@zapier/zapier-sdk 0.39.0 → 0.40.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 (192) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/CLAUDE.md +12 -14
  3. package/README.md +186 -192
  4. package/dist/api/schemas.d.ts +2 -2
  5. package/dist/api/schemas.js +3 -3
  6. package/dist/formatters/tableRecord.js +1 -1
  7. package/dist/index.cjs +652 -377
  8. package/dist/index.d.mts +468 -53
  9. package/dist/index.mjs +643 -378
  10. package/dist/plugins/apps/index.d.ts +1 -1
  11. package/dist/plugins/apps/index.d.ts.map +1 -1
  12. package/dist/plugins/apps/index.js +4 -8
  13. package/dist/plugins/apps/schemas.d.ts +2 -1
  14. package/dist/plugins/apps/schemas.d.ts.map +1 -1
  15. package/dist/plugins/apps/schemas.js +24 -8
  16. package/dist/plugins/fetch/index.d.ts +4 -2
  17. package/dist/plugins/fetch/index.d.ts.map +1 -1
  18. package/dist/plugins/fetch/index.js +1 -3
  19. package/dist/plugins/fetch/schemas.d.ts.map +1 -1
  20. package/dist/plugins/fetch/schemas.js +11 -4
  21. package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
  22. package/dist/plugins/findFirstConnection/index.js +0 -1
  23. package/dist/plugins/findFirstConnection/schemas.d.ts +4 -1
  24. package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -1
  25. package/dist/plugins/findFirstConnection/schemas.js +2 -0
  26. package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
  27. package/dist/plugins/findUniqueConnection/index.js +0 -1
  28. package/dist/plugins/findUniqueConnection/schemas.d.ts +4 -1
  29. package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -1
  30. package/dist/plugins/findUniqueConnection/schemas.js +2 -0
  31. package/dist/plugins/getAction/index.d.ts.map +1 -1
  32. package/dist/plugins/getAction/index.js +8 -6
  33. package/dist/plugins/getAction/schemas.d.ts +58 -1
  34. package/dist/plugins/getAction/schemas.d.ts.map +1 -1
  35. package/dist/plugins/getAction/schemas.js +16 -4
  36. package/dist/plugins/getApp/index.d.ts.map +1 -1
  37. package/dist/plugins/getApp/index.js +6 -5
  38. package/dist/plugins/getApp/schemas.d.ts +19 -1
  39. package/dist/plugins/getApp/schemas.d.ts.map +1 -1
  40. package/dist/plugins/getApp/schemas.js +14 -4
  41. package/dist/plugins/getConnection/index.d.ts.map +1 -1
  42. package/dist/plugins/getConnection/index.js +3 -5
  43. package/dist/plugins/getConnection/schemas.d.ts +1 -0
  44. package/dist/plugins/getConnection/schemas.d.ts.map +1 -1
  45. package/dist/plugins/getConnection/schemas.js +11 -5
  46. package/dist/plugins/getInputFieldsSchema/index.d.ts +2 -1
  47. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
  48. package/dist/plugins/getInputFieldsSchema/index.js +18 -12
  49. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +71 -1
  50. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -1
  51. package/dist/plugins/getInputFieldsSchema/schemas.js +39 -10
  52. package/dist/plugins/listActions/index.d.ts.map +1 -1
  53. package/dist/plugins/listActions/index.js +5 -4
  54. package/dist/plugins/listActions/schemas.d.ts +58 -1
  55. package/dist/plugins/listActions/schemas.d.ts.map +1 -1
  56. package/dist/plugins/listActions/schemas.js +25 -12
  57. package/dist/plugins/listApps/index.js +1 -1
  58. package/dist/plugins/listApps/schemas.d.ts +1 -0
  59. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  60. package/dist/plugins/listApps/schemas.js +6 -1
  61. package/dist/plugins/listConnections/index.d.ts +2 -1
  62. package/dist/plugins/listConnections/index.d.ts.map +1 -1
  63. package/dist/plugins/listConnections/index.js +27 -14
  64. package/dist/plugins/listConnections/schemas.d.ts +5 -0
  65. package/dist/plugins/listConnections/schemas.d.ts.map +1 -1
  66. package/dist/plugins/listConnections/schemas.js +22 -9
  67. package/dist/plugins/listInputFieldChoices/index.d.ts +2 -2
  68. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
  69. package/dist/plugins/listInputFieldChoices/index.js +21 -15
  70. package/dist/plugins/listInputFieldChoices/schemas.d.ts +92 -1
  71. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
  72. package/dist/plugins/listInputFieldChoices/schemas.js +47 -23
  73. package/dist/plugins/listInputFields/index.d.ts +2 -1
  74. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  75. package/dist/plugins/listInputFields/index.js +18 -13
  76. package/dist/plugins/listInputFields/schemas.d.ts +80 -1
  77. package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
  78. package/dist/plugins/listInputFields/schemas.js +40 -11
  79. package/dist/plugins/manifest/schemas.d.ts.map +1 -1
  80. package/dist/plugins/manifest/schemas.js +4 -2
  81. package/dist/plugins/registry/index.d.ts.map +1 -1
  82. package/dist/plugins/registry/index.js +0 -1
  83. package/dist/plugins/request/index.d.ts.map +1 -1
  84. package/dist/plugins/request/index.js +2 -5
  85. package/dist/plugins/request/schemas.d.ts +2 -0
  86. package/dist/plugins/request/schemas.d.ts.map +1 -1
  87. package/dist/plugins/request/schemas.js +13 -5
  88. package/dist/plugins/runAction/index.d.ts.map +1 -1
  89. package/dist/plugins/runAction/index.js +17 -15
  90. package/dist/plugins/runAction/schemas.d.ts +83 -2
  91. package/dist/plugins/runAction/schemas.d.ts.map +1 -1
  92. package/dist/plugins/runAction/schemas.js +41 -17
  93. package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
  94. package/dist/plugins/tables/createTableFields/index.js +5 -4
  95. package/dist/plugins/tables/createTableFields/schemas.d.ts +128 -2
  96. package/dist/plugins/tables/createTableFields/schemas.d.ts.map +1 -1
  97. package/dist/plugins/tables/createTableFields/schemas.js +23 -7
  98. package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
  99. package/dist/plugins/tables/createTableRecords/index.js +7 -6
  100. package/dist/plugins/tables/createTableRecords/schemas.d.ts +38 -2
  101. package/dist/plugins/tables/createTableRecords/schemas.d.ts.map +1 -1
  102. package/dist/plugins/tables/createTableRecords/schemas.js +23 -7
  103. package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
  104. package/dist/plugins/tables/deleteTable/index.js +5 -4
  105. package/dist/plugins/tables/deleteTable/schemas.d.ts +17 -1
  106. package/dist/plugins/tables/deleteTable/schemas.d.ts.map +1 -1
  107. package/dist/plugins/tables/deleteTable/schemas.js +14 -2
  108. package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
  109. package/dist/plugins/tables/deleteTableFields/index.js +9 -7
  110. package/dist/plugins/tables/deleteTableFields/schemas.d.ts +22 -1
  111. package/dist/plugins/tables/deleteTableFields/schemas.d.ts.map +1 -1
  112. package/dist/plugins/tables/deleteTableFields/schemas.js +18 -2
  113. package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
  114. package/dist/plugins/tables/deleteTableRecords/index.js +7 -5
  115. package/dist/plugins/tables/deleteTableRecords/schemas.d.ts +22 -1
  116. package/dist/plugins/tables/deleteTableRecords/schemas.d.ts.map +1 -1
  117. package/dist/plugins/tables/deleteTableRecords/schemas.js +18 -2
  118. package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
  119. package/dist/plugins/tables/getTable/index.js +6 -5
  120. package/dist/plugins/tables/getTable/schemas.d.ts +16 -1
  121. package/dist/plugins/tables/getTable/schemas.d.ts.map +1 -1
  122. package/dist/plugins/tables/getTable/schemas.js +14 -2
  123. package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
  124. package/dist/plugins/tables/getTableRecord/index.js +9 -7
  125. package/dist/plugins/tables/getTableRecord/schemas.d.ts +39 -2
  126. package/dist/plugins/tables/getTableRecord/schemas.d.ts.map +1 -1
  127. package/dist/plugins/tables/getTableRecord/schemas.js +20 -5
  128. package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
  129. package/dist/plugins/tables/listTableFields/index.js +10 -8
  130. package/dist/plugins/tables/listTableFields/schemas.d.ts +27 -2
  131. package/dist/plugins/tables/listTableFields/schemas.d.ts.map +1 -1
  132. package/dist/plugins/tables/listTableFields/schemas.js +24 -8
  133. package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
  134. package/dist/plugins/tables/listTableRecords/index.js +7 -6
  135. package/dist/plugins/tables/listTableRecords/schemas.d.ts +119 -2
  136. package/dist/plugins/tables/listTableRecords/schemas.d.ts.map +1 -1
  137. package/dist/plugins/tables/listTableRecords/schemas.js +23 -7
  138. package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
  139. package/dist/plugins/tables/listTables/index.js +3 -2
  140. package/dist/plugins/tables/listTables/schemas.d.ts +5 -1
  141. package/dist/plugins/tables/listTables/schemas.d.ts.map +1 -1
  142. package/dist/plugins/tables/listTables/schemas.js +4 -1
  143. package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
  144. package/dist/plugins/tables/updateTableRecords/index.js +7 -6
  145. package/dist/plugins/tables/updateTableRecords/schemas.d.ts +41 -2
  146. package/dist/plugins/tables/updateTableRecords/schemas.d.ts.map +1 -1
  147. package/dist/plugins/tables/updateTableRecords/schemas.js +23 -7
  148. package/dist/resolvers/actionKey.d.ts +1 -1
  149. package/dist/resolvers/actionKey.d.ts.map +1 -1
  150. package/dist/resolvers/actionKey.js +3 -3
  151. package/dist/resolvers/actionType.d.ts +1 -1
  152. package/dist/resolvers/actionType.d.ts.map +1 -1
  153. package/dist/resolvers/actionType.js +2 -2
  154. package/dist/resolvers/connectionId.d.ts +1 -1
  155. package/dist/resolvers/connectionId.d.ts.map +1 -1
  156. package/dist/resolvers/connectionId.js +9 -9
  157. package/dist/resolvers/inputFieldKey.d.ts +3 -3
  158. package/dist/resolvers/inputFieldKey.d.ts.map +1 -1
  159. package/dist/resolvers/inputFieldKey.js +6 -6
  160. package/dist/resolvers/inputs.d.ts +3 -3
  161. package/dist/resolvers/inputs.d.ts.map +1 -1
  162. package/dist/resolvers/inputs.js +8 -8
  163. package/dist/resolvers/tableFieldIds.d.ts +1 -1
  164. package/dist/resolvers/tableFieldIds.d.ts.map +1 -1
  165. package/dist/resolvers/tableFieldIds.js +3 -3
  166. package/dist/resolvers/tableFilters.d.ts +1 -1
  167. package/dist/resolvers/tableFilters.d.ts.map +1 -1
  168. package/dist/resolvers/tableFilters.js +4 -4
  169. package/dist/resolvers/tableId.js +1 -1
  170. package/dist/resolvers/tableRecordId.d.ts +2 -2
  171. package/dist/resolvers/tableRecordId.d.ts.map +1 -1
  172. package/dist/resolvers/tableRecordId.js +5 -5
  173. package/dist/resolvers/tableRecords.d.ts +2 -2
  174. package/dist/resolvers/tableRecords.d.ts.map +1 -1
  175. package/dist/resolvers/tableRecords.js +6 -6
  176. package/dist/resolvers/tableSort.d.ts +1 -1
  177. package/dist/resolvers/tableSort.d.ts.map +1 -1
  178. package/dist/resolvers/tableSort.js +2 -2
  179. package/dist/services/implementations.d.ts.map +1 -1
  180. package/dist/services/implementations.js +2 -3
  181. package/dist/types/properties.d.ts +30 -0
  182. package/dist/types/properties.d.ts.map +1 -1
  183. package/dist/types/properties.js +34 -1
  184. package/dist/types/sdk.d.ts +0 -2
  185. package/dist/types/sdk.d.ts.map +1 -1
  186. package/dist/utils/domain-utils.d.ts +5 -0
  187. package/dist/utils/domain-utils.d.ts.map +1 -1
  188. package/dist/utils/domain-utils.js +17 -3
  189. package/dist/utils/id-utils.d.ts +2 -0
  190. package/dist/utils/id-utils.d.ts.map +1 -1
  191. package/dist/utils/id-utils.js +2 -0
  192. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -63,6 +63,11 @@ var ZAPIER_MAX_NETWORK_RETRY_DELAY_MS = parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRY
63
63
  var AppKeyPropertySchema = withPositional(
64
64
  z.string().min(1).describe("App key (e.g., 'SlackCLIAPI' or slug like 'github')")
65
65
  );
66
+ var AppPropertySchema = withPositional(
67
+ z.string().min(1).describe(
68
+ "App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3')"
69
+ )
70
+ );
66
71
  var ActionTypePropertySchema = z.enum([
67
72
  "read",
68
73
  "read_bulk",
@@ -74,8 +79,16 @@ var ActionTypePropertySchema = z.enum([
74
79
  "filter"
75
80
  ]).describe("Action type that matches the action's defined type");
76
81
  var ActionKeyPropertySchema = z.string().min(1).describe("Action key to execute");
82
+ var ActionPropertySchema = withPositional(
83
+ z.string().min(1).describe("Action key (e.g., 'send_message' or 'find_row')")
84
+ );
85
+ var InputFieldPropertySchema = withPositional(
86
+ z.string().min(1).describe("Input field key to get choices for")
87
+ );
77
88
  var ConnectionIdPropertySchema = z.union([z.string(), z.number().int().positive()]).describe("Connection ID to use for this action");
78
- var AuthenticationIdPropertySchema = ConnectionIdPropertySchema;
89
+ var AuthenticationIdPropertySchema = ConnectionIdPropertySchema.meta({
90
+ deprecated: true
91
+ });
79
92
  var ConnectionPropertySchema = z.union([z.string(), z.number().int().positive()]).describe(
80
93
  "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly."
81
94
  );
@@ -88,6 +101,19 @@ var ParamsPropertySchema = z.record(z.string(), z.unknown()).describe("Additiona
88
101
  var ActionTimeoutMsPropertySchema = z.number().min(1e3).optional().describe(
89
102
  `Maximum time to wait for action completion in milliseconds (default: ${DEFAULT_ACTION_TIMEOUT_MS})`
90
103
  );
104
+ var TablePropertySchema = withPositional(
105
+ z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
106
+ );
107
+ var RecordPropertySchema = withPositional(
108
+ z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID").describe("The unique identifier of the record")
109
+ );
110
+ var RecordsPropertySchema = z.array(z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID")).min(1).max(100).describe("Record IDs to operate on");
111
+ var FieldsPropertySchema = z.array(z.union([z.string(), z.number()])).describe(
112
+ 'Fields to operate on. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6).'
113
+ );
114
+ var AppsPropertySchema = z.array(z.string()).describe("Filter by app keys (e.g., 'SlackCLIAPI' or slug like 'github')");
115
+ var TablesPropertySchema = z.array(z.string()).describe("Filter by specific table IDs");
116
+ var ConnectionsPropertySchema = z.array(z.string()).describe("List of connection IDs to filter by");
91
117
 
92
118
  // src/types/errors.ts
93
119
  var ZapierError = class extends Error {
@@ -252,20 +278,34 @@ HTTP Status: ${error.statusCode}`;
252
278
  }
253
279
  var ActionExecutionInputSchema = z.object({
254
280
  inputs: z.record(z.string(), z.unknown()).optional(),
255
- connectionId: ConnectionIdPropertySchema.optional(),
281
+ /** @deprecated Use `connection` instead. */
282
+ connectionId: ConnectionIdPropertySchema.optional().meta({
283
+ deprecated: true
284
+ }),
256
285
  connection: ConnectionPropertySchema.optional(),
257
- /** @deprecated Use connectionId instead */
258
- authenticationId: AuthenticationIdPropertySchema.optional(),
286
+ /** @deprecated Use connection instead */
287
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
288
+ deprecated: true
289
+ }),
259
290
  timeoutMs: ActionTimeoutMsPropertySchema
260
291
  }).describe(
261
292
  "Execute an action with the given inputs for the bound app, as an alternative to runAction"
262
- );
293
+ ).meta({
294
+ aliases: { connectionId: "connection", authenticationId: "connection" }
295
+ });
263
296
  var AppFactoryInputSchema = z.object({
264
- connectionId: ConnectionIdPropertySchema.optional(),
297
+ /** @deprecated Use `connection` instead. */
298
+ connectionId: ConnectionIdPropertySchema.optional().meta({
299
+ deprecated: true
300
+ }),
265
301
  connection: ConnectionPropertySchema.optional(),
266
- /** @deprecated Use connectionId instead */
267
- authenticationId: AuthenticationIdPropertySchema.optional()
268
- }).describe("Bind a connection alias or numeric connectionId to an app");
302
+ /** @deprecated Use connection instead */
303
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
304
+ deprecated: true
305
+ })
306
+ }).describe("Bind a connection alias or numeric connectionId to an app").meta({
307
+ aliases: { connectionId: "connection", authenticationId: "connection" }
308
+ });
269
309
  function getStringProperty(obj, key) {
270
310
  if (typeof obj === "object" && obj !== null && key in obj) {
271
311
  const value = obj[key];
@@ -341,12 +381,11 @@ function createActionFunction(appKey, actionType, actionKey, options, pinnedAuth
341
381
  errorContext: `Connection is required. Either use the factory pattern: sdk.apps.${appKey}({ connectionId }) or sdk.apps.${appKey}({ connection: "name" }), or provide connectionId/connection in the action call.`
342
382
  });
343
383
  return sdk.runAction({
344
- appKey,
384
+ app: appKey,
345
385
  actionType,
346
- actionKey,
386
+ action: actionKey,
347
387
  inputs,
348
- connectionId,
349
- connection,
388
+ connection: connectionId ?? connection,
350
389
  timeoutMs
351
390
  });
352
391
  };
@@ -365,8 +404,7 @@ function createActionTypeProxy(appKey, actionType, options, pinnedAuthId, pinned
365
404
  });
366
405
  return sdk.fetch(url, {
367
406
  ...init,
368
- connectionId,
369
- connection
407
+ connection: connectionId ?? connection
370
408
  });
371
409
  };
372
410
  }
@@ -459,8 +497,7 @@ var appsPlugin = ({ sdk }) => {
459
497
  packages: ["sdk"],
460
498
  type: "function",
461
499
  inputSchema: AppFactoryInputSchema,
462
- returnType: "AppProxy",
463
- deprecatedParameters: ["authenticationId"]
500
+ returnType: "AppProxy"
464
501
  },
465
502
  "apps.{appKey}.{actionType}.{actionKey}": {
466
503
  categories: ["app"],
@@ -468,8 +505,7 @@ var appsPlugin = ({ sdk }) => {
468
505
  type: "list",
469
506
  inputSchema: ActionExecutionInputSchema,
470
507
  itemType: "ActionResult",
471
- outputSchema: ActionResultItemSchema,
472
- deprecatedParameters: ["authenticationId"]
508
+ outputSchema: ActionResultItemSchema
473
509
  }
474
510
  }
475
511
  }
@@ -489,16 +525,25 @@ var FetchInitSchema = z.object({
489
525
  ]).optional().describe(
490
526
  "Request body \u2014 plain objects and JSON strings are auto-detected and Content-Type is set accordingly"
491
527
  ),
492
- connectionId: ConnectionIdPropertySchema.optional(),
528
+ connectionId: ConnectionIdPropertySchema.optional().meta({
529
+ deprecated: true
530
+ }),
493
531
  connection: ConnectionPropertySchema.optional(),
494
- /** @deprecated Use connectionId instead */
495
- authenticationId: AuthenticationIdPropertySchema.optional(),
532
+ /** @deprecated Use connection instead */
533
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
534
+ deprecated: true
535
+ }),
496
536
  callbackUrl: z.string().optional().describe("URL to send async response to (makes request async)")
497
537
  }).optional().describe(
498
538
  "Request options including method, headers, body, and authentication"
499
- );
539
+ ).meta({
540
+ aliases: { connectionId: "connection", authenticationId: "connection" }
541
+ });
500
542
 
501
543
  // src/utils/domain-utils.ts
544
+ function isConnectionId(value) {
545
+ return /^\d+$/.test(value) || isUuid(value);
546
+ }
502
547
  async function resolveConnectionId({
503
548
  connectionId,
504
549
  connection,
@@ -519,13 +564,16 @@ async function resolveConnectionId({
519
564
  resolvedConnectionId = connection;
520
565
  } else {
521
566
  const entry = await resolveConnection(connection);
522
- if (!entry) {
567
+ if (entry) {
568
+ resolvedConnectionId = entry.connectionId;
569
+ } else if (isConnectionId(connection)) {
570
+ resolvedConnectionId = connection;
571
+ } else {
523
572
  throw new ZapierConfigurationError(
524
- `Connection "${connection}" not found in connections map. Ensure the connection is defined in the manifest connections, or use a numeric connectionId.`,
573
+ `Connection "${connection}" not found in connections map. Ensure the connection is defined in the manifest connections, or pass a connection ID directly.`,
525
574
  { configType: "connections" }
526
575
  );
527
576
  }
528
- resolvedConnectionId = entry.connectionId;
529
577
  }
530
578
  }
531
579
  return resolvedConnectionId;
@@ -611,20 +659,6 @@ function isResolvedAppLocator(appLocator) {
611
659
  return !!appLocator.implementationName;
612
660
  }
613
661
 
614
- // src/utils/id-utils.ts
615
- function coerceToNumericId(fieldName, value) {
616
- if (value === "") {
617
- throw new ZapierValidationError(`The ${fieldName} cannot be empty`);
618
- }
619
- const numericValue = typeof value === "number" ? value : Number(value);
620
- if (!Number.isFinite(numericValue)) {
621
- throw new ZapierValidationError(
622
- `The ${fieldName} "${value}" could not be converted to a number`
623
- );
624
- }
625
- return numericValue;
626
- }
627
-
628
662
  // src/utils/type-guard-utils.ts
629
663
  function isPlainObject(value) {
630
664
  if (typeof value !== "object" || value === null) return false;
@@ -735,10 +769,7 @@ var fetchPlugin = ({ context }) => {
735
769
  }
736
770
  }
737
771
  if (resolvedConnectionId) {
738
- headers["X-Relay-Authentication-Id"] = coerceToNumericId(
739
- "connectionId",
740
- resolvedConnectionId
741
- ).toString();
772
+ headers["X-Relay-Authentication-Id"] = String(resolvedConnectionId);
742
773
  }
743
774
  if (callbackUrl) {
744
775
  headers["X-Relay-Callback-Url"] = callbackUrl;
@@ -795,8 +826,7 @@ var fetchPlugin = ({ context }) => {
795
826
  inputParameters: [
796
827
  { name: "url", schema: FetchUrlSchema },
797
828
  { name: "init", schema: FetchInitSchema }
798
- ],
799
- deprecatedParameters: ["authenticationId"]
829
+ ]
800
830
  }
801
831
  }
802
832
  }
@@ -1289,10 +1319,15 @@ function createPaginatedFunction(coreFn, schema, telemetry, explicitFunctionName
1289
1319
  var ListAppsSchema = ListAppsQuerySchema.omit({
1290
1320
  offset: true
1291
1321
  }).extend({
1322
+ // New name for appKeys
1323
+ apps: AppsPropertySchema.optional().describe(
1324
+ "Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"
1325
+ ),
1292
1326
  // Override appKeys to be an array instead of comma-separated string
1327
+ /** @deprecated Use `apps` instead. */
1293
1328
  appKeys: z.array(z.string()).optional().describe(
1294
1329
  "Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"
1295
- ),
1330
+ ).meta({ deprecated: true }),
1296
1331
  // Override pageSize to make optional (base has default value)
1297
1332
  pageSize: z.number().min(1).optional().describe("Number of apps per page"),
1298
1333
  // SDK specific property for pagination/iterable helpers
@@ -1362,7 +1397,7 @@ function createTelemetryCallback(emitMethodCalled, methodName) {
1362
1397
  var listAppsPlugin = ({ context }) => {
1363
1398
  async function listAppsPage(options) {
1364
1399
  const { api, resolveAppKeys: resolveAppKeys2 } = context;
1365
- const appKeys = options.appKeys ?? [];
1400
+ const appKeys = options.apps ?? options.appKeys ?? [];
1366
1401
  const appLocators = await resolveAppKeys2({
1367
1402
  appKeys: [...appKeys]
1368
1403
  });
@@ -1424,17 +1459,29 @@ var listAppsPlugin = ({ context }) => {
1424
1459
  }
1425
1460
  };
1426
1461
  };
1462
+ var ListActionsDescription = "List all actions for a specific app";
1463
+ var ListActionsBaseSchema = z.object({
1464
+ pageSize: z.number().min(1).optional().describe("Number of actions per page"),
1465
+ maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1466
+ cursor: z.string().optional().describe("Cursor to start from")
1467
+ });
1427
1468
  var ListActionsSchema = z.object({
1428
- appKey: AppKeyPropertySchema.describe(
1469
+ app: AppPropertySchema.describe(
1429
1470
  "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1430
1471
  ),
1431
1472
  actionType: ActionTypePropertySchema.optional().describe(
1432
1473
  "Filter actions by type"
1474
+ )
1475
+ }).merge(ListActionsBaseSchema).describe(ListActionsDescription).meta({ aliases: { appKey: "app" } });
1476
+ var ListActionsSchemaDeprecated = z.object({
1477
+ appKey: AppKeyPropertySchema.describe(
1478
+ "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1433
1479
  ),
1434
- pageSize: z.number().min(1).optional().describe("Number of actions per page"),
1435
- maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1436
- cursor: z.string().optional().describe("Cursor to start from")
1437
- }).describe("List all actions for a specific app");
1480
+ actionType: ActionTypePropertySchema.optional().describe(
1481
+ "Filter actions by type"
1482
+ )
1483
+ }).merge(ListActionsBaseSchema);
1484
+ var ListActionsInputSchema = z.union([ListActionsSchema, ListActionsSchemaDeprecated]).describe(ListActionsDescription);
1438
1485
  var NeedChoicesSchema = z.object({
1439
1486
  key: z.string().optional(),
1440
1487
  label: z.string().optional(),
@@ -1659,7 +1706,7 @@ z.object({
1659
1706
  selected_api: z.string(),
1660
1707
  action: z.string(),
1661
1708
  type_of: z.string(),
1662
- authentication_id: z.number().optional(),
1709
+ authentication_id: z.union([z.string(), z.number()]).optional(),
1663
1710
  params: z.record(z.string(), z.unknown()).optional()
1664
1711
  });
1665
1712
  z.object({
@@ -1706,7 +1753,7 @@ z.object({
1706
1753
  selected_api: z.string().optional().describe(
1707
1754
  "Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."
1708
1755
  ),
1709
- authentication_id: z.coerce.number().optional().describe(
1756
+ authentication_id: z.union([z.string(), z.number()]).optional().describe(
1710
1757
  "If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."
1711
1758
  ),
1712
1759
  params: z.record(z.string(), z.unknown()).optional().describe(
@@ -1786,10 +1833,10 @@ var appKeyResolver = {
1786
1833
  // src/resolvers/actionType.ts
1787
1834
  var actionTypeResolver = {
1788
1835
  type: "dynamic",
1789
- depends: ["appKey"],
1836
+ depends: ["app"],
1790
1837
  fetch: async (sdk, resolvedParams) => {
1791
1838
  const actionsResponse = await sdk.listActions({
1792
- appKey: resolvedParams.appKey
1839
+ app: resolvedParams.app
1793
1840
  });
1794
1841
  const actionTypes = actionsResponse.data.map(
1795
1842
  (action) => action.action_type
@@ -1811,10 +1858,10 @@ var actionTypeResolver = {
1811
1858
  // src/resolvers/actionKey.ts
1812
1859
  var actionKeyResolver = {
1813
1860
  type: "dynamic",
1814
- depends: ["appKey", "actionType"],
1861
+ depends: ["app", "actionType"],
1815
1862
  fetch: async (sdk, resolvedParams) => {
1816
1863
  const actionsResponse = await sdk.listActions({
1817
- appKey: resolvedParams.appKey
1864
+ app: resolvedParams.app
1818
1865
  });
1819
1866
  return actionsResponse.data.filter(
1820
1867
  (action) => action.action_type === resolvedParams.actionType
@@ -1822,7 +1869,7 @@ var actionKeyResolver = {
1822
1869
  },
1823
1870
  prompt: (actions) => ({
1824
1871
  type: "list",
1825
- name: "actionKey",
1872
+ name: "action",
1826
1873
  message: "Select action:",
1827
1874
  choices: actions.map((action) => ({
1828
1875
  name: `${action.title || action.name || action.key} - ${action.description || "No description"}`,
@@ -1839,7 +1886,7 @@ async function fetchConnections(sdk, resolvedParams) {
1839
1886
  );
1840
1887
  return toIterable(
1841
1888
  sdk.listConnections({
1842
- appKey: resolvedParams.appKey,
1889
+ app: resolvedParams.app,
1843
1890
  includeShared: includeShared || void 0
1844
1891
  })
1845
1892
  );
@@ -1847,8 +1894,8 @@ async function fetchConnections(sdk, resolvedParams) {
1847
1894
  function promptForConnection(connections, params) {
1848
1895
  return {
1849
1896
  type: "list",
1850
- name: "connectionId",
1851
- message: params.appKey ? `Select connection for ${params.appKey}:` : "Select connection:",
1897
+ name: "connection",
1898
+ message: params.app ? `Select connection for ${params.app}:` : "Select connection:",
1852
1899
  choices: connections.map((connection) => ({
1853
1900
  name: `${connection.title || connection.label || "Connection"} (ID: ${connection.id})`,
1854
1901
  value: connection.id
@@ -1857,12 +1904,12 @@ function promptForConnection(connections, params) {
1857
1904
  }
1858
1905
  var connectionIdResolver = {
1859
1906
  type: "dynamic",
1860
- depends: ["appKey"],
1907
+ depends: ["app"],
1861
1908
  requireCapabilities: ["canIncludeSharedConnections"],
1862
1909
  tryResolveWithoutPrompt: async (sdk, params) => {
1863
- if (!params.appKey) return null;
1910
+ if (!params.app) return null;
1864
1911
  try {
1865
- const app = await sdk.getApp({ appKey: params.appKey });
1912
+ const app = await sdk.getApp({ app: params.app });
1866
1913
  if (!app.data.auth_type) {
1867
1914
  return { resolvedValue: null };
1868
1915
  }
@@ -1901,13 +1948,13 @@ function makeFieldsOptional(fields) {
1901
1948
  }
1902
1949
  var inputsResolver = {
1903
1950
  type: "fields",
1904
- depends: ["appKey", "actionKey", "actionType", "connectionId"],
1951
+ depends: ["app", "action", "actionType", "connection"],
1905
1952
  fetch: async (sdk, resolvedParams) => {
1906
1953
  const fieldsResponse = await sdk.listInputFields({
1907
- appKey: resolvedParams.appKey,
1908
- actionKey: resolvedParams.actionKey,
1954
+ app: resolvedParams.app,
1955
+ action: resolvedParams.action,
1909
1956
  actionType: resolvedParams.actionType,
1910
- connectionId: resolvedParams.connectionId,
1957
+ connection: resolvedParams.connection,
1911
1958
  inputs: resolvedParams.inputs
1912
1959
  // Pass along currently resolved inputs
1913
1960
  });
@@ -1916,13 +1963,13 @@ var inputsResolver = {
1916
1963
  };
1917
1964
  var inputsAllOptionalResolver = {
1918
1965
  type: "fields",
1919
- depends: ["appKey", "actionKey", "actionType", "connectionId"],
1966
+ depends: ["app", "action", "actionType", "connection"],
1920
1967
  fetch: async (sdk, resolvedParams) => {
1921
1968
  const fieldsResponse = await sdk.listInputFields({
1922
- appKey: resolvedParams.appKey,
1923
- actionKey: resolvedParams.actionKey,
1969
+ app: resolvedParams.app,
1970
+ action: resolvedParams.action,
1924
1971
  actionType: resolvedParams.actionType,
1925
- connectionId: resolvedParams.connectionId,
1972
+ connection: resolvedParams.connection,
1926
1973
  inputs: resolvedParams.inputs
1927
1974
  // Pass along currently resolved inputs
1928
1975
  });
@@ -1949,21 +1996,20 @@ function flattenRootFieldset(rootFieldset) {
1949
1996
  }
1950
1997
  var inputFieldKeyResolver = {
1951
1998
  type: "dynamic",
1952
- depends: ["appKey", "actionKey", "actionType", "connectionId"],
1999
+ depends: ["app", "action", "actionType", "connection"],
1953
2000
  fetch: async (sdk, resolvedParams) => {
1954
2001
  const fieldsResponse = await sdk.listInputFields({
1955
- appKey: resolvedParams.appKey,
1956
- actionKey: resolvedParams.actionKey,
2002
+ app: resolvedParams.app,
2003
+ action: resolvedParams.action,
1957
2004
  actionType: resolvedParams.actionType,
1958
- connectionId: resolvedParams.connectionId,
2005
+ connection: resolvedParams.connection,
1959
2006
  inputs: resolvedParams.inputs
1960
- // Pass along currently resolved inputs
1961
2007
  });
1962
2008
  return flattenRootFieldset(fieldsResponse.data);
1963
2009
  },
1964
2010
  prompt: (fields) => ({
1965
2011
  type: "list",
1966
- name: "inputFieldKey",
2012
+ name: "inputField",
1967
2013
  message: "Select input field:",
1968
2014
  choices: fields.map((field) => ({
1969
2015
  name: `${field.title || field.key} - ${field.value_type || "No type"} ${field.is_required ? "(required)" : "(optional)"}`,
@@ -2021,7 +2067,7 @@ var tableIdResolver = {
2021
2067
  },
2022
2068
  prompt: (tables) => ({
2023
2069
  type: "list",
2024
- name: "tableId",
2070
+ name: "table",
2025
2071
  message: "Select a table:",
2026
2072
  choices: tables.map((table) => ({
2027
2073
  name: `${table.name} (${table.id})`,
@@ -2270,7 +2316,7 @@ function summarizeRecord(record) {
2270
2316
  }
2271
2317
  function fetchRecords(sdk, params) {
2272
2318
  return sdk.listTableRecords({
2273
- tableId: params.tableId,
2319
+ table: params.table,
2274
2320
  keyMode: "names"
2275
2321
  });
2276
2322
  }
@@ -2282,22 +2328,22 @@ function recordChoices(records) {
2282
2328
  }
2283
2329
  var tableRecordIdResolver = {
2284
2330
  type: "dynamic",
2285
- depends: ["tableId"],
2331
+ depends: ["table"],
2286
2332
  fetch: fetchRecords,
2287
2333
  prompt: (records) => ({
2288
2334
  type: "list",
2289
- name: "recordId",
2335
+ name: "record",
2290
2336
  message: "Select a record:",
2291
2337
  choices: recordChoices(records)
2292
2338
  })
2293
2339
  };
2294
2340
  var tableRecordIdsResolver = {
2295
2341
  type: "dynamic",
2296
- depends: ["tableId"],
2342
+ depends: ["table"],
2297
2343
  fetch: fetchRecords,
2298
2344
  prompt: (records) => ({
2299
2345
  type: "checkbox",
2300
- name: "recordIds",
2346
+ name: "records",
2301
2347
  message: "Select records to delete:",
2302
2348
  choices: recordChoices(records),
2303
2349
  validate: (value) => Array.isArray(value) && value.length > 0 ? true : "Select at least one record"
@@ -2307,13 +2353,13 @@ var tableRecordIdsResolver = {
2307
2353
  // src/resolvers/tableFieldIds.ts
2308
2354
  var tableFieldIdsResolver = {
2309
2355
  type: "dynamic",
2310
- depends: ["tableId"],
2356
+ depends: ["table"],
2311
2357
  fetch: (sdk, params) => {
2312
- return sdk.listTableFields({ tableId: params.tableId });
2358
+ return sdk.listTableFields({ table: params.table });
2313
2359
  },
2314
2360
  prompt: (fields) => ({
2315
2361
  type: "checkbox",
2316
- name: "fieldKeys",
2362
+ name: "fields",
2317
2363
  message: "Select fields:",
2318
2364
  choices: fields.map((field) => ({
2319
2365
  name: `${field.name} (${field.id}, ${field.type})`,
@@ -2392,12 +2438,20 @@ var FieldItemSchema = withFormatter(FieldItemSchemaBase, {
2392
2438
  details: [{ text: `Type: ${item.type}`, style: "dim" }]
2393
2439
  })
2394
2440
  });
2395
- var ListTableFieldsOptionsSchema = z.object({
2396
- tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
2441
+ var ListTableFieldsDescription = "List fields for a table";
2442
+ var ListTableFieldsOptionsBaseSchema = z.object({
2443
+ fields: FieldsPropertySchema.optional(),
2397
2444
  fieldKeys: z.array(z.union([z.string(), z.number()])).optional().describe(
2398
2445
  'Filter by specific fields. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6).'
2399
- )
2400
- }).describe("List fields for a table");
2446
+ ).meta({ deprecated: true })
2447
+ });
2448
+ var ListTableFieldsOptionsSchema = ListTableFieldsOptionsBaseSchema.extend({
2449
+ table: TablePropertySchema
2450
+ }).describe(ListTableFieldsDescription).meta({ aliases: { tableId: "table", fieldKeys: "fields" } });
2451
+ var ListTableFieldsOptionsSchemaDeprecated = ListTableFieldsOptionsBaseSchema.extend({
2452
+ tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
2453
+ });
2454
+ var ListTableFieldsOptionsInputSchema = z.union([ListTableFieldsOptionsSchema, ListTableFieldsOptionsSchemaDeprecated]).describe(ListTableFieldsDescription);
2401
2455
 
2402
2456
  // src/resolvers/tableFields.ts
2403
2457
  var fieldTypeChoices = FieldTypeSchema.options.map((type) => ({
@@ -2446,13 +2500,13 @@ function tableFieldValueType(fieldType) {
2446
2500
  }
2447
2501
  function createSingleRecordResolver({
2448
2502
  sdk,
2449
- tableId,
2503
+ table,
2450
2504
  includeRecordId
2451
2505
  }) {
2452
2506
  return {
2453
2507
  type: "fields",
2454
2508
  fetch: async () => {
2455
- const { data: fields } = await sdk.listTableFields({ tableId });
2509
+ const { data: fields } = await sdk.listTableFields({ table });
2456
2510
  const inputFields = fields.map((field) => ({
2457
2511
  type: "input_field",
2458
2512
  key: field.id,
@@ -2487,22 +2541,22 @@ function createSingleRecordResolver({
2487
2541
  }
2488
2542
  var tableRecordsResolver = {
2489
2543
  type: "array",
2490
- depends: ["tableId"],
2544
+ depends: ["table"],
2491
2545
  fetch: async (sdk, params) => {
2492
2546
  return createSingleRecordResolver({
2493
2547
  sdk,
2494
- tableId: params.tableId
2548
+ table: params.table
2495
2549
  });
2496
2550
  },
2497
2551
  minItems: 1
2498
2552
  };
2499
2553
  var tableUpdateRecordsResolver = {
2500
2554
  type: "array",
2501
- depends: ["tableId"],
2555
+ depends: ["table"],
2502
2556
  fetch: async (sdk, params) => {
2503
2557
  return createSingleRecordResolver({
2504
2558
  sdk,
2505
- tableId: params.tableId,
2559
+ table: params.table,
2506
2560
  includeRecordId: true
2507
2561
  });
2508
2562
  },
@@ -2528,12 +2582,12 @@ var FILTER_OPERATORS = [
2528
2582
  ];
2529
2583
  function createSingleFilterResolver({
2530
2584
  sdk,
2531
- tableId
2585
+ table
2532
2586
  }) {
2533
2587
  return {
2534
2588
  type: "fields",
2535
2589
  fetch: async () => {
2536
- const { data: fields } = await sdk.listTableFields({ tableId });
2590
+ const { data: fields } = await sdk.listTableFields({ table });
2537
2591
  const fieldChoices = fields.flatMap((field) => {
2538
2592
  const components = NESTED_COMPONENTS[field.type];
2539
2593
  if (components && components.size > 1) {
@@ -2575,11 +2629,11 @@ function createSingleFilterResolver({
2575
2629
  }
2576
2630
  var tableFiltersResolver = {
2577
2631
  type: "array",
2578
- depends: ["tableId"],
2632
+ depends: ["table"],
2579
2633
  fetch: async (sdk, params) => {
2580
2634
  return createSingleFilterResolver({
2581
2635
  sdk,
2582
- tableId: params.tableId
2636
+ table: params.table
2583
2637
  });
2584
2638
  },
2585
2639
  minItems: 0
@@ -2588,10 +2642,10 @@ var tableFiltersResolver = {
2588
2642
  // src/resolvers/tableSort.ts
2589
2643
  var tableSortResolver = {
2590
2644
  type: "fields",
2591
- depends: ["tableId"],
2645
+ depends: ["table"],
2592
2646
  fetch: async (sdk, params) => {
2593
2647
  const { data: fields } = await sdk.listTableFields({
2594
- tableId: params.tableId
2648
+ table: params.table
2595
2649
  });
2596
2650
  const fieldChoices = fields.flatMap((field) => {
2597
2651
  const components = NESTED_COMPONENTS[field.type];
@@ -2638,13 +2692,14 @@ var listActionsPlugin = ({ context }) => {
2638
2692
  inputSchema: ListActionsSchema,
2639
2693
  outputSchema: ActionItemSchema,
2640
2694
  resolvers: {
2641
- appKey: appKeyResolver,
2695
+ app: appKeyResolver,
2642
2696
  actionType: actionTypeResolver
2643
2697
  }
2644
2698
  };
2645
2699
  async function listActionsPage(options) {
2646
2700
  const { api, getVersionedImplementationId } = context;
2647
- const selectedApi = await getVersionedImplementationId(options.appKey);
2701
+ const appKey = "app" in options ? options.app : options.appKey;
2702
+ const selectedApi = await getVersionedImplementationId(appKey);
2648
2703
  if (!selectedApi) {
2649
2704
  throw new ZapierConfigurationError(
2650
2705
  "No current_implementation_id found for app",
@@ -2706,7 +2761,7 @@ var listActionsPlugin = ({ context }) => {
2706
2761
  const methodName = stripPageSuffix(listActionsPage.name);
2707
2762
  const listActionsDefinition = createPaginatedFunction(
2708
2763
  listActionsPage,
2709
- ListActionsSchema,
2764
+ ListActionsInputSchema,
2710
2765
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
2711
2766
  methodName,
2712
2767
  DEFAULT_PAGE_SIZE
@@ -2720,22 +2775,41 @@ var listActionsPlugin = ({ context }) => {
2720
2775
  }
2721
2776
  };
2722
2777
  };
2723
- var ListInputFieldsSchema = z.object({
2724
- appKey: AppKeyPropertySchema,
2725
- actionType: ActionTypePropertySchema,
2726
- actionKey: ActionKeyPropertySchema,
2778
+ var ListInputFieldsDescription = "Get the input fields required for a specific action";
2779
+ var ListInputFieldsBaseSchema = z.object({
2780
+ connection: ConnectionPropertySchema.optional().describe(
2781
+ "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId."
2782
+ ),
2727
2783
  connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
2728
2784
  "Connection ID to use when listing input fields. Required if the action needs a connection to determine available fields."
2729
- ),
2730
- /** @deprecated Use connectionId instead */
2731
- authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
2785
+ ).meta({ deprecated: true }),
2786
+ /** @deprecated Use connection instead */
2787
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
2732
2788
  inputs: InputsPropertySchema.optional().describe(
2733
2789
  "Current input values that may affect available fields"
2734
2790
  ),
2735
2791
  pageSize: z.number().min(1).optional().describe("Number of input fields per page"),
2736
2792
  maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
2737
2793
  cursor: z.string().optional().describe("Cursor to start from")
2738
- }).describe("Get the input fields required for a specific action");
2794
+ });
2795
+ var ListInputFieldsSchema = z.object({
2796
+ app: AppPropertySchema,
2797
+ actionType: ActionTypePropertySchema,
2798
+ action: ActionPropertySchema
2799
+ }).merge(ListInputFieldsBaseSchema).describe(ListInputFieldsDescription).meta({
2800
+ aliases: {
2801
+ appKey: "app",
2802
+ actionKey: "action",
2803
+ connectionId: "connection",
2804
+ authenticationId: "connection"
2805
+ }
2806
+ });
2807
+ var ListInputFieldsSchemaDeprecated = z.object({
2808
+ appKey: AppKeyPropertySchema,
2809
+ actionType: ActionTypePropertySchema,
2810
+ actionKey: ActionKeyPropertySchema
2811
+ }).merge(ListInputFieldsBaseSchema);
2812
+ var ListInputFieldsInputSchema = z.union([ListInputFieldsSchema, ListInputFieldsSchemaDeprecated]).describe(ListInputFieldsDescription);
2739
2813
  var BaseFieldItemSchema = z.object({
2740
2814
  type: z.string(),
2741
2815
  // "input_field", "info_field", or "fieldset"
@@ -2870,10 +2944,7 @@ async function fetchImplementationNeeds({
2870
2944
  params: inputs || {}
2871
2945
  };
2872
2946
  if (connectionId !== null) {
2873
- request.authentication_id = coerceToNumericId(
2874
- "authentication_id",
2875
- connectionId
2876
- );
2947
+ request.authentication_id = connectionId;
2877
2948
  }
2878
2949
  const response = await api.post(
2879
2950
  "/zapier/api/v4/implementations/needs/",
@@ -2901,10 +2972,7 @@ async function fetchImplementationChoices({
2901
2972
  params: inputs || {}
2902
2973
  };
2903
2974
  if (connectionId !== null) {
2904
- request.authentication_id = coerceToNumericId(
2905
- "authentication_id",
2906
- connectionId
2907
- );
2975
+ request.authentication_id = connectionId;
2908
2976
  }
2909
2977
  const response = await api.post(
2910
2978
  "/zapier/api/v4/implementations/choices/",
@@ -3020,15 +3088,15 @@ function transformNeedsToFields(needs) {
3020
3088
  var listInputFieldsPlugin = ({ sdk, context }) => {
3021
3089
  async function listInputFieldsPage(options) {
3022
3090
  const { api, getVersionedImplementationId } = context;
3023
- const {
3024
- appKey,
3025
- actionKey,
3026
- actionType,
3091
+ const appKey = "app" in options ? options.app : options.appKey;
3092
+ const actionKey = "action" in options ? options.action : options.actionKey;
3093
+ const { actionType, connection, connectionId, authenticationId, inputs } = options;
3094
+ const resolvedConnectionId = await resolveConnectionId({
3095
+ connection,
3027
3096
  connectionId,
3028
3097
  authenticationId,
3029
- inputs
3030
- } = options;
3031
- const resolvedConnectionId = connectionId ?? authenticationId ?? null;
3098
+ resolveConnection: context.resolveConnection
3099
+ });
3032
3100
  const selectedApi = await getVersionedImplementationId(appKey);
3033
3101
  if (!selectedApi) {
3034
3102
  throw new ZapierConfigurationError(
@@ -3042,16 +3110,16 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
3042
3110
  operationKey: actionKey
3043
3111
  });
3044
3112
  const { data: action } = await sdk.getAction({
3045
- appKey,
3113
+ app: appKey,
3046
3114
  actionType,
3047
- actionKey
3115
+ action: actionKey
3048
3116
  });
3049
3117
  const needsData = await fetchImplementationNeeds({
3050
3118
  api,
3051
3119
  selectedApi,
3052
3120
  action: action.key,
3053
3121
  actionType,
3054
- connectionId: resolvedConnectionId,
3122
+ connectionId: resolvedConnectionId ?? null,
3055
3123
  inputs
3056
3124
  });
3057
3125
  const rootFieldset = transformNeedsToFields(needsData.needs || []);
@@ -3064,7 +3132,7 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
3064
3132
  const methodName = stripPageSuffix(listInputFieldsPage.name);
3065
3133
  const listInputFieldsDefinition = createPaginatedFunction(
3066
3134
  listInputFieldsPage,
3067
- ListInputFieldsSchema,
3135
+ ListInputFieldsInputSchema,
3068
3136
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
3069
3137
  methodName,
3070
3138
  DEFAULT_PAGE_SIZE
@@ -3080,13 +3148,12 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
3080
3148
  inputSchema: ListInputFieldsSchema,
3081
3149
  outputSchema: RootFieldItemSchema,
3082
3150
  resolvers: {
3083
- appKey: appKeyResolver,
3151
+ app: appKeyResolver,
3084
3152
  actionType: actionTypeResolver,
3085
- actionKey: actionKeyResolver,
3086
- connectionId: connectionIdResolver,
3153
+ action: actionKeyResolver,
3154
+ connection: connectionIdResolver,
3087
3155
  inputs: inputsAllOptionalResolver
3088
- },
3089
- deprecatedParameters: ["authenticationId"]
3156
+ }
3090
3157
  }
3091
3158
  }
3092
3159
  }
@@ -3101,18 +3168,27 @@ var ListConnectionsQuerySchema = ListConnectionsQuerySchema$1.omit({
3101
3168
  is_expired: true,
3102
3169
  page_size: true
3103
3170
  }).extend({
3104
- // Override appKey with our custom schema (array type, different description)
3171
+ // New name for appKey
3172
+ app: AppPropertySchema.optional().describe(
3173
+ "App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
3174
+ ),
3175
+ /** @deprecated Use `app` instead. */
3105
3176
  appKey: AppKeyPropertySchema.optional().describe(
3106
3177
  "App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
3178
+ ).meta({ deprecated: true }),
3179
+ // New name for connectionIds
3180
+ connections: ConnectionsPropertySchema.optional().describe(
3181
+ "List of connection IDs to filter by"
3107
3182
  ),
3108
- // Override connectionIds to be an array instead of comma-separated string
3109
- connectionIds: z.array(z.string()).optional().describe("List of connection IDs to filter by"),
3110
- /** @deprecated Use connectionIds instead */
3183
+ /** @deprecated Use `connections` instead. */
3184
+ connectionIds: z.array(z.string()).optional().describe("List of connection IDs to filter by").meta({ deprecated: true }),
3185
+ /** @deprecated Use `connections` instead. */
3111
3186
  authenticationIds: z.array(z.string()).optional().describe(
3112
- "List of authentication IDs to filter by (deprecated, use connectionIds)"
3113
- ),
3114
- // camelCase account ID
3115
- accountId: z.string().optional().describe("Account ID to filter by"),
3187
+ "List of authentication IDs to filter by (deprecated, use connections)"
3188
+ ).meta({ deprecated: true }),
3189
+ account: z.string().optional().describe("Account to filter by"),
3190
+ /** @deprecated Use `account` instead. */
3191
+ accountId: z.string().optional().describe("Account ID to filter by").meta({ deprecated: true }),
3116
3192
  // Include shared connections (overrides default owner=me filter)
3117
3193
  includeShared: z.boolean().optional().describe(
3118
3194
  "Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections."
@@ -3164,21 +3240,31 @@ var listConnectionsPlugin = ({ context }) => {
3164
3240
  if (options.pageSize !== void 0) {
3165
3241
  searchParams.page_size = options.pageSize.toString();
3166
3242
  }
3167
- if (options.appKey) {
3168
- const implementationId = await getVersionedImplementationId(
3169
- options.appKey
3170
- );
3243
+ const appKey = options.app ?? options.appKey;
3244
+ if (appKey) {
3245
+ const implementationId = await getVersionedImplementationId(appKey);
3171
3246
  if (implementationId) {
3172
3247
  setMethodMetadata({ selectedApi: implementationId });
3173
3248
  const [versionlessSelectedApi] = splitVersionedKey(implementationId);
3174
3249
  searchParams.app_key = versionlessSelectedApi;
3175
3250
  } else {
3176
- searchParams.app_key = options.appKey;
3177
- }
3178
- }
3179
- const resolvedConnectionIds = options.connectionIds ?? options.authenticationIds;
3180
- if (resolvedConnectionIds && resolvedConnectionIds.length > 0) {
3181
- searchParams.connection_ids = resolvedConnectionIds.join(",");
3251
+ searchParams.app_key = appKey;
3252
+ }
3253
+ }
3254
+ const connectionRefs = options.connections;
3255
+ const legacyConnectionIds = options.connectionIds ?? options.authenticationIds;
3256
+ if (connectionRefs && connectionRefs.length > 0) {
3257
+ const resolvedIds = await Promise.all(
3258
+ connectionRefs.map(
3259
+ (ref) => resolveConnectionId({
3260
+ connection: ref,
3261
+ resolveConnection: context.resolveConnection
3262
+ })
3263
+ )
3264
+ );
3265
+ searchParams.connection_ids = resolvedIds.filter((id) => id != null).join(",");
3266
+ } else if (legacyConnectionIds && legacyConnectionIds.length > 0) {
3267
+ searchParams.connection_ids = legacyConnectionIds.join(",");
3182
3268
  }
3183
3269
  if (options.search) {
3184
3270
  searchParams.search = options.search;
@@ -3186,8 +3272,9 @@ var listConnectionsPlugin = ({ context }) => {
3186
3272
  if (options.title) {
3187
3273
  searchParams.title = options.title;
3188
3274
  }
3189
- if (options.accountId) {
3190
- searchParams.account_id = options.accountId;
3275
+ const accountId = options.account ?? options.accountId;
3276
+ if (accountId) {
3277
+ searchParams.account_id = accountId;
3191
3278
  }
3192
3279
  if (options.owner && options.owner !== "me" && !options.includeShared) {
3193
3280
  throw new ZapierValidationError(
@@ -3247,9 +3334,8 @@ var listConnectionsPlugin = ({ context }) => {
3247
3334
  inputSchema: ListConnectionsQuerySchema,
3248
3335
  outputSchema: ConnectionItemSchema,
3249
3336
  resolvers: {
3250
- appKey: appKeyResolver
3251
- },
3252
- deprecatedParameters: ["authenticationIds"]
3337
+ app: appKeyResolver
3338
+ }
3253
3339
  }
3254
3340
  }
3255
3341
  }
@@ -3492,17 +3578,21 @@ var deleteClientCredentialsPlugin = ({ context }) => {
3492
3578
  }
3493
3579
  };
3494
3580
  };
3581
+ var GetAppDescription = "Get detailed information about a specific app";
3495
3582
  var GetAppSchema = z.object({
3496
- appKey: AppKeyPropertySchema.describe(
3497
- "App key of app to fetch (e.g., 'SlackCLIAPI' or slug like 'github')"
3498
- )
3499
- }).describe("Get detailed information about a specific app");
3583
+ app: AppPropertySchema
3584
+ }).describe(GetAppDescription).meta({ aliases: { appKey: "app" } });
3585
+ var GetAppSchemaDeprecated = z.object({
3586
+ appKey: AppKeyPropertySchema
3587
+ });
3588
+ var GetAppInputSchema = z.union([GetAppSchema, GetAppSchemaDeprecated]).describe(GetAppDescription);
3500
3589
 
3501
3590
  // src/plugins/getApp/index.ts
3502
3591
  var getAppPlugin = ({ sdk, context }) => {
3503
3592
  async function getApp(options) {
3593
+ const appKey = "app" in options ? options.app : options.appKey;
3504
3594
  const appsIterable = sdk.listApps({
3505
- appKeys: [options.appKey]
3595
+ appKeys: [appKey]
3506
3596
  }).items();
3507
3597
  for await (const app of appsIterable) {
3508
3598
  return {
@@ -3510,12 +3600,12 @@ var getAppPlugin = ({ sdk, context }) => {
3510
3600
  };
3511
3601
  }
3512
3602
  throw new ZapierAppNotFoundError("App not found", {
3513
- appKey: options.appKey
3603
+ appKey
3514
3604
  });
3515
3605
  }
3516
3606
  const getAppDefinition = createFunction(
3517
3607
  getApp,
3518
- GetAppSchema,
3608
+ GetAppInputSchema,
3519
3609
  createTelemetryCallback(
3520
3610
  context.eventEmission.emitMethodCalled,
3521
3611
  getApp.name
@@ -3532,28 +3622,37 @@ var getAppPlugin = ({ sdk, context }) => {
3532
3622
  inputSchema: GetAppSchema,
3533
3623
  outputSchema: AppItemSchema,
3534
3624
  resolvers: {
3535
- appKey: appKeyResolver
3625
+ app: appKeyResolver
3536
3626
  }
3537
3627
  }
3538
3628
  }
3539
3629
  }
3540
3630
  };
3541
3631
  };
3632
+ var GetActionDescription = "Get detailed information about a specific action";
3542
3633
  var GetActionSchema = z.object({
3634
+ app: AppPropertySchema,
3635
+ actionType: ActionTypePropertySchema,
3636
+ action: ActionPropertySchema
3637
+ }).describe(GetActionDescription).meta({ aliases: { appKey: "app", actionKey: "action" } });
3638
+ var GetActionSchemaDeprecated = z.object({
3543
3639
  appKey: AppKeyPropertySchema,
3544
3640
  actionType: ActionTypePropertySchema,
3545
3641
  actionKey: ActionKeyPropertySchema
3546
- }).describe("Get detailed information about a specific action");
3642
+ });
3643
+ var GetActionInputSchema = z.union([GetActionSchema, GetActionSchemaDeprecated]).describe(GetActionDescription);
3547
3644
 
3548
3645
  // src/plugins/getAction/index.ts
3549
3646
  var getActionPlugin = ({ sdk, context }) => {
3550
3647
  async function getAction(options) {
3551
- const { actionKey, actionType, appKey } = options;
3648
+ const appKey = "app" in options ? options.app : options.appKey;
3649
+ const actionKey = "action" in options ? options.action : options.actionKey;
3650
+ const { actionType } = options;
3552
3651
  setMethodMetadata({
3553
3652
  operationType: actionType,
3554
3653
  operationKey: actionKey
3555
3654
  });
3556
- for await (const action of sdk.listActions({ appKey }).items()) {
3655
+ for await (const action of sdk.listActions({ app: appKey }).items()) {
3557
3656
  if ((action.key === actionKey || action.id === actionKey) && action.action_type === actionType) {
3558
3657
  return { data: action };
3559
3658
  }
@@ -3565,7 +3664,7 @@ var getActionPlugin = ({ sdk, context }) => {
3565
3664
  }
3566
3665
  const getActionDefinition = createFunction(
3567
3666
  getAction,
3568
- GetActionSchema,
3667
+ GetActionInputSchema,
3569
3668
  createTelemetryCallback(
3570
3669
  context.eventEmission.emitMethodCalled,
3571
3670
  getAction.name
@@ -3582,9 +3681,9 @@ var getActionPlugin = ({ sdk, context }) => {
3582
3681
  inputSchema: GetActionSchema,
3583
3682
  outputSchema: ActionItemSchema,
3584
3683
  resolvers: {
3585
- appKey: appKeyResolver,
3684
+ app: appKeyResolver,
3586
3685
  actionType: actionTypeResolver,
3587
- actionKey: actionKeyResolver
3686
+ action: actionKeyResolver
3588
3687
  }
3589
3688
  }
3590
3689
  }
@@ -3592,18 +3691,24 @@ var getActionPlugin = ({ sdk, context }) => {
3592
3691
  };
3593
3692
  };
3594
3693
  var GetConnectionParamSchema = z.object({
3595
- connectionId: ConnectionIdPropertySchema.optional(),
3596
- /** @deprecated Use connectionId instead */
3597
- authenticationId: ConnectionIdPropertySchema.optional()
3694
+ connection: ConnectionPropertySchema.optional(),
3695
+ /** @deprecated Use connection instead */
3696
+ connectionId: ConnectionIdPropertySchema.optional().meta({
3697
+ deprecated: true
3698
+ }),
3699
+ /** @deprecated Use connection instead */
3700
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
3701
+ deprecated: true
3702
+ })
3598
3703
  });
3599
3704
 
3600
3705
  // src/plugins/getConnection/index.ts
3601
3706
  var getConnectionPlugin = ({ context }) => {
3602
3707
  async function getConnection(options) {
3603
3708
  const { api } = context;
3604
- const resolvedConnectionId = options.connectionId ?? options.authenticationId;
3709
+ const resolvedConnectionId = options.connection ?? options.connectionId ?? options.authenticationId;
3605
3710
  if (!resolvedConnectionId) {
3606
- throw new Error("connectionId is required");
3711
+ throw new Error("connection is required");
3607
3712
  }
3608
3713
  return await api.get(
3609
3714
  `/api/v0/connections/${encodeURIComponent(String(resolvedConnectionId))}`
@@ -3628,9 +3733,8 @@ var getConnectionPlugin = ({ context }) => {
3628
3733
  inputSchema: GetConnectionParamSchema,
3629
3734
  outputSchema: ConnectionItemSchema,
3630
3735
  resolvers: {
3631
- connectionId: connectionIdGenericResolver
3632
- },
3633
- deprecatedParameters: ["authenticationId"]
3736
+ connection: connectionIdGenericResolver
3737
+ }
3634
3738
  }
3635
3739
  }
3636
3740
  }
@@ -3639,7 +3743,9 @@ var getConnectionPlugin = ({ context }) => {
3639
3743
 
3640
3744
  // src/plugins/findFirstConnection/schemas.ts
3641
3745
  var FindFirstConnectionSchema = ListConnectionsQuerySchema.omit({
3746
+ connections: true,
3642
3747
  connectionIds: true,
3748
+ authenticationIds: true,
3643
3749
  pageSize: true,
3644
3750
  maxItems: true,
3645
3751
  cursor: true
@@ -3679,8 +3785,7 @@ var findFirstConnectionPlugin = ({ sdk, context }) => {
3679
3785
  type: "item",
3680
3786
  itemType: "Connection",
3681
3787
  inputSchema: FindFirstConnectionSchema,
3682
- outputSchema: ConnectionItemSchema,
3683
- deprecatedParameters: ["authenticationIds"]
3788
+ outputSchema: ConnectionItemSchema
3684
3789
  }
3685
3790
  }
3686
3791
  }
@@ -3689,7 +3794,9 @@ var findFirstConnectionPlugin = ({ sdk, context }) => {
3689
3794
 
3690
3795
  // src/plugins/findUniqueConnection/schemas.ts
3691
3796
  var FindUniqueConnectionSchema = ListConnectionsQuerySchema.omit({
3797
+ connections: true,
3692
3798
  connectionIds: true,
3799
+ authenticationIds: true,
3693
3800
  pageSize: true,
3694
3801
  maxItems: true,
3695
3802
  cursor: true
@@ -3735,25 +3842,22 @@ var findUniqueConnectionPlugin = ({ sdk, context }) => {
3735
3842
  type: "item",
3736
3843
  itemType: "Connection",
3737
3844
  inputSchema: FindUniqueConnectionSchema,
3738
- outputSchema: ConnectionItemSchema,
3739
- deprecatedParameters: ["authenticationIds"]
3845
+ outputSchema: ConnectionItemSchema
3740
3846
  }
3741
3847
  }
3742
3848
  }
3743
3849
  };
3744
3850
  };
3745
- var RunActionSchema = z.object({
3746
- appKey: AppKeyPropertySchema,
3747
- actionType: ActionTypePropertySchema,
3748
- actionKey: ActionKeyPropertySchema,
3749
- connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
3750
- "Connection ID to use when running the action. Required if the action needs a connection to authenticate and interact with the service."
3751
- ),
3851
+ var RunActionDescription = "Execute an action with the given inputs";
3852
+ var RunActionBaseSchema = z.object({
3752
3853
  connection: ConnectionPropertySchema.optional().describe(
3753
3854
  "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId."
3754
3855
  ),
3755
- /** @deprecated Use connectionId instead */
3756
- authenticationId: ConnectionIdPropertySchema.nullable().optional(),
3856
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
3857
+ "Connection ID to use when running the action. Required if the action needs a connection to authenticate and interact with the service."
3858
+ ).meta({ deprecated: true }),
3859
+ /** @deprecated Use connection instead */
3860
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
3757
3861
  inputs: InputsPropertySchema.optional().describe(
3758
3862
  "Input parameters for the action"
3759
3863
  ),
@@ -3761,7 +3865,25 @@ var RunActionSchema = z.object({
3761
3865
  pageSize: z.number().min(1).optional().describe("Number of results per page"),
3762
3866
  maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
3763
3867
  cursor: z.string().optional().describe("Cursor to start from")
3764
- }).describe("Execute an action with the given inputs");
3868
+ });
3869
+ var RunActionSchema = z.object({
3870
+ app: AppPropertySchema,
3871
+ actionType: ActionTypePropertySchema,
3872
+ action: ActionPropertySchema
3873
+ }).merge(RunActionBaseSchema).describe(RunActionDescription).meta({
3874
+ aliases: {
3875
+ appKey: "app",
3876
+ actionKey: "action",
3877
+ connectionId: "connection",
3878
+ authenticationId: "connection"
3879
+ }
3880
+ });
3881
+ var RunActionSchemaDeprecated = z.object({
3882
+ appKey: AppKeyPropertySchema,
3883
+ actionType: ActionTypePropertySchema,
3884
+ actionKey: ActionKeyPropertySchema
3885
+ }).merge(RunActionBaseSchema);
3886
+ var RunActionInputSchema = z.union([RunActionSchema, RunActionSchemaDeprecated]).describe(RunActionDescription);
3765
3887
 
3766
3888
  // src/plugins/runAction/index.ts
3767
3889
  async function executeAction(actionOptions) {
@@ -3862,8 +3984,8 @@ var runActionPlugin = ({ sdk, context }) => {
3862
3984
  );
3863
3985
  }
3864
3986
  const actionData = await sdk.getAction({
3865
- appKey,
3866
- actionKey,
3987
+ app: appKey,
3988
+ action: actionKey,
3867
3989
  actionType
3868
3990
  });
3869
3991
  if (actionData.data.action_type !== actionType) {
@@ -3875,9 +3997,9 @@ var runActionPlugin = ({ sdk, context }) => {
3875
3997
  }
3876
3998
  async function runActionPage(options) {
3877
3999
  const { api } = context;
4000
+ const appKey = "app" in options ? options.app : options.appKey;
4001
+ const actionKey = "action" in options ? options.action : options.actionKey;
3878
4002
  const {
3879
- appKey,
3880
- actionKey,
3881
4003
  actionType,
3882
4004
  connectionId,
3883
4005
  connection,
@@ -3892,7 +4014,11 @@ var runActionPlugin = ({ sdk, context }) => {
3892
4014
  authenticationId,
3893
4015
  resolveConnection: context.resolveConnection
3894
4016
  });
3895
- const { selectedApi, actionId } = await getRunActionContext(options);
4017
+ const { selectedApi, actionId } = await getRunActionContext({
4018
+ appKey,
4019
+ actionKey,
4020
+ actionType
4021
+ });
3896
4022
  setMethodMetadata({
3897
4023
  selectedApi,
3898
4024
  operationType: actionType,
@@ -3928,7 +4054,7 @@ var runActionPlugin = ({ sdk, context }) => {
3928
4054
  const methodName = stripPageSuffix(runActionPage.name);
3929
4055
  const runActionDefinition = createPaginatedFunction(
3930
4056
  runActionPage,
3931
- RunActionSchema,
4057
+ RunActionInputSchema,
3932
4058
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
3933
4059
  methodName
3934
4060
  );
@@ -3943,13 +4069,12 @@ var runActionPlugin = ({ sdk, context }) => {
3943
4069
  inputSchema: RunActionSchema,
3944
4070
  outputSchema: ActionResultItemSchema,
3945
4071
  resolvers: {
3946
- appKey: appKeyResolver,
4072
+ app: appKeyResolver,
3947
4073
  actionType: actionTypeResolver,
3948
- actionKey: actionKeyResolver,
3949
- connectionId: connectionIdResolver,
4074
+ action: actionKeyResolver,
4075
+ connection: connectionIdResolver,
3950
4076
  inputs: inputsResolver
3951
- },
3952
- deprecatedParameters: ["authenticationId"]
4077
+ }
3953
4078
  }
3954
4079
  }
3955
4080
  }
@@ -3959,16 +4084,23 @@ var RelayRequestSchema = z.object({
3959
4084
  url: z.string().url().describe("The URL to request (will be proxied through Relay)"),
3960
4085
  method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method"),
3961
4086
  body: z.any().optional().describe("Request body as a string"),
3962
- connectionId: ConnectionIdPropertySchema.optional(),
3963
- /** @deprecated Use connectionId instead */
3964
- authenticationId: AuthenticationIdPropertySchema.optional(),
4087
+ connection: ConnectionPropertySchema.optional(),
4088
+ connectionId: ConnectionIdPropertySchema.optional().meta({
4089
+ deprecated: true
4090
+ }),
4091
+ /** @deprecated Use connection instead */
4092
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
4093
+ deprecated: true
4094
+ }),
3965
4095
  callbackUrl: z.string().url().optional().describe("URL to send async response to (makes request async)"),
3966
4096
  headers: z.union([
3967
4097
  z.record(z.string(), z.string()),
3968
4098
  z.instanceof(Headers),
3969
4099
  z.array(z.tuple([z.string(), z.string()]))
3970
4100
  ]).optional().describe("Request headers")
3971
- }).describe("Make authenticated HTTP requests through Zapier's Relay service");
4101
+ }).describe("Make authenticated HTTP requests through Zapier's Relay service").meta({
4102
+ aliases: { connectionId: "connection", authenticationId: "connection" }
4103
+ });
3972
4104
  var RelayFetchSchema = RelayRequestSchema;
3973
4105
 
3974
4106
  // src/utils/logging.ts
@@ -3991,16 +4123,16 @@ var requestPlugin = ({ sdk, context }) => {
3991
4123
  method,
3992
4124
  body,
3993
4125
  headers,
4126
+ connection,
3994
4127
  connectionId,
3995
4128
  authenticationId,
3996
4129
  callbackUrl
3997
4130
  } = options;
3998
- const resolvedConnectionId = connectionId ?? authenticationId;
3999
4131
  return sdk.fetch(url, {
4000
4132
  method,
4001
4133
  body,
4002
4134
  headers,
4003
- connectionId: resolvedConnectionId,
4135
+ connection: connection ?? connectionId ?? authenticationId,
4004
4136
  callbackUrl
4005
4137
  });
4006
4138
  }
@@ -4020,8 +4152,7 @@ var requestPlugin = ({ sdk, context }) => {
4020
4152
  packages: ["cli", "mcp"],
4021
4153
  categories: ["http", "deprecated"],
4022
4154
  returnType: "Response",
4023
- inputSchema: RelayRequestSchema,
4024
- deprecatedParameters: ["authenticationId"]
4155
+ inputSchema: RelayRequestSchema
4025
4156
  }
4026
4157
  }
4027
4158
  }
@@ -4099,8 +4230,8 @@ var ActionEntrySchema = z.object({
4099
4230
  actionKey: z.string().describe("Action key identifier"),
4100
4231
  actionType: z.string().describe("Action type (e.g., 'read', 'write', 'search')"),
4101
4232
  connectionId: ConnectionIdPropertySchema.nullable().optional(),
4102
- /** @deprecated Use connectionId instead */
4103
- authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
4233
+ /** @deprecated Use connection instead */
4234
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
4104
4235
  inputs: z.record(z.string(), z.unknown()).optional().describe("Resolved input values"),
4105
4236
  schema: z.record(z.string(), z.unknown()).describe(
4106
4237
  "Complete JSON Schema from getInputFieldsSchema (includes $schema, type, properties, required, etc.)"
@@ -5973,7 +6104,8 @@ var TableItemSchema = z.object({
5973
6104
  parent_table_id: z.string().optional()
5974
6105
  });
5975
6106
  var ListTablesOptionsSchema = z.object({
5976
- tableIds: z.array(z.string()).optional().describe("Filter by specific table IDs"),
6107
+ tables: TablesPropertySchema.optional(),
6108
+ tableIds: z.array(z.string()).optional().describe("Filter by specific table IDs").meta({ deprecated: true }),
5977
6109
  kind: z.enum(["table", "virtual_table", "both"]).optional().describe("Filter by table type"),
5978
6110
  search: z.string().optional().describe("Search term to filter tables by name"),
5979
6111
  owner: z.string().optional().describe(
@@ -6010,8 +6142,9 @@ var listTablesPlugin = ({ context }) => {
6010
6142
  if (options.pageSize !== void 0) {
6011
6143
  searchParams.limit = options.pageSize.toString();
6012
6144
  }
6013
- if (options?.tableIds && options.tableIds.length > 0) {
6014
- searchParams.ids = options.tableIds.join(",");
6145
+ const tableIds = "tables" in options && options.tables ? options.tables : options.tableIds;
6146
+ if (tableIds && tableIds.length > 0) {
6147
+ searchParams.ids = tableIds.join(",");
6015
6148
  }
6016
6149
  if (options?.kind) {
6017
6150
  searchParams.kind = options.kind;
@@ -6091,38 +6224,41 @@ var listTablesPlugin = ({ context }) => {
6091
6224
  var GetTableApiResponseSchema = z.object({
6092
6225
  data: TableApiItemSchema
6093
6226
  });
6227
+ var GetTableDescription = "Get detailed information about a specific table";
6094
6228
  var GetTableOptionsSchema = z.object({
6229
+ table: TablePropertySchema
6230
+ }).describe(GetTableDescription).meta({ aliases: { tableId: "table" } });
6231
+ var GetTableOptionsSchemaDeprecated = z.object({
6095
6232
  tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table to retrieve")
6096
- }).describe("Get detailed information about a specific table");
6233
+ });
6234
+ var GetTableOptionsInputSchema = z.union([GetTableOptionsSchema, GetTableOptionsSchemaDeprecated]).describe(GetTableDescription);
6097
6235
 
6098
6236
  // src/plugins/tables/getTable/index.ts
6099
6237
  var getTablePlugin = ({ context }) => {
6100
6238
  async function getTable(options) {
6101
6239
  const { api } = context;
6102
- const rawResponse = await api.get(
6103
- `/tables/api/v1/tables/${options.tableId}`,
6104
- {
6105
- customErrorHandler: ({ status }) => {
6106
- if (status === 401) {
6107
- return new ZapierAuthenticationError(
6108
- `Authentication failed. Your token may not have permission to access this table or may be expired. (HTTP ${status})`,
6109
- { statusCode: status }
6110
- );
6111
- }
6112
- if (status === 403) {
6113
- return new ZapierAuthenticationError(
6114
- `Access forbidden. Your token may not have the required scopes to access this table. (HTTP ${status})`,
6115
- { statusCode: status }
6116
- );
6117
- }
6118
- if (status === 404) {
6119
- return new Error(`Table not found: ${options.tableId}`);
6120
- }
6121
- return void 0;
6122
- },
6123
- authRequired: true
6124
- }
6125
- );
6240
+ const tableId = "table" in options ? options.table : options.tableId;
6241
+ const rawResponse = await api.get(`/tables/api/v1/tables/${tableId}`, {
6242
+ customErrorHandler: ({ status }) => {
6243
+ if (status === 401) {
6244
+ return new ZapierAuthenticationError(
6245
+ `Authentication failed. Your token may not have permission to access this table or may be expired. (HTTP ${status})`,
6246
+ { statusCode: status }
6247
+ );
6248
+ }
6249
+ if (status === 403) {
6250
+ return new ZapierAuthenticationError(
6251
+ `Access forbidden. Your token may not have the required scopes to access this table. (HTTP ${status})`,
6252
+ { statusCode: status }
6253
+ );
6254
+ }
6255
+ if (status === 404) {
6256
+ return new Error(`Table not found: ${tableId}`);
6257
+ }
6258
+ return void 0;
6259
+ },
6260
+ authRequired: true
6261
+ });
6126
6262
  const response = GetTableApiResponseSchema.parse(rawResponse);
6127
6263
  return {
6128
6264
  data: transformTableItem(response.data)
@@ -6130,7 +6266,7 @@ var getTablePlugin = ({ context }) => {
6130
6266
  }
6131
6267
  const getTableDefinition = createFunction(
6132
6268
  getTable,
6133
- GetTableOptionsSchema,
6269
+ GetTableOptionsInputSchema,
6134
6270
  createTelemetryCallback(
6135
6271
  context.eventEmission.emitMethodCalled,
6136
6272
  getTable.name
@@ -6147,7 +6283,7 @@ var getTablePlugin = ({ context }) => {
6147
6283
  inputSchema: GetTableOptionsSchema,
6148
6284
  outputSchema: TableItemSchema,
6149
6285
  resolvers: {
6150
- tableId: tableIdResolver
6286
+ table: tableIdResolver
6151
6287
  }
6152
6288
  }
6153
6289
  }
@@ -6222,16 +6358,22 @@ var createTablePlugin = ({ context }) => {
6222
6358
  }
6223
6359
  };
6224
6360
  };
6361
+ var DeleteTableDescription = "Delete a table by its ID";
6225
6362
  var DeleteTableOptionsSchema = z.object({
6363
+ table: TablePropertySchema
6364
+ }).describe(DeleteTableDescription).meta({ aliases: { tableId: "table" } });
6365
+ var DeleteTableOptionsSchemaDeprecated = z.object({
6226
6366
  tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table to delete")
6227
- }).describe("Delete a table by its ID");
6367
+ });
6368
+ var DeleteTableOptionsInputSchema = z.union([DeleteTableOptionsSchema, DeleteTableOptionsSchemaDeprecated]).describe(DeleteTableDescription);
6228
6369
 
6229
6370
  // src/plugins/tables/deleteTable/index.ts
6230
6371
  var deleteTablePlugin = ({ context }) => {
6231
6372
  async function deleteTable(options) {
6232
6373
  await context.checkCapability("canDeleteTables");
6233
6374
  const { api } = context;
6234
- await api.delete(`/tables/api/v1/tables/${options.tableId}`, void 0, {
6375
+ const tableId = "table" in options ? options.table : options.tableId;
6376
+ await api.delete(`/tables/api/v1/tables/${tableId}`, void 0, {
6235
6377
  customErrorHandler: ({ status }) => {
6236
6378
  if (status === 401) {
6237
6379
  return new ZapierAuthenticationError(
@@ -6255,7 +6397,7 @@ var deleteTablePlugin = ({ context }) => {
6255
6397
  }
6256
6398
  const deleteTableDefinition = createFunction(
6257
6399
  deleteTable,
6258
- DeleteTableOptionsSchema,
6400
+ DeleteTableOptionsInputSchema,
6259
6401
  createTelemetryCallback(
6260
6402
  context.eventEmission.emitMethodCalled,
6261
6403
  deleteTable.name
@@ -6271,7 +6413,7 @@ var deleteTablePlugin = ({ context }) => {
6271
6413
  itemType: "Table",
6272
6414
  inputSchema: DeleteTableOptionsSchema,
6273
6415
  resolvers: {
6274
- tableId: tableIdResolver
6416
+ table: tableIdResolver
6275
6417
  },
6276
6418
  confirm: "delete"
6277
6419
  }
@@ -6284,17 +6426,19 @@ var deleteTablePlugin = ({ context }) => {
6284
6426
  var listTableFieldsPlugin = ({ context }) => {
6285
6427
  async function listTableFields(options) {
6286
6428
  const { api } = context;
6429
+ const tableId = "table" in options ? options.table : options.tableId;
6430
+ const fieldKeys = "fields" in options ? options.fields : options.fieldKeys;
6287
6431
  const searchParams = {};
6288
- if (options.fieldKeys && options.fieldKeys.length > 0) {
6432
+ if (fieldKeys && fieldKeys.length > 0) {
6289
6433
  const numericIds = await resolveFieldKeys({
6290
6434
  api,
6291
- tableId: options.tableId,
6292
- fieldKeys: options.fieldKeys
6435
+ tableId,
6436
+ fieldKeys
6293
6437
  });
6294
6438
  searchParams.field_ids = numericIds.join(",");
6295
6439
  }
6296
6440
  const rawResponse = await api.get(
6297
- `/tables/api/v1/tables/${options.tableId}/fields`,
6441
+ `/tables/api/v1/tables/${tableId}/fields`,
6298
6442
  {
6299
6443
  searchParams: Object.keys(searchParams).length > 0 ? searchParams : void 0,
6300
6444
  customErrorHandler: ({ status }) => {
@@ -6311,7 +6455,7 @@ var listTableFieldsPlugin = ({ context }) => {
6311
6455
  );
6312
6456
  }
6313
6457
  if (status === 404) {
6314
- return new Error(`Table not found: ${options.tableId}`);
6458
+ return new Error(`Table not found: ${tableId}`);
6315
6459
  }
6316
6460
  return void 0;
6317
6461
  },
@@ -6325,7 +6469,7 @@ var listTableFieldsPlugin = ({ context }) => {
6325
6469
  }
6326
6470
  const listTableFieldsDefinition = createFunction(
6327
6471
  listTableFields,
6328
- ListTableFieldsOptionsSchema,
6472
+ ListTableFieldsOptionsInputSchema,
6329
6473
  createTelemetryCallback(
6330
6474
  context.eventEmission.emitMethodCalled,
6331
6475
  listTableFields.name
@@ -6342,7 +6486,7 @@ var listTableFieldsPlugin = ({ context }) => {
6342
6486
  inputSchema: ListTableFieldsOptionsSchema,
6343
6487
  outputSchema: FieldItemSchema,
6344
6488
  resolvers: {
6345
- tableId: tableIdResolver
6489
+ table: tableIdResolver
6346
6490
  }
6347
6491
  }
6348
6492
  }
@@ -6366,17 +6510,28 @@ var NewFieldSchema = z.object({
6366
6510
  options: z.record(z.string(), z.unknown()).optional().describe("Data configuration options for the field"),
6367
6511
  config: z.record(z.string(), z.unknown()).optional().describe("Display configuration for the field")
6368
6512
  });
6369
- var CreateTableFieldsOptionsSchema = z.object({
6370
- tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6513
+ var CreateTableFieldsDescription = "Create one or more fields in a table";
6514
+ var CreateTableFieldsBase = z.object({
6371
6515
  fields: z.array(NewFieldSchema).min(1).describe("Array of field definitions to create")
6372
- }).describe("Create one or more fields in a table");
6516
+ });
6517
+ var CreateTableFieldsOptionsSchema = CreateTableFieldsBase.extend({
6518
+ table: TablePropertySchema
6519
+ }).describe(CreateTableFieldsDescription).meta({ aliases: { tableId: "table" } });
6520
+ var CreateTableFieldsOptionsSchemaDeprecated = CreateTableFieldsBase.extend({
6521
+ tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
6522
+ });
6523
+ var CreateTableFieldsOptionsInputSchema = z.union([
6524
+ CreateTableFieldsOptionsSchema,
6525
+ CreateTableFieldsOptionsSchemaDeprecated
6526
+ ]).describe(CreateTableFieldsDescription);
6373
6527
 
6374
6528
  // src/plugins/tables/createTableFields/index.ts
6375
6529
  var createTableFieldsPlugin = ({ context }) => {
6376
6530
  async function createTableFields(options) {
6377
6531
  const { api } = context;
6532
+ const tableId = "table" in options ? options.table : options.tableId;
6378
6533
  const rawResponse = await api.post(
6379
- `/tables/api/v1/tables/${options.tableId}/fields`,
6534
+ `/tables/api/v1/tables/${tableId}/fields`,
6380
6535
  {
6381
6536
  new_fields: options.fields
6382
6537
  },
@@ -6406,7 +6561,7 @@ var createTableFieldsPlugin = ({ context }) => {
6406
6561
  }
6407
6562
  const createTableFieldsDefinition = createFunction(
6408
6563
  createTableFields,
6409
- CreateTableFieldsOptionsSchema,
6564
+ CreateTableFieldsOptionsInputSchema,
6410
6565
  createTelemetryCallback(
6411
6566
  context.eventEmission.emitMethodCalled,
6412
6567
  createTableFields.name
@@ -6423,7 +6578,7 @@ var createTableFieldsPlugin = ({ context }) => {
6423
6578
  inputSchema: CreateTableFieldsOptionsSchema,
6424
6579
  outputSchema: FieldItemSchema,
6425
6580
  resolvers: {
6426
- tableId: tableIdResolver,
6581
+ table: tableIdResolver,
6427
6582
  fields: tableFieldsResolver
6428
6583
  }
6429
6584
  }
@@ -6431,24 +6586,35 @@ var createTableFieldsPlugin = ({ context }) => {
6431
6586
  }
6432
6587
  };
6433
6588
  };
6589
+ var DeleteTableFieldsDescription = "Delete one or more fields from a table";
6434
6590
  var DeleteTableFieldsOptionsSchema = z.object({
6591
+ table: TablePropertySchema,
6592
+ fields: FieldsPropertySchema.min(1)
6593
+ }).describe(DeleteTableFieldsDescription).meta({ aliases: { tableId: "table", fieldKeys: "fields" } });
6594
+ var DeleteTableFieldsOptionsSchemaDeprecated = z.object({
6435
6595
  tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6436
6596
  fieldKeys: z.array(z.union([z.string(), z.number()])).min(1).describe(
6437
6597
  'Fields to delete. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6).'
6438
6598
  )
6439
- }).describe("Delete one or more fields from a table");
6599
+ });
6600
+ var DeleteTableFieldsOptionsInputSchema = z.union([
6601
+ DeleteTableFieldsOptionsSchema,
6602
+ DeleteTableFieldsOptionsSchemaDeprecated
6603
+ ]).describe(DeleteTableFieldsDescription);
6440
6604
 
6441
6605
  // src/plugins/tables/deleteTableFields/index.ts
6442
6606
  var deleteTableFieldsPlugin = ({ context }) => {
6443
6607
  async function deleteTableFields(options) {
6444
6608
  const { api } = context;
6609
+ const tableId = "table" in options ? options.table : options.tableId;
6610
+ const fieldKeys = "fields" in options ? options.fields : options.fieldKeys;
6445
6611
  const numericFieldIds = await resolveFieldKeys({
6446
6612
  api,
6447
- tableId: options.tableId,
6448
- fieldKeys: options.fieldKeys
6613
+ tableId,
6614
+ fieldKeys
6449
6615
  });
6450
6616
  await api.delete(
6451
- `/tables/api/v1/tables/${options.tableId}/fields`,
6617
+ `/tables/api/v1/tables/${tableId}/fields`,
6452
6618
  { field_ids: numericFieldIds },
6453
6619
  {
6454
6620
  customErrorHandler: ({ status }) => {
@@ -6475,7 +6641,7 @@ var deleteTableFieldsPlugin = ({ context }) => {
6475
6641
  }
6476
6642
  const deleteTableFieldsDefinition = createFunction(
6477
6643
  deleteTableFields,
6478
- DeleteTableFieldsOptionsSchema,
6644
+ DeleteTableFieldsOptionsInputSchema,
6479
6645
  createTelemetryCallback(
6480
6646
  context.eventEmission.emitMethodCalled,
6481
6647
  deleteTableFields.name
@@ -6491,8 +6657,8 @@ var deleteTableFieldsPlugin = ({ context }) => {
6491
6657
  itemType: "Field",
6492
6658
  inputSchema: DeleteTableFieldsOptionsSchema,
6493
6659
  resolvers: {
6494
- tableId: tableIdResolver,
6495
- fieldKeys: tableFieldIdsResolver
6660
+ table: tableIdResolver,
6661
+ fields: tableFieldIdsResolver
6496
6662
  },
6497
6663
  confirm: "delete"
6498
6664
  }
@@ -6527,11 +6693,19 @@ var RecordItemSchema = withFormatter(RecordItemSchemaBase, {
6527
6693
  var GetTableRecordApiResponseSchema = z.object({
6528
6694
  data: RecordApiItemSchema
6529
6695
  });
6530
- var GetTableRecordOptionsSchema = z.object({
6531
- tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6532
- recordId: z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID").describe("The unique identifier of the record"),
6696
+ var GetTableRecordDescription = "Get a single record from a table by ID";
6697
+ var GetTableRecordOptionsBaseSchema = z.object({
6533
6698
  keyMode: KeyModeSchema
6534
- }).describe("Get a single record from a table by ID");
6699
+ });
6700
+ var GetTableRecordOptionsSchema = GetTableRecordOptionsBaseSchema.extend({
6701
+ table: TablePropertySchema,
6702
+ record: RecordPropertySchema
6703
+ }).describe(GetTableRecordDescription).meta({ aliases: { tableId: "table", recordId: "record" } });
6704
+ var GetTableRecordOptionsSchemaDeprecated = GetTableRecordOptionsBaseSchema.extend({
6705
+ tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6706
+ recordId: z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID").describe("The unique identifier of the record")
6707
+ });
6708
+ var GetTableRecordOptionsInputSchema = z.union([GetTableRecordOptionsSchema, GetTableRecordOptionsSchemaDeprecated]).describe(GetTableRecordDescription);
6535
6709
 
6536
6710
  // src/formatters/tableRecord.ts
6537
6711
  var tableRecordFormatter = {
@@ -6540,7 +6714,7 @@ var tableRecordFormatter = {
6540
6714
  const hasFieldIds = Object.keys(item.data).some(isFieldId);
6541
6715
  if (!hasFieldIds) return {};
6542
6716
  const { data: fields } = await sdk.listTableFields({
6543
- tableId: params.tableId
6717
+ table: params.tableId
6544
6718
  });
6545
6719
  return Object.fromEntries(fields.map((f) => [f.id, f.name]));
6546
6720
  },
@@ -6559,8 +6733,10 @@ var tableRecordFormatter = {
6559
6733
  var getTableRecordPlugin = ({ context }) => {
6560
6734
  async function getTableRecord(options) {
6561
6735
  const { api } = context;
6736
+ const tableId = "table" in options ? options.table : options.tableId;
6737
+ const recordId = "record" in options ? options.record : options.recordId;
6562
6738
  const rawResponse = await api.get(
6563
- `/tables/api/v1/tables/${options.tableId}/records/${options.recordId}`,
6739
+ `/tables/api/v1/tables/${tableId}/records/${recordId}`,
6564
6740
  {
6565
6741
  customErrorHandler: ({ status }) => {
6566
6742
  if (status === 401) {
@@ -6576,7 +6752,7 @@ var getTableRecordPlugin = ({ context }) => {
6576
6752
  );
6577
6753
  }
6578
6754
  if (status === 404) {
6579
- return new Error(`Record not found: ${options.recordId}`);
6755
+ return new Error(`Record not found: ${recordId}`);
6580
6756
  }
6581
6757
  return void 0;
6582
6758
  },
@@ -6586,7 +6762,7 @@ var getTableRecordPlugin = ({ context }) => {
6586
6762
  const response = GetTableRecordApiResponseSchema.parse(rawResponse);
6587
6763
  const translator = await createFieldKeyTranslator({
6588
6764
  api,
6589
- tableId: options.tableId,
6765
+ tableId,
6590
6766
  keyMode: options.keyMode
6591
6767
  });
6592
6768
  return {
@@ -6598,7 +6774,7 @@ var getTableRecordPlugin = ({ context }) => {
6598
6774
  }
6599
6775
  const getTableRecordDefinition = createFunction(
6600
6776
  getTableRecord,
6601
- GetTableRecordOptionsSchema,
6777
+ GetTableRecordOptionsInputSchema,
6602
6778
  createTelemetryCallback(
6603
6779
  context.eventEmission.emitMethodCalled,
6604
6780
  getTableRecord.name
@@ -6615,8 +6791,8 @@ var getTableRecordPlugin = ({ context }) => {
6615
6791
  inputSchema: GetTableRecordOptionsSchema,
6616
6792
  outputSchema: RecordItemSchema,
6617
6793
  resolvers: {
6618
- tableId: tableIdResolver,
6619
- recordId: tableRecordIdResolver
6794
+ table: tableIdResolver,
6795
+ record: tableRecordIdResolver
6620
6796
  },
6621
6797
  formatter: tableRecordFormatter
6622
6798
  }
@@ -6661,15 +6837,25 @@ var SortConditionSchema = z.object({
6661
6837
  fieldKey: z.string().describe("The field key to sort by"),
6662
6838
  direction: SortDirectionSchema.optional().default("asc").describe("Sort direction")
6663
6839
  });
6664
- var ListTableRecordsOptionsSchema = z.object({
6665
- tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6840
+ var ListTableRecordsDescription = "List records in a table with optional filtering and sorting";
6841
+ var ListTableRecordsBase = z.object({
6666
6842
  filters: z.array(FilterConditionSchema).optional().describe("Filter conditions for the query"),
6667
6843
  sort: SortConditionSchema.optional().describe("Sort records by a field"),
6668
6844
  pageSize: z.number().min(1).max(1e3).optional().describe("Number of records per page (max 1000)"),
6669
6845
  maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
6670
6846
  cursor: z.string().optional().describe("Cursor to start from"),
6671
6847
  keyMode: KeyModeSchema
6672
- }).describe("List records in a table with optional filtering and sorting");
6848
+ });
6849
+ var ListTableRecordsOptionsSchema = ListTableRecordsBase.extend({
6850
+ table: TablePropertySchema
6851
+ }).describe(ListTableRecordsDescription).meta({ aliases: { tableId: "table" } });
6852
+ var ListTableRecordsOptionsSchemaDeprecated = ListTableRecordsBase.extend({
6853
+ tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
6854
+ });
6855
+ var ListTableRecordsOptionsInputSchema = z.union([
6856
+ ListTableRecordsOptionsSchema,
6857
+ ListTableRecordsOptionsSchemaDeprecated
6858
+ ]).describe(ListTableRecordsDescription);
6673
6859
 
6674
6860
  // src/plugins/tables/listTableRecords/index.ts
6675
6861
  function extractNextCursor2(meta) {
@@ -6681,9 +6867,10 @@ function extractNextCursor2(meta) {
6681
6867
  var listTableRecordsPlugin = ({ context }) => {
6682
6868
  async function listTableRecordsPage(options) {
6683
6869
  const { api } = context;
6870
+ const tableId = "table" in options ? options.table : options.tableId;
6684
6871
  const translator = await createFieldKeyTranslator({
6685
6872
  api,
6686
- tableId: options.tableId,
6873
+ tableId,
6687
6874
  keyMode: options.keyMode
6688
6875
  });
6689
6876
  const body = {};
@@ -6712,7 +6899,7 @@ var listTableRecordsPlugin = ({ context }) => {
6712
6899
  };
6713
6900
  }
6714
6901
  const rawResponse = await api.post(
6715
- `/tables/api/v1/tables/${options.tableId}/records/query`,
6902
+ `/tables/api/v1/tables/${tableId}/records/query`,
6716
6903
  body,
6717
6904
  {
6718
6905
  searchParams: { allow_nested_queries: "true" },
@@ -6730,7 +6917,7 @@ var listTableRecordsPlugin = ({ context }) => {
6730
6917
  );
6731
6918
  }
6732
6919
  if (status === 404) {
6733
- return new Error(`Table not found: ${options.tableId}`);
6920
+ return new Error(`Table not found: ${tableId}`);
6734
6921
  }
6735
6922
  return void 0;
6736
6923
  },
@@ -6750,7 +6937,7 @@ var listTableRecordsPlugin = ({ context }) => {
6750
6937
  const methodName = stripPageSuffix(listTableRecordsPage.name);
6751
6938
  const listTableRecordsDefinition = createPaginatedFunction(
6752
6939
  listTableRecordsPage,
6753
- ListTableRecordsOptionsSchema,
6940
+ ListTableRecordsOptionsInputSchema,
6754
6941
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
6755
6942
  methodName,
6756
6943
  DEFAULT_PAGE_SIZE
@@ -6766,7 +6953,7 @@ var listTableRecordsPlugin = ({ context }) => {
6766
6953
  inputSchema: ListTableRecordsOptionsSchema,
6767
6954
  outputSchema: RecordItemSchema,
6768
6955
  resolvers: {
6769
- tableId: tableIdResolver,
6956
+ table: tableIdResolver,
6770
6957
  filters: tableFiltersResolver,
6771
6958
  sort: tableSortResolver
6772
6959
  },
@@ -6789,23 +6976,36 @@ var CreateTableRecordsApiResponseSchema = z.object({
6789
6976
  var NewRecordSchema = z.object({
6790
6977
  data: z.record(z.string(), z.unknown()).describe("The field values for the record, keyed by field ID")
6791
6978
  });
6792
- var CreateTableRecordsOptionsSchema = z.object({
6793
- tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6979
+ var CreateTableRecordsDescription = "Create one or more records in a table";
6980
+ var CreateTableRecordsBase = z.object({
6794
6981
  records: z.array(NewRecordSchema).min(1).max(100).describe("Array of records to create (max 100)"),
6795
6982
  keyMode: KeyModeSchema
6796
- }).describe("Create one or more records in a table");
6983
+ });
6984
+ var CreateTableRecordsOptionsSchema = CreateTableRecordsBase.extend({
6985
+ table: TablePropertySchema
6986
+ }).describe(CreateTableRecordsDescription).meta({ aliases: { tableId: "table" } });
6987
+ var CreateTableRecordsOptionsSchemaDeprecated = CreateTableRecordsBase.extend(
6988
+ {
6989
+ tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
6990
+ }
6991
+ );
6992
+ var CreateTableRecordsOptionsInputSchema = z.union([
6993
+ CreateTableRecordsOptionsSchema,
6994
+ CreateTableRecordsOptionsSchemaDeprecated
6995
+ ]).describe(CreateTableRecordsDescription);
6797
6996
 
6798
6997
  // src/plugins/tables/createTableRecords/index.ts
6799
6998
  var createTableRecordsPlugin = ({ context }) => {
6800
6999
  async function createTableRecords(options) {
6801
7000
  const { api } = context;
7001
+ const tableId = "table" in options ? options.table : options.tableId;
6802
7002
  const translator = await createFieldKeyTranslator({
6803
7003
  api,
6804
- tableId: options.tableId,
7004
+ tableId,
6805
7005
  keyMode: options.keyMode
6806
7006
  });
6807
7007
  const rawResponse = await api.post(
6808
- `/tables/api/v1/tables/${options.tableId}/records`,
7008
+ `/tables/api/v1/tables/${tableId}/records`,
6809
7009
  {
6810
7010
  new_records: options.records.map((record) => ({
6811
7011
  data: translator.translateInput(record.data)
@@ -6826,7 +7026,7 @@ var createTableRecordsPlugin = ({ context }) => {
6826
7026
  );
6827
7027
  }
6828
7028
  if (status === 404) {
6829
- return new Error(`Table not found: ${options.tableId}`);
7029
+ return new Error(`Table not found: ${tableId}`);
6830
7030
  }
6831
7031
  return void 0;
6832
7032
  },
@@ -6847,7 +7047,7 @@ var createTableRecordsPlugin = ({ context }) => {
6847
7047
  }
6848
7048
  const createTableRecordsDefinition = createFunction(
6849
7049
  createTableRecords,
6850
- CreateTableRecordsOptionsSchema,
7050
+ CreateTableRecordsOptionsInputSchema,
6851
7051
  createTelemetryCallback(
6852
7052
  context.eventEmission.emitMethodCalled,
6853
7053
  createTableRecords.name
@@ -6864,7 +7064,7 @@ var createTableRecordsPlugin = ({ context }) => {
6864
7064
  inputSchema: CreateTableRecordsOptionsSchema,
6865
7065
  outputSchema: RecordItemSchema,
6866
7066
  resolvers: {
6867
- tableId: tableIdResolver,
7067
+ table: tableIdResolver,
6868
7068
  records: tableRecordsResolver
6869
7069
  },
6870
7070
  formatter: tableRecordFormatter
@@ -6873,20 +7073,29 @@ var createTableRecordsPlugin = ({ context }) => {
6873
7073
  }
6874
7074
  };
6875
7075
  };
7076
+ var DeleteTableRecordsDescription = "Delete one or more records from a table";
6876
7077
  var DeleteTableRecordsOptionsSchema = z.object({
7078
+ table: TablePropertySchema,
7079
+ records: RecordsPropertySchema
7080
+ }).describe(DeleteTableRecordsDescription).meta({ aliases: { tableId: "table", recordIds: "records" } });
7081
+ var DeleteTableRecordsOptionsSchemaDeprecated = z.object({
6877
7082
  tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6878
- recordIds: z.array(
6879
- z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID")
6880
- ).min(1).max(100).describe("Array of record IDs to delete (max 100)")
6881
- }).describe("Delete one or more records from a table");
7083
+ recordIds: z.array(z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID")).min(1).max(100).describe("Array of record IDs to delete (max 100)")
7084
+ });
7085
+ var DeleteTableRecordsOptionsInputSchema = z.union([
7086
+ DeleteTableRecordsOptionsSchema,
7087
+ DeleteTableRecordsOptionsSchemaDeprecated
7088
+ ]).describe(DeleteTableRecordsDescription);
6882
7089
 
6883
7090
  // src/plugins/tables/deleteTableRecords/index.ts
6884
7091
  var deleteTableRecordsPlugin = ({ context }) => {
6885
7092
  async function deleteTableRecords(options) {
6886
7093
  const { api } = context;
7094
+ const tableId = "table" in options ? options.table : options.tableId;
7095
+ const recordIds = "records" in options ? options.records : options.recordIds;
6887
7096
  await api.delete(
6888
- `/tables/api/v1/tables/${options.tableId}/records`,
6889
- { record_ids: options.recordIds },
7097
+ `/tables/api/v1/tables/${tableId}/records`,
7098
+ { record_ids: recordIds },
6890
7099
  {
6891
7100
  customErrorHandler: ({ status }) => {
6892
7101
  if (status === 401) {
@@ -6912,7 +7121,7 @@ var deleteTableRecordsPlugin = ({ context }) => {
6912
7121
  }
6913
7122
  const deleteTableRecordsDefinition = createFunction(
6914
7123
  deleteTableRecords,
6915
- DeleteTableRecordsOptionsSchema,
7124
+ DeleteTableRecordsOptionsInputSchema,
6916
7125
  createTelemetryCallback(
6917
7126
  context.eventEmission.emitMethodCalled,
6918
7127
  deleteTableRecords.name
@@ -6928,8 +7137,8 @@ var deleteTableRecordsPlugin = ({ context }) => {
6928
7137
  itemType: "Record",
6929
7138
  inputSchema: DeleteTableRecordsOptionsSchema,
6930
7139
  resolvers: {
6931
- tableId: tableIdResolver,
6932
- recordIds: tableRecordIdsResolver
7140
+ table: tableIdResolver,
7141
+ records: tableRecordIdsResolver
6933
7142
  },
6934
7143
  confirm: "delete"
6935
7144
  }
@@ -6951,23 +7160,36 @@ var UpdateRecordSchema = z.object({
6951
7160
  id: z.string().describe("The record ID to update"),
6952
7161
  data: z.record(z.string(), z.unknown()).describe("The field values to update, keyed by field key")
6953
7162
  });
6954
- var UpdateTableRecordsOptionsSchema = z.object({
6955
- tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
7163
+ var UpdateTableRecordsDescription = "Update one or more records in a table";
7164
+ var UpdateTableRecordsBase = z.object({
6956
7165
  records: z.array(UpdateRecordSchema).min(1).max(100).describe("Array of records to update (max 100)"),
6957
7166
  keyMode: KeyModeSchema
6958
- }).describe("Update one or more records in a table");
7167
+ });
7168
+ var UpdateTableRecordsOptionsSchema = UpdateTableRecordsBase.extend({
7169
+ table: TablePropertySchema
7170
+ }).describe(UpdateTableRecordsDescription).meta({ aliases: { tableId: "table" } });
7171
+ var UpdateTableRecordsOptionsSchemaDeprecated = UpdateTableRecordsBase.extend(
7172
+ {
7173
+ tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
7174
+ }
7175
+ );
7176
+ var UpdateTableRecordsOptionsInputSchema = z.union([
7177
+ UpdateTableRecordsOptionsSchema,
7178
+ UpdateTableRecordsOptionsSchemaDeprecated
7179
+ ]).describe(UpdateTableRecordsDescription);
6959
7180
 
6960
7181
  // src/plugins/tables/updateTableRecords/index.ts
6961
7182
  var updateTableRecordsPlugin = ({ context }) => {
6962
7183
  async function updateTableRecords(options) {
6963
7184
  const { api } = context;
7185
+ const tableId = "table" in options ? options.table : options.tableId;
6964
7186
  const translator = await createFieldKeyTranslator({
6965
7187
  api,
6966
- tableId: options.tableId,
7188
+ tableId,
6967
7189
  keyMode: options.keyMode
6968
7190
  });
6969
7191
  const rawResponse = await api.patch(
6970
- `/tables/api/v1/tables/${options.tableId}/records`,
7192
+ `/tables/api/v1/tables/${tableId}/records`,
6971
7193
  {
6972
7194
  updated_records: options.records.map((record) => ({
6973
7195
  id: record.id,
@@ -6989,7 +7211,7 @@ var updateTableRecordsPlugin = ({ context }) => {
6989
7211
  );
6990
7212
  }
6991
7213
  if (status === 404) {
6992
- return new Error(`Table not found: ${options.tableId}`);
7214
+ return new Error(`Table not found: ${tableId}`);
6993
7215
  }
6994
7216
  return void 0;
6995
7217
  },
@@ -7010,7 +7232,7 @@ var updateTableRecordsPlugin = ({ context }) => {
7010
7232
  }
7011
7233
  const updateTableRecordsDefinition = createFunction(
7012
7234
  updateTableRecords,
7013
- UpdateTableRecordsOptionsSchema,
7235
+ UpdateTableRecordsOptionsInputSchema,
7014
7236
  createTelemetryCallback(
7015
7237
  context.eventEmission.emitMethodCalled,
7016
7238
  updateTableRecords.name
@@ -7027,7 +7249,7 @@ var updateTableRecordsPlugin = ({ context }) => {
7027
7249
  inputSchema: UpdateTableRecordsOptionsSchema,
7028
7250
  outputSchema: RecordItemSchema,
7029
7251
  resolvers: {
7030
- tableId: tableIdResolver,
7252
+ table: tableIdResolver,
7031
7253
  records: tableUpdateRecordsResolver
7032
7254
  },
7033
7255
  formatter: tableRecordFormatter
@@ -7101,7 +7323,6 @@ var registryPlugin = ({ sdk, context }) => {
7101
7323
  // Auto-infer confirm: "delete" from type: "delete" (all deletes should confirm)
7102
7324
  confirm: meta.confirm ?? (meta.type === "delete" ? "delete" : void 0),
7103
7325
  deprecation: meta.deprecation,
7104
- deprecatedParameters: meta.deprecatedParameters,
7105
7326
  aliases: meta.aliases,
7106
7327
  supportsJsonOutput: meta.supportsJsonOutput ?? true
7107
7328
  };
@@ -7213,43 +7434,66 @@ var findUniqueAuthenticationPlugin = ({ sdk }) => ({
7213
7434
  }
7214
7435
  }
7215
7436
  });
7437
+ 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.";
7438
+ var GetInputFieldsSchemaBaseSchema = z.object({
7439
+ connection: ConnectionPropertySchema.optional().describe(
7440
+ "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId."
7441
+ ),
7442
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
7443
+ "Connection ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7444
+ ).meta({ deprecated: true }),
7445
+ /** @deprecated Use connection instead */
7446
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
7447
+ "Authentication ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7448
+ ).meta({ deprecated: true }),
7449
+ inputs: InputsPropertySchema.optional().describe(
7450
+ "Current input values that may affect the schema (e.g., when fields depend on other field values)"
7451
+ )
7452
+ });
7216
7453
  var GetInputFieldsSchemaSchema = z.object({
7217
- appKey: AppKeyPropertySchema.describe(
7454
+ app: AppPropertySchema.describe(
7218
7455
  "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
7219
7456
  ),
7220
7457
  actionType: ActionTypePropertySchema.describe(
7221
7458
  "Action type that matches the action's defined type"
7222
7459
  ),
7223
- actionKey: ActionKeyPropertySchema.describe(
7460
+ action: ActionPropertySchema.describe(
7224
7461
  "Action key to get the input schema for"
7462
+ )
7463
+ }).merge(GetInputFieldsSchemaBaseSchema).describe(GetInputFieldsSchemaDescription).meta({
7464
+ aliases: {
7465
+ appKey: "app",
7466
+ actionKey: "action",
7467
+ connectionId: "connection",
7468
+ authenticationId: "connection"
7469
+ }
7470
+ });
7471
+ var GetInputFieldsSchemaSchemaDeprecated = z.object({
7472
+ appKey: AppKeyPropertySchema.describe(
7473
+ "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
7225
7474
  ),
7226
- connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
7227
- "Connection ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7228
- ),
7229
- /** @deprecated Use connectionId instead */
7230
- authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
7231
- "Authentication ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7475
+ actionType: ActionTypePropertySchema.describe(
7476
+ "Action type that matches the action's defined type"
7232
7477
  ),
7233
- inputs: InputsPropertySchema.optional().describe(
7234
- "Current input values that may affect the schema (e.g., when fields depend on other field values)"
7478
+ actionKey: ActionKeyPropertySchema.describe(
7479
+ "Action key to get the input schema for"
7235
7480
  )
7236
- }).describe(
7237
- "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."
7238
- );
7481
+ }).merge(GetInputFieldsSchemaBaseSchema);
7482
+ var GetInputFieldsSchemaInputSchema = z.union([GetInputFieldsSchemaSchema, GetInputFieldsSchemaSchemaDeprecated]).describe(GetInputFieldsSchemaDescription);
7239
7483
 
7240
7484
  // src/plugins/getInputFieldsSchema/index.ts
7241
7485
  var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7242
7486
  async function getInputFieldsSchema(options) {
7243
7487
  const { api, getVersionedImplementationId } = context;
7244
- const {
7245
- appKey,
7246
- actionKey,
7247
- actionType,
7488
+ const appKey = "app" in options ? options.app : options.appKey;
7489
+ const actionKey = "action" in options ? options.action : options.actionKey;
7490
+ const { actionType, connection, connectionId, authenticationId, inputs } = options;
7491
+ const resolvedConnectionId = await resolveConnectionId({
7492
+ connection,
7248
7493
  connectionId,
7249
7494
  authenticationId,
7250
- inputs
7251
- } = options;
7252
- const resolvedConnectionId = connectionId ?? authenticationId ?? null;
7495
+ resolveConnection: context.resolveConnection
7496
+ });
7253
7497
  const selectedApi = await getVersionedImplementationId(appKey);
7254
7498
  if (!selectedApi) {
7255
7499
  throw new ZapierConfigurationError(
@@ -7263,16 +7507,16 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7263
7507
  operationKey: actionKey
7264
7508
  });
7265
7509
  const { data: action } = await sdk.getAction({
7266
- appKey,
7510
+ app: appKey,
7267
7511
  actionType,
7268
- actionKey
7512
+ action: actionKey
7269
7513
  });
7270
7514
  const needsData = await fetchImplementationNeeds({
7271
7515
  api,
7272
7516
  selectedApi,
7273
7517
  action: action.key,
7274
7518
  actionType,
7275
- connectionId: resolvedConnectionId,
7519
+ connectionId: resolvedConnectionId ?? null,
7276
7520
  inputs
7277
7521
  });
7278
7522
  return {
@@ -7281,7 +7525,7 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7281
7525
  }
7282
7526
  const getInputFieldsSchemaDefinition = createFunction(
7283
7527
  getInputFieldsSchema,
7284
- GetInputFieldsSchemaSchema,
7528
+ GetInputFieldsSchemaInputSchema,
7285
7529
  createTelemetryCallback(
7286
7530
  context.eventEmission.emitMethodCalled,
7287
7531
  getInputFieldsSchema.name
@@ -7297,13 +7541,12 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7297
7541
  itemType: "InputSchema",
7298
7542
  inputSchema: GetInputFieldsSchemaSchema,
7299
7543
  resolvers: {
7300
- appKey: appKeyResolver,
7544
+ app: appKeyResolver,
7301
7545
  actionType: actionTypeResolver,
7302
- actionKey: actionKeyResolver,
7303
- connectionId: connectionIdResolver,
7546
+ action: actionKeyResolver,
7547
+ connection: connectionIdResolver,
7304
7548
  inputs: inputsAllOptionalResolver
7305
- },
7306
- deprecatedParameters: ["authenticationId"]
7549
+ }
7307
7550
  }
7308
7551
  }
7309
7552
  }
@@ -7329,28 +7572,45 @@ var InputFieldChoiceItemSchema = withFormatter(NeedChoicesSchema, {
7329
7572
  };
7330
7573
  }
7331
7574
  });
7332
- var ListInputFieldChoicesSchema = z.object({
7333
- // Required action identification
7334
- appKey: AppKeyPropertySchema,
7335
- actionType: ActionTypePropertySchema,
7336
- actionKey: ActionKeyPropertySchema,
7337
- // Input field specification
7338
- inputFieldKey: z.string().min(1).describe("Input field key to get choices for."),
7339
- // Common parameters
7575
+ var ListInputFieldChoicesDescription = "Get the available choices for a dynamic dropdown input field";
7576
+ var ListInputFieldChoicesBaseSchema = z.object({
7577
+ connection: ConnectionPropertySchema.optional().describe(
7578
+ "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId."
7579
+ ),
7340
7580
  connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
7341
7581
  "Connection ID to use when listing available field choices. Required if the action needs a connection to populate dynamic dropdown options."
7342
- ),
7343
- /** @deprecated Use connectionId instead */
7344
- authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
7582
+ ).meta({ deprecated: true }),
7583
+ /** @deprecated Use connection instead */
7584
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
7345
7585
  inputs: InputsPropertySchema.optional().describe(
7346
7586
  "Current input values that may affect available choices"
7347
7587
  ),
7348
7588
  page: z.number().int().min(0).optional().describe("Page number for paginated results"),
7349
- // Pagination options (SDK-level)
7350
7589
  pageSize: z.number().min(1).optional().describe("Number of choices per page"),
7351
7590
  maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
7352
7591
  cursor: z.string().optional().describe("Cursor to start from")
7353
- }).describe("Get the available choices for a dynamic dropdown input field");
7592
+ });
7593
+ var ListInputFieldChoicesSchema = z.object({
7594
+ app: AppPropertySchema,
7595
+ actionType: ActionTypePropertySchema,
7596
+ action: ActionPropertySchema,
7597
+ inputField: InputFieldPropertySchema
7598
+ }).merge(ListInputFieldChoicesBaseSchema).describe(ListInputFieldChoicesDescription).meta({
7599
+ aliases: {
7600
+ appKey: "app",
7601
+ actionKey: "action",
7602
+ inputFieldKey: "inputField",
7603
+ connectionId: "connection",
7604
+ authenticationId: "connection"
7605
+ }
7606
+ });
7607
+ var ListInputFieldChoicesSchemaDeprecated = z.object({
7608
+ appKey: AppKeyPropertySchema,
7609
+ actionType: ActionTypePropertySchema,
7610
+ actionKey: ActionKeyPropertySchema,
7611
+ inputFieldKey: z.string().min(1).describe("Input field key to get choices for.")
7612
+ }).merge(ListInputFieldChoicesBaseSchema);
7613
+ var ListInputFieldChoicesInputSchema = z.union([ListInputFieldChoicesSchema, ListInputFieldChoicesSchemaDeprecated]).describe(ListInputFieldChoicesDescription);
7354
7614
 
7355
7615
  // src/plugins/listInputFieldChoices/index.ts
7356
7616
  function transformNeedChoicesToInputFieldChoiceItem(choice) {
@@ -7364,18 +7624,24 @@ function transformNeedChoicesToInputFieldChoiceItem(choice) {
7364
7624
  var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7365
7625
  async function listInputFieldChoicesPage(options) {
7366
7626
  const { api, getVersionedImplementationId } = context;
7627
+ const appKey = "app" in options ? options.app : options.appKey;
7628
+ const actionKey = "action" in options ? options.action : options.actionKey;
7629
+ const inputFieldKey = "inputField" in options ? options.inputField : options.inputFieldKey;
7367
7630
  const {
7368
- appKey,
7369
7631
  actionType,
7370
- actionKey,
7371
- inputFieldKey,
7632
+ connection,
7372
7633
  connectionId,
7373
7634
  authenticationId,
7374
7635
  inputs,
7375
7636
  page,
7376
7637
  cursor
7377
7638
  } = options;
7378
- const resolvedConnectionId = connectionId ?? authenticationId ?? null;
7639
+ const resolvedConnectionId = await resolveConnectionId({
7640
+ connection,
7641
+ connectionId,
7642
+ authenticationId,
7643
+ resolveConnection: context.resolveConnection
7644
+ });
7379
7645
  const selectedApi = await getVersionedImplementationId(appKey);
7380
7646
  if (!selectedApi) {
7381
7647
  throw new ZapierConfigurationError(
@@ -7389,16 +7655,16 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7389
7655
  operationKey: actionKey
7390
7656
  });
7391
7657
  const { data: action } = await sdk.getAction({
7392
- appKey,
7658
+ app: appKey,
7393
7659
  actionType,
7394
- actionKey
7660
+ action: actionKey
7395
7661
  });
7396
7662
  const needsData = await fetchImplementationNeeds({
7397
7663
  api,
7398
7664
  selectedApi,
7399
7665
  action: action.key,
7400
7666
  actionType,
7401
- connectionId: resolvedConnectionId,
7667
+ connectionId: resolvedConnectionId ?? null,
7402
7668
  inputs
7403
7669
  });
7404
7670
  const targetNeed = needsData.needs?.find(
@@ -7422,7 +7688,7 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7422
7688
  api,
7423
7689
  actionId: action.id,
7424
7690
  inputFieldId: inputFieldKey,
7425
- connectionId: resolvedConnectionId,
7691
+ connectionId: resolvedConnectionId ?? null,
7426
7692
  inputs,
7427
7693
  page: requestPage
7428
7694
  });
@@ -7451,7 +7717,7 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7451
7717
  const methodName = stripPageSuffix(listInputFieldChoicesPage.name);
7452
7718
  const listInputFieldChoicesDefinition = createPaginatedFunction(
7453
7719
  listInputFieldChoicesPage,
7454
- ListInputFieldChoicesSchema,
7720
+ ListInputFieldChoicesInputSchema,
7455
7721
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
7456
7722
  methodName,
7457
7723
  DEFAULT_PAGE_SIZE
@@ -7467,14 +7733,13 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7467
7733
  inputSchema: ListInputFieldChoicesSchema,
7468
7734
  outputSchema: InputFieldChoiceItemSchema,
7469
7735
  resolvers: {
7470
- appKey: appKeyResolver,
7736
+ app: appKeyResolver,
7471
7737
  actionType: actionTypeResolver,
7472
- actionKey: actionKeyResolver,
7473
- connectionId: connectionIdResolver,
7474
- inputFieldKey: inputFieldKeyResolver,
7738
+ action: actionKeyResolver,
7739
+ connection: connectionIdResolver,
7740
+ inputField: inputFieldKeyResolver,
7475
7741
  inputs: inputsAllOptionalResolver
7476
- },
7477
- deprecatedParameters: ["authenticationId"]
7742
+ }
7478
7743
  }
7479
7744
  }
7480
7745
  }
@@ -7639,7 +7904,7 @@ function getCpuTime() {
7639
7904
  }
7640
7905
 
7641
7906
  // src/plugins/eventEmission/builders.ts
7642
- var SDK_VERSION = "0.39.0";
7907
+ var SDK_VERSION = "0.40.0";
7643
7908
  function createBaseEvent(context = {}) {
7644
7909
  return {
7645
7910
  event_id: generateEventId(),
@@ -8169,4 +8434,4 @@ var BaseSdkOptionsSchema = z.object({
8169
8434
  // Use credentials instead
8170
8435
  });
8171
8436
 
8172
- export { ActionKeyPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_PAGE_SIZE, DebugPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, 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 };
8437
+ 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_CONFIG_PATH, 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, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, 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 };