/** * Integration declaration functions and types. * * This module provides declaration functions for specifying integrations * upfront in the API config. This enables: * - Single declaration of integration IDs * - Full type safety on ctx.integrations * - Upfront authentication before API execution * * @example * ```typescript * import { api, z, postgres, slack } from '@superblocksteam/sdk-api'; * * // Store integration IDs in constants with descriptive names * const PROD_POSTGRES = 'a1b2c3d4-uuid'; * const OPS_SLACK = 'e5f6g7h8-uuid'; * * export default api({ * integrations: { * pg: postgres(PROD_POSTGRES), * notifier: slack(OPS_SLACK), * }, * input: z.object({ userId: z.string() }), * output: z.object({ name: z.string() }), * async run(ctx) { * const users = await ctx.integrations.pg.query(...); * await ctx.integrations.notifier.apiRequest(...); * return { name: users[0].name }; * }, * }); * ``` */ import type { AirtableClient } from "./airtable/index.js"; import type { AnthropicClient } from "./anthropic/index.js"; import type { AsanaClient } from "./asana/index.js"; import type { AthenaClient } from "./athena/index.js"; import type { BigQueryClient } from "./bigquery/index.js"; import type { BitbucketClient } from "./bitbucket/index.js"; import type { BoxClient } from "./box/index.js"; import type { CircleCIClient } from "./circleci/index.js"; import type { CockroachDBClient } from "./cockroachdb/index.js"; import type { CohereClient } from "./cohere/index.js"; import type { ConfluenceClient } from "./confluence/index.js"; import type { CosmosDBClient } from "./cosmosdb/index.js"; import type { DatabricksClient } from "./databricks/index.js"; import type { DatadogClient } from "./datadog/index.js"; import type { DropboxClient } from "./dropbox/index.js"; import type { DynamoDBClient } from "./dynamodb/index.js"; import type { ElasticSearchClient } from "./elasticsearch/index.js"; import type { FireworksClient } from "./fireworks/index.js"; import type { FrontClient } from "./front/index.js"; import type { GCSClient } from "./gcs/index.js"; import type { GeminiClient } from "./gemini/index.js"; import type { GitHubClient } from "./github/index.js"; import type { GoogleAnalyticsClient } from "./googleanalytics/index.js"; import type { GoogleDriveClient } from "./googledrive/index.js"; import type { GraphQLClient } from "./graphql/index.js"; import type { GroqClient } from "./groq/index.js"; import type { GoogleSheetsClient } from "./gsheets/index.js"; import type { HubSpotClient } from "./hubspot/index.js"; import type { IntercomClient } from "./intercom/index.js"; import type { JiraClient } from "./jira/index.js"; import type { LakebaseClient } from "./lakebase/index.js"; import type { LaunchDarklyClient } from "./launchdarkly/index.js"; import type { MariaDBClient } from "./mariadb/index.js"; import type { MistralClient } from "./mistral/index.js"; import type { MongoDBClient } from "./mongodb/index.js"; import type { MSSQLClient } from "./mssql/index.js"; import type { MySQLClient } from "./mysql/index.js"; import type { NotionClient } from "./notion/index.js"; import type { OpenAIClient } from "./openai_v2/index.js"; import type { OracleDBClient } from "./oracledb/index.js"; import type { PagerDutyClient } from "./pagerduty/index.js"; import type { PerplexityClient } from "./perplexity/index.js"; import type { PostgresClient } from "./postgres/index.js"; import type { RedshiftClient } from "./redshift/index.js"; import type { RestApiIntegrationPluginClient } from "./restapiintegration/index.js"; import type { S3Client } from "./s3/index.js"; import type { SalesforceClient } from "./salesforce/index.js"; import type { SegmentClient } from "./segment/index.js"; import type { SendGridClient } from "./sendgrid/index.js"; import type { SlackClient } from "./slack/index.js"; import type { SmtpClient } from "./smtp/index.js"; import type { SnowflakeClient } from "./snowflake/index.js"; import type { SnowflakeCortexClient } from "./snowflakecortex/index.js"; import type { SnowflakePostgresClient } from "./snowflakepostgres/index.js"; import type { StabilityAIClient } from "./stabilityai/index.js"; import type { StripeClient } from "./stripe/index.js"; import type { SuperblocksOCRClient } from "./superblocks-ocr/index.js"; import type { TwilioClient } from "./twilio/index.js"; import type { ZendeskClient } from "./zendesk/index.js"; import type { ZoomClient } from "./zoom/index.js"; /** * Base type for all integration references. * * An IntegrationRef represents a declared integration that will be available * at runtime via `ctx.integrations`. The TClient type parameter enables * type inference for the actual client type. * * @template TPluginId - The plugin type identifier (e.g., 'postgres', 'slack') * @template TClient - The client interface type (e.g., PostgresClient) */ export interface IntegrationRef { /** The plugin type identifier */ readonly pluginId: TPluginId; /** The integration ID (UUID) */ readonly id: string; /** * Phantom type marker for client inference. * This is never used at runtime - it exists purely for TypeScript * to infer the correct client type. */ readonly __clientType?: TClient; } /** * Rejects the broad `string` type while still accepting string literal types. * This keeps integration IDs statically analyzable by the build pipeline. */ type LiteralString = string extends T ? never : T; /** Reference to a PostgreSQL integration */ export type PostgresRef = IntegrationRef<"postgres", PostgresClient>; /** Reference to a Slack integration */ export type SlackRef = IntegrationRef<"slack", SlackClient>; /** Reference to an OpenAI integration */ export type OpenAIRef = IntegrationRef<"openai_v2", OpenAIClient>; /** Reference to an Anthropic integration */ export type AnthropicRef = IntegrationRef<"anthropic", AnthropicClient>; /** Reference to a Stripe integration */ export type StripeRef = IntegrationRef<"stripe", StripeClient>; /** Reference to a GitHub integration */ export type GitHubRef = IntegrationRef<"github", GitHubClient>; /** Reference to a Notion integration */ export type NotionRef = IntegrationRef<"notion", NotionClient>; /** Reference to a Snowflake integration */ export type SnowflakeRef = IntegrationRef<"snowflake", SnowflakeClient>; /** Reference to a Snowflake Cortex integration */ export type SnowflakeCortexRef = IntegrationRef<"snowflakecortex", SnowflakeCortexClient>; /** Reference to an Airtable integration */ export type AirtableRef = IntegrationRef<"airtable", AirtableClient>; /** Reference to an Asana integration */ export type AsanaRef = IntegrationRef<"asana", AsanaClient>; /** Reference to a Bitbucket integration */ export type BitbucketRef = IntegrationRef<"bitbucket", BitbucketClient>; /** Reference to a Box integration */ export type BoxRef = IntegrationRef<"box", BoxClient>; /** Reference to a CircleCI integration */ export type CircleCIRef = IntegrationRef<"circleci", CircleCIClient>; /** Reference to a Cohere integration */ export type CohereRef = IntegrationRef<"cohere", CohereClient>; /** Reference to a Confluence integration */ export type ConfluenceRef = IntegrationRef<"confluence", ConfluenceClient>; /** Reference to a Datadog integration */ export type DatadogRef = IntegrationRef<"datadog", DatadogClient>; /** Reference to a Dropbox integration */ export type DropboxRef = IntegrationRef<"dropbox", DropboxClient>; /** Reference to an ElasticSearch integration */ export type ElasticSearchRef = IntegrationRef<"elasticsearch", ElasticSearchClient>; /** Reference to a Fireworks integration */ export type FireworksRef = IntegrationRef<"fireworks", FireworksClient>; /** Reference to a Front integration */ export type FrontRef = IntegrationRef<"front", FrontClient>; /** Reference to a Gemini integration */ export type GeminiRef = IntegrationRef<"gemini", GeminiClient>; /** Reference to a Google Analytics integration */ export type GoogleAnalyticsRef = IntegrationRef<"googleanalytics", GoogleAnalyticsClient>; /** Reference to a Google Drive integration */ export type GoogleDriveRef = IntegrationRef<"googledrive", GoogleDriveClient>; /** Reference to a Groq integration */ export type GroqRef = IntegrationRef<"groq", GroqClient>; /** Reference to a HubSpot integration */ export type HubSpotRef = IntegrationRef<"hubspot", HubSpotClient>; /** Reference to an Intercom integration */ export type IntercomRef = IntegrationRef<"intercom", IntercomClient>; /** Reference to a Jira integration */ export type JiraRef = IntegrationRef<"jira", JiraClient>; /** Reference to a LaunchDarkly integration */ export type LaunchDarklyRef = IntegrationRef<"launchdarkly", LaunchDarklyClient>; /** Reference to a Mistral integration */ export type MistralRef = IntegrationRef<"mistral", MistralClient>; /** Reference to a PagerDuty integration */ export type PagerDutyRef = IntegrationRef<"pagerduty", PagerDutyClient>; /** Reference to a Perplexity integration */ export type PerplexityRef = IntegrationRef<"perplexity", PerplexityClient>; /** Reference to a Segment integration */ export type SegmentRef = IntegrationRef<"segment", SegmentClient>; /** Reference to a SendGrid integration */ export type SendGridRef = IntegrationRef<"sendgrid", SendGridClient>; /** Reference to a StabilityAI integration */ export type StabilityAIRef = IntegrationRef<"stabilityai", StabilityAIClient>; /** Reference to a Twilio integration */ export type TwilioRef = IntegrationRef<"twilio", TwilioClient>; /** Reference to a Zendesk integration */ export type ZendeskRef = IntegrationRef<"zendesk", ZendeskClient>; /** Reference to a Zoom integration */ export type ZoomRef = IntegrationRef<"zoom", ZoomClient>; /** Reference to a GraphQL integration */ export type GraphQLRef = IntegrationRef<"graphqlintegration", GraphQLClient>; /** Reference to a MySQL integration */ export type MySQLRef = IntegrationRef<"mysql", MySQLClient>; /** Reference to a MariaDB integration */ export type MariaDBRef = IntegrationRef<"mariadb", MariaDBClient>; /** Reference to a MSSQL integration */ export type MSSQLRef = IntegrationRef<"mssql", MSSQLClient>; /** Reference to a CockroachDB integration */ export type CockroachDBRef = IntegrationRef<"cockroachdb", CockroachDBClient>; /** Reference to an OracleDB integration */ export type OracleDBRef = IntegrationRef<"oracledb", OracleDBClient>; /** Reference to a Redshift integration */ export type RedshiftRef = IntegrationRef<"redshift", RedshiftClient>; /** Reference to an Athena integration */ export type AthenaRef = IntegrationRef<"athena", AthenaClient>; /** Reference to a Databricks integration */ export type DatabricksRef = IntegrationRef<"databricks", DatabricksClient>; /** Reference to a BigQuery integration */ export type BigQueryRef = IntegrationRef<"bigquery", BigQueryClient>; /** Reference to a MongoDB integration */ export type MongoDBRef = IntegrationRef<"mongodb", MongoDBClient>; /** Reference to a DynamoDB integration */ export type DynamoDBRef = IntegrationRef<"dynamodb", DynamoDBClient>; /** Reference to a CosmosDB integration */ export type CosmosDBRef = IntegrationRef<"cosmosdb", CosmosDBClient>; /** Reference to an S3 integration */ export type S3Ref = IntegrationRef<"s3", S3Client>; /** Reference to a GCS integration */ export type GCSRef = IntegrationRef<"gcs", GCSClient>; /** Reference to a Google Sheets integration */ export type GoogleSheetsRef = IntegrationRef<"gsheets", GoogleSheetsClient>; /** Reference to a Salesforce integration */ export type SalesforceRef = IntegrationRef<"salesforce", SalesforceClient>; /** Reference to a Superblocks OCR integration */ export type SuperblocksOCRRef = IntegrationRef<"superblocks-ocr", SuperblocksOCRClient>; /** Reference to a Lakebase integration */ export type LakebaseRef = IntegrationRef<"lakebase", LakebaseClient>; /** Reference to a Snowflake Postgres integration */ export type SnowflakePostgresRef = IntegrationRef<"snowflakepostgres", SnowflakePostgresClient>; /** Reference to an SMTP integration */ export type SmtpRef = IntegrationRef<"smtp", SmtpClient>; /** Reference to a REST API Integration */ export type RestApiIntegrationRef = IntegrationRef<"restapiintegration", RestApiIntegrationPluginClient>; /** * Declare a PostgreSQL integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config * * @example * ```typescript * import { api, z, postgres } from '@superblocksteam/sdk-api'; * * const PROD_POSTGRES = 'a1b2c3d4-uuid'; * * export default api({ * integrations: { * db: postgres(PROD_POSTGRES), * }, * input: z.object({ userId: z.string() }), * output: z.object({ name: z.string() }), * async run(ctx, { userId }) { * const users = await ctx.integrations.db.query( * 'SELECT * FROM users WHERE id = $1', * z.object({ id: z.string(), name: z.string() }), * [userId] * ); * return { name: users[0].name }; * }, * }); * ``` */ export declare function postgres(id: LiteralString): PostgresRef; /** * Declare a Slack integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config * * @example * ```typescript * import { api, z, slack } from '@superblocksteam/sdk-api'; * * const OPS_SLACK = 'e5f6g7h8-uuid'; * * export default api({ * integrations: { * notifier: slack(OPS_SLACK), * }, * input: z.object({ message: z.string() }), * output: z.object({ sent: z.boolean() }), * async run(ctx, { message }) { * await ctx.integrations.notifier.apiRequest( * { method: 'POST', path: '/chat.postMessage', body: { channel: '#alerts', text: message } }, * { response: z.object({ ok: z.boolean() }) } * ); * return { sent: true }; * }, * }); * ``` */ export declare function slack(id: LiteralString): SlackRef; /** * Declare an OpenAI integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function openai(id: LiteralString): OpenAIRef; /** * Declare an Anthropic integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function anthropic(id: LiteralString): AnthropicRef; /** * Declare a Stripe integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function stripe(id: LiteralString): StripeRef; /** * Declare a GitHub integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function github(id: LiteralString): GitHubRef; /** * Declare a Notion integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function notion(id: LiteralString): NotionRef; /** * Declare a Snowflake integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function snowflake(id: LiteralString): SnowflakeRef; /** * Declare a Snowflake Cortex integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function snowflakeCortex(id: LiteralString): SnowflakeCortexRef; /** * Declare an Airtable integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function airtable(id: LiteralString): AirtableRef; /** * Declare an Asana integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function asana(id: LiteralString): AsanaRef; /** * Declare a Bitbucket integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function bitbucket(id: LiteralString): BitbucketRef; /** * Declare a Box integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function box(id: LiteralString): BoxRef; /** * Declare a CircleCI integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function circleci(id: LiteralString): CircleCIRef; /** * Declare a Cohere integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function cohere(id: LiteralString): CohereRef; /** * Declare a Confluence integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function confluence(id: LiteralString): ConfluenceRef; /** * Declare a Datadog integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function datadog(id: LiteralString): DatadogRef; /** * Declare a Dropbox integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function dropbox(id: LiteralString): DropboxRef; /** * Declare an ElasticSearch integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function elasticsearch(id: LiteralString): ElasticSearchRef; /** * Declare a Fireworks integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function fireworks(id: LiteralString): FireworksRef; /** * Declare a Front integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function front(id: LiteralString): FrontRef; /** * Declare a Gemini integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function gemini(id: LiteralString): GeminiRef; /** * Declare a Google Analytics integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function googleAnalytics(id: LiteralString): GoogleAnalyticsRef; /** * Declare a Google Drive integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function googleDrive(id: LiteralString): GoogleDriveRef; /** * Declare a Groq integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function groq(id: LiteralString): GroqRef; /** * Declare a HubSpot integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function hubspot(id: LiteralString): HubSpotRef; /** * Declare an Intercom integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function intercom(id: LiteralString): IntercomRef; /** * Declare a Jira integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function jira(id: LiteralString): JiraRef; /** * Declare a LaunchDarkly integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function launchDarkly(id: LiteralString): LaunchDarklyRef; /** * Declare a Mistral integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function mistral(id: LiteralString): MistralRef; /** * Declare a PagerDuty integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function pagerDuty(id: LiteralString): PagerDutyRef; /** * Declare a Perplexity integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function perplexity(id: LiteralString): PerplexityRef; /** * Declare a Segment integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function segment(id: LiteralString): SegmentRef; /** * Declare a SendGrid integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function sendGrid(id: LiteralString): SendGridRef; /** * Declare a StabilityAI integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function stabilityAI(id: LiteralString): StabilityAIRef; /** * Declare a Twilio integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function twilio(id: LiteralString): TwilioRef; /** * Declare a Zendesk integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function zendesk(id: LiteralString): ZendeskRef; /** * Declare a Zoom integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function zoom(id: LiteralString): ZoomRef; /** * Declare a GraphQL integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function graphql(id: LiteralString): GraphQLRef; /** * Declare a MySQL integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function mysql(id: LiteralString): MySQLRef; /** * Declare a MariaDB integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function mariadb(id: LiteralString): MariaDBRef; /** * Declare a MSSQL integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function mssql(id: LiteralString): MSSQLRef; /** * Declare a CockroachDB integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function cockroachdb(id: LiteralString): CockroachDBRef; /** * Declare an OracleDB integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function oracledb(id: LiteralString): OracleDBRef; /** * Declare a Redshift integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function redshift(id: LiteralString): RedshiftRef; /** * Declare an Athena integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function athena(id: LiteralString): AthenaRef; /** * Declare a Databricks integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function databricks(id: LiteralString): DatabricksRef; /** * Declare a BigQuery integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function bigquery(id: LiteralString): BigQueryRef; /** * Declare a MongoDB integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function mongodb(id: LiteralString): MongoDBRef; /** * Declare a DynamoDB integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function dynamodb(id: LiteralString): DynamoDBRef; /** * Declare a CosmosDB integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function cosmosdb(id: LiteralString): CosmosDBRef; /** * Declare an S3 integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function s3(id: LiteralString): S3Ref; /** * Declare a GCS (Google Cloud Storage) integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function gcs(id: LiteralString): GCSRef; /** * Declare a Google Sheets integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function googleSheets(id: LiteralString): GoogleSheetsRef; /** * Declare a Salesforce integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function salesforce(id: LiteralString): SalesforceRef; /** * Declare a Superblocks OCR integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function superblocksOcr(id: LiteralString): SuperblocksOCRRef; /** * Declare a Lakebase integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function lakebase(id: LiteralString): LakebaseRef; /** * Declare a Snowflake Postgres integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function snowflakePostgres(id: LiteralString): SnowflakePostgresRef; /** * Declare an SMTP integration. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config */ export declare function smtp(id: LiteralString): SmtpRef; /** * Declare a REST API Integration. * * Use this for REST API Integrations configured with a base URL and * authentication in the integrations page. * * @param id - The integration ID (UUID) * @returns An integration reference for use in the API config * * @example * ```typescript * import { api, z, restApiIntegration } from '@superblocksteam/sdk-api'; * * const MY_API = 'a1b2c3d4-uuid'; * * export default api({ * integrations: { * myApi: restApiIntegration(MY_API), * }, * output: z.object({ users: z.array(z.unknown()) }), * async run(ctx) { * const users = await ctx.integrations.myApi.apiRequest( * { method: 'GET', path: '/users' }, * { response: z.object({ users: z.array(z.unknown()) }) }, * ); * return users; * }, * }); * ``` */ export declare function restApiIntegration(id: LiteralString): RestApiIntegrationRef; /** * Union of all possible integration reference types. */ export type AnyIntegrationRef = IntegrationRef; /** * Extract the client type from an integration reference. * * @example * ```typescript * type PgClient = ClientFromRef; // PostgresClient * ``` */ export type ClientFromRef = T extends IntegrationRef ? C : never; /** * Map of integration keys to their client types. * * This type transforms a record of integration references into a record * of their corresponding client types, enabling type-safe access via * `ctx.integrations`. * * @example * ```typescript * type Integrations = IntegrationsMap<{ * pg: PostgresRef; * notifier: SlackRef; * }>; * // => { pg: PostgresClient; notifier: SlackClient } * ``` */ export type IntegrationsMap> = { [K in keyof T]: ClientFromRef; }; /** * Serialized integration declaration for runtime use. * * This is the format used by CompiledApi.integrations to list declared * integrations for upfront authentication. */ export interface IntegrationDeclaration { /** User-defined key in the integrations object */ readonly key: string; /** The plugin type identifier */ readonly pluginId: string; /** The integration ID (UUID) */ readonly id: string; } /** * Extract integration declarations from an integrations config object. * * @param integrations - The integrations object from ApiConfig * @returns Array of integration declarations for runtime use */ export declare function extractIntegrationDeclarations(integrations: Record | undefined): IntegrationDeclaration[]; /** * Get integration declarations from an API object. * * Handles APIs from different sources: * - CompiledApi from api(): integrations is already IntegrationDeclaration[] * - Bundle output: integrations may be undefined (tree-shaken or omitted) * - Raw config object: integrations is Record * * @param api - API object with optional integrations field * @returns Array of integration declarations for runtime use */ export declare function getIntegrationDeclarations(api: { integrations?: unknown; }): IntegrationDeclaration[]; export {}; //# sourceMappingURL=declarations.d.ts.map