import * as z from "zod"; import type { IntegrationScopeRequirement, ResolvedIntegrationAccount } from "../../../automation/integrations.js"; /** Scalar or repeated value serialized into Apollo query parameters. */ export type ApolloQueryValue = boolean | number | readonly (boolean | number | string)[] | string | undefined; /** Options for one authenticated Apollo REST request. */ export interface ApolloRequestOptions { /** Provider-native JSON request body. */ body?: unknown; /** Additional request headers. Apollo authentication is always overridden. */ headers?: ConstructorParameters[0]; /** HTTP method. Defaults to `POST` when a body is present and `GET` otherwise. */ method?: "DELETE" | "GET" | "PATCH" | "POST" | "PUT"; /** Provider-native query parameters. Arrays become repeated parameters. */ query?: Record; /** Schema that validates and types the successful response. */ responseSchema: TSchema; } /** Authenticated Apollo REST API helper for custom actions. */ export interface ApolloApi { /** * Calls an Apollo v1 endpoint and validates its successful response. * * @param path - Relative path below Apollo's `/api/v1` root. * @param options - Request data and successful response schema. */ request(path: string, options: ApolloRequestOptions): Promise>; } /** Structured error returned by an Apollo API request. */ export declare class ApolloApiError extends Error { /** Provider-specific error code, when supplied. */ readonly providerCode?: number | string; /** Provider error message, when supplied. */ readonly providerMessage?: string; /** Retry delay reported by Apollo, in seconds. */ readonly retryAfter?: number; /** HTTP status returned by Apollo. */ readonly status: number; /** * Creates a structured Apollo API error. * * @param options - Provider and transport error details. * @param options.providerCode - Provider-specific error code. * @param options.providerMessage - Provider error message. * @param options.retryAfter - Retry delay in seconds. * @param options.status - HTTP response status. */ constructor(options: { providerCode?: number | string; providerMessage?: string; retryAfter?: number; status: number; }); } /** * Allows an Apollo action through OAuth with its required scope or an API key. * * @param requiredScope - OAuth scope requirement for the action. */ export declare function apolloAccountOptions(requiredScope: IntegrationScopeRequirement): { readonly connections: readonly [{ readonly connectionMethodId: "oauth"; readonly requiredScope: IntegrationScopeRequirement; }, { readonly connectionMethodId: "api-key"; }]; }; /** Allows an Apollo action only through an API key. */ export declare function apolloApiKeyAccountOptions(): { readonly connections: readonly [{ readonly connectionMethodId: "api-key"; }]; }; /** * Converts provider-native Apollo response keys to camelCase recursively. * * @param value - Provider response value. */ export declare function fromApolloWire(value: unknown): unknown; /** * Creates a raw authenticated Apollo REST API helper. * * Use this escape hatch for endpoints without packaged actions. Callers supply * a response schema so provider results remain validated at the boundary. * * @param account - Resolved Apollo integration account. * @throws {Error} When the account uses an unsupported connection method. */ export declare function getApolloApi(account: ResolvedIntegrationAccount<"apollo">): ApolloApi; //# sourceMappingURL=api.d.ts.map