@zapier/zapier-sdk 0.18.4 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +12 -3
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +11 -6
  5. package/dist/api/client.test.js +82 -27
  6. package/dist/api/index.d.ts +3 -2
  7. package/dist/api/index.d.ts.map +1 -1
  8. package/dist/api/index.js +2 -3
  9. package/dist/api/schemas.d.ts +5 -5
  10. package/dist/api/types.d.ts +8 -3
  11. package/dist/api/types.d.ts.map +1 -1
  12. package/dist/auth.d.ts +54 -26
  13. package/dist/auth.d.ts.map +1 -1
  14. package/dist/auth.js +211 -39
  15. package/dist/auth.test.js +338 -64
  16. package/dist/constants.d.ts +14 -0
  17. package/dist/constants.d.ts.map +1 -1
  18. package/dist/constants.js +14 -0
  19. package/dist/credentials.d.ts +57 -0
  20. package/dist/credentials.d.ts.map +1 -0
  21. package/dist/credentials.js +174 -0
  22. package/dist/index.cjs +346 -48
  23. package/dist/index.d.mts +213 -29
  24. package/dist/index.d.ts +3 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +5 -0
  27. package/dist/index.mjs +326 -47
  28. package/dist/plugins/api/index.d.ts +2 -0
  29. package/dist/plugins/api/index.d.ts.map +1 -1
  30. package/dist/plugins/api/index.js +8 -4
  31. package/dist/plugins/eventEmission/index.d.ts.map +1 -1
  32. package/dist/plugins/eventEmission/index.js +1 -3
  33. package/dist/plugins/eventEmission/index.test.js +14 -17
  34. package/dist/plugins/getAction/schemas.d.ts +1 -1
  35. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +1 -1
  36. package/dist/plugins/listActions/index.test.js +1 -0
  37. package/dist/plugins/listActions/schemas.d.ts +1 -1
  38. package/dist/plugins/listInputFieldChoices/schemas.d.ts +1 -1
  39. package/dist/plugins/listInputFields/schemas.d.ts +1 -1
  40. package/dist/plugins/manifest/index.d.ts.map +1 -1
  41. package/dist/plugins/manifest/index.js +10 -2
  42. package/dist/plugins/manifest/index.test.js +46 -6
  43. package/dist/plugins/runAction/schemas.d.ts +1 -1
  44. package/dist/schemas/Action.d.ts +1 -1
  45. package/dist/sdk.d.ts +1 -0
  46. package/dist/sdk.d.ts.map +1 -1
  47. package/dist/sdk.test.js +5 -4
  48. package/dist/types/credentials.d.ts +65 -0
  49. package/dist/types/credentials.d.ts.map +1 -0
  50. package/dist/types/credentials.js +42 -0
  51. package/dist/types/properties.d.ts +1 -1
  52. package/dist/types/sdk.d.ts +12 -3
  53. package/dist/types/sdk.d.ts.map +1 -1
  54. package/dist/utils/logging.d.ts +13 -0
  55. package/dist/utils/logging.d.ts.map +1 -0
  56. package/dist/utils/logging.js +20 -0
  57. package/package.json +2 -2
package/dist/index.d.mts CHANGED
@@ -381,6 +381,71 @@ interface EventEmissionProvides {
381
381
  context: EventEmissionContext;
382
382
  }
383
383
 
384
+ /**
385
+ * Credentials type definitions
386
+ *
387
+ * The credentials system provides a unified way to authenticate with Zapier APIs.
388
+ * It supports multiple credential types:
389
+ * - String: A token (JWT or API key) used directly
390
+ * - Client credentials: OAuth client ID + secret exchanged for a token
391
+ * - PKCE: OAuth client ID for interactive login (CLI only)
392
+ * - Function: Lazy/dynamic credential resolution
393
+ */
394
+ /**
395
+ * Client credentials for OAuth client_credentials flow.
396
+ * The SDK will exchange these for an access token.
397
+ */
398
+ interface ClientCredentialsObject {
399
+ type?: "client_credentials";
400
+ clientId: string;
401
+ clientSecret: string;
402
+ baseUrl?: string;
403
+ scope?: string;
404
+ }
405
+ /**
406
+ * PKCE credentials for interactive OAuth flow.
407
+ * Only works when @zapier/zapier-sdk-cli-login is available.
408
+ */
409
+ interface PkceCredentialsObject {
410
+ type?: "pkce";
411
+ clientId: string;
412
+ baseUrl?: string;
413
+ scope?: string;
414
+ }
415
+ /**
416
+ * Union of all credential object types.
417
+ */
418
+ type CredentialsObject = ClientCredentialsObject | PkceCredentialsObject;
419
+ /**
420
+ * Resolved credentials - what a credentials function must return.
421
+ * Either a string (token) or a credentials object.
422
+ * Functions are not allowed to return other functions.
423
+ */
424
+ type ResolvedCredentials = string | CredentialsObject;
425
+ /**
426
+ * Credentials can be:
427
+ * - A string (token or API key)
428
+ * - A credentials object (client_credentials or pkce)
429
+ * - A function that returns credentials (sync or async)
430
+ */
431
+ type Credentials = ResolvedCredentials | (() => ResolvedCredentials | Promise<ResolvedCredentials>);
432
+ /**
433
+ * Type guard for client credentials objects.
434
+ */
435
+ declare function isClientCredentials(credentials: ResolvedCredentials): credentials is ClientCredentialsObject;
436
+ /**
437
+ * Type guard for PKCE credentials objects.
438
+ */
439
+ declare function isPkceCredentials(credentials: ResolvedCredentials): credentials is PkceCredentialsObject;
440
+ /**
441
+ * Type guard for credentials objects (either type).
442
+ */
443
+ declare function isCredentialsObject(credentials: ResolvedCredentials): credentials is CredentialsObject;
444
+ /**
445
+ * Type guard for credentials functions.
446
+ */
447
+ declare function isCredentialsFunction(credentials: Credentials): credentials is () => ResolvedCredentials | Promise<ResolvedCredentials>;
448
+
384
449
  declare const NeedSchema: z.ZodObject<{
385
450
  key: z.ZodString;
386
451
  alters_custom_fields: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -1122,6 +1187,7 @@ interface ApiPluginOptions extends BaseSdkOptions {
1122
1187
  interface ApiPluginProvides {
1123
1188
  context: {
1124
1189
  api: ApiClient;
1190
+ resolveCredentials: () => Promise<ResolvedCredentials | undefined>;
1125
1191
  };
1126
1192
  }
1127
1193
  declare const apiPlugin: Plugin<{}, {}, ApiPluginProvides>;
@@ -1666,13 +1732,21 @@ interface ListInputFieldChoicesPluginProvides {
1666
1732
  */
1667
1733
 
1668
1734
  interface BaseSdkOptions {
1735
+ /**
1736
+ * Authentication credentials. Can be:
1737
+ * - A string (token or API key)
1738
+ * - An object with clientId/clientSecret for client_credentials flow
1739
+ * - An object with clientId (no secret) for PKCE flow
1740
+ * - A function returning any of the above
1741
+ */
1742
+ credentials?: Credentials;
1743
+ /**
1744
+ * @deprecated Use `credentials` instead.
1745
+ */
1669
1746
  token?: string;
1670
- getToken?: () => Promise<string | undefined>;
1671
1747
  onEvent?: EventCallback;
1672
1748
  fetch?: typeof fetch;
1673
1749
  baseUrl?: string;
1674
- authBaseUrl?: string;
1675
- authClientId?: string;
1676
1750
  trackingBaseUrl?: string;
1677
1751
  debug?: boolean;
1678
1752
  manifestPath?: string;
@@ -2147,52 +2221,147 @@ declare const inputFieldKeyResolver: DynamicResolver<InputFieldItem$1, {
2147
2221
  * SDK Authentication Utilities
2148
2222
  *
2149
2223
  * This module provides SDK-level authentication utilities focused
2150
- * solely on token acquisition. CLI-specific functionality like login/logout
2151
- * is handled by the @zapier/zapier-sdk-cli-login package.
2224
+ * on token acquisition. It uses the credentials system for resolution
2225
+ * and handles different credential types appropriately.
2226
+ *
2227
+ * CLI-specific functionality like login/logout is handled by the
2228
+ * @zapier/zapier-sdk-cli-login package.
2152
2229
  */
2153
2230
 
2154
- interface AuthOptions {
2231
+ /**
2232
+ * Options for resolving auth tokens.
2233
+ */
2234
+ interface ResolveAuthTokenOptions {
2235
+ credentials?: Credentials;
2236
+ /** @deprecated Use `credentials` instead */
2237
+ token?: string;
2155
2238
  onEvent?: EventCallback;
2156
2239
  fetch?: typeof globalThis.fetch;
2157
2240
  baseUrl?: string;
2158
- authBaseUrl?: string;
2159
- authClientId?: string;
2160
- }
2161
- interface ResolveAuthTokenOptions extends AuthOptions {
2162
- token?: string;
2163
- getToken?: () => Promise<string | undefined> | string | undefined;
2164
2241
  }
2165
2242
  /**
2166
- * Gets the ZAPIER_TOKEN from environment variables.
2167
- * Returns undefined if not set.
2243
+ * Clear the token cache. Useful for testing or forcing re-authentication.
2168
2244
  */
2169
- declare function getTokenFromEnv(): string | undefined;
2245
+ declare function clearTokenCache(): void;
2246
+ /**
2247
+ * Invalidate a cached token. Called when we get a 401 response.
2248
+ */
2249
+ declare function invalidateCachedToken(clientId: string): void;
2250
+ /**
2251
+ * Options for getTokenFromCliLogin.
2252
+ */
2253
+ interface CliLoginOptions {
2254
+ onEvent?: EventCallback;
2255
+ fetch?: typeof globalThis.fetch;
2256
+ credentials?: {
2257
+ type?: "pkce";
2258
+ clientId: string;
2259
+ baseUrl?: string;
2260
+ scope?: string;
2261
+ };
2262
+ }
2170
2263
  /**
2171
2264
  * Attempts to get a token by optionally importing from CLI login package.
2172
2265
  * This provides a graceful fallback when the CLI login package is not available.
2173
2266
  *
2174
2267
  * Returns undefined if no valid token is found or CLI package is not available.
2175
2268
  */
2176
- declare function getTokenFromCliLogin(options?: AuthOptions): Promise<string | undefined>;
2269
+ declare function getTokenFromCliLogin(options: CliLoginOptions): Promise<string | undefined>;
2177
2270
  /**
2178
- * Attempts to get a token with the following precedence:
2179
- * 1. ZAPIER_TOKEN environment variable
2180
- * 2. CLI login package (if available) with auto-refresh
2271
+ * Resolves an auth token from wherever it can be found.
2272
+ *
2273
+ * Resolution order:
2274
+ * 1. Explicit credentials option (or deprecated token option)
2275
+ * 2. Environment variables
2276
+ * 3. CLI login package (if available)
2277
+ *
2278
+ * For different credential types:
2279
+ * - String: Used directly as the token
2280
+ * - Client credentials: Exchanged for an access token (with caching)
2281
+ * - PKCE: Delegates to CLI login (throws if not available)
2181
2282
  *
2182
2283
  * Returns undefined if no valid token is found.
2183
2284
  */
2184
- declare function getTokenFromEnvOrConfig(options?: AuthOptions): Promise<string | undefined>;
2285
+ declare function resolveAuthToken(options?: ResolveAuthTokenOptions): Promise<string | undefined>;
2185
2286
  /**
2186
- * Resolves an auth token from all possible sources with the following precedence:
2187
- * 1. Explicitly provided token in options
2188
- * 2. Token from getToken callback in options
2189
- * 3. ZAPIER_TOKEN environment variable
2190
- * 4. CLI login package (if available)
2287
+ * Invalidate the cached token for the given credentials, if applicable.
2288
+ * This is called when we receive a 401 response, indicating the token
2289
+ * is no longer valid. Only affects client_credentials flow tokens.
2290
+ */
2291
+ declare function invalidateCredentialsToken(options: {
2292
+ credentials?: Credentials;
2293
+ token?: string;
2294
+ }): Promise<void>;
2295
+
2296
+ /**
2297
+ * Credentials Resolution
2191
2298
  *
2192
- * This is the canonical token resolution logic used throughout the SDK.
2193
- * Returns undefined if no valid token is found.
2299
+ * This module provides the core logic for resolving credentials from various sources:
2300
+ * - Explicit credentials option
2301
+ * - Deprecated token option
2302
+ * - Environment variables (new and deprecated)
2303
+ * - CLI login stored tokens
2194
2304
  */
2195
- declare function resolveAuthToken(options?: ResolveAuthTokenOptions): Promise<string | undefined>;
2305
+
2306
+ /**
2307
+ * Options for resolving credentials.
2308
+ */
2309
+ interface ResolveCredentialsOptions {
2310
+ credentials?: Credentials;
2311
+ /** @deprecated Use `credentials` instead */
2312
+ token?: string;
2313
+ /** SDK base URL - used to derive auth base URL if not specified in credentials */
2314
+ baseUrl?: string;
2315
+ }
2316
+ /**
2317
+ * Resolve credentials from environment variables.
2318
+ *
2319
+ * Precedence:
2320
+ * 1. ZAPIER_CREDENTIALS (string token)
2321
+ * 2. ZAPIER_CREDENTIALS_CLIENT_ID + ZAPIER_CREDENTIALS_CLIENT_SECRET (client credentials)
2322
+ * 3. ZAPIER_CREDENTIALS_CLIENT_ID alone (PKCE)
2323
+ * 4. Deprecated ZAPIER_TOKEN, ZAPIER_AUTH_* vars (with warnings)
2324
+ *
2325
+ * @param sdkBaseUrl - SDK base URL used to derive auth base URL if not specified
2326
+ */
2327
+ declare function resolveCredentialsFromEnv(sdkBaseUrl?: string): ResolvedCredentials | undefined;
2328
+ /**
2329
+ * Resolve credentials from all possible sources.
2330
+ *
2331
+ * Precedence:
2332
+ * 1. Explicit credentials option
2333
+ * 2. Deprecated token option (with warning)
2334
+ * 3. Environment variables
2335
+ * 4. CLI login stored token (handled separately in auth.ts)
2336
+ *
2337
+ * If credentials is a function, it is called and must return
2338
+ * a string or credentials object (not another function).
2339
+ *
2340
+ * The baseUrl option is used to derive the auth base URL if not
2341
+ * specified in credentials.
2342
+ */
2343
+ declare function resolveCredentials(options?: ResolveCredentialsOptions): Promise<ResolvedCredentials | undefined>;
2344
+ /**
2345
+ * Extract the base URL from credentials for use in auth flows.
2346
+ */
2347
+ declare function getBaseUrlFromCredentials(credentials: ResolvedCredentials | undefined): string | undefined;
2348
+ /**
2349
+ * Extract the client ID from credentials for use in auth flows.
2350
+ */
2351
+ declare function getClientIdFromCredentials(credentials: ResolvedCredentials | undefined): string | undefined;
2352
+
2353
+ /**
2354
+ * Logging utilities for the SDK
2355
+ */
2356
+ /**
2357
+ * Log a deprecation warning. Each unique message is only logged once per process.
2358
+ */
2359
+ declare function logDeprecation(message: string): void;
2360
+ /**
2361
+ * Reset the set of logged deprecation warnings.
2362
+ * Useful for testing.
2363
+ */
2364
+ declare function resetDeprecationWarnings(): void;
2196
2365
 
2197
2366
  /**
2198
2367
  * SDK Constants
@@ -2207,6 +2376,20 @@ declare const ZAPIER_BASE_URL: string;
2207
2376
  * Maximum number of items that can be requested per page across all paginated functions
2208
2377
  */
2209
2378
  declare const MAX_PAGE_LIMIT = 10000;
2379
+ /**
2380
+ * Credentials from environment variables
2381
+ */
2382
+ declare const ZAPIER_CREDENTIALS: string | undefined;
2383
+ declare const ZAPIER_CREDENTIALS_CLIENT_ID: string | undefined;
2384
+ declare const ZAPIER_CREDENTIALS_CLIENT_SECRET: string | undefined;
2385
+ declare const ZAPIER_CREDENTIALS_BASE_URL: string | undefined;
2386
+ declare const ZAPIER_CREDENTIALS_SCOPE: string | undefined;
2387
+ /**
2388
+ * Deprecated environment variables (kept for backwards compatibility)
2389
+ */
2390
+ declare const ZAPIER_TOKEN: string | undefined;
2391
+ declare const ZAPIER_AUTH_BASE_URL: string | undefined;
2392
+ declare const ZAPIER_AUTH_CLIENT_ID: string | undefined;
2210
2393
 
2211
2394
  interface ZapierSdkOptions extends BaseSdkOptions {
2212
2395
  }
@@ -2224,6 +2407,7 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
2224
2407
  meta: Record<string, PluginMeta>;
2225
2408
  } & EventEmissionContext & {
2226
2409
  api: ApiClient;
2410
+ resolveCredentials: () => Promise<ResolvedCredentials | undefined>;
2227
2411
  } & {
2228
2412
  getVersionedImplementationId: GetVersionedImplementationId;
2229
2413
  resolveAppKeys: ResolveAppKeys;
@@ -2351,4 +2535,4 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
2351
2535
  }>;
2352
2536
  declare function createZapierSdk(options?: ZapierSdkOptions): ZapierSdk;
2353
2537
 
2354
- export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type AuthEvent, type AuthOptions, type Authentication, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type AuthenticationItem, type AuthenticationsResponse, type BaseEvent, type BatchOptions, type Choice, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindUniqueAuthenticationPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListInputFieldsPluginProvides, type LoadingEvent, MAX_PAGE_LIMIT, type Manifest, type ManifestEntry, type ManifestPluginOptions, type ManifestPluginProvides, type MethodCalledEvent, type MethodCalledEventData, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UserProfile, type UserProfileItem, ZAPIER_BASE_URL, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdGenericResolver, authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, createBaseEvent, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, fetchPlugin, findFirstAuthenticationPlugin, findManifestEntry, findUniqueAuthenticationPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getAuthenticationPlugin, getCiPlatform, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, getTokenFromEnv, getTokenFromEnvOrConfig, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, isCi, isPositional, listActionsPlugin, listAppsPlugin, listAuthenticationsPlugin, listInputFieldsPlugin, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resolveAuthToken, runActionPlugin, toSnakeCase, toTitleCase };
2538
+ export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTypeProperty, ActionTypePropertySchema, type AddActionEntryOptions, type AddActionEntryResult, type ApiError, type ApiEvent, type ApiPluginOptions, type ApiPluginProvides, type App, type AppItem, type AppKeyProperty, AppKeyPropertySchema, type ApplicationLifecycleEventData, type AppsPluginProvides, type AuthEvent, type Authentication, type AuthenticationIdProperty, AuthenticationIdPropertySchema, type AuthenticationItem, type AuthenticationsResponse, type BaseEvent, type BatchOptions, type Choice, type ClientCredentialsObject, type Credentials, type CredentialsObject, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindUniqueAuthenticationPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListInputFieldsPluginProvides, type LoadingEvent, MAX_PAGE_LIMIT, type Manifest, type ManifestEntry, type ManifestPluginOptions, type ManifestPluginProvides, type MethodCalledEvent, type MethodCalledEventData, type Need, type NeedsRequest, type NeedsResponse, type OffsetProperty, OffsetPropertySchema, type OutputProperty, OutputPropertySchema, type PaginatedSdkFunction, type ParamsProperty, ParamsPropertySchema, type PkceCredentialsObject, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedCredentials, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type UpdateManifestEntryOptions, type UpdateManifestEntryResult, type UserProfile, type UserProfileItem, ZAPIER_AUTH_BASE_URL, ZAPIER_AUTH_CLIENT_ID, ZAPIER_BASE_URL, ZAPIER_CREDENTIALS, ZAPIER_CREDENTIALS_BASE_URL, ZAPIER_CREDENTIALS_CLIENT_ID, ZAPIER_CREDENTIALS_CLIENT_SECRET, ZAPIER_CREDENTIALS_SCOPE, ZAPIER_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, authenticationIdGenericResolver, authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, createBaseEvent, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, fetchPlugin, findFirstAuthenticationPlugin, findManifestEntry, findUniqueAuthenticationPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getAuthenticationPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listAuthenticationsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };
package/dist/index.d.ts CHANGED
@@ -27,6 +27,9 @@ export { batch } from "./utils/batch-utils";
27
27
  export type { BatchOptions } from "./utils/batch-utils";
28
28
  export * from "./resolvers";
29
29
  export * from "./auth";
30
+ export * from "./credentials";
31
+ export * from "./types/credentials";
32
+ export { logDeprecation, resetDeprecationWarnings } from "./utils/logging";
30
33
  export * from "./constants";
31
34
  export { RelayRequestSchema, RelayFetchSchema, } from "./plugins/request/schemas";
32
35
  export { createZapierSdk, createZapierSdkWithoutRegistry, createSdk, ZapierSdkOptions, } from "./sdk";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAG9B,YAAY,EACV,MAAM,EACN,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,YAAY,E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kB,EAClB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,SAAS,EACT,gBAAgB,GACjB,MAAM,OAAO,CAAC;AAGf,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,YAAY,EACV,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,cAAc,EACd,GAAG,GACJ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EACV,oBAAoB,EACpB,YAAY,EACZ,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,IAAI,EACJ,aAAa,EACb,cAAc,EACd,UAAU,EACV,8BAA8B,EAC9B,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,sBAAsB,GACvB,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -30,6 +30,11 @@ export { batch } from "./utils/batch-utils";
30
30
  export * from "./resolvers";
31
31
  // Export auth utilities for CLI use
32
32
  export * from "./auth";
33
+ // Export credentials types and utilities
34
+ export * from "./credentials";
35
+ export * from "./types/credentials";
36
+ // Export logging utilities
37
+ export { logDeprecation, resetDeprecationWarnings } from "./utils/logging";
33
38
  // Export constants
34
39
  export * from "./constants";
35
40
  // All functions now available through the plugin system via createZapierSdk()