UNPKG

@cumulus/api-client

Version:

API client for working with the Cumulus archive API

71 lines 3.13 kB
import { ApiGatewayLambdaHttpProxyResponse, InvokeApiFunction } from './types'; /** * Create a provider via the API * * @param {Object} params - params * @param {string} params.prefix - the prefix configured for the stack * @param {string} params.provider - provider object * @param {Function} params.callback - function to invoke the api lambda * that takes a prefix / user payload * @returns {Promise<Object>} - promise that resolves to the output of the callback */ export declare const createProvider: (params: { prefix: string; provider: string; callback?: InvokeApiFunction; }) => Promise<ApiGatewayLambdaHttpProxyResponse>; /** * Delete a provider from the Cumulus API * * @param {Object} params - params * @param {string} params.prefix - the prefix configured for the stack * @param {string} params.providerId - a provider id * @param {Function} params.callback - async function to invoke the api lambda * that takes a prefix / user payload. Defaults * to cumulusApiClient.invokeApi * @returns {Promise<Object>} - promise that resolves to the output * of the callback */ export declare const deleteProvider: (params: { prefix: string; providerId: string; expectedStatusCodes: number[]; callback?: InvokeApiFunction; }) => Promise<ApiGatewayLambdaHttpProxyResponse>; /** * Fetch a provider from the Cumulus API * * @param {Object} params - params * @param {string} params.prefix - the prefix configured for the stack * @param {string} params.providerId - a provider id * @param {Function} params.callback - async function to invoke the api lambda * that takes a prefix / user payload. Defaults * to cumulusApiClient.invokeApi * @returns {Promise<Object>} - promise that resolves to the output * of the API lambda */ export declare const getProvider: (params: { prefix: string; providerId: string; callback?: InvokeApiFunction; }) => Promise<ApiGatewayLambdaHttpProxyResponse>; /** * Fetch a list of providers from the Cumulus API * * @param {Object} params - params * @param {string} params.prefix - the prefix configured for the stack * @param {Object} [params.queryStringParameters] - query string parameters to * include in the request * @param {Function} [params.callback=invokeApi] - async function to invoke the * api lambda that takes a prefix / user payload. * @returns {Promise<Object>} - the list of providers fetched by the API */ export declare const getProviders: (params: { prefix: string; queryStringParameters?: { [key: string]: string | string[] | undefined; fields?: string[] | undefined; } | undefined; callback?: InvokeApiFunction | undefined; }) => Promise<ApiGatewayLambdaHttpProxyResponse>; //# sourceMappingURL=providers.d.ts.map