/** * REST API Integration client types. */ import type { BaseIntegrationClient } from "../../types.js"; import type { SupportsApiRequest } from "../base/index.js"; /** * REST API Integration client for making HTTP requests to configured endpoints. * * This is the generic REST API Integration plugin. Use apiRequest() to make * HTTP calls to any endpoint configured on the integration (base URL, auth, etc.). * * @example * ```typescript * // Declare in api(): integrations: { myApi: restApiIntegration(INTEGRATION_ID) } * // In run(), access via: ctx.integrations.myApi * * const ResponseSchema = z.object({ * data: z.array(z.object({ id: z.string(), name: z.string() })), * }); * * const result = await ctx.integrations.myApi.apiRequest( * { * method: 'GET', * path: '/users', * params: { limit: 10 }, * }, * { response: ResponseSchema }, * ); * ``` */ export interface RestApiIntegrationPluginClient extends BaseIntegrationClient, SupportsApiRequest {}