/** * 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 */ import { z } from "zod"; /** * Client credentials for OAuth client_credentials flow. * The SDK will exchange these for an access token. */ export declare const ClientCredentialsObjectSchema: z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; clientSecret: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>; export 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). */ export declare const PkceCredentialsObjectSchema: z.ZodObject<{ type: z.ZodOptional>; clientId: z.ZodString; baseUrl: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>; export type PkceCredentialsObject = z.infer; /** * Union of all credential object types. */ export 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>]>; export 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. */ export 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>]>]>; export type ResolvedCredentials = z.infer; /** * Lazy/dynamic credential resolution — a function returning resolved credentials. */ export 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>]>]>>]>>; export 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) */ export 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>]>]>>]>>]>; export type Credentials = z.infer; /** * Type guard for client credentials objects. */ export declare function isClientCredentials(credentials: ResolvedCredentials): credentials is ClientCredentialsObject; /** * Type guard for PKCE credentials objects. */ export declare function isPkceCredentials(credentials: ResolvedCredentials): credentials is PkceCredentialsObject; /** * Type guard for credentials objects (either type). */ export declare function isCredentialsObject(credentials: ResolvedCredentials): credentials is CredentialsObject; /** * Type guard for credentials functions. */ export declare function isCredentialsFunction(credentials: Credentials): credentials is CredentialsFunction; //# sourceMappingURL=credentials.d.ts.map