@zapier/zapier-sdk 0.53.0 → 0.54.1

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 (36) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +10 -9
  3. package/dist/experimental.cjs +106 -62
  4. package/dist/experimental.d.mts +4 -2
  5. package/dist/experimental.d.ts +1 -0
  6. package/dist/experimental.d.ts.map +1 -1
  7. package/dist/experimental.mjs +106 -62
  8. package/dist/{index-D2HKNk0N.d.mts → index-SDDmBk2j.d.mts} +85 -10
  9. package/dist/{index-D2HKNk0N.d.ts → index-SDDmBk2j.d.ts} +85 -10
  10. package/dist/index.cjs +51 -27
  11. package/dist/index.d.mts +2 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.mjs +51 -27
  15. package/dist/plugins/triggers/createTriggerInbox/index.d.ts +1 -0
  16. package/dist/plugins/triggers/createTriggerInbox/index.d.ts.map +1 -1
  17. package/dist/plugins/triggers/createTriggerInbox/index.js +18 -3
  18. package/dist/plugins/triggers/createTriggerInbox/schemas.d.ts +1 -0
  19. package/dist/plugins/triggers/createTriggerInbox/schemas.d.ts.map +1 -1
  20. package/dist/plugins/triggers/createTriggerInbox/schemas.js +3 -2
  21. package/dist/plugins/triggers/ensureTriggerInbox/index.d.ts.map +1 -1
  22. package/dist/plugins/triggers/ensureTriggerInbox/index.js +1 -12
  23. package/dist/plugins/triggers/utils.d.ts +6 -0
  24. package/dist/plugins/triggers/utils.d.ts.map +1 -1
  25. package/dist/plugins/triggers/utils.js +17 -0
  26. package/dist/resolvers/appKey.d.ts +7 -2
  27. package/dist/resolvers/appKey.d.ts.map +1 -1
  28. package/dist/resolvers/appKey.js +46 -3
  29. package/dist/schemas/App.d.ts.map +1 -1
  30. package/dist/schemas/App.js +2 -11
  31. package/dist/utils/domain-utils.d.ts +4 -0
  32. package/dist/utils/domain-utils.d.ts.map +1 -1
  33. package/dist/utils/domain-utils.js +5 -0
  34. package/dist/utils/schema-utils.d.ts +80 -8
  35. package/dist/utils/schema-utils.d.ts.map +1 -1
  36. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1371,6 +1371,18 @@ var FetchInitSchema = zod.z.object({
1371
1371
  aliases: { connectionId: "connection", authenticationId: "connection" }
1372
1372
  });
1373
1373
 
1374
+ // src/utils/string-utils.ts
1375
+ function toTitleCase(input) {
1376
+ return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
1377
+ }
1378
+ function toSnakeCase(input) {
1379
+ let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
1380
+ if (/^[0-9]/.test(result)) {
1381
+ result = "_" + result;
1382
+ }
1383
+ return result;
1384
+ }
1385
+
1374
1386
  // src/utils/domain-utils.ts
1375
1387
  function isConnectionId(value) {
1376
1388
  return /^\d+$/.test(value) || isUuid(value);
@@ -1517,6 +1529,12 @@ function toAppLocator(appKey) {
1517
1529
  function isResolvedAppLocator(appLocator) {
1518
1530
  return !!appLocator.implementationName;
1519
1531
  }
1532
+ function getAppKeyList(app) {
1533
+ const keys = new Set(
1534
+ [app.slug, toSnakeCase(app.slug), app.key].filter(Boolean)
1535
+ );
1536
+ return Array.from(keys);
1537
+ }
1520
1538
 
1521
1539
  // src/utils/abort-utils.ts
1522
1540
  function getAbortSignalApi() {
@@ -1822,34 +1840,12 @@ var ListAppsSchema = apps.ListAppsQuerySchema.omit({
1822
1840
  // SDK specific property for pagination/iterable helpers
1823
1841
  cursor: zod.z.string().optional().describe("Cursor to start from")
1824
1842
  }).describe("List all available apps with optional filtering");
1825
-
1826
- // src/utils/string-utils.ts
1827
- function toTitleCase(input) {
1828
- return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
1829
- }
1830
- function toSnakeCase(input) {
1831
- let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
1832
- if (/^[0-9]/.test(result)) {
1833
- result = "_" + result;
1834
- }
1835
- return result;
1836
- }
1837
-
1838
- // src/schemas/App.ts
1839
1843
  var AppItemSchema = withFormatter(apps.AppItemSchema, {
1840
1844
  format: (item) => {
1841
- const additionalKeys = [];
1842
- if (item.slug && item.slug !== item.key) {
1843
- additionalKeys.push(item.slug);
1844
- const snakeCaseSlug = toSnakeCase(item.slug);
1845
- if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
1846
- additionalKeys.push(snakeCaseSlug);
1847
- }
1848
- }
1849
1845
  return {
1850
1846
  title: item.title,
1851
1847
  key: item.key,
1852
- keys: [item.key, ...additionalKeys],
1848
+ keys: getAppKeyList(item),
1853
1849
  description: item.description,
1854
1850
  details: []
1855
1851
  };
@@ -2275,9 +2271,37 @@ var ActionItemSchema = withFormatter(
2275
2271
 
2276
2272
  // src/resolvers/appKey.ts
2277
2273
  var appKeyResolver = {
2278
- type: "static",
2279
- inputType: "text",
2280
- placeholder: "Enter app key (e.g., 'SlackCLIAPI' or slug like 'github')"
2274
+ type: "dynamic",
2275
+ inputType: "search",
2276
+ placeholder: "e.g., 'slack' or 'SlackCLIAPI' or 'mail'",
2277
+ // Try the user's typed string as an exact app locator first; getApp accepts
2278
+ // a slug, key, or implementation id. If that hits, short-circuit with the
2279
+ // input — every variant the user could have typed is already a valid value
2280
+ // anywhere else app is required, so no canonicalization needed here. If
2281
+ // getApp 404s, fall back to a search; any other error (auth, network,
2282
+ // rate-limit) propagates so the user sees the real problem.
2283
+ fetch: async (sdk, { search }) => {
2284
+ if (!search) return [];
2285
+ try {
2286
+ await sdk.getApp({ app: search });
2287
+ return search;
2288
+ } catch (err) {
2289
+ if (!(err instanceof ZapierAppNotFoundError) && !(err instanceof ZapierNotFoundError)) {
2290
+ throw err;
2291
+ }
2292
+ }
2293
+ const page = await sdk.listApps({ search });
2294
+ return page.data;
2295
+ },
2296
+ prompt: (apps) => ({
2297
+ type: "list",
2298
+ name: "app",
2299
+ message: "Select app:",
2300
+ choices: apps.map((app) => ({
2301
+ name: app.title ? `${app.title} (${getAppKeyList(app).join(", ")})` : app.key,
2302
+ value: app.key
2303
+ }))
2304
+ })
2281
2305
  };
2282
2306
 
2283
2307
  // src/resolvers/actionType.ts
@@ -6285,7 +6309,7 @@ async function invalidateCredentialsToken(options) {
6285
6309
  }
6286
6310
 
6287
6311
  // src/sdk-version.ts
6288
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.53.0" : void 0) || "unknown";
6312
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.54.1" : void 0) || "unknown";
6289
6313
 
6290
6314
  // src/utils/open-url.ts
6291
6315
  var nodePrefix = "node:";
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- export { u as Action, d as ActionEntry, cg as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aU as ActionItem, bv as ActionKeyProperty, b3 as ActionKeyPropertySchema, bw as ActionProperty, b4 as ActionPropertySchema, aq as ActionResolverItem, bH as ActionTimeoutMsProperty, bf as ActionTimeoutMsPropertySchema, ar as ActionTypeItem, bu as ActionTypeProperty, b2 as ActionTypePropertySchema, b as AddActionEntryOptions, c as AddActionEntryResult, A as ApiClient, bU as ApiError, dC as ApiEvent, c_ as ApiPluginOptions, d0 as ApiPluginProvides, v as App, ch as AppFactoryInput, aS as AppItem, bs as AppKeyProperty, b0 as AppKeyPropertySchema, bt as AppProperty, b1 as AppPropertySchema, aB as ApplicationLifecycleEventData, c9 as ApprovalStatus, cf as AppsPluginProvides, bM as AppsProperty, bk as AppsPropertySchema, a0 as ArrayResolver, dB as AuthEvent, bA as AuthenticationIdProperty, b7 as AuthenticationIdPropertySchema, ax as BaseEvent, aj as BaseSdkOptionsSchema, a8 as BatchOptions, cN as CONTEXT_CACHE_MAX_SIZE, cM as CONTEXT_CACHE_TTL_MS, x as Choice, dI as ClientCredentialsObject, dT as ClientCredentialsObjectSchema, K as Connection, d$ as ConnectionEntry, d_ as ConnectionEntrySchema, by as ConnectionIdProperty, b6 as ConnectionIdPropertySchema, aT as ConnectionItem, bz as ConnectionProperty, b8 as ConnectionPropertySchema, e1 as ConnectionsMap, e0 as ConnectionsMapSchema, e3 as ConnectionsPluginProvides, bO as ConnectionsProperty, bm as ConnectionsPropertySchema, O as ConnectionsResponse, cz as CreateClientCredentialsPluginProvides, es as CreateTableFieldsPluginProvides, em as CreateTablePluginProvides, eA as CreateTableRecordsPluginProvides, dF as Credentials, dY as CredentialsFunction, dX as CredentialsFunctionSchema, dH as CredentialsObject, dV as CredentialsObjectSchema, dZ as CredentialsSchema, e8 as DEFAULT_ACTION_TIMEOUT_MS, ef as DEFAULT_APPROVAL_TIMEOUT_MS, cW as DEFAULT_CONFIG_PATH, eg as DEFAULT_MAX_APPROVAL_RETRIES, e7 as DEFAULT_PAGE_SIZE, bF as DebugProperty, bd as DebugPropertySchema, cB as DeleteClientCredentialsPluginProvides, eu as DeleteTableFieldsPluginProvides, eo as DeleteTablePluginProvides, eC as DeleteTableRecordsPluginProvides, o as DrainTriggerInboxCallback, p as DrainTriggerInboxErrorObserver, D as DrainTriggerInboxOptions, i as DynamicResolver, aC as EnhancedErrorEventData, bV as ErrorOptions, dE as EventCallback, aA as EventContext, E as EventEmissionContext, az as EventEmissionProvides, cj as FetchPluginProvides, w as Field, bL as FieldsProperty, bj as FieldsPropertySchema, a3 as FieldsResolver, F as FieldsetItem, s as FindFirstAuthenticationPluginProvides, cJ as FindFirstConnectionPluginProvides, t as FindUniqueAuthenticationPluginProvides, cL as FindUniqueConnectionPluginProvides, Y as FormatMetadata, X as FormattedItem, ai as FunctionDeprecation, aZ as FunctionOptions, ah as FunctionRegistryEntry, ct as GetActionInputFieldsSchemaPluginProvides, cF as GetActionPluginProvides, cD as GetAppPluginProvides, G as GetAuthenticationPluginProvides, cH as GetConnectionPluginProvides, cZ as GetProfilePluginProvides, ek as GetTablePluginProvides, ew as GetTableRecordPluginProvides, aW as InfoFieldItem, aV as InputFieldItem, bx as InputFieldProperty, b5 as InputFieldPropertySchema, bB as InputsProperty, b9 as InputsPropertySchema, bT as LeaseLimitProperty, br as LeaseLimitPropertySchema, bR as LeaseProperty, bp as LeasePropertySchema, bS as LeaseSecondsProperty, bq as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bC as LimitProperty, ba as LimitPropertySchema, cr as ListActionInputFieldChoicesPluginProvides, cp as ListActionInputFieldsPluginProvides, cn as ListActionsPluginProvides, cl as ListAppsPluginProvides, q as ListAuthenticationsPluginProvides, cx as ListClientCredentialsPluginProvides, cv as ListConnectionsPluginProvides, eq as ListTableFieldsPluginProvides, ey as ListTableRecordsPluginProvides, ei as ListTablesPluginProvides, dD as LoadingEvent, eb as MAX_CONCURRENCY_LIMIT, e6 as MAX_PAGE_LIMIT, M as Manifest, cX as ManifestEntry, cS as ManifestPluginOptions, cV as ManifestPluginProvides, ay as MethodCalledEvent, aD as MethodCalledEventData, N as Need, I as NeedsRequest, J as NeedsResponse, bD as OffsetProperty, bb as OffsetPropertySchema, _ as OutputFormatter, bE as OutputProperty, bc as OutputPropertySchema, a$ as PaginatedSdkFunction, e as PaginatedSdkResult, bG as ParamsProperty, be as ParamsPropertySchema, dJ as PkceCredentialsObject, dU as PkceCredentialsObjectSchema, ak as Plugin, P as PluginMeta, al as PluginProvides, au as PollOptions, g as PositionalMetadata, c7 as RateLimitInfo, bJ as RecordProperty, bh as RecordPropertySchema, bK as RecordsProperty, bi as RecordsPropertySchema, ad as RelayFetchSchema, ac as RelayRequestSchema, at as RequestOptions, cR as RequestPluginProvides, dn as ResolveAuthTokenOptions, dO as ResolveCredentialsOptions, R as ResolvedAppLocator, dG as ResolvedCredentials, dW as ResolvedCredentialsSchema, $ as Resolver, a1 as ResolverMetadata, aX as RootFieldItem, cP as RunActionPluginProvides, dA as SdkEvent, a_ as SdkPage, a2 as StaticResolver, bI as TableProperty, bg as TablePropertySchema, bN as TablesProperty, bl as TablesPropertySchema, bQ as TriggerInboxNameProperty, bo as TriggerInboxNamePropertySchema, bP as TriggerInboxProperty, bn as TriggerInboxPropertySchema, T as TriggerMessageStatus, U as UpdateManifestEntryOptions, a as UpdateManifestEntryResult, eE as UpdateTableRecordsPluginProvides, Q as UserProfile, aY as UserProfileItem, j as WatchTriggerInboxOptions, W as WithAddPlugin, e4 as ZAPIER_BASE_URL, ed as ZAPIER_MAX_CONCURRENT_REQUESTS, e9 as ZAPIER_MAX_NETWORK_RETRIES, ea as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, m as ZapierAbortDrainSignal, c5 as ZapierActionError, bX as ZapierApiError, bY as ZapierAppNotFoundError, ca as ZapierApprovalError, b$ as ZapierAuthenticationError, c3 as ZapierBundleError, dw as ZapierCache, dx as ZapierCacheEntry, dy as ZapierCacheSetOptions, c2 as ZapierConfigurationError, c6 as ZapierConflictError, bW as ZapierError, h as ZapierFetchInitOptions, c0 as ZapierNotFoundError, c8 as ZapierRateLimitError, cb as ZapierRelayError, n as ZapierReleaseTriggerMessageSignal, c1 as ZapierResourceNotFoundError, eG as ZapierSdk, l as ZapierSdkApps, Z as ZapierSdkOptions, cd as ZapierSignal, c4 as ZapierTimeoutError, b_ as ZapierUnknownError, bZ as ZapierValidationError, d3 as actionKeyResolver, d2 as actionTypeResolver, c$ as apiPlugin, d1 as appKeyResolver, ce as appsPlugin, d5 as authenticationIdGenericResolver, d4 as authenticationIdResolver, a7 as batch, aN as buildApplicationLifecycleEvent, a9 as buildCapabilityMessage, aP as buildErrorEvent, aO as buildErrorEventWithContext, aR as buildMethodCalledEvent, dp as clearTokenCache, d9 as clientCredentialsNameResolver, da as clientIdResolver, ap as composePlugins, d5 as connectionIdGenericResolver, d4 as connectionIdResolver, e2 as connectionsPlugin, aQ as createBaseEvent, cy as createClientCredentialsPlugin, V as createFunction, dz as createMemoryCache, ag as createOptionsPlugin, ao as createPaginatedPluginMethod, an as createPluginMethod, af as createSdk, er as createTableFieldsPlugin, el as createTablePlugin, ez as createTableRecordsPlugin, av as createZapierApi, eF as createZapierSdk, ae as createZapierSdkWithoutRegistry, am as definePlugin, cA as deleteClientCredentialsPlugin, et as deleteTableFieldsPlugin, en as deleteTablePlugin, eB as deleteTableRecordsPlugin, ci as fetchPlugin, cI as findFirstConnectionPlugin, f as findManifestEntry, cK as findUniqueConnectionPlugin, cc as formatErrorMessage, aE as generateEventId, cs as getActionInputFieldsSchemaPlugin, cE as getActionPlugin, cC as getAppPlugin, dR as getBaseUrlFromCredentials, aK as getCiPlatform, dS as getClientIdFromCredentials, cG as getConnectionPlugin, aM as getCpuTime, aF as getCurrentTimestamp, aL as getMemoryUsage, aw as getOrCreateApiClient, aH as getOsInfo, aI as getPlatformVersions, cT as getPreferredManifestEntryKey, cY as getProfilePlugin, aG as getReleaseId, ej as getTablePlugin, ev as getTableRecordPlugin, dt as getTokenFromCliLogin, ee as getZapierApprovalMode, e5 as getZapierSdkService, dr as injectCliLogin, d8 as inputFieldKeyResolver, d7 as inputsAllOptionalResolver, d6 as inputsResolver, dq as invalidateCachedToken, dv as invalidateCredentialsToken, aJ as isCi, ds as isCliLoginAvailable, dK as isClientCredentials, dN as isCredentialsFunction, dM as isCredentialsObject, dL as isPkceCredentials, S as isPositional, cq as listActionInputFieldChoicesPlugin, co as listActionInputFieldsPlugin, cm as listActionsPlugin, ck as listAppsPlugin, cw as listClientCredentialsPlugin, cu as listConnectionsPlugin, ep as listTableFieldsPlugin, ex as listTableRecordsPlugin, eh as listTablesPlugin, aa as logDeprecation, cU as manifestPlugin, ec as parseConcurrencyEnvVar, r as readManifestFromFile, as as registryPlugin, cQ as requestPlugin, ab as resetDeprecationWarnings, du as resolveAuthToken, dQ as resolveCredentials, dP as resolveCredentialsFromEnv, cO as runActionPlugin, a4 as runWithTelemetryContext, dg as tableFieldIdsResolver, di as tableFieldsResolver, dl as tableFiltersResolver, db as tableIdResolver, dh as tableNameResolver, de as tableRecordIdResolver, df as tableRecordIdsResolver, dj as tableRecordsResolver, dm as tableSortResolver, dk as tableUpdateRecordsResolver, a5 as toSnakeCase, a6 as toTitleCase, dc as triggerInboxResolver, dd as triggerMessagesResolver, eD as updateTableRecordsPlugin } from './index-D2HKNk0N.mjs';
1
+ export { u as Action, d as ActionEntry, ci as ActionExecutionOptions, y as ActionExecutionResult, z as ActionField, H as ActionFieldChoice, aW as ActionItem, bx as ActionKeyProperty, b5 as ActionKeyPropertySchema, by as ActionProperty, b6 as ActionPropertySchema, as as ActionResolverItem, bJ as ActionTimeoutMsProperty, bh as ActionTimeoutMsPropertySchema, at as ActionTypeItem, bw as ActionTypeProperty, b4 as ActionTypePropertySchema, b as AddActionEntryOptions, c as AddActionEntryResult, A as ApiClient, bW as ApiError, dE as ApiEvent, d0 as ApiPluginOptions, d2 as ApiPluginProvides, v as App, cj as AppFactoryInput, aU as AppItem, bu as AppKeyProperty, b2 as AppKeyPropertySchema, bv as AppProperty, b3 as AppPropertySchema, aD as ApplicationLifecycleEventData, cb as ApprovalStatus, ch as AppsPluginProvides, bO as AppsProperty, bm as AppsPropertySchema, a0 as ArrayResolver, dD as AuthEvent, bC as AuthenticationIdProperty, b9 as AuthenticationIdPropertySchema, az as BaseEvent, al as BaseSdkOptionsSchema, aa as BatchOptions, cP as CONTEXT_CACHE_MAX_SIZE, cO as CONTEXT_CACHE_TTL_MS, x as Choice, dK as ClientCredentialsObject, dV as ClientCredentialsObjectSchema, K as Connection, e1 as ConnectionEntry, e0 as ConnectionEntrySchema, bA as ConnectionIdProperty, b8 as ConnectionIdPropertySchema, aV as ConnectionItem, bB as ConnectionProperty, ba as ConnectionPropertySchema, e3 as ConnectionsMap, e2 as ConnectionsMapSchema, e5 as ConnectionsPluginProvides, bQ as ConnectionsProperty, bo as ConnectionsPropertySchema, O as ConnectionsResponse, cB as CreateClientCredentialsPluginProvides, eu as CreateTableFieldsPluginProvides, eo as CreateTablePluginProvides, eC as CreateTableRecordsPluginProvides, dH as Credentials, d_ as CredentialsFunction, dZ as CredentialsFunctionSchema, dJ as CredentialsObject, dX as CredentialsObjectSchema, d$ as CredentialsSchema, ea as DEFAULT_ACTION_TIMEOUT_MS, eh as DEFAULT_APPROVAL_TIMEOUT_MS, cY as DEFAULT_CONFIG_PATH, ei as DEFAULT_MAX_APPROVAL_RETRIES, e9 as DEFAULT_PAGE_SIZE, bH as DebugProperty, bf as DebugPropertySchema, cD as DeleteClientCredentialsPluginProvides, ew as DeleteTableFieldsPluginProvides, eq as DeleteTablePluginProvides, eE as DeleteTableRecordsPluginProvides, o as DrainTriggerInboxCallback, p as DrainTriggerInboxErrorObserver, D as DrainTriggerInboxOptions, a3 as DynamicListResolver, i as DynamicResolver, a4 as DynamicSearchResolver, aE as EnhancedErrorEventData, bX as ErrorOptions, dG as EventCallback, aC as EventContext, E as EventEmissionContext, aB as EventEmissionProvides, cl as FetchPluginProvides, w as Field, bN as FieldsProperty, bl as FieldsPropertySchema, a5 as FieldsResolver, F as FieldsetItem, s as FindFirstAuthenticationPluginProvides, cL as FindFirstConnectionPluginProvides, t as FindUniqueAuthenticationPluginProvides, cN as FindUniqueConnectionPluginProvides, Y as FormatMetadata, X as FormattedItem, ak as FunctionDeprecation, a$ as FunctionOptions, aj as FunctionRegistryEntry, cv as GetActionInputFieldsSchemaPluginProvides, cH as GetActionPluginProvides, cF as GetAppPluginProvides, G as GetAuthenticationPluginProvides, cJ as GetConnectionPluginProvides, c$ as GetProfilePluginProvides, em as GetTablePluginProvides, ey as GetTableRecordPluginProvides, aY as InfoFieldItem, aX as InputFieldItem, bz as InputFieldProperty, b7 as InputFieldPropertySchema, bD as InputsProperty, bb as InputsPropertySchema, bV as LeaseLimitProperty, bt as LeaseLimitPropertySchema, bT as LeaseProperty, br as LeasePropertySchema, bU as LeaseSecondsProperty, bs as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bE as LimitProperty, bc as LimitPropertySchema, ct as ListActionInputFieldChoicesPluginProvides, cr as ListActionInputFieldsPluginProvides, cp as ListActionsPluginProvides, cn as ListAppsPluginProvides, q as ListAuthenticationsPluginProvides, cz as ListClientCredentialsPluginProvides, cx as ListConnectionsPluginProvides, es as ListTableFieldsPluginProvides, eA as ListTableRecordsPluginProvides, ek as ListTablesPluginProvides, dF as LoadingEvent, ed as MAX_CONCURRENCY_LIMIT, e8 as MAX_PAGE_LIMIT, M as Manifest, cZ as ManifestEntry, cU as ManifestPluginOptions, cX as ManifestPluginProvides, aA as MethodCalledEvent, aF as MethodCalledEventData, N as Need, I as NeedsRequest, J as NeedsResponse, bF as OffsetProperty, bd as OffsetPropertySchema, _ as OutputFormatter, bG as OutputProperty, be as OutputPropertySchema, b1 as PaginatedSdkFunction, e as PaginatedSdkResult, bI as ParamsProperty, bg as ParamsPropertySchema, dL as PkceCredentialsObject, dW as PkceCredentialsObjectSchema, am as Plugin, P as PluginMeta, an as PluginProvides, aw as PollOptions, g as PositionalMetadata, c9 as RateLimitInfo, bL as RecordProperty, bj as RecordPropertySchema, bM as RecordsProperty, bk as RecordsPropertySchema, af as RelayFetchSchema, ae as RelayRequestSchema, av as RequestOptions, cT as RequestPluginProvides, dq as ResolveAuthTokenOptions, dQ as ResolveCredentialsOptions, R as ResolvedAppLocator, dI as ResolvedCredentials, dY as ResolvedCredentialsSchema, $ as Resolver, a1 as ResolverMetadata, aZ as RootFieldItem, cR as RunActionPluginProvides, dC as SdkEvent, b0 as SdkPage, a2 as StaticResolver, bK as TableProperty, bi as TablePropertySchema, bP as TablesProperty, bn as TablesPropertySchema, bS as TriggerInboxNameProperty, bq as TriggerInboxNamePropertySchema, bR as TriggerInboxProperty, bp as TriggerInboxPropertySchema, T as TriggerMessageStatus, U as UpdateManifestEntryOptions, a as UpdateManifestEntryResult, eG as UpdateTableRecordsPluginProvides, Q as UserProfile, a_ as UserProfileItem, j as WatchTriggerInboxOptions, W as WithAddPlugin, e6 as ZAPIER_BASE_URL, ef as ZAPIER_MAX_CONCURRENT_REQUESTS, eb as ZAPIER_MAX_NETWORK_RETRIES, ec as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, m as ZapierAbortDrainSignal, c7 as ZapierActionError, bZ as ZapierApiError, b_ as ZapierAppNotFoundError, cc as ZapierApprovalError, c1 as ZapierAuthenticationError, c5 as ZapierBundleError, dy as ZapierCache, dz as ZapierCacheEntry, dA as ZapierCacheSetOptions, c4 as ZapierConfigurationError, c8 as ZapierConflictError, bY as ZapierError, h as ZapierFetchInitOptions, c2 as ZapierNotFoundError, ca as ZapierRateLimitError, cd as ZapierRelayError, n as ZapierReleaseTriggerMessageSignal, c3 as ZapierResourceNotFoundError, eI as ZapierSdk, l as ZapierSdkApps, Z as ZapierSdkOptions, cf as ZapierSignal, c6 as ZapierTimeoutError, c0 as ZapierUnknownError, b$ as ZapierValidationError, d5 as actionKeyResolver, d4 as actionTypeResolver, d1 as apiPlugin, d3 as appKeyResolver, cg as appsPlugin, d7 as authenticationIdGenericResolver, d6 as authenticationIdResolver, a9 as batch, aP as buildApplicationLifecycleEvent, ab as buildCapabilityMessage, aR as buildErrorEvent, aQ as buildErrorEventWithContext, aT as buildMethodCalledEvent, dr as clearTokenCache, db as clientCredentialsNameResolver, dc as clientIdResolver, ar as composePlugins, d7 as connectionIdGenericResolver, d6 as connectionIdResolver, e4 as connectionsPlugin, aS as createBaseEvent, cA as createClientCredentialsPlugin, V as createFunction, dB as createMemoryCache, ai as createOptionsPlugin, aq as createPaginatedPluginMethod, ap as createPluginMethod, ah as createSdk, et as createTableFieldsPlugin, en as createTablePlugin, eB as createTableRecordsPlugin, ax as createZapierApi, eH as createZapierSdk, ag as createZapierSdkWithoutRegistry, ao as definePlugin, cC as deleteClientCredentialsPlugin, ev as deleteTableFieldsPlugin, ep as deleteTablePlugin, eD as deleteTableRecordsPlugin, ck as fetchPlugin, cK as findFirstConnectionPlugin, f as findManifestEntry, cM as findUniqueConnectionPlugin, ce as formatErrorMessage, aG as generateEventId, cu as getActionInputFieldsSchemaPlugin, cG as getActionPlugin, cE as getAppPlugin, dT as getBaseUrlFromCredentials, aM as getCiPlatform, dU as getClientIdFromCredentials, cI as getConnectionPlugin, aO as getCpuTime, aH as getCurrentTimestamp, aN as getMemoryUsage, ay as getOrCreateApiClient, aJ as getOsInfo, aK as getPlatformVersions, cV as getPreferredManifestEntryKey, c_ as getProfilePlugin, aI as getReleaseId, el as getTablePlugin, ex as getTableRecordPlugin, dv as getTokenFromCliLogin, eg as getZapierApprovalMode, e7 as getZapierSdkService, dt as injectCliLogin, da as inputFieldKeyResolver, d9 as inputsAllOptionalResolver, d8 as inputsResolver, ds as invalidateCachedToken, dx as invalidateCredentialsToken, aL as isCi, du as isCliLoginAvailable, dM as isClientCredentials, dP as isCredentialsFunction, dO as isCredentialsObject, dN as isPkceCredentials, S as isPositional, cs as listActionInputFieldChoicesPlugin, cq as listActionInputFieldsPlugin, co as listActionsPlugin, cm as listAppsPlugin, cy as listClientCredentialsPlugin, cw as listConnectionsPlugin, er as listTableFieldsPlugin, ez as listTableRecordsPlugin, ej as listTablesPlugin, ac as logDeprecation, cW as manifestPlugin, ee as parseConcurrencyEnvVar, r as readManifestFromFile, au as registryPlugin, cS as requestPlugin, ad as resetDeprecationWarnings, dw as resolveAuthToken, dS as resolveCredentials, dR as resolveCredentialsFromEnv, cQ as runActionPlugin, a6 as runWithTelemetryContext, di as tableFieldIdsResolver, dk as tableFieldsResolver, dn as tableFiltersResolver, dd as tableIdResolver, dj as tableNameResolver, dg as tableRecordIdResolver, dh as tableRecordIdsResolver, dl as tableRecordsResolver, dp as tableSortResolver, dm as tableUpdateRecordsResolver, a7 as toSnakeCase, a8 as toTitleCase, de as triggerInboxResolver, df as triggerMessagesResolver, eF as updateTableRecordsPlugin } from './index-SDDmBk2j.mjs';
2
2
  import 'zod';
3
3
  import '@zapier/zapier-sdk-core/v0/schemas/connections';
4
4
  import '@zapier/policy-context';
5
5
  import 'zod/v4/core';
6
+ import '@zapier/zapier-sdk-core/v0/schemas/apps';
6
7
  import '@zapier/zapier-sdk-cli/login';
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ export * from "./plugins/api";
31
31
  export type { Action, App, Need, Field, Choice, ActionExecutionResult, ActionField, ActionFieldChoice, NeedsRequest, NeedsResponse, Connection, ConnectionsResponse, UserProfile, } from "./api/types";
32
32
  export { isPositional, PositionalMetadata } from "./utils/schema-utils";
33
33
  export { createFunction } from "./utils/function-utils";
34
- export type { FormattedItem, FormatMetadata, OutputFormatter, Resolver, ArrayResolver, ResolverMetadata, StaticResolver, DynamicResolver, FieldsResolver, } from "./utils/schema-utils";
34
+ export type { FormattedItem, FormatMetadata, OutputFormatter, Resolver, ArrayResolver, ResolverMetadata, StaticResolver, DynamicResolver, DynamicListResolver, DynamicSearchResolver, FieldsResolver, } from "./utils/schema-utils";
35
35
  export { runWithTelemetryContext } from "./utils/telemetry-context";
36
36
  export { toSnakeCase, toTitleCase } from "./utils/string-utils";
37
37
  export { batch } from "./utils/batch-utils";
@@ -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,iBAAiB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,cAAc,gBAAgB,CAAC;A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AAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAG9D,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,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.mjs CHANGED
@@ -1369,6 +1369,18 @@ var FetchInitSchema = z.object({
1369
1369
  aliases: { connectionId: "connection", authenticationId: "connection" }
1370
1370
  });
1371
1371
 
1372
+ // src/utils/string-utils.ts
1373
+ function toTitleCase(input) {
1374
+ return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
1375
+ }
1376
+ function toSnakeCase(input) {
1377
+ let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
1378
+ if (/^[0-9]/.test(result)) {
1379
+ result = "_" + result;
1380
+ }
1381
+ return result;
1382
+ }
1383
+
1372
1384
  // src/utils/domain-utils.ts
1373
1385
  function isConnectionId(value) {
1374
1386
  return /^\d+$/.test(value) || isUuid(value);
@@ -1515,6 +1527,12 @@ function toAppLocator(appKey) {
1515
1527
  function isResolvedAppLocator(appLocator) {
1516
1528
  return !!appLocator.implementationName;
1517
1529
  }
1530
+ function getAppKeyList(app) {
1531
+ const keys = new Set(
1532
+ [app.slug, toSnakeCase(app.slug), app.key].filter(Boolean)
1533
+ );
1534
+ return Array.from(keys);
1535
+ }
1518
1536
 
1519
1537
  // src/utils/abort-utils.ts
1520
1538
  function getAbortSignalApi() {
@@ -1820,34 +1838,12 @@ var ListAppsSchema = ListAppsQuerySchema.omit({
1820
1838
  // SDK specific property for pagination/iterable helpers
1821
1839
  cursor: z.string().optional().describe("Cursor to start from")
1822
1840
  }).describe("List all available apps with optional filtering");
1823
-
1824
- // src/utils/string-utils.ts
1825
- function toTitleCase(input) {
1826
- return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-]+/g, " ").replace(/\s+/g, " ").trim().split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
1827
- }
1828
- function toSnakeCase(input) {
1829
- let result = input.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s\-]+/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").toLowerCase();
1830
- if (/^[0-9]/.test(result)) {
1831
- result = "_" + result;
1832
- }
1833
- return result;
1834
- }
1835
-
1836
- // src/schemas/App.ts
1837
1841
  var AppItemSchema = withFormatter(AppItemSchema$1, {
1838
1842
  format: (item) => {
1839
- const additionalKeys = [];
1840
- if (item.slug && item.slug !== item.key) {
1841
- additionalKeys.push(item.slug);
1842
- const snakeCaseSlug = toSnakeCase(item.slug);
1843
- if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
1844
- additionalKeys.push(snakeCaseSlug);
1845
- }
1846
- }
1847
1843
  return {
1848
1844
  title: item.title,
1849
1845
  key: item.key,
1850
- keys: [item.key, ...additionalKeys],
1846
+ keys: getAppKeyList(item),
1851
1847
  description: item.description,
1852
1848
  details: []
1853
1849
  };
@@ -2273,9 +2269,37 @@ var ActionItemSchema = withFormatter(
2273
2269
 
2274
2270
  // src/resolvers/appKey.ts
2275
2271
  var appKeyResolver = {
2276
- type: "static",
2277
- inputType: "text",
2278
- placeholder: "Enter app key (e.g., 'SlackCLIAPI' or slug like 'github')"
2272
+ type: "dynamic",
2273
+ inputType: "search",
2274
+ placeholder: "e.g., 'slack' or 'SlackCLIAPI' or 'mail'",
2275
+ // Try the user's typed string as an exact app locator first; getApp accepts
2276
+ // a slug, key, or implementation id. If that hits, short-circuit with the
2277
+ // input — every variant the user could have typed is already a valid value
2278
+ // anywhere else app is required, so no canonicalization needed here. If
2279
+ // getApp 404s, fall back to a search; any other error (auth, network,
2280
+ // rate-limit) propagates so the user sees the real problem.
2281
+ fetch: async (sdk, { search }) => {
2282
+ if (!search) return [];
2283
+ try {
2284
+ await sdk.getApp({ app: search });
2285
+ return search;
2286
+ } catch (err) {
2287
+ if (!(err instanceof ZapierAppNotFoundError) && !(err instanceof ZapierNotFoundError)) {
2288
+ throw err;
2289
+ }
2290
+ }
2291
+ const page = await sdk.listApps({ search });
2292
+ return page.data;
2293
+ },
2294
+ prompt: (apps) => ({
2295
+ type: "list",
2296
+ name: "app",
2297
+ message: "Select app:",
2298
+ choices: apps.map((app) => ({
2299
+ name: app.title ? `${app.title} (${getAppKeyList(app).join(", ")})` : app.key,
2300
+ value: app.key
2301
+ }))
2302
+ })
2279
2303
  };
2280
2304
 
2281
2305
  // src/resolvers/actionType.ts
@@ -6283,7 +6307,7 @@ async function invalidateCredentialsToken(options) {
6283
6307
  }
6284
6308
 
6285
6309
  // src/sdk-version.ts
6286
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.53.0" : void 0) || "unknown";
6310
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.54.1" : void 0) || "unknown";
6287
6311
 
6288
6312
  // src/utils/open-url.ts
6289
6313
  var nodePrefix = "node:";
@@ -31,6 +31,7 @@ export declare const createTriggerInboxPlugin: (sdk: {
31
31
  createTriggerInbox: (options?: {
32
32
  app: string;
33
33
  action: string;
34
+ name?: string | undefined;
34
35
  connection?: string | number | null | undefined;
35
36
  inputs?: Record<string, unknown> | undefined;
36
37
  notificationUrl?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/createTriggerInbox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,WAAW,CAAC;AAU7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAInE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;aAIpB;QACP,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2E/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/createTriggerInbox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,WAAW,CAAC;AAa7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAKnE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;aAIpB;QACP,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+F/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
2
2
  import { CreateTriggerInboxSchema, TriggerInboxItemSchema } from "./schemas";
3
- import { ZapierConfigurationError } from "../../../types/errors";
3
+ import { ZapierConfigurationError, ZapierConflictError, } from "../../../types/errors";
4
4
  import { appKeyResolver, actionKeyResolver, connectionIdResolver, inputsResolver, } from "../../../resolvers";
5
5
  import { resolveConnectionId } from "../../../utils/domain-utils";
6
6
  import { triggersDefaults } from "../shared";
7
+ import { extractErrorDetail } from "../utils";
7
8
  export const createTriggerInboxPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
8
9
  ...triggersDefaults,
9
10
  name: "createTriggerInbox",
@@ -16,6 +17,7 @@ export const createTriggerInboxPlugin = definePlugin((sdk) => createPluginMethod
16
17
  // seeded into resolvedParams without polluting the user-facing schema
17
18
  // (where it would leak into the SDK method signature and CLI flags).
18
19
  resolvers: {
20
+ name: { type: "static", inputType: "text" },
19
21
  app: appKeyResolver,
20
22
  action: actionKeyResolver,
21
23
  connection: connectionIdResolver,
@@ -24,7 +26,7 @@ export const createTriggerInboxPlugin = definePlugin((sdk) => createPluginMethod
24
26
  },
25
27
  handler: async ({ sdk, options }) => {
26
28
  const { api } = sdk.context;
27
- const { app: appKey, action: actionKey, connection, inputs = {}, notificationUrl, } = options;
29
+ const { name, app: appKey, action: actionKey, connection, inputs = {}, notificationUrl, } = options;
28
30
  const resolvedConnectionId = await resolveConnectionId({
29
31
  connection,
30
32
  resolveConnection: sdk.context.resolveConnection,
@@ -41,10 +43,23 @@ export const createTriggerInboxPlugin = definePlugin((sdk) => createPluginMethod
41
43
  connection_id: resolvedConnectionId ?? null,
42
44
  },
43
45
  };
46
+ if (name !== undefined) {
47
+ requestBody.name = name;
48
+ }
44
49
  if (notificationUrl !== undefined) {
45
50
  requestBody.notification_url = notificationUrl;
46
51
  }
47
- const rawResponse = await api.post("/trigger-inbox/api/v1/inboxes", requestBody, { authRequired: true });
52
+ const rawResponse = await api.post("/trigger-inbox/api/v1/inboxes", requestBody, {
53
+ authRequired: true,
54
+ customErrorHandler: ({ status, data }) => {
55
+ if (status === 409) {
56
+ const detail = extractErrorDetail(data);
57
+ return new ZapierConflictError(detail ??
58
+ `An inbox named "${name}" already exists with a different subscription.`, { statusCode: status, resourceType: "trigger_inbox" });
59
+ }
60
+ return undefined;
61
+ },
62
+ });
48
63
  return { data: TriggerInboxItemSchema.parse(rawResponse) };
49
64
  },
50
65
  }));
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  import type { FunctionOptions } from "../../../types/functions";
3
3
  import { TriggerInboxItemSchema, type TriggerInboxItem } from "../../../schemas/TriggerInbox";
4
4
  export declare const CreateTriggerInboxSchema: z.ZodObject<{
5
+ name: z.ZodOptional<z.ZodString>;
5
6
  app: z.ZodString & {
6
7
  _def: z.core.$ZodStringDef & import("../../..").PositionalMetadata;
7
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/createTriggerInbox/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAOhE,OAAO,EACL,sBAAsB,EACtB,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAKvC,eAAO,MAAM,wBAAwB;;;;;;;;;;iBAkBK,CAAC;AAE3C,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,wBAAwB,CAChC,GACC,eAAe,CAAC;AAElB,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/createTriggerInbox/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAQhE,OAAO,EACL,sBAAsB,EACtB,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAKvC,eAAO,MAAM,wBAAwB;;;;;;;;;;;iBAqBK,CAAC;AAE3C,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,wBAAwB,CAChC,GACC,eAAe,CAAC;AAElB,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { z } from "zod";
2
- import { AppPropertySchema, ActionPropertySchema, ConnectionPropertySchema, InputsPropertySchema, } from "../../../types/properties";
2
+ import { AppPropertySchema, ActionPropertySchema, ConnectionPropertySchema, InputsPropertySchema, TriggerInboxNamePropertySchema, } from "../../../types/properties";
3
3
  import { TriggerInboxItemSchema, } from "../../../schemas/TriggerInbox";
4
- const CreateTriggerInboxDescription = "Create a new trigger inbox subscription with an auto-generated name. Always creates; use ensureTriggerInbox for get-or-create on a stable name.";
4
+ const CreateTriggerInboxDescription = "Create a new trigger inbox subscription. Always creates a new inbox; use ensureTriggerInbox for get-or-create on a stable name.";
5
5
  export const CreateTriggerInboxSchema = z
6
6
  .object({
7
+ name: TriggerInboxNamePropertySchema.optional().describe("Optional inbox name. Auto-generated when omitted. Throws a conflict error if the name is already in use by another subscription."),
7
8
  app: AppPropertySchema,
8
9
  action: ActionPropertySchema,
9
10
  connection: ConnectionPropertySchema.nullable()
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/ensureTriggerInbox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,WAAW,CAAC;AAa7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAcnE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;aAIpB;QACP,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/triggers/ensureTriggerInbox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAA0B,MAAM,WAAW,CAAC;AAa7E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAKnE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;aAIpB;QACP,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2F/C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,UAAU,CACvD,OAAO,wBAAwB,CAChC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -4,18 +4,7 @@ import { ZapierConfigurationError, ZapierConflictError, } from "../../../types/e
4
4
  import { appKeyResolver, actionKeyResolver, connectionIdResolver, inputsResolver, } from "../../../resolvers";
5
5
  import { resolveConnectionId } from "../../../utils/domain-utils";
6
6
  import { triggersDefaults } from "../shared";
7
- function extractErrorDetail(data) {
8
- if (typeof data !== "object" || data === null)
9
- return undefined;
10
- const errors = data.errors;
11
- if (!Array.isArray(errors) || errors.length === 0)
12
- return undefined;
13
- const first = errors[0];
14
- if (typeof first !== "object" || first === null)
15
- return undefined;
16
- const detail = first.detail;
17
- return typeof detail === "string" ? detail : undefined;
18
- }
7
+ import { extractErrorDetail } from "../utils";
19
8
  export const ensureTriggerInboxPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
20
9
  ...triggersDefaults,
21
10
  name: "ensureTriggerInbox",
@@ -14,4 +14,10 @@ export declare function resolveTriggerInboxId({ api, inbox, }: {
14
14
  api: ApiClient;
15
15
  inbox: string;
16
16
  }): Promise<string>;
17
+ /**
18
+ * Pulls `errors[0].detail` off a JSON:API-style error response body.
19
+ * Returns `undefined` for any shape that doesn't match, so callers can
20
+ * fall back to a default message.
21
+ */
22
+ export declare function extractErrorDetail(data: unknown): string | undefined;
17
23
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/triggers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAM3C;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,GAAG,EACH,KAAK,GACN,EAAE;IACD,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/triggers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAM3C;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,GAAG,EACH,KAAK,GACN,EAAE;IACD,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQpE"}
@@ -26,3 +26,20 @@ export async function resolveTriggerInboxId({ api, inbox, }) {
26
26
  }
27
27
  return id;
28
28
  }
29
+ /**
30
+ * Pulls `errors[0].detail` off a JSON:API-style error response body.
31
+ * Returns `undefined` for any shape that doesn't match, so callers can
32
+ * fall back to a default message.
33
+ */
34
+ export function extractErrorDetail(data) {
35
+ if (typeof data !== "object" || data === null)
36
+ return undefined;
37
+ const errors = data.errors;
38
+ if (!Array.isArray(errors) || errors.length === 0)
39
+ return undefined;
40
+ const first = errors[0];
41
+ if (typeof first !== "object" || first === null)
42
+ return undefined;
43
+ const detail = first.detail;
44
+ return typeof detail === "string" ? detail : undefined;
45
+ }
@@ -1,3 +1,8 @@
1
- import type { StaticResolver } from "../utils/schema-utils";
2
- export declare const appKeyResolver: StaticResolver;
1
+ import type { DynamicResolver } from "../utils/schema-utils";
2
+ import type { AppItem } from "../plugins/listApps/schemas";
3
+ type AppKeyResolver = DynamicResolver<AppItem, {
4
+ search?: string;
5
+ }>;
6
+ export declare const appKeyResolver: AppKeyResolver;
7
+ export {};
3
8
  //# sourceMappingURL=appKey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/appKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,eAAO,MAAM,cAAc,EAAE,cAI5B,CAAC"}
1
+ {"version":3,"file":"appKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/appKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAI3D,KAAK,cAAc,GAAG,eAAe,CAAC,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEpE,eAAO,MAAM,cAAc,EAAE,cA6C5B,CAAC"}
@@ -1,5 +1,48 @@
1
+ import { ZapierAppNotFoundError, ZapierNotFoundError } from "../types/errors";
2
+ import { getAppKeyList } from "../utils/domain-utils";
1
3
  export const appKeyResolver = {
2
- type: "static",
3
- inputType: "text",
4
- placeholder: "Enter app key (e.g., 'SlackCLIAPI' or slug like 'github')",
4
+ type: "dynamic",
5
+ inputType: "search",
6
+ placeholder: "e.g., 'slack' or 'SlackCLIAPI' or 'mail'",
7
+ // Try the user's typed string as an exact app locator first; getApp accepts
8
+ // a slug, key, or implementation id. If that hits, short-circuit with the
9
+ // input — every variant the user could have typed is already a valid value
10
+ // anywhere else app is required, so no canonicalization needed here. If
11
+ // getApp 404s, fall back to a search; any other error (auth, network,
12
+ // rate-limit) propagates so the user sees the real problem.
13
+ fetch: async (sdk, { search }) => {
14
+ if (!search)
15
+ return [];
16
+ try {
17
+ await sdk.getApp({ app: search });
18
+ return search;
19
+ }
20
+ catch (err) {
21
+ // ZapierAppNotFoundError and ZapierNotFoundError are independent
22
+ // siblings under ZapierError, not parent/child — so neither
23
+ // instanceof check subsumes the other. getApp throws the
24
+ // app-specific class today; the generic one stays here for 404s
25
+ // that arrive through other layers (e.g. an intermediate plugin
26
+ // wrapping the error, or a future endpoint refactor that drops
27
+ // the app-specific class). Any other class (auth, network, rate
28
+ // limit) propagates so the user sees the real problem.
29
+ if (!(err instanceof ZapierAppNotFoundError) &&
30
+ !(err instanceof ZapierNotFoundError)) {
31
+ throw err;
32
+ }
33
+ }
34
+ const page = await sdk.listApps({ search });
35
+ return page.data;
36
+ },
37
+ prompt: (apps) => ({
38
+ type: "list",
39
+ name: "app",
40
+ message: "Select app:",
41
+ choices: apps.map((app) => ({
42
+ name: app.title
43
+ ? `${app.title} (${getAppKeyList(app).join(", ")})`
44
+ : app.key,
45
+ value: app.key,
46
+ })),
47
+ }),
5
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/schemas/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMtE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBxB,CAAC;AAMH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/schemas/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMtE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUxB,CAAC;AAMH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1,24 +1,15 @@
1
1
  import { withFormatter } from "../utils/schema-utils";
2
2
  import { AppItemSchema as AppItemSchemaBase } from "@zapier/zapier-sdk-core/v0/schemas/apps";
3
- import { toSnakeCase } from "../utils/string-utils";
3
+ import { getAppKeyList } from "../utils/domain-utils";
4
4
  // ============================================================================
5
5
  // App Item Schema (wraps core schema with SDK-specific formatting)
6
6
  // ============================================================================
7
7
  export const AppItemSchema = withFormatter(AppItemSchemaBase, {
8
8
  format: (item) => {
9
- // Create additional keys if slug exists
10
- const additionalKeys = [];
11
- if (item.slug && item.slug !== item.key) {
12
- additionalKeys.push(item.slug);
13
- const snakeCaseSlug = toSnakeCase(item.slug);
14
- if (snakeCaseSlug !== item.slug && snakeCaseSlug !== item.key) {
15
- additionalKeys.push(snakeCaseSlug);
16
- }
17
- }
18
9
  return {
19
10
  title: item.title,
20
11
  key: item.key,
21
- keys: [item.key, ...additionalKeys],
12
+ keys: getAppKeyList(item),
22
13
  description: item.description,
23
14
  details: [],
24
15
  };
@@ -89,4 +89,8 @@ export declare function isUuid(appKey: string): boolean;
89
89
  export declare function toAppLocator(appKey: string): AppLocator;
90
90
  export declare function isResolvedAppLocator(appLocator: AppLocator): appLocator is ResolvedAppLocator;
91
91
  export declare function toImplementationId(appLocator: ResolvedAppLocator): string;
92
+ export declare function getAppKeyList(app: {
93
+ key: string;
94
+ slug: string;
95
+ }): string[];
92
96
  //# sourceMappingURL=domain-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"domain-utils.d.ts","sourceRoot":"","sources":["../../src/utils/domain-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAM3E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,GACN,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IAC1E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