@zapier/zapier-sdk 0.45.1 → 0.46.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -5
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +7 -1
  5. package/dist/api/schemas.d.ts +5 -5
  6. package/dist/api/types.d.ts +6 -0
  7. package/dist/api/types.d.ts.map +1 -1
  8. package/dist/auth.d.ts +27 -6
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +130 -92
  11. package/dist/cache.d.ts +50 -0
  12. package/dist/cache.d.ts.map +1 -0
  13. package/dist/cache.js +47 -0
  14. package/dist/index.cjs +116 -61
  15. package/dist/index.d.mts +108 -35
  16. package/dist/index.mjs +116 -62
  17. package/dist/plugins/getAction/schemas.d.ts +4 -4
  18. package/dist/plugins/getApp/index.js +1 -1
  19. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +4 -4
  20. package/dist/plugins/listActions/schemas.d.ts +4 -4
  21. package/dist/plugins/listApps/index.js +2 -2
  22. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  23. package/dist/plugins/listApps/schemas.js +2 -0
  24. package/dist/plugins/listClientCredentials/index.js +1 -1
  25. package/dist/plugins/listClientCredentials/schemas.d.ts.map +1 -1
  26. package/dist/plugins/listClientCredentials/schemas.js +1 -0
  27. package/dist/plugins/listInputFieldChoices/schemas.d.ts +4 -4
  28. package/dist/plugins/listInputFields/schemas.d.ts +4 -4
  29. package/dist/plugins/runAction/schemas.d.ts +4 -4
  30. package/dist/plugins/tables/createTableFields/schemas.d.ts +21 -21
  31. package/dist/plugins/tables/listTableFields/schemas.d.ts +12 -12
  32. package/dist/plugins/tables/listTableRecords/schemas.d.ts +6 -6
  33. package/dist/schemas/Action.d.ts +1 -1
  34. package/dist/schemas/Connection.d.ts +3 -0
  35. package/dist/schemas/Connection.d.ts.map +1 -1
  36. package/dist/types/credentials.d.ts +2 -1
  37. package/dist/types/credentials.d.ts.map +1 -1
  38. package/dist/types/credentials.js +2 -1
  39. package/dist/types/properties.d.ts +1 -1
  40. package/dist/types/sdk.d.ts +2 -0
  41. package/dist/types/sdk.d.ts.map +1 -1
  42. package/dist/types/sdk.js +1 -0
  43. package/package.json +4 -6
package/dist/index.mjs CHANGED
@@ -1544,7 +1544,9 @@ function createPaginatedFunction(coreFn, schema, telemetry, explicitFunctionName
1544
1544
  return namedFunctions[functionName];
1545
1545
  }
1546
1546
  var ListAppsSchema = ListAppsQuerySchema.omit({
1547
- offset: true
1547
+ offset: true,
1548
+ app_keys: true,
1549
+ page_size: true
1548
1550
  }).extend({
1549
1551
  // New name for appKeys
1550
1552
  apps: AppsPropertySchema.optional().describe(
@@ -1654,10 +1656,10 @@ var listAppsPlugin = (sdk) => {
1654
1656
  });
1655
1657
  return await api.get("/api/v0/apps", {
1656
1658
  searchParams: {
1657
- appKeys: implementationIds.join(","),
1659
+ app_keys: implementationIds.join(","),
1658
1660
  ...options.search && { search: options.search },
1659
1661
  ...options.pageSize !== void 0 && {
1660
- pageSize: options.pageSize.toString()
1662
+ page_size: options.pageSize.toString()
1661
1663
  },
1662
1664
  ...options.cursor && { offset: options.cursor }
1663
1665
  }
@@ -3597,7 +3599,8 @@ var listConnectionsPlugin = (sdk) => {
3597
3599
  };
3598
3600
  };
3599
3601
  var ListClientCredentialsQuerySchema = ListClientCredentialsQuerySchema$1.omit({
3600
- offset: true
3602
+ offset: true,
3603
+ page_size: true
3601
3604
  }).extend({
3602
3605
  // Override pageSize to make optional
3603
3606
  pageSize: z.number().min(1).optional().describe("Number of credentials per page"),
@@ -3655,7 +3658,7 @@ var listClientCredentialsPlugin = (sdk) => {
3655
3658
  const { api } = sdk.context;
3656
3659
  const searchParams = {};
3657
3660
  if (options.pageSize !== void 0) {
3658
- searchParams.pageSize = options.pageSize.toString();
3661
+ searchParams.page_size = options.pageSize.toString();
3659
3662
  }
3660
3663
  if (options.cursor) {
3661
3664
  searchParams.offset = options.cursor;
@@ -3853,7 +3856,7 @@ var getAppPlugin = (sdk) => {
3853
3856
  async function getApp(options) {
3854
3857
  const appKey = "app" in options ? options.app : options.appKey;
3855
3858
  const appsIterable = sdk.listApps({
3856
- appKeys: [appKey]
3859
+ apps: [appKey]
3857
3860
  }).items();
3858
3861
  for await (const app of appsIterable) {
3859
3862
  return {
@@ -5521,43 +5524,74 @@ function getClientIdFromCredentials(credentials) {
5521
5524
  return void 0;
5522
5525
  }
5523
5526
 
5527
+ // src/cache.ts
5528
+ function createMemoryCache() {
5529
+ const store = /* @__PURE__ */ new Map();
5530
+ return {
5531
+ async get(key) {
5532
+ const entry = store.get(key);
5533
+ if (!entry) return void 0;
5534
+ if (entry.expiresAt !== void 0 && entry.expiresAt <= Date.now()) {
5535
+ store.delete(key);
5536
+ return void 0;
5537
+ }
5538
+ return { value: entry.value, expiresAt: entry.expiresAt };
5539
+ },
5540
+ async set(key, value, options) {
5541
+ const expiresAt = options?.ttl ? Date.now() + options.ttl * 1e3 : void 0;
5542
+ store.set(key, { value, expiresAt });
5543
+ },
5544
+ async delete(key) {
5545
+ store.delete(key);
5546
+ }
5547
+ };
5548
+ }
5549
+
5524
5550
  // src/auth.ts
5525
- var tokenCache = /* @__PURE__ */ new Map();
5551
+ var DEFAULT_AUTH_BASE_URL = "https://zapier.com";
5526
5552
  var pendingExchanges = /* @__PURE__ */ new Map();
5527
- function buildCacheKey(clientId, scopes) {
5528
- const sortedScopes = [...scopes].sort().join(",");
5529
- return `${clientId}:${sortedScopes}`;
5553
+ var cachedDefaultCache;
5554
+ function buildCacheKey(options) {
5555
+ const sortedScopes = [...options.scopes].sort().join(",");
5556
+ return `zapier-sdk/client-credentials/${options.clientId}:${sortedScopes}:${options.baseUrl}`;
5530
5557
  }
5531
5558
  function clearTokenCache() {
5532
- tokenCache.clear();
5533
5559
  pendingExchanges.clear();
5534
5560
  cachedCliLogin = void 0;
5561
+ cachedDefaultCache = void 0;
5535
5562
  }
5536
- var TOKEN_EXPIRATION_BUFFER = 5 * 60 * 1e3;
5537
- function getCachedToken(clientId, scopes) {
5538
- const cacheKey = buildCacheKey(clientId, scopes);
5539
- const cached = tokenCache.get(cacheKey);
5540
- if (!cached) return void 0;
5541
- if (cached.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER) {
5542
- return cached.accessToken;
5563
+ var TOKEN_EXPIRATION_BUFFER_MS = 5 * 60 * 1e3;
5564
+ async function resolveCache(options) {
5565
+ if (options.cache) return options.cache;
5566
+ if (cachedDefaultCache !== void 0) return cachedDefaultCache;
5567
+ const cliLogin = await getCliLogin();
5568
+ if (cliLogin?.createCache) {
5569
+ try {
5570
+ const cache = cliLogin.createCache();
5571
+ cachedDefaultCache = cache;
5572
+ return cache;
5573
+ } catch {
5574
+ }
5543
5575
  }
5544
- tokenCache.delete(cacheKey);
5545
- return void 0;
5576
+ const fallback = createMemoryCache();
5577
+ cachedDefaultCache = fallback;
5578
+ return fallback;
5546
5579
  }
5547
- function cacheToken(clientId, scopes, accessToken, expiresIn) {
5548
- const cacheKey = buildCacheKey(clientId, scopes);
5549
- tokenCache.set(cacheKey, {
5550
- accessToken,
5551
- expiresAt: Date.now() + expiresIn * 1e3
5552
- });
5580
+ function entryIsValid(entry) {
5581
+ if (entry.expiresAt === void 0) return true;
5582
+ return entry.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER_MS;
5553
5583
  }
5554
- function invalidateCachedToken(clientId, scopes) {
5555
- const cacheKey = buildCacheKey(clientId, scopes);
5556
- tokenCache.delete(cacheKey);
5584
+ async function invalidateCachedToken(options) {
5585
+ const cacheKey = buildCacheKey(options);
5557
5586
  pendingExchanges.delete(cacheKey);
5587
+ const cache = await resolveCache({ cache: options.cache });
5588
+ try {
5589
+ await cache.delete(cacheKey);
5590
+ } catch {
5591
+ }
5558
5592
  }
5559
5593
  function getTokenEndpointUrl(baseUrl) {
5560
- const base = baseUrl || ZAPIER_BASE_URL;
5594
+ const base = baseUrl || DEFAULT_AUTH_BASE_URL;
5561
5595
  return `${base}/oauth/token/`;
5562
5596
  }
5563
5597
  function mergeScopes(credentialsScope, requiredScopes) {
@@ -5624,8 +5658,6 @@ async function exchangeClientCredentials(options) {
5624
5658
  if (!data.access_token) {
5625
5659
  throw new Error("Client credentials response missing access_token");
5626
5660
  }
5627
- const expiresIn = data.expires_in || 3600;
5628
- cacheToken(clientId, mergedScopes, data.access_token, expiresIn);
5629
5661
  onEvent?.({
5630
5662
  type: "auth_success",
5631
5663
  payload: {
@@ -5634,7 +5666,10 @@ async function exchangeClientCredentials(options) {
5634
5666
  },
5635
5667
  timestamp: Date.now()
5636
5668
  });
5637
- return data.access_token;
5669
+ return {
5670
+ accessToken: data.access_token,
5671
+ expiresIn: data.expires_in || 3600
5672
+ };
5638
5673
  }
5639
5674
  var cachedCliLogin;
5640
5675
  async function getCliLogin() {
@@ -5649,14 +5684,6 @@ async function getCliLogin() {
5649
5684
  }
5650
5685
  } catch {
5651
5686
  }
5652
- try {
5653
- const mod = await import('@zapier/zapier-sdk-cli-login');
5654
- if (typeof mod.getToken === "function") {
5655
- cachedCliLogin = mod;
5656
- return cachedCliLogin;
5657
- }
5658
- } catch {
5659
- }
5660
5687
  cachedCliLogin = false;
5661
5688
  return void 0;
5662
5689
  }
@@ -5694,24 +5721,41 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
5694
5721
  if (isClientCredentials(credentials)) {
5695
5722
  const { clientId } = credentials;
5696
5723
  const mergedScopes = mergeScopes(credentials.scope, options.requiredScopes);
5697
- const cacheKey = buildCacheKey(clientId, mergedScopes);
5698
- const cached = getCachedToken(clientId, mergedScopes);
5699
- if (cached) {
5700
- return cached;
5724
+ const resolvedBaseUrl = credentials.baseUrl || options.baseUrl || DEFAULT_AUTH_BASE_URL;
5725
+ const cacheKey = buildCacheKey({
5726
+ clientId,
5727
+ scopes: mergedScopes,
5728
+ baseUrl: resolvedBaseUrl
5729
+ });
5730
+ const cache = await resolveCache(options);
5731
+ const cached = await cache.get(cacheKey);
5732
+ if (cached && entryIsValid(cached)) {
5733
+ return cached.value;
5701
5734
  }
5702
5735
  const pending = pendingExchanges.get(cacheKey);
5703
- if (pending) {
5704
- return pending;
5705
- }
5706
- const exchangePromise = exchangeClientCredentials({
5707
- clientId: credentials.clientId,
5708
- clientSecret: credentials.clientSecret,
5709
- baseUrl: credentials.baseUrl || options.baseUrl,
5710
- scope: credentials.scope,
5711
- requiredScopes: options.requiredScopes,
5712
- fetch: options.fetch,
5713
- onEvent: options.onEvent
5714
- }).finally(() => {
5736
+ if (pending) return pending;
5737
+ const runLocked = async () => {
5738
+ const recheck = await cache.get(cacheKey);
5739
+ if (recheck && entryIsValid(recheck)) return recheck.value;
5740
+ const { accessToken, expiresIn } = await exchangeClientCredentials({
5741
+ clientId: credentials.clientId,
5742
+ clientSecret: credentials.clientSecret,
5743
+ baseUrl: credentials.baseUrl || options.baseUrl,
5744
+ scope: credentials.scope,
5745
+ requiredScopes: options.requiredScopes,
5746
+ fetch: options.fetch,
5747
+ onEvent: options.onEvent
5748
+ });
5749
+ try {
5750
+ await cache.set(cacheKey, accessToken, {
5751
+ secret: true,
5752
+ ttl: expiresIn
5753
+ });
5754
+ } catch {
5755
+ }
5756
+ return accessToken;
5757
+ };
5758
+ const exchangePromise = (cache.withLock ? cache.withLock(cacheKey, runLocked) : runLocked()).finally(() => {
5715
5759
  pendingExchanges.delete(cacheKey);
5716
5760
  });
5717
5761
  pendingExchanges.set(cacheKey, exchangePromise);
@@ -5739,12 +5783,18 @@ async function invalidateCredentialsToken(options) {
5739
5783
  const clientId = getClientIdFromCredentials(resolved);
5740
5784
  if (clientId && isClientCredentials(resolved)) {
5741
5785
  const scopes = mergeScopes(resolved.scope, options.requiredScopes);
5742
- invalidateCachedToken(clientId, scopes);
5786
+ const baseUrl = resolved.baseUrl || options.baseUrl || DEFAULT_AUTH_BASE_URL;
5787
+ await invalidateCachedToken({
5788
+ clientId,
5789
+ scopes,
5790
+ baseUrl,
5791
+ cache: options.cache
5792
+ });
5743
5793
  }
5744
5794
  }
5745
5795
 
5746
5796
  // src/sdk-version.ts
5747
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.45.1" : void 0) || "unknown";
5797
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.46.0" : void 0) || "unknown";
5748
5798
 
5749
5799
  // src/utils/open-url.ts
5750
5800
  var nodePrefix = "node:";
@@ -6091,7 +6141,8 @@ var ZapierApiClient = class {
6091
6141
  fetch: this.options.fetch,
6092
6142
  baseUrl: this.options.baseUrl,
6093
6143
  requiredScopes: options?.requiredScopes,
6094
- debug: this.options.debug
6144
+ debug: this.options.debug,
6145
+ cache: this.options.cache
6095
6146
  });
6096
6147
  }
6097
6148
  // Helper to handle responses
@@ -6142,7 +6193,9 @@ var ZapierApiClient = class {
6142
6193
  await invalidateCredentialsToken({
6143
6194
  credentials: this.options.credentials,
6144
6195
  token: this.options.token,
6145
- requiredScopes
6196
+ baseUrl: this.options.baseUrl,
6197
+ requiredScopes,
6198
+ cache: this.options.cache
6146
6199
  });
6147
6200
  }
6148
6201
  throw new ZapierAuthenticationError(message, errorOptions);
@@ -9068,6 +9121,7 @@ var BaseSdkOptionsSchema = z.object({
9068
9121
  fetch: z.custom().optional().meta({ internal: true }),
9069
9122
  eventEmission: z.custom().optional().meta({ internal: true }),
9070
9123
  callerPackage: z.custom().optional().meta({ internal: true }),
9124
+ cache: z.custom().optional().meta({ internal: true }),
9071
9125
  canIncludeSharedConnections: z.boolean().optional().describe("Allow listing shared connections."),
9072
9126
  canIncludeSharedTables: z.boolean().optional().describe("Allow listing shared tables."),
9073
9127
  canDeleteTables: z.boolean().optional().describe("Allow deleting tables."),
@@ -9084,4 +9138,4 @@ var registryPlugin = () => {
9084
9138
  return {};
9085
9139
  };
9086
9140
 
9087
- export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DebugPropertySchema, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createOptionsPlugin, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getZapierApprovalMode, getZapierIsInteractive, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, updateTableRecordsPlugin };
9141
+ export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_APPROVAL_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DebugPropertySchema, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getZapierApprovalMode, getZapierIsInteractive, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, updateTableRecordsPlugin };
@@ -6,11 +6,11 @@ export declare const GetActionSchema: z.ZodObject<{
6
6
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
7
7
  };
8
8
  actionType: z.ZodEnum<{
9
- search: "search";
10
9
  filter: "filter";
11
10
  read: "read";
12
11
  read_bulk: "read_bulk";
13
12
  run: "run";
13
+ search: "search";
14
14
  search_and_write: "search_and_write";
15
15
  search_or_write: "search_or_write";
16
16
  write: "write";
@@ -24,11 +24,11 @@ declare const GetActionSchemaDeprecated: z.ZodObject<{
24
24
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
25
25
  };
26
26
  actionType: z.ZodEnum<{
27
- search: "search";
28
27
  filter: "filter";
29
28
  read: "read";
30
29
  read_bulk: "read_bulk";
31
30
  run: "run";
31
+ search: "search";
32
32
  search_and_write: "search_and_write";
33
33
  search_or_write: "search_or_write";
34
34
  write: "write";
@@ -40,11 +40,11 @@ export declare const GetActionInputSchema: z.ZodUnion<readonly [z.ZodObject<{
40
40
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
41
41
  };
42
42
  actionType: z.ZodEnum<{
43
- search: "search";
44
43
  filter: "filter";
45
44
  read: "read";
46
45
  read_bulk: "read_bulk";
47
46
  run: "run";
47
+ search: "search";
48
48
  search_and_write: "search_and_write";
49
49
  search_or_write: "search_or_write";
50
50
  write: "write";
@@ -57,11 +57,11 @@ export declare const GetActionInputSchema: z.ZodUnion<readonly [z.ZodObject<{
57
57
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
58
58
  };
59
59
  actionType: z.ZodEnum<{
60
- search: "search";
61
60
  filter: "filter";
62
61
  read: "read";
63
62
  read_bulk: "read_bulk";
64
63
  run: "run";
64
+ search: "search";
65
65
  search_and_write: "search_and_write";
66
66
  search_or_write: "search_or_write";
67
67
  write: "write";
@@ -10,7 +10,7 @@ export const getAppPlugin = (sdk) => {
10
10
  const appKey = "app" in options ? options.app : options.appKey;
11
11
  const appsIterable = sdk
12
12
  .listApps({
13
- appKeys: [appKey],
13
+ apps: [appKey],
14
14
  })
15
15
  .items();
16
16
  for await (const app of appsIterable) {
@@ -5,11 +5,11 @@ export declare const GetInputFieldsSchemaSchema: z.ZodObject<{
5
5
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
6
6
  };
7
7
  actionType: z.ZodEnum<{
8
- search: "search";
9
8
  filter: "filter";
10
9
  read: "read";
11
10
  read_bulk: "read_bulk";
12
11
  run: "run";
12
+ search: "search";
13
13
  search_and_write: "search_and_write";
14
14
  search_or_write: "search_or_write";
15
15
  write: "write";
@@ -27,11 +27,11 @@ declare const GetInputFieldsSchemaSchemaDeprecated: z.ZodObject<{
27
27
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
28
28
  };
29
29
  actionType: z.ZodEnum<{
30
- search: "search";
31
30
  filter: "filter";
32
31
  read: "read";
33
32
  read_bulk: "read_bulk";
34
33
  run: "run";
34
+ search: "search";
35
35
  search_and_write: "search_and_write";
36
36
  search_or_write: "search_or_write";
37
37
  write: "write";
@@ -47,11 +47,11 @@ export declare const GetInputFieldsSchemaInputSchema: z.ZodUnion<readonly [z.Zod
47
47
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
48
48
  };
49
49
  actionType: z.ZodEnum<{
50
- search: "search";
51
50
  filter: "filter";
52
51
  read: "read";
53
52
  read_bulk: "read_bulk";
54
53
  run: "run";
54
+ search: "search";
55
55
  search_and_write: "search_and_write";
56
56
  search_or_write: "search_or_write";
57
57
  write: "write";
@@ -68,11 +68,11 @@ export declare const GetInputFieldsSchemaInputSchema: z.ZodUnion<readonly [z.Zod
68
68
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
69
69
  };
70
70
  actionType: z.ZodEnum<{
71
- search: "search";
72
71
  filter: "filter";
73
72
  read: "read";
74
73
  read_bulk: "read_bulk";
75
74
  run: "run";
75
+ search: "search";
76
76
  search_and_write: "search_and_write";
77
77
  search_or_write: "search_or_write";
78
78
  write: "write";
@@ -7,11 +7,11 @@ export declare const ListActionsSchema: z.ZodObject<{
7
7
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
8
8
  };
9
9
  actionType: z.ZodOptional<z.ZodEnum<{
10
- search: "search";
11
10
  filter: "filter";
12
11
  read: "read";
13
12
  read_bulk: "read_bulk";
14
13
  run: "run";
14
+ search: "search";
15
15
  search_and_write: "search_and_write";
16
16
  search_or_write: "search_or_write";
17
17
  write: "write";
@@ -25,11 +25,11 @@ declare const ListActionsSchemaDeprecated: z.ZodObject<{
25
25
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
26
26
  };
27
27
  actionType: z.ZodOptional<z.ZodEnum<{
28
- search: "search";
29
28
  filter: "filter";
30
29
  read: "read";
31
30
  read_bulk: "read_bulk";
32
31
  run: "run";
32
+ search: "search";
33
33
  search_and_write: "search_and_write";
34
34
  search_or_write: "search_or_write";
35
35
  write: "write";
@@ -43,11 +43,11 @@ export declare const ListActionsInputSchema: z.ZodUnion<readonly [z.ZodObject<{
43
43
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
44
44
  };
45
45
  actionType: z.ZodOptional<z.ZodEnum<{
46
- search: "search";
47
46
  filter: "filter";
48
47
  read: "read";
49
48
  read_bulk: "read_bulk";
50
49
  run: "run";
50
+ search: "search";
51
51
  search_and_write: "search_and_write";
52
52
  search_or_write: "search_or_write";
53
53
  write: "write";
@@ -60,11 +60,11 @@ export declare const ListActionsInputSchema: z.ZodUnion<readonly [z.ZodObject<{
60
60
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
61
61
  };
62
62
  actionType: z.ZodOptional<z.ZodEnum<{
63
- search: "search";
64
63
  filter: "filter";
65
64
  read: "read";
66
65
  read_bulk: "read_bulk";
67
66
  run: "run";
67
+ search: "search";
68
68
  search_and_write: "search_and_write";
69
69
  search_or_write: "search_or_write";
70
70
  write: "write";
@@ -42,10 +42,10 @@ export const listAppsPlugin = (sdk) => {
42
42
  });
43
43
  return await api.get("/api/v0/apps", {
44
44
  searchParams: {
45
- appKeys: implementationIds.join(","),
45
+ app_keys: implementationIds.join(","),
46
46
  ...(options.search && { search: options.search }),
47
47
  ...(options.pageSize !== undefined && {
48
- pageSize: options.pageSize.toString(),
48
+ page_size: options.pageSize.toString(),
49
49
  }),
50
50
  ...(options.cursor && { offset: options.cursor }),
51
51
  },
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,sBAAsB,IAAI,0BAA0B,EAEpD,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACtB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EAAE,iBAAiB,IAAI,aAAa,EAAE,CAAC;AAC9C,OAAO,EAAE,0BAA0B,IAAI,sBAAsB,EAAE,CAAC;AAChE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;;;;;iBA4BmC,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAG7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGnE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC,eAAe,GAAG,SAAS,EAAE,OAAO,CAAC,CAAC;CACtE"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,sBAAsB,IAAI,0BAA0B,EAEpD,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACtB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EAAE,iBAAiB,IAAI,aAAa,EAAE,CAAC;AAC9C,OAAO,EAAE,0BAA0B,IAAI,sBAAsB,EAAE,CAAC;AAChE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;;;;;iBA8BmC,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAG7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGnE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC,eAAe,GAAG,SAAS,EAAE,OAAO,CAAC,CAAC;CACtE"}
@@ -27,6 +27,8 @@ export { ListAppsResponseSchemaBase as ListAppsResponseSchema };
27
27
  */
28
28
  export const ListAppsSchema = ListAppsQueryBase.omit({
29
29
  offset: true,
30
+ app_keys: true,
31
+ page_size: true,
30
32
  })
31
33
  .extend({
32
34
  // New name for appKeys
@@ -10,7 +10,7 @@ export const listClientCredentialsPlugin = (sdk) => {
10
10
  const { api } = sdk.context;
11
11
  const searchParams = {};
12
12
  if (options.pageSize !== undefined) {
13
- searchParams.pageSize = options.pageSize.toString();
13
+ searchParams.page_size = options.pageSize.toString();
14
14
  }
15
15
  if (options.cursor) {
16
16
  searchParams.offset = options.cursor;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAEnG,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,eAAO,MAAM,gCAAgC;;;;iBAoBsB,CAAC;AAGpE,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,gCAAgC,CACxC,CAAC;AAGF,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,qBAAqB,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,0BAA0B,GAClC,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,gCAAgC;IAC/C,qBAAqB,EAAE,oBAAoB,CACzC,4BAA4B,EAC5B,qBAAqB,CACtB,CAAC;CACH"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAEnG,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,eAAO,MAAM,gCAAgC;;;;iBAqBsB,CAAC;AAGpE,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,gCAAgC,CACxC,CAAC;AAGF,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,qBAAqB,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,0BAA0B,GAClC,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,gCAAgC;IAC/C,qBAAqB,EAAE,oBAAoB,CACzC,4BAA4B,EAC5B,qBAAqB,CACtB,CAAC;CACH"}
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  import { ListClientCredentialsQuerySchema as ListClientCredentialsQueryBase } from "@zapier/zapier-sdk-core/v0/schemas/client-credentials";
3
3
  export const ListClientCredentialsQuerySchema = ListClientCredentialsQueryBase.omit({
4
4
  offset: true,
5
+ page_size: true,
5
6
  })
6
7
  .extend({
7
8
  // Override pageSize to make optional
@@ -13,11 +13,11 @@ export declare const ListInputFieldChoicesSchema: z.ZodObject<{
13
13
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
14
14
  };
15
15
  actionType: z.ZodEnum<{
16
- search: "search";
17
16
  filter: "filter";
18
17
  read: "read";
19
18
  read_bulk: "read_bulk";
20
19
  run: "run";
20
+ search: "search";
21
21
  search_and_write: "search_and_write";
22
22
  search_or_write: "search_or_write";
23
23
  write: "write";
@@ -42,11 +42,11 @@ declare const ListInputFieldChoicesSchemaDeprecated: z.ZodObject<{
42
42
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
43
43
  };
44
44
  actionType: z.ZodEnum<{
45
- search: "search";
46
45
  filter: "filter";
47
46
  read: "read";
48
47
  read_bulk: "read_bulk";
49
48
  run: "run";
49
+ search: "search";
50
50
  search_and_write: "search_and_write";
51
51
  search_or_write: "search_or_write";
52
52
  write: "write";
@@ -67,11 +67,11 @@ export declare const ListInputFieldChoicesInputSchema: z.ZodUnion<readonly [z.Zo
67
67
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
68
68
  };
69
69
  actionType: z.ZodEnum<{
70
- search: "search";
71
70
  filter: "filter";
72
71
  read: "read";
73
72
  read_bulk: "read_bulk";
74
73
  run: "run";
74
+ search: "search";
75
75
  search_and_write: "search_and_write";
76
76
  search_or_write: "search_or_write";
77
77
  write: "write";
@@ -95,11 +95,11 @@ export declare const ListInputFieldChoicesInputSchema: z.ZodUnion<readonly [z.Zo
95
95
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
96
96
  };
97
97
  actionType: z.ZodEnum<{
98
- search: "search";
99
98
  filter: "filter";
100
99
  read: "read";
101
100
  read_bulk: "read_bulk";
102
101
  run: "run";
102
+ search: "search";
103
103
  search_and_write: "search_and_write";
104
104
  search_or_write: "search_or_write";
105
105
  write: "write";
@@ -7,11 +7,11 @@ export declare const ListInputFieldsSchema: z.ZodObject<{
7
7
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
8
8
  };
9
9
  actionType: z.ZodEnum<{
10
- search: "search";
11
10
  filter: "filter";
12
11
  read: "read";
13
12
  read_bulk: "read_bulk";
14
13
  run: "run";
14
+ search: "search";
15
15
  search_and_write: "search_and_write";
16
16
  search_or_write: "search_or_write";
17
17
  write: "write";
@@ -32,11 +32,11 @@ declare const ListInputFieldsSchemaDeprecated: z.ZodObject<{
32
32
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
33
33
  };
34
34
  actionType: z.ZodEnum<{
35
- search: "search";
36
35
  filter: "filter";
37
36
  read: "read";
38
37
  read_bulk: "read_bulk";
39
38
  run: "run";
39
+ search: "search";
40
40
  search_and_write: "search_and_write";
41
41
  search_or_write: "search_or_write";
42
42
  write: "write";
@@ -55,11 +55,11 @@ export declare const ListInputFieldsInputSchema: z.ZodUnion<readonly [z.ZodObjec
55
55
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
56
56
  };
57
57
  actionType: z.ZodEnum<{
58
- search: "search";
59
58
  filter: "filter";
60
59
  read: "read";
61
60
  read_bulk: "read_bulk";
62
61
  run: "run";
62
+ search: "search";
63
63
  search_and_write: "search_and_write";
64
64
  search_or_write: "search_or_write";
65
65
  write: "write";
@@ -79,11 +79,11 @@ export declare const ListInputFieldsInputSchema: z.ZodUnion<readonly [z.ZodObjec
79
79
  _def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
80
80
  };
81
81
  actionType: z.ZodEnum<{
82
- search: "search";
83
82
  filter: "filter";
84
83
  read: "read";
85
84
  read_bulk: "read_bulk";
86
85
  run: "run";
86
+ search: "search";
87
87
  search_and_write: "search_and_write";
88
88
  search_or_write: "search_or_write";
89
89
  write: "write";