UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

53 lines (52 loc) 2.37 kB
import { IntegrationId, IntegrationInfo, IntegrationType } from './public-types'; /** * IntegrationClient manages integrations within an application, * providing methods for listing, retrieving, updating, and deleting integrations. * @category Platform */ export declare class IntegrationClient { private readonly rpcManager; private readonly iacBaseUrl; /** * Lists all integrations for the current application. * * @param type - (Optional) Filter by integration type. * @returns A promise that resolves with a list of integrations. */ list<ConfigurationType = Record<string, any>>(type?: IntegrationType): Promise<Array<IntegrationInfo<ConfigurationType>>>; /** * Retrieves the integration by its ID. * * @param integrationId - The ID of the integration to retrieve. * @returns A promise that resolves with the integration info, or `undefined` if not found. */ get<ConfigurationType = Record<string, any>>(integrationId: IntegrationId): Promise<IntegrationInfo<ConfigurationType> | undefined>; /** * Retrieves the integration's schema by its ID. * * @param integrationId - The ID of the integration to retrieve. * @returns A promise that resolves with the integration schema, or `undefined` if not found. */ getIntegrationSchema<ConfigurationType = Record<string, any>>(integrationId: IntegrationId): Promise<IntegrationInfo<ConfigurationType> | undefined>; /** * Deletes the integration with the given ID. * * @param integrationId - The ID of the integration to delete. * @returns A promise that resolves when the integration has been deleted. */ delete(integrationId: IntegrationId): Promise<void>; /** * Deletes multiple integrations by their IDs. * * @param integrationIds - An array of integration IDs to delete. * @returns A promise that resolves when all deletions are complete. */ deleteMany(integrationIds: Array<IntegrationId>): Promise<void>; /** * Creates or updates an integration. * * @param integration - The integration information to upsert. * @returns A promise that resolves when the operation is complete. */ upsertIntegration<ConfigurationType = Record<string, any>>(integration: IntegrationInfo<ConfigurationType>): Promise<void>; }