import * as zod from 'zod'; import { z } from 'zod'; import { ConnectionSchema, ConnectionsResponseSchema } from '@zapier/zapier-sdk-core/v0/schemas/connections'; import { RequestContext } from '@zapier/policy-context'; import * as zod_v4_core from 'zod/v4/core'; import { AppItem as AppItem$1 } from '@zapier/zapier-sdk-core/v0/schemas/apps'; import * as _zapier_zapier_sdk_cli_login from '@zapier/zapier-sdk-cli/login'; declare const AppKeyPropertySchema: z.ZodString & { _def: z.core.$ZodStringDef & PositionalMetadata; }; declare const AppPropertySchema: z.ZodString & { _def: z.core.$ZodStringDef & PositionalMetadata; }; declare const ActionTypePropertySchema: z.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; declare const ActionKeyPropertySchema: z.ZodString; declare const ActionPropertySchema: z.ZodString & { _def: z.core.$ZodStringDef & PositionalMetadata; }; declare const InputFieldPropertySchema: z.ZodString & { _def: z.core.$ZodStringDef & PositionalMetadata; }; declare const ConnectionIdPropertySchema: z.ZodUnion; /** @deprecated Use ConnectionIdPropertySchema instead */ declare const AuthenticationIdPropertySchema: z.ZodUnion; declare const ConnectionPropertySchema: z.ZodUnion; declare const InputsPropertySchema: z.ZodRecord; declare const LimitPropertySchema: z.ZodDefault; declare const OffsetPropertySchema: z.ZodDefault; declare const OutputPropertySchema: z.ZodString; declare const DebugPropertySchema: z.ZodDefault; declare const ParamsPropertySchema: z.ZodRecord; declare const ActionTimeoutMsPropertySchema: z.ZodOptional; declare const TablePropertySchema: z.ZodString & { _def: z.core.$ZodStringDef & PositionalMetadata; }; declare const RecordPropertySchema: z.ZodString & { _def: z.core.$ZodStringDef & PositionalMetadata; }; declare const RecordsPropertySchema: z.ZodArray; declare const FieldsPropertySchema: z.ZodArray>; declare const AppsPropertySchema: z.ZodArray; declare const TablesPropertySchema: z.ZodArray; declare const ConnectionsPropertySchema: z.ZodArray; declare const TriggerInboxPropertySchema: z.ZodString & { _def: z.core.$ZodStringDef & PositionalMetadata; }; declare const TriggerInboxNamePropertySchema: z.ZodString; declare const LeasePropertySchema: z.ZodString; declare const LeaseSecondsPropertySchema: z.ZodNumber; declare const LeaseLimitPropertySchema: z.ZodNumber; type AppKeyProperty = z.infer; type AppProperty = z.infer; type ActionTypeProperty = z.infer; type ActionKeyProperty = z.infer; type ActionProperty = z.infer; type InputFieldProperty = z.infer; type ConnectionIdProperty = z.infer; type ConnectionProperty = z.infer; /** @deprecated Use ConnectionIdProperty instead */ type AuthenticationIdProperty = ConnectionIdProperty; type InputsProperty = z.infer; type LimitProperty = z.infer; type OffsetProperty = z.infer; type OutputProperty = z.infer; type DebugProperty = z.infer; type ParamsProperty = z.infer; type ActionTimeoutMsProperty = z.infer; type TableProperty = z.infer; type RecordProperty = z.infer; type RecordsProperty = z.infer; type FieldsProperty = z.infer; type AppsProperty = z.infer; type TablesProperty = z.infer; type ConnectionsProperty = z.infer; type TriggerInboxProperty = z.infer; type TriggerInboxNameProperty = z.infer; type LeaseProperty = z.infer; type LeaseSecondsProperty = z.infer; type LeaseLimitProperty = z.infer; declare const ActionExecutionInputSchema: z.ZodObject<{ inputs: z.ZodOptional>; connectionId: z.ZodOptional>; connection: z.ZodOptional>; authenticationId: z.ZodOptional>; timeoutMs: z.ZodOptional; }, z.core.$strip>; type ActionExecutionOptions = z.infer; declare const AppFactoryInputSchema: z.ZodObject<{ connectionId: z.ZodOptional>; connection: z.ZodOptional>; authenticationId: z.ZodOptional>; }, z.core.$strip>; type AppFactoryInput = z.infer; interface BaseActionTypeProxy { [action: string]: (options?: ActionExecutionOptions) => Promise<{ data: any[]; nextCursor?: string; }> & AsyncIterable<{ data: any[]; nextCursor?: string; }> & { items(): AsyncIterable; }; } type ActionTypeProxy = BaseActionTypeProxy; type AppFetchFn = (url: string | URL, init?: RequestInit & { /** @deprecated Use `connection` instead. */ connectionId?: ConnectionIdProperty; connection?: ConnectionProperty; /** @deprecated Use `connection` instead. */ authenticationId?: AuthenticationIdProperty; callbackUrl?: string; }) => Promise; type AppProxy = { [type: string]: ActionTypeProxy; } & { fetch: AppFetchFn; }; interface AppFactory { (options: AppFactoryInput): AppProxy; } type AppProxyWithFactory = AppFactory & AppProxy; interface ActionProxy { [app: string]: AppProxyWithFactory; } /** * SDK Event System * * This module provides common event type definitions for the SDK's * event system, including authentication, API, and loading events. */ interface SdkEvent { type: string; payload?: Record; timestamp?: number; } interface AuthEvent extends SdkEvent { type: "auth_refreshing" | "auth_success" | "auth_error" | "auth_logout"; payload?: { message?: string; error?: string; operation?: string; }; } interface ApiEvent extends SdkEvent { type: "api_request" | "api_response" | "api_error"; payload?: { url?: string; method?: string; status?: number; duration?: number; error?: string; }; } interface LoadingEvent extends SdkEvent { type: "loading_start" | "loading_end"; payload?: { operation?: string; resource?: string; }; } type EventCallback = (event: SdkEvent) => void; /** * Credentials type definitions * * The credentials system provides a unified way to authenticate with Zapier APIs. * It supports multiple credential types: * - String: A token (JWT or API key) used directly * - Client credentials: OAuth client ID + secret exchanged for a token * - PKCE: OAuth client ID for interactive login (CLI only) * - Function: Lazy/dynamic credential resolution */ /** * Client credentials for OAuth client_credentials flow. * The SDK will exchange these for an access token. */ declare const ClientCredentialsObjectSchema: z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>; type ClientCredentialsObject = z.infer; /** * PKCE credentials for interactive OAuth flow. * Only works when @zapier/zapier-sdk-cli is installed (the SDK dynamically * imports its `./login` entry point). */ declare const PkceCredentialsObjectSchema: z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>; type PkceCredentialsObject = z.infer; /** * Union of all credential object types. */ declare const CredentialsObjectSchema: z.ZodUnion>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>; type CredentialsObject = z.infer; /** * Resolved credentials - what a credentials function must return. * Either a string (token) or a credentials object. * Functions are not allowed to return other functions. */ declare const ResolvedCredentialsSchema: z.ZodUnion>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>; type ResolvedCredentials = z.infer; /** * Lazy/dynamic credential resolution — a function returning resolved credentials. */ declare const CredentialsFunctionSchema: z.ZodFunction, z.ZodUnion>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>, z.ZodPromise>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>>]>>; type CredentialsFunction = z.infer; /** * Credentials can be: * - A string (token or API key) * - A credentials object (client_credentials or pkce) * - A function that returns credentials (sync or async) */ declare const CredentialsSchema: z.ZodUnion>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>, z.ZodFunction, z.ZodUnion>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>, z.ZodPromise>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>>]>>]>; type Credentials = z.infer; /** * Type guard for client credentials objects. */ declare function isClientCredentials(credentials: ResolvedCredentials): credentials is ClientCredentialsObject; /** * Type guard for PKCE credentials objects. */ declare function isPkceCredentials(credentials: ResolvedCredentials): credentials is PkceCredentialsObject; /** * Type guard for credentials objects (either type). */ declare function isCredentialsObject(credentials: ResolvedCredentials): credentials is CredentialsObject; /** * Type guard for credentials functions. */ declare function isCredentialsFunction(credentials: Credentials): credentials is CredentialsFunction; /** * Best-effort cache for the SDK. * * The SDK uses this to avoid re-fetching values it can recreate, primarily * client_credentials access tokens. Cache entries may disappear at any time: * a miss is normal and callers must be able to rebuild the value. * * The default cache is in-memory. When the CLI package is installed, the SDK * can opportunistically use its filesystem + keychain cache. Browser and * minimal server deployments fall back to memory unless a caller injects a * Redis, database, or environment-specific cache. * * Secrets: adapters receive a `secret: true` flag on `set` and decide * what to do with it (keychain for the filesystem adapter; ignored for * the in-memory adapter; user adapters can throw, plaintext, encrypt — * their call). The value returned by `get` is always the plain secret. */ interface ZapierCacheEntry { value: string; /** Millisecond epoch. Undefined means "no expiration recorded." */ expiresAt?: number; } interface ZapierCacheSetOptions { /** * Hint that this value is sensitive. Adapters may use a more secure * backend (e.g. the OS keychain for the filesystem adapter); adapters * without a secure backend may throw, warn, or accept — their call. */ secret?: boolean; /** Time-to-live in seconds from now. */ ttl?: number; } interface ZapierCache { get(key: string): Promise; set(key: string, value: string, options?: ZapierCacheSetOptions): Promise; delete(key: string): Promise; /** * Optional mutex for caches that can coordinate beyond one JavaScript * process. The SDK re-checks the cache inside the lock before rebuilding. */ withLock?(key: string, fn: () => Promise): Promise; } /** * Simplest possible adapter: a Map. No persistence, no locking (single * process only), no differentiation between secrets and non-secrets. * This is the default when cli-login isn't installed and no custom * cache is provided. */ declare function createMemoryCache(): ZapierCache; declare const NeedSchema: z.ZodObject<{ key: z.ZodString; alters_custom_fields: z.ZodOptional>; capabilities: z.ZodOptional>; choices: z.ZodOptional; label: z.ZodOptional; sample: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>>>; computed: z.ZodOptional>; custom_field: z.ZodOptional; default: z.ZodOptional; depends_on: z.ZodOptional>; format: z.ZodOptional>; from_search: z.ZodOptional; from_write: z.ZodOptional; help_text: z.ZodOptional; help_text_html: z.ZodOptional; input_format: z.ZodOptional>; label: z.ZodOptional; language: z.ZodOptional; parent_key: z.ZodOptional; placeholder: z.ZodOptional; prefill: z.ZodOptional; required: z.ZodOptional; searchfill: z.ZodOptional; send_in_json: z.ZodOptional; regex: z.ZodOptional; type: z.ZodOptional>; list: z.ZodOptional; }, z.core.$strip>; declare const ActionSchema: z.ZodObject<{ id: z.ZodOptional; type: z.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; key: z.ZodString; name: z.ZodString; description: z.ZodString; is_important: z.ZodOptional; is_hidden: z.ZodOptional; selected_api: z.ZodOptional; }, z.core.$strip>; declare const ChoiceSchema: z.ZodObject<{ value: z.ZodUnion; label: z.ZodString; }, z.core.$strip>; declare const FieldSchema: z.ZodObject<{ key: z.ZodString; label: z.ZodString; type: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; object: "object"; file: "file"; array: "array"; datetime: "datetime"; }>; required: z.ZodBoolean; description: z.ZodOptional; choices: z.ZodOptional; label: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>; declare const ActionExecutionResultSchema: z.ZodObject<{ data: z.ZodArray; }, z.core.$strip>; declare const ActionFieldChoiceSchema: z.ZodObject<{ value: z.ZodUnion; label: z.ZodString; }, z.core.$strip>; declare const ActionFieldSchema: z.ZodObject<{ key: z.ZodString; label: z.ZodOptional; required: z.ZodBoolean; type: z.ZodOptional; helpText: z.ZodOptional; helpTextHtml: z.ZodOptional; choices: z.ZodOptional; label: z.ZodString; }, z.core.$strip>>>; default: z.ZodOptional; placeholder: z.ZodOptional; computed: z.ZodOptional; customField: z.ZodOptional; dependsOn: z.ZodOptional>; format: z.ZodOptional; inputFormat: z.ZodOptional>; }, z.core.$strip>; declare const UserProfileSchema: z.ZodObject<{ id: z.ZodNumber; public_id: z.ZodOptional; code: z.ZodString; user_id: z.ZodNumber; auto_provisioned: z.ZodBoolean; first_name: z.ZodString; last_name: z.ZodString; username: z.ZodString; personas: z.ZodString; user_generated_personas: z.ZodString; last_login: z.ZodString; email: z.ZodString; email_hash: z.ZodString; email_confirmed: z.ZodBoolean; timezone: z.ZodString; photo_url: z.ZodString; has_seen_notifications: z.ZodRecord>; signup: z.ZodString; since_signup: z.ZodString; has_activated: z.ZodBoolean; enable_gz_creator: z.ZodBoolean; should_see_nps_survey: z.ZodBoolean; is_developer: z.ZodBoolean; is_expert: z.ZodBoolean; tos_agreement: z.ZodBoolean; should_renew_tos: z.ZodBoolean; is_gdpr_consented: z.ZodBoolean; disable_ssl_check: z.ZodBoolean; identity: z.ZodNumber; summary_schedule: z.ZodString; alert_triggers: z.ZodString; alert_actions: z.ZodString; is_staff: z.ZodBoolean; is_zt_reviewer: z.ZodBoolean; is_high_value: z.ZodBoolean; is_temporary: z.ZodBoolean; banner_message: z.ZodString; enable_totp_2fa: z.ZodBoolean; viewed_help: z.ZodRecord; show_editor_migration_mesaging: z.ZodBoolean; switches: z.ZodRecord; organizations: z.ZodArray>>; primary_organization: z.ZodNullable>; has_active_zaps: z.ZodBoolean; has_google_sso: z.ZodBoolean; auth_realm: z.ZodString; roles: z.ZodArray>; }, z.core.$strip>; declare const AppSchema: z.ZodObject<{ age_in_days: z.ZodOptional; api_docs_url: z.ZodOptional>; app_profile_url: z.ZodString; banner: z.ZodOptional; categories: z.ZodOptional>; canonical_id: z.ZodOptional; current_implementation_id: z.ZodString; days_since_last_update: z.ZodOptional; description: z.ZodString; external_url: z.ZodString; hashtag: z.ZodOptional; id: z.ZodOptional; image: z.ZodOptional; images: z.ZodOptional; integration_overview_html: z.ZodOptional>; internal_id: z.ZodString; invite_url: z.ZodOptional>; is_beta: z.ZodOptional; is_built_in: z.ZodOptional; is_featured: z.ZodOptional; is_premium: z.ZodOptional; is_public: z.ZodOptional; is_upcoming: z.ZodOptional; learn_more_url: z.ZodString; name: z.ZodString; popularity: z.ZodNumber; primary_color: z.ZodString; request_count: z.ZodOptional; slug: z.ZodString; zap_usage_count: z.ZodOptional>; }, z.core.$strip>; declare const NeedsRequestSchema: z.ZodObject<{ selected_api: z.ZodString; action: z.ZodString; type_of: z.ZodString; authentication_id: z.ZodOptional>; params: z.ZodOptional>; }, z.core.$strip>; declare const NeedsResponseSchema: z.ZodObject<{ success: z.ZodBoolean; needs: z.ZodOptional>; capabilities: z.ZodOptional>; choices: z.ZodOptional; label: z.ZodOptional; sample: z.ZodOptional; value: z.ZodOptional; }, z.core.$strip>>>; computed: z.ZodOptional>; custom_field: z.ZodOptional; default: z.ZodOptional; depends_on: z.ZodOptional>; format: z.ZodOptional>; from_search: z.ZodOptional; from_write: z.ZodOptional; help_text: z.ZodOptional; help_text_html: z.ZodOptional; input_format: z.ZodOptional>; label: z.ZodOptional; language: z.ZodOptional; parent_key: z.ZodOptional; placeholder: z.ZodOptional; prefill: z.ZodOptional; required: z.ZodOptional; searchfill: z.ZodOptional; send_in_json: z.ZodOptional; regex: z.ZodOptional; type: z.ZodOptional>; list: z.ZodOptional; }, z.core.$strip>>>; errors: z.ZodOptional>; last_fetched_at: z.ZodOptional; schema: z.ZodOptional>; }, z.core.$strip>; /** * API Client Type Definitions * * This module contains all type definitions related to the Zapier API client, * including configuration options, client interfaces, request/response types, * and API response models. * * API response model types are inferred from Zod schemas defined in api/schemas.ts * to ensure a single source of truth and eliminate duplication. */ interface ApiClientOptions { baseUrl: string; /** * Authentication credentials. */ credentials?: Credentials; /** * @deprecated Use `credentials` instead. */ token?: string; debug?: boolean; fetch?: typeof globalThis.fetch; onEvent?: (event: SdkEvent) => void; /** * Maximum number of retries for rate-limited requests (429 responses). * Set to 0 to disable retries. Default is 3. */ maxNetworkRetries?: number; /** * Maximum delay in milliseconds to wait for a rate limit retry. * If the server requests a longer delay, the request fails immediately. * Default is 60000 (60 seconds). */ maxNetworkRetryDelayMs?: number; /** * Maximum number of concurrent in-flight HTTP requests per client. * Requests beyond this limit queue in FIFO order until a slot frees. * Pass `Infinity` to disable. Default: 200. */ maxConcurrentRequests?: number; /** * Controls how the approval flow is handled. * - "poll": Create the approval, open the URL in a browser, poll until * resolved, and retry the original request on success. * - "throw": Create the approval and throw a ZapierApprovalError immediately * with the approval URL so the caller can surface it. * - "disabled": Throw a ZapierApprovalError on approval-required responses * without creating an approval. * Resolution order is: explicit option, then ZAPIER_APPROVAL_MODE, then a * TTY-based default ("poll" if interactive, "throw" otherwise). */ approvalMode?: "disabled" | "poll" | "throw"; /** * Timeout in ms for approval polling. Default: 600000 (10 minutes). */ approvalTimeoutMs?: number; /** * Maximum number of sequential approval rounds for a single request before * giving up. A single request can legitimately require multiple approvals * (one per gating policy); this cap prevents a runaway loop if the server * keeps returning approval_required. Default: 2. */ maxApprovalRetries?: number; /** * Identifies the wrapping package that built this client (e.g., the CLI or * MCP server). When set, emitted as `x-zapier-sdk-package` / * `x-zapier-sdk-package-version` telemetry headers. Omitted by direct * `createZapierSdk` callers — their identity is captured by * `x-zapier-sdk-version` alone. */ callerPackage?: { name: string; version: string; }; /** * Pluggable key-value cache used to cache access tokens across * invocations. See ZapierCache in ../cache.ts. */ cache?: ZapierCache; } interface ApiClient { get: (path: string, options?: RequestOptions) => Promise; post: (path: string, data?: unknown, options?: RequestOptions) => Promise; put: (path: string, data?: unknown, options?: RequestOptions) => Promise; patch: (path: string, data?: unknown, options?: RequestOptions) => Promise; delete: (path: string, data?: unknown, options?: RequestOptions) => Promise; poll: (path: string, options?: PollOptions) => Promise; fetch: (path: string, init?: RequestInit & { searchParams?: Record; authRequired?: boolean; approvalContext?: () => RequestContext; }) => Promise; } interface RequestOptions { headers?: Record; searchParams?: Record; authRequired?: boolean; /** * OAuth scopes required for this request. When using client credentials, * these scopes will be requested during token exchange (merged with any * scopes specified in the credentials object). */ requiredScopes?: string[]; customErrorHandler?: (errorInfo: { status: number; statusText: string; data: unknown; }) => Error | undefined; /** * Optional metadata about what this request is fetching/affecting. When * set, 404 responses throw `ZapierResourceNotFoundError` with * `resourceType` / `resourceId` populated. The `type` is free-form; * conventionally it matches how the resource appears in API URL segments * (`"table"`, `"record"`, `"connection"`, etc.). */ resource?: { type: string; id?: string | number; }; /** * Builds the policy context for this request if it triggers the approval * flow. Callers that may receive a 403 `approval_required` response MUST * provide this so the SDK can create an approval with the correct context. */ approvalContext?: () => RequestContext; /** * Abort signal forwarded to the underlying `fetch`. Aborting cancels * the in-flight request and any rate-limit retry sleep before the * next attempt; the resulting `AbortError` is the caller's * responsibility to handle. */ signal?: AbortSignal; } interface PollOptions extends RequestOptions { initialDelay?: number; timeoutMs?: number; successStatus?: number; pendingStatus?: number; /** Function to check if the response body indicates pending state (return true to continue polling) */ isPending?: (response: unknown) => boolean; resultExtractor?: (response: unknown) => unknown; } type Need = z.infer; type Action = z.infer; type Choice = z.infer; type Field = z.infer; type ActionExecutionResult = z.infer; type ActionFieldChoice = z.infer; type ActionField = z.infer; type Connection = z.infer; type ConnectionsResponse = z.infer; type UserProfile = z.infer; type App = z.infer; type NeedsRequest = z.infer; type NeedsResponse = z.infer; /** * A single connection entry in the connections map. * Provides a connectionId that maps a named connection alias to a Zapier connection. */ declare const ConnectionEntrySchema: z.ZodObject<{ connectionId: z.ZodUnion; }, z.core.$strip>; type ConnectionEntry = z.infer; /** * A map of named connections. Keys are user-defined connection aliases * (e.g. "slack_work", "slack_private") that can be referenced via the * `connection` parameter on action calls. */ declare const ConnectionsMapSchema: z.ZodRecord; }, z.core.$strip>>; type ConnectionsMap = z.infer; /** * Domain utility functions for working with app identifiers and data normalization */ interface AppLocator { lookupAppKey: string; slug?: string; implementationName?: string; version?: string; } interface ResolvedAppLocator extends AppLocator { implementationName: string; } declare const DEFAULT_CONFIG_PATH: ".zapierrc"; type ManifestEntry = { implementationName: string; version?: string; }; type GetVersionedImplementationId = (appKey: string) => Promise; /** * Action entry for storing saved action configurations * The key in the actions record IS the user-provided name */ declare const ActionEntrySchema: z.ZodObject<{ appKey: z.ZodString; actionKey: z.ZodString; actionType: z.ZodString; connectionId: z.ZodOptional>>; authenticationId: z.ZodOptional>>; inputs: z.ZodOptional>; schema: z.ZodRecord; createdAt: z.ZodString; }, z.core.$strip>; type ActionEntry = z.infer; type Manifest = { apps?: Record; actions?: Record; canIncludeSharedConnections?: boolean; canIncludeSharedTables?: boolean; canDeleteTables?: boolean; connections?: ConnectionsMap; }; declare const ManifestPluginOptionsSchema: z.ZodObject<{ manifestPath: z.ZodOptional; manifest: z.ZodOptional>>; actions: z.ZodOptional>>; authenticationId: z.ZodOptional>>; inputs: z.ZodOptional>; schema: z.ZodRecord; createdAt: z.ZodString; }, z.core.$strip>>>; canIncludeSharedConnections: z.ZodOptional; canIncludeSharedTables: z.ZodOptional; canDeleteTables: z.ZodOptional; connections: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; }, z.core.$strip>; declare function buildCapabilityMessage(key: string): string; declare const GATED_FLAGS: readonly ["canIncludeSharedConnections", "canIncludeSharedTables", "canDeleteTables"]; type GatedFlag = (typeof GATED_FLAGS)[number]; interface CapabilitiesContext { checkCapability: (key: GatedFlag) => Promise; hasCapability: (key: GatedFlag) => Promise; } /** * API Client Implementation * * This module contains the core API client implementation, including * HTTP method handlers, response processing, and client factory functions. */ declare const createZapierApi: (options: ApiClientOptions) => ApiClient; /** * Zapier API Client Module * * This module provides a centralized API layer for all HTTP interactions * with Zapier's various APIs. It handles authentication, error handling, * polling, and provides consistent patterns across all services. */ /** * Utility function to get or create an API client for standalone functions * * @param config - Configuration that may include an existing API client * @returns ApiClient instance */ declare function getOrCreateApiClient(config: { baseUrl?: string; credentials?: Credentials; /** @deprecated Use `credentials` instead */ token?: string; api?: ApiClient; debug?: boolean; fetch?: typeof globalThis.fetch; }): ApiClient; /** * Event emission types matching Avro schemas for SDK telemetry * * These interfaces correspond to the Avro schemas: * - application_lifecycle_event.avsc * - error_occurred_event.avsc */ interface BaseEvent { event_id: string; timestamp_ms: number; release_id: string; customuser_id?: number | null; account_id?: number | null; identity_id?: number | null; visitor_id?: string | null; correlation_id?: string | null; } interface ErrorOccurredEvent extends BaseEvent { zap_id?: number | null; node_id?: number | null; selected_api?: string | null; app_id?: number | null; app_version_id?: number | null; error_message: string; error_type?: string | null; error_status_code?: number | null; error_stack_trace?: string | null; error_source_method?: string | null; error_source_file?: string | null; error_line_number?: number | null; operation_type?: string | null; operation_key?: string | null; error_severity?: string | null; is_user_facing: boolean; is_recoverable?: boolean | null; sdk_version?: string | null; error_metadata?: Record | null; parent_error_id?: string | null; error_occurred_timestamp_ms?: number | null; error_code?: string | null; recovery_attempted?: boolean | null; recovery_action?: string | null; recovery_successful?: boolean | null; environment?: string | null; execution_time_before_error_ms?: number | null; } interface ApplicationLifecycleEvent extends BaseEvent { lifecycle_event_type: "startup" | "exit" | "signal_termination" | "login_success"; selected_api?: string | null; app_id?: number | null; app_version_id?: number | null; sdk_version?: string | null; cli_version?: string | null; exit_code?: number | null; signal_name?: string | null; uptime_ms?: number | null; memory_usage_bytes?: number | null; peak_memory_usage_bytes?: number | null; cpu_time_ms?: number | null; os_platform?: string | null; os_release?: string | null; os_architecture?: string | null; platform_versions?: Record | null; environment?: string | null; is_ci_environment?: boolean | null; ci_platform?: string | null; session_id?: string | null; metadata?: Record | null; process_argv?: (string | null)[] | null; is_graceful_shutdown?: boolean | null; shutdown_duration_ms?: number | null; active_requests_count?: number | null; } interface MethodCalledEvent extends BaseEvent { method_name: string; method_module: string | null; execution_duration_ms: number; success_flag: boolean; error_message: string | null; error_type: string | null; argument_count: number; is_paginated: boolean; sdk_version: string; environment: string | null; selected_api: string | null; app_id: number | null; app_version_id: number | null; zap_id: number | null; node_id: number | null; operation_type: string | null; operation_key: string | null; call_context: string | null; is_retry: boolean; retry_attempt: number | null; argument_types: string[] | null; return_type: string | null; caller_method: string | null; call_stack_depth: number | null; is_synchronous: boolean | null; cpu_time_ms: number | null; memory_usage_bytes: number | null; } /** * Transport abstraction layer for event emission * * Provides configurable transport mechanisms for emitting telemetry events. * All transports implement silent failure to prevent SDK disruption. */ interface EventTransport { emit(subject: string, event: T): Promise; close?(): Promise; } interface TransportConfig { type: "http" | "console" | "noop"; endpoint?: string; headers?: Record; retryAttempts?: number; retryDelayMs?: number; } interface EventContext { customuser_id?: number | null; account_id?: number | null; identity_id?: number | null; visitor_id?: string | null; correlation_id?: string | null; selected_api?: string | null; app_id?: number | null; app_version_id?: number | null; zap_id?: number | null; node_id?: number | null; environment?: string | null; operation_type?: string | null; } interface ErrorEventData { error_message: string; is_user_facing: boolean; error_type?: string | null; error_status_code?: number | null; error_stack_trace?: string | null; error_source_method?: string | null; error_source_file?: string | null; error_line_number?: number | null; operation_type?: string | null; operation_key?: string | null; error_severity?: string | null; is_recoverable?: boolean | null; error_metadata?: Record | null; parent_error_id?: string | null; error_occurred_timestamp_ms?: number | null; error_code?: string | null; recovery_attempted?: boolean | null; recovery_action?: string | null; recovery_successful?: boolean | null; execution_time_before_error_ms?: number | null; } interface EnhancedErrorEventData extends ErrorEventData { execution_start_time?: number | null; } interface ApplicationLifecycleEventData { lifecycle_event_type: "startup" | "exit" | "signal_termination" | "login_success"; exit_code?: number | null; signal_name?: string | null; uptime_ms?: number | null; is_graceful_shutdown?: boolean | null; shutdown_duration_ms?: number | null; memory_usage_bytes?: number | null; peak_memory_usage_bytes?: number | null; cpu_time_ms?: number | null; active_requests_count?: number | null; } interface MethodCalledEventData { method_name: string; method_module?: string | null; execution_duration_ms: number; success_flag: boolean; error_message?: string | null; error_type?: string | null; argument_count: number; is_paginated?: boolean; selected_api?: string | null; operation_type?: string | null; operation_key?: string | null; } /** * Event builder utilities for creating telemetry events * * Provides builder functions that auto-populate common fields and ensure * schema compliance for all event types. */ declare function createBaseEvent(context?: EventContext): BaseEvent; declare function buildErrorEvent(data: ErrorEventData, context?: EventContext): ErrorOccurredEvent; declare function buildApplicationLifecycleEvent(data: ApplicationLifecycleEventData, context?: EventContext): ApplicationLifecycleEvent; declare function buildErrorEventWithContext(data: EnhancedErrorEventData, context?: EventContext): ErrorOccurredEvent; declare function buildMethodCalledEvent(data: MethodCalledEventData, context?: EventContext): MethodCalledEvent; /** * Simple utility functions for event emission * These are pure functions that can be used to populate common event fields */ /** * Generate a unique event ID */ declare function generateEventId(): string; /** * Get current timestamp in milliseconds since epoch */ declare function getCurrentTimestamp(): number; /** * Get release ID (git SHA) - in production this would come from build process */ declare function getReleaseId(): string; /** * Get operating system information */ declare function getOsInfo(): { platform: string | null; release: string | null; architecture: string | null; }; /** * Get platform versions (Node.js, npm, etc.) */ declare function getPlatformVersions(): Record; /** * Check if running in CI environment */ declare function isCi(): boolean; /** * Get CI platform name if running in CI */ declare function getCiPlatform(): string | null; /** * Get memory usage in bytes */ declare function getMemoryUsage(): number | null; /** * Get CPU time in milliseconds */ declare function getCpuTime(): number | null; /** * Removes all registered process event listeners. * Useful for test cleanup to prevent listener accumulation. */ declare function cleanupEventListeners(): void; interface EventEmissionConfig { enabled?: boolean; transport?: TransportConfig; callContext?: "sdk" | "cli" | "mcp"; } interface EventEmissionContext { eventEmission: { transport: EventTransport; config: EventEmissionConfig; emit(subject: string, event: T): void; createBaseEvent(): Promise; emitMethodCalled(data: MethodCalledEventData): void; flush(): Promise; close(exitCode?: number): Promise; }; } declare const eventEmissionPlugin: (sdk: { context: { options?: BaseSdkOptions; }; } & { context: { meta: Record; }; }) => { context: EventEmissionContext; }; type EventEmissionProvides = ReturnType; type ManifestPluginOptions = z.infer; interface UpdateManifestEntryOptions { appKey: string; entry: ManifestEntry; configPath?: string; skipWrite?: boolean; manifest?: Manifest; } interface UpdateManifestEntryResult { key: string; entry: ManifestEntry; manifest: Manifest; } interface AddActionEntryOptions { name: string; entry: ActionEntry; configPath?: string; skipWrite?: boolean; manifest?: Manifest; } interface AddActionEntryResult { name: string; entry: ActionEntry; manifest: Manifest; } /** * Read manifest from a file path asynchronously * Supports local files (Node.js) and browser environments (fallback to global filesystem) */ declare function readManifestFromFile(filePath: string): Promise; /** * Get the preferred key for storing an app in the manifest * Extracted from plugin to make it easier to test */ declare function getPreferredManifestEntryKey({ appKey, api, }: { appKey: string; api: ApiClient; }): Promise; /** * Find a manifest entry by any app key (implementation name, slug, etc.). */ declare function findManifestEntry({ appKey, manifest, }: { appKey: string; manifest: Manifest; }): [string, ManifestEntry] | null; declare const manifestPlugin: (sdk: { context: { api: ApiClient; options?: { manifestPath?: string; manifest?: Manifest; }; }; } & { context: { meta: Record; }; }) => { context: { getResolvedManifest: () => Promise; getVersionedImplementationId: (appKey: string) => Promise; resolveAppKeys: ({ appKeys }: { appKeys: string[]; }) => Promise; updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise; addActionEntry: (options: AddActionEntryOptions) => Promise; findActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => ActionEntry | null; listActionEntries: ({ configPath, }?: { configPath?: string; }) => Promise>; deleteActionEntry: ({ name, configPath, skipWrite, }: { name: string; configPath?: string; skipWrite?: boolean; }) => Promise; hasActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => boolean; findManifestEntry: typeof findManifestEntry; readManifestFromFile: typeof readManifestFromFile; getManifestConnections: () => Promise | null>; }; }; type ManifestPluginProvides = ReturnType; /** * Function-related types and interfaces */ interface FunctionOptions { /** Base URL for Zapier API */ baseUrl?: string; /** Authentication token */ token?: string; /** Function to dynamically resolve authentication token */ getToken?: () => Promise; /** Optional pre-instantiated API client */ api?: ApiClient; /** Enable debug logging */ debug?: boolean; /** Custom fetch implementation */ fetch?: typeof globalThis.fetch; } /** * Single page of a paginated SDK list result. Returned from the page-level * promise and yielded from the page-level async iterable. */ interface SdkPage { data: T[]; nextCursor?: string; } /** * Return type of every paginated SDK method. The same value is both: * * - a Promise that resolves to the first page (`SdkPage`), and * - an AsyncIterable that yields each page in turn, * * with an `.items()` method that returns an AsyncIterable over individual * items across all pages. Named so paginated plugin signatures serialize * as `PaginatedSdkResult` in `.d.ts` rather than expanding the * full triple-intersection at every callsite. */ interface PaginatedSdkResult extends Promise>, AsyncIterable> { items(): AsyncIterable; } type PaginatedSdkFunction = (options: TOptions) => PaginatedSdkResult; declare const RelayRequestSchema: z.ZodObject<{ url: z.ZodString; method: z.ZodOptional>; body: z.ZodOptional; connection: z.ZodOptional>; connectionId: z.ZodOptional>; authenticationId: z.ZodOptional>; callbackUrl: z.ZodOptional; headers: z.ZodOptional, z.ZodCustom, z.ZodArray>]>>; }, z.core.$strip>; declare const RelayFetchSchema: z.ZodObject<{ url: z.ZodString; method: z.ZodOptional>; body: z.ZodOptional; connection: z.ZodOptional>; connectionId: z.ZodOptional>; authenticationId: z.ZodOptional>; callbackUrl: z.ZodOptional; headers: z.ZodOptional, z.ZodCustom, z.ZodArray>]>>; }, z.core.$strip>; interface FunctionRegistryEntry { name: string; /** * Human-readable description of the function. Surfaced as CLI help text, * MCP tool description, and README documentation. Prefer providing this * directly rather than relying solely on inputSchema.describe(). */ description?: string; type?: "list" | "item" | "create" | "update" | "delete" | "function"; itemType?: string; returnType?: string; inputSchema?: z.ZodSchema; inputParameters?: Array<{ name: string; schema: z.ZodSchema; }>; outputSchema?: z.ZodSchema; categories: string[]; resolvers?: Record; packages?: string[]; /** * True if the plugin is registered only in the experimental SDK * factory. See `PluginMeta.experimental`. */ experimental?: boolean; /** Confirmation prompt type - prompts user before executing */ confirm?: "create-secret" | "delete"; /** * Optional deprecation metadata for commands. */ deprecation?: FunctionDeprecation; /** Short flag aliases for CLI options (e.g., { request: "X", header: "H" }) */ aliases?: Record; /** Output formatter with optional page-level enrichment (mirrors resolvers for output) */ formatter?: OutputFormatter; /** Defaults to true. Set to false to suppress --json (e.g. login/logout/init). */ supportsJsonOutput: boolean; } interface FunctionDeprecation { /** User-facing deprecation message for why/how to migrate */ message: string; } interface RegistryResult { functions: FunctionRegistryEntry[]; categories: { key: string; title: string; titlePlural: string; functions: string[]; }[]; } /** * SDK-related types and interfaces */ declare const BaseSdkOptionsSchema: z.ZodObject<{ credentials: z.ZodOptional>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>, z.ZodFunction, z.ZodUnion>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>, z.ZodPromise>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>]>]>>]>>]>>; debug: z.ZodOptional; baseUrl: z.ZodOptional; trackingBaseUrl: z.ZodOptional; maxNetworkRetries: z.ZodOptional; maxNetworkRetryDelayMs: z.ZodOptional; maxConcurrentRequests: z.ZodOptional]>>; approvalTimeoutMs: z.ZodOptional; maxApprovalRetries: z.ZodOptional; approvalMode: z.ZodOptional>; manifestPath: z.ZodOptional; manifest: z.ZodOptional>; onEvent: z.ZodOptional>; fetch: z.ZodOptional>; eventEmission: z.ZodOptional>; callerPackage: z.ZodOptional>; cache: z.ZodOptional>; canIncludeSharedConnections: z.ZodOptional; canIncludeSharedTables: z.ZodOptional; canDeleteTables: z.ZodOptional; token: z.ZodOptional; }, z.core.$strip>; type BaseSdkOptions = z.infer; /** * ------------------------------ * Plugin Type System * ------------------------------ * * Plugins receive the sdk as a positional parameter. sdk.context holds shared * internal state (api client, event emission, meta, options, etc.). SDK methods * live at the root, context nests under .context. * * A plugin is (sdk) => partialSdk. createSdk() returns an empty SDK. addPlugin * merges the plugin's result into the SDK, producing a new SDK. */ interface PluginProvides extends Record { context?: { meta?: Record; [key: string]: any; }; } interface PluginMeta { /** * Human-readable description of the plugin function. Used by the CLI (help text), * MCP (tool description), and README generators. When omitted, falls back to * the inputSchema's `.describe()` value or a generic placeholder. */ description?: string; categories?: string[]; type?: "list" | "item" | "create" | "update" | "delete" | "function"; itemType?: string; returnType?: string; inputSchema?: z.ZodSchema; outputSchema?: z.ZodSchema; resolvers?: Record; /** Confirmation prompt type - prompts user before executing */ confirm?: "create-secret" | "delete"; /** * Marks this plugin as experimental — registered only in the * `@zapier/zapier-sdk/experimental` factory and badged in * generated docs / CLI help. Access is gated structurally by the * subpath import: stable callers can't reach experimental methods * because the stable SDK type and runtime registry don't include * them. No runtime capability check. */ experimental?: boolean; [key: string]: any; } /** * Plugin interface — 2 type params: * * TSdk = what this plugin needs (the SDK shape including context) * TProvides = what this plugin returns (a partial SDK shape) * * The sdk param always includes context.meta, even if TSdk doesn't declare it. */ interface Plugin { (sdk: TSdk & { context: { meta: Record; }; }): TProvides; } /** * Takes an SDK shape and adds addPlugin and getRegistry methods to it. * addPlugin merges a plugin's result into the shape, producing a new SDK. * Use composePlugins(...) to bundle multiple plugins into one before * adding — addPlugin itself is single-plugin only, which keeps inference * stable through long chains. * getRegistry is a lazy view over context.meta, available on every sdk * produced by buildSdk regardless of plugin order. */ type WithAddPlugin; }; }> = T & { addPlugin(plugin: Plugin, options?: { override?: boolean; }): WithAddPlugin; getRegistry(options?: { package?: string; }): RegistryResult; }; interface ZapierSdkOptions extends BaseSdkOptions { } declare function createOptionsPlugin(options: ZapierSdkOptions): () => { context: { options: ZapierSdkOptions; }; }; declare function createSdk(): { readonly context: Readonly<{ meta: Record; }>; getContext: () => Readonly<{ meta: Record; }>; getRegistry(options?: { package?: string; } | undefined): RegistryResult; addPlugin(plugin: Plugin<{ context: { meta: Record; }; }, TProvides>, options?: { override?: boolean; } | undefined): WithAddPlugin<{ context: { meta: Record; }; } & TProvides>; }; /** * @deprecated `getRegistry` is now built into every sdk, so the "without * registry" form has no behavioral difference from {@link createZapierSdk}. * Use {@link createZapierSdk} instead. */ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): WithAddPlugin<{ context: { meta: Record; }; } & { context: { options: ZapierSdkOptions; }; } & { context: EventEmissionContext; } & { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: { getResolvedManifest: () => Promise; getVersionedImplementationId: (appKey: string) => Promise; resolveAppKeys: ({ appKeys }: { appKeys: string[]; }) => Promise; updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise; addActionEntry: (options: AddActionEntryOptions) => Promise; findActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => ActionEntry | null; listActionEntries: ({ configPath, }?: { configPath?: string; }) => Promise>; deleteActionEntry: ({ name, configPath, skipWrite, }: { name: string; configPath?: string; skipWrite?: boolean; }) => Promise; hasActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => boolean; findManifestEntry: typeof findManifestEntry; readManifestFromFile: typeof readManifestFromFile; getManifestConnections: () => Promise | null>; }; } & { context: CapabilitiesContext; } & { context: { resolveConnection: (name: string) => Promise<{ connectionId: string | number; } | undefined>; getConnectionsMap: () => Promise | null>; }; } & { listApps: (options?: ({ search?: string | undefined; apps?: string[] | undefined; appKeys?: string[] | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }>; } & { context: { meta: { listApps: PluginMeta; }; }; } & { getApp: (options?: { app: string; } | { appKey: string; } | undefined) => Promise<{ data: { slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }; }>; } & { context: { meta: { getApp: PluginMeta; }; }; } & { listActions: (options?: (({ app: string; actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listActions: PluginMeta; }; }; } & { getAction: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; } | undefined) => Promise<{ data: { description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getAction: PluginMeta; }; }; } & { listActionInputFields: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key: string; type: "input_field"; default_value: string; depends_on: string[]; description: string; invalidates_input_fields: boolean; is_required: boolean; placeholder: string; title: string; value_type: string; format?: string | undefined; items?: { type: string; } | undefined; } | { key: string; type: "info_field"; description: string; title?: string | undefined; } | FieldsetItem>; } & { context: { meta: { listActionInputFields: PluginMeta; }; }; } & { getActionInputFieldsSchema: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | undefined) => Promise<{ data: Record; }>; } & { context: { meta: { getActionInputFieldsSchema: PluginMeta; }; }; } & { listActionInputFieldChoices: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; inputField: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; inputFieldKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key?: string | undefined; label?: string | undefined; sample?: string | undefined; value?: string | undefined; }>; } & { context: { meta: { listActionInputFieldChoices: PluginMeta; }; }; } & { listInputFields: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key: string; type: "input_field"; default_value: string; depends_on: string[]; description: string; invalidates_input_fields: boolean; is_required: boolean; placeholder: string; title: string; value_type: string; format?: string | undefined; items?: { type: string; } | undefined; } | { key: string; type: "info_field"; description: string; title?: string | undefined; } | FieldsetItem>; context: { meta: { listInputFields: { categories: string[]; type: "list"; itemType: string; inputSchema: zod.ZodUnion; action: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>, zod.ZodObject<{ appKey: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; actionType: zod.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; actionKey: zod.ZodString; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>]>; outputSchema: zod.ZodUnion; default_value: zod.ZodString; depends_on: zod.ZodArray; description: zod.ZodString; invalidates_input_fields: zod.ZodBoolean; is_required: zod.ZodBoolean; placeholder: zod.ZodString; title: zod.ZodString; value_type: zod.ZodString; format: zod.ZodOptional; items: zod.ZodOptional>; }, zod_v4_core.$strip>, zod.ZodObject<{ key: zod.ZodString; type: zod.ZodLiteral<"info_field">; description: zod.ZodString; title: zod.ZodOptional; }, zod_v4_core.$strip>, zod.ZodType>]>; defaultPageSize: number; }; }; }; } & { getInputFieldsSchema: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | undefined) => Promise<{ data: Record; }>; context: { meta: { getInputFieldsSchema: { categories: string[]; type: "function"; inputSchema: zod.ZodUnion; action: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; }, zod_v4_core.$strip>, zod.ZodObject<{ appKey: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; actionType: zod.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; actionKey: zod.ZodString; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; }, zod_v4_core.$strip>]>; }; }; }; } & { listInputFieldChoices: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; inputField: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; inputFieldKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key?: string | undefined; label?: string | undefined; sample?: string | undefined; value?: string | undefined; }>; context: { meta: { listInputFieldChoices: { categories: string[]; type: "list"; itemType: string; inputSchema: zod.ZodUnion; action: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; inputField: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; page: zod.ZodOptional; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>, zod.ZodObject<{ appKey: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; actionType: zod.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; actionKey: zod.ZodString; inputFieldKey: zod.ZodString; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; page: zod.ZodOptional; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>]>; outputSchema: zod.ZodObject<{ key: zod.ZodOptional; label: zod.ZodOptional; sample: zod.ZodOptional; value: zod.ZodOptional; }, zod_v4_core.$strip>; defaultPageSize: number; }; }; }; } & { runAction: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; timeoutMs?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; timeoutMs?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult; } & { context: { meta: { runAction: PluginMeta; }; }; } & { listConnections: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listConnections: PluginMeta; }; }; } & { getConnection: (options?: { connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getConnection: PluginMeta; }; }; } & { findFirstConnection: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { findFirstConnection: PluginMeta; }; }; } & { findUniqueConnection: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { findUniqueConnection: PluginMeta; }; }; } & { listAuthentications: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; context: { meta: { listAuthentications: { packages: string[]; categories: string[]; type: "list"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; owner: zod.ZodOptional; app: zod.ZodOptional; appKey: zod.ZodOptional; connections: zod.ZodOptional>; connectionIds: zod.ZodOptional>; authenticationIds: zod.ZodOptional>; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; } & { getAuthentication: (options?: { connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { getAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ connection: zod.ZodOptional>; connectionId: zod.ZodOptional>; authenticationId: zod.ZodOptional>; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; } & { findFirstAuthentication: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { findFirstAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; appKey: zod.ZodOptional; app: zod.ZodOptional; owner: zod.ZodOptional; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; } & { findUniqueAuthentication: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { findUniqueAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; appKey: zod.ZodOptional; app: zod.ZodOptional; owner: zod.ZodOptional; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; } & { listClientCredentials: (options?: ({ pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ client_id: string; name: string; allowed_scopes: ("credentials" | "external")[]; created_at?: string | null | undefined; updated_at?: string | undefined; }>; } & { context: { meta: { listClientCredentials: PluginMeta; }; }; } & { createClientCredentials: (options?: { name: string; allowedScopes: ("credentials" | "external")[]; policy?: Record | undefined; } | undefined) => Promise<{ data: { client_id: string; name: string; client_secret: string; }; }>; } & { context: { meta: { createClientCredentials: PluginMeta; }; }; } & { deleteClientCredentials: (options?: { clientId: string; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteClientCredentials: PluginMeta; }; }; } & { fetch: (url: string | URL, init?: ZapierFetchInitOptions) => Promise; context: { meta: { fetch: { description: string; packages: string[]; categories: string[]; returnType: string; inputParameters: ({ name: string; schema: zod.ZodUnion]>; } | { name: string; schema: zod.ZodOptional>; headers: zod.ZodOptional>; body: zod.ZodOptional, zod.ZodCustom, zod.ZodRecord]>>; connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; callbackUrl: zod.ZodOptional; maxTime: zod.ZodOptional; }, zod_v4_core.$strip>>; })[]; }; }; }; } & { request: (options?: { url: string; method?: "POST" | "GET" | "DELETE" | "PUT" | "PATCH" | "HEAD" | "OPTIONS" | undefined; body?: any; connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; callbackUrl?: string | undefined; headers?: Record | [string, string][] | Headers | undefined; } | undefined) => Promise; } & { context: { meta: { request: PluginMeta; }; }; } & { listTables: (options?: ({ tables?: string[] | undefined; tableIds?: string[] | undefined; kind?: "table" | "virtual_table" | "both" | undefined; search?: string | undefined; owner?: string | undefined; includeShared?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }>; } & { context: { meta: { listTables: PluginMeta; }; }; } & { getTable: (options?: { table: string; } | { tableId: string; } | undefined) => Promise<{ data: { id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }; }>; } & { context: { meta: { getTable: PluginMeta; }; }; } & { deleteTable: (options?: { table: string; } | { tableId: string; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTable: PluginMeta; }; }; } & { createTable: (options?: { name: string; description?: string | undefined; } | undefined) => Promise<{ data: { id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }; }>; } & { context: { meta: { createTable: PluginMeta; }; }; } & { listTableFields: (options?: { table: string; fields?: (string | number)[] | undefined; fieldKeys?: (string | number)[] | undefined; trash?: "include" | "exclude" | "only" | undefined; } | { tableId: string; fields?: (string | number)[] | undefined; fieldKeys?: (string | number)[] | undefined; trash?: "include" | "exclude" | "only" | undefined; } | undefined) => Promise<{ data: { id: string; type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; created_at?: string | undefined; edited_at?: string | undefined; options?: Record | undefined; config?: Record | undefined; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { listTableFields: PluginMeta; }; }; } & { createTableFields: (options?: { table: string; fields: { type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; options?: Record | undefined; config?: Record | undefined; }[]; } | { tableId: string; fields: { type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; options?: Record | undefined; config?: Record | undefined; }[]; } | undefined) => Promise<{ data: { id: string; type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; created_at?: string | undefined; edited_at?: string | undefined; options?: Record | undefined; config?: Record | undefined; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { createTableFields: PluginMeta; }; }; } & { deleteTableFields: (options?: { table: string; fields: (string | number)[]; } | { tableId: string; fieldKeys: (string | number)[]; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTableFields: PluginMeta; }; }; } & { getTableRecord: (options?: { table: string; record: string; keyMode: "names" | "ids"; } | { tableId: string; recordId: string; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }; }>; } & { context: { meta: { getTableRecord: PluginMeta; }; }; } & { listTableRecords: (options?: (({ table: string; keyMode: "names" | "ids"; filters?: { fieldKey: string; operator: "in" | "search" | "exact" | "different" | "contains" | "icontains" | "gte" | "gt" | "lt" | "lte" | "range" | "isnull" | "startswith" | "is_within"; value?: unknown; }[] | undefined; sort?: { fieldKey: string; direction: "asc" | "desc"; } | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; trash?: "include" | "exclude" | "only" | undefined; } | { tableId: string; keyMode: "names" | "ids"; filters?: { fieldKey: string; operator: "in" | "search" | "exact" | "different" | "contains" | "icontains" | "gte" | "gt" | "lt" | "lte" | "range" | "isnull" | "startswith" | "is_within"; value?: unknown; }[] | undefined; sort?: { fieldKey: string; direction: "asc" | "desc"; } | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; trash?: "include" | "exclude" | "only" | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ id: string; data: Record; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }>; } & { context: { meta: { listTableRecords: PluginMeta; }; }; } & { createTableRecords: (options?: { table: string; records: { data: Record; }[]; keyMode: "names" | "ids"; } | { tableId: string; records: { data: Record; }[]; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { createTableRecords: PluginMeta; }; }; } & { deleteTableRecords: (options?: { table: string; records: string[]; } | { tableId: string; recordIds: string[]; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTableRecords: PluginMeta; }; }; } & { updateTableRecords: (options?: { table: string; records: { id: string; data: Record; }[]; keyMode: "names" | "ids"; } | { tableId: string; records: { id: string; data: Record; }[]; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { updateTableRecords: PluginMeta; }; }; } & { apps: ActionProxy & ZapierSdkApps; context: { meta: { "apps.{appKey}": { categories: string[]; packages: string[]; type: "function"; inputSchema: zod.ZodObject<{ connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; }, zod_v4_core.$strip>; returnType: string; }; "apps.{appKey}.{actionType}.{actionKey}": { categories: string[]; packages: string[]; type: "list"; inputSchema: zod.ZodObject<{ inputs: zod.ZodOptional>; connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; timeoutMs: zod.ZodOptional; }, zod_v4_core.$strip>; itemType: string; outputSchema: zod.ZodUnknown; }; }; }; } & { getProfile: (options?: Record | undefined) => Promise<{ data: { id: string; first_name: string; last_name: string; full_name: string; email: string; email_confirmed: boolean; timezone: string; }; }>; } & { context: { meta: { getProfile: PluginMeta; }; }; }>; declare function createZapierSdk(options?: ZapierSdkOptions): WithAddPlugin<{ context: { meta: Record; }; } & { context: { options: ZapierSdkOptions; }; } & { context: EventEmissionContext; } & { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: { getResolvedManifest: () => Promise; getVersionedImplementationId: (appKey: string) => Promise; resolveAppKeys: ({ appKeys }: { appKeys: string[]; }) => Promise; updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise; addActionEntry: (options: AddActionEntryOptions) => Promise; findActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => ActionEntry | null; listActionEntries: ({ configPath, }?: { configPath?: string; }) => Promise>; deleteActionEntry: ({ name, configPath, skipWrite, }: { name: string; configPath?: string; skipWrite?: boolean; }) => Promise; hasActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => boolean; findManifestEntry: typeof findManifestEntry; readManifestFromFile: typeof readManifestFromFile; getManifestConnections: () => Promise | null>; }; } & { context: CapabilitiesContext; } & { context: { resolveConnection: (name: string) => Promise<{ connectionId: string | number; } | undefined>; getConnectionsMap: () => Promise | null>; }; } & { listApps: (options?: ({ search?: string | undefined; apps?: string[] | undefined; appKeys?: string[] | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }>; } & { context: { meta: { listApps: PluginMeta; }; }; } & { getApp: (options?: { app: string; } | { appKey: string; } | undefined) => Promise<{ data: { slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }; }>; } & { context: { meta: { getApp: PluginMeta; }; }; } & { listActions: (options?: (({ app: string; actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listActions: PluginMeta; }; }; } & { getAction: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; } | undefined) => Promise<{ data: { description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getAction: PluginMeta; }; }; } & { listActionInputFields: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key: string; type: "input_field"; default_value: string; depends_on: string[]; description: string; invalidates_input_fields: boolean; is_required: boolean; placeholder: string; title: string; value_type: string; format?: string | undefined; items?: { type: string; } | undefined; } | { key: string; type: "info_field"; description: string; title?: string | undefined; } | FieldsetItem>; } & { context: { meta: { listActionInputFields: PluginMeta; }; }; } & { getActionInputFieldsSchema: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | undefined) => Promise<{ data: Record; }>; } & { context: { meta: { getActionInputFieldsSchema: PluginMeta; }; }; } & { listActionInputFieldChoices: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; inputField: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; inputFieldKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key?: string | undefined; label?: string | undefined; sample?: string | undefined; value?: string | undefined; }>; } & { context: { meta: { listActionInputFieldChoices: PluginMeta; }; }; } & { listInputFields: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key: string; type: "input_field"; default_value: string; depends_on: string[]; description: string; invalidates_input_fields: boolean; is_required: boolean; placeholder: string; title: string; value_type: string; format?: string | undefined; items?: { type: string; } | undefined; } | { key: string; type: "info_field"; description: string; title?: string | undefined; } | FieldsetItem>; context: { meta: { listInputFields: { categories: string[]; type: "list"; itemType: string; inputSchema: zod.ZodUnion; action: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>, zod.ZodObject<{ appKey: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; actionType: zod.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; actionKey: zod.ZodString; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>]>; outputSchema: zod.ZodUnion; default_value: zod.ZodString; depends_on: zod.ZodArray; description: zod.ZodString; invalidates_input_fields: zod.ZodBoolean; is_required: zod.ZodBoolean; placeholder: zod.ZodString; title: zod.ZodString; value_type: zod.ZodString; format: zod.ZodOptional; items: zod.ZodOptional>; }, zod_v4_core.$strip>, zod.ZodObject<{ key: zod.ZodString; type: zod.ZodLiteral<"info_field">; description: zod.ZodString; title: zod.ZodOptional; }, zod_v4_core.$strip>, zod.ZodType>]>; defaultPageSize: number; }; }; }; } & { getInputFieldsSchema: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | undefined) => Promise<{ data: Record; }>; context: { meta: { getInputFieldsSchema: { categories: string[]; type: "function"; inputSchema: zod.ZodUnion; action: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; }, zod_v4_core.$strip>, zod.ZodObject<{ appKey: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; actionType: zod.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; actionKey: zod.ZodString; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; }, zod_v4_core.$strip>]>; }; }; }; } & { listInputFieldChoices: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; inputField: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; inputFieldKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key?: string | undefined; label?: string | undefined; sample?: string | undefined; value?: string | undefined; }>; context: { meta: { listInputFieldChoices: { categories: string[]; type: "list"; itemType: string; inputSchema: zod.ZodUnion; action: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; inputField: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; page: zod.ZodOptional; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>, zod.ZodObject<{ appKey: zod.ZodString & { _def: zod_v4_core.$ZodStringDef & PositionalMetadata; }; actionType: zod.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; actionKey: zod.ZodString; inputFieldKey: zod.ZodString; connection: zod.ZodOptional>; connectionId: zod.ZodOptional>>; authenticationId: zod.ZodOptional>>; inputs: zod.ZodOptional>; page: zod.ZodOptional; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>]>; outputSchema: zod.ZodObject<{ key: zod.ZodOptional; label: zod.ZodOptional; sample: zod.ZodOptional; value: zod.ZodOptional; }, zod_v4_core.$strip>; defaultPageSize: number; }; }; }; } & { runAction: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; timeoutMs?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; timeoutMs?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult; } & { context: { meta: { runAction: PluginMeta; }; }; } & { listConnections: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listConnections: PluginMeta; }; }; } & { getConnection: (options?: { connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getConnection: PluginMeta; }; }; } & { findFirstConnection: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { findFirstConnection: PluginMeta; }; }; } & { findUniqueConnection: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { findUniqueConnection: PluginMeta; }; }; } & { listAuthentications: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; context: { meta: { listAuthentications: { packages: string[]; categories: string[]; type: "list"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; owner: zod.ZodOptional; app: zod.ZodOptional; appKey: zod.ZodOptional; connections: zod.ZodOptional>; connectionIds: zod.ZodOptional>; authenticationIds: zod.ZodOptional>; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; } & { getAuthentication: (options?: { connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { getAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ connection: zod.ZodOptional>; connectionId: zod.ZodOptional>; authenticationId: zod.ZodOptional>; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; } & { findFirstAuthentication: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { findFirstAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; appKey: zod.ZodOptional; app: zod.ZodOptional; owner: zod.ZodOptional; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; } & { findUniqueAuthentication: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { findUniqueAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; appKey: zod.ZodOptional; app: zod.ZodOptional; owner: zod.ZodOptional; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; } & { listClientCredentials: (options?: ({ pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ client_id: string; name: string; allowed_scopes: ("credentials" | "external")[]; created_at?: string | null | undefined; updated_at?: string | undefined; }>; } & { context: { meta: { listClientCredentials: PluginMeta; }; }; } & { createClientCredentials: (options?: { name: string; allowedScopes: ("credentials" | "external")[]; policy?: Record | undefined; } | undefined) => Promise<{ data: { client_id: string; name: string; client_secret: string; }; }>; } & { context: { meta: { createClientCredentials: PluginMeta; }; }; } & { deleteClientCredentials: (options?: { clientId: string; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteClientCredentials: PluginMeta; }; }; } & { fetch: (url: string | URL, init?: ZapierFetchInitOptions) => Promise; context: { meta: { fetch: { description: string; packages: string[]; categories: string[]; returnType: string; inputParameters: ({ name: string; schema: zod.ZodUnion]>; } | { name: string; schema: zod.ZodOptional>; headers: zod.ZodOptional>; body: zod.ZodOptional, zod.ZodCustom, zod.ZodRecord]>>; connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; callbackUrl: zod.ZodOptional; maxTime: zod.ZodOptional; }, zod_v4_core.$strip>>; })[]; }; }; }; } & { request: (options?: { url: string; method?: "POST" | "GET" | "DELETE" | "PUT" | "PATCH" | "HEAD" | "OPTIONS" | undefined; body?: any; connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; callbackUrl?: string | undefined; headers?: Record | [string, string][] | Headers | undefined; } | undefined) => Promise; } & { context: { meta: { request: PluginMeta; }; }; } & { listTables: (options?: ({ tables?: string[] | undefined; tableIds?: string[] | undefined; kind?: "table" | "virtual_table" | "both" | undefined; search?: string | undefined; owner?: string | undefined; includeShared?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }>; } & { context: { meta: { listTables: PluginMeta; }; }; } & { getTable: (options?: { table: string; } | { tableId: string; } | undefined) => Promise<{ data: { id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }; }>; } & { context: { meta: { getTable: PluginMeta; }; }; } & { deleteTable: (options?: { table: string; } | { tableId: string; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTable: PluginMeta; }; }; } & { createTable: (options?: { name: string; description?: string | undefined; } | undefined) => Promise<{ data: { id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }; }>; } & { context: { meta: { createTable: PluginMeta; }; }; } & { listTableFields: (options?: { table: string; fields?: (string | number)[] | undefined; fieldKeys?: (string | number)[] | undefined; trash?: "include" | "exclude" | "only" | undefined; } | { tableId: string; fields?: (string | number)[] | undefined; fieldKeys?: (string | number)[] | undefined; trash?: "include" | "exclude" | "only" | undefined; } | undefined) => Promise<{ data: { id: string; type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; created_at?: string | undefined; edited_at?: string | undefined; options?: Record | undefined; config?: Record | undefined; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { listTableFields: PluginMeta; }; }; } & { createTableFields: (options?: { table: string; fields: { type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; options?: Record | undefined; config?: Record | undefined; }[]; } | { tableId: string; fields: { type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; options?: Record | undefined; config?: Record | undefined; }[]; } | undefined) => Promise<{ data: { id: string; type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; created_at?: string | undefined; edited_at?: string | undefined; options?: Record | undefined; config?: Record | undefined; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { createTableFields: PluginMeta; }; }; } & { deleteTableFields: (options?: { table: string; fields: (string | number)[]; } | { tableId: string; fieldKeys: (string | number)[]; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTableFields: PluginMeta; }; }; } & { getTableRecord: (options?: { table: string; record: string; keyMode: "names" | "ids"; } | { tableId: string; recordId: string; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }; }>; } & { context: { meta: { getTableRecord: PluginMeta; }; }; } & { listTableRecords: (options?: (({ table: string; keyMode: "names" | "ids"; filters?: { fieldKey: string; operator: "in" | "search" | "exact" | "different" | "contains" | "icontains" | "gte" | "gt" | "lt" | "lte" | "range" | "isnull" | "startswith" | "is_within"; value?: unknown; }[] | undefined; sort?: { fieldKey: string; direction: "asc" | "desc"; } | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; trash?: "include" | "exclude" | "only" | undefined; } | { tableId: string; keyMode: "names" | "ids"; filters?: { fieldKey: string; operator: "in" | "search" | "exact" | "different" | "contains" | "icontains" | "gte" | "gt" | "lt" | "lte" | "range" | "isnull" | "startswith" | "is_within"; value?: unknown; }[] | undefined; sort?: { fieldKey: string; direction: "asc" | "desc"; } | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; trash?: "include" | "exclude" | "only" | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ id: string; data: Record; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }>; } & { context: { meta: { listTableRecords: PluginMeta; }; }; } & { createTableRecords: (options?: { table: string; records: { data: Record; }[]; keyMode: "names" | "ids"; } | { tableId: string; records: { data: Record; }[]; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { createTableRecords: PluginMeta; }; }; } & { deleteTableRecords: (options?: { table: string; records: string[]; } | { tableId: string; recordIds: string[]; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTableRecords: PluginMeta; }; }; } & { updateTableRecords: (options?: { table: string; records: { id: string; data: Record; }[]; keyMode: "names" | "ids"; } | { tableId: string; records: { id: string; data: Record; }[]; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { updateTableRecords: PluginMeta; }; }; } & { apps: ActionProxy & ZapierSdkApps; context: { meta: { "apps.{appKey}": { categories: string[]; packages: string[]; type: "function"; inputSchema: zod.ZodObject<{ connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; }, zod_v4_core.$strip>; returnType: string; }; "apps.{appKey}.{actionType}.{actionKey}": { categories: string[]; packages: string[]; type: "list"; inputSchema: zod.ZodObject<{ inputs: zod.ZodOptional>; connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; timeoutMs: zod.ZodOptional; }, zod_v4_core.$strip>; itemType: string; outputSchema: zod.ZodUnknown; }; }; }; } & { getProfile: (options?: Record | undefined) => Promise<{ data: { id: string; first_name: string; last_name: string; full_name: string; email: string; email_confirmed: boolean; timezone: string; }; }>; } & { context: { meta: { getProfile: PluginMeta; }; }; }>; type ZapierSdk = ReturnType; interface FormattedItem { title: string; id?: string; key?: string; keys?: string[]; description?: string; data?: unknown; details: Array<{ label?: string; text: string; style: "normal" | "dim" | "accent" | "warning" | "success"; }>; } interface FormatMetadata { format: (item: TItem) => FormattedItem; } interface OutputFormatter, TContext = unknown> { fetch?: (sdk: ZapierSdk, params: TParams, item: TItem, context: TContext | undefined) => Promise; format: (item: TItem, context?: TContext) => FormattedItem; } interface PromptConfig { type: "list" | "checkbox" | "confirm"; name: string; message: string; choices?: Array<{ name: string; value: unknown; /** * Optional secondary info shown after `name`. The CLI wraps it in * dimmed parens; an array is joined with ", ". Use for keys, ids, or * other context that's useful but shouldn't compete visually with * the primary label. */ hint?: string | string[]; }>; default?: unknown; filter?: (value: unknown) => unknown; /** * Return `true` for valid; a string for a custom invalid message; or * `false` for invalid with a generic fallback message ("X: invalid * value."). Prefer returning a string so users see something specific. */ validate?: (value: unknown) => boolean | string; } /** A PromptConfig narrowed to single-select list mode. */ type ListPromptConfig = PromptConfig & { type: "list"; }; interface Resolver { type: string; depends?: readonly string[] | string[]; } interface StaticResolver extends Resolver { type: "static"; inputType?: "text" | "password" | "email"; placeholder?: string; } /** * A resolver that always resolves to a fixed value, never prompts. Use to * pin an implicit parameter that downstream resolvers or SDK calls require * but the user shouldn't have to provide. Triggers, for example, are always * `actionType: "read"` from the SDK's perspective; createTriggerInbox * declares `actionType: { type: "constant", value: "read" }` so the * standard `actionKeyResolver` and `inputsResolver` (which depend on * `actionType`) work without any pinned variants. * * Constants attached to keys that aren't in the schema are seeded into * `resolvedParams` upfront, so dependent resolvers find them in context * without the key appearing in the user-facing surface (TS option type, * CLI flags, generated docs). */ interface ConstantResolver extends Resolver { type: "constant"; value: unknown; } /** * Fields shared by both variants of {@link DynamicResolver}. */ interface DynamicResolverBase extends Resolver { type: "dynamic"; prompt: (items: TItem[], params: TParams) => PromptConfig; /** Capabilities that expand results. The parameter resolver shows a hint for any that aren't enabled. */ requireCapabilities?: string[]; /** * Optional hook called before fetch/prompt. If it returns a non-null object, * resolvedValue is used directly and fetch/prompt are skipped entirely. Return * null to fall through to the normal resolution flow. Implementations should * catch their own errors and return null on failure rather than throwing, so * that a transient API error does not block the CLI entirely. */ tryResolveWithoutPrompt?: (sdk: ZapierSdk, params: TParams) => Promise<{ resolvedValue: unknown; } | null>; } /** * The classic dynamic-resolver variant: `fetch` returns a list of items * that the CLI renders as a search-filterable dropdown. The user picks one. */ interface DynamicListResolver extends DynamicResolverBase { /** Explicitly absent on the list variant — set `inputType: "search"` to opt into the search variant. */ inputType?: never; /** Only meaningful for the search variant; set to `never` here so TS catches misuse. */ placeholder?: never; fetch: (sdk: ZapierSdk, resolvedParams: TParams) => PromiseLike>; } /** * The search-input variant: the CLI prompts the user for free-form text * first, then calls `fetch` with `{ ...resolvedParams, search }`. * * `fetch` can short-circuit by returning a primitive (`string | number`), * which the CLI treats as an exact match — no dropdown is rendered. Any * other return (array, page, async iterable) is rendered as the normal * search-filterable dropdown. * * The `search` key is injected by the CLI at call time; it isn't part of * `TParams` because callers that invoke `fetch` directly (outside the CLI) * are responsible for passing it themselves. Search-mode resolvers should * type `TParams` as `{ search?: string; ...otherDeps }` to make this * explicit. */ interface DynamicSearchResolver extends Omit, "prompt"> { inputType: "search"; /** * Hint text appended to the search prompt's message. NOT used as * inquirer's `default` value, because inquirer prefills `default` as * editable text that the user has to delete before typing. */ placeholder?: string; /** * Search-mode always renders a single-select @inquirer/search dropdown, * so `prompt` must return a list-typed PromptConfig. Checkbox/confirm * configs would be silently ignored at runtime; the type narrows so * misuse fails at compile time. * * Note: a primitive return from `fetch` (string | number) is treated * as an exact match and short-circuits without running this prompt or * the resolver's validate/filter. Canonicalize inside `fetch` if the * exact-match path needs normalization. */ prompt: (items: TItem[], params: TParams) => ListPromptConfig; fetch: (sdk: ZapierSdk, resolvedParams: TParams) => PromiseLike>; } /** * A dynamic resolver — either a classic list (`inputType` absent) or a * search-input variant (`inputType: "search"`). The discriminator is the * `inputType` field; TS narrows to the right variant when you check it. */ type DynamicResolver> = DynamicListResolver | DynamicSearchResolver; interface ResolverFieldItem { type: string; key: string; title?: string; is_required?: boolean; value_type?: string; choices?: Array<{ label: string; value: string; }>; fields?: ResolverFieldItem[]; resolver?: ResolverMetadata; } interface FieldsResolver, TResult = Record> extends Resolver { type: "fields"; fetch: (sdk: ZapierSdk, resolvedParams: TParams) => Promise; transform?: (value: Record) => TResult; } interface ArrayResolver> extends Resolver { type: "array"; fetch: (sdk: ZapierSdk, resolvedParams: TParams) => Promise>; minItems?: number; maxItems?: number; } type ResolverMetadata> = StaticResolver | ConstantResolver | DynamicResolver | FieldsResolver | ArrayResolver; interface PositionalMetadata { positionalMeta: { positional: true; }; } declare function isPositional(schema: z.ZodType): boolean; declare const AppItemSchema: z.ZodObject<{ description: z.ZodOptional; is_hidden: z.ZodOptional; auth_type: z.ZodOptional; actions: z.ZodOptional; read_bulk: z.ZodOptional; write: z.ZodOptional; search: z.ZodOptional; search_or_write: z.ZodOptional; search_and_write: z.ZodOptional; filter: z.ZodOptional; }, z.core.$strip>>; is_deprecated: z.ZodOptional; is_beta: z.ZodOptional; is_premium: z.ZodOptional; slug: z.ZodString; age_in_days: z.ZodOptional; banner: z.ZodOptional; categories: z.ZodOptional>>; images: z.ZodOptional; url_32x32: z.ZodOptional; url_64x64: z.ZodOptional; url_128x128: z.ZodOptional; }, z.core.$strip>>; popularity: z.ZodOptional; has_filters: z.ZodOptional; has_reads: z.ZodOptional; has_searches: z.ZodOptional; has_searches_or_writes: z.ZodOptional; has_upfront_fields: z.ZodOptional; has_writes: z.ZodOptional; is_built_in: z.ZodOptional; is_featured: z.ZodOptional; is_invite: z.ZodOptional; is_public: z.ZodOptional; is_upcoming: z.ZodOptional; visibility: z.ZodOptional; primary_color: z.ZodOptional; secondary_color: z.ZodOptional; classification: z.ZodOptional; api_docs_url: z.ZodOptional; image: z.ZodOptional; title: z.ZodString; key: z.ZodString; implementation_id: z.ZodString; version: z.ZodOptional; }, z.core.$strip>; declare const ConnectionItemSchema: z.ZodObject<{ title: z.ZodOptional>; date: z.ZodString; is_invite_only: z.ZodBoolean; lastchanged: z.ZodOptional; destination_selected_api: z.ZodOptional>; is_private: z.ZodBoolean; shared_with_all: z.ZodBoolean; is_stale: z.ZodOptional; is_shared: z.ZodOptional; marked_stale_at: z.ZodOptional>; label: z.ZodOptional>; identifier: z.ZodOptional>; url: z.ZodOptional; groups: z.ZodOptional>>; members: z.ZodOptional; permissions: z.ZodOptional>; public_id: z.ZodOptional; account_public_id: z.ZodOptional; customuser_public_id: z.ZodOptional; id: z.ZodString; account_id: z.ZodString; implementation_id: z.ZodOptional; profile_id: z.ZodOptional; is_expired: z.ZodOptional; expired_at: z.ZodOptional>; app_key: z.ZodOptional; app_version: z.ZodOptional; }, z.core.$strip>; type ConnectionItem$1 = z.infer; declare const ActionItemSchema: z.ZodObject<{ id: z.ZodOptional; description: z.ZodString; key: z.ZodString; is_important: z.ZodOptional; is_hidden: z.ZodOptional; app_key: z.ZodString; app_version: z.ZodOptional; action_type: z.ZodEnum<{ filter: "filter"; read: "read"; read_bulk: "read_bulk"; run: "run"; search: "search"; search_and_write: "search_and_write"; search_or_write: "search_or_write"; write: "write"; }>; title: z.ZodString; type: z.ZodLiteral<"action">; }, z.core.$strip>; declare const InputFieldItemSchema: z.ZodObject<{ key: z.ZodString; type: z.ZodLiteral<"input_field">; default_value: z.ZodString; depends_on: z.ZodArray; description: z.ZodString; invalidates_input_fields: z.ZodBoolean; is_required: z.ZodBoolean; placeholder: z.ZodString; title: z.ZodString; value_type: z.ZodString; format: z.ZodOptional; items: z.ZodOptional>; }, z.core.$strip>; declare const InfoFieldItemSchema: z.ZodObject<{ key: z.ZodString; type: z.ZodLiteral<"info_field">; description: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; type FieldsetItemType = z.infer | z.infer | FieldsetItem; interface FieldsetItem { type: "fieldset"; key: string; title: string; fields: FieldsetItemType[]; } declare const RootFieldItemSchema: z.ZodUnion; default_value: z.ZodString; depends_on: z.ZodArray; description: z.ZodString; invalidates_input_fields: z.ZodBoolean; is_required: z.ZodBoolean; placeholder: z.ZodString; title: z.ZodString; value_type: z.ZodString; format: z.ZodOptional; items: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ key: z.ZodString; type: z.ZodLiteral<"info_field">; description: z.ZodString; title: z.ZodOptional; }, z.core.$strip>, z.ZodType>]>; type InputFieldItem$1 = z.infer; declare const UserProfileItemSchema: z.ZodObject<{ id: z.ZodString; first_name: z.ZodString; last_name: z.ZodString; full_name: z.ZodString; email: z.ZodString; email_confirmed: z.ZodBoolean; timezone: z.ZodString; }, z.core.$strip>; /** * Represents an app item returned by getApp and listApps functions * Inferred from AppItemSchema which extends the base App API schema */ type AppItem = z.infer; /** * Represents a connection item returned by listConnections functions * Inferred from ConnectionItemSchema which extends the base Connection API schema */ type ConnectionItem = z.infer; /** * Represents an action item returned by listActions functions * Inferred from ActionItemSchema which extends the base Action API schema */ type ActionItem$1 = z.infer; /** * Represents an input field item returned by listInputFields functions * Inferred from InputFieldItemSchema which extends the base Need API schema */ type InputFieldItem = z.infer; /** * Represents an info field item (help text/copy) returned by listInputFields functions * Inferred from InfoFieldItemSchema */ type InfoFieldItem = z.infer; /** * Represents a root field item (any field/fieldset type) returned by listInputFields * Inferred from RootFieldItemSchema - use as RootFieldItem[] */ type RootFieldItem = z.infer; /** * Represents a user profile item returned by getProfile function * Inferred from UserProfileItemSchema which extends the base UserProfile API schema */ type UserProfileItem = z.infer; /** * Standard error format returned by the Zapier API */ interface ApiError { status: number; code: string; title: string; detail: string; source?: unknown; meta?: unknown; } /** * Base options for all error constructors */ interface ErrorOptions { statusCode?: number; errors?: ApiError[]; cause?: unknown; response?: unknown; } /** * Base class for all Zapier SDK errors * Use instanceof ZapierError to check if an error is from the SDK */ declare abstract class ZapierError extends Error { abstract readonly name: string; abstract readonly code: string; statusCode?: number; errors?: ApiError[]; cause?: unknown; response?: unknown; constructor(message: string, options?: ErrorOptions); } /** * Error thrown when API requests fail */ declare class ZapierApiError extends ZapierError { readonly name = "ZapierApiError"; readonly code: "ZAPIER_API_ERROR"; constructor(message: string, options?: ErrorOptions); } /** * Error thrown when an app is not found */ declare class ZapierAppNotFoundError extends ZapierError { readonly name = "ZapierAppNotFoundError"; readonly code: "ZAPIER_APP_NOT_FOUND_ERROR"; appKey?: string; constructor(message: string, options?: ErrorOptions & { appKey?: string; }); } /** * Error thrown when validation fails (e.g., invalid parameters) */ declare class ZapierValidationError extends ZapierError { readonly name = "ZapierValidationError"; readonly code: "ZAPIER_VALIDATION_ERROR"; details?: unknown; constructor(message: string, options?: ErrorOptions & { details?: unknown; }); } /** * Error for unrecognized/unknown errors that get wrapped by safe functions */ declare class ZapierUnknownError extends ZapierError { readonly name = "ZapierUnknownError"; readonly code: "ZAPIER_UNKNOWN_ERROR"; constructor(message: string, options?: ErrorOptions); } /** * Error thrown for authentication and authorization failures (401/403) */ declare class ZapierAuthenticationError extends ZapierError { readonly name = "ZapierAuthenticationError"; readonly code: "ZAPIER_AUTHENTICATION_ERROR"; constructor(message: string, options?: ErrorOptions); } /** * Error thrown when a resource is not found (404) */ declare class ZapierNotFoundError extends ZapierError { readonly name: string; readonly code: string; constructor(message: string, options?: ErrorOptions); } /** * Error thrown when a requested resource is not found and the caller * provided a `resource` hint on the request, populating `resourceType` * and (optionally) `resourceId`. Subclass of `ZapierNotFoundError` so * `instanceof ZapierNotFoundError` checks continue to work. */ declare class ZapierResourceNotFoundError extends ZapierNotFoundError { readonly name = "ZapierResourceNotFoundError"; readonly code: "ZAPIER_RESOURCE_NOT_FOUND_ERROR"; resourceType?: string; resourceId?: string; constructor(message: string, options?: ErrorOptions & { resourceType?: string; resourceId?: string; }); } /** * Error thrown when required app or implementation configuration is missing */ declare class ZapierConfigurationError extends ZapierError { readonly name = "ZapierConfigurationError"; readonly code: "ZAPIER_CONFIGURATION_ERROR"; configType?: string; constructor(message: string, options?: ErrorOptions & { configType?: string; }); } /** * Error thrown when code bundling or compilation fails */ declare class ZapierBundleError extends ZapierError { readonly name = "ZapierBundleError"; readonly code: "ZAPIER_BUNDLE_ERROR"; buildErrors?: string[]; constructor(message: string, options?: ErrorOptions & { buildErrors?: string[]; }); } /** * Error thrown when operations timeout or exceed retry limits */ declare class ZapierTimeoutError extends ZapierError { readonly name = "ZapierTimeoutError"; readonly code: "ZAPIER_TIMEOUT_ERROR"; attempts?: number; maxAttempts?: number; constructor(message: string, options?: ErrorOptions & { attempts?: number; maxAttempts?: number; }); } /** * Error thrown when action execution fails due to errors returned from the third-party service * This happens when the Actions API returns a 200 status but includes errors in the response */ declare class ZapierActionError extends ZapierError { readonly name = "ZapierActionError"; readonly code: "ZAPIER_ACTION_ERROR"; appKey?: string; actionKey?: string; constructor(message: string, options?: ErrorOptions & { appKey?: string; actionKey?: string; }); get actionErrors(): ApiError[] | undefined; } /** * Error thrown when an operation conflicts with existing state (409). Common * cases: creating a named resource where a different one already exists with * the same name, or operating on a resource in an incompatible state. */ declare class ZapierConflictError extends ZapierError { readonly name = "ZapierConflictError"; readonly code: "ZAPIER_CONFLICT_ERROR"; resourceType?: string; constructor(message: string, options?: ErrorOptions & { resourceType?: string; }); } /** * Rate limit information extracted from response headers */ interface RateLimitInfo { /** How long to wait before retrying (from Retry-After or X-RateLimit-Reset) */ retryAfterMs?: number; /** Maximum requests allowed in the window (from X-RateLimit-Limit) */ limit?: number; /** Requests remaining in the current window (from X-RateLimit-Remaining) */ remaining?: number; /** When the rate limit window resets in ms since epoch (from X-RateLimit-Reset) */ resetMs?: number; } /** * Error thrown when rate limited (429) after all retries are exhausted */ declare class ZapierRateLimitError extends ZapierError { readonly name = "ZapierRateLimitError"; readonly code: "ZAPIER_RATE_LIMIT_ERROR"; rateLimit: RateLimitInfo; retries: number; constructor(message: string, options?: ErrorOptions & { rateLimit?: RateLimitInfo; retries?: number; }); } /** * Terminal status of an approval attempt, exposed on `ZapierApprovalError.approvalStatus`. * * - `pending`: The approval was created but not yet resolved. Only thrown in * `approvalMode: "throw"` — the caller is expected to surface the approval URL * to an end user (e.g. an LLM instructing its user to click the link). * - `denied`: A human explicitly rejected the approval in the UI. * - `policy_denied`: A policy rule blocked the request before (or instead of) * creating an approval. Cannot be approved by a human. * - `approval_required`: The backend requested approval, but `approvalMode` is * `"disabled"` (the default) so the SDK did not create an approval. Set * `approvalMode` to `"poll"` or `"throw"` (or the `ZAPIER_APPROVAL_MODE` env * var) to enable the approval flow. * - `timeout`: Poll mode exceeded `approvalTimeoutMs` without the approval * being resolved. * - `max_retries_exceeded`: A single request triggered more sequential approval * rounds than `maxApprovalRetries` allows (runaway-loop safeguard). */ type ApprovalStatus = "denied" | "timeout" | "pending" | "policy_denied" | "approval_required" | "max_retries_exceeded"; /** * Error thrown when a request requires approval and the approval is denied, times out, * or the auth type doesn't support the approval flow. */ declare class ZapierApprovalError extends ZapierError { readonly name = "ZapierApprovalError"; readonly code: "ZAPIER_APPROVAL_ERROR"; approvalId?: string; approvalStatus?: ApprovalStatus; approvalUrl?: string; pollUrl?: string; constructor(message: string, options?: ErrorOptions & { approvalId?: string; status?: ApprovalStatus; approvalUrl?: string; pollUrl?: string; }); } /** * Error thrown when Relay itself encounters an error (as opposed to the upstream partner API returning an error). * Indicated by the presence of the X-Relay-Error response header. */ declare class ZapierRelayError extends ZapierError { readonly name = "ZapierRelayError"; readonly code: "ZAPIER_RELAY_ERROR"; constructor(message: string, options?: ErrorOptions); } /** * Utility function to format error messages for display */ declare function formatErrorMessage(error: ZapierError): string; /** * Base class for all Zapier SDK signals. * * Signals are intentional control-flow throws — the user is signaling * intent to the SDK runtime, not reporting a failure. For example, a * callback throwing `ZapierReleaseTriggerMessageSignal` tells * `drainTriggerInbox` to release the message immediately rather than * leave it leased. * * Distinct from `ZapierError` (failures): signals are not errors and * shouldn't be caught by error-handling code via `instanceof * ZapierError`. Use `instanceof ZapierSignal` to discriminate intent * throws from real failures. */ declare abstract class ZapierSignal extends Error { abstract readonly name: string; abstract readonly code: string; constructor(message?: string); } declare const TriggerMessageStatusSchema: z.ZodUnion, z.ZodString]>; type TriggerMessageStatus = z.infer; declare const TriggerMessageItemSchema: z.ZodObject<{ id: z.ZodString; created_at: z.ZodString; status: z.ZodUnion, z.ZodString]>; message_attributes: z.ZodObject<{ lease_count: z.ZodNumber; error_message: z.ZodNullable; possible_duplicate_data: z.ZodBoolean; }, z.core.$strip>; }, z.core.$strip>; type TriggerMessageItem = z.infer; declare const LeasedTriggerMessageItemSchema: z.ZodObject<{ id: z.ZodString; created_at: z.ZodString; status: z.ZodUnion, z.ZodString]>; message_attributes: z.ZodObject<{ lease_count: z.ZodNumber; error_message: z.ZodNullable; possible_duplicate_data: z.ZodBoolean; }, z.core.$strip>; payload: z.ZodRecord; }, z.core.$strip>; type LeasedTriggerMessageItem = z.infer; /** * Signal an `onMessage` callback can throw to release the current * message back to the inbox immediately (status returns to * `available`) rather than leaving it leased until the lease * timeout. The actual release call is deferred to the end of the * drain so the same drain doesn't immediately re-lease it. * * Always triggers release regardless of `releaseOnError`. */ declare class ZapierReleaseTriggerMessageSignal extends ZapierSignal { readonly name = "ZapierReleaseTriggerMessageSignal"; readonly code: "ZAPIER_RELEASE_TRIGGER_MESSAGE_SIGNAL"; } /** * Signal an `onMessage` callback can throw to stop the drain after * the current batch — no further leases, no further callbacks. The * triggering message gets the same release-or-leave treatment as any * thrown error (per `releaseOnError`). Other in-flight messages in * the same batch finish normally before the command returns. * Already-leased-but-not-yet-started messages are released so * they're available for re-lease. */ declare class ZapierAbortDrainSignal extends ZapierSignal { readonly name = "ZapierAbortDrainSignal"; readonly code: "ZAPIER_ABORT_DRAIN_SIGNAL"; } /** * Per-message handler. Resolves to ack the message; rejects to * release-or-leave per `releaseOnError`. Throw a * `ZapierReleaseTriggerMessageSignal` for explicit release; throw a * `ZapierAbortDrainSignal` to stop the drain after the current * batch. */ type DrainTriggerInboxCallback = (message: LeasedTriggerMessageItem) => void | Promise; /** * Per-message error observer for `continueOnError: true` mode. * Called with the failure reason and the message; signals * (`ZapierSignal` subclasses) are filtered out — they're * control-flow throws, not failures to observe. Synchronous from * the loop's perspective; throwing from `onError` is swallowed, * since it's an observer not a flow controller. */ type DrainTriggerInboxErrorObserver = (error: unknown, message: LeasedTriggerMessageItem) => void | Promise; /** * Fields shared by both `drainTriggerInbox` and `watchTriggerInbox`. * `onMessage` is required at the type level; runtime validation in * the handler covers JS callers who bypass TS. */ interface TriggerInboxCommandSharedFields { inbox: string; onMessage: DrainTriggerInboxCallback; concurrency?: number; leaseLimit?: number; leaseSeconds?: number; releaseOnError?: boolean; continueOnError?: boolean; onError?: DrainTriggerInboxErrorObserver; signal?: AbortSignal; } /** * Hand-typed options for `drainTriggerInbox`. The Zod schema above is * for docs and registry; this type is what the SDK function accepts, * with `onMessage` / `onError` typed as proper callbacks instead of * opaque `z.function()`. */ type DrainTriggerInboxOptions = TriggerInboxCommandSharedFields & { maxMessages?: number; }; type WatchTriggerInboxOptions = TriggerInboxCommandSharedFields & { maxDrainIntervalSeconds?: number; }; declare const appsPlugin: (sdk: { fetch: (url: string | URL, init?: ZapierFetchInitOptions) => Promise; context: { meta: { fetch: { description: string; packages: string[]; categories: string[]; returnType: string; inputParameters: ({ name: string; schema: zod.ZodUnion]>; } | { name: string; schema: zod.ZodOptional>; headers: zod.ZodOptional>; body: zod.ZodOptional, zod.ZodCustom, zod.ZodRecord]>>; connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; callbackUrl: zod.ZodOptional; maxTime: zod.ZodOptional; }, zod_v4_core.$strip>>; })[]; }; }; }; } & { runAction: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; timeoutMs?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; timeoutMs?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult; } & { context: { meta: { runAction: PluginMeta; }; }; } & { context: { meta: Record; }; }) => { apps: ActionProxy & ZapierSdkApps; context: { meta: { "apps.{appKey}": { categories: string[]; packages: string[]; type: "function"; inputSchema: zod.ZodObject<{ connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; }, zod_v4_core.$strip>; returnType: string; }; "apps.{appKey}.{actionType}.{actionKey}": { categories: string[]; packages: string[]; type: "list"; inputSchema: zod.ZodObject<{ inputs: zod.ZodOptional>; connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; timeoutMs: zod.ZodOptional; }, zod_v4_core.$strip>; itemType: string; outputSchema: zod.ZodUnknown; }; }; }; }; type AppsPluginProvides = ReturnType; interface ZapierSdkApps { } declare const connectionsPlugin: (sdk: { context: Pick; } & { context: { meta: Record; }; }) => { context: { resolveConnection: (name: string) => Promise<{ connectionId: string | number; } | undefined>; getConnectionsMap: () => Promise | null>; }; }; type ConnectionsPluginProvides = ReturnType; interface ZapierFetchInitOptions extends RequestInit { /** @deprecated Use `connection` instead. */ connectionId?: string | number; connection?: string | number; /** @deprecated Use `connection` instead. */ authenticationId?: string | number; callbackUrl?: string; /** Maximum seconds to wait for a response, subject to a server-side limit. */ maxTime?: number; } /** * Fetch plugin, the primary way to make authenticated HTTP requests through Zapier's Relay service. * Mirrors the native fetch(url, init?) signature with additional Zapier-specific options. */ declare const fetchPlugin: (sdk: { context: { api: ApiClient; } & ConnectionsPluginProvides["context"]; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { fetch: (url: string | URL, init?: ZapierFetchInitOptions) => Promise; context: { meta: { fetch: { description: string; packages: string[]; categories: string[]; returnType: string; inputParameters: ({ name: string; schema: z.ZodUnion]>; } | { name: string; schema: z.ZodOptional>; headers: z.ZodOptional>; body: z.ZodOptional, z.ZodCustom, z.ZodRecord]>>; connectionId: z.ZodOptional>; connection: z.ZodOptional>; authenticationId: z.ZodOptional>; callbackUrl: z.ZodOptional; maxTime: z.ZodOptional; }, z.core.$strip>>; })[]; }; }; }; }; type FetchPluginProvides = ReturnType; declare const listAppsPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: { getResolvedManifest: () => Promise; getVersionedImplementationId: (appKey: string) => Promise; resolveAppKeys: ({ appKeys }: { appKeys: string[]; }) => Promise; updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise; addActionEntry: (options: AddActionEntryOptions) => Promise; findActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => ActionEntry | null; listActionEntries: ({ configPath, }?: { configPath?: string; }) => Promise>; deleteActionEntry: ({ name, configPath, skipWrite, }: { name: string; configPath?: string; skipWrite?: boolean; }) => Promise; hasActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => boolean; findManifestEntry: typeof findManifestEntry; readManifestFromFile: typeof readManifestFromFile; getManifestConnections: () => Promise | null>; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { listApps: (options?: ({ search?: string | undefined; apps?: string[] | undefined; appKeys?: string[] | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }>; } & { context: { meta: { listApps: PluginMeta; }; }; }; type ListAppsPluginProvides = ReturnType; declare const listActionsPlugin: (sdk: { context: { getResolvedManifest: () => Promise; getVersionedImplementationId: (appKey: string) => Promise; resolveAppKeys: ({ appKeys }: { appKeys: string[]; }) => Promise; updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise; addActionEntry: (options: AddActionEntryOptions) => Promise; findActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => ActionEntry | null; listActionEntries: ({ configPath, }?: { configPath?: string; }) => Promise>; deleteActionEntry: ({ name, configPath, skipWrite, }: { name: string; configPath?: string; skipWrite?: boolean; }) => Promise; hasActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => boolean; findManifestEntry: typeof findManifestEntry; readManifestFromFile: typeof readManifestFromFile; getManifestConnections: () => Promise | null>; }; } & { context: { api: ApiClient; getVersionedImplementationId: GetVersionedImplementationId; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { listActions: (options?: (({ app: string; actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listActions: PluginMeta; }; }; }; type ListActionsPluginProvides = ReturnType; declare const listActionInputFieldsPlugin: (sdk: { getApp: (options?: { app: string; } | { appKey: string; } | undefined) => Promise<{ data: { slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }; }>; } & { context: { meta: { getApp: PluginMeta; }; }; } & { getAction: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; } | undefined) => Promise<{ data: { description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getAction: PluginMeta; }; }; } & { context: { api: ApiClient; getVersionedImplementationId: GetVersionedImplementationId; } & ConnectionsPluginProvides["context"]; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { listActionInputFields: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key: string; type: "input_field"; default_value: string; depends_on: string[]; description: string; invalidates_input_fields: boolean; is_required: boolean; placeholder: string; title: string; value_type: string; format?: string | undefined; items?: { type: string; } | undefined; } | { key: string; type: "info_field"; description: string; title?: string | undefined; } | FieldsetItem>; } & { context: { meta: { listActionInputFields: PluginMeta; }; }; }; type ListActionInputFieldsPluginProvides = ReturnType; declare const listActionInputFieldChoicesPlugin: (sdk: { getAction: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; } | undefined) => Promise<{ data: { description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getAction: PluginMeta; }; }; } & { context: { api: ApiClient; getVersionedImplementationId: GetVersionedImplementationId; } & ConnectionsPluginProvides["context"]; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { listActionInputFieldChoices: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; inputField: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; inputFieldKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; page?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ key?: string | undefined; label?: string | undefined; sample?: string | undefined; value?: string | undefined; }>; } & { context: { meta: { listActionInputFieldChoices: PluginMeta; }; }; }; type ListActionInputFieldChoicesPluginProvides = ReturnType; declare const getActionInputFieldsSchemaPlugin: (sdk: { getAction: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; } | undefined) => Promise<{ data: { description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getAction: PluginMeta; }; }; } & { context: { api: ApiClient; getVersionedImplementationId: GetVersionedImplementationId; } & ConnectionsPluginProvides["context"]; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { getActionInputFieldsSchema: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; } | undefined) => Promise<{ data: Record; }>; } & { context: { meta: { getActionInputFieldsSchema: PluginMeta; }; }; }; type GetActionInputFieldsSchemaPluginProvides = ReturnType; declare const listConnectionsPlugin: (sdk: { context: { getResolvedManifest: () => Promise; getVersionedImplementationId: (appKey: string) => Promise; resolveAppKeys: ({ appKeys }: { appKeys: string[]; }) => Promise; updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise; addActionEntry: (options: AddActionEntryOptions) => Promise; findActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => ActionEntry | null; listActionEntries: ({ configPath, }?: { configPath?: string; }) => Promise>; deleteActionEntry: ({ name, configPath, skipWrite, }: { name: string; configPath?: string; skipWrite?: boolean; }) => Promise; hasActionEntry: ({ name, manifest, }: { name: string; manifest: Manifest; }) => boolean; findManifestEntry: typeof findManifestEntry; readManifestFromFile: typeof readManifestFromFile; getManifestConnections: () => Promise | null>; }; } & { context: { api: ApiClient; getVersionedImplementationId: GetVersionedImplementationId; } & CapabilitiesContext & ConnectionsPluginProvides["context"]; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { listConnections: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listConnections: PluginMeta; }; }; }; type ListConnectionsPluginProvides = ReturnType; declare const listClientCredentialsPlugin: (sdk: { context: { api: ApiClient; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { listClientCredentials: (options?: ({ pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ client_id: string; name: string; allowed_scopes: ("credentials" | "external")[]; created_at?: string | null | undefined; updated_at?: string | undefined; }>; } & { context: { meta: { listClientCredentials: PluginMeta; }; }; }; type ListClientCredentialsPluginProvides = ReturnType; declare const createClientCredentialsPlugin: (sdk: { context: { api: ApiClient; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { createClientCredentials: (options?: { name: string; allowedScopes: ("credentials" | "external")[]; policy?: Record | undefined; } | undefined) => Promise<{ data: { client_id: string; name: string; client_secret: string; }; }>; } & { context: { meta: { createClientCredentials: PluginMeta; }; }; }; type CreateClientCredentialsPluginProvides = ReturnType; declare const deleteClientCredentialsPlugin: (sdk: { context: { api: ApiClient; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { deleteClientCredentials: (options?: { clientId: string; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteClientCredentials: PluginMeta; }; }; }; type DeleteClientCredentialsPluginProvides = ReturnType; declare const getAppPlugin: (sdk: { listApps: (options?: ({ search?: string | undefined; apps?: string[] | undefined; appKeys?: string[] | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }>; } & { context: { meta: { listApps: PluginMeta; }; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { getApp: (options?: { app: string; } | { appKey: string; } | undefined) => Promise<{ data: { slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }; }>; } & { context: { meta: { getApp: PluginMeta; }; }; }; type GetAppPluginProvides = ReturnType; declare const getActionPlugin: (sdk: { listActions: (options?: (({ app: string; actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listActions: PluginMeta; }; }; } & { context: { api: ApiClient; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { getAction: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; } | undefined) => Promise<{ data: { description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getAction: PluginMeta; }; }; }; type GetActionPluginProvides = ReturnType; declare const getConnectionPlugin: (sdk: { context: { api: ApiClient; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { getConnection: (options?: { connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getConnection: PluginMeta; }; }; }; type GetConnectionPluginProvides = ReturnType; declare const findFirstConnectionPlugin: (sdk: { listConnections: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listConnections: PluginMeta; }; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { findFirstConnection: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { findFirstConnection: PluginMeta; }; }; }; type FindFirstConnectionPluginProvides = ReturnType; declare const findUniqueConnectionPlugin: (sdk: { listConnections: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listConnections: PluginMeta; }; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { findUniqueConnection: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { findUniqueConnection: PluginMeta; }; }; }; type FindUniqueConnectionPluginProvides = ReturnType; /** * Deprecated Authentication Plugins * * These plugins provide backward compatibility for the old authentication naming. * They are simple aliases that delegate to the connection plugins. * The connection plugins already accept both connectionId and authenticationId parameters. * * @deprecated Use the connection equivalents instead: * - listAuthentications -> listConnections * - getAuthentication -> getConnection * - findFirstAuthentication -> findFirstConnection * - findUniqueAuthentication -> findUniqueConnection */ /** * @deprecated Use listConnections instead */ declare const listAuthenticationsPlugin: (sdk: { listConnections: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; } & { context: { meta: { listConnections: PluginMeta; }; }; } & { context: { meta: Record; }; }) => { listAuthentications: (options?: ({ title?: string | undefined; search?: string | undefined; owner?: string | undefined; app?: string | undefined; appKey?: string | undefined; connections?: string[] | undefined; connectionIds?: string[] | undefined; authenticationIds?: string[] | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }>; context: { meta: { listAuthentications: { packages: string[]; categories: string[]; type: "list"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; owner: zod.ZodOptional; app: zod.ZodOptional; appKey: zod.ZodOptional; connections: zod.ZodOptional>; connectionIds: zod.ZodOptional>; authenticationIds: zod.ZodOptional>; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; pageSize: zod.ZodOptional; maxItems: zod.ZodOptional; cursor: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; }; type ListAuthenticationsPluginProvides = ReturnType; /** * @deprecated Use getConnection instead */ declare const getAuthenticationPlugin: (sdk: { getConnection: (options?: { connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getConnection: PluginMeta; }; }; } & { context: { meta: Record; }; }) => { getAuthentication: (options?: { connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { getAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ connection: zod.ZodOptional>; connectionId: zod.ZodOptional>; authenticationId: zod.ZodOptional>; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; }; type GetAuthenticationPluginProvides = ReturnType; /** * @deprecated Use findFirstConnection instead */ declare const findFirstAuthenticationPlugin: (sdk: { findFirstConnection: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { findFirstConnection: PluginMeta; }; }; } & { context: { meta: Record; }; }) => { findFirstAuthentication: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { findFirstAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; appKey: zod.ZodOptional; app: zod.ZodOptional; owner: zod.ZodOptional; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; }; type FindFirstAuthenticationPluginProvides = ReturnType; /** * @deprecated Use findUniqueConnection instead */ declare const findUniqueAuthenticationPlugin: (sdk: { findUniqueConnection: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { findUniqueConnection: PluginMeta; }; }; } & { context: { meta: Record; }; }) => { findUniqueAuthentication: (options?: { title?: string | undefined; search?: string | undefined; appKey?: string | undefined; app?: string | undefined; owner?: string | undefined; account?: string | undefined; accountId?: string | undefined; includeShared?: boolean | undefined; isExpired?: boolean | undefined; expired?: boolean | undefined; } | undefined) => Promise<{ data: { date: string; is_invite_only: boolean; is_private: boolean; shared_with_all: boolean; id: string; account_id: string; title?: string | null | undefined; lastchanged?: string | undefined; destination_selected_api?: string | null | undefined; is_stale?: string | undefined; is_shared?: string | undefined; marked_stale_at?: string | null | undefined; label?: string | null | undefined; identifier?: string | null | undefined; url?: string | undefined; groups?: Record[] | undefined; members?: string | undefined; permissions?: Record | undefined; public_id?: string | undefined; account_public_id?: string | undefined; customuser_public_id?: string | undefined; implementation_id?: string | undefined; profile_id?: string | undefined; is_expired?: string | undefined; expired_at?: string | null | undefined; app_key?: string | undefined; app_version?: string | undefined; }; }>; context: { meta: { findUniqueAuthentication: { packages: string[]; categories: string[]; type: "item"; itemType: string; inputSchema: zod.ZodObject<{ title: zod.ZodOptional; search: zod.ZodOptional; appKey: zod.ZodOptional; app: zod.ZodOptional; owner: zod.ZodOptional; account: zod.ZodOptional; accountId: zod.ZodOptional; includeShared: zod.ZodOptional; isExpired: zod.ZodOptional; expired: zod.ZodOptional; }, zod_v4_core.$strip>; outputSchema: zod.ZodObject<{ title: zod.ZodOptional>; date: zod.ZodString; is_invite_only: zod.ZodBoolean; lastchanged: zod.ZodOptional; destination_selected_api: zod.ZodOptional>; is_private: zod.ZodBoolean; shared_with_all: zod.ZodBoolean; is_stale: zod.ZodOptional; is_shared: zod.ZodOptional; marked_stale_at: zod.ZodOptional>; label: zod.ZodOptional>; identifier: zod.ZodOptional>; url: zod.ZodOptional; groups: zod.ZodOptional>>; members: zod.ZodOptional; permissions: zod.ZodOptional>; public_id: zod.ZodOptional; account_public_id: zod.ZodOptional; customuser_public_id: zod.ZodOptional; id: zod.ZodString; account_id: zod.ZodString; implementation_id: zod.ZodOptional; profile_id: zod.ZodOptional; is_expired: zod.ZodOptional; expired_at: zod.ZodOptional>; app_key: zod.ZodOptional; app_version: zod.ZodOptional; }, zod_v4_core.$strip>; }; }; }; }; type FindUniqueAuthenticationPluginProvides = ReturnType; declare const CONTEXT_CACHE_TTL_MS = 60000; declare const CONTEXT_CACHE_MAX_SIZE = 500; declare const runActionPlugin: (sdk: { getAction: (options?: { app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; } | undefined) => Promise<{ data: { description: string; key: string; app_key: string; action_type: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; title: string; type: "action"; id?: string | undefined; is_important?: boolean | undefined; is_hidden?: boolean | undefined; app_version?: string | undefined; }; }>; } & { context: { meta: { getAction: PluginMeta; }; }; } & { getApp: (options?: { app: string; } | { appKey: string; } | undefined) => Promise<{ data: { slug: string; title: string; key: string; implementation_id: string; description?: string | undefined; is_hidden?: boolean | undefined; auth_type?: string | undefined; actions?: { read?: number | undefined; read_bulk?: number | undefined; write?: number | undefined; search?: number | undefined; search_or_write?: number | undefined; search_and_write?: number | undefined; filter?: number | undefined; } | undefined; is_deprecated?: boolean | undefined; is_beta?: boolean | undefined; is_premium?: boolean | undefined; age_in_days?: number | undefined; banner?: string | undefined; categories?: { id: number; name: string; slug: string; }[] | undefined; images?: { url_16x16?: string | undefined; url_32x32?: string | undefined; url_64x64?: string | undefined; url_128x128?: string | undefined; } | undefined; popularity?: number | undefined; has_filters?: boolean | undefined; has_reads?: boolean | undefined; has_searches?: boolean | undefined; has_searches_or_writes?: boolean | undefined; has_upfront_fields?: boolean | undefined; has_writes?: boolean | undefined; is_built_in?: boolean | undefined; is_featured?: boolean | undefined; is_invite?: boolean | undefined; is_public?: boolean | undefined; is_upcoming?: boolean | undefined; visibility?: string | undefined; primary_color?: string | undefined; secondary_color?: string | undefined; classification?: string | undefined; api_docs_url?: string | undefined; image?: string | undefined; version?: string | undefined; }; }>; } & { context: { meta: { getApp: PluginMeta; }; }; } & { context: { api: ApiClient; getVersionedImplementationId: GetVersionedImplementationId; } & ConnectionsPluginProvides["context"]; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { runAction: (options?: (({ app: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; action: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; timeoutMs?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } | { appKey: string; actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write"; actionKey: string; connection?: string | number | undefined; connectionId?: string | number | null | undefined; authenticationId?: string | number | null | undefined; inputs?: Record | undefined; timeoutMs?: number | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult; } & { context: { meta: { runAction: PluginMeta; }; }; }; type RunActionPluginProvides = ReturnType; /** * @deprecated Use `sdk.fetch(url, init?)` instead. This plugin now delegates * to the fetch plugin and is kept only for backward compatibility. It is * hidden from the CLI/MCP registries. */ declare const requestPlugin: (sdk: { fetch: (url: string | URL, init?: ZapierFetchInitOptions) => Promise; context: { meta: { fetch: { description: string; packages: string[]; categories: string[]; returnType: string; inputParameters: ({ name: string; schema: zod.ZodUnion]>; } | { name: string; schema: zod.ZodOptional>; headers: zod.ZodOptional>; body: zod.ZodOptional, zod.ZodCustom, zod.ZodRecord]>>; connectionId: zod.ZodOptional>; connection: zod.ZodOptional>; authenticationId: zod.ZodOptional>; callbackUrl: zod.ZodOptional; maxTime: zod.ZodOptional; }, zod_v4_core.$strip>>; })[]; }; }; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { request: (options?: { url: string; method?: "POST" | "GET" | "DELETE" | "PUT" | "PATCH" | "HEAD" | "OPTIONS" | undefined; body?: any; connection?: string | number | undefined; connectionId?: string | number | undefined; authenticationId?: string | number | undefined; callbackUrl?: string | undefined; headers?: Record | [string, string][] | Headers | undefined; } | undefined) => Promise; } & { context: { meta: { request: PluginMeta; }; }; }; type RequestPluginProvides = ReturnType; declare const getProfilePlugin: (sdk: { context: { api: ApiClient; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { getProfile: (options?: Record | undefined) => Promise<{ data: { id: string; first_name: string; last_name: string; full_name: string; email: string; email_confirmed: boolean; timezone: string; }; }>; } & { context: { meta: { getProfile: PluginMeta; }; }; }; type GetProfilePluginProvides = ReturnType; interface ApiPluginOptions extends BaseSdkOptions { } declare const apiPlugin: (sdk: { context: { options: BaseSdkOptions; }; } & { context: { meta: Record; }; }) => { context: { api: ApiClient; resolveCredentials: () => Promise; }; }; type ApiPluginProvides = ReturnType; /** * Generic utility functions for creating paginated SDK functions */ /** * Callbacks for telemetry events during function execution */ interface TelemetryCallbacks { onMethodCalled?: (data: { methodName: string; durationMs: number; success: boolean; error?: Error; argumentCount: number; isPaginated: boolean; }) => void; } /** * Higher-order function that creates a function from a core function * * @param coreFn - Function that returns T directly or throws errors * @param schema - Optional Zod schema for validation * @param telemetry - Optional telemetry callbacks * @returns A function that normalizes and rethrows errors */ declare function createFunction(coreFn: (options: TOptions) => Promise, schema?: z.ZodSchema, telemetry?: TelemetryCallbacks): (options?: TOptions) => Promise; declare function runWithTelemetryContext(fn: () => T): T; /** * String utility functions for the Zapier SDK */ /** * Converts a string to title case, handling various input formats: * - camelCase: "firstName" → "First Name" * - snake_case: "first_name" → "First Name" * - kebab-case: "first-name" → "First Name" * - mixed formats: "first_name-value" → "First Name Value" */ declare function toTitleCase(input: string): string; /** * Converts a string to snake_case, handling various input formats: * - camelCase: "firstName" → "first_name" * - kebab-case: "first-name" → "first_name" * - title case: "First Name" → "first_name" * - mixed formats: "first-Name Value" → "first_name_value" * - starts with number: "123abc" → "_123abc" */ declare function toSnakeCase(input: string): string; /** * Batch Operation Utilities * * This module provides utilities for executing multiple async operations * with concurrency control and retry logic. */ /** * Options for batch execution */ interface BatchOptions { /** * Maximum number of concurrent operations (default: 10) * Lower values are more "polite" but slower * Higher values are faster but risk rate limits */ concurrency?: number; /** * Whether to retry failed operations (default: true) * When enabled, each operation gets up to MAX_CONSECUTIVE_ERRORS retries */ retry?: boolean; /** * Delay in milliseconds between starting batches (default: 100ms) * Adds a small delay between concurrent batches to avoid burst patterns */ batchDelay?: number; /** * Overall timeout for the entire batch operation in milliseconds (default: 180000ms / 3 minutes) * When exceeded, throws ZapierTimeoutError and stops processing remaining tasks */ timeoutMs?: number; /** * Timeout for individual tasks in milliseconds (default: none) * When set, each task will be cancelled if it exceeds this duration * Tasks that timeout will be marked as rejected in the results */ taskTimeoutMs?: number; } /** * Execute multiple async operations with concurrency limiting and retry logic * * This prevents overwhelming APIs by: * 1. Limiting concurrent operations (worker pool pattern) * 2. Adding small delays between batches to avoid burst detection * 3. Retrying failed operations with exponential backoff * * Problem Solved: * - Rate limit prevention: Steady stream instead of burst requests * - Connection pool management: Stays within browser/Node limits (~6-8 per domain) * - Resilience: Transient failures are retried automatically * - Observability: Returns detailed success/failure info for each operation * * Example Usage: * ```typescript * // Instead of Promise.allSettled (fires all at once): * const results = await Promise.allSettled( * actions.map(a => sdk.listInputFields(a)) * ); * * // Use batch (controlled concurrency): * const results = await batch( * actions.map(a => () => sdk.listInputFields(a)), * { concurrency: 10, retry: true } * ); * ``` * * @param tasks - Array of functions that return promises (NOT promises themselves!) * @param options - Configuration for concurrency and retry behavior * @returns Promise resolving to array of settled results (same as Promise.allSettled) */ declare function batch(tasks: (() => Promise)[], options?: BatchOptions): Promise[]>; type AppKeyResolver = DynamicResolver; declare const appKeyResolver: AppKeyResolver; interface ActionTypeItem { key: string; name: string; } declare const actionTypeResolver: DynamicResolver; interface ActionItem { key: string; title?: string; name?: string; description?: string; action_type: string; is_hidden?: boolean; } declare const actionKeyResolver: DynamicResolver; type ConnectionIdResolver = DynamicResolver; declare const connectionIdResolver: ConnectionIdResolver; declare const connectionIdGenericResolver: ConnectionIdResolver; type InputsResolver = { type: "fields"; depends: readonly string[]; fetch: (sdk: any, resolvedParams: { app: string; action: string; actionType: ActionTypeProperty; connection: string | number; inputs?: Record; }) => Promise; }; declare const inputsResolver: InputsResolver; declare const inputsAllOptionalResolver: InputsResolver; declare const inputFieldKeyResolver: DynamicResolver; }>; declare const clientCredentialsNameResolver: StaticResolver; declare const ClientCredentialsItemSchema: z.ZodObject<{ client_id: z.ZodString; name: z.ZodString; allowed_scopes: z.ZodArray>; created_at: z.ZodOptional>; updated_at: z.ZodOptional; }, z.core.$strip>; type ClientCredentialsItem = z.infer; declare const clientIdResolver: DynamicResolver; declare const TableItemSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; description: z.ZodOptional; created_at: z.ZodString; edited_at: z.ZodString; kind: z.ZodEnum<{ table: "table"; virtual_table: "virtual_table"; }>; account_id: z.ZodString; profile_id: z.ZodString; parent_table_id: z.ZodOptional; }, z.core.$strip>; type TableItem = z.infer; declare const tableIdResolver: DynamicResolver; declare const TriggerInboxItemSchema: z.ZodObject<{ id: z.ZodString; created_at: z.ZodString; name: z.ZodNullable; status: z.ZodUnion, z.ZodString]>; paused_reason: z.ZodNullable, z.ZodString]>>; notification_url: z.ZodNullable; subscription: z.ZodObject<{ connection_id: z.ZodUnion; app_key: z.ZodString; action_key: z.ZodString; inputs: z.ZodRecord; }, z.core.$strip>; }, z.core.$strip>; type TriggerInboxItem = z.infer; declare const triggerInboxResolver: DynamicResolver; declare const WorkflowItemSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; description: z.ZodNullable; trigger_url: z.ZodString; enabled: z.ZodBoolean; current_version_id: z.ZodNullable; created_at: z.ZodString; updated_at: z.ZodString; }, z.core.$strip>; type WorkflowItem = z.infer; declare const workflowIdResolver: DynamicResolver; declare const RunItemSchema: z.ZodObject<{ id: z.ZodString; status: z.ZodEnum<{ initialized: "initialized"; started: "started"; finished: "finished"; failed: "failed"; cancelled: "cancelled"; }>; input: z.ZodUnknown; output: z.ZodNullable; error: z.ZodNullable>; execution_id: z.ZodNullable; is_private: z.ZodBoolean; created_at: z.ZodString; updated_at: z.ZodString; }, z.core.$strip>; type RunItem = z.infer; declare const durableRunIdResolver: DynamicResolver; declare const WorkflowVersionListItemSchema: z.ZodObject<{ id: z.ZodString; workflow_id: z.ZodString; zapier_durable_version: z.ZodString; dependencies: z.ZodNullable>; created_by_user_id: z.ZodString; created_at: z.ZodString; }, z.core.$strip>; type WorkflowVersionListItem = z.infer; declare const workflowVersionIdResolver: DynamicResolver; declare const WorkflowRunListItemSchema: z.ZodObject<{ id: z.ZodString; trigger_id: z.ZodNullable; durable_run_id: z.ZodNullable; workflow_version_id: z.ZodNullable; status: z.ZodUnion, z.ZodString]>; input: z.ZodUnknown; output: z.ZodNullable; error: z.ZodNullable; created_at: z.ZodString; updated_at: z.ZodString; }, z.core.$strip>; type WorkflowRunListItem = z.infer; declare const workflowRunIdResolver: DynamicResolver; declare const triggerMessagesResolver: DynamicResolver; declare const RecordItemSchema: z.ZodObject<{ id: z.ZodString; data: z.ZodRecord; created_at: z.ZodString; edited_at: z.ZodString; deleted_at: z.ZodOptional>; }, z.core.$strip>; type RecordItem = z.infer; declare const tableRecordIdResolver: DynamicResolver; declare const tableRecordIdsResolver: DynamicResolver; declare const FieldItemSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; text: "text"; datetime: "datetime"; decimal: "decimal"; json: "json"; email: "email"; link: "link"; multiple_string: "multiple_string"; labeled_string: "labeled_string"; multiple_labeled_string: "multiple_labeled_string"; multiple_text: "multiple_text"; multiple_boolean: "multiple_boolean"; multiple_number: "multiple_number"; multiple_decimal: "multiple_decimal"; multiple_datetime: "multiple_datetime"; uuid: "uuid"; multiple_uuid: "multiple_uuid"; multiple_json: "multiple_json"; formula: "formula"; button_trigger_zap: "button_trigger_zap"; button_continue_zap: "button_continue_zap"; multiple_email: "multiple_email"; multiple_link: "multiple_link"; currency: "currency"; phone_number: "phone_number"; ai_formula: "ai_formula"; linked_record: "linked_record"; multiple_linked_record: "multiple_linked_record"; }>; name: z.ZodString; created_at: z.ZodOptional; edited_at: z.ZodOptional; options: z.ZodOptional>; config: z.ZodOptional>; deleted_at: z.ZodOptional>; }, z.core.$strip>; type FieldItem = z.infer; declare const tableFieldIdsResolver: DynamicResolver; declare const tableNameResolver: StaticResolver; declare const tableFieldsResolver: ArrayResolver; declare const tableRecordsResolver: ArrayResolver<{ table: string; }>; declare const tableUpdateRecordsResolver: ArrayResolver<{ table: string; }>; declare const tableFiltersResolver: ArrayResolver<{ table: string; }>; declare const tableSortResolver: FieldsResolver<{ table: string; }>; /** * Options for resolving auth tokens. */ interface ResolveAuthTokenOptions { credentials?: Credentials; /** @deprecated Use `credentials` instead */ token?: string; onEvent?: EventCallback; fetch?: typeof globalThis.fetch; baseUrl?: string; /** * Additional OAuth scopes required for this request. When using client * credentials, these scopes will be merged with any scopes specified in * the credentials object during token exchange. */ requiredScopes?: string[]; /** Enable debug logging for auth operations. */ debug?: boolean; /** * Pluggable key-value cache used to cache access tokens across * process boundaries. When omitted, the SDK tries to load a default * adapter from the cli-login package (file system + keychain) and * falls back to in-memory cache if none is available. */ cache?: ZapierCache; } /** * Clear in-process caches. Useful for testing or to force the next * resolve to re-import the default cache adapter. Does not touch * persistent cache — use `invalidateCachedToken` for that. */ declare function clearTokenCache(): void; /** * Invalidate the cached token for a given client_credentials identity. * Called on 401 so the next request re-exchanges. Clears both the * in-process pending-exchange map and the persistent layer via the * resolved cache adapter. */ declare function invalidateCachedToken(options: { clientId: string; scopes: string[]; baseUrl: string; cache?: ZapierCache; }): Promise; /** * Options for getTokenFromCliLogin. */ interface CliLoginOptions { onEvent?: EventCallback; fetch?: typeof globalThis.fetch; credentials?: { type?: "pkce"; clientId: string; baseUrl?: string; scope?: string; }; debug?: boolean; } type CliLoginModule = typeof _zapier_zapier_sdk_cli_login & { getActiveCredentials?: (options?: { baseUrl?: string; }) => { clientId: string; scopes: string[]; baseUrl?: string; } | undefined; getStoredClientCredentials?: (options?: { baseUrl?: string; }) => Promise; }; /** * Inject an already-loaded CLI login module so the SDK skips its dynamic import. * This guarantees CLI and SDK share the same module instance in the same process. */ declare function injectCliLogin(module: CliLoginModule): void; /** * Returns whether a CLI login package is available. * `undefined` if no import has been attempted yet, `true` if found, `false` if not. */ declare function isCliLoginAvailable(): boolean | undefined; /** * Attempts to get a token from the CLI login package. * * Returns undefined if no valid token is found or no login package is available. * Throws if there's an actual error (like token refresh failure). */ declare function getTokenFromCliLogin(options: CliLoginOptions): Promise; /** * Resolves an auth token from wherever it can be found. * * Resolution order: * 1. Explicit credentials option (or deprecated token option) * 2. Environment variables * 3. CLI login package (if available) * * For different credential types: * - String: Used directly as the token * - Client credentials: Exchanged for an access token (with caching) * - PKCE: Delegates to CLI login (throws if not available) * * Returns undefined if no valid token is found. */ declare function resolveAuthToken(options?: ResolveAuthTokenOptions): Promise; /** * Invalidate the cached token for the given credentials, if applicable. * This is called when we receive a 401 response, indicating the token * is no longer valid. Only affects client_credentials flow tokens. */ declare function invalidateCredentialsToken(options: { credentials?: Credentials; token?: string; baseUrl?: string; requiredScopes?: string[]; cache?: ZapierCache; }): Promise; /** * Credentials Resolution * * This module provides the core logic for resolving credentials from various sources: * - Explicit credentials option * - Deprecated token option * - Environment variables (new and deprecated) * - CLI login stored tokens */ /** * Options for resolving credentials. */ interface ResolveCredentialsOptions { credentials?: Credentials; /** @deprecated Use `credentials` instead */ token?: string; /** SDK base URL - used to derive auth base URL if not specified in credentials */ baseUrl?: string; } /** * Resolve credentials from environment variables. * * Precedence: * 1. ZAPIER_CREDENTIALS (string token) * 2. ZAPIER_CREDENTIALS_CLIENT_ID + ZAPIER_CREDENTIALS_CLIENT_SECRET (client credentials) * 3. ZAPIER_CREDENTIALS_CLIENT_ID alone (PKCE) * 4. Deprecated ZAPIER_TOKEN, ZAPIER_AUTH_* vars (with warnings) * * @param sdkBaseUrl - SDK base URL used to derive auth base URL if not specified */ declare function resolveCredentialsFromEnv(sdkBaseUrl?: string): ResolvedCredentials | undefined; /** * Resolve credentials from all possible sources. * * Precedence: * 1. Explicit credentials option * 2. Deprecated token option (with warning) * 3. Environment variables * 4. CLI login stored token (handled separately in auth.ts) * * If credentials is a function, it is called and must return * a string or credentials object (not another function). * * The baseUrl option is used to derive the auth base URL if not * specified in credentials. */ declare function resolveCredentials(options?: ResolveCredentialsOptions): Promise; /** * Extract the base URL from credentials for use in auth flows. */ declare function getBaseUrlFromCredentials(credentials: ResolvedCredentials | undefined): string | undefined; /** * Extract the client ID from credentials for use in auth flows. */ declare function getClientIdFromCredentials(credentials: ResolvedCredentials | undefined): string | undefined; /** * Logging utilities for the SDK */ /** * Log a deprecation warning. Each unique message is only logged once per process. */ declare function logDeprecation(message: string): void; /** * Reset the set of logged deprecation warnings. * Useful for testing. */ declare function resetDeprecationWarnings(): void; /** * SDK Constants * * This module contains shared constants used throughout the SDK. */ /** * Base URL for Zapier API endpoints */ declare const ZAPIER_BASE_URL: string; /** * Calling service name for telemetry headers. * * Read lazily so tests can stub the env var after module import. */ declare function getZapierSdkService(): string | undefined; /** * Maximum number of items that can be requested per page across all paginated functions */ declare const MAX_PAGE_LIMIT = 10000; /** * Default number of items per page for paginated functions */ declare const DEFAULT_PAGE_SIZE = 100; /** * Default timeout for action execution (in milliseconds) */ declare const DEFAULT_ACTION_TIMEOUT_MS = 180000; /** * Network retry configuration from environment variables */ declare const ZAPIER_MAX_NETWORK_RETRIES: number; declare const ZAPIER_MAX_NETWORK_RETRY_DELAY_MS: number; /** * Upper bound on the concurrency cap. Anything beyond this is almost * certainly a configuration mistake and would also bypass IEEE 754 safe * integer range for inputs like "9".repeat(309), which would silently * become Infinity and disable throttling. */ declare const MAX_CONCURRENCY_LIMIT = 10000; declare function parseConcurrencyEnvVar(name: string): number | undefined; /** * Default cap on concurrent in-flight HTTP requests per SDK instance. * Beyond this, requests queue (FIFO) until a slot frees up. Sized for * production workloads that fan out hundreds of action runs in parallel; * lower it when running against a smaller backend or to be more * conservative. Pass `Infinity` to disable. */ declare const ZAPIER_MAX_CONCURRENT_REQUESTS: number; /** * Approval flow behavior from environment variable. * - "poll": Create the approval, open the URL in a browser, poll until * resolved, and retry the original request on success. * - "throw": Create the approval and throw a ZapierApprovalError immediately * with the approval URL so the caller can surface it. * - "disabled": Throw a ZapierApprovalError on approval-required responses * without creating an approval. * * This parser only reflects the env var value. If unset, callers should fall * back to getZapierDefaultApprovalMode(). * * Read lazily so tests can set env vars after module import. */ declare function getZapierApprovalMode(): "disabled" | "poll" | "throw" | undefined; /** * Returns the default approval mode based on whether the process is running in * an interactive terminal. If both stdin and stdout are TTYs the user can act * on an approval URL immediately, so "poll" is the right default. In a * non-interactive context (CI, piped output) the process cannot open a browser * or wait for input, so "throw" hands the URL to the caller. */ declare function getZapierDefaultApprovalMode(): "poll" | "throw"; /** * Default timeout for approval polling (10 minutes) */ declare const DEFAULT_APPROVAL_TIMEOUT_MS: number; /** * Default cap on chained approval retries for a single request. Multiple * sequential approvals can occur when more than one policy gates the same * action; this cap prevents a runaway loop if the server keeps returning * approval_required after a successful approval. */ declare const DEFAULT_MAX_APPROVAL_RETRIES = 2; declare const listTablesPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: CapabilitiesContext; } & { context: { meta: Record; }; }) => { listTables: (options?: ({ tables?: string[] | undefined; tableIds?: string[] | undefined; kind?: "table" | "virtual_table" | "both" | undefined; search?: string | undefined; owner?: string | undefined; includeShared?: boolean | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; } & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }>; } & { context: { meta: { listTables: PluginMeta; }; }; }; type ListTablesPluginProvides = ReturnType; declare const getTablePlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { getTable: (options?: { table: string; } | { tableId: string; } | undefined) => Promise<{ data: { id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }; }>; } & { context: { meta: { getTable: PluginMeta; }; }; }; type GetTablePluginProvides = ReturnType; declare const createTablePlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { createTable: (options?: { name: string; description?: string | undefined; } | undefined) => Promise<{ data: { id: string; name: string; created_at: string; edited_at: string; kind: "table" | "virtual_table"; account_id: string; profile_id: string; description?: string | undefined; parent_table_id?: string | undefined; }; }>; } & { context: { meta: { createTable: PluginMeta; }; }; }; type CreateTablePluginProvides = ReturnType; declare const deleteTablePlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: CapabilitiesContext; } & { context: { meta: Record; }; }) => { deleteTable: (options?: { table: string; } | { tableId: string; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTable: PluginMeta; }; }; }; type DeleteTablePluginProvides = ReturnType; declare const listTableFieldsPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { listTableFields: (options?: { table: string; fields?: (string | number)[] | undefined; fieldKeys?: (string | number)[] | undefined; trash?: "include" | "exclude" | "only" | undefined; } | { tableId: string; fields?: (string | number)[] | undefined; fieldKeys?: (string | number)[] | undefined; trash?: "include" | "exclude" | "only" | undefined; } | undefined) => Promise<{ data: { id: string; type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; created_at?: string | undefined; edited_at?: string | undefined; options?: Record | undefined; config?: Record | undefined; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { listTableFields: PluginMeta; }; }; }; type ListTableFieldsPluginProvides = ReturnType; declare const createTableFieldsPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { createTableFields: (options?: { table: string; fields: { type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; options?: Record | undefined; config?: Record | undefined; }[]; } | { tableId: string; fields: { type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; options?: Record | undefined; config?: Record | undefined; }[]; } | undefined) => Promise<{ data: { id: string; type: "string" | "number" | "boolean" | "text" | "datetime" | "decimal" | "json" | "email" | "link" | "multiple_string" | "labeled_string" | "multiple_labeled_string" | "multiple_text" | "multiple_boolean" | "multiple_number" | "multiple_decimal" | "multiple_datetime" | "uuid" | "multiple_uuid" | "multiple_json" | "formula" | "button_trigger_zap" | "button_continue_zap" | "multiple_email" | "multiple_link" | "currency" | "phone_number" | "ai_formula" | "linked_record" | "multiple_linked_record"; name: string; created_at?: string | undefined; edited_at?: string | undefined; options?: Record | undefined; config?: Record | undefined; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { createTableFields: PluginMeta; }; }; }; type CreateTableFieldsPluginProvides = ReturnType; declare const deleteTableFieldsPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { deleteTableFields: (options?: { table: string; fields: (string | number)[]; } | { tableId: string; fieldKeys: (string | number)[]; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTableFields: PluginMeta; }; }; }; type DeleteTableFieldsPluginProvides = ReturnType; declare const getTableRecordPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { getTableRecord: (options?: { table: string; record: string; keyMode: "names" | "ids"; } | { tableId: string; recordId: string; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }; }>; } & { context: { meta: { getTableRecord: PluginMeta; }; }; }; type GetTableRecordPluginProvides = ReturnType; declare const listTableRecordsPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { listTableRecords: (options?: (({ table: string; keyMode: "names" | "ids"; filters?: { fieldKey: string; operator: "in" | "search" | "exact" | "different" | "contains" | "icontains" | "gte" | "gt" | "lt" | "lte" | "range" | "isnull" | "startswith" | "is_within"; value?: unknown; }[] | undefined; sort?: { fieldKey: string; direction: "asc" | "desc"; } | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; trash?: "include" | "exclude" | "only" | undefined; } | { tableId: string; keyMode: "names" | "ids"; filters?: { fieldKey: string; operator: "in" | "search" | "exact" | "different" | "contains" | "icontains" | "gte" | "gt" | "lt" | "lte" | "range" | "isnull" | "startswith" | "is_within"; value?: unknown; }[] | undefined; sort?: { fieldKey: string; direction: "asc" | "desc"; } | undefined; pageSize?: number | undefined; maxItems?: number | undefined; cursor?: string | undefined; trash?: "include" | "exclude" | "only" | undefined; }) & { cursor?: string; pageSize?: number; maxItems?: number; }) | undefined) => PaginatedSdkResult<{ id: string; data: Record; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }>; } & { context: { meta: { listTableRecords: PluginMeta; }; }; }; type ListTableRecordsPluginProvides = ReturnType; declare const createTableRecordsPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { createTableRecords: (options?: { table: string; records: { data: Record; }[]; keyMode: "names" | "ids"; } | { tableId: string; records: { data: Record; }[]; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { createTableRecords: PluginMeta; }; }; }; type CreateTableRecordsPluginProvides = ReturnType; declare const deleteTableRecordsPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { deleteTableRecords: (options?: { table: string; records: string[]; } | { tableId: string; recordIds: string[]; } | undefined) => Promise<{ success: boolean; }>; } & { context: { meta: { deleteTableRecords: PluginMeta; }; }; }; type DeleteTableRecordsPluginProvides = ReturnType; declare const updateTableRecordsPlugin: (sdk: { context: { api: ApiClient; resolveCredentials: () => Promise; }; } & { context: EventEmissionContext; } & { context: { meta: Record; }; }) => { updateTableRecords: (options?: { table: string; records: { id: string; data: Record; }[]; keyMode: "names" | "ids"; } | { tableId: string; records: { id: string; data: Record; }[]; keyMode: "names" | "ids"; } | undefined) => Promise<{ data: { data: Record; id: string; created_at: string; edited_at: string; deleted_at?: string | null | undefined; }[]; }>; } & { context: { meta: { updateTableRecords: PluginMeta; }; }; }; type UpdateTableRecordsPluginProvides = ReturnType; /** * ------------------------------ * Plugin authoring helpers * ------------------------------ * * - `definePlugin`: identity wrapper that constrains a plugin's return to * `PluginProvides` while preserving the narrow inferred shape, so callers * can derive their `*PluginProvides` type via `ReturnType` * instead of declaring it by hand. * - `createPluginMethod` / `createPaginatedPluginMethod`: per-method * primitives that sit inside a `definePlugin` callback and build the * * { [name]: wrappedFn, context: { meta: { [name]: meta } } } * * fragment a plugin returns for a single method, wiring up * `createFunction` / `createPaginatedFunction`, the telemetry callback, * and the doubled `name` (function key + meta key) in one place. * * Two method helpers (rather than one with a `paginated: true` discriminant) * because the handler signature changes shape across pagination, and * discriminated unions on optional booleans produce noisy TS errors. */ /** * Identity helper that preserves the narrow inferred return type of a plugin. * * Wrapping a plugin function with `definePlugin(...)` lets callers derive the * plugin's contribution via `ReturnType` instead of declaring a * matching `*PluginProvides` interface by hand. The constraint * `TProvides extends PluginProvides` enforces the structural floor (must * return a valid plugin output); beyond that the inferred shape flows through. */ declare function definePlugin(fn: (sdk: TSdk & { context: { meta: Record; }; }) => TProvides): (sdk: TSdk & { context: { meta: Record; }; }) => TProvides; /** * Method-level meta fields. Mirrors `PluginMeta` minus `inputSchema`, which is * passed at the top level alongside the handler and merged into the meta by * the helpers themselves. */ type MethodMeta = Omit; interface PluginMethodConfig extends MethodMeta { name: TName; /** * Schema for runtime input validation; drives the handler's `options` * type. For plugins that accept deprecated parameter aliases this is a * `z.union([CanonicalSchema, DeprecatedSchema])` — the registry * unwraps unions and exposes only the first variant (canonical) to * docs, CLI help, and MCP tool definitions. */ inputSchema?: z.ZodSchema; handler: (args: { sdk: TSdk; options: TInput; }) => Promise; } type PluginMethodReturn = { [K in TName]: (options?: TInput) => Promise; } & { context: { meta: { [K in TName]: PluginMeta; }; }; }; /** * Build the method fragment for a non-paginated SDK method. Used inside a * `definePlugin(...)` callback: * * export const getProfilePlugin = definePlugin( * (sdk: ApiPluginProvides & EventEmissionProvides) => * createPluginMethod(sdk, { * name: "getProfile", * categories: ["account"], * inputSchema: GetProfileSchema, * handler: async ({ sdk }) => { ... }, * }), * ); */ declare function createPluginMethod(sdk: TSdk, config: PluginMethodConfig): PluginMethodReturn; interface PaginatedPluginMethodConfig extends MethodMeta { name: TName; /** Same semantics as `createPluginMethod`'s `inputSchema`. */ inputSchema?: z.ZodSchema; /** * Optional default page size when the caller doesn't pass one. Mirrors * `createPaginatedFunction`'s `defaultPageSize` arg. */ defaultPageSize?: number; /** * Page handler. Returns whatever shape the upstream API gives back, as * long as it has a `data: TItem[]` field. JSON:API envelopes * (`{ data, links, meta }`) work directly: pair them with * `extractCursor` below to pull the next-page cursor out of the response. */ handler: (args: { sdk: TSdk; options: TInput & { cursor?: string; pageSize?: number; }; }) => Promise; /** * Pull the next-page cursor out of the handler's response. Most JSON:API * endpoints will use `(response) => extractCursor(response.links)` from * `function-utils`. Provide a custom extractor for non-standard shapes * (e.g. `(response) => response.meta?.pagination?.end_cursor`). * * If omitted, the runtime falls back to its built-in detection * (`response.nextCursor` or `response.links?.next` URL parsing) — i.e. * the same auto-detection that worked before this helper existed. New * plugins should set `extractCursor` explicitly so the pagination shape * is visible at the call site. */ extractCursor?: (response: TResponse) => string | undefined; } type ItemOf = TResponse extends { data: readonly (infer TItem)[]; } ? TItem : never; type PaginatedPluginMethodReturn = { [K in TName]: (options?: TInput & { cursor?: string; pageSize?: number; maxItems?: number; }) => PaginatedSdkResult; } & { context: { meta: { [K in TName]: PluginMeta; }; }; }; /** * Paginated variant of `createPluginMethod`. The handler receives * `{ cursor?, pageSize? }` in `options` and returns whatever shape the * upstream API gives back, as long as it has a `data: TItem[]` field. * Pair JSON:API responses with `extractCursor` to make the cursor * extraction visible at the call site: * * createPaginatedPluginMethod(sdk, { * name: "listApps", * inputSchema: ListAppsSchema, * handler: ({ sdk, options }) => * sdk.context.api.get("/api/v0/apps", {...}), * extractCursor: (response) => extractCursor(response.links), * }); */ declare function createPaginatedPluginMethod(sdk: TSdk, config: PaginatedPluginMethodConfig): PaginatedPluginMethodReturn>; /** * Maps a tuple of plugins to a tuple of their TSdk requirement types. * * SdkRequirementsOf<[Plugin<{ api }, _>, Plugin<{ options }, _>]> * = [{ api }, { options }] */ type SdkRequirementsOf[]> = { [K in keyof T]: T[K] extends Plugin ? Sdk : never; }; /** * Maps a tuple of plugins to a tuple of their TProvides output types. * * ProvidesOf<[Plugin<_, { hello }>, Plugin<_, { goodbye }>]> * = [{ hello }, { goodbye }] */ type ProvidesOf[]> = { [K in keyof T]: T[K] extends Plugin ? Provides : never; }; /** * Intersects every member of a tuple into a single combined type. The * result is an object that has every property of every member at once. * * IntersectAll<[{ api }, { options }]> = { api } & { options } * IntersectAll<[]> = {} * * Walks recursively: head & IntersectAll, base case is the empty * tuple. Why intersection (`&`) and not union (`|`): the composed plugin * must require ALL of the sub-plugins' needs at once — an SDK that has * both `api` AND `options` — not "either api or options." */ type IntersectAll = T extends readonly [ infer Head, ...infer Tail ] ? Head & IntersectAll : {}; /** * The TSdk a composed plugin requires: every sub-plugin's TSdk requirement, * all at once. Composing a plugin that needs `{ api }` with one that needs * `{ options }` yields a composed plugin that needs `{ api } & { options }`. */ type ComposeSdk[]> = IntersectAll>; /** * What a composed plugin provides: every sub-plugin's TProvides combined. * Composing a plugin that provides `{ hello }` with one that provides * `{ goodbye }` yields `{ hello } & { goodbye }`. */ type ComposeProvides[]> = IntersectAll>; /** * Bundle N plugins into a single plugin so a consumer can call * `addPlugin(combined)` once. Use this when an extension package wants to * expose granular sub-plugins for tree-shaking *and* a one-call convenience * entry point. * * Three commitments (per the boilerplate-reduction design): * 1. **Bag mode.** Sub-plugins must not depend on each other; order is * irrelevant. If you need pipeline composition (later sub-plugins * reading earlier sub-plugins' outputs), use a regular `definePlugin` * callback that calls each `createPluginMethod` in turn. * 2. **Over-approximation of TSdk.** The composed plugin requires the * intersection of every sub-plugin's requirements (all of them, all at * once). Works fine for homogeneous-deps groups; widens slightly for * heterogeneous ones, which keeps the variadic types tractable. * 3. **Collision detection.** Throws on duplicate root keys, duplicate * `context.meta` keys, and duplicate non-meta `context.*` keys * *inside* a single `composePlugins(...)` call. Cross-`addPlugin` * collisions are handled separately by `addPlugin` itself, which * warns-and-skips the colliding plugin (the first registration * wins). Pure meta-only overrides (e.g. `cliOverridesPlugin` * patching `meta.fetch.deprecated` without re-registering `fetch`) * stay legitimate in both code paths. * * Why prefer this over an `addPlugin([...])` array overload: TypeScript's * overload resolution interacts badly with arrays carrying a mix of * `TProvides` shapes — chained inference downstream of `addPlugin([...])` * tends to widen and lose individual method types. A single composed * plugin flows through the existing single-plugin `addPlugin` cleanly. */ declare function composePlugins[]>(...plugins: Ts): Plugin, ComposeProvides>; /** * @deprecated `getRegistry` is now built into every sdk produced by * `buildSdk`. Adding this plugin is a no-op. Remove the * `.addPlugin(registryPlugin)` call. */ declare const registryPlugin: (sdk: { context: { meta: Record; }; }) => {}; export { type Resolver as $, type ApiClient as A, type BaseSdkOptions as B, type CapabilitiesContext as C, type DrainTriggerInboxOptions as D, type EventEmissionContext as E, type FieldsetItem as F, type GetAuthenticationPluginProvides as G, type ActionFieldChoice as H, type NeedsRequest as I, type NeedsResponse as J, type Connection as K, type LeasedTriggerMessageItem as L, type Manifest as M, type Need as N, type ConnectionsResponse as O, type PluginMeta as P, type UserProfile as Q, type ResolvedAppLocator as R, isPositional as S, type TriggerMessageStatus as T, type UpdateManifestEntryOptions as U, createFunction as V, type WithAddPlugin as W, type FormattedItem as X, type FormatMetadata as Y, type ZapierSdkOptions as Z, type OutputFormatter as _, type UpdateManifestEntryResult as a, RecordsPropertySchema as a$, type ArrayResolver as a0, type ResolverMetadata as a1, type StaticResolver as a2, type DynamicListResolver as a3, type DynamicSearchResolver as a4, type FieldsResolver as a5, runWithTelemetryContext as a6, toSnakeCase as a7, toTitleCase as a8, batch as a9, type ConnectionItem as aA, type ActionItem$1 as aB, type InputFieldItem as aC, type InfoFieldItem as aD, type RootFieldItem as aE, type UserProfileItem as aF, type FunctionOptions as aG, type SdkPage as aH, type PaginatedSdkFunction as aI, AppKeyPropertySchema as aJ, AppPropertySchema as aK, ActionTypePropertySchema as aL, ActionKeyPropertySchema as aM, ActionPropertySchema as aN, InputFieldPropertySchema as aO, ConnectionIdPropertySchema as aP, AuthenticationIdPropertySchema as aQ, ConnectionPropertySchema as aR, InputsPropertySchema as aS, LimitPropertySchema as aT, OffsetPropertySchema as aU, OutputPropertySchema as aV, DebugPropertySchema as aW, ParamsPropertySchema as aX, ActionTimeoutMsPropertySchema as aY, TablePropertySchema as aZ, RecordPropertySchema as a_, type BatchOptions as aa, buildCapabilityMessage as ab, logDeprecation as ac, resetDeprecationWarnings as ad, RelayRequestSchema as ae, RelayFetchSchema as af, createZapierSdkWithoutRegistry as ag, createSdk as ah, createOptionsPlugin as ai, type FunctionRegistryEntry as aj, type FunctionDeprecation as ak, BaseSdkOptionsSchema as al, type Plugin as am, type PluginProvides as an, definePlugin as ao, createPluginMethod as ap, createPaginatedPluginMethod as aq, composePlugins as ar, type ActionItem as as, type ActionTypeItem as at, registryPlugin as au, type RequestOptions as av, type PollOptions as aw, createZapierApi as ax, getOrCreateApiClient as ay, type AppItem as az, type AddActionEntryOptions as b, fetchPlugin as b$, FieldsPropertySchema as b0, AppsPropertySchema as b1, TablesPropertySchema as b2, ConnectionsPropertySchema as b3, TriggerInboxPropertySchema as b4, TriggerInboxNamePropertySchema as b5, LeasePropertySchema as b6, LeaseSecondsPropertySchema as b7, LeaseLimitPropertySchema as b8, type AppKeyProperty as b9, type LeaseLimitProperty as bA, type ApiError as bB, type ErrorOptions as bC, ZapierError as bD, ZapierApiError as bE, ZapierAppNotFoundError as bF, ZapierValidationError as bG, ZapierUnknownError as bH, ZapierAuthenticationError as bI, ZapierNotFoundError as bJ, ZapierResourceNotFoundError as bK, ZapierConfigurationError as bL, ZapierBundleError as bM, ZapierTimeoutError as bN, ZapierActionError as bO, ZapierConflictError as bP, type RateLimitInfo as bQ, ZapierRateLimitError as bR, type ApprovalStatus as bS, ZapierApprovalError as bT, ZapierRelayError as bU, formatErrorMessage as bV, ZapierSignal as bW, appsPlugin as bX, type AppsPluginProvides as bY, type ActionExecutionOptions as bZ, type AppFactoryInput as b_, type AppProperty as ba, type ActionTypeProperty as bb, type ActionKeyProperty as bc, type ActionProperty as bd, type InputFieldProperty as be, type ConnectionIdProperty as bf, type ConnectionProperty as bg, type AuthenticationIdProperty as bh, type InputsProperty as bi, type LimitProperty as bj, type OffsetProperty as bk, type OutputProperty as bl, type DebugProperty as bm, type ParamsProperty as bn, type ActionTimeoutMsProperty as bo, type TableProperty as bp, type RecordProperty as bq, type RecordsProperty as br, type FieldsProperty as bs, type AppsProperty as bt, type TablesProperty as bu, type ConnectionsProperty as bv, type TriggerInboxProperty as bw, type TriggerInboxNameProperty as bx, type LeaseProperty as by, type LeaseSecondsProperty as bz, type AddActionEntryResult as c, tableRecordIdResolver as c$, type FetchPluginProvides as c0, listAppsPlugin as c1, type ListAppsPluginProvides as c2, listActionsPlugin as c3, type ListActionsPluginProvides as c4, listActionInputFieldsPlugin as c5, type ListActionInputFieldsPluginProvides as c6, listActionInputFieldChoicesPlugin as c7, type ListActionInputFieldChoicesPluginProvides as c8, getActionInputFieldsSchemaPlugin as c9, getPreferredManifestEntryKey as cA, manifestPlugin as cB, type ManifestPluginProvides as cC, DEFAULT_CONFIG_PATH as cD, type ManifestEntry as cE, getProfilePlugin as cF, type GetProfilePluginProvides as cG, type ApiPluginOptions as cH, apiPlugin as cI, type ApiPluginProvides as cJ, appKeyResolver as cK, actionTypeResolver as cL, actionKeyResolver as cM, connectionIdResolver as cN, connectionIdGenericResolver as cO, inputsResolver as cP, inputsAllOptionalResolver as cQ, inputFieldKeyResolver as cR, clientCredentialsNameResolver as cS, clientIdResolver as cT, tableIdResolver as cU, triggerInboxResolver as cV, workflowIdResolver as cW, durableRunIdResolver as cX, workflowVersionIdResolver as cY, workflowRunIdResolver as cZ, triggerMessagesResolver as c_, type GetActionInputFieldsSchemaPluginProvides as ca, listConnectionsPlugin as cb, type ListConnectionsPluginProvides as cc, listClientCredentialsPlugin as cd, type ListClientCredentialsPluginProvides as ce, createClientCredentialsPlugin as cf, type CreateClientCredentialsPluginProvides as cg, deleteClientCredentialsPlugin as ch, type DeleteClientCredentialsPluginProvides as ci, getAppPlugin as cj, type GetAppPluginProvides as ck, getActionPlugin as cl, type GetActionPluginProvides as cm, getConnectionPlugin as cn, type GetConnectionPluginProvides as co, findFirstConnectionPlugin as cp, type FindFirstConnectionPluginProvides as cq, findUniqueConnectionPlugin as cr, type FindUniqueConnectionPluginProvides as cs, CONTEXT_CACHE_TTL_MS as ct, CONTEXT_CACHE_MAX_SIZE as cu, runActionPlugin as cv, type RunActionPluginProvides as cw, requestPlugin as cx, type RequestPluginProvides as cy, type ManifestPluginOptions as cz, type ActionEntry as d, getZapierApprovalMode as d$, tableRecordIdsResolver as d0, tableFieldIdsResolver as d1, tableNameResolver as d2, tableFieldsResolver as d3, tableRecordsResolver as d4, tableUpdateRecordsResolver as d5, tableFiltersResolver as d6, tableSortResolver as d7, type ResolveAuthTokenOptions as d8, clearTokenCache as d9, resolveCredentialsFromEnv as dA, resolveCredentials as dB, getBaseUrlFromCredentials as dC, getClientIdFromCredentials as dD, ClientCredentialsObjectSchema as dE, PkceCredentialsObjectSchema as dF, CredentialsObjectSchema as dG, ResolvedCredentialsSchema as dH, CredentialsFunctionSchema as dI, type CredentialsFunction as dJ, CredentialsSchema as dK, ConnectionEntrySchema as dL, type ConnectionEntry as dM, ConnectionsMapSchema as dN, type ConnectionsMap as dO, connectionsPlugin as dP, type ConnectionsPluginProvides as dQ, ZAPIER_BASE_URL as dR, getZapierSdkService as dS, MAX_PAGE_LIMIT as dT, DEFAULT_PAGE_SIZE as dU, DEFAULT_ACTION_TIMEOUT_MS as dV, ZAPIER_MAX_NETWORK_RETRIES as dW, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS as dX, MAX_CONCURRENCY_LIMIT as dY, parseConcurrencyEnvVar as dZ, ZAPIER_MAX_CONCURRENT_REQUESTS as d_, invalidateCachedToken as da, injectCliLogin as db, isCliLoginAvailable as dc, getTokenFromCliLogin as dd, resolveAuthToken as de, invalidateCredentialsToken as df, type ZapierCache as dg, type ZapierCacheEntry as dh, type ZapierCacheSetOptions as di, createMemoryCache as dj, type SdkEvent as dk, type AuthEvent as dl, type ApiEvent as dm, type LoadingEvent as dn, type EventCallback as dp, type Credentials as dq, type ResolvedCredentials as dr, type CredentialsObject as ds, type ClientCredentialsObject as dt, type PkceCredentialsObject as du, isClientCredentials as dv, isPkceCredentials as dw, isCredentialsObject as dx, isCredentialsFunction as dy, type ResolveCredentialsOptions as dz, type PaginatedSdkResult as e, getZapierDefaultApprovalMode as e0, DEFAULT_APPROVAL_TIMEOUT_MS as e1, DEFAULT_MAX_APPROVAL_RETRIES as e2, listTablesPlugin as e3, type ListTablesPluginProvides as e4, getTablePlugin as e5, type GetTablePluginProvides as e6, createTablePlugin as e7, type CreateTablePluginProvides as e8, deleteTablePlugin as e9, buildErrorEventWithContext as eA, buildErrorEvent as eB, createBaseEvent as eC, buildMethodCalledEvent as eD, type BaseEvent as eE, type MethodCalledEvent as eF, generateEventId as eG, getCurrentTimestamp as eH, getReleaseId as eI, getOsInfo as eJ, getPlatformVersions as eK, isCi as eL, getCiPlatform as eM, getMemoryUsage as eN, getCpuTime as eO, createZapierSdk as eP, type ZapierSdk as eQ, type DeleteTablePluginProvides as ea, listTableFieldsPlugin as eb, type ListTableFieldsPluginProvides as ec, createTableFieldsPlugin as ed, type CreateTableFieldsPluginProvides as ee, deleteTableFieldsPlugin as ef, type DeleteTableFieldsPluginProvides as eg, getTableRecordPlugin as eh, type GetTableRecordPluginProvides as ei, listTableRecordsPlugin as ej, type ListTableRecordsPluginProvides as ek, createTableRecordsPlugin as el, type CreateTableRecordsPluginProvides as em, deleteTableRecordsPlugin as en, type DeleteTableRecordsPluginProvides as eo, updateTableRecordsPlugin as ep, type UpdateTableRecordsPluginProvides as eq, cleanupEventListeners as er, type EventEmissionConfig as es, eventEmissionPlugin as et, type EventEmissionProvides as eu, type EventContext as ev, type ApplicationLifecycleEventData as ew, type EnhancedErrorEventData as ex, type MethodCalledEventData as ey, buildApplicationLifecycleEvent as ez, findManifestEntry as f, type PositionalMetadata as g, type ZapierFetchInitOptions as h, type DynamicResolver as i, type WatchTriggerInboxOptions as j, type ActionProxy as k, type ZapierSdkApps as l, ZapierAbortDrainSignal as m, ZapierReleaseTriggerMessageSignal as n, type DrainTriggerInboxCallback as o, type DrainTriggerInboxErrorObserver as p, type ListAuthenticationsPluginProvides as q, readManifestFromFile as r, type FindFirstAuthenticationPluginProvides as s, type FindUniqueAuthenticationPluginProvides as t, type Action as u, type App as v, type Field as w, type Choice as x, type ActionExecutionResult as y, type ActionField as z };