@zapier/zapier-sdk 0.31.4 → 0.32.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.32.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 250cb7d: Store CLI login credentials in system keychain.
8
+
3
9
  ## 0.31.4
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -4,8 +4,9 @@
4
4
 
5
5
  - [Closed Beta](#closed-beta)
6
6
  - [Documentation](#documentation)
7
- - [Installation](#installation)
8
7
  - [Quick Start](#quick-start)
8
+ - [Installation](#installation)
9
+ - [Walkthrough](#walkthrough)
9
10
  - [Factory](#factory)
10
11
  - [Available Functions](#available-functions)
11
12
  - [Accounts](#accounts)
@@ -50,20 +51,32 @@ While the dust settles, that documentation may be incomplete, and this README ma
50
51
 
51
52
  Agents are sometimes blocked from viewing docs on npm, so you may want to provide them a link to the official docs or copy the docs here into a prompt.
52
53
 
53
- ## Installation
54
+ ## Quick Start
55
+
56
+ _For new projects._
57
+
58
+ The following will create a new project from scratch, set up the SDK and the SDK CLI, and give you a working starter example to get you going:
54
59
 
55
60
  ```bash
56
- # If you're starting a new project:
57
- cd your-project-dir
58
- npm init -y
59
- npx tsc --init
60
- # Also, set `"type": "module"` in your package.json for the code examples below.
61
+ # Create a new Zapier SDK project (scaffolds files, installs deps, and logs you in).
62
+ npx @zapier/zapier-sdk-cli init my-zapier-app
63
+
64
+ # Or skip the interactive prompts and accept all defaults.
65
+ npx @zapier/zapier-sdk-cli init my-zapier-app --skip-prompts
66
+ ```
67
+
68
+ ## Installation
69
+
70
+ _For existing projects._
61
71
 
72
+ If you already have a project and want to start integrating apps through Zapier using the SDK:
73
+
74
+ ```bash
62
75
  npm install @zapier/zapier-sdk
63
76
  npm install -D @zapier/zapier-sdk-cli @types/node typescript
64
77
  ```
65
78
 
66
- ## Quick Start
79
+ ## Walkthrough
67
80
 
68
81
  Assuming you've installed the CLI package into your project (see instructions above), you (or an agent) can start using it right away. This is useful for introspecting actions, connections, etc. that you want to use in code, but you can also use it to directly use integrations.
69
82
 
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AA2oBjB,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,SAW3D,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AA4oBjB,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,SAW3D,CAAC"}
@@ -420,7 +420,8 @@ class ZapierApiClient {
420
420
  // If we know auth is required, and we don't have a token, throw an error
421
421
  // before we even make a request.
422
422
  if (options.authRequired) {
423
- if (headers.get("Authorization") == null && authToken == null) {
423
+ const authHeaderName = pathConfig?.authHeader ?? "Authorization";
424
+ if (headers.get(authHeaderName) == null && authToken == null) {
424
425
  const message = isCliLoginAvailable() === false
425
426
  ? "Authentication required but no credentials available. " +
426
427
  "To use CLI login, install the CLI as a dev dependency " +
@@ -43,8 +43,8 @@ export declare const NeedSchema: z.ZodObject<{
43
43
  string: "string";
44
44
  boolean: "boolean";
45
45
  file: "file";
46
- filter: "filter";
47
46
  integer: "integer";
47
+ filter: "filter";
48
48
  text: "text";
49
49
  datetime: "datetime";
50
50
  decimal: "decimal";
@@ -65,8 +65,8 @@ export declare const ActionPermissionsSchema: z.ZodObject<{
65
65
  export declare const ActionSchema: z.ZodObject<{
66
66
  id: z.ZodOptional<z.ZodString>;
67
67
  type: z.ZodEnum<{
68
- filter: "filter";
69
68
  search: "search";
69
+ filter: "filter";
70
70
  read: "read";
71
71
  read_bulk: "read_bulk";
72
72
  run: "run";
@@ -287,8 +287,8 @@ export declare const NeedsResponseSchema: z.ZodObject<{
287
287
  string: "string";
288
288
  boolean: "boolean";
289
289
  file: "file";
290
- filter: "filter";
291
290
  integer: "integer";
291
+ filter: "filter";
292
292
  text: "text";
293
293
  datetime: "datetime";
294
294
  decimal: "decimal";
@@ -312,8 +312,8 @@ export declare const ImplementationSchema: z.ZodObject<{
312
312
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
313
313
  id: z.ZodOptional<z.ZodString>;
314
314
  type: z.ZodEnum<{
315
- filter: "filter";
316
315
  search: "search";
316
+ filter: "filter";
317
317
  read: "read";
318
318
  read_bulk: "read_bulk";
319
319
  run: "run";
@@ -354,8 +354,8 @@ export declare const ImplementationsResponseSchema: z.ZodObject<{
354
354
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
355
355
  id: z.ZodOptional<z.ZodString>;
356
356
  type: z.ZodEnum<{
357
- filter: "filter";
358
357
  search: "search";
358
+ filter: "filter";
359
359
  read: "read";
360
360
  read_bulk: "read_bulk";
361
361
  run: "run";
package/dist/auth.d.ts CHANGED
@@ -55,6 +55,12 @@ interface CliLoginOptions {
55
55
  };
56
56
  debug?: boolean;
57
57
  }
58
+ type CliLoginModule = typeof import("@zapier/zapier-sdk-cli-login");
59
+ /**
60
+ * Inject an already-loaded CLI login module so the SDK skips its dynamic import.
61
+ * This guarantees CLI and SDK share the same module instance in the same process.
62
+ */
63
+ export declare function injectCliLogin(module: CliLoginModule): void;
58
64
  /**
59
65
  * Returns whether a CLI login package is available.
60
66
  * `undefined` if no import has been attempted yet, `true` if found, `false` if not.
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK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AC;CAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhB"}
package/dist/auth.js CHANGED
@@ -201,6 +201,13 @@ async function getCliLogin() {
201
201
  return undefined;
202
202
  }
203
203
  }
204
+ /**
205
+ * Inject an already-loaded CLI login module so the SDK skips its dynamic import.
206
+ * This guarantees CLI and SDK share the same module instance in the same process.
207
+ */
208
+ export function injectCliLogin(module) {
209
+ cachedCliLogin = module;
210
+ }
204
211
  /**
205
212
  * Returns whether a CLI login package is available.
206
213
  * `undefined` if no import has been attempted yet, `true` if found, `false` if not.
package/dist/index.cjs CHANGED
@@ -4303,6 +4303,9 @@ async function getCliLogin() {
4303
4303
  return void 0;
4304
4304
  }
4305
4305
  }
4306
+ function injectCliLogin(module) {
4307
+ cachedCliLogin = module;
4308
+ }
4306
4309
  function isCliLoginAvailable() {
4307
4310
  if (cachedCliLogin === void 0) return void 0;
4308
4311
  return cachedCliLogin !== false;
@@ -4734,7 +4737,8 @@ var ZapierApiClient = class {
4734
4737
  headers.set(authHeaderName, getAuthorizationHeader(authToken));
4735
4738
  }
4736
4739
  if (options.authRequired) {
4737
- if (headers.get("Authorization") == null && authToken == null) {
4740
+ const authHeaderName = pathConfig2?.authHeader ?? "Authorization";
4741
+ if (headers.get(authHeaderName) == null && authToken == null) {
4738
4742
  const message = isCliLoginAvailable() === false ? "Authentication required but no credentials available. To use CLI login, install the CLI as a dev dependency (e.g. `npm install -D @zapier/zapier-sdk-cli`) and log in (e.g. `npx zapier-sdk login`). Alternatively, set the ZAPIER_CREDENTIALS environment variable or ZAPIER_CREDENTIALS_CLIENT_ID and ZAPIER_CREDENTIALS_CLIENT_SECRET environment variables." : "Authentication required but no credentials available. Please log in (e.g. `npx zapier-sdk login`) or set the ZAPIER_CREDENTIALS environment variable or ZAPIER_CREDENTIALS_CLIENT_ID and ZAPIER_CREDENTIALS_CLIENT_SECRET environment variables.";
4739
4743
  throw new ZapierAuthenticationError(message);
4740
4744
  }
@@ -5499,7 +5503,7 @@ function getCpuTime() {
5499
5503
 
5500
5504
  // package.json
5501
5505
  var package_default = {
5502
- version: "0.31.4"};
5506
+ version: "0.32.0"};
5503
5507
 
5504
5508
  // src/plugins/eventEmission/builders.ts
5505
5509
  function createBaseEvent(context = {}) {
@@ -6085,6 +6089,7 @@ exports.getPreferredManifestEntryKey = getPreferredManifestEntryKey;
6085
6089
  exports.getProfilePlugin = getProfilePlugin;
6086
6090
  exports.getReleaseId = getReleaseId;
6087
6091
  exports.getTokenFromCliLogin = getTokenFromCliLogin;
6092
+ exports.injectCliLogin = injectCliLogin;
6088
6093
  exports.inputFieldKeyResolver = inputFieldKeyResolver;
6089
6094
  exports.inputsAllOptionalResolver = inputsAllOptionalResolver;
6090
6095
  exports.inputsResolver = inputsResolver;
package/dist/index.d.mts CHANGED
@@ -3,6 +3,7 @@ import { z } from 'zod';
3
3
  import { ConnectionSchema, ConnectionsResponseSchema, ConnectionItem as ConnectionItem$2, GetConnectionResponse } from '@zapier/zapier-sdk-core/v0/schemas/connections';
4
4
  import { AppItem as AppItem$1 } from '@zapier/zapier-sdk-core/v0/schemas/apps';
5
5
  import { ClientCredentialsItem as ClientCredentialsItem$1, ClientCredentialsCreatedItem } from '@zapier/zapier-sdk-core/v0/schemas/client-credentials';
6
+ import * as _zapier_zapier_sdk_cli_login from '@zapier/zapier-sdk-cli-login';
6
7
 
7
8
  /**
8
9
  * SDK Event System
@@ -612,6 +613,7 @@ declare const NeedSchema: z.ZodObject<{
612
613
  boolean: "boolean";
613
614
  file: "file";
614
615
  integer: "integer";
616
+ filter: "filter";
615
617
  text: "text";
616
618
  datetime: "datetime";
617
619
  decimal: "decimal";
@@ -619,7 +621,6 @@ declare const NeedSchema: z.ZodObject<{
619
621
  password: "password";
620
622
  dict: "dict";
621
623
  code: "code";
622
- filter: "filter";
623
624
  json: "json";
624
625
  }>>;
625
626
  list: z.ZodOptional<z.ZodBoolean>;
@@ -818,6 +819,7 @@ declare const NeedsResponseSchema: z.ZodObject<{
818
819
  boolean: "boolean";
819
820
  file: "file";
820
821
  integer: "integer";
822
+ filter: "filter";
821
823
  text: "text";
822
824
  datetime: "datetime";
823
825
  decimal: "decimal";
@@ -825,7 +827,6 @@ declare const NeedsResponseSchema: z.ZodObject<{
825
827
  password: "password";
826
828
  dict: "dict";
827
829
  code: "code";
828
- filter: "filter";
829
830
  json: "json";
830
831
  }>>;
831
832
  list: z.ZodOptional<z.ZodBoolean>;
@@ -2578,17 +2579,6 @@ type ClientCredentialsItem = z.infer<typeof ClientCredentialsItemSchema>;
2578
2579
 
2579
2580
  declare const clientIdResolver: DynamicResolver<ClientCredentialsItem, {}>;
2580
2581
 
2581
- /**
2582
- * SDK Authentication Utilities
2583
- *
2584
- * This module provides SDK-level authentication utilities focused
2585
- * on token acquisition. It uses the credentials system for resolution
2586
- * and handles different credential types appropriately.
2587
- *
2588
- * CLI-specific functionality like login/logout is handled by the
2589
- * @zapier/zapier-sdk-cli-login package.
2590
- */
2591
-
2592
2582
  /**
2593
2583
  * Options for resolving auth tokens.
2594
2584
  */
@@ -2631,6 +2621,12 @@ interface CliLoginOptions {
2631
2621
  };
2632
2622
  debug?: boolean;
2633
2623
  }
2624
+ type CliLoginModule = typeof _zapier_zapier_sdk_cli_login;
2625
+ /**
2626
+ * Inject an already-loaded CLI login module so the SDK skips its dynamic import.
2627
+ * This guarantees CLI and SDK share the same module instance in the same process.
2628
+ */
2629
+ declare function injectCliLogin(module: CliLoginModule): void;
2634
2630
  /**
2635
2631
  * Returns whether a CLI login package is available.
2636
2632
  * `undefined` if no import has been attempted yet, `true` if found, `false` if not.
@@ -2962,4 +2958,4 @@ declare function createZapierSdkWithoutRegistry(options?: ZapierSdkOptions): Sdk
2962
2958
  }>;
2963
2959
  declare function createZapierSdk(options?: ZapierSdkOptions): ZapierSdk;
2964
2960
 
2965
- export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTimeoutMsProperty, ActionTimeoutMsPropertySchema, 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 AuthenticationIdProperty, AuthenticationIdPropertySchema, type BaseEvent, BaseSdkOptionsSchema, type BatchOptions, type Choice, type ClientCredentialsObject, ClientCredentialsObjectSchema, type Connection, type ConnectionIdProperty, ConnectionIdPropertySchema, type ConnectionItem, type ConnectionsResponse, type CreateClientCredentialsPluginProvides, type Credentials, type CredentialsFunction, CredentialsFunctionSchema, type CredentialsObject, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type DeleteClientCredentialsPluginProvides, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindFirstConnectionPluginProvides, type FindUniqueAuthenticationPluginProvides, type FindUniqueConnectionPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetConnectionPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListClientCredentialsPluginProvides, type ListConnectionsPluginProvides, 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, PkceCredentialsObjectSchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, type RateLimitInfo, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedCredentials, ResolvedCredentialsSchema, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type StaticResolver, 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_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZAPIER_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };
2961
+ export { type Action, type ActionEntry, type ActionExecutionOptions, type ActionExecutionResult, type ActionField, type ActionFieldChoice, type ActionItem$1 as ActionItem, type ActionKeyProperty, ActionKeyPropertySchema, type ActionTimeoutMsProperty, ActionTimeoutMsPropertySchema, 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 AuthenticationIdProperty, AuthenticationIdPropertySchema, type BaseEvent, BaseSdkOptionsSchema, type BatchOptions, type Choice, type ClientCredentialsObject, ClientCredentialsObjectSchema, type Connection, type ConnectionIdProperty, ConnectionIdPropertySchema, type ConnectionItem, type ConnectionsResponse, type CreateClientCredentialsPluginProvides, type Credentials, type CredentialsFunction, CredentialsFunctionSchema, type CredentialsObject, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, type DebugProperty, DebugPropertySchema, type DeleteClientCredentialsPluginProvides, type EnhancedErrorEventData, type ErrorOptions, type EventCallback, type EventContext, type EventEmissionContext, type FetchPluginProvides, type Field, type FieldsetItem, type FindFirstAuthenticationPluginProvides, type FindFirstConnectionPluginProvides, type FindUniqueAuthenticationPluginProvides, type FindUniqueConnectionPluginProvides, type FormatMetadata, type FormattedItem, type FunctionOptions, type FunctionRegistryEntry, type GetActionPluginProvides, type GetAppPluginProvides, type GetAuthenticationPluginProvides, type GetConnectionPluginProvides, type GetContextType, type GetProfilePluginProvides, type GetSdkType, type InfoFieldItem, type InputFieldItem, type InputsProperty, InputsPropertySchema, type LimitProperty, LimitPropertySchema, type ListActionsPluginProvides, type ListAppsPluginProvides, type ListAuthenticationsPluginProvides, type ListClientCredentialsPluginProvides, type ListConnectionsPluginProvides, 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, PkceCredentialsObjectSchema, type Plugin, type PluginDependencies, type PluginOptions, type PluginProvides, type PositionalMetadata, type RateLimitInfo, RelayFetchSchema, RelayRequestSchema, type RequestPluginProvides, type ResolveAuthTokenOptions, type ResolveCredentialsOptions, type ResolvedCredentials, ResolvedCredentialsSchema, type RootFieldItem, type RunActionPluginProvides, type Sdk, type SdkEvent, type StaticResolver, 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_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZAPIER_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, type ZapierFetchInitOptions, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, type ZapierSdk, type ZapierSdkApps, type ZapierSdkOptions, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };
package/dist/index.mjs CHANGED
@@ -4281,6 +4281,9 @@ async function getCliLogin() {
4281
4281
  return void 0;
4282
4282
  }
4283
4283
  }
4284
+ function injectCliLogin(module) {
4285
+ cachedCliLogin = module;
4286
+ }
4284
4287
  function isCliLoginAvailable() {
4285
4288
  if (cachedCliLogin === void 0) return void 0;
4286
4289
  return cachedCliLogin !== false;
@@ -4712,7 +4715,8 @@ var ZapierApiClient = class {
4712
4715
  headers.set(authHeaderName, getAuthorizationHeader(authToken));
4713
4716
  }
4714
4717
  if (options.authRequired) {
4715
- if (headers.get("Authorization") == null && authToken == null) {
4718
+ const authHeaderName = pathConfig2?.authHeader ?? "Authorization";
4719
+ if (headers.get(authHeaderName) == null && authToken == null) {
4716
4720
  const message = isCliLoginAvailable() === false ? "Authentication required but no credentials available. To use CLI login, install the CLI as a dev dependency (e.g. `npm install -D @zapier/zapier-sdk-cli`) and log in (e.g. `npx zapier-sdk login`). Alternatively, set the ZAPIER_CREDENTIALS environment variable or ZAPIER_CREDENTIALS_CLIENT_ID and ZAPIER_CREDENTIALS_CLIENT_SECRET environment variables." : "Authentication required but no credentials available. Please log in (e.g. `npx zapier-sdk login`) or set the ZAPIER_CREDENTIALS environment variable or ZAPIER_CREDENTIALS_CLIENT_ID and ZAPIER_CREDENTIALS_CLIENT_SECRET environment variables.";
4717
4721
  throw new ZapierAuthenticationError(message);
4718
4722
  }
@@ -5477,7 +5481,7 @@ function getCpuTime() {
5477
5481
 
5478
5482
  // package.json
5479
5483
  var package_default = {
5480
- version: "0.31.4"};
5484
+ version: "0.32.0"};
5481
5485
 
5482
5486
  // src/plugins/eventEmission/builders.ts
5483
5487
  function createBaseEvent(context = {}) {
@@ -5969,4 +5973,4 @@ var BaseSdkOptionsSchema = z.object({
5969
5973
  // Use credentials instead
5970
5974
  });
5971
5975
 
5972
- export { ActionKeyPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, ClientCredentialsObjectSchema, ConnectionIdPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DebugPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, 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_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZAPIER_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };
5976
+ export { ActionKeyPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, ClientCredentialsObjectSchema, ConnectionIdPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DebugPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, 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_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZAPIER_TOKEN, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTokenFromCliLogin, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, toSnakeCase, toTitleCase };
@@ -6,8 +6,8 @@ export declare const GetActionSchema: z.ZodObject<{
6
6
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
7
7
  };
8
8
  actionType: z.ZodEnum<{
9
- filter: "filter";
10
9
  search: "search";
10
+ filter: "filter";
11
11
  read: "read";
12
12
  read_bulk: "read_bulk";
13
13
  run: "run";
@@ -5,8 +5,8 @@ export declare const GetInputFieldsSchemaSchema: z.ZodObject<{
5
5
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
6
6
  };
7
7
  actionType: z.ZodEnum<{
8
- filter: "filter";
9
8
  search: "search";
9
+ filter: "filter";
10
10
  read: "read";
11
11
  read_bulk: "read_bulk";
12
12
  run: "run";
@@ -7,8 +7,8 @@ export declare const ListActionsSchema: z.ZodObject<{
7
7
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
8
8
  };
9
9
  actionType: z.ZodOptional<z.ZodEnum<{
10
- filter: "filter";
11
10
  search: "search";
11
+ filter: "filter";
12
12
  read: "read";
13
13
  read_bulk: "read_bulk";
14
14
  run: "run";
@@ -13,8 +13,8 @@ export declare const ListInputFieldChoicesSchema: z.ZodObject<{
13
13
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
14
14
  };
15
15
  actionType: z.ZodEnum<{
16
- filter: "filter";
17
16
  search: "search";
17
+ filter: "filter";
18
18
  read: "read";
19
19
  read_bulk: "read_bulk";
20
20
  run: "run";
@@ -7,8 +7,8 @@ export declare const ListInputFieldsSchema: z.ZodObject<{
7
7
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
8
8
  };
9
9
  actionType: z.ZodEnum<{
10
- filter: "filter";
11
10
  search: "search";
11
+ filter: "filter";
12
12
  read: "read";
13
13
  read_bulk: "read_bulk";
14
14
  run: "run";
@@ -6,8 +6,8 @@ export declare const RunActionSchema: z.ZodObject<{
6
6
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
7
7
  };
8
8
  actionType: z.ZodEnum<{
9
- filter: "filter";
10
9
  search: "search";
10
+ filter: "filter";
11
11
  read: "read";
12
12
  read_bulk: "read_bulk";
13
13
  run: "run";
@@ -8,8 +8,8 @@ export declare const ActionItemSchema: z.ZodObject<{
8
8
  app_key: z.ZodString;
9
9
  app_version: z.ZodOptional<z.ZodString>;
10
10
  action_type: z.ZodEnum<{
11
- filter: "filter";
12
11
  search: "search";
12
+ filter: "filter";
13
13
  read: "read";
14
14
  read_bulk: "read_bulk";
15
15
  run: "run";
@@ -3,8 +3,8 @@ export declare const AppKeyPropertySchema: z.ZodString & {
3
3
  _def: z.core.$ZodStringDef & import("..").PositionalMetadata;
4
4
  };
5
5
  export declare const ActionTypePropertySchema: z.ZodEnum<{
6
- filter: "filter";
7
6
  search: "search";
7
+ filter: "filter";
8
8
  read: "read";
9
9
  read_bulk: "read_bulk";
10
10
  run: "run";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.31.4",
3
+ "version": "0.32.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -45,7 +45,7 @@
45
45
  "tsup": "^8.5.0",
46
46
  "typescript": "^5.8.3",
47
47
  "vitest": "^3.2.3",
48
- "@zapier/zapier-sdk-cli-login": "0.7.0"
48
+ "@zapier/zapier-sdk-cli-login": "0.8.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsup",