@zapier/zapier-sdk 0.48.0 → 0.49.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 (213) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1519 -314
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +10 -1
  5. package/dist/api/polling.d.ts +7 -0
  6. package/dist/api/polling.d.ts.map +1 -1
  7. package/dist/api/polling.js +29 -4
  8. package/dist/api/types.d.ts +7 -0
  9. package/dist/api/types.d.ts.map +1 -1
  10. package/dist/experimental.cjs +10389 -0
  11. package/dist/experimental.d.mts +2292 -0
  12. package/dist/experimental.d.ts +2308 -0
  13. package/dist/experimental.d.ts.map +1 -0
  14. package/dist/experimental.js +155 -0
  15. package/dist/experimental.mjs +10207 -0
  16. package/dist/index-C2vsvjgN.d.mts +9539 -0
  17. package/dist/index-C2vsvjgN.d.ts +9539 -0
  18. package/dist/index.cjs +817 -603
  19. package/dist/index.d.mts +6 -8562
  20. package/dist/index.d.ts +7 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +5 -1
  23. package/dist/index.mjs +805 -603
  24. package/dist/plugins/apps/index.d.ts +1 -1
  25. package/dist/plugins/deprecated/inputFields.d.ts +468 -0
  26. package/dist/plugins/deprecated/inputFields.d.ts.map +1 -0
  27. package/dist/plugins/deprecated/inputFields.js +73 -0
  28. package/dist/plugins/fetch/index.d.ts +1 -1
  29. package/dist/plugins/fetch/schemas.d.ts +1 -1
  30. package/dist/plugins/{getInputFieldsSchema → getActionInputFieldsSchema}/index.d.ts +4 -4
  31. package/dist/plugins/getActionInputFieldsSchema/index.d.ts.map +1 -0
  32. package/dist/plugins/{getInputFieldsSchema → getActionInputFieldsSchema}/index.js +4 -4
  33. package/dist/plugins/{getInputFieldsSchema → getActionInputFieldsSchema}/schemas.d.ts +8 -8
  34. package/dist/plugins/getActionInputFieldsSchema/schemas.d.ts.map +1 -0
  35. package/dist/plugins/{getInputFieldsSchema → getActionInputFieldsSchema}/schemas.js +13 -10
  36. package/dist/plugins/{listInputFieldChoices → listActionInputFieldChoices}/index.d.ts +4 -4
  37. package/dist/plugins/listActionInputFieldChoices/index.d.ts.map +1 -0
  38. package/dist/plugins/{listInputFieldChoices → listActionInputFieldChoices}/index.js +4 -4
  39. package/dist/plugins/{listInputFieldChoices → listActionInputFieldChoices}/schemas.d.ts +10 -10
  40. package/dist/plugins/listActionInputFieldChoices/schemas.d.ts.map +1 -0
  41. package/dist/plugins/{listInputFieldChoices → listActionInputFieldChoices}/schemas.js +13 -10
  42. package/dist/plugins/{listInputFields → listActionInputFields}/index.d.ts +4 -4
  43. package/dist/plugins/listActionInputFields/index.d.ts.map +1 -0
  44. package/dist/plugins/{listInputFields → listActionInputFields}/index.js +5 -5
  45. package/dist/plugins/{listInputFields → listActionInputFields}/schemas.d.ts +9 -9
  46. package/dist/plugins/listActionInputFields/schemas.d.ts.map +1 -0
  47. package/dist/plugins/{listInputFields → listActionInputFields}/schemas.js +7 -7
  48. package/dist/plugins/request/index.d.ts +2 -2
  49. package/dist/plugins/request/schemas.d.ts +2 -2
  50. package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
  51. package/dist/plugins/tables/createTableFields/index.js +1 -0
  52. package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
  53. package/dist/plugins/tables/createTableRecords/index.js +1 -0
  54. package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
  55. package/dist/plugins/tables/updateTableRecords/index.js +1 -0
  56. package/dist/plugins/triggers/ackTriggerInboxMessages/index.d.ts +51 -0
  57. package/dist/plugins/triggers/ackTriggerInboxMessages/index.d.ts.map +1 -0
  58. package/dist/plugins/triggers/ackTriggerInboxMessages/index.js +35 -0
  59. package/dist/plugins/triggers/ackTriggerInboxMessages/schemas.d.ts +34 -0
  60. package/dist/plugins/triggers/ackTriggerInboxMessages/schemas.d.ts.map +1 -0
  61. package/dist/plugins/triggers/ackTriggerInboxMessages/schemas.js +17 -0
  62. package/dist/plugins/triggers/createTriggerInbox/index.d.ts +62 -0
  63. package/dist/plugins/triggers/createTriggerInbox/index.d.ts.map +1 -0
  64. package/dist/plugins/triggers/createTriggerInbox/index.js +54 -0
  65. package/dist/plugins/triggers/createTriggerInbox/schemas.d.ts +20 -0
  66. package/dist/plugins/triggers/createTriggerInbox/schemas.d.ts.map +1 -0
  67. package/dist/plugins/triggers/createTriggerInbox/schemas.js +20 -0
  68. package/dist/plugins/triggers/deleteTriggerInbox/index.d.ts +50 -0
  69. package/dist/plugins/triggers/deleteTriggerInbox/index.d.ts.map +1 -0
  70. package/dist/plugins/triggers/deleteTriggerInbox/index.js +27 -0
  71. package/dist/plugins/triggers/deleteTriggerInbox/schemas.d.ts +14 -0
  72. package/dist/plugins/triggers/deleteTriggerInbox/schemas.d.ts.map +1 -0
  73. package/dist/plugins/triggers/deleteTriggerInbox/schemas.js +9 -0
  74. package/dist/plugins/triggers/drainTriggerInbox/index.d.ts +213 -0
  75. package/dist/plugins/triggers/drainTriggerInbox/index.d.ts.map +1 -0
  76. package/dist/plugins/triggers/drainTriggerInbox/index.js +227 -0
  77. package/dist/plugins/triggers/drainTriggerInbox/pipeline.d.ts +56 -0
  78. package/dist/plugins/triggers/drainTriggerInbox/pipeline.d.ts.map +1 -0
  79. package/dist/plugins/triggers/drainTriggerInbox/pipeline.js +225 -0
  80. package/dist/plugins/triggers/drainTriggerInbox/schemas.d.ts +104 -0
  81. package/dist/plugins/triggers/drainTriggerInbox/schemas.d.ts.map +1 -0
  82. package/dist/plugins/triggers/drainTriggerInbox/schemas.js +102 -0
  83. package/dist/plugins/triggers/ensureTriggerInbox/index.d.ts +63 -0
  84. package/dist/plugins/triggers/ensureTriggerInbox/index.d.ts.map +1 -0
  85. package/dist/plugins/triggers/ensureTriggerInbox/index.js +77 -0
  86. package/dist/plugins/triggers/ensureTriggerInbox/schemas.d.ts +21 -0
  87. package/dist/plugins/triggers/ensureTriggerInbox/schemas.d.ts.map +1 -0
  88. package/dist/plugins/triggers/ensureTriggerInbox/schemas.js +21 -0
  89. package/dist/plugins/triggers/getTriggerInbox/index.d.ts +50 -0
  90. package/dist/plugins/triggers/getTriggerInbox/index.d.ts.map +1 -0
  91. package/dist/plugins/triggers/getTriggerInbox/index.js +26 -0
  92. package/dist/plugins/triggers/getTriggerInbox/schemas.d.ts +14 -0
  93. package/dist/plugins/triggers/getTriggerInbox/schemas.d.ts.map +1 -0
  94. package/dist/plugins/triggers/getTriggerInbox/schemas.js +9 -0
  95. package/dist/plugins/triggers/getTriggerInputFieldsSchema/index.d.ts +48 -0
  96. package/dist/plugins/triggers/getTriggerInputFieldsSchema/index.d.ts.map +1 -0
  97. package/dist/plugins/triggers/getTriggerInputFieldsSchema/index.js +23 -0
  98. package/dist/plugins/triggers/getTriggerInputFieldsSchema/schemas.d.ts +13 -0
  99. package/dist/plugins/triggers/getTriggerInputFieldsSchema/schemas.d.ts.map +1 -0
  100. package/dist/plugins/triggers/getTriggerInputFieldsSchema/schemas.js +10 -0
  101. package/dist/plugins/triggers/leaseTriggerInboxMessages/index.d.ts +58 -0
  102. package/dist/plugins/triggers/leaseTriggerInboxMessages/index.d.ts.map +1 -0
  103. package/dist/plugins/triggers/leaseTriggerInboxMessages/index.js +70 -0
  104. package/dist/plugins/triggers/leaseTriggerInboxMessages/schemas.d.ts +57 -0
  105. package/dist/plugins/triggers/leaseTriggerInboxMessages/schemas.d.ts.map +1 -0
  106. package/dist/plugins/triggers/leaseTriggerInboxMessages/schemas.js +25 -0
  107. package/dist/plugins/triggers/listTriggerInboxMessages/index.d.ts +51 -0
  108. package/dist/plugins/triggers/listTriggerInboxMessages/index.d.ts.map +1 -0
  109. package/dist/plugins/triggers/listTriggerInboxMessages/index.js +48 -0
  110. package/dist/plugins/triggers/listTriggerInboxMessages/schemas.d.ts +37 -0
  111. package/dist/plugins/triggers/listTriggerInboxMessages/schemas.d.ts.map +1 -0
  112. package/dist/plugins/triggers/listTriggerInboxMessages/schemas.js +27 -0
  113. package/dist/plugins/triggers/listTriggerInboxes/index.d.ts +56 -0
  114. package/dist/plugins/triggers/listTriggerInboxes/index.d.ts.map +1 -0
  115. package/dist/plugins/triggers/listTriggerInboxes/index.js +51 -0
  116. package/dist/plugins/triggers/listTriggerInboxes/schemas.d.ts +58 -0
  117. package/dist/plugins/triggers/listTriggerInboxes/schemas.d.ts.map +1 -0
  118. package/dist/plugins/triggers/listTriggerInboxes/schemas.js +35 -0
  119. package/dist/plugins/triggers/listTriggerInputFieldChoices/index.d.ts +77 -0
  120. package/dist/plugins/triggers/listTriggerInputFieldChoices/index.d.ts.map +1 -0
  121. package/dist/plugins/triggers/listTriggerInputFieldChoices/index.js +30 -0
  122. package/dist/plugins/triggers/listTriggerInputFieldChoices/schemas.d.ts +20 -0
  123. package/dist/plugins/triggers/listTriggerInputFieldChoices/schemas.d.ts.map +1 -0
  124. package/dist/plugins/triggers/listTriggerInputFieldChoices/schemas.js +28 -0
  125. package/dist/plugins/triggers/listTriggerInputFields/index.d.ts +101 -0
  126. package/dist/plugins/triggers/listTriggerInputFields/index.d.ts.map +1 -0
  127. package/dist/plugins/triggers/listTriggerInputFields/index.js +33 -0
  128. package/dist/plugins/triggers/listTriggerInputFields/schemas.d.ts +16 -0
  129. package/dist/plugins/triggers/listTriggerInputFields/schemas.d.ts.map +1 -0
  130. package/dist/plugins/triggers/listTriggerInputFields/schemas.js +21 -0
  131. package/dist/plugins/triggers/pauseTriggerInbox/index.d.ts +50 -0
  132. package/dist/plugins/triggers/pauseTriggerInbox/index.d.ts.map +1 -0
  133. package/dist/plugins/triggers/pauseTriggerInbox/index.js +26 -0
  134. package/dist/plugins/triggers/pauseTriggerInbox/schemas.d.ts +14 -0
  135. package/dist/plugins/triggers/pauseTriggerInbox/schemas.d.ts.map +1 -0
  136. package/dist/plugins/triggers/pauseTriggerInbox/schemas.js +9 -0
  137. package/dist/plugins/triggers/releaseTriggerInboxMessages/index.d.ts +51 -0
  138. package/dist/plugins/triggers/releaseTriggerInboxMessages/index.d.ts.map +1 -0
  139. package/dist/plugins/triggers/releaseTriggerInboxMessages/index.js +37 -0
  140. package/dist/plugins/triggers/releaseTriggerInboxMessages/schemas.d.ts +34 -0
  141. package/dist/plugins/triggers/releaseTriggerInboxMessages/schemas.d.ts.map +1 -0
  142. package/dist/plugins/triggers/releaseTriggerInboxMessages/schemas.js +17 -0
  143. package/dist/plugins/triggers/resumeTriggerInbox/index.d.ts +50 -0
  144. package/dist/plugins/triggers/resumeTriggerInbox/index.d.ts.map +1 -0
  145. package/dist/plugins/triggers/resumeTriggerInbox/index.js +26 -0
  146. package/dist/plugins/triggers/resumeTriggerInbox/schemas.d.ts +14 -0
  147. package/dist/plugins/triggers/resumeTriggerInbox/schemas.d.ts.map +1 -0
  148. package/dist/plugins/triggers/resumeTriggerInbox/schemas.js +9 -0
  149. package/dist/plugins/triggers/shared.d.ts +17 -0
  150. package/dist/plugins/triggers/shared.d.ts.map +1 -0
  151. package/dist/plugins/triggers/shared.js +16 -0
  152. package/dist/plugins/triggers/updateTriggerInbox/index.d.ts +51 -0
  153. package/dist/plugins/triggers/updateTriggerInbox/index.d.ts.map +1 -0
  154. package/dist/plugins/triggers/updateTriggerInbox/index.js +30 -0
  155. package/dist/plugins/triggers/updateTriggerInbox/schemas.d.ts +15 -0
  156. package/dist/plugins/triggers/updateTriggerInbox/schemas.d.ts.map +1 -0
  157. package/dist/plugins/triggers/updateTriggerInbox/schemas.js +15 -0
  158. package/dist/plugins/triggers/utils.d.ts +17 -0
  159. package/dist/plugins/triggers/utils.d.ts.map +1 -0
  160. package/dist/plugins/triggers/utils.js +28 -0
  161. package/dist/plugins/triggers/watchTriggerInbox/index.d.ts +163 -0
  162. package/dist/plugins/triggers/watchTriggerInbox/index.d.ts.map +1 -0
  163. package/dist/plugins/triggers/watchTriggerInbox/index.js +111 -0
  164. package/dist/registry.d.ts.map +1 -1
  165. package/dist/registry.js +2 -0
  166. package/dist/resolvers/actionKey.d.ts +1 -0
  167. package/dist/resolvers/actionKey.d.ts.map +1 -1
  168. package/dist/resolvers/actionKey.js +1 -1
  169. package/dist/resolvers/index.d.ts +2 -2
  170. package/dist/resolvers/index.d.ts.map +1 -1
  171. package/dist/resolvers/index.js +2 -2
  172. package/dist/resolvers/triggerInbox.d.ts +4 -0
  173. package/dist/resolvers/triggerInbox.d.ts.map +1 -0
  174. package/dist/resolvers/triggerInbox.js +18 -0
  175. package/dist/schemas/TriggerInbox.d.ts +59 -0
  176. package/dist/schemas/TriggerInbox.d.ts.map +1 -0
  177. package/dist/schemas/TriggerInbox.js +81 -0
  178. package/dist/schemas/TriggerMessage.d.ts +48 -0
  179. package/dist/schemas/TriggerMessage.d.ts.map +1 -0
  180. package/dist/schemas/TriggerMessage.js +79 -0
  181. package/dist/sdk.d.ts +621 -17
  182. package/dist/sdk.d.ts.map +1 -1
  183. package/dist/sdk.js +26 -9
  184. package/dist/types/errors.d.ts +13 -0
  185. package/dist/types/errors.d.ts.map +1 -1
  186. package/dist/types/errors.js +16 -0
  187. package/dist/types/plugin.d.ts +12 -1
  188. package/dist/types/plugin.d.ts.map +1 -1
  189. package/dist/types/properties.d.ts +12 -0
  190. package/dist/types/properties.d.ts.map +1 -1
  191. package/dist/types/properties.js +25 -0
  192. package/dist/types/registry.d.ts +5 -0
  193. package/dist/types/registry.d.ts.map +1 -1
  194. package/dist/types/sdk.d.ts +2 -2
  195. package/dist/types/sdk.d.ts.map +1 -1
  196. package/dist/types/signals.d.ts +20 -0
  197. package/dist/types/signals.d.ts.map +1 -0
  198. package/dist/types/signals.js +21 -0
  199. package/dist/utils/abort-utils.d.ts +13 -0
  200. package/dist/utils/abort-utils.d.ts.map +1 -1
  201. package/dist/utils/abort-utils.js +15 -0
  202. package/dist/utils/retry-utils.d.ts +6 -2
  203. package/dist/utils/retry-utils.d.ts.map +1 -1
  204. package/dist/utils/retry-utils.js +22 -3
  205. package/dist/utils/schema-utils.d.ts +19 -1
  206. package/dist/utils/schema-utils.d.ts.map +1 -1
  207. package/package.json +12 -1
  208. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +0 -1
  209. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +0 -1
  210. package/dist/plugins/listInputFieldChoices/index.d.ts.map +0 -1
  211. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +0 -1
  212. package/dist/plugins/listInputFields/index.d.ts.map +0 -1
  213. package/dist/plugins/listInputFields/schemas.d.ts.map +0 -1
package/dist/index.mjs CHANGED
@@ -127,6 +127,19 @@ var FieldsPropertySchema = z.array(z.union([z.string(), z.number()])).describe(
127
127
  var AppsPropertySchema = z.array(z.string()).describe("Filter by app keys (e.g., 'SlackCLIAPI' or slug like 'github')");
128
128
  var TablesPropertySchema = z.array(z.string()).describe("Filter by specific table IDs");
129
129
  var ConnectionsPropertySchema = z.array(z.string()).describe("List of connection IDs to filter by");
130
+ var TriggerInboxPropertySchema = withPositional(
131
+ z.string().min(1).describe(
132
+ "Trigger inbox identifier \u2014 UUID or name. Non-UUID values are resolved by name via the inbox list endpoint."
133
+ )
134
+ );
135
+ var TriggerInboxNamePropertySchema = z.string().min(1).max(100).describe(
136
+ "Inbox name; unique per (user, account). Enables get-or-create on createTriggerInbox."
137
+ );
138
+ var LeasePropertySchema = z.string().min(1).describe("Lease ID returned from leaseTriggerInboxMessages");
139
+ var LeaseSecondsPropertySchema = z.number().int().min(1).max(3600).describe(
140
+ "Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes)."
141
+ );
142
+ var LeaseLimitPropertySchema = z.number().int().min(1).max(100).describe("Maximum messages to lease in a single batch (1-100)");
130
143
 
131
144
  // src/types/errors.ts
132
145
  var ZapierError = class extends Error {
@@ -230,6 +243,14 @@ var ZapierActionError = class extends ZapierError {
230
243
  return this.errors;
231
244
  }
232
245
  };
246
+ var ZapierConflictError = class extends ZapierError {
247
+ constructor(message, options = {}) {
248
+ super(message, options);
249
+ this.name = "ZapierConflictError";
250
+ this.code = "ZAPIER_CONFLICT_ERROR";
251
+ this.resourceType = options.resourceType;
252
+ }
253
+ };
233
254
  var ZapierRateLimitError = class extends ZapierError {
234
255
  constructor(message, options = {}) {
235
256
  super(message, options);
@@ -283,6 +304,10 @@ ${context.join(", ")}`;
283
304
  if (error.resourceId) context.push(`ID: ${error.resourceId}`);
284
305
  message += `
285
306
  ${context.join(", ")}`;
307
+ }
308
+ if (error instanceof ZapierConflictError && error.resourceType) {
309
+ message += `
310
+ Type: ${error.resourceType}`;
286
311
  }
287
312
  if (error instanceof ZapierTimeoutError && (error.attempts || error.maxAttempts)) {
288
313
  const context = [];
@@ -334,6 +359,67 @@ function formatDuration(ms) {
334
359
  const days = Math.round(hours / 24);
335
360
  return `${days}d`;
336
361
  }
362
+
363
+ // src/types/signals.ts
364
+ var ZapierSignal = class extends Error {
365
+ constructor(message) {
366
+ super(message);
367
+ Object.setPrototypeOf(this, new.target.prototype);
368
+ }
369
+ };
370
+ var ZapierReleaseTriggerMessageSignal = class extends ZapierSignal {
371
+ constructor() {
372
+ super(...arguments);
373
+ this.name = "ZapierReleaseTriggerMessageSignal";
374
+ this.code = "ZAPIER_RELEASE_TRIGGER_MESSAGE_SIGNAL";
375
+ }
376
+ };
377
+ var ZapierAbortDrainSignal = class extends ZapierSignal {
378
+ constructor() {
379
+ super(...arguments);
380
+ this.name = "ZapierAbortDrainSignal";
381
+ this.code = "ZAPIER_ABORT_DRAIN_SIGNAL";
382
+ }
383
+ };
384
+ var TriggerInboxCommandBaseSchema = z.object({
385
+ inbox: TriggerInboxPropertySchema,
386
+ onMessage: z.function().optional().meta({ exampleRequired: true }).describe(
387
+ "Per-message handler. Resolves to ack; rejects to release-or-leave per `releaseOnError`. Throw `ZapierReleaseTriggerMessageSignal` to release explicitly, or `ZapierAbortDrainSignal` to stop after the current batch."
388
+ ),
389
+ concurrency: z.number().int().min(1).optional().describe(
390
+ "Per-message handler workers running in parallel. Defaults to `leaseLimit`, or 1 if neither is set."
391
+ ),
392
+ leaseLimit: z.number().int().min(1).max(100).optional().describe(
393
+ "Per-lease HTTP batch size. Defaults to `concurrency`, or 1 if neither is set."
394
+ ),
395
+ leaseSeconds: LeaseSecondsPropertySchema.optional(),
396
+ releaseOnError: z.boolean().optional().describe(
397
+ "If true, errors immediately release the message. If false (default), errors leave it leased until the lease timeout. `ZapierReleaseTriggerMessageSignal` always releases regardless."
398
+ ),
399
+ continueOnError: z.boolean().optional().describe(
400
+ "If false (default, fail-fast), the first handler error rejects and stops the drain. If true, handler errors are observed via `onError` and the drain continues. SDK-level errors (lease / ack / release) reject regardless."
401
+ ),
402
+ onError: z.function().optional().describe(
403
+ "Per-message error observer for `continueOnError: true`. Called with the failure and the message; control-flow signals are filtered out. Throws from `onError` are swallowed."
404
+ ),
405
+ signal: z.custom((v) => v instanceof AbortSignal).optional().describe(
406
+ "Abort signal. Aborting cancels in-flight HTTP, releases unprocessed messages, and resolves cleanly. Errors during shutdown still reject."
407
+ )
408
+ });
409
+ TriggerInboxCommandBaseSchema.extend({
410
+ maxMessages: z.number().int().min(1).optional().describe(
411
+ "Cap total messages drained. Defaults to draining the inbox until empty."
412
+ )
413
+ }).describe(
414
+ "Drain an existing trigger inbox: lease currently-available messages and process them via onMessage. Returns when the inbox is empty, maxMessages is reached, the abort signal fires, or a fatal error rejects."
415
+ );
416
+ TriggerInboxCommandBaseSchema.extend({
417
+ maxDrainIntervalSeconds: z.number().int().min(1).optional().describe(
418
+ "Maximum seconds between empty-inbox poll attempts (default: 60). Caps the back-off cadence."
419
+ )
420
+ }).describe(
421
+ "Continuously consume a trigger inbox: drain currently-available messages, then poll with backoff for new arrivals, until aborted. Stop via the `signal` AbortSignal or by throwing `ZapierAbortDrainSignal` from a handler. Resolves cleanly on abort; rejects on a fatal error or a fail-fast handler error."
422
+ );
337
423
  var ActionExecutionInputSchema = z.object({
338
424
  inputs: z.record(z.string(), z.unknown()).optional(),
339
425
  /** @deprecated Use `connection` instead. */
@@ -1422,6 +1508,9 @@ function getAbortSignalApi() {
1422
1508
  const api = AbortSignal;
1423
1509
  return { any: api.any };
1424
1510
  }
1511
+ function isAbortError(err) {
1512
+ return err instanceof Error && err.name === "AbortError";
1513
+ }
1425
1514
  function createTimeoutError(timeoutMs) {
1426
1515
  if (typeof DOMException !== "undefined") {
1427
1516
  return new DOMException(
@@ -2210,7 +2299,7 @@ var actionKeyResolver = {
2210
2299
  app: resolvedParams.app
2211
2300
  });
2212
2301
  return actionsResponse.data.filter(
2213
- (action) => action.action_type === resolvedParams.actionType
2302
+ (action) => action.action_type === resolvedParams.actionType && !action.is_hidden
2214
2303
  );
2215
2304
  },
2216
2305
  prompt: (actions) => ({
@@ -2421,6 +2510,23 @@ var tableIdResolver = {
2421
2510
  }))
2422
2511
  })
2423
2512
  };
2513
+
2514
+ // src/resolvers/triggerInbox.ts
2515
+ var triggerInboxResolver = {
2516
+ type: "dynamic",
2517
+ fetch: async (sdk) => toIterable(sdk.listTriggerInboxes()),
2518
+ prompt: (inboxes) => ({
2519
+ type: "list",
2520
+ name: "inbox",
2521
+ message: "Select a trigger inbox:",
2522
+ // `deleting` inboxes are on their way out — no operation against them
2523
+ // is useful (delete is a no-op, pause/resume/update are rejected).
2524
+ choices: inboxes.filter((inbox) => inbox.status !== "deleting").map((inbox) => ({
2525
+ name: `${inbox.name ?? inbox.id} (${inbox.subscription.app_key} / ${inbox.subscription.action_key}, ${inbox.status})`,
2526
+ value: inbox.id
2527
+ }))
2528
+ })
2529
+ };
2424
2530
  function formatFieldValue(v) {
2425
2531
  if (v == null) return "";
2426
2532
  if (typeof v === "object") {
@@ -3095,7 +3201,7 @@ var listActionsPlugin = definePlugin(
3095
3201
  })
3096
3202
  );
3097
3203
  var ListInputFieldsDescription = "Get the input fields required for a specific action";
3098
- var ListInputFieldsBaseSchema = z.object({
3204
+ var ListActionInputFieldsBaseSchema = z.object({
3099
3205
  connection: ConnectionPropertySchema.optional().describe(
3100
3206
  "Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId."
3101
3207
  ),
@@ -3111,11 +3217,11 @@ var ListInputFieldsBaseSchema = z.object({
3111
3217
  maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
3112
3218
  cursor: z.string().optional().describe("Cursor to start from")
3113
3219
  });
3114
- var ListInputFieldsSchema = z.object({
3220
+ var ListActionInputFieldsSchema = z.object({
3115
3221
  app: AppPropertySchema,
3116
3222
  actionType: ActionTypePropertySchema,
3117
3223
  action: ActionPropertySchema
3118
- }).merge(ListInputFieldsBaseSchema).describe(ListInputFieldsDescription).meta({
3224
+ }).merge(ListActionInputFieldsBaseSchema).describe(ListInputFieldsDescription).meta({
3119
3225
  aliases: {
3120
3226
  appKey: "app",
3121
3227
  actionKey: "action",
@@ -3123,12 +3229,12 @@ var ListInputFieldsSchema = z.object({
3123
3229
  authenticationId: "connection"
3124
3230
  }
3125
3231
  });
3126
- var ListInputFieldsSchemaDeprecated = z.object({
3232
+ var ListActionInputFieldsSchemaDeprecated = z.object({
3127
3233
  appKey: AppKeyPropertySchema,
3128
3234
  actionType: ActionTypePropertySchema,
3129
3235
  actionKey: ActionKeyPropertySchema
3130
- }).merge(ListInputFieldsBaseSchema);
3131
- var ListInputFieldsInputSchema = z.union([ListInputFieldsSchema, ListInputFieldsSchemaDeprecated]).describe(ListInputFieldsDescription);
3236
+ }).merge(ListActionInputFieldsBaseSchema);
3237
+ var ListActionInputFieldsInputSchema = z.union([ListActionInputFieldsSchema, ListActionInputFieldsSchemaDeprecated]).describe(ListInputFieldsDescription);
3132
3238
  var BaseFieldItemSchema = z.object({
3133
3239
  type: z.string(),
3134
3240
  // "input_field", "info_field", or "fieldset"
@@ -3305,7 +3411,7 @@ async function fetchImplementationChoices({
3305
3411
  return response;
3306
3412
  }
3307
3413
 
3308
- // src/plugins/listInputFields/index.ts
3414
+ // src/plugins/listActionInputFields/index.ts
3309
3415
  function getInputFieldTypeFromNeed(need) {
3310
3416
  if (need.list) {
3311
3417
  return "ARRAY" /* ARRAY */;
@@ -3404,13 +3510,13 @@ function transformNeedsToFields(needs) {
3404
3510
  }
3405
3511
  return rootFields;
3406
3512
  }
3407
- var listInputFieldsPlugin = definePlugin(
3513
+ var listActionInputFieldsPlugin = definePlugin(
3408
3514
  (sdk) => createPaginatedPluginMethod(sdk, {
3409
- name: "listInputFields",
3515
+ name: "listActionInputFields",
3410
3516
  categories: ["action"],
3411
3517
  type: "list",
3412
- itemType: "RootFieldItem",
3413
- inputSchema: ListInputFieldsInputSchema,
3518
+ itemType: "RootField",
3519
+ inputSchema: ListActionInputFieldsInputSchema,
3414
3520
  outputSchema: RootFieldItemSchema,
3415
3521
  defaultPageSize: DEFAULT_PAGE_SIZE,
3416
3522
  resolvers: {
@@ -3471,271 +3577,566 @@ var listInputFieldsPlugin = definePlugin(
3471
3577
  }
3472
3578
  })
3473
3579
  );
3474
- var ListConnectionsQuerySchema = ListConnectionsQuerySchema$1.omit({
3475
- offset: true,
3476
- // Omit snake_case fields, we'll add camelCase versions
3477
- app_key: true,
3478
- connection_ids: true,
3479
- account_id: true,
3480
- is_expired: true,
3481
- page_size: true
3482
- }).extend({
3483
- // New name for appKey
3484
- app: AppPropertySchema.optional().describe(
3485
- "App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
3486
- ),
3487
- /** @deprecated Use `app` instead. */
3488
- appKey: AppKeyPropertySchema.optional().describe(
3489
- "App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
3490
- ).meta({ deprecated: true }),
3491
- // New name for connectionIds
3492
- connections: ConnectionsPropertySchema.optional().describe(
3493
- "List of connection IDs to filter by"
3494
- ),
3495
- /** @deprecated Use `connections` instead. */
3496
- connectionIds: z.array(z.string()).optional().describe("List of connection IDs to filter by").meta({ deprecated: true }),
3497
- /** @deprecated Use `connections` instead. */
3498
- authenticationIds: z.array(z.string()).optional().describe(
3499
- "List of authentication IDs to filter by (deprecated, use connections)"
3500
- ).meta({ deprecated: true }),
3501
- account: z.string().optional().describe("Account to filter by"),
3502
- /** @deprecated Use `account` instead. */
3503
- accountId: z.string().optional().describe("Account ID to filter by").meta({ deprecated: true }),
3504
- // Include shared connections (overrides default owner=me filter)
3505
- includeShared: z.boolean().optional().describe(
3506
- "Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections."
3507
- ),
3508
- /** @deprecated Use `expired` instead */
3509
- isExpired: z.boolean().optional().describe("Filter by expired status").meta({
3510
- deprecated: true,
3511
- deprecationMessage: "Use --expired instead to show only expired connections."
3512
- }),
3513
- expired: z.boolean().optional().describe(
3514
- "Show only expired connections (default: only non-expired connections are returned)"
3515
- ),
3516
- // Override pageSize to make optional
3517
- pageSize: z.number().min(1).optional().describe("Number of connections per page"),
3518
- // SDK specific property for pagination/iterable helpers
3519
- maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
3520
- // SDK specific property for pagination/iterable helpers
3521
- cursor: z.string().optional().describe("Cursor to start from")
3522
- }).describe("List available connections with optional filtering");
3523
- var ConnectionItemSchema = withFormatter(ConnectionItemSchema$1, {
3580
+ var InputFieldChoiceItemSchema = withFormatter(NeedChoicesSchema, {
3524
3581
  format: (item) => {
3582
+ const title = item.label || item.key || "Choice";
3525
3583
  const details = [];
3526
- if (item.identifier) {
3527
- details.push({
3528
- text: `Identifier: ${item.identifier}`,
3529
- style: "accent"
3530
- });
3584
+ if (item.label && item.key && item.label !== item.key) {
3585
+ details.push({ text: `Key: ${item.key}`, style: "dim" });
3531
3586
  }
3532
- details.push({
3533
- text: `Account: ${item.account_id} | Private: ${item.is_private} | Shared: ${item.shared_with_all}`,
3534
- style: "dim"
3535
- });
3536
- if (item.marked_stale_at) {
3537
- details.push({
3538
- text: `Warning: Marked stale: ${new Date(item.marked_stale_at).toLocaleDateString()}`,
3539
- style: "warning"
3540
- });
3587
+ if (item.sample && item.sample !== item.key) {
3588
+ details.push({ text: `Sample: ${item.sample}`, style: "dim" });
3589
+ }
3590
+ if (item.value && item.value !== item.key) {
3591
+ details.push({ text: `Value: ${item.value}`, style: "normal" });
3541
3592
  }
3542
3593
  return {
3543
- title: item.title || `Connection ${item.id}`,
3544
- id: item.id?.toString(),
3594
+ title,
3595
+ key: item.key,
3545
3596
  details
3546
3597
  };
3547
3598
  }
3548
3599
  });
3600
+ var ListActionInputFieldChoicesDescription = "Get the available choices for a dynamic dropdown input field";
3601
+ var ListActionInputFieldChoicesBaseSchema = z.object({
3602
+ connection: ConnectionPropertySchema.optional().describe(
3603
+ "Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId."
3604
+ ),
3605
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
3606
+ "Connection ID to use when listing available field choices. Required if the action needs a connection to populate dynamic dropdown options."
3607
+ ).meta({ deprecated: true }),
3608
+ /** @deprecated Use connection instead */
3609
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
3610
+ inputs: InputsPropertySchema.optional().describe(
3611
+ "Current input values that may affect available choices"
3612
+ ),
3613
+ page: z.number().int().min(0).optional().describe("Page number for paginated results"),
3614
+ pageSize: z.number().min(1).optional().describe("Number of choices per page"),
3615
+ maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
3616
+ cursor: z.string().optional().describe("Cursor to start from")
3617
+ });
3618
+ var ListActionInputFieldChoicesSchema = z.object({
3619
+ app: AppPropertySchema,
3620
+ actionType: ActionTypePropertySchema,
3621
+ action: ActionPropertySchema,
3622
+ inputField: InputFieldPropertySchema
3623
+ }).merge(ListActionInputFieldChoicesBaseSchema).describe(ListActionInputFieldChoicesDescription).meta({
3624
+ aliases: {
3625
+ appKey: "app",
3626
+ actionKey: "action",
3627
+ inputFieldKey: "inputField",
3628
+ connectionId: "connection",
3629
+ authenticationId: "connection"
3630
+ }
3631
+ });
3632
+ var ListActionInputFieldChoicesSchemaDeprecated = z.object({
3633
+ appKey: AppKeyPropertySchema,
3634
+ actionType: ActionTypePropertySchema,
3635
+ actionKey: ActionKeyPropertySchema,
3636
+ inputFieldKey: z.string().min(1).describe("Input field key to get choices for.")
3637
+ }).merge(ListActionInputFieldChoicesBaseSchema);
3638
+ var ListActionInputFieldChoicesInputSchema = z.union([
3639
+ ListActionInputFieldChoicesSchema,
3640
+ ListActionInputFieldChoicesSchemaDeprecated
3641
+ ]).describe(ListActionInputFieldChoicesDescription);
3549
3642
 
3550
- // src/plugins/listConnections/index.ts
3551
- var listConnectionsPlugin = definePlugin(
3643
+ // src/plugins/listActionInputFieldChoices/index.ts
3644
+ function transformNeedChoicesToInputFieldChoiceItem(choice) {
3645
+ return {
3646
+ key: choice.key,
3647
+ label: choice.label,
3648
+ sample: choice.sample,
3649
+ value: choice.value
3650
+ };
3651
+ }
3652
+ var listActionInputFieldChoicesPlugin = definePlugin(
3552
3653
  (sdk) => createPaginatedPluginMethod(sdk, {
3553
- name: "listConnections",
3554
- categories: ["connection"],
3654
+ name: "listActionInputFieldChoices",
3655
+ categories: ["action"],
3555
3656
  type: "list",
3556
- itemType: "Connection",
3557
- inputSchema: ListConnectionsQuerySchema,
3558
- outputSchema: ConnectionItemSchema,
3657
+ itemType: "InputFieldChoice",
3658
+ inputSchema: ListActionInputFieldChoicesInputSchema,
3659
+ outputSchema: InputFieldChoiceItemSchema,
3559
3660
  defaultPageSize: DEFAULT_PAGE_SIZE,
3560
- resolvers: { app: appKeyResolver },
3561
- handler: async ({ sdk: sdk2, options }) => {
3562
- if (options.includeShared) {
3563
- await sdk2.context.checkCapability("canIncludeSharedConnections");
3564
- }
3661
+ resolvers: {
3662
+ app: appKeyResolver,
3663
+ actionType: actionTypeResolver,
3664
+ action: actionKeyResolver,
3665
+ connection: connectionIdResolver,
3666
+ inputField: inputFieldKeyResolver,
3667
+ inputs: inputsAllOptionalResolver
3668
+ },
3669
+ handler: async ({
3670
+ sdk: sdk2,
3671
+ options
3672
+ }) => {
3565
3673
  const { api, getVersionedImplementationId } = sdk2.context;
3566
- const searchParams = {};
3567
- if (options.pageSize !== void 0) {
3568
- searchParams.page_size = options.pageSize.toString();
3569
- }
3570
- const appKey = options.app ?? options.appKey;
3571
- if (appKey) {
3572
- const implementationId = await getVersionedImplementationId(appKey);
3573
- if (implementationId) {
3574
- setMethodMetadata({ selectedApi: implementationId });
3575
- const [versionlessSelectedApi] = splitVersionedKey(implementationId);
3576
- searchParams.app_key = versionlessSelectedApi;
3577
- } else {
3578
- searchParams.app_key = appKey;
3579
- }
3580
- }
3581
- const connectionRefs = options.connections;
3582
- const legacyConnectionIds = options.connectionIds ?? options.authenticationIds;
3583
- if (connectionRefs && connectionRefs.length > 0) {
3584
- const resolvedIds = await Promise.all(
3585
- connectionRefs.map(
3586
- (ref) => resolveConnectionId({
3587
- connection: ref,
3588
- resolveConnection: sdk2.context.resolveConnection
3589
- })
3590
- )
3591
- );
3592
- searchParams.connection_ids = resolvedIds.filter((id) => id != null).join(",");
3593
- } else if (legacyConnectionIds && legacyConnectionIds.length > 0) {
3594
- searchParams.connection_ids = legacyConnectionIds.join(",");
3595
- }
3596
- if (options.search) {
3597
- searchParams.search = options.search;
3598
- }
3599
- if (options.title) {
3600
- searchParams.title = options.title;
3601
- }
3602
- const accountId = options.account ?? options.accountId;
3603
- if (accountId) {
3604
- searchParams.account_id = accountId;
3605
- }
3606
- if (options.owner && options.owner !== "me" && !options.includeShared) {
3607
- throw new ZapierValidationError(
3608
- 'The "owner" option requires "includeShared" to be true. Without includeShared, only your own connections are returned.'
3674
+ const appKey = "app" in options ? options.app : options.appKey;
3675
+ const actionKey = "action" in options ? options.action : options.actionKey;
3676
+ const inputFieldKey = "inputField" in options ? options.inputField : options.inputFieldKey;
3677
+ const {
3678
+ actionType,
3679
+ connection,
3680
+ connectionId,
3681
+ authenticationId,
3682
+ inputs,
3683
+ page,
3684
+ cursor
3685
+ } = options;
3686
+ const resolvedConnectionId = await resolveConnectionId({
3687
+ connection,
3688
+ connectionId,
3689
+ authenticationId,
3690
+ resolveConnection: sdk2.context.resolveConnection
3691
+ });
3692
+ const selectedApi = await getVersionedImplementationId(appKey);
3693
+ if (!selectedApi) {
3694
+ throw new ZapierConfigurationError(
3695
+ "No current_implementation_id found for app",
3696
+ { configType: "current_implementation_id" }
3609
3697
  );
3610
3698
  }
3611
- const owner = options.includeShared ? options.owner : "me";
3612
- if (owner) {
3613
- searchParams.owner = owner;
3614
- }
3615
- if (options.isExpired !== void 0) {
3616
- searchParams.is_expired = options.isExpired.toString();
3617
- } else {
3618
- searchParams.is_expired = (options.expired ?? false).toString();
3699
+ setMethodMetadata({
3700
+ selectedApi,
3701
+ operationType: actionType,
3702
+ operationKey: actionKey
3703
+ });
3704
+ const { data: action } = await sdk2.getAction({
3705
+ app: appKey,
3706
+ actionType,
3707
+ action: actionKey
3708
+ });
3709
+ const needsData = await fetchImplementationNeeds({
3710
+ api,
3711
+ selectedApi,
3712
+ action: action.key,
3713
+ actionType,
3714
+ connectionId: resolvedConnectionId ?? null,
3715
+ inputs
3716
+ });
3717
+ const targetNeed = needsData.needs?.find(
3718
+ (need) => need.key === inputFieldKey
3719
+ );
3720
+ if (targetNeed?.choices && targetNeed.choices.length > 0) {
3721
+ return {
3722
+ data: targetNeed.choices.map(
3723
+ transformNeedChoicesToInputFieldChoiceItem
3724
+ )
3725
+ };
3619
3726
  }
3620
- if (options.cursor) {
3621
- searchParams.offset = options.cursor;
3727
+ if (!action.id) {
3728
+ throw new ZapierApiError(
3729
+ `Action ${actionKey} does not have an ID - cannot retrieve input field choices`
3730
+ );
3622
3731
  }
3623
- const response = await api.get(
3624
- "/api/v0/connections",
3625
- { searchParams, authRequired: true }
3732
+ const requestPage = cursor ? parseInt(cursor, 10) : page ?? 0;
3733
+ const choicesData = await fetchImplementationChoices({
3734
+ api,
3735
+ actionId: action.id,
3736
+ inputFieldId: inputFieldKey,
3737
+ connectionId: resolvedConnectionId ?? null,
3738
+ inputs,
3739
+ page: requestPage
3740
+ });
3741
+ const choices = (choicesData.choices || []).map(
3742
+ transformNeedChoicesToInputFieldChoiceItem
3626
3743
  );
3627
- return {
3628
- ...response,
3629
- data: response.data.map(transformConnectionItem)
3630
- };
3631
- },
3632
- extractCursor: (response) => extractCursor(response.links)
3633
- })
3634
- );
3635
- var ListClientCredentialsQuerySchema = ListClientCredentialsQuerySchema$1.omit({
3636
- offset: true,
3637
- page_size: true
3638
- }).extend({
3639
- // Override pageSize to make optional
3640
- pageSize: z.number().min(1).optional().describe("Number of credentials per page"),
3641
- // SDK specific property for pagination/iterable helpers
3642
- maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
3643
- // SDK specific property for pagination/iterable helpers
3644
- cursor: z.string().optional().describe("Cursor to start from")
3645
- }).describe("List client credentials for the authenticated user");
3646
- var ClientCredentialsItemSchema = withFormatter(
3647
- ClientCredentialsItemSchema$1,
3648
- {
3649
- format: (item) => {
3650
- const details = [];
3651
- if (item.allowed_scopes && item.allowed_scopes.length > 0) {
3652
- details.push({
3653
- text: `Scopes: ${item.allowed_scopes.join(", ")}`,
3654
- style: "accent"
3655
- });
3656
- }
3657
- if (item.created_at) {
3658
- details.push({
3659
- text: `Created: ${new Date(item.created_at).toLocaleDateString()}`,
3660
- style: "dim"
3661
- });
3744
+ let nextCursor;
3745
+ if (choicesData.next_page != null) {
3746
+ nextCursor = choicesData.next_page.toString();
3747
+ } else if (choicesData.links?.next) {
3748
+ try {
3749
+ const nextUrl = new URL(choicesData.links.next);
3750
+ const nextPage = nextUrl.searchParams.get("page");
3751
+ if (nextPage) {
3752
+ nextCursor = nextPage;
3753
+ }
3754
+ } catch {
3755
+ }
3662
3756
  }
3663
- return {
3664
- title: item.name,
3665
- id: item.client_id,
3666
- details
3667
- };
3757
+ return { data: choices, nextCursor };
3668
3758
  }
3669
- }
3759
+ })
3670
3760
  );
3671
- var ClientCredentialsCreatedItemSchema = withFormatter(
3672
- ClientCredentialsCreatedItemSchema$1,
3673
- {
3674
- format: (item) => {
3675
- return {
3676
- title: item.name,
3677
- id: item.client_id,
3678
- details: [
3679
- {
3680
- text: `Client Secret: ${item.client_secret}`,
3681
- style: "accent"
3682
- }
3683
- ]
3684
- };
3685
- }
3761
+ var GetActionInputFieldsSchemaDescription = "Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters.";
3762
+ var GetActionInputFieldsSchemaBaseSchema = z.object({
3763
+ connection: ConnectionPropertySchema.optional().describe(
3764
+ "Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId."
3765
+ ),
3766
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
3767
+ "Connection ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
3768
+ ).meta({ deprecated: true }),
3769
+ /** @deprecated Use connection instead */
3770
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
3771
+ "Authentication ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
3772
+ ).meta({ deprecated: true }),
3773
+ inputs: InputsPropertySchema.optional().describe(
3774
+ "Current input values that may affect the schema (e.g., when fields depend on other field values)"
3775
+ )
3776
+ });
3777
+ var GetActionInputFieldsSchemaSchema = z.object({
3778
+ app: AppPropertySchema.describe(
3779
+ "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
3780
+ ),
3781
+ actionType: ActionTypePropertySchema.describe(
3782
+ "Action type that matches the action's defined type"
3783
+ ),
3784
+ action: ActionPropertySchema.describe(
3785
+ "Action key to get the input schema for"
3786
+ )
3787
+ }).merge(GetActionInputFieldsSchemaBaseSchema).describe(GetActionInputFieldsSchemaDescription).meta({
3788
+ aliases: {
3789
+ appKey: "app",
3790
+ actionKey: "action",
3791
+ connectionId: "connection",
3792
+ authenticationId: "connection"
3686
3793
  }
3687
- );
3794
+ });
3795
+ var GetActionInputFieldsSchemaSchemaDeprecated = z.object({
3796
+ appKey: AppKeyPropertySchema.describe(
3797
+ "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
3798
+ ),
3799
+ actionType: ActionTypePropertySchema.describe(
3800
+ "Action type that matches the action's defined type"
3801
+ ),
3802
+ actionKey: ActionKeyPropertySchema.describe(
3803
+ "Action key to get the input schema for"
3804
+ )
3805
+ }).merge(GetActionInputFieldsSchemaBaseSchema);
3806
+ var GetActionInputFieldsSchemaInputSchema = z.union([
3807
+ GetActionInputFieldsSchemaSchema,
3808
+ GetActionInputFieldsSchemaSchemaDeprecated
3809
+ ]).describe(GetActionInputFieldsSchemaDescription);
3688
3810
 
3689
- // src/plugins/listClientCredentials/index.ts
3690
- var listClientCredentialsPlugin = definePlugin(
3691
- (sdk) => createPaginatedPluginMethod(sdk, {
3692
- name: "listClientCredentials",
3693
- categories: ["client-credentials"],
3694
- type: "list",
3695
- itemType: "ClientCredentials",
3696
- inputSchema: ListClientCredentialsQuerySchema,
3697
- outputSchema: ClientCredentialsItemSchema,
3698
- defaultPageSize: DEFAULT_PAGE_SIZE,
3811
+ // src/plugins/getActionInputFieldsSchema/index.ts
3812
+ var getActionInputFieldsSchemaPlugin = definePlugin(
3813
+ (sdk) => createPluginMethod(sdk, {
3814
+ name: "getActionInputFieldsSchema",
3815
+ categories: ["action"],
3816
+ type: "item",
3817
+ itemType: "InputSchema",
3818
+ inputSchema: GetActionInputFieldsSchemaInputSchema,
3819
+ resolvers: {
3820
+ app: appKeyResolver,
3821
+ actionType: actionTypeResolver,
3822
+ action: actionKeyResolver,
3823
+ connection: connectionIdResolver,
3824
+ inputs: inputsAllOptionalResolver
3825
+ },
3699
3826
  handler: async ({
3700
3827
  sdk: sdk2,
3701
3828
  options
3702
3829
  }) => {
3703
- const searchParams = {};
3704
- if (options.pageSize !== void 0) {
3705
- searchParams.page_size = options.pageSize.toString();
3706
- }
3707
- if (options.cursor) {
3708
- searchParams.offset = options.cursor;
3830
+ const { api, getVersionedImplementationId } = sdk2.context;
3831
+ const appKey = "app" in options ? options.app : options.appKey;
3832
+ const actionKey = "action" in options ? options.action : options.actionKey;
3833
+ const {
3834
+ actionType,
3835
+ connection,
3836
+ connectionId,
3837
+ authenticationId,
3838
+ inputs
3839
+ } = options;
3840
+ const resolvedConnectionId = await resolveConnectionId({
3841
+ connection,
3842
+ connectionId,
3843
+ authenticationId,
3844
+ resolveConnection: sdk2.context.resolveConnection
3845
+ });
3846
+ const selectedApi = await getVersionedImplementationId(appKey);
3847
+ if (!selectedApi) {
3848
+ throw new ZapierConfigurationError(
3849
+ "No current_implementation_id found for app",
3850
+ { configType: "current_implementation_id" }
3851
+ );
3709
3852
  }
3710
- return sdk2.context.api.get(
3711
- "/api/v0/client-credentials",
3712
- {
3713
- searchParams,
3714
- authRequired: true,
3715
- requiredScopes: ["credentials"]
3716
- }
3717
- );
3718
- },
3719
- extractCursor: (response) => extractCursor(response.links)
3853
+ setMethodMetadata({
3854
+ selectedApi,
3855
+ operationType: actionType,
3856
+ operationKey: actionKey
3857
+ });
3858
+ const { data: action } = await sdk2.getAction({
3859
+ app: appKey,
3860
+ actionType,
3861
+ action: actionKey
3862
+ });
3863
+ const needsData = await fetchImplementationNeeds({
3864
+ api,
3865
+ selectedApi,
3866
+ action: action.key,
3867
+ actionType,
3868
+ connectionId: resolvedConnectionId ?? null,
3869
+ inputs
3870
+ });
3871
+ return { data: needsData.schema || {} };
3872
+ }
3720
3873
  })
3721
3874
  );
3722
- var CreateClientCredentialsSchema = CreateClientCredentialsRequestSchema.omit({ allowed_scopes: true }).extend({
3723
- allowedScopes: z.array(z.enum(["credentials", "external"])).default(["external"]).describe("Scopes to allow for these credentials"),
3724
- // Temporarily hidden while we finalise work to make approvals/policies customer-facing.
3725
- policy: z.record(z.string(), z.unknown()).optional().describe("Policy document (JSON) to attach to the credentials").meta({ deprecated: true })
3726
- }).describe("Create new client credentials for the authenticated user");
3727
-
3728
- // src/plugins/createClientCredentials/index.ts
3729
- var createClientCredentialsPlugin = definePlugin(
3730
- (sdk) => createPluginMethod(sdk, {
3731
- name: "createClientCredentials",
3732
- categories: ["client-credentials"],
3733
- type: "create",
3734
- itemType: "ClientCredentials",
3735
- inputSchema: CreateClientCredentialsSchema,
3736
- outputSchema: ClientCredentialsCreatedItemSchema,
3737
- confirm: "create-secret",
3738
- resolvers: { name: clientCredentialsNameResolver },
3875
+ var ListConnectionsQuerySchema = ListConnectionsQuerySchema$1.omit({
3876
+ offset: true,
3877
+ // Omit snake_case fields, we'll add camelCase versions
3878
+ app_key: true,
3879
+ connection_ids: true,
3880
+ account_id: true,
3881
+ is_expired: true,
3882
+ page_size: true
3883
+ }).extend({
3884
+ // New name for appKey
3885
+ app: AppPropertySchema.optional().describe(
3886
+ "App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
3887
+ ),
3888
+ /** @deprecated Use `app` instead. */
3889
+ appKey: AppKeyPropertySchema.optional().describe(
3890
+ "App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
3891
+ ).meta({ deprecated: true }),
3892
+ // New name for connectionIds
3893
+ connections: ConnectionsPropertySchema.optional().describe(
3894
+ "List of connection IDs to filter by"
3895
+ ),
3896
+ /** @deprecated Use `connections` instead. */
3897
+ connectionIds: z.array(z.string()).optional().describe("List of connection IDs to filter by").meta({ deprecated: true }),
3898
+ /** @deprecated Use `connections` instead. */
3899
+ authenticationIds: z.array(z.string()).optional().describe(
3900
+ "List of authentication IDs to filter by (deprecated, use connections)"
3901
+ ).meta({ deprecated: true }),
3902
+ account: z.string().optional().describe("Account to filter by"),
3903
+ /** @deprecated Use `account` instead. */
3904
+ accountId: z.string().optional().describe("Account ID to filter by").meta({ deprecated: true }),
3905
+ // Include shared connections (overrides default owner=me filter)
3906
+ includeShared: z.boolean().optional().describe(
3907
+ "Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections."
3908
+ ),
3909
+ /** @deprecated Use `expired` instead */
3910
+ isExpired: z.boolean().optional().describe("Filter by expired status").meta({
3911
+ deprecated: true,
3912
+ deprecationMessage: "Use --expired instead to show only expired connections."
3913
+ }),
3914
+ expired: z.boolean().optional().describe(
3915
+ "Show only expired connections (default: only non-expired connections are returned)"
3916
+ ),
3917
+ // Override pageSize to make optional
3918
+ pageSize: z.number().min(1).optional().describe("Number of connections per page"),
3919
+ // SDK specific property for pagination/iterable helpers
3920
+ maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
3921
+ // SDK specific property for pagination/iterable helpers
3922
+ cursor: z.string().optional().describe("Cursor to start from")
3923
+ }).describe("List available connections with optional filtering");
3924
+ var ConnectionItemSchema = withFormatter(ConnectionItemSchema$1, {
3925
+ format: (item) => {
3926
+ const details = [];
3927
+ if (item.identifier) {
3928
+ details.push({
3929
+ text: `Identifier: ${item.identifier}`,
3930
+ style: "accent"
3931
+ });
3932
+ }
3933
+ details.push({
3934
+ text: `Account: ${item.account_id} | Private: ${item.is_private} | Shared: ${item.shared_with_all}`,
3935
+ style: "dim"
3936
+ });
3937
+ if (item.marked_stale_at) {
3938
+ details.push({
3939
+ text: `Warning: Marked stale: ${new Date(item.marked_stale_at).toLocaleDateString()}`,
3940
+ style: "warning"
3941
+ });
3942
+ }
3943
+ return {
3944
+ title: item.title || `Connection ${item.id}`,
3945
+ id: item.id?.toString(),
3946
+ details
3947
+ };
3948
+ }
3949
+ });
3950
+
3951
+ // src/plugins/listConnections/index.ts
3952
+ var listConnectionsPlugin = definePlugin(
3953
+ (sdk) => createPaginatedPluginMethod(sdk, {
3954
+ name: "listConnections",
3955
+ categories: ["connection"],
3956
+ type: "list",
3957
+ itemType: "Connection",
3958
+ inputSchema: ListConnectionsQuerySchema,
3959
+ outputSchema: ConnectionItemSchema,
3960
+ defaultPageSize: DEFAULT_PAGE_SIZE,
3961
+ resolvers: { app: appKeyResolver },
3962
+ handler: async ({ sdk: sdk2, options }) => {
3963
+ if (options.includeShared) {
3964
+ await sdk2.context.checkCapability("canIncludeSharedConnections");
3965
+ }
3966
+ const { api, getVersionedImplementationId } = sdk2.context;
3967
+ const searchParams = {};
3968
+ if (options.pageSize !== void 0) {
3969
+ searchParams.page_size = options.pageSize.toString();
3970
+ }
3971
+ const appKey = options.app ?? options.appKey;
3972
+ if (appKey) {
3973
+ const implementationId = await getVersionedImplementationId(appKey);
3974
+ if (implementationId) {
3975
+ setMethodMetadata({ selectedApi: implementationId });
3976
+ const [versionlessSelectedApi] = splitVersionedKey(implementationId);
3977
+ searchParams.app_key = versionlessSelectedApi;
3978
+ } else {
3979
+ searchParams.app_key = appKey;
3980
+ }
3981
+ }
3982
+ const connectionRefs = options.connections;
3983
+ const legacyConnectionIds = options.connectionIds ?? options.authenticationIds;
3984
+ if (connectionRefs && connectionRefs.length > 0) {
3985
+ const resolvedIds = await Promise.all(
3986
+ connectionRefs.map(
3987
+ (ref) => resolveConnectionId({
3988
+ connection: ref,
3989
+ resolveConnection: sdk2.context.resolveConnection
3990
+ })
3991
+ )
3992
+ );
3993
+ searchParams.connection_ids = resolvedIds.filter((id) => id != null).join(",");
3994
+ } else if (legacyConnectionIds && legacyConnectionIds.length > 0) {
3995
+ searchParams.connection_ids = legacyConnectionIds.join(",");
3996
+ }
3997
+ if (options.search) {
3998
+ searchParams.search = options.search;
3999
+ }
4000
+ if (options.title) {
4001
+ searchParams.title = options.title;
4002
+ }
4003
+ const accountId = options.account ?? options.accountId;
4004
+ if (accountId) {
4005
+ searchParams.account_id = accountId;
4006
+ }
4007
+ if (options.owner && options.owner !== "me" && !options.includeShared) {
4008
+ throw new ZapierValidationError(
4009
+ 'The "owner" option requires "includeShared" to be true. Without includeShared, only your own connections are returned.'
4010
+ );
4011
+ }
4012
+ const owner = options.includeShared ? options.owner : "me";
4013
+ if (owner) {
4014
+ searchParams.owner = owner;
4015
+ }
4016
+ if (options.isExpired !== void 0) {
4017
+ searchParams.is_expired = options.isExpired.toString();
4018
+ } else {
4019
+ searchParams.is_expired = (options.expired ?? false).toString();
4020
+ }
4021
+ if (options.cursor) {
4022
+ searchParams.offset = options.cursor;
4023
+ }
4024
+ const response = await api.get(
4025
+ "/api/v0/connections",
4026
+ { searchParams, authRequired: true }
4027
+ );
4028
+ return {
4029
+ ...response,
4030
+ data: response.data.map(transformConnectionItem)
4031
+ };
4032
+ },
4033
+ extractCursor: (response) => extractCursor(response.links)
4034
+ })
4035
+ );
4036
+ var ListClientCredentialsQuerySchema = ListClientCredentialsQuerySchema$1.omit({
4037
+ offset: true,
4038
+ page_size: true
4039
+ }).extend({
4040
+ // Override pageSize to make optional
4041
+ pageSize: z.number().min(1).optional().describe("Number of credentials per page"),
4042
+ // SDK specific property for pagination/iterable helpers
4043
+ maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
4044
+ // SDK specific property for pagination/iterable helpers
4045
+ cursor: z.string().optional().describe("Cursor to start from")
4046
+ }).describe("List client credentials for the authenticated user");
4047
+ var ClientCredentialsItemSchema = withFormatter(
4048
+ ClientCredentialsItemSchema$1,
4049
+ {
4050
+ format: (item) => {
4051
+ const details = [];
4052
+ if (item.allowed_scopes && item.allowed_scopes.length > 0) {
4053
+ details.push({
4054
+ text: `Scopes: ${item.allowed_scopes.join(", ")}`,
4055
+ style: "accent"
4056
+ });
4057
+ }
4058
+ if (item.created_at) {
4059
+ details.push({
4060
+ text: `Created: ${new Date(item.created_at).toLocaleDateString()}`,
4061
+ style: "dim"
4062
+ });
4063
+ }
4064
+ return {
4065
+ title: item.name,
4066
+ id: item.client_id,
4067
+ details
4068
+ };
4069
+ }
4070
+ }
4071
+ );
4072
+ var ClientCredentialsCreatedItemSchema = withFormatter(
4073
+ ClientCredentialsCreatedItemSchema$1,
4074
+ {
4075
+ format: (item) => {
4076
+ return {
4077
+ title: item.name,
4078
+ id: item.client_id,
4079
+ details: [
4080
+ {
4081
+ text: `Client Secret: ${item.client_secret}`,
4082
+ style: "accent"
4083
+ }
4084
+ ]
4085
+ };
4086
+ }
4087
+ }
4088
+ );
4089
+
4090
+ // src/plugins/listClientCredentials/index.ts
4091
+ var listClientCredentialsPlugin = definePlugin(
4092
+ (sdk) => createPaginatedPluginMethod(sdk, {
4093
+ name: "listClientCredentials",
4094
+ categories: ["client-credentials"],
4095
+ type: "list",
4096
+ itemType: "ClientCredentials",
4097
+ inputSchema: ListClientCredentialsQuerySchema,
4098
+ outputSchema: ClientCredentialsItemSchema,
4099
+ defaultPageSize: DEFAULT_PAGE_SIZE,
4100
+ handler: async ({
4101
+ sdk: sdk2,
4102
+ options
4103
+ }) => {
4104
+ const searchParams = {};
4105
+ if (options.pageSize !== void 0) {
4106
+ searchParams.page_size = options.pageSize.toString();
4107
+ }
4108
+ if (options.cursor) {
4109
+ searchParams.offset = options.cursor;
4110
+ }
4111
+ return sdk2.context.api.get(
4112
+ "/api/v0/client-credentials",
4113
+ {
4114
+ searchParams,
4115
+ authRequired: true,
4116
+ requiredScopes: ["credentials"]
4117
+ }
4118
+ );
4119
+ },
4120
+ extractCursor: (response) => extractCursor(response.links)
4121
+ })
4122
+ );
4123
+ var CreateClientCredentialsSchema = CreateClientCredentialsRequestSchema.omit({ allowed_scopes: true }).extend({
4124
+ allowedScopes: z.array(z.enum(["credentials", "external"])).default(["external"]).describe("Scopes to allow for these credentials"),
4125
+ // Temporarily hidden while we finalise work to make approvals/policies customer-facing.
4126
+ policy: z.record(z.string(), z.unknown()).optional().describe("Policy document (JSON) to attach to the credentials").meta({ deprecated: true })
4127
+ }).describe("Create new client credentials for the authenticated user");
4128
+
4129
+ // src/plugins/createClientCredentials/index.ts
4130
+ var createClientCredentialsPlugin = definePlugin(
4131
+ (sdk) => createPluginMethod(sdk, {
4132
+ name: "createClientCredentials",
4133
+ categories: ["client-credentials"],
4134
+ type: "create",
4135
+ itemType: "ClientCredentials",
4136
+ inputSchema: CreateClientCredentialsSchema,
4137
+ outputSchema: ClientCredentialsCreatedItemSchema,
4138
+ confirm: "create-secret",
4139
+ resolvers: { name: clientCredentialsNameResolver },
3739
4140
  handler: async ({ sdk: sdk2, options }) => {
3740
4141
  const { api } = sdk2.context;
3741
4142
  const response = await api.post(
@@ -4985,8 +5386,22 @@ function calculateExponentialBackoffMs(attempt, baseDelayMs = BASE_EXPONENTIAL_B
4985
5386
  const jitter = Math.random() * JITTER_FACTOR * baseDelay;
4986
5387
  return Math.floor(baseDelay + jitter);
4987
5388
  }
4988
- function sleep(ms) {
4989
- return new Promise((resolve2) => setTimeout(resolve2, ms));
5389
+ function sleep(ms, signal) {
5390
+ if (!signal) {
5391
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
5392
+ }
5393
+ if (signal.aborted) return Promise.resolve();
5394
+ return new Promise((resolve2) => {
5395
+ const timer = setTimeout(() => {
5396
+ signal.removeEventListener("abort", onAbort);
5397
+ resolve2();
5398
+ }, ms);
5399
+ const onAbort = () => {
5400
+ clearTimeout(timer);
5401
+ resolve2();
5402
+ };
5403
+ signal.addEventListener("abort", onAbort, { once: true });
5404
+ });
4990
5405
  }
4991
5406
 
4992
5407
  // src/api/polling.ts
@@ -5016,6 +5431,14 @@ function getPollingInterval(elapsedMs) {
5016
5431
  const stage = POLLING_STAGES.find(([threshold]) => elapsedMs < threshold);
5017
5432
  return stage ? stage[1] : DEFAULT_MAX_POLLING_INTERVAL_MS;
5018
5433
  }
5434
+ function makeAbortError() {
5435
+ if (typeof DOMException !== "undefined") {
5436
+ return new DOMException("Polling was aborted", "AbortError");
5437
+ }
5438
+ const err = new Error("Polling was aborted");
5439
+ err.name = "AbortError";
5440
+ return err;
5441
+ }
5019
5442
  var processResponse = async (response, successStatus, pendingStatus, isPending, resultExtractor, errorCount) => {
5020
5443
  if (!response.ok) {
5021
5444
  return {
@@ -5069,7 +5492,8 @@ async function pollUntilComplete(options) {
5069
5492
  successStatus = DEFAULT_SUCCESS_STATUS,
5070
5493
  pendingStatus = DEFAULT_PENDING_STATUS,
5071
5494
  isPending,
5072
- resultExtractor = (response) => response
5495
+ resultExtractor = (response) => response,
5496
+ signal
5073
5497
  } = options;
5074
5498
  if (timeoutMs <= 0) {
5075
5499
  throw new ZapierValidationError("Timeout must be greater than 0", {
@@ -5081,13 +5505,16 @@ async function pollUntilComplete(options) {
5081
5505
  details: { initialDelay }
5082
5506
  });
5083
5507
  }
5508
+ if (signal?.aborted) throw makeAbortError();
5084
5509
  const startTime = Date.now();
5085
5510
  let attempts = 0;
5086
5511
  let errorCount = 0;
5087
5512
  if (initialDelay > 0) {
5088
- await sleep(initialDelay);
5513
+ await sleep(initialDelay, signal);
5514
+ if (signal?.aborted) throw makeAbortError();
5089
5515
  }
5090
5516
  while (true) {
5517
+ if (signal?.aborted) throw makeAbortError();
5091
5518
  const elapsedTime = Date.now() - startTime;
5092
5519
  if (elapsedTime >= timeoutMs) {
5093
5520
  throw new ZapierTimeoutError(
@@ -5100,7 +5527,8 @@ async function pollUntilComplete(options) {
5100
5527
  if (attempts > 0) {
5101
5528
  const interval = getPollingInterval(elapsedTime);
5102
5529
  const waitTime = calculateErrorBackoffMs(interval, errorCount);
5103
- await sleep(waitTime);
5530
+ await sleep(waitTime, signal);
5531
+ if (signal?.aborted) throw makeAbortError();
5104
5532
  }
5105
5533
  attempts++;
5106
5534
  try {
@@ -5128,6 +5556,7 @@ async function pollUntilComplete(options) {
5128
5556
  );
5129
5557
  }
5130
5558
  } catch (error) {
5559
+ if (isAbortError(error)) throw error;
5131
5560
  errorCount++;
5132
5561
  if (errorCount >= MAX_CONSECUTIVE_ERRORS) {
5133
5562
  throw new ZapierApiError(
@@ -5629,7 +6058,7 @@ async function invalidateCredentialsToken(options) {
5629
6058
  }
5630
6059
 
5631
6060
  // src/sdk-version.ts
5632
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.48.0" : void 0) || "unknown";
6061
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.49.0" : void 0) || "unknown";
5633
6062
 
5634
6063
  // src/utils/open-url.ts
5635
6064
  var nodePrefix = "node:";
@@ -5769,6 +6198,11 @@ var pathConfig = {
5769
6198
  "/tables": {
5770
6199
  authHeader: "Authorization",
5771
6200
  pathPrefix: "/api/v0/sdk/tables"
6201
+ },
6202
+ // e.g. /trigger-inbox -> https://sdkapi.zapier.com/api/v0/sdk/trigger-inbox/...
6203
+ "/trigger-inbox": {
6204
+ authHeader: "Authorization",
6205
+ pathPrefix: "/api/v0/sdk/trigger-inbox"
5772
6206
  }
5773
6207
  };
5774
6208
  var ZapierApiClient = class {
@@ -5831,7 +6265,7 @@ var ZapierApiClient = class {
5831
6265
  method: init?.method ?? "GET",
5832
6266
  rateLimit: rateLimitInfo
5833
6267
  });
5834
- await sleep(delayMs);
6268
+ await sleep(delayMs, init?.signal ?? void 0);
5835
6269
  }
5836
6270
  };
5837
6271
  /**
@@ -5939,14 +6373,16 @@ var ZapierApiClient = class {
5939
6373
  fetchPoll: () => this.fetch(path, {
5940
6374
  method: "GET",
5941
6375
  searchParams: options.searchParams,
5942
- authRequired: options.authRequired
6376
+ authRequired: options.authRequired,
6377
+ signal: options.signal
5943
6378
  }),
5944
6379
  initialDelay: options.initialDelay,
5945
6380
  timeoutMs: options.timeoutMs,
5946
6381
  successStatus: options.successStatus,
5947
6382
  pendingStatus: options.pendingStatus,
5948
6383
  isPending: options.isPending,
5949
- resultExtractor: options.resultExtractor
6384
+ resultExtractor: options.resultExtractor,
6385
+ signal: options.signal
5950
6386
  });
5951
6387
  };
5952
6388
  this.maxNetworkRetries = options.maxNetworkRetries ?? ZAPIER_MAX_NETWORK_RETRIES;
@@ -6908,6 +7344,7 @@ var createTableFieldsPlugin = definePlugin(
6908
7344
  name: "createTableFields",
6909
7345
  type: "create",
6910
7346
  itemType: "Field",
7347
+ returnType: "FieldItem[]",
6911
7348
  inputSchema: CreateTableFieldsOptionsInputSchema,
6912
7349
  outputSchema: FieldItemSchema,
6913
7350
  resolvers: { table: tableIdResolver, fields: tableFieldsResolver },
@@ -7245,6 +7682,7 @@ var createTableRecordsPlugin = definePlugin(
7245
7682
  name: "createTableRecords",
7246
7683
  type: "create",
7247
7684
  itemType: "Record",
7685
+ returnType: "RecordItem[]",
7248
7686
  inputSchema: CreateTableRecordsOptionsInputSchema,
7249
7687
  outputSchema: RecordItemSchema,
7250
7688
  resolvers: { table: tableIdResolver, records: tableRecordsResolver },
@@ -7356,6 +7794,7 @@ var updateTableRecordsPlugin = definePlugin(
7356
7794
  name: "updateTableRecords",
7357
7795
  type: "update",
7358
7796
  itemType: "Record",
7797
+ returnType: "RecordItem[]",
7359
7798
  inputSchema: UpdateTableRecordsOptionsInputSchema,
7360
7799
  outputSchema: RecordItemSchema,
7361
7800
  resolvers: {
@@ -7411,6 +7850,7 @@ var categoryDefinitions = {
7411
7850
  titlePlural: "Client Credentials"
7412
7851
  },
7413
7852
  table: { title: "Table" },
7853
+ trigger: { title: "Trigger" },
7414
7854
  http: { title: "HTTP Request" },
7415
7855
  utility: { title: "Utility", titlePlural: "Utilities" },
7416
7856
  other: { title: "Other" }
@@ -7441,6 +7881,7 @@ function buildRegistry({
7441
7881
  categories: m.categories || [],
7442
7882
  resolvers: m.resolvers,
7443
7883
  formatter: m.formatter,
7884
+ experimental: m.experimental,
7444
7885
  packages: m.packages,
7445
7886
  confirm: m.confirm ?? (m.type === "delete" ? "delete" : void 0),
7446
7887
  deprecation: m.deprecation,
@@ -7470,361 +7911,122 @@ function buildRegistry({
7470
7911
  return { functions: filteredFunctions, categories: filteredCategories };
7471
7912
  }
7472
7913
 
7473
- // src/plugins/deprecated/authentications.ts
7474
- var listAuthenticationsPlugin = definePlugin(
7475
- (sdk) => ({
7476
- listAuthentications: sdk.listConnections,
7477
- context: {
7478
- meta: {
7479
- listAuthentications: {
7480
- packages: ["cli", "mcp"],
7481
- categories: ["connection", "deprecated"],
7482
- type: "list",
7483
- itemType: "Connection",
7484
- inputSchema: ListConnectionsQuerySchema,
7485
- outputSchema: ConnectionItemSchema
7486
- }
7487
- }
7488
- }
7489
- })
7490
- );
7491
- var getAuthenticationPlugin = definePlugin(
7492
- (sdk) => ({
7493
- getAuthentication: sdk.getConnection,
7494
- context: {
7495
- meta: {
7496
- getAuthentication: {
7497
- packages: ["cli", "mcp"],
7498
- categories: ["connection", "deprecated"],
7499
- type: "item",
7500
- itemType: "Connection",
7501
- inputSchema: GetConnectionParamSchema,
7502
- outputSchema: ConnectionItemSchema
7503
- }
7504
- }
7505
- }
7506
- })
7507
- );
7508
- var findFirstAuthenticationPlugin = definePlugin(
7509
- (sdk) => ({
7510
- findFirstAuthentication: sdk.findFirstConnection,
7511
- context: {
7512
- meta: {
7513
- findFirstAuthentication: {
7514
- packages: ["cli", "mcp"],
7515
- categories: ["connection", "deprecated"],
7516
- type: "item",
7517
- itemType: "Connection",
7518
- inputSchema: FindFirstConnectionSchema,
7519
- outputSchema: ConnectionItemSchema
7520
- }
7521
- }
7522
- }
7523
- })
7524
- );
7525
- var findUniqueAuthenticationPlugin = definePlugin(
7526
- (sdk) => ({
7527
- findUniqueAuthentication: sdk.findUniqueConnection,
7528
- context: {
7529
- meta: {
7530
- findUniqueAuthentication: {
7531
- packages: ["cli", "mcp"],
7532
- categories: ["connection", "deprecated"],
7533
- type: "item",
7534
- itemType: "Connection",
7535
- inputSchema: FindUniqueConnectionSchema,
7536
- outputSchema: ConnectionItemSchema
7537
- }
7538
- }
7539
- }
7540
- })
7541
- );
7542
- var GetInputFieldsSchemaDescription = "Get the JSON Schema representation of input fields for an action. Returns a JSON Schema object describing the structure, types, and validation rules for the action's input parameters.";
7543
- var GetInputFieldsSchemaBaseSchema = z.object({
7544
- connection: ConnectionPropertySchema.optional().describe(
7545
- "Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId."
7546
- ),
7547
- connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
7548
- "Connection ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7549
- ).meta({ deprecated: true }),
7550
- /** @deprecated Use connection instead */
7551
- authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
7552
- "Authentication ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7553
- ).meta({ deprecated: true }),
7554
- inputs: InputsPropertySchema.optional().describe(
7555
- "Current input values that may affect the schema (e.g., when fields depend on other field values)"
7556
- )
7557
- });
7558
- var GetInputFieldsSchemaSchema = z.object({
7559
- app: AppPropertySchema.describe(
7560
- "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
7561
- ),
7562
- actionType: ActionTypePropertySchema.describe(
7563
- "Action type that matches the action's defined type"
7564
- ),
7565
- action: ActionPropertySchema.describe(
7566
- "Action key to get the input schema for"
7567
- )
7568
- }).merge(GetInputFieldsSchemaBaseSchema).describe(GetInputFieldsSchemaDescription).meta({
7569
- aliases: {
7570
- appKey: "app",
7571
- actionKey: "action",
7572
- connectionId: "connection",
7573
- authenticationId: "connection"
7574
- }
7575
- });
7576
- var GetInputFieldsSchemaSchemaDeprecated = z.object({
7577
- appKey: AppKeyPropertySchema.describe(
7578
- "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
7579
- ),
7580
- actionType: ActionTypePropertySchema.describe(
7581
- "Action type that matches the action's defined type"
7582
- ),
7583
- actionKey: ActionKeyPropertySchema.describe(
7584
- "Action key to get the input schema for"
7585
- )
7586
- }).merge(GetInputFieldsSchemaBaseSchema);
7587
- var GetInputFieldsSchemaInputSchema = z.union([GetInputFieldsSchemaSchema, GetInputFieldsSchemaSchemaDeprecated]).describe(GetInputFieldsSchemaDescription);
7588
-
7589
- // src/plugins/getInputFieldsSchema/index.ts
7590
- var getInputFieldsSchemaPlugin = definePlugin(
7591
- (sdk) => createPluginMethod(sdk, {
7592
- name: "getInputFieldsSchema",
7593
- categories: ["action"],
7594
- type: "item",
7595
- itemType: "InputSchema",
7596
- inputSchema: GetInputFieldsSchemaInputSchema,
7597
- resolvers: {
7598
- app: appKeyResolver,
7599
- actionType: actionTypeResolver,
7600
- action: actionKeyResolver,
7601
- connection: connectionIdResolver,
7602
- inputs: inputsAllOptionalResolver
7603
- },
7604
- handler: async ({
7605
- sdk: sdk2,
7606
- options
7607
- }) => {
7608
- const { api, getVersionedImplementationId } = sdk2.context;
7609
- const appKey = "app" in options ? options.app : options.appKey;
7610
- const actionKey = "action" in options ? options.action : options.actionKey;
7611
- const {
7612
- actionType,
7613
- connection,
7614
- connectionId,
7615
- authenticationId,
7616
- inputs
7617
- } = options;
7618
- const resolvedConnectionId = await resolveConnectionId({
7619
- connection,
7620
- connectionId,
7621
- authenticationId,
7622
- resolveConnection: sdk2.context.resolveConnection
7623
- });
7624
- const selectedApi = await getVersionedImplementationId(appKey);
7625
- if (!selectedApi) {
7626
- throw new ZapierConfigurationError(
7627
- "No current_implementation_id found for app",
7628
- { configType: "current_implementation_id" }
7629
- );
7914
+ // src/plugins/deprecated/authentications.ts
7915
+ var listAuthenticationsPlugin = definePlugin(
7916
+ (sdk) => ({
7917
+ listAuthentications: sdk.listConnections,
7918
+ context: {
7919
+ meta: {
7920
+ listAuthentications: {
7921
+ packages: ["cli", "mcp"],
7922
+ categories: ["connection", "deprecated"],
7923
+ type: "list",
7924
+ itemType: "Connection",
7925
+ inputSchema: ListConnectionsQuerySchema,
7926
+ outputSchema: ConnectionItemSchema
7927
+ }
7630
7928
  }
7631
- setMethodMetadata({
7632
- selectedApi,
7633
- operationType: actionType,
7634
- operationKey: actionKey
7635
- });
7636
- const { data: action } = await sdk2.getAction({
7637
- app: appKey,
7638
- actionType,
7639
- action: actionKey
7640
- });
7641
- const needsData = await fetchImplementationNeeds({
7642
- api,
7643
- selectedApi,
7644
- action: action.key,
7645
- actionType,
7646
- connectionId: resolvedConnectionId ?? null,
7647
- inputs
7648
- });
7649
- return { data: needsData.schema || {} };
7650
7929
  }
7651
7930
  })
7652
7931
  );
7653
- var InputFieldChoiceItemSchema = withFormatter(NeedChoicesSchema, {
7654
- format: (item) => {
7655
- const title = item.label || item.key || "Choice";
7656
- const details = [];
7657
- if (item.label && item.key && item.label !== item.key) {
7658
- details.push({ text: `Key: ${item.key}`, style: "dim" });
7932
+ var getAuthenticationPlugin = definePlugin(
7933
+ (sdk) => ({
7934
+ getAuthentication: sdk.getConnection,
7935
+ context: {
7936
+ meta: {
7937
+ getAuthentication: {
7938
+ packages: ["cli", "mcp"],
7939
+ categories: ["connection", "deprecated"],
7940
+ type: "item",
7941
+ itemType: "Connection",
7942
+ inputSchema: GetConnectionParamSchema,
7943
+ outputSchema: ConnectionItemSchema
7944
+ }
7945
+ }
7659
7946
  }
7660
- if (item.sample && item.sample !== item.key) {
7661
- details.push({ text: `Sample: ${item.sample}`, style: "dim" });
7947
+ })
7948
+ );
7949
+ var findFirstAuthenticationPlugin = definePlugin(
7950
+ (sdk) => ({
7951
+ findFirstAuthentication: sdk.findFirstConnection,
7952
+ context: {
7953
+ meta: {
7954
+ findFirstAuthentication: {
7955
+ packages: ["cli", "mcp"],
7956
+ categories: ["connection", "deprecated"],
7957
+ type: "item",
7958
+ itemType: "Connection",
7959
+ inputSchema: FindFirstConnectionSchema,
7960
+ outputSchema: ConnectionItemSchema
7961
+ }
7962
+ }
7662
7963
  }
7663
- if (item.value && item.value !== item.key) {
7664
- details.push({ text: `Value: ${item.value}`, style: "normal" });
7964
+ })
7965
+ );
7966
+ var findUniqueAuthenticationPlugin = definePlugin(
7967
+ (sdk) => ({
7968
+ findUniqueAuthentication: sdk.findUniqueConnection,
7969
+ context: {
7970
+ meta: {
7971
+ findUniqueAuthentication: {
7972
+ packages: ["cli", "mcp"],
7973
+ categories: ["connection", "deprecated"],
7974
+ type: "item",
7975
+ itemType: "Connection",
7976
+ inputSchema: FindUniqueConnectionSchema,
7977
+ outputSchema: ConnectionItemSchema
7978
+ }
7979
+ }
7665
7980
  }
7666
- return {
7667
- title,
7668
- key: item.key,
7669
- details
7670
- };
7671
- }
7672
- });
7673
- var ListInputFieldChoicesDescription = "Get the available choices for a dynamic dropdown input field";
7674
- var ListInputFieldChoicesBaseSchema = z.object({
7675
- connection: ConnectionPropertySchema.optional().describe(
7676
- "Connection alias or connection ID (UUID or positive integer). Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly. Mutually exclusive with connectionId."
7677
- ),
7678
- connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
7679
- "Connection ID to use when listing available field choices. Required if the action needs a connection to populate dynamic dropdown options."
7680
- ).meta({ deprecated: true }),
7681
- /** @deprecated Use connection instead */
7682
- authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
7683
- inputs: InputsPropertySchema.optional().describe(
7684
- "Current input values that may affect available choices"
7685
- ),
7686
- page: z.number().int().min(0).optional().describe("Page number for paginated results"),
7687
- pageSize: z.number().min(1).optional().describe("Number of choices per page"),
7688
- maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
7689
- cursor: z.string().optional().describe("Cursor to start from")
7690
- });
7691
- var ListInputFieldChoicesSchema = z.object({
7692
- app: AppPropertySchema,
7693
- actionType: ActionTypePropertySchema,
7694
- action: ActionPropertySchema,
7695
- inputField: InputFieldPropertySchema
7696
- }).merge(ListInputFieldChoicesBaseSchema).describe(ListInputFieldChoicesDescription).meta({
7697
- aliases: {
7698
- appKey: "app",
7699
- actionKey: "action",
7700
- inputFieldKey: "inputField",
7701
- connectionId: "connection",
7702
- authenticationId: "connection"
7703
- }
7704
- });
7705
- var ListInputFieldChoicesSchemaDeprecated = z.object({
7706
- appKey: AppKeyPropertySchema,
7707
- actionType: ActionTypePropertySchema,
7708
- actionKey: ActionKeyPropertySchema,
7709
- inputFieldKey: z.string().min(1).describe("Input field key to get choices for.")
7710
- }).merge(ListInputFieldChoicesBaseSchema);
7711
- var ListInputFieldChoicesInputSchema = z.union([ListInputFieldChoicesSchema, ListInputFieldChoicesSchemaDeprecated]).describe(ListInputFieldChoicesDescription);
7981
+ })
7982
+ );
7712
7983
 
7713
- // src/plugins/listInputFieldChoices/index.ts
7714
- function transformNeedChoicesToInputFieldChoiceItem(choice) {
7715
- return {
7716
- key: choice.key,
7717
- label: choice.label,
7718
- sample: choice.sample,
7719
- value: choice.value
7720
- };
7721
- }
7722
- var listInputFieldChoicesPlugin = definePlugin(
7723
- (sdk) => createPaginatedPluginMethod(sdk, {
7724
- name: "listInputFieldChoices",
7725
- categories: ["action"],
7726
- type: "list",
7727
- itemType: "InputFieldChoice",
7728
- inputSchema: ListInputFieldChoicesInputSchema,
7729
- outputSchema: InputFieldChoiceItemSchema,
7730
- defaultPageSize: DEFAULT_PAGE_SIZE,
7731
- resolvers: {
7732
- app: appKeyResolver,
7733
- actionType: actionTypeResolver,
7734
- action: actionKeyResolver,
7735
- connection: connectionIdResolver,
7736
- inputField: inputFieldKeyResolver,
7737
- inputs: inputsAllOptionalResolver
7738
- },
7739
- handler: async ({
7740
- sdk: sdk2,
7741
- options
7742
- }) => {
7743
- const { api, getVersionedImplementationId } = sdk2.context;
7744
- const appKey = "app" in options ? options.app : options.appKey;
7745
- const actionKey = "action" in options ? options.action : options.actionKey;
7746
- const inputFieldKey = "inputField" in options ? options.inputField : options.inputFieldKey;
7747
- const {
7748
- actionType,
7749
- connection,
7750
- connectionId,
7751
- authenticationId,
7752
- inputs,
7753
- page,
7754
- cursor
7755
- } = options;
7756
- const resolvedConnectionId = await resolveConnectionId({
7757
- connection,
7758
- connectionId,
7759
- authenticationId,
7760
- resolveConnection: sdk2.context.resolveConnection
7761
- });
7762
- const selectedApi = await getVersionedImplementationId(appKey);
7763
- if (!selectedApi) {
7764
- throw new ZapierConfigurationError(
7765
- "No current_implementation_id found for app",
7766
- { configType: "current_implementation_id" }
7767
- );
7768
- }
7769
- setMethodMetadata({
7770
- selectedApi,
7771
- operationType: actionType,
7772
- operationKey: actionKey
7773
- });
7774
- const { data: action } = await sdk2.getAction({
7775
- app: appKey,
7776
- actionType,
7777
- action: actionKey
7778
- });
7779
- const needsData = await fetchImplementationNeeds({
7780
- api,
7781
- selectedApi,
7782
- action: action.key,
7783
- actionType,
7784
- connectionId: resolvedConnectionId ?? null,
7785
- inputs
7786
- });
7787
- const targetNeed = needsData.needs?.find(
7788
- (need) => need.key === inputFieldKey
7789
- );
7790
- if (targetNeed?.choices && targetNeed.choices.length > 0) {
7791
- return {
7792
- data: targetNeed.choices.map(
7793
- transformNeedChoicesToInputFieldChoiceItem
7794
- )
7795
- };
7984
+ // src/plugins/deprecated/inputFields.ts
7985
+ var listInputFieldsDeprecatedPlugin = definePlugin(
7986
+ (sdk) => ({
7987
+ listInputFields: sdk.listActionInputFields,
7988
+ context: {
7989
+ meta: {
7990
+ listInputFields: {
7991
+ categories: ["action", "deprecated"],
7992
+ type: "list",
7993
+ itemType: "RootField",
7994
+ inputSchema: ListActionInputFieldsInputSchema,
7995
+ outputSchema: RootFieldItemSchema,
7996
+ defaultPageSize: DEFAULT_PAGE_SIZE
7997
+ }
7796
7998
  }
7797
- if (!action.id) {
7798
- throw new ZapierApiError(
7799
- `Action ${actionKey} does not have an ID - cannot retrieve input field choices`
7800
- );
7999
+ }
8000
+ })
8001
+ );
8002
+ var listInputFieldChoicesDeprecatedPlugin = definePlugin(
8003
+ (sdk) => ({
8004
+ listInputFieldChoices: sdk.listActionInputFieldChoices,
8005
+ context: {
8006
+ meta: {
8007
+ listInputFieldChoices: {
8008
+ categories: ["action", "deprecated"],
8009
+ type: "list",
8010
+ itemType: "InputFieldChoiceItem",
8011
+ inputSchema: ListActionInputFieldChoicesInputSchema,
8012
+ outputSchema: InputFieldChoiceItemSchema,
8013
+ defaultPageSize: DEFAULT_PAGE_SIZE
8014
+ }
7801
8015
  }
7802
- const requestPage = cursor ? parseInt(cursor, 10) : page ?? 0;
7803
- const choicesData = await fetchImplementationChoices({
7804
- api,
7805
- actionId: action.id,
7806
- inputFieldId: inputFieldKey,
7807
- connectionId: resolvedConnectionId ?? null,
7808
- inputs,
7809
- page: requestPage
7810
- });
7811
- const choices = (choicesData.choices || []).map(
7812
- transformNeedChoicesToInputFieldChoiceItem
7813
- );
7814
- let nextCursor;
7815
- if (choicesData.next_page != null) {
7816
- nextCursor = choicesData.next_page.toString();
7817
- } else if (choicesData.links?.next) {
7818
- try {
7819
- const nextUrl = new URL(choicesData.links.next);
7820
- const nextPage = nextUrl.searchParams.get("page");
7821
- if (nextPage) {
7822
- nextCursor = nextPage;
7823
- }
7824
- } catch {
8016
+ }
8017
+ })
8018
+ );
8019
+ var getInputFieldsSchemaDeprecatedPlugin = definePlugin(
8020
+ (sdk) => ({
8021
+ getInputFieldsSchema: sdk.getActionInputFieldsSchema,
8022
+ context: {
8023
+ meta: {
8024
+ getInputFieldsSchema: {
8025
+ categories: ["action", "deprecated"],
8026
+ type: "function",
8027
+ inputSchema: GetActionInputFieldsSchemaInputSchema
7825
8028
  }
7826
8029
  }
7827
- return { data: choices, nextCursor };
7828
8030
  }
7829
8031
  })
7830
8032
  );
@@ -8477,7 +8679,7 @@ function buildSdk(properties, context) {
8477
8679
  }
8478
8680
  return registryCache.get(cacheKey);
8479
8681
  },
8480
- addPlugin(plugin) {
8682
+ addPlugin(plugin, options) {
8481
8683
  const pluginResult = plugin({
8482
8684
  ...properties,
8483
8685
  context: frozenContext
@@ -8494,10 +8696,10 @@ function buildSdk(properties, context) {
8494
8696
  for (const key of Object.keys(pluginContextRest)) {
8495
8697
  if (key in existingContext) collisions.push(`context.${key}`);
8496
8698
  }
8497
- if (collisions.length > 0) {
8699
+ if (collisions.length > 0 && !options?.override) {
8498
8700
  const name = plugin.name || "anonymous plugin";
8499
8701
  console.warn(
8500
- `[zapier-sdk] Skipping "${name}" \u2014 duplicate registration of: ${collisions.join(", ")}. If the duplicate is intentional, wrap with composePlugins(...). Otherwise rename the method or remove the duplicate.`
8702
+ `[zapier-sdk] Skipping "${name}" \u2014 duplicate registration of: ${collisions.join(", ")}. If the duplicate is intentional, pass { override: true } to addPlugin or wrap with composePlugins(...). Otherwise rename the method or remove the duplicate.`
8501
8703
  );
8502
8704
  return buildSdk(properties, context);
8503
8705
  }
@@ -8522,7 +8724,7 @@ function createZapierSdkWithoutRegistry(options = {}) {
8522
8724
  return createZapierSdk(options);
8523
8725
  }
8524
8726
  function createZapierSdk(options = {}) {
8525
- return createSdk().addPlugin(createOptionsPlugin(options)).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(capabilitiesPlugin).addPlugin(connectionsPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listConnectionsPlugin).addPlugin(getConnectionPlugin).addPlugin(findFirstConnectionPlugin).addPlugin(findUniqueConnectionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(listTablesPlugin).addPlugin(getTablePlugin).addPlugin(deleteTablePlugin).addPlugin(createTablePlugin).addPlugin(listTableFieldsPlugin).addPlugin(createTableFieldsPlugin).addPlugin(deleteTableFieldsPlugin).addPlugin(getTableRecordPlugin).addPlugin(listTableRecordsPlugin).addPlugin(createTableRecordsPlugin).addPlugin(deleteTableRecordsPlugin).addPlugin(updateTableRecordsPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
8727
+ return createSdk().addPlugin(createOptionsPlugin(options)).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(capabilitiesPlugin).addPlugin(connectionsPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listActionInputFieldsPlugin).addPlugin(getActionInputFieldsSchemaPlugin).addPlugin(listActionInputFieldChoicesPlugin).addPlugin(listInputFieldsDeprecatedPlugin).addPlugin(getInputFieldsSchemaDeprecatedPlugin).addPlugin(listInputFieldChoicesDeprecatedPlugin).addPlugin(runActionPlugin).addPlugin(listConnectionsPlugin).addPlugin(getConnectionPlugin).addPlugin(findFirstConnectionPlugin).addPlugin(findUniqueConnectionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(listTablesPlugin).addPlugin(getTablePlugin).addPlugin(deleteTablePlugin).addPlugin(createTablePlugin).addPlugin(listTableFieldsPlugin).addPlugin(createTableFieldsPlugin).addPlugin(deleteTableFieldsPlugin).addPlugin(getTableRecordPlugin).addPlugin(listTableRecordsPlugin).addPlugin(createTableRecordsPlugin).addPlugin(deleteTableRecordsPlugin).addPlugin(updateTableRecordsPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
8526
8728
  }
8527
8729
  var BaseSdkOptionsSchema = z.object({
8528
8730
  credentials: CredentialsSchema.optional().describe(
@@ -8576,4 +8778,4 @@ var registryPlugin = definePlugin((_sdk) => {
8576
8778
  return {};
8577
8779
  });
8578
8780
 
8579
- 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, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, definePlugin, 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 };
8781
+ 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, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createMemoryCache, createOptionsPlugin, createPaginatedPluginMethod, createPluginMethod, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, definePlugin, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionInputFieldsSchemaPlugin, 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, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, 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, triggerInboxResolver, updateTableRecordsPlugin };