UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

31 lines (30 loc) 1.22 kB
import { ApiOptions } from '../public-types/api-client.public-types'; import { ApiEndpointId, HttpMethod } from '../public-types/api.public-types'; import { IntegrationId } from '../public-types/communication.public-types'; /** The headers of an API call. */ export type ApiHeaders = Record<string, string | number | boolean>; /** The context of an API call. */ export declare class ApiCallContext { readonly integrationId: IntegrationId; readonly endpointId: ApiEndpointId; readonly url: string; readonly method: HttpMethod; readonly body: unknown; readonly options: ApiOptions; } /** * Represents a request to call an API through a specified integration and endpoint. * Includes optional method override and additional request options. */ export interface CallApiRequest<BodyType = any> { /** The identifier of the integration through which the API is called. */ integrationId: IntegrationId; /** Target API endpoint to invoke. */ endpointId: ApiEndpointId; /** Optional request payload. */ body?: BodyType; /** Optional HTTP method override. Default is POST. */ overrideMethod?: HttpMethod; /** Additional request options. */ options: ApiOptions; }