@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.cjs CHANGED
@@ -85,6 +85,11 @@ var ZAPIER_MAX_NETWORK_RETRY_DELAY_MS = parseIntEnvVar("ZAPIER_MAX_NETWORK_RETRY
85
85
  var AppKeyPropertySchema = withPositional(
86
86
  zod.z.string().min(1).describe("App key (e.g., 'SlackCLIAPI' or slug like 'github')")
87
87
  );
88
+ var AppPropertySchema = withPositional(
89
+ zod.z.string().min(1).describe(
90
+ "App slug (e.g., 'github'), implementation name (e.g., 'SlackCLIAPI'), or versioned ID (e.g., 'github@1.2.3')"
91
+ )
92
+ );
88
93
  var ActionTypePropertySchema = zod.z.enum([
89
94
  "read",
90
95
  "read_bulk",
@@ -96,8 +101,16 @@ var ActionTypePropertySchema = zod.z.enum([
96
101
  "filter"
97
102
  ]).describe("Action type that matches the action's defined type");
98
103
  var ActionKeyPropertySchema = zod.z.string().min(1).describe("Action key to execute");
104
+ var ActionPropertySchema = withPositional(
105
+ zod.z.string().min(1).describe("Action key (e.g., 'send_message' or 'find_row')")
106
+ );
107
+ var InputFieldPropertySchema = withPositional(
108
+ zod.z.string().min(1).describe("Input field key to get choices for")
109
+ );
99
110
  var ConnectionIdPropertySchema = zod.z.union([zod.z.string(), zod.z.number().int().positive()]).describe("Connection ID to use for this action");
100
- var AuthenticationIdPropertySchema = ConnectionIdPropertySchema;
111
+ var AuthenticationIdPropertySchema = ConnectionIdPropertySchema.meta({
112
+ deprecated: true
113
+ });
101
114
  var ConnectionPropertySchema = zod.z.union([zod.z.string(), zod.z.number().int().positive()]).describe(
102
115
  "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly."
103
116
  );
@@ -110,6 +123,19 @@ var ParamsPropertySchema = zod.z.record(zod.z.string(), zod.z.unknown()).describ
110
123
  var ActionTimeoutMsPropertySchema = zod.z.number().min(1e3).optional().describe(
111
124
  `Maximum time to wait for action completion in milliseconds (default: ${DEFAULT_ACTION_TIMEOUT_MS})`
112
125
  );
126
+ var TablePropertySchema = withPositional(
127
+ zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
128
+ );
129
+ var RecordPropertySchema = withPositional(
130
+ zod.z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID").describe("The unique identifier of the record")
131
+ );
132
+ var RecordsPropertySchema = zod.z.array(zod.z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID")).min(1).max(100).describe("Record IDs to operate on");
133
+ var FieldsPropertySchema = zod.z.array(zod.z.union([zod.z.string(), zod.z.number()])).describe(
134
+ 'Fields to operate on. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6).'
135
+ );
136
+ var AppsPropertySchema = zod.z.array(zod.z.string()).describe("Filter by app keys (e.g., 'SlackCLIAPI' or slug like 'github')");
137
+ var TablesPropertySchema = zod.z.array(zod.z.string()).describe("Filter by specific table IDs");
138
+ var ConnectionsPropertySchema = zod.z.array(zod.z.string()).describe("List of connection IDs to filter by");
113
139
 
114
140
  // src/types/errors.ts
115
141
  var ZapierError = class extends Error {
@@ -274,20 +300,34 @@ HTTP Status: ${error.statusCode}`;
274
300
  }
275
301
  var ActionExecutionInputSchema = zod.z.object({
276
302
  inputs: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
277
- connectionId: ConnectionIdPropertySchema.optional(),
303
+ /** @deprecated Use `connection` instead. */
304
+ connectionId: ConnectionIdPropertySchema.optional().meta({
305
+ deprecated: true
306
+ }),
278
307
  connection: ConnectionPropertySchema.optional(),
279
- /** @deprecated Use connectionId instead */
280
- authenticationId: AuthenticationIdPropertySchema.optional(),
308
+ /** @deprecated Use connection instead */
309
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
310
+ deprecated: true
311
+ }),
281
312
  timeoutMs: ActionTimeoutMsPropertySchema
282
313
  }).describe(
283
314
  "Execute an action with the given inputs for the bound app, as an alternative to runAction"
284
- );
315
+ ).meta({
316
+ aliases: { connectionId: "connection", authenticationId: "connection" }
317
+ });
285
318
  var AppFactoryInputSchema = zod.z.object({
286
- connectionId: ConnectionIdPropertySchema.optional(),
319
+ /** @deprecated Use `connection` instead. */
320
+ connectionId: ConnectionIdPropertySchema.optional().meta({
321
+ deprecated: true
322
+ }),
287
323
  connection: ConnectionPropertySchema.optional(),
288
- /** @deprecated Use connectionId instead */
289
- authenticationId: AuthenticationIdPropertySchema.optional()
290
- }).describe("Bind a connection alias or numeric connectionId to an app");
324
+ /** @deprecated Use connection instead */
325
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
326
+ deprecated: true
327
+ })
328
+ }).describe("Bind a connection alias or numeric connectionId to an app").meta({
329
+ aliases: { connectionId: "connection", authenticationId: "connection" }
330
+ });
291
331
  function getStringProperty(obj, key) {
292
332
  if (typeof obj === "object" && obj !== null && key in obj) {
293
333
  const value = obj[key];
@@ -363,12 +403,11 @@ function createActionFunction(appKey, actionType, actionKey, options, pinnedAuth
363
403
  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.`
364
404
  });
365
405
  return sdk.runAction({
366
- appKey,
406
+ app: appKey,
367
407
  actionType,
368
- actionKey,
408
+ action: actionKey,
369
409
  inputs,
370
- connectionId,
371
- connection,
410
+ connection: connectionId ?? connection,
372
411
  timeoutMs
373
412
  });
374
413
  };
@@ -387,8 +426,7 @@ function createActionTypeProxy(appKey, actionType, options, pinnedAuthId, pinned
387
426
  });
388
427
  return sdk.fetch(url, {
389
428
  ...init,
390
- connectionId,
391
- connection
429
+ connection: connectionId ?? connection
392
430
  });
393
431
  };
394
432
  }
@@ -481,8 +519,7 @@ var appsPlugin = ({ sdk }) => {
481
519
  packages: ["sdk"],
482
520
  type: "function",
483
521
  inputSchema: AppFactoryInputSchema,
484
- returnType: "AppProxy",
485
- deprecatedParameters: ["authenticationId"]
522
+ returnType: "AppProxy"
486
523
  },
487
524
  "apps.{appKey}.{actionType}.{actionKey}": {
488
525
  categories: ["app"],
@@ -490,8 +527,7 @@ var appsPlugin = ({ sdk }) => {
490
527
  type: "list",
491
528
  inputSchema: ActionExecutionInputSchema,
492
529
  itemType: "ActionResult",
493
- outputSchema: ActionResultItemSchema,
494
- deprecatedParameters: ["authenticationId"]
530
+ outputSchema: ActionResultItemSchema
495
531
  }
496
532
  }
497
533
  }
@@ -511,16 +547,25 @@ var FetchInitSchema = zod.z.object({
511
547
  ]).optional().describe(
512
548
  "Request body \u2014 plain objects and JSON strings are auto-detected and Content-Type is set accordingly"
513
549
  ),
514
- connectionId: ConnectionIdPropertySchema.optional(),
550
+ connectionId: ConnectionIdPropertySchema.optional().meta({
551
+ deprecated: true
552
+ }),
515
553
  connection: ConnectionPropertySchema.optional(),
516
- /** @deprecated Use connectionId instead */
517
- authenticationId: AuthenticationIdPropertySchema.optional(),
554
+ /** @deprecated Use connection instead */
555
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
556
+ deprecated: true
557
+ }),
518
558
  callbackUrl: zod.z.string().optional().describe("URL to send async response to (makes request async)")
519
559
  }).optional().describe(
520
560
  "Request options including method, headers, body, and authentication"
521
- );
561
+ ).meta({
562
+ aliases: { connectionId: "connection", authenticationId: "connection" }
563
+ });
522
564
 
523
565
  // src/utils/domain-utils.ts
566
+ function isConnectionId(value) {
567
+ return /^\d+$/.test(value) || isUuid(value);
568
+ }
524
569
  async function resolveConnectionId({
525
570
  connectionId,
526
571
  connection,
@@ -541,13 +586,16 @@ async function resolveConnectionId({
541
586
  resolvedConnectionId = connection;
542
587
  } else {
543
588
  const entry = await resolveConnection(connection);
544
- if (!entry) {
589
+ if (entry) {
590
+ resolvedConnectionId = entry.connectionId;
591
+ } else if (isConnectionId(connection)) {
592
+ resolvedConnectionId = connection;
593
+ } else {
545
594
  throw new ZapierConfigurationError(
546
- `Connection "${connection}" not found in connections map. Ensure the connection is defined in the manifest connections, or use a numeric connectionId.`,
595
+ `Connection "${connection}" not found in connections map. Ensure the connection is defined in the manifest connections, or pass a connection ID directly.`,
547
596
  { configType: "connections" }
548
597
  );
549
598
  }
550
- resolvedConnectionId = entry.connectionId;
551
599
  }
552
600
  }
553
601
  return resolvedConnectionId;
@@ -633,20 +681,6 @@ function isResolvedAppLocator(appLocator) {
633
681
  return !!appLocator.implementationName;
634
682
  }
635
683
 
636
- // src/utils/id-utils.ts
637
- function coerceToNumericId(fieldName, value) {
638
- if (value === "") {
639
- throw new ZapierValidationError(`The ${fieldName} cannot be empty`);
640
- }
641
- const numericValue = typeof value === "number" ? value : Number(value);
642
- if (!Number.isFinite(numericValue)) {
643
- throw new ZapierValidationError(
644
- `The ${fieldName} "${value}" could not be converted to a number`
645
- );
646
- }
647
- return numericValue;
648
- }
649
-
650
684
  // src/utils/type-guard-utils.ts
651
685
  function isPlainObject(value) {
652
686
  if (typeof value !== "object" || value === null) return false;
@@ -757,10 +791,7 @@ var fetchPlugin = ({ context }) => {
757
791
  }
758
792
  }
759
793
  if (resolvedConnectionId) {
760
- headers["X-Relay-Authentication-Id"] = coerceToNumericId(
761
- "connectionId",
762
- resolvedConnectionId
763
- ).toString();
794
+ headers["X-Relay-Authentication-Id"] = String(resolvedConnectionId);
764
795
  }
765
796
  if (callbackUrl) {
766
797
  headers["X-Relay-Callback-Url"] = callbackUrl;
@@ -817,8 +848,7 @@ var fetchPlugin = ({ context }) => {
817
848
  inputParameters: [
818
849
  { name: "url", schema: FetchUrlSchema },
819
850
  { name: "init", schema: FetchInitSchema }
820
- ],
821
- deprecatedParameters: ["authenticationId"]
851
+ ]
822
852
  }
823
853
  }
824
854
  }
@@ -1311,10 +1341,15 @@ function createPaginatedFunction(coreFn, schema, telemetry, explicitFunctionName
1311
1341
  var ListAppsSchema = apps.ListAppsQuerySchema.omit({
1312
1342
  offset: true
1313
1343
  }).extend({
1344
+ // New name for appKeys
1345
+ apps: AppsPropertySchema.optional().describe(
1346
+ "Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"
1347
+ ),
1314
1348
  // Override appKeys to be an array instead of comma-separated string
1349
+ /** @deprecated Use `apps` instead. */
1315
1350
  appKeys: zod.z.array(zod.z.string()).optional().describe(
1316
1351
  "Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"
1317
- ),
1352
+ ).meta({ deprecated: true }),
1318
1353
  // Override pageSize to make optional (base has default value)
1319
1354
  pageSize: zod.z.number().min(1).optional().describe("Number of apps per page"),
1320
1355
  // SDK specific property for pagination/iterable helpers
@@ -1384,7 +1419,7 @@ function createTelemetryCallback(emitMethodCalled, methodName) {
1384
1419
  var listAppsPlugin = ({ context }) => {
1385
1420
  async function listAppsPage(options) {
1386
1421
  const { api, resolveAppKeys: resolveAppKeys2 } = context;
1387
- const appKeys = options.appKeys ?? [];
1422
+ const appKeys = options.apps ?? options.appKeys ?? [];
1388
1423
  const appLocators = await resolveAppKeys2({
1389
1424
  appKeys: [...appKeys]
1390
1425
  });
@@ -1446,17 +1481,29 @@ var listAppsPlugin = ({ context }) => {
1446
1481
  }
1447
1482
  };
1448
1483
  };
1484
+ var ListActionsDescription = "List all actions for a specific app";
1485
+ var ListActionsBaseSchema = zod.z.object({
1486
+ pageSize: zod.z.number().min(1).optional().describe("Number of actions per page"),
1487
+ maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1488
+ cursor: zod.z.string().optional().describe("Cursor to start from")
1489
+ });
1449
1490
  var ListActionsSchema = zod.z.object({
1450
- appKey: AppKeyPropertySchema.describe(
1491
+ app: AppPropertySchema.describe(
1451
1492
  "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1452
1493
  ),
1453
1494
  actionType: ActionTypePropertySchema.optional().describe(
1454
1495
  "Filter actions by type"
1496
+ )
1497
+ }).merge(ListActionsBaseSchema).describe(ListActionsDescription).meta({ aliases: { appKey: "app" } });
1498
+ var ListActionsSchemaDeprecated = zod.z.object({
1499
+ appKey: AppKeyPropertySchema.describe(
1500
+ "App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
1455
1501
  ),
1456
- pageSize: zod.z.number().min(1).optional().describe("Number of actions per page"),
1457
- maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
1458
- cursor: zod.z.string().optional().describe("Cursor to start from")
1459
- }).describe("List all actions for a specific app");
1502
+ actionType: ActionTypePropertySchema.optional().describe(
1503
+ "Filter actions by type"
1504
+ )
1505
+ }).merge(ListActionsBaseSchema);
1506
+ var ListActionsInputSchema = zod.z.union([ListActionsSchema, ListActionsSchemaDeprecated]).describe(ListActionsDescription);
1460
1507
  var NeedChoicesSchema = zod.z.object({
1461
1508
  key: zod.z.string().optional(),
1462
1509
  label: zod.z.string().optional(),
@@ -1681,7 +1728,7 @@ zod.z.object({
1681
1728
  selected_api: zod.z.string(),
1682
1729
  action: zod.z.string(),
1683
1730
  type_of: zod.z.string(),
1684
- authentication_id: zod.z.number().optional(),
1731
+ authentication_id: zod.z.union([zod.z.string(), zod.z.number()]).optional(),
1685
1732
  params: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1686
1733
  });
1687
1734
  zod.z.object({
@@ -1728,7 +1775,7 @@ zod.z.object({
1728
1775
  selected_api: zod.z.string().optional().describe(
1729
1776
  "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."
1730
1777
  ),
1731
- authentication_id: zod.z.coerce.number().optional().describe(
1778
+ authentication_id: zod.z.union([zod.z.string(), zod.z.number()]).optional().describe(
1732
1779
  "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)."
1733
1780
  ),
1734
1781
  params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe(
@@ -1808,10 +1855,10 @@ var appKeyResolver = {
1808
1855
  // src/resolvers/actionType.ts
1809
1856
  var actionTypeResolver = {
1810
1857
  type: "dynamic",
1811
- depends: ["appKey"],
1858
+ depends: ["app"],
1812
1859
  fetch: async (sdk, resolvedParams) => {
1813
1860
  const actionsResponse = await sdk.listActions({
1814
- appKey: resolvedParams.appKey
1861
+ app: resolvedParams.app
1815
1862
  });
1816
1863
  const actionTypes = actionsResponse.data.map(
1817
1864
  (action) => action.action_type
@@ -1833,10 +1880,10 @@ var actionTypeResolver = {
1833
1880
  // src/resolvers/actionKey.ts
1834
1881
  var actionKeyResolver = {
1835
1882
  type: "dynamic",
1836
- depends: ["appKey", "actionType"],
1883
+ depends: ["app", "actionType"],
1837
1884
  fetch: async (sdk, resolvedParams) => {
1838
1885
  const actionsResponse = await sdk.listActions({
1839
- appKey: resolvedParams.appKey
1886
+ app: resolvedParams.app
1840
1887
  });
1841
1888
  return actionsResponse.data.filter(
1842
1889
  (action) => action.action_type === resolvedParams.actionType
@@ -1844,7 +1891,7 @@ var actionKeyResolver = {
1844
1891
  },
1845
1892
  prompt: (actions) => ({
1846
1893
  type: "list",
1847
- name: "actionKey",
1894
+ name: "action",
1848
1895
  message: "Select action:",
1849
1896
  choices: actions.map((action) => ({
1850
1897
  name: `${action.title || action.name || action.key} - ${action.description || "No description"}`,
@@ -1861,7 +1908,7 @@ async function fetchConnections(sdk, resolvedParams) {
1861
1908
  );
1862
1909
  return toIterable(
1863
1910
  sdk.listConnections({
1864
- appKey: resolvedParams.appKey,
1911
+ app: resolvedParams.app,
1865
1912
  includeShared: includeShared || void 0
1866
1913
  })
1867
1914
  );
@@ -1869,8 +1916,8 @@ async function fetchConnections(sdk, resolvedParams) {
1869
1916
  function promptForConnection(connections, params) {
1870
1917
  return {
1871
1918
  type: "list",
1872
- name: "connectionId",
1873
- message: params.appKey ? `Select connection for ${params.appKey}:` : "Select connection:",
1919
+ name: "connection",
1920
+ message: params.app ? `Select connection for ${params.app}:` : "Select connection:",
1874
1921
  choices: connections.map((connection) => ({
1875
1922
  name: `${connection.title || connection.label || "Connection"} (ID: ${connection.id})`,
1876
1923
  value: connection.id
@@ -1879,12 +1926,12 @@ function promptForConnection(connections, params) {
1879
1926
  }
1880
1927
  var connectionIdResolver = {
1881
1928
  type: "dynamic",
1882
- depends: ["appKey"],
1929
+ depends: ["app"],
1883
1930
  requireCapabilities: ["canIncludeSharedConnections"],
1884
1931
  tryResolveWithoutPrompt: async (sdk, params) => {
1885
- if (!params.appKey) return null;
1932
+ if (!params.app) return null;
1886
1933
  try {
1887
- const app = await sdk.getApp({ appKey: params.appKey });
1934
+ const app = await sdk.getApp({ app: params.app });
1888
1935
  if (!app.data.auth_type) {
1889
1936
  return { resolvedValue: null };
1890
1937
  }
@@ -1923,13 +1970,13 @@ function makeFieldsOptional(fields) {
1923
1970
  }
1924
1971
  var inputsResolver = {
1925
1972
  type: "fields",
1926
- depends: ["appKey", "actionKey", "actionType", "connectionId"],
1973
+ depends: ["app", "action", "actionType", "connection"],
1927
1974
  fetch: async (sdk, resolvedParams) => {
1928
1975
  const fieldsResponse = await sdk.listInputFields({
1929
- appKey: resolvedParams.appKey,
1930
- actionKey: resolvedParams.actionKey,
1976
+ app: resolvedParams.app,
1977
+ action: resolvedParams.action,
1931
1978
  actionType: resolvedParams.actionType,
1932
- connectionId: resolvedParams.connectionId,
1979
+ connection: resolvedParams.connection,
1933
1980
  inputs: resolvedParams.inputs
1934
1981
  // Pass along currently resolved inputs
1935
1982
  });
@@ -1938,13 +1985,13 @@ var inputsResolver = {
1938
1985
  };
1939
1986
  var inputsAllOptionalResolver = {
1940
1987
  type: "fields",
1941
- depends: ["appKey", "actionKey", "actionType", "connectionId"],
1988
+ depends: ["app", "action", "actionType", "connection"],
1942
1989
  fetch: async (sdk, resolvedParams) => {
1943
1990
  const fieldsResponse = await sdk.listInputFields({
1944
- appKey: resolvedParams.appKey,
1945
- actionKey: resolvedParams.actionKey,
1991
+ app: resolvedParams.app,
1992
+ action: resolvedParams.action,
1946
1993
  actionType: resolvedParams.actionType,
1947
- connectionId: resolvedParams.connectionId,
1994
+ connection: resolvedParams.connection,
1948
1995
  inputs: resolvedParams.inputs
1949
1996
  // Pass along currently resolved inputs
1950
1997
  });
@@ -1971,21 +2018,20 @@ function flattenRootFieldset(rootFieldset) {
1971
2018
  }
1972
2019
  var inputFieldKeyResolver = {
1973
2020
  type: "dynamic",
1974
- depends: ["appKey", "actionKey", "actionType", "connectionId"],
2021
+ depends: ["app", "action", "actionType", "connection"],
1975
2022
  fetch: async (sdk, resolvedParams) => {
1976
2023
  const fieldsResponse = await sdk.listInputFields({
1977
- appKey: resolvedParams.appKey,
1978
- actionKey: resolvedParams.actionKey,
2024
+ app: resolvedParams.app,
2025
+ action: resolvedParams.action,
1979
2026
  actionType: resolvedParams.actionType,
1980
- connectionId: resolvedParams.connectionId,
2027
+ connection: resolvedParams.connection,
1981
2028
  inputs: resolvedParams.inputs
1982
- // Pass along currently resolved inputs
1983
2029
  });
1984
2030
  return flattenRootFieldset(fieldsResponse.data);
1985
2031
  },
1986
2032
  prompt: (fields) => ({
1987
2033
  type: "list",
1988
- name: "inputFieldKey",
2034
+ name: "inputField",
1989
2035
  message: "Select input field:",
1990
2036
  choices: fields.map((field) => ({
1991
2037
  name: `${field.title || field.key} - ${field.value_type || "No type"} ${field.is_required ? "(required)" : "(optional)"}`,
@@ -2043,7 +2089,7 @@ var tableIdResolver = {
2043
2089
  },
2044
2090
  prompt: (tables) => ({
2045
2091
  type: "list",
2046
- name: "tableId",
2092
+ name: "table",
2047
2093
  message: "Select a table:",
2048
2094
  choices: tables.map((table) => ({
2049
2095
  name: `${table.name} (${table.id})`,
@@ -2292,7 +2338,7 @@ function summarizeRecord(record) {
2292
2338
  }
2293
2339
  function fetchRecords(sdk, params) {
2294
2340
  return sdk.listTableRecords({
2295
- tableId: params.tableId,
2341
+ table: params.table,
2296
2342
  keyMode: "names"
2297
2343
  });
2298
2344
  }
@@ -2304,22 +2350,22 @@ function recordChoices(records) {
2304
2350
  }
2305
2351
  var tableRecordIdResolver = {
2306
2352
  type: "dynamic",
2307
- depends: ["tableId"],
2353
+ depends: ["table"],
2308
2354
  fetch: fetchRecords,
2309
2355
  prompt: (records) => ({
2310
2356
  type: "list",
2311
- name: "recordId",
2357
+ name: "record",
2312
2358
  message: "Select a record:",
2313
2359
  choices: recordChoices(records)
2314
2360
  })
2315
2361
  };
2316
2362
  var tableRecordIdsResolver = {
2317
2363
  type: "dynamic",
2318
- depends: ["tableId"],
2364
+ depends: ["table"],
2319
2365
  fetch: fetchRecords,
2320
2366
  prompt: (records) => ({
2321
2367
  type: "checkbox",
2322
- name: "recordIds",
2368
+ name: "records",
2323
2369
  message: "Select records to delete:",
2324
2370
  choices: recordChoices(records),
2325
2371
  validate: (value) => Array.isArray(value) && value.length > 0 ? true : "Select at least one record"
@@ -2329,13 +2375,13 @@ var tableRecordIdsResolver = {
2329
2375
  // src/resolvers/tableFieldIds.ts
2330
2376
  var tableFieldIdsResolver = {
2331
2377
  type: "dynamic",
2332
- depends: ["tableId"],
2378
+ depends: ["table"],
2333
2379
  fetch: (sdk, params) => {
2334
- return sdk.listTableFields({ tableId: params.tableId });
2380
+ return sdk.listTableFields({ table: params.table });
2335
2381
  },
2336
2382
  prompt: (fields) => ({
2337
2383
  type: "checkbox",
2338
- name: "fieldKeys",
2384
+ name: "fields",
2339
2385
  message: "Select fields:",
2340
2386
  choices: fields.map((field) => ({
2341
2387
  name: `${field.name} (${field.id}, ${field.type})`,
@@ -2414,12 +2460,20 @@ var FieldItemSchema = withFormatter(FieldItemSchemaBase, {
2414
2460
  details: [{ text: `Type: ${item.type}`, style: "dim" }]
2415
2461
  })
2416
2462
  });
2417
- var ListTableFieldsOptionsSchema = zod.z.object({
2418
- tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
2463
+ var ListTableFieldsDescription = "List fields for a table";
2464
+ var ListTableFieldsOptionsBaseSchema = zod.z.object({
2465
+ fields: FieldsPropertySchema.optional(),
2419
2466
  fieldKeys: zod.z.array(zod.z.union([zod.z.string(), zod.z.number()])).optional().describe(
2420
2467
  'Filter by specific fields. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6).'
2421
- )
2422
- }).describe("List fields for a table");
2468
+ ).meta({ deprecated: true })
2469
+ });
2470
+ var ListTableFieldsOptionsSchema = ListTableFieldsOptionsBaseSchema.extend({
2471
+ table: TablePropertySchema
2472
+ }).describe(ListTableFieldsDescription).meta({ aliases: { tableId: "table", fieldKeys: "fields" } });
2473
+ var ListTableFieldsOptionsSchemaDeprecated = ListTableFieldsOptionsBaseSchema.extend({
2474
+ tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
2475
+ });
2476
+ var ListTableFieldsOptionsInputSchema = zod.z.union([ListTableFieldsOptionsSchema, ListTableFieldsOptionsSchemaDeprecated]).describe(ListTableFieldsDescription);
2423
2477
 
2424
2478
  // src/resolvers/tableFields.ts
2425
2479
  var fieldTypeChoices = FieldTypeSchema.options.map((type) => ({
@@ -2468,13 +2522,13 @@ function tableFieldValueType(fieldType) {
2468
2522
  }
2469
2523
  function createSingleRecordResolver({
2470
2524
  sdk,
2471
- tableId,
2525
+ table,
2472
2526
  includeRecordId
2473
2527
  }) {
2474
2528
  return {
2475
2529
  type: "fields",
2476
2530
  fetch: async () => {
2477
- const { data: fields } = await sdk.listTableFields({ tableId });
2531
+ const { data: fields } = await sdk.listTableFields({ table });
2478
2532
  const inputFields = fields.map((field) => ({
2479
2533
  type: "input_field",
2480
2534
  key: field.id,
@@ -2509,22 +2563,22 @@ function createSingleRecordResolver({
2509
2563
  }
2510
2564
  var tableRecordsResolver = {
2511
2565
  type: "array",
2512
- depends: ["tableId"],
2566
+ depends: ["table"],
2513
2567
  fetch: async (sdk, params) => {
2514
2568
  return createSingleRecordResolver({
2515
2569
  sdk,
2516
- tableId: params.tableId
2570
+ table: params.table
2517
2571
  });
2518
2572
  },
2519
2573
  minItems: 1
2520
2574
  };
2521
2575
  var tableUpdateRecordsResolver = {
2522
2576
  type: "array",
2523
- depends: ["tableId"],
2577
+ depends: ["table"],
2524
2578
  fetch: async (sdk, params) => {
2525
2579
  return createSingleRecordResolver({
2526
2580
  sdk,
2527
- tableId: params.tableId,
2581
+ table: params.table,
2528
2582
  includeRecordId: true
2529
2583
  });
2530
2584
  },
@@ -2550,12 +2604,12 @@ var FILTER_OPERATORS = [
2550
2604
  ];
2551
2605
  function createSingleFilterResolver({
2552
2606
  sdk,
2553
- tableId
2607
+ table
2554
2608
  }) {
2555
2609
  return {
2556
2610
  type: "fields",
2557
2611
  fetch: async () => {
2558
- const { data: fields } = await sdk.listTableFields({ tableId });
2612
+ const { data: fields } = await sdk.listTableFields({ table });
2559
2613
  const fieldChoices = fields.flatMap((field) => {
2560
2614
  const components = NESTED_COMPONENTS[field.type];
2561
2615
  if (components && components.size > 1) {
@@ -2597,11 +2651,11 @@ function createSingleFilterResolver({
2597
2651
  }
2598
2652
  var tableFiltersResolver = {
2599
2653
  type: "array",
2600
- depends: ["tableId"],
2654
+ depends: ["table"],
2601
2655
  fetch: async (sdk, params) => {
2602
2656
  return createSingleFilterResolver({
2603
2657
  sdk,
2604
- tableId: params.tableId
2658
+ table: params.table
2605
2659
  });
2606
2660
  },
2607
2661
  minItems: 0
@@ -2610,10 +2664,10 @@ var tableFiltersResolver = {
2610
2664
  // src/resolvers/tableSort.ts
2611
2665
  var tableSortResolver = {
2612
2666
  type: "fields",
2613
- depends: ["tableId"],
2667
+ depends: ["table"],
2614
2668
  fetch: async (sdk, params) => {
2615
2669
  const { data: fields } = await sdk.listTableFields({
2616
- tableId: params.tableId
2670
+ table: params.table
2617
2671
  });
2618
2672
  const fieldChoices = fields.flatMap((field) => {
2619
2673
  const components = NESTED_COMPONENTS[field.type];
@@ -2660,13 +2714,14 @@ var listActionsPlugin = ({ context }) => {
2660
2714
  inputSchema: ListActionsSchema,
2661
2715
  outputSchema: ActionItemSchema,
2662
2716
  resolvers: {
2663
- appKey: appKeyResolver,
2717
+ app: appKeyResolver,
2664
2718
  actionType: actionTypeResolver
2665
2719
  }
2666
2720
  };
2667
2721
  async function listActionsPage(options) {
2668
2722
  const { api, getVersionedImplementationId } = context;
2669
- const selectedApi = await getVersionedImplementationId(options.appKey);
2723
+ const appKey = "app" in options ? options.app : options.appKey;
2724
+ const selectedApi = await getVersionedImplementationId(appKey);
2670
2725
  if (!selectedApi) {
2671
2726
  throw new ZapierConfigurationError(
2672
2727
  "No current_implementation_id found for app",
@@ -2728,7 +2783,7 @@ var listActionsPlugin = ({ context }) => {
2728
2783
  const methodName = stripPageSuffix(listActionsPage.name);
2729
2784
  const listActionsDefinition = createPaginatedFunction(
2730
2785
  listActionsPage,
2731
- ListActionsSchema,
2786
+ ListActionsInputSchema,
2732
2787
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
2733
2788
  methodName,
2734
2789
  DEFAULT_PAGE_SIZE
@@ -2742,22 +2797,41 @@ var listActionsPlugin = ({ context }) => {
2742
2797
  }
2743
2798
  };
2744
2799
  };
2745
- var ListInputFieldsSchema = zod.z.object({
2746
- appKey: AppKeyPropertySchema,
2747
- actionType: ActionTypePropertySchema,
2748
- actionKey: ActionKeyPropertySchema,
2800
+ var ListInputFieldsDescription = "Get the input fields required for a specific action";
2801
+ var ListInputFieldsBaseSchema = zod.z.object({
2802
+ connection: ConnectionPropertySchema.optional().describe(
2803
+ "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId."
2804
+ ),
2749
2805
  connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
2750
2806
  "Connection ID to use when listing input fields. Required if the action needs a connection to determine available fields."
2751
- ),
2752
- /** @deprecated Use connectionId instead */
2753
- authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
2807
+ ).meta({ deprecated: true }),
2808
+ /** @deprecated Use connection instead */
2809
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
2754
2810
  inputs: InputsPropertySchema.optional().describe(
2755
2811
  "Current input values that may affect available fields"
2756
2812
  ),
2757
2813
  pageSize: zod.z.number().min(1).optional().describe("Number of input fields per page"),
2758
2814
  maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
2759
2815
  cursor: zod.z.string().optional().describe("Cursor to start from")
2760
- }).describe("Get the input fields required for a specific action");
2816
+ });
2817
+ var ListInputFieldsSchema = zod.z.object({
2818
+ app: AppPropertySchema,
2819
+ actionType: ActionTypePropertySchema,
2820
+ action: ActionPropertySchema
2821
+ }).merge(ListInputFieldsBaseSchema).describe(ListInputFieldsDescription).meta({
2822
+ aliases: {
2823
+ appKey: "app",
2824
+ actionKey: "action",
2825
+ connectionId: "connection",
2826
+ authenticationId: "connection"
2827
+ }
2828
+ });
2829
+ var ListInputFieldsSchemaDeprecated = zod.z.object({
2830
+ appKey: AppKeyPropertySchema,
2831
+ actionType: ActionTypePropertySchema,
2832
+ actionKey: ActionKeyPropertySchema
2833
+ }).merge(ListInputFieldsBaseSchema);
2834
+ var ListInputFieldsInputSchema = zod.z.union([ListInputFieldsSchema, ListInputFieldsSchemaDeprecated]).describe(ListInputFieldsDescription);
2761
2835
  var BaseFieldItemSchema = zod.z.object({
2762
2836
  type: zod.z.string(),
2763
2837
  // "input_field", "info_field", or "fieldset"
@@ -2892,10 +2966,7 @@ async function fetchImplementationNeeds({
2892
2966
  params: inputs || {}
2893
2967
  };
2894
2968
  if (connectionId !== null) {
2895
- request.authentication_id = coerceToNumericId(
2896
- "authentication_id",
2897
- connectionId
2898
- );
2969
+ request.authentication_id = connectionId;
2899
2970
  }
2900
2971
  const response = await api.post(
2901
2972
  "/zapier/api/v4/implementations/needs/",
@@ -2923,10 +2994,7 @@ async function fetchImplementationChoices({
2923
2994
  params: inputs || {}
2924
2995
  };
2925
2996
  if (connectionId !== null) {
2926
- request.authentication_id = coerceToNumericId(
2927
- "authentication_id",
2928
- connectionId
2929
- );
2997
+ request.authentication_id = connectionId;
2930
2998
  }
2931
2999
  const response = await api.post(
2932
3000
  "/zapier/api/v4/implementations/choices/",
@@ -3042,15 +3110,15 @@ function transformNeedsToFields(needs) {
3042
3110
  var listInputFieldsPlugin = ({ sdk, context }) => {
3043
3111
  async function listInputFieldsPage(options) {
3044
3112
  const { api, getVersionedImplementationId } = context;
3045
- const {
3046
- appKey,
3047
- actionKey,
3048
- actionType,
3113
+ const appKey = "app" in options ? options.app : options.appKey;
3114
+ const actionKey = "action" in options ? options.action : options.actionKey;
3115
+ const { actionType, connection, connectionId, authenticationId, inputs } = options;
3116
+ const resolvedConnectionId = await resolveConnectionId({
3117
+ connection,
3049
3118
  connectionId,
3050
3119
  authenticationId,
3051
- inputs
3052
- } = options;
3053
- const resolvedConnectionId = connectionId ?? authenticationId ?? null;
3120
+ resolveConnection: context.resolveConnection
3121
+ });
3054
3122
  const selectedApi = await getVersionedImplementationId(appKey);
3055
3123
  if (!selectedApi) {
3056
3124
  throw new ZapierConfigurationError(
@@ -3064,16 +3132,16 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
3064
3132
  operationKey: actionKey
3065
3133
  });
3066
3134
  const { data: action } = await sdk.getAction({
3067
- appKey,
3135
+ app: appKey,
3068
3136
  actionType,
3069
- actionKey
3137
+ action: actionKey
3070
3138
  });
3071
3139
  const needsData = await fetchImplementationNeeds({
3072
3140
  api,
3073
3141
  selectedApi,
3074
3142
  action: action.key,
3075
3143
  actionType,
3076
- connectionId: resolvedConnectionId,
3144
+ connectionId: resolvedConnectionId ?? null,
3077
3145
  inputs
3078
3146
  });
3079
3147
  const rootFieldset = transformNeedsToFields(needsData.needs || []);
@@ -3086,7 +3154,7 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
3086
3154
  const methodName = stripPageSuffix(listInputFieldsPage.name);
3087
3155
  const listInputFieldsDefinition = createPaginatedFunction(
3088
3156
  listInputFieldsPage,
3089
- ListInputFieldsSchema,
3157
+ ListInputFieldsInputSchema,
3090
3158
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
3091
3159
  methodName,
3092
3160
  DEFAULT_PAGE_SIZE
@@ -3102,13 +3170,12 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
3102
3170
  inputSchema: ListInputFieldsSchema,
3103
3171
  outputSchema: RootFieldItemSchema,
3104
3172
  resolvers: {
3105
- appKey: appKeyResolver,
3173
+ app: appKeyResolver,
3106
3174
  actionType: actionTypeResolver,
3107
- actionKey: actionKeyResolver,
3108
- connectionId: connectionIdResolver,
3175
+ action: actionKeyResolver,
3176
+ connection: connectionIdResolver,
3109
3177
  inputs: inputsAllOptionalResolver
3110
- },
3111
- deprecatedParameters: ["authenticationId"]
3178
+ }
3112
3179
  }
3113
3180
  }
3114
3181
  }
@@ -3123,18 +3190,27 @@ var ListConnectionsQuerySchema = connections.ListConnectionsQuerySchema.omit({
3123
3190
  is_expired: true,
3124
3191
  page_size: true
3125
3192
  }).extend({
3126
- // Override appKey with our custom schema (array type, different description)
3193
+ // New name for appKey
3194
+ app: AppPropertySchema.optional().describe(
3195
+ "App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
3196
+ ),
3197
+ /** @deprecated Use `app` instead. */
3127
3198
  appKey: AppKeyPropertySchema.optional().describe(
3128
3199
  "App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github')"
3200
+ ).meta({ deprecated: true }),
3201
+ // New name for connectionIds
3202
+ connections: ConnectionsPropertySchema.optional().describe(
3203
+ "List of connection IDs to filter by"
3129
3204
  ),
3130
- // Override connectionIds to be an array instead of comma-separated string
3131
- connectionIds: zod.z.array(zod.z.string()).optional().describe("List of connection IDs to filter by"),
3132
- /** @deprecated Use connectionIds instead */
3205
+ /** @deprecated Use `connections` instead. */
3206
+ connectionIds: zod.z.array(zod.z.string()).optional().describe("List of connection IDs to filter by").meta({ deprecated: true }),
3207
+ /** @deprecated Use `connections` instead. */
3133
3208
  authenticationIds: zod.z.array(zod.z.string()).optional().describe(
3134
- "List of authentication IDs to filter by (deprecated, use connectionIds)"
3135
- ),
3136
- // camelCase account ID
3137
- accountId: zod.z.string().optional().describe("Account ID to filter by"),
3209
+ "List of authentication IDs to filter by (deprecated, use connections)"
3210
+ ).meta({ deprecated: true }),
3211
+ account: zod.z.string().optional().describe("Account to filter by"),
3212
+ /** @deprecated Use `account` instead. */
3213
+ accountId: zod.z.string().optional().describe("Account ID to filter by").meta({ deprecated: true }),
3138
3214
  // Include shared connections (overrides default owner=me filter)
3139
3215
  includeShared: zod.z.boolean().optional().describe(
3140
3216
  "Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections."
@@ -3186,21 +3262,31 @@ var listConnectionsPlugin = ({ context }) => {
3186
3262
  if (options.pageSize !== void 0) {
3187
3263
  searchParams.page_size = options.pageSize.toString();
3188
3264
  }
3189
- if (options.appKey) {
3190
- const implementationId = await getVersionedImplementationId(
3191
- options.appKey
3192
- );
3265
+ const appKey = options.app ?? options.appKey;
3266
+ if (appKey) {
3267
+ const implementationId = await getVersionedImplementationId(appKey);
3193
3268
  if (implementationId) {
3194
3269
  setMethodMetadata({ selectedApi: implementationId });
3195
3270
  const [versionlessSelectedApi] = splitVersionedKey(implementationId);
3196
3271
  searchParams.app_key = versionlessSelectedApi;
3197
3272
  } else {
3198
- searchParams.app_key = options.appKey;
3199
- }
3200
- }
3201
- const resolvedConnectionIds = options.connectionIds ?? options.authenticationIds;
3202
- if (resolvedConnectionIds && resolvedConnectionIds.length > 0) {
3203
- searchParams.connection_ids = resolvedConnectionIds.join(",");
3273
+ searchParams.app_key = appKey;
3274
+ }
3275
+ }
3276
+ const connectionRefs = options.connections;
3277
+ const legacyConnectionIds = options.connectionIds ?? options.authenticationIds;
3278
+ if (connectionRefs && connectionRefs.length > 0) {
3279
+ const resolvedIds = await Promise.all(
3280
+ connectionRefs.map(
3281
+ (ref) => resolveConnectionId({
3282
+ connection: ref,
3283
+ resolveConnection: context.resolveConnection
3284
+ })
3285
+ )
3286
+ );
3287
+ searchParams.connection_ids = resolvedIds.filter((id) => id != null).join(",");
3288
+ } else if (legacyConnectionIds && legacyConnectionIds.length > 0) {
3289
+ searchParams.connection_ids = legacyConnectionIds.join(",");
3204
3290
  }
3205
3291
  if (options.search) {
3206
3292
  searchParams.search = options.search;
@@ -3208,8 +3294,9 @@ var listConnectionsPlugin = ({ context }) => {
3208
3294
  if (options.title) {
3209
3295
  searchParams.title = options.title;
3210
3296
  }
3211
- if (options.accountId) {
3212
- searchParams.account_id = options.accountId;
3297
+ const accountId = options.account ?? options.accountId;
3298
+ if (accountId) {
3299
+ searchParams.account_id = accountId;
3213
3300
  }
3214
3301
  if (options.owner && options.owner !== "me" && !options.includeShared) {
3215
3302
  throw new ZapierValidationError(
@@ -3269,9 +3356,8 @@ var listConnectionsPlugin = ({ context }) => {
3269
3356
  inputSchema: ListConnectionsQuerySchema,
3270
3357
  outputSchema: ConnectionItemSchema,
3271
3358
  resolvers: {
3272
- appKey: appKeyResolver
3273
- },
3274
- deprecatedParameters: ["authenticationIds"]
3359
+ app: appKeyResolver
3360
+ }
3275
3361
  }
3276
3362
  }
3277
3363
  }
@@ -3514,17 +3600,21 @@ var deleteClientCredentialsPlugin = ({ context }) => {
3514
3600
  }
3515
3601
  };
3516
3602
  };
3603
+ var GetAppDescription = "Get detailed information about a specific app";
3517
3604
  var GetAppSchema = zod.z.object({
3518
- appKey: AppKeyPropertySchema.describe(
3519
- "App key of app to fetch (e.g., 'SlackCLIAPI' or slug like 'github')"
3520
- )
3521
- }).describe("Get detailed information about a specific app");
3605
+ app: AppPropertySchema
3606
+ }).describe(GetAppDescription).meta({ aliases: { appKey: "app" } });
3607
+ var GetAppSchemaDeprecated = zod.z.object({
3608
+ appKey: AppKeyPropertySchema
3609
+ });
3610
+ var GetAppInputSchema = zod.z.union([GetAppSchema, GetAppSchemaDeprecated]).describe(GetAppDescription);
3522
3611
 
3523
3612
  // src/plugins/getApp/index.ts
3524
3613
  var getAppPlugin = ({ sdk, context }) => {
3525
3614
  async function getApp(options) {
3615
+ const appKey = "app" in options ? options.app : options.appKey;
3526
3616
  const appsIterable = sdk.listApps({
3527
- appKeys: [options.appKey]
3617
+ appKeys: [appKey]
3528
3618
  }).items();
3529
3619
  for await (const app of appsIterable) {
3530
3620
  return {
@@ -3532,12 +3622,12 @@ var getAppPlugin = ({ sdk, context }) => {
3532
3622
  };
3533
3623
  }
3534
3624
  throw new ZapierAppNotFoundError("App not found", {
3535
- appKey: options.appKey
3625
+ appKey
3536
3626
  });
3537
3627
  }
3538
3628
  const getAppDefinition = createFunction(
3539
3629
  getApp,
3540
- GetAppSchema,
3630
+ GetAppInputSchema,
3541
3631
  createTelemetryCallback(
3542
3632
  context.eventEmission.emitMethodCalled,
3543
3633
  getApp.name
@@ -3554,28 +3644,37 @@ var getAppPlugin = ({ sdk, context }) => {
3554
3644
  inputSchema: GetAppSchema,
3555
3645
  outputSchema: AppItemSchema,
3556
3646
  resolvers: {
3557
- appKey: appKeyResolver
3647
+ app: appKeyResolver
3558
3648
  }
3559
3649
  }
3560
3650
  }
3561
3651
  }
3562
3652
  };
3563
3653
  };
3654
+ var GetActionDescription = "Get detailed information about a specific action";
3564
3655
  var GetActionSchema = zod.z.object({
3656
+ app: AppPropertySchema,
3657
+ actionType: ActionTypePropertySchema,
3658
+ action: ActionPropertySchema
3659
+ }).describe(GetActionDescription).meta({ aliases: { appKey: "app", actionKey: "action" } });
3660
+ var GetActionSchemaDeprecated = zod.z.object({
3565
3661
  appKey: AppKeyPropertySchema,
3566
3662
  actionType: ActionTypePropertySchema,
3567
3663
  actionKey: ActionKeyPropertySchema
3568
- }).describe("Get detailed information about a specific action");
3664
+ });
3665
+ var GetActionInputSchema = zod.z.union([GetActionSchema, GetActionSchemaDeprecated]).describe(GetActionDescription);
3569
3666
 
3570
3667
  // src/plugins/getAction/index.ts
3571
3668
  var getActionPlugin = ({ sdk, context }) => {
3572
3669
  async function getAction(options) {
3573
- const { actionKey, actionType, appKey } = options;
3670
+ const appKey = "app" in options ? options.app : options.appKey;
3671
+ const actionKey = "action" in options ? options.action : options.actionKey;
3672
+ const { actionType } = options;
3574
3673
  setMethodMetadata({
3575
3674
  operationType: actionType,
3576
3675
  operationKey: actionKey
3577
3676
  });
3578
- for await (const action of sdk.listActions({ appKey }).items()) {
3677
+ for await (const action of sdk.listActions({ app: appKey }).items()) {
3579
3678
  if ((action.key === actionKey || action.id === actionKey) && action.action_type === actionType) {
3580
3679
  return { data: action };
3581
3680
  }
@@ -3587,7 +3686,7 @@ var getActionPlugin = ({ sdk, context }) => {
3587
3686
  }
3588
3687
  const getActionDefinition = createFunction(
3589
3688
  getAction,
3590
- GetActionSchema,
3689
+ GetActionInputSchema,
3591
3690
  createTelemetryCallback(
3592
3691
  context.eventEmission.emitMethodCalled,
3593
3692
  getAction.name
@@ -3604,9 +3703,9 @@ var getActionPlugin = ({ sdk, context }) => {
3604
3703
  inputSchema: GetActionSchema,
3605
3704
  outputSchema: ActionItemSchema,
3606
3705
  resolvers: {
3607
- appKey: appKeyResolver,
3706
+ app: appKeyResolver,
3608
3707
  actionType: actionTypeResolver,
3609
- actionKey: actionKeyResolver
3708
+ action: actionKeyResolver
3610
3709
  }
3611
3710
  }
3612
3711
  }
@@ -3614,18 +3713,24 @@ var getActionPlugin = ({ sdk, context }) => {
3614
3713
  };
3615
3714
  };
3616
3715
  var GetConnectionParamSchema = zod.z.object({
3617
- connectionId: ConnectionIdPropertySchema.optional(),
3618
- /** @deprecated Use connectionId instead */
3619
- authenticationId: ConnectionIdPropertySchema.optional()
3716
+ connection: ConnectionPropertySchema.optional(),
3717
+ /** @deprecated Use connection instead */
3718
+ connectionId: ConnectionIdPropertySchema.optional().meta({
3719
+ deprecated: true
3720
+ }),
3721
+ /** @deprecated Use connection instead */
3722
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
3723
+ deprecated: true
3724
+ })
3620
3725
  });
3621
3726
 
3622
3727
  // src/plugins/getConnection/index.ts
3623
3728
  var getConnectionPlugin = ({ context }) => {
3624
3729
  async function getConnection(options) {
3625
3730
  const { api } = context;
3626
- const resolvedConnectionId = options.connectionId ?? options.authenticationId;
3731
+ const resolvedConnectionId = options.connection ?? options.connectionId ?? options.authenticationId;
3627
3732
  if (!resolvedConnectionId) {
3628
- throw new Error("connectionId is required");
3733
+ throw new Error("connection is required");
3629
3734
  }
3630
3735
  return await api.get(
3631
3736
  `/api/v0/connections/${encodeURIComponent(String(resolvedConnectionId))}`
@@ -3650,9 +3755,8 @@ var getConnectionPlugin = ({ context }) => {
3650
3755
  inputSchema: GetConnectionParamSchema,
3651
3756
  outputSchema: ConnectionItemSchema,
3652
3757
  resolvers: {
3653
- connectionId: connectionIdGenericResolver
3654
- },
3655
- deprecatedParameters: ["authenticationId"]
3758
+ connection: connectionIdGenericResolver
3759
+ }
3656
3760
  }
3657
3761
  }
3658
3762
  }
@@ -3661,7 +3765,9 @@ var getConnectionPlugin = ({ context }) => {
3661
3765
 
3662
3766
  // src/plugins/findFirstConnection/schemas.ts
3663
3767
  var FindFirstConnectionSchema = ListConnectionsQuerySchema.omit({
3768
+ connections: true,
3664
3769
  connectionIds: true,
3770
+ authenticationIds: true,
3665
3771
  pageSize: true,
3666
3772
  maxItems: true,
3667
3773
  cursor: true
@@ -3701,8 +3807,7 @@ var findFirstConnectionPlugin = ({ sdk, context }) => {
3701
3807
  type: "item",
3702
3808
  itemType: "Connection",
3703
3809
  inputSchema: FindFirstConnectionSchema,
3704
- outputSchema: ConnectionItemSchema,
3705
- deprecatedParameters: ["authenticationIds"]
3810
+ outputSchema: ConnectionItemSchema
3706
3811
  }
3707
3812
  }
3708
3813
  }
@@ -3711,7 +3816,9 @@ var findFirstConnectionPlugin = ({ sdk, context }) => {
3711
3816
 
3712
3817
  // src/plugins/findUniqueConnection/schemas.ts
3713
3818
  var FindUniqueConnectionSchema = ListConnectionsQuerySchema.omit({
3819
+ connections: true,
3714
3820
  connectionIds: true,
3821
+ authenticationIds: true,
3715
3822
  pageSize: true,
3716
3823
  maxItems: true,
3717
3824
  cursor: true
@@ -3757,25 +3864,22 @@ var findUniqueConnectionPlugin = ({ sdk, context }) => {
3757
3864
  type: "item",
3758
3865
  itemType: "Connection",
3759
3866
  inputSchema: FindUniqueConnectionSchema,
3760
- outputSchema: ConnectionItemSchema,
3761
- deprecatedParameters: ["authenticationIds"]
3867
+ outputSchema: ConnectionItemSchema
3762
3868
  }
3763
3869
  }
3764
3870
  }
3765
3871
  };
3766
3872
  };
3767
- var RunActionSchema = zod.z.object({
3768
- appKey: AppKeyPropertySchema,
3769
- actionType: ActionTypePropertySchema,
3770
- actionKey: ActionKeyPropertySchema,
3771
- connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
3772
- "Connection ID to use when running the action. Required if the action needs a connection to authenticate and interact with the service."
3773
- ),
3873
+ var RunActionDescription = "Execute an action with the given inputs";
3874
+ var RunActionBaseSchema = zod.z.object({
3774
3875
  connection: ConnectionPropertySchema.optional().describe(
3775
3876
  "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId."
3776
3877
  ),
3777
- /** @deprecated Use connectionId instead */
3778
- authenticationId: ConnectionIdPropertySchema.nullable().optional(),
3878
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
3879
+ "Connection ID to use when running the action. Required if the action needs a connection to authenticate and interact with the service."
3880
+ ).meta({ deprecated: true }),
3881
+ /** @deprecated Use connection instead */
3882
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
3779
3883
  inputs: InputsPropertySchema.optional().describe(
3780
3884
  "Input parameters for the action"
3781
3885
  ),
@@ -3783,7 +3887,25 @@ var RunActionSchema = zod.z.object({
3783
3887
  pageSize: zod.z.number().min(1).optional().describe("Number of results per page"),
3784
3888
  maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
3785
3889
  cursor: zod.z.string().optional().describe("Cursor to start from")
3786
- }).describe("Execute an action with the given inputs");
3890
+ });
3891
+ var RunActionSchema = zod.z.object({
3892
+ app: AppPropertySchema,
3893
+ actionType: ActionTypePropertySchema,
3894
+ action: ActionPropertySchema
3895
+ }).merge(RunActionBaseSchema).describe(RunActionDescription).meta({
3896
+ aliases: {
3897
+ appKey: "app",
3898
+ actionKey: "action",
3899
+ connectionId: "connection",
3900
+ authenticationId: "connection"
3901
+ }
3902
+ });
3903
+ var RunActionSchemaDeprecated = zod.z.object({
3904
+ appKey: AppKeyPropertySchema,
3905
+ actionType: ActionTypePropertySchema,
3906
+ actionKey: ActionKeyPropertySchema
3907
+ }).merge(RunActionBaseSchema);
3908
+ var RunActionInputSchema = zod.z.union([RunActionSchema, RunActionSchemaDeprecated]).describe(RunActionDescription);
3787
3909
 
3788
3910
  // src/plugins/runAction/index.ts
3789
3911
  async function executeAction(actionOptions) {
@@ -3884,8 +4006,8 @@ var runActionPlugin = ({ sdk, context }) => {
3884
4006
  );
3885
4007
  }
3886
4008
  const actionData = await sdk.getAction({
3887
- appKey,
3888
- actionKey,
4009
+ app: appKey,
4010
+ action: actionKey,
3889
4011
  actionType
3890
4012
  });
3891
4013
  if (actionData.data.action_type !== actionType) {
@@ -3897,9 +4019,9 @@ var runActionPlugin = ({ sdk, context }) => {
3897
4019
  }
3898
4020
  async function runActionPage(options) {
3899
4021
  const { api } = context;
4022
+ const appKey = "app" in options ? options.app : options.appKey;
4023
+ const actionKey = "action" in options ? options.action : options.actionKey;
3900
4024
  const {
3901
- appKey,
3902
- actionKey,
3903
4025
  actionType,
3904
4026
  connectionId,
3905
4027
  connection,
@@ -3914,7 +4036,11 @@ var runActionPlugin = ({ sdk, context }) => {
3914
4036
  authenticationId,
3915
4037
  resolveConnection: context.resolveConnection
3916
4038
  });
3917
- const { selectedApi, actionId } = await getRunActionContext(options);
4039
+ const { selectedApi, actionId } = await getRunActionContext({
4040
+ appKey,
4041
+ actionKey,
4042
+ actionType
4043
+ });
3918
4044
  setMethodMetadata({
3919
4045
  selectedApi,
3920
4046
  operationType: actionType,
@@ -3950,7 +4076,7 @@ var runActionPlugin = ({ sdk, context }) => {
3950
4076
  const methodName = stripPageSuffix(runActionPage.name);
3951
4077
  const runActionDefinition = createPaginatedFunction(
3952
4078
  runActionPage,
3953
- RunActionSchema,
4079
+ RunActionInputSchema,
3954
4080
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
3955
4081
  methodName
3956
4082
  );
@@ -3965,13 +4091,12 @@ var runActionPlugin = ({ sdk, context }) => {
3965
4091
  inputSchema: RunActionSchema,
3966
4092
  outputSchema: ActionResultItemSchema,
3967
4093
  resolvers: {
3968
- appKey: appKeyResolver,
4094
+ app: appKeyResolver,
3969
4095
  actionType: actionTypeResolver,
3970
- actionKey: actionKeyResolver,
3971
- connectionId: connectionIdResolver,
4096
+ action: actionKeyResolver,
4097
+ connection: connectionIdResolver,
3972
4098
  inputs: inputsResolver
3973
- },
3974
- deprecatedParameters: ["authenticationId"]
4099
+ }
3975
4100
  }
3976
4101
  }
3977
4102
  }
@@ -3981,16 +4106,23 @@ var RelayRequestSchema = zod.z.object({
3981
4106
  url: zod.z.string().url().describe("The URL to request (will be proxied through Relay)"),
3982
4107
  method: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method"),
3983
4108
  body: zod.z.any().optional().describe("Request body as a string"),
3984
- connectionId: ConnectionIdPropertySchema.optional(),
3985
- /** @deprecated Use connectionId instead */
3986
- authenticationId: AuthenticationIdPropertySchema.optional(),
4109
+ connection: ConnectionPropertySchema.optional(),
4110
+ connectionId: ConnectionIdPropertySchema.optional().meta({
4111
+ deprecated: true
4112
+ }),
4113
+ /** @deprecated Use connection instead */
4114
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
4115
+ deprecated: true
4116
+ }),
3987
4117
  callbackUrl: zod.z.string().url().optional().describe("URL to send async response to (makes request async)"),
3988
4118
  headers: zod.z.union([
3989
4119
  zod.z.record(zod.z.string(), zod.z.string()),
3990
4120
  zod.z.instanceof(Headers),
3991
4121
  zod.z.array(zod.z.tuple([zod.z.string(), zod.z.string()]))
3992
4122
  ]).optional().describe("Request headers")
3993
- }).describe("Make authenticated HTTP requests through Zapier's Relay service");
4123
+ }).describe("Make authenticated HTTP requests through Zapier's Relay service").meta({
4124
+ aliases: { connectionId: "connection", authenticationId: "connection" }
4125
+ });
3994
4126
  var RelayFetchSchema = RelayRequestSchema;
3995
4127
 
3996
4128
  // src/utils/logging.ts
@@ -4013,16 +4145,16 @@ var requestPlugin = ({ sdk, context }) => {
4013
4145
  method,
4014
4146
  body,
4015
4147
  headers,
4148
+ connection,
4016
4149
  connectionId,
4017
4150
  authenticationId,
4018
4151
  callbackUrl
4019
4152
  } = options;
4020
- const resolvedConnectionId = connectionId ?? authenticationId;
4021
4153
  return sdk.fetch(url, {
4022
4154
  method,
4023
4155
  body,
4024
4156
  headers,
4025
- connectionId: resolvedConnectionId,
4157
+ connection: connection ?? connectionId ?? authenticationId,
4026
4158
  callbackUrl
4027
4159
  });
4028
4160
  }
@@ -4042,8 +4174,7 @@ var requestPlugin = ({ sdk, context }) => {
4042
4174
  packages: ["cli", "mcp"],
4043
4175
  categories: ["http", "deprecated"],
4044
4176
  returnType: "Response",
4045
- inputSchema: RelayRequestSchema,
4046
- deprecatedParameters: ["authenticationId"]
4177
+ inputSchema: RelayRequestSchema
4047
4178
  }
4048
4179
  }
4049
4180
  }
@@ -4121,8 +4252,8 @@ var ActionEntrySchema = zod.z.object({
4121
4252
  actionKey: zod.z.string().describe("Action key identifier"),
4122
4253
  actionType: zod.z.string().describe("Action type (e.g., 'read', 'write', 'search')"),
4123
4254
  connectionId: ConnectionIdPropertySchema.nullable().optional(),
4124
- /** @deprecated Use connectionId instead */
4125
- authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
4255
+ /** @deprecated Use connection instead */
4256
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
4126
4257
  inputs: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Resolved input values"),
4127
4258
  schema: zod.z.record(zod.z.string(), zod.z.unknown()).describe(
4128
4259
  "Complete JSON Schema from getInputFieldsSchema (includes $schema, type, properties, required, etc.)"
@@ -5995,7 +6126,8 @@ var TableItemSchema = zod.z.object({
5995
6126
  parent_table_id: zod.z.string().optional()
5996
6127
  });
5997
6128
  var ListTablesOptionsSchema = zod.z.object({
5998
- tableIds: zod.z.array(zod.z.string()).optional().describe("Filter by specific table IDs"),
6129
+ tables: TablesPropertySchema.optional(),
6130
+ tableIds: zod.z.array(zod.z.string()).optional().describe("Filter by specific table IDs").meta({ deprecated: true }),
5999
6131
  kind: zod.z.enum(["table", "virtual_table", "both"]).optional().describe("Filter by table type"),
6000
6132
  search: zod.z.string().optional().describe("Search term to filter tables by name"),
6001
6133
  owner: zod.z.string().optional().describe(
@@ -6032,8 +6164,9 @@ var listTablesPlugin = ({ context }) => {
6032
6164
  if (options.pageSize !== void 0) {
6033
6165
  searchParams.limit = options.pageSize.toString();
6034
6166
  }
6035
- if (options?.tableIds && options.tableIds.length > 0) {
6036
- searchParams.ids = options.tableIds.join(",");
6167
+ const tableIds = "tables" in options && options.tables ? options.tables : options.tableIds;
6168
+ if (tableIds && tableIds.length > 0) {
6169
+ searchParams.ids = tableIds.join(",");
6037
6170
  }
6038
6171
  if (options?.kind) {
6039
6172
  searchParams.kind = options.kind;
@@ -6113,38 +6246,41 @@ var listTablesPlugin = ({ context }) => {
6113
6246
  var GetTableApiResponseSchema = zod.z.object({
6114
6247
  data: TableApiItemSchema
6115
6248
  });
6249
+ var GetTableDescription = "Get detailed information about a specific table";
6116
6250
  var GetTableOptionsSchema = zod.z.object({
6251
+ table: TablePropertySchema
6252
+ }).describe(GetTableDescription).meta({ aliases: { tableId: "table" } });
6253
+ var GetTableOptionsSchemaDeprecated = zod.z.object({
6117
6254
  tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table to retrieve")
6118
- }).describe("Get detailed information about a specific table");
6255
+ });
6256
+ var GetTableOptionsInputSchema = zod.z.union([GetTableOptionsSchema, GetTableOptionsSchemaDeprecated]).describe(GetTableDescription);
6119
6257
 
6120
6258
  // src/plugins/tables/getTable/index.ts
6121
6259
  var getTablePlugin = ({ context }) => {
6122
6260
  async function getTable(options) {
6123
6261
  const { api } = context;
6124
- const rawResponse = await api.get(
6125
- `/tables/api/v1/tables/${options.tableId}`,
6126
- {
6127
- customErrorHandler: ({ status }) => {
6128
- if (status === 401) {
6129
- return new ZapierAuthenticationError(
6130
- `Authentication failed. Your token may not have permission to access this table or may be expired. (HTTP ${status})`,
6131
- { statusCode: status }
6132
- );
6133
- }
6134
- if (status === 403) {
6135
- return new ZapierAuthenticationError(
6136
- `Access forbidden. Your token may not have the required scopes to access this table. (HTTP ${status})`,
6137
- { statusCode: status }
6138
- );
6139
- }
6140
- if (status === 404) {
6141
- return new Error(`Table not found: ${options.tableId}`);
6142
- }
6143
- return void 0;
6144
- },
6145
- authRequired: true
6146
- }
6147
- );
6262
+ const tableId = "table" in options ? options.table : options.tableId;
6263
+ const rawResponse = await api.get(`/tables/api/v1/tables/${tableId}`, {
6264
+ customErrorHandler: ({ status }) => {
6265
+ if (status === 401) {
6266
+ return new ZapierAuthenticationError(
6267
+ `Authentication failed. Your token may not have permission to access this table or may be expired. (HTTP ${status})`,
6268
+ { statusCode: status }
6269
+ );
6270
+ }
6271
+ if (status === 403) {
6272
+ return new ZapierAuthenticationError(
6273
+ `Access forbidden. Your token may not have the required scopes to access this table. (HTTP ${status})`,
6274
+ { statusCode: status }
6275
+ );
6276
+ }
6277
+ if (status === 404) {
6278
+ return new Error(`Table not found: ${tableId}`);
6279
+ }
6280
+ return void 0;
6281
+ },
6282
+ authRequired: true
6283
+ });
6148
6284
  const response = GetTableApiResponseSchema.parse(rawResponse);
6149
6285
  return {
6150
6286
  data: transformTableItem(response.data)
@@ -6152,7 +6288,7 @@ var getTablePlugin = ({ context }) => {
6152
6288
  }
6153
6289
  const getTableDefinition = createFunction(
6154
6290
  getTable,
6155
- GetTableOptionsSchema,
6291
+ GetTableOptionsInputSchema,
6156
6292
  createTelemetryCallback(
6157
6293
  context.eventEmission.emitMethodCalled,
6158
6294
  getTable.name
@@ -6169,7 +6305,7 @@ var getTablePlugin = ({ context }) => {
6169
6305
  inputSchema: GetTableOptionsSchema,
6170
6306
  outputSchema: TableItemSchema,
6171
6307
  resolvers: {
6172
- tableId: tableIdResolver
6308
+ table: tableIdResolver
6173
6309
  }
6174
6310
  }
6175
6311
  }
@@ -6244,16 +6380,22 @@ var createTablePlugin = ({ context }) => {
6244
6380
  }
6245
6381
  };
6246
6382
  };
6383
+ var DeleteTableDescription = "Delete a table by its ID";
6247
6384
  var DeleteTableOptionsSchema = zod.z.object({
6385
+ table: TablePropertySchema
6386
+ }).describe(DeleteTableDescription).meta({ aliases: { tableId: "table" } });
6387
+ var DeleteTableOptionsSchemaDeprecated = zod.z.object({
6248
6388
  tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table to delete")
6249
- }).describe("Delete a table by its ID");
6389
+ });
6390
+ var DeleteTableOptionsInputSchema = zod.z.union([DeleteTableOptionsSchema, DeleteTableOptionsSchemaDeprecated]).describe(DeleteTableDescription);
6250
6391
 
6251
6392
  // src/plugins/tables/deleteTable/index.ts
6252
6393
  var deleteTablePlugin = ({ context }) => {
6253
6394
  async function deleteTable(options) {
6254
6395
  await context.checkCapability("canDeleteTables");
6255
6396
  const { api } = context;
6256
- await api.delete(`/tables/api/v1/tables/${options.tableId}`, void 0, {
6397
+ const tableId = "table" in options ? options.table : options.tableId;
6398
+ await api.delete(`/tables/api/v1/tables/${tableId}`, void 0, {
6257
6399
  customErrorHandler: ({ status }) => {
6258
6400
  if (status === 401) {
6259
6401
  return new ZapierAuthenticationError(
@@ -6277,7 +6419,7 @@ var deleteTablePlugin = ({ context }) => {
6277
6419
  }
6278
6420
  const deleteTableDefinition = createFunction(
6279
6421
  deleteTable,
6280
- DeleteTableOptionsSchema,
6422
+ DeleteTableOptionsInputSchema,
6281
6423
  createTelemetryCallback(
6282
6424
  context.eventEmission.emitMethodCalled,
6283
6425
  deleteTable.name
@@ -6293,7 +6435,7 @@ var deleteTablePlugin = ({ context }) => {
6293
6435
  itemType: "Table",
6294
6436
  inputSchema: DeleteTableOptionsSchema,
6295
6437
  resolvers: {
6296
- tableId: tableIdResolver
6438
+ table: tableIdResolver
6297
6439
  },
6298
6440
  confirm: "delete"
6299
6441
  }
@@ -6306,17 +6448,19 @@ var deleteTablePlugin = ({ context }) => {
6306
6448
  var listTableFieldsPlugin = ({ context }) => {
6307
6449
  async function listTableFields(options) {
6308
6450
  const { api } = context;
6451
+ const tableId = "table" in options ? options.table : options.tableId;
6452
+ const fieldKeys = "fields" in options ? options.fields : options.fieldKeys;
6309
6453
  const searchParams = {};
6310
- if (options.fieldKeys && options.fieldKeys.length > 0) {
6454
+ if (fieldKeys && fieldKeys.length > 0) {
6311
6455
  const numericIds = await resolveFieldKeys({
6312
6456
  api,
6313
- tableId: options.tableId,
6314
- fieldKeys: options.fieldKeys
6457
+ tableId,
6458
+ fieldKeys
6315
6459
  });
6316
6460
  searchParams.field_ids = numericIds.join(",");
6317
6461
  }
6318
6462
  const rawResponse = await api.get(
6319
- `/tables/api/v1/tables/${options.tableId}/fields`,
6463
+ `/tables/api/v1/tables/${tableId}/fields`,
6320
6464
  {
6321
6465
  searchParams: Object.keys(searchParams).length > 0 ? searchParams : void 0,
6322
6466
  customErrorHandler: ({ status }) => {
@@ -6333,7 +6477,7 @@ var listTableFieldsPlugin = ({ context }) => {
6333
6477
  );
6334
6478
  }
6335
6479
  if (status === 404) {
6336
- return new Error(`Table not found: ${options.tableId}`);
6480
+ return new Error(`Table not found: ${tableId}`);
6337
6481
  }
6338
6482
  return void 0;
6339
6483
  },
@@ -6347,7 +6491,7 @@ var listTableFieldsPlugin = ({ context }) => {
6347
6491
  }
6348
6492
  const listTableFieldsDefinition = createFunction(
6349
6493
  listTableFields,
6350
- ListTableFieldsOptionsSchema,
6494
+ ListTableFieldsOptionsInputSchema,
6351
6495
  createTelemetryCallback(
6352
6496
  context.eventEmission.emitMethodCalled,
6353
6497
  listTableFields.name
@@ -6364,7 +6508,7 @@ var listTableFieldsPlugin = ({ context }) => {
6364
6508
  inputSchema: ListTableFieldsOptionsSchema,
6365
6509
  outputSchema: FieldItemSchema,
6366
6510
  resolvers: {
6367
- tableId: tableIdResolver
6511
+ table: tableIdResolver
6368
6512
  }
6369
6513
  }
6370
6514
  }
@@ -6388,17 +6532,28 @@ var NewFieldSchema = zod.z.object({
6388
6532
  options: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Data configuration options for the field"),
6389
6533
  config: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Display configuration for the field")
6390
6534
  });
6391
- var CreateTableFieldsOptionsSchema = zod.z.object({
6392
- tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6535
+ var CreateTableFieldsDescription = "Create one or more fields in a table";
6536
+ var CreateTableFieldsBase = zod.z.object({
6393
6537
  fields: zod.z.array(NewFieldSchema).min(1).describe("Array of field definitions to create")
6394
- }).describe("Create one or more fields in a table");
6538
+ });
6539
+ var CreateTableFieldsOptionsSchema = CreateTableFieldsBase.extend({
6540
+ table: TablePropertySchema
6541
+ }).describe(CreateTableFieldsDescription).meta({ aliases: { tableId: "table" } });
6542
+ var CreateTableFieldsOptionsSchemaDeprecated = CreateTableFieldsBase.extend({
6543
+ tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
6544
+ });
6545
+ var CreateTableFieldsOptionsInputSchema = zod.z.union([
6546
+ CreateTableFieldsOptionsSchema,
6547
+ CreateTableFieldsOptionsSchemaDeprecated
6548
+ ]).describe(CreateTableFieldsDescription);
6395
6549
 
6396
6550
  // src/plugins/tables/createTableFields/index.ts
6397
6551
  var createTableFieldsPlugin = ({ context }) => {
6398
6552
  async function createTableFields(options) {
6399
6553
  const { api } = context;
6554
+ const tableId = "table" in options ? options.table : options.tableId;
6400
6555
  const rawResponse = await api.post(
6401
- `/tables/api/v1/tables/${options.tableId}/fields`,
6556
+ `/tables/api/v1/tables/${tableId}/fields`,
6402
6557
  {
6403
6558
  new_fields: options.fields
6404
6559
  },
@@ -6428,7 +6583,7 @@ var createTableFieldsPlugin = ({ context }) => {
6428
6583
  }
6429
6584
  const createTableFieldsDefinition = createFunction(
6430
6585
  createTableFields,
6431
- CreateTableFieldsOptionsSchema,
6586
+ CreateTableFieldsOptionsInputSchema,
6432
6587
  createTelemetryCallback(
6433
6588
  context.eventEmission.emitMethodCalled,
6434
6589
  createTableFields.name
@@ -6445,7 +6600,7 @@ var createTableFieldsPlugin = ({ context }) => {
6445
6600
  inputSchema: CreateTableFieldsOptionsSchema,
6446
6601
  outputSchema: FieldItemSchema,
6447
6602
  resolvers: {
6448
- tableId: tableIdResolver,
6603
+ table: tableIdResolver,
6449
6604
  fields: tableFieldsResolver
6450
6605
  }
6451
6606
  }
@@ -6453,24 +6608,35 @@ var createTableFieldsPlugin = ({ context }) => {
6453
6608
  }
6454
6609
  };
6455
6610
  };
6611
+ var DeleteTableFieldsDescription = "Delete one or more fields from a table";
6456
6612
  var DeleteTableFieldsOptionsSchema = zod.z.object({
6613
+ table: TablePropertySchema,
6614
+ fields: FieldsPropertySchema.min(1)
6615
+ }).describe(DeleteTableFieldsDescription).meta({ aliases: { tableId: "table", fieldKeys: "fields" } });
6616
+ var DeleteTableFieldsOptionsSchemaDeprecated = zod.z.object({
6457
6617
  tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6458
6618
  fieldKeys: zod.z.array(zod.z.union([zod.z.string(), zod.z.number()])).min(1).describe(
6459
6619
  'Fields to delete. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6).'
6460
6620
  )
6461
- }).describe("Delete one or more fields from a table");
6621
+ });
6622
+ var DeleteTableFieldsOptionsInputSchema = zod.z.union([
6623
+ DeleteTableFieldsOptionsSchema,
6624
+ DeleteTableFieldsOptionsSchemaDeprecated
6625
+ ]).describe(DeleteTableFieldsDescription);
6462
6626
 
6463
6627
  // src/plugins/tables/deleteTableFields/index.ts
6464
6628
  var deleteTableFieldsPlugin = ({ context }) => {
6465
6629
  async function deleteTableFields(options) {
6466
6630
  const { api } = context;
6631
+ const tableId = "table" in options ? options.table : options.tableId;
6632
+ const fieldKeys = "fields" in options ? options.fields : options.fieldKeys;
6467
6633
  const numericFieldIds = await resolveFieldKeys({
6468
6634
  api,
6469
- tableId: options.tableId,
6470
- fieldKeys: options.fieldKeys
6635
+ tableId,
6636
+ fieldKeys
6471
6637
  });
6472
6638
  await api.delete(
6473
- `/tables/api/v1/tables/${options.tableId}/fields`,
6639
+ `/tables/api/v1/tables/${tableId}/fields`,
6474
6640
  { field_ids: numericFieldIds },
6475
6641
  {
6476
6642
  customErrorHandler: ({ status }) => {
@@ -6497,7 +6663,7 @@ var deleteTableFieldsPlugin = ({ context }) => {
6497
6663
  }
6498
6664
  const deleteTableFieldsDefinition = createFunction(
6499
6665
  deleteTableFields,
6500
- DeleteTableFieldsOptionsSchema,
6666
+ DeleteTableFieldsOptionsInputSchema,
6501
6667
  createTelemetryCallback(
6502
6668
  context.eventEmission.emitMethodCalled,
6503
6669
  deleteTableFields.name
@@ -6513,8 +6679,8 @@ var deleteTableFieldsPlugin = ({ context }) => {
6513
6679
  itemType: "Field",
6514
6680
  inputSchema: DeleteTableFieldsOptionsSchema,
6515
6681
  resolvers: {
6516
- tableId: tableIdResolver,
6517
- fieldKeys: tableFieldIdsResolver
6682
+ table: tableIdResolver,
6683
+ fields: tableFieldIdsResolver
6518
6684
  },
6519
6685
  confirm: "delete"
6520
6686
  }
@@ -6549,11 +6715,19 @@ var RecordItemSchema = withFormatter(RecordItemSchemaBase, {
6549
6715
  var GetTableRecordApiResponseSchema = zod.z.object({
6550
6716
  data: RecordApiItemSchema
6551
6717
  });
6552
- var GetTableRecordOptionsSchema = zod.z.object({
6553
- tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6554
- recordId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID").describe("The unique identifier of the record"),
6718
+ var GetTableRecordDescription = "Get a single record from a table by ID";
6719
+ var GetTableRecordOptionsBaseSchema = zod.z.object({
6555
6720
  keyMode: KeyModeSchema
6556
- }).describe("Get a single record from a table by ID");
6721
+ });
6722
+ var GetTableRecordOptionsSchema = GetTableRecordOptionsBaseSchema.extend({
6723
+ table: TablePropertySchema,
6724
+ record: RecordPropertySchema
6725
+ }).describe(GetTableRecordDescription).meta({ aliases: { tableId: "table", recordId: "record" } });
6726
+ var GetTableRecordOptionsSchemaDeprecated = GetTableRecordOptionsBaseSchema.extend({
6727
+ tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6728
+ recordId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID").describe("The unique identifier of the record")
6729
+ });
6730
+ var GetTableRecordOptionsInputSchema = zod.z.union([GetTableRecordOptionsSchema, GetTableRecordOptionsSchemaDeprecated]).describe(GetTableRecordDescription);
6557
6731
 
6558
6732
  // src/formatters/tableRecord.ts
6559
6733
  var tableRecordFormatter = {
@@ -6562,7 +6736,7 @@ var tableRecordFormatter = {
6562
6736
  const hasFieldIds = Object.keys(item.data).some(isFieldId);
6563
6737
  if (!hasFieldIds) return {};
6564
6738
  const { data: fields } = await sdk.listTableFields({
6565
- tableId: params.tableId
6739
+ table: params.tableId
6566
6740
  });
6567
6741
  return Object.fromEntries(fields.map((f) => [f.id, f.name]));
6568
6742
  },
@@ -6581,8 +6755,10 @@ var tableRecordFormatter = {
6581
6755
  var getTableRecordPlugin = ({ context }) => {
6582
6756
  async function getTableRecord(options) {
6583
6757
  const { api } = context;
6758
+ const tableId = "table" in options ? options.table : options.tableId;
6759
+ const recordId = "record" in options ? options.record : options.recordId;
6584
6760
  const rawResponse = await api.get(
6585
- `/tables/api/v1/tables/${options.tableId}/records/${options.recordId}`,
6761
+ `/tables/api/v1/tables/${tableId}/records/${recordId}`,
6586
6762
  {
6587
6763
  customErrorHandler: ({ status }) => {
6588
6764
  if (status === 401) {
@@ -6598,7 +6774,7 @@ var getTableRecordPlugin = ({ context }) => {
6598
6774
  );
6599
6775
  }
6600
6776
  if (status === 404) {
6601
- return new Error(`Record not found: ${options.recordId}`);
6777
+ return new Error(`Record not found: ${recordId}`);
6602
6778
  }
6603
6779
  return void 0;
6604
6780
  },
@@ -6608,7 +6784,7 @@ var getTableRecordPlugin = ({ context }) => {
6608
6784
  const response = GetTableRecordApiResponseSchema.parse(rawResponse);
6609
6785
  const translator = await createFieldKeyTranslator({
6610
6786
  api,
6611
- tableId: options.tableId,
6787
+ tableId,
6612
6788
  keyMode: options.keyMode
6613
6789
  });
6614
6790
  return {
@@ -6620,7 +6796,7 @@ var getTableRecordPlugin = ({ context }) => {
6620
6796
  }
6621
6797
  const getTableRecordDefinition = createFunction(
6622
6798
  getTableRecord,
6623
- GetTableRecordOptionsSchema,
6799
+ GetTableRecordOptionsInputSchema,
6624
6800
  createTelemetryCallback(
6625
6801
  context.eventEmission.emitMethodCalled,
6626
6802
  getTableRecord.name
@@ -6637,8 +6813,8 @@ var getTableRecordPlugin = ({ context }) => {
6637
6813
  inputSchema: GetTableRecordOptionsSchema,
6638
6814
  outputSchema: RecordItemSchema,
6639
6815
  resolvers: {
6640
- tableId: tableIdResolver,
6641
- recordId: tableRecordIdResolver
6816
+ table: tableIdResolver,
6817
+ record: tableRecordIdResolver
6642
6818
  },
6643
6819
  formatter: tableRecordFormatter
6644
6820
  }
@@ -6683,15 +6859,25 @@ var SortConditionSchema = zod.z.object({
6683
6859
  fieldKey: zod.z.string().describe("The field key to sort by"),
6684
6860
  direction: SortDirectionSchema.optional().default("asc").describe("Sort direction")
6685
6861
  });
6686
- var ListTableRecordsOptionsSchema = zod.z.object({
6687
- tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6862
+ var ListTableRecordsDescription = "List records in a table with optional filtering and sorting";
6863
+ var ListTableRecordsBase = zod.z.object({
6688
6864
  filters: zod.z.array(FilterConditionSchema).optional().describe("Filter conditions for the query"),
6689
6865
  sort: SortConditionSchema.optional().describe("Sort records by a field"),
6690
6866
  pageSize: zod.z.number().min(1).max(1e3).optional().describe("Number of records per page (max 1000)"),
6691
6867
  maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
6692
6868
  cursor: zod.z.string().optional().describe("Cursor to start from"),
6693
6869
  keyMode: KeyModeSchema
6694
- }).describe("List records in a table with optional filtering and sorting");
6870
+ });
6871
+ var ListTableRecordsOptionsSchema = ListTableRecordsBase.extend({
6872
+ table: TablePropertySchema
6873
+ }).describe(ListTableRecordsDescription).meta({ aliases: { tableId: "table" } });
6874
+ var ListTableRecordsOptionsSchemaDeprecated = ListTableRecordsBase.extend({
6875
+ tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
6876
+ });
6877
+ var ListTableRecordsOptionsInputSchema = zod.z.union([
6878
+ ListTableRecordsOptionsSchema,
6879
+ ListTableRecordsOptionsSchemaDeprecated
6880
+ ]).describe(ListTableRecordsDescription);
6695
6881
 
6696
6882
  // src/plugins/tables/listTableRecords/index.ts
6697
6883
  function extractNextCursor2(meta) {
@@ -6703,9 +6889,10 @@ function extractNextCursor2(meta) {
6703
6889
  var listTableRecordsPlugin = ({ context }) => {
6704
6890
  async function listTableRecordsPage(options) {
6705
6891
  const { api } = context;
6892
+ const tableId = "table" in options ? options.table : options.tableId;
6706
6893
  const translator = await createFieldKeyTranslator({
6707
6894
  api,
6708
- tableId: options.tableId,
6895
+ tableId,
6709
6896
  keyMode: options.keyMode
6710
6897
  });
6711
6898
  const body = {};
@@ -6734,7 +6921,7 @@ var listTableRecordsPlugin = ({ context }) => {
6734
6921
  };
6735
6922
  }
6736
6923
  const rawResponse = await api.post(
6737
- `/tables/api/v1/tables/${options.tableId}/records/query`,
6924
+ `/tables/api/v1/tables/${tableId}/records/query`,
6738
6925
  body,
6739
6926
  {
6740
6927
  searchParams: { allow_nested_queries: "true" },
@@ -6752,7 +6939,7 @@ var listTableRecordsPlugin = ({ context }) => {
6752
6939
  );
6753
6940
  }
6754
6941
  if (status === 404) {
6755
- return new Error(`Table not found: ${options.tableId}`);
6942
+ return new Error(`Table not found: ${tableId}`);
6756
6943
  }
6757
6944
  return void 0;
6758
6945
  },
@@ -6772,7 +6959,7 @@ var listTableRecordsPlugin = ({ context }) => {
6772
6959
  const methodName = stripPageSuffix(listTableRecordsPage.name);
6773
6960
  const listTableRecordsDefinition = createPaginatedFunction(
6774
6961
  listTableRecordsPage,
6775
- ListTableRecordsOptionsSchema,
6962
+ ListTableRecordsOptionsInputSchema,
6776
6963
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
6777
6964
  methodName,
6778
6965
  DEFAULT_PAGE_SIZE
@@ -6788,7 +6975,7 @@ var listTableRecordsPlugin = ({ context }) => {
6788
6975
  inputSchema: ListTableRecordsOptionsSchema,
6789
6976
  outputSchema: RecordItemSchema,
6790
6977
  resolvers: {
6791
- tableId: tableIdResolver,
6978
+ table: tableIdResolver,
6792
6979
  filters: tableFiltersResolver,
6793
6980
  sort: tableSortResolver
6794
6981
  },
@@ -6811,23 +6998,36 @@ var CreateTableRecordsApiResponseSchema = zod.z.object({
6811
6998
  var NewRecordSchema = zod.z.object({
6812
6999
  data: zod.z.record(zod.z.string(), zod.z.unknown()).describe("The field values for the record, keyed by field ID")
6813
7000
  });
6814
- var CreateTableRecordsOptionsSchema = zod.z.object({
6815
- tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
7001
+ var CreateTableRecordsDescription = "Create one or more records in a table";
7002
+ var CreateTableRecordsBase = zod.z.object({
6816
7003
  records: zod.z.array(NewRecordSchema).min(1).max(100).describe("Array of records to create (max 100)"),
6817
7004
  keyMode: KeyModeSchema
6818
- }).describe("Create one or more records in a table");
7005
+ });
7006
+ var CreateTableRecordsOptionsSchema = CreateTableRecordsBase.extend({
7007
+ table: TablePropertySchema
7008
+ }).describe(CreateTableRecordsDescription).meta({ aliases: { tableId: "table" } });
7009
+ var CreateTableRecordsOptionsSchemaDeprecated = CreateTableRecordsBase.extend(
7010
+ {
7011
+ tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
7012
+ }
7013
+ );
7014
+ var CreateTableRecordsOptionsInputSchema = zod.z.union([
7015
+ CreateTableRecordsOptionsSchema,
7016
+ CreateTableRecordsOptionsSchemaDeprecated
7017
+ ]).describe(CreateTableRecordsDescription);
6819
7018
 
6820
7019
  // src/plugins/tables/createTableRecords/index.ts
6821
7020
  var createTableRecordsPlugin = ({ context }) => {
6822
7021
  async function createTableRecords(options) {
6823
7022
  const { api } = context;
7023
+ const tableId = "table" in options ? options.table : options.tableId;
6824
7024
  const translator = await createFieldKeyTranslator({
6825
7025
  api,
6826
- tableId: options.tableId,
7026
+ tableId,
6827
7027
  keyMode: options.keyMode
6828
7028
  });
6829
7029
  const rawResponse = await api.post(
6830
- `/tables/api/v1/tables/${options.tableId}/records`,
7030
+ `/tables/api/v1/tables/${tableId}/records`,
6831
7031
  {
6832
7032
  new_records: options.records.map((record) => ({
6833
7033
  data: translator.translateInput(record.data)
@@ -6848,7 +7048,7 @@ var createTableRecordsPlugin = ({ context }) => {
6848
7048
  );
6849
7049
  }
6850
7050
  if (status === 404) {
6851
- return new Error(`Table not found: ${options.tableId}`);
7051
+ return new Error(`Table not found: ${tableId}`);
6852
7052
  }
6853
7053
  return void 0;
6854
7054
  },
@@ -6869,7 +7069,7 @@ var createTableRecordsPlugin = ({ context }) => {
6869
7069
  }
6870
7070
  const createTableRecordsDefinition = createFunction(
6871
7071
  createTableRecords,
6872
- CreateTableRecordsOptionsSchema,
7072
+ CreateTableRecordsOptionsInputSchema,
6873
7073
  createTelemetryCallback(
6874
7074
  context.eventEmission.emitMethodCalled,
6875
7075
  createTableRecords.name
@@ -6886,7 +7086,7 @@ var createTableRecordsPlugin = ({ context }) => {
6886
7086
  inputSchema: CreateTableRecordsOptionsSchema,
6887
7087
  outputSchema: RecordItemSchema,
6888
7088
  resolvers: {
6889
- tableId: tableIdResolver,
7089
+ table: tableIdResolver,
6890
7090
  records: tableRecordsResolver
6891
7091
  },
6892
7092
  formatter: tableRecordFormatter
@@ -6895,20 +7095,29 @@ var createTableRecordsPlugin = ({ context }) => {
6895
7095
  }
6896
7096
  };
6897
7097
  };
7098
+ var DeleteTableRecordsDescription = "Delete one or more records from a table";
6898
7099
  var DeleteTableRecordsOptionsSchema = zod.z.object({
7100
+ table: TablePropertySchema,
7101
+ records: RecordsPropertySchema
7102
+ }).describe(DeleteTableRecordsDescription).meta({ aliases: { tableId: "table", recordIds: "records" } });
7103
+ var DeleteTableRecordsOptionsSchemaDeprecated = zod.z.object({
6899
7104
  tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
6900
- recordIds: zod.z.array(
6901
- zod.z.string().regex(/^[A-Z0-9]{26}$/, "Record ID must be a valid ULID")
6902
- ).min(1).max(100).describe("Array of record IDs to delete (max 100)")
6903
- }).describe("Delete one or more records from a table");
7105
+ recordIds: zod.z.array(zod.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)")
7106
+ });
7107
+ var DeleteTableRecordsOptionsInputSchema = zod.z.union([
7108
+ DeleteTableRecordsOptionsSchema,
7109
+ DeleteTableRecordsOptionsSchemaDeprecated
7110
+ ]).describe(DeleteTableRecordsDescription);
6904
7111
 
6905
7112
  // src/plugins/tables/deleteTableRecords/index.ts
6906
7113
  var deleteTableRecordsPlugin = ({ context }) => {
6907
7114
  async function deleteTableRecords(options) {
6908
7115
  const { api } = context;
7116
+ const tableId = "table" in options ? options.table : options.tableId;
7117
+ const recordIds = "records" in options ? options.records : options.recordIds;
6909
7118
  await api.delete(
6910
- `/tables/api/v1/tables/${options.tableId}/records`,
6911
- { record_ids: options.recordIds },
7119
+ `/tables/api/v1/tables/${tableId}/records`,
7120
+ { record_ids: recordIds },
6912
7121
  {
6913
7122
  customErrorHandler: ({ status }) => {
6914
7123
  if (status === 401) {
@@ -6934,7 +7143,7 @@ var deleteTableRecordsPlugin = ({ context }) => {
6934
7143
  }
6935
7144
  const deleteTableRecordsDefinition = createFunction(
6936
7145
  deleteTableRecords,
6937
- DeleteTableRecordsOptionsSchema,
7146
+ DeleteTableRecordsOptionsInputSchema,
6938
7147
  createTelemetryCallback(
6939
7148
  context.eventEmission.emitMethodCalled,
6940
7149
  deleteTableRecords.name
@@ -6950,8 +7159,8 @@ var deleteTableRecordsPlugin = ({ context }) => {
6950
7159
  itemType: "Record",
6951
7160
  inputSchema: DeleteTableRecordsOptionsSchema,
6952
7161
  resolvers: {
6953
- tableId: tableIdResolver,
6954
- recordIds: tableRecordIdsResolver
7162
+ table: tableIdResolver,
7163
+ records: tableRecordIdsResolver
6955
7164
  },
6956
7165
  confirm: "delete"
6957
7166
  }
@@ -6973,23 +7182,36 @@ var UpdateRecordSchema = zod.z.object({
6973
7182
  id: zod.z.string().describe("The record ID to update"),
6974
7183
  data: zod.z.record(zod.z.string(), zod.z.unknown()).describe("The field values to update, keyed by field key")
6975
7184
  });
6976
- var UpdateTableRecordsOptionsSchema = zod.z.object({
6977
- tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table"),
7185
+ var UpdateTableRecordsDescription = "Update one or more records in a table";
7186
+ var UpdateTableRecordsBase = zod.z.object({
6978
7187
  records: zod.z.array(UpdateRecordSchema).min(1).max(100).describe("Array of records to update (max 100)"),
6979
7188
  keyMode: KeyModeSchema
6980
- }).describe("Update one or more records in a table");
7189
+ });
7190
+ var UpdateTableRecordsOptionsSchema = UpdateTableRecordsBase.extend({
7191
+ table: TablePropertySchema
7192
+ }).describe(UpdateTableRecordsDescription).meta({ aliases: { tableId: "table" } });
7193
+ var UpdateTableRecordsOptionsSchemaDeprecated = UpdateTableRecordsBase.extend(
7194
+ {
7195
+ tableId: zod.z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
7196
+ }
7197
+ );
7198
+ var UpdateTableRecordsOptionsInputSchema = zod.z.union([
7199
+ UpdateTableRecordsOptionsSchema,
7200
+ UpdateTableRecordsOptionsSchemaDeprecated
7201
+ ]).describe(UpdateTableRecordsDescription);
6981
7202
 
6982
7203
  // src/plugins/tables/updateTableRecords/index.ts
6983
7204
  var updateTableRecordsPlugin = ({ context }) => {
6984
7205
  async function updateTableRecords(options) {
6985
7206
  const { api } = context;
7207
+ const tableId = "table" in options ? options.table : options.tableId;
6986
7208
  const translator = await createFieldKeyTranslator({
6987
7209
  api,
6988
- tableId: options.tableId,
7210
+ tableId,
6989
7211
  keyMode: options.keyMode
6990
7212
  });
6991
7213
  const rawResponse = await api.patch(
6992
- `/tables/api/v1/tables/${options.tableId}/records`,
7214
+ `/tables/api/v1/tables/${tableId}/records`,
6993
7215
  {
6994
7216
  updated_records: options.records.map((record) => ({
6995
7217
  id: record.id,
@@ -7011,7 +7233,7 @@ var updateTableRecordsPlugin = ({ context }) => {
7011
7233
  );
7012
7234
  }
7013
7235
  if (status === 404) {
7014
- return new Error(`Table not found: ${options.tableId}`);
7236
+ return new Error(`Table not found: ${tableId}`);
7015
7237
  }
7016
7238
  return void 0;
7017
7239
  },
@@ -7032,7 +7254,7 @@ var updateTableRecordsPlugin = ({ context }) => {
7032
7254
  }
7033
7255
  const updateTableRecordsDefinition = createFunction(
7034
7256
  updateTableRecords,
7035
- UpdateTableRecordsOptionsSchema,
7257
+ UpdateTableRecordsOptionsInputSchema,
7036
7258
  createTelemetryCallback(
7037
7259
  context.eventEmission.emitMethodCalled,
7038
7260
  updateTableRecords.name
@@ -7049,7 +7271,7 @@ var updateTableRecordsPlugin = ({ context }) => {
7049
7271
  inputSchema: UpdateTableRecordsOptionsSchema,
7050
7272
  outputSchema: RecordItemSchema,
7051
7273
  resolvers: {
7052
- tableId: tableIdResolver,
7274
+ table: tableIdResolver,
7053
7275
  records: tableUpdateRecordsResolver
7054
7276
  },
7055
7277
  formatter: tableRecordFormatter
@@ -7123,7 +7345,6 @@ var registryPlugin = ({ sdk, context }) => {
7123
7345
  // Auto-infer confirm: "delete" from type: "delete" (all deletes should confirm)
7124
7346
  confirm: meta.confirm ?? (meta.type === "delete" ? "delete" : void 0),
7125
7347
  deprecation: meta.deprecation,
7126
- deprecatedParameters: meta.deprecatedParameters,
7127
7348
  aliases: meta.aliases,
7128
7349
  supportsJsonOutput: meta.supportsJsonOutput ?? true
7129
7350
  };
@@ -7235,43 +7456,66 @@ var findUniqueAuthenticationPlugin = ({ sdk }) => ({
7235
7456
  }
7236
7457
  }
7237
7458
  });
7459
+ 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.";
7460
+ var GetInputFieldsSchemaBaseSchema = zod.z.object({
7461
+ connection: ConnectionPropertySchema.optional().describe(
7462
+ "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId."
7463
+ ),
7464
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
7465
+ "Connection ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7466
+ ).meta({ deprecated: true }),
7467
+ /** @deprecated Use connection instead */
7468
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
7469
+ "Authentication ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7470
+ ).meta({ deprecated: true }),
7471
+ inputs: InputsPropertySchema.optional().describe(
7472
+ "Current input values that may affect the schema (e.g., when fields depend on other field values)"
7473
+ )
7474
+ });
7238
7475
  var GetInputFieldsSchemaSchema = zod.z.object({
7239
- appKey: AppKeyPropertySchema.describe(
7476
+ app: AppPropertySchema.describe(
7240
7477
  "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
7241
7478
  ),
7242
7479
  actionType: ActionTypePropertySchema.describe(
7243
7480
  "Action type that matches the action's defined type"
7244
7481
  ),
7245
- actionKey: ActionKeyPropertySchema.describe(
7482
+ action: ActionPropertySchema.describe(
7246
7483
  "Action key to get the input schema for"
7484
+ )
7485
+ }).merge(GetInputFieldsSchemaBaseSchema).describe(GetInputFieldsSchemaDescription).meta({
7486
+ aliases: {
7487
+ appKey: "app",
7488
+ actionKey: "action",
7489
+ connectionId: "connection",
7490
+ authenticationId: "connection"
7491
+ }
7492
+ });
7493
+ var GetInputFieldsSchemaSchemaDeprecated = zod.z.object({
7494
+ appKey: AppKeyPropertySchema.describe(
7495
+ "App key (e.g., 'SlackCLIAPI' or slug like 'github') to get the input schema for"
7247
7496
  ),
7248
- connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
7249
- "Connection ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7250
- ),
7251
- /** @deprecated Use connectionId instead */
7252
- authenticationId: AuthenticationIdPropertySchema.nullable().optional().describe(
7253
- "Authentication ID to use when fetching the schema. Required if the action needs a connection to determine available fields."
7497
+ actionType: ActionTypePropertySchema.describe(
7498
+ "Action type that matches the action's defined type"
7254
7499
  ),
7255
- inputs: InputsPropertySchema.optional().describe(
7256
- "Current input values that may affect the schema (e.g., when fields depend on other field values)"
7500
+ actionKey: ActionKeyPropertySchema.describe(
7501
+ "Action key to get the input schema for"
7257
7502
  )
7258
- }).describe(
7259
- "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."
7260
- );
7503
+ }).merge(GetInputFieldsSchemaBaseSchema);
7504
+ var GetInputFieldsSchemaInputSchema = zod.z.union([GetInputFieldsSchemaSchema, GetInputFieldsSchemaSchemaDeprecated]).describe(GetInputFieldsSchemaDescription);
7261
7505
 
7262
7506
  // src/plugins/getInputFieldsSchema/index.ts
7263
7507
  var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7264
7508
  async function getInputFieldsSchema(options) {
7265
7509
  const { api, getVersionedImplementationId } = context;
7266
- const {
7267
- appKey,
7268
- actionKey,
7269
- actionType,
7510
+ const appKey = "app" in options ? options.app : options.appKey;
7511
+ const actionKey = "action" in options ? options.action : options.actionKey;
7512
+ const { actionType, connection, connectionId, authenticationId, inputs } = options;
7513
+ const resolvedConnectionId = await resolveConnectionId({
7514
+ connection,
7270
7515
  connectionId,
7271
7516
  authenticationId,
7272
- inputs
7273
- } = options;
7274
- const resolvedConnectionId = connectionId ?? authenticationId ?? null;
7517
+ resolveConnection: context.resolveConnection
7518
+ });
7275
7519
  const selectedApi = await getVersionedImplementationId(appKey);
7276
7520
  if (!selectedApi) {
7277
7521
  throw new ZapierConfigurationError(
@@ -7285,16 +7529,16 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7285
7529
  operationKey: actionKey
7286
7530
  });
7287
7531
  const { data: action } = await sdk.getAction({
7288
- appKey,
7532
+ app: appKey,
7289
7533
  actionType,
7290
- actionKey
7534
+ action: actionKey
7291
7535
  });
7292
7536
  const needsData = await fetchImplementationNeeds({
7293
7537
  api,
7294
7538
  selectedApi,
7295
7539
  action: action.key,
7296
7540
  actionType,
7297
- connectionId: resolvedConnectionId,
7541
+ connectionId: resolvedConnectionId ?? null,
7298
7542
  inputs
7299
7543
  });
7300
7544
  return {
@@ -7303,7 +7547,7 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7303
7547
  }
7304
7548
  const getInputFieldsSchemaDefinition = createFunction(
7305
7549
  getInputFieldsSchema,
7306
- GetInputFieldsSchemaSchema,
7550
+ GetInputFieldsSchemaInputSchema,
7307
7551
  createTelemetryCallback(
7308
7552
  context.eventEmission.emitMethodCalled,
7309
7553
  getInputFieldsSchema.name
@@ -7319,13 +7563,12 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7319
7563
  itemType: "InputSchema",
7320
7564
  inputSchema: GetInputFieldsSchemaSchema,
7321
7565
  resolvers: {
7322
- appKey: appKeyResolver,
7566
+ app: appKeyResolver,
7323
7567
  actionType: actionTypeResolver,
7324
- actionKey: actionKeyResolver,
7325
- connectionId: connectionIdResolver,
7568
+ action: actionKeyResolver,
7569
+ connection: connectionIdResolver,
7326
7570
  inputs: inputsAllOptionalResolver
7327
- },
7328
- deprecatedParameters: ["authenticationId"]
7571
+ }
7329
7572
  }
7330
7573
  }
7331
7574
  }
@@ -7351,28 +7594,45 @@ var InputFieldChoiceItemSchema = withFormatter(NeedChoicesSchema, {
7351
7594
  };
7352
7595
  }
7353
7596
  });
7354
- var ListInputFieldChoicesSchema = zod.z.object({
7355
- // Required action identification
7356
- appKey: AppKeyPropertySchema,
7357
- actionType: ActionTypePropertySchema,
7358
- actionKey: ActionKeyPropertySchema,
7359
- // Input field specification
7360
- inputFieldKey: zod.z.string().min(1).describe("Input field key to get choices for."),
7361
- // Common parameters
7597
+ var ListInputFieldChoicesDescription = "Get the available choices for a dynamic dropdown input field";
7598
+ var ListInputFieldChoicesBaseSchema = zod.z.object({
7599
+ connection: ConnectionPropertySchema.optional().describe(
7600
+ "Connection alias (string) or numeric connectionId. Strings are resolved from the connections map; numbers are used directly. Mutually exclusive with connectionId."
7601
+ ),
7362
7602
  connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
7363
7603
  "Connection ID to use when listing available field choices. Required if the action needs a connection to populate dynamic dropdown options."
7364
- ),
7365
- /** @deprecated Use connectionId instead */
7366
- authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
7604
+ ).meta({ deprecated: true }),
7605
+ /** @deprecated Use connection instead */
7606
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional().meta({ deprecated: true }),
7367
7607
  inputs: InputsPropertySchema.optional().describe(
7368
7608
  "Current input values that may affect available choices"
7369
7609
  ),
7370
7610
  page: zod.z.number().int().min(0).optional().describe("Page number for paginated results"),
7371
- // Pagination options (SDK-level)
7372
7611
  pageSize: zod.z.number().min(1).optional().describe("Number of choices per page"),
7373
7612
  maxItems: zod.z.number().min(1).optional().describe("Maximum total items to return across all pages"),
7374
7613
  cursor: zod.z.string().optional().describe("Cursor to start from")
7375
- }).describe("Get the available choices for a dynamic dropdown input field");
7614
+ });
7615
+ var ListInputFieldChoicesSchema = zod.z.object({
7616
+ app: AppPropertySchema,
7617
+ actionType: ActionTypePropertySchema,
7618
+ action: ActionPropertySchema,
7619
+ inputField: InputFieldPropertySchema
7620
+ }).merge(ListInputFieldChoicesBaseSchema).describe(ListInputFieldChoicesDescription).meta({
7621
+ aliases: {
7622
+ appKey: "app",
7623
+ actionKey: "action",
7624
+ inputFieldKey: "inputField",
7625
+ connectionId: "connection",
7626
+ authenticationId: "connection"
7627
+ }
7628
+ });
7629
+ var ListInputFieldChoicesSchemaDeprecated = zod.z.object({
7630
+ appKey: AppKeyPropertySchema,
7631
+ actionType: ActionTypePropertySchema,
7632
+ actionKey: ActionKeyPropertySchema,
7633
+ inputFieldKey: zod.z.string().min(1).describe("Input field key to get choices for.")
7634
+ }).merge(ListInputFieldChoicesBaseSchema);
7635
+ var ListInputFieldChoicesInputSchema = zod.z.union([ListInputFieldChoicesSchema, ListInputFieldChoicesSchemaDeprecated]).describe(ListInputFieldChoicesDescription);
7376
7636
 
7377
7637
  // src/plugins/listInputFieldChoices/index.ts
7378
7638
  function transformNeedChoicesToInputFieldChoiceItem(choice) {
@@ -7386,18 +7646,24 @@ function transformNeedChoicesToInputFieldChoiceItem(choice) {
7386
7646
  var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7387
7647
  async function listInputFieldChoicesPage(options) {
7388
7648
  const { api, getVersionedImplementationId } = context;
7649
+ const appKey = "app" in options ? options.app : options.appKey;
7650
+ const actionKey = "action" in options ? options.action : options.actionKey;
7651
+ const inputFieldKey = "inputField" in options ? options.inputField : options.inputFieldKey;
7389
7652
  const {
7390
- appKey,
7391
7653
  actionType,
7392
- actionKey,
7393
- inputFieldKey,
7654
+ connection,
7394
7655
  connectionId,
7395
7656
  authenticationId,
7396
7657
  inputs,
7397
7658
  page,
7398
7659
  cursor
7399
7660
  } = options;
7400
- const resolvedConnectionId = connectionId ?? authenticationId ?? null;
7661
+ const resolvedConnectionId = await resolveConnectionId({
7662
+ connection,
7663
+ connectionId,
7664
+ authenticationId,
7665
+ resolveConnection: context.resolveConnection
7666
+ });
7401
7667
  const selectedApi = await getVersionedImplementationId(appKey);
7402
7668
  if (!selectedApi) {
7403
7669
  throw new ZapierConfigurationError(
@@ -7411,16 +7677,16 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7411
7677
  operationKey: actionKey
7412
7678
  });
7413
7679
  const { data: action } = await sdk.getAction({
7414
- appKey,
7680
+ app: appKey,
7415
7681
  actionType,
7416
- actionKey
7682
+ action: actionKey
7417
7683
  });
7418
7684
  const needsData = await fetchImplementationNeeds({
7419
7685
  api,
7420
7686
  selectedApi,
7421
7687
  action: action.key,
7422
7688
  actionType,
7423
- connectionId: resolvedConnectionId,
7689
+ connectionId: resolvedConnectionId ?? null,
7424
7690
  inputs
7425
7691
  });
7426
7692
  const targetNeed = needsData.needs?.find(
@@ -7444,7 +7710,7 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7444
7710
  api,
7445
7711
  actionId: action.id,
7446
7712
  inputFieldId: inputFieldKey,
7447
- connectionId: resolvedConnectionId,
7713
+ connectionId: resolvedConnectionId ?? null,
7448
7714
  inputs,
7449
7715
  page: requestPage
7450
7716
  });
@@ -7473,7 +7739,7 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7473
7739
  const methodName = stripPageSuffix(listInputFieldChoicesPage.name);
7474
7740
  const listInputFieldChoicesDefinition = createPaginatedFunction(
7475
7741
  listInputFieldChoicesPage,
7476
- ListInputFieldChoicesSchema,
7742
+ ListInputFieldChoicesInputSchema,
7477
7743
  createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
7478
7744
  methodName,
7479
7745
  DEFAULT_PAGE_SIZE
@@ -7489,14 +7755,13 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7489
7755
  inputSchema: ListInputFieldChoicesSchema,
7490
7756
  outputSchema: InputFieldChoiceItemSchema,
7491
7757
  resolvers: {
7492
- appKey: appKeyResolver,
7758
+ app: appKeyResolver,
7493
7759
  actionType: actionTypeResolver,
7494
- actionKey: actionKeyResolver,
7495
- connectionId: connectionIdResolver,
7496
- inputFieldKey: inputFieldKeyResolver,
7760
+ action: actionKeyResolver,
7761
+ connection: connectionIdResolver,
7762
+ inputField: inputFieldKeyResolver,
7497
7763
  inputs: inputsAllOptionalResolver
7498
- },
7499
- deprecatedParameters: ["authenticationId"]
7764
+ }
7500
7765
  }
7501
7766
  }
7502
7767
  }
@@ -7661,7 +7926,7 @@ function getCpuTime() {
7661
7926
  }
7662
7927
 
7663
7928
  // src/plugins/eventEmission/builders.ts
7664
- var SDK_VERSION = "0.39.0";
7929
+ var SDK_VERSION = "0.40.0";
7665
7930
  function createBaseEvent(context = {}) {
7666
7931
  return {
7667
7932
  event_id: generateEventId(),
@@ -8192,9 +8457,12 @@ var BaseSdkOptionsSchema = zod.z.object({
8192
8457
  });
8193
8458
 
8194
8459
  exports.ActionKeyPropertySchema = ActionKeyPropertySchema;
8460
+ exports.ActionPropertySchema = ActionPropertySchema;
8195
8461
  exports.ActionTimeoutMsPropertySchema = ActionTimeoutMsPropertySchema;
8196
8462
  exports.ActionTypePropertySchema = ActionTypePropertySchema;
8197
8463
  exports.AppKeyPropertySchema = AppKeyPropertySchema;
8464
+ exports.AppPropertySchema = AppPropertySchema;
8465
+ exports.AppsPropertySchema = AppsPropertySchema;
8198
8466
  exports.AuthenticationIdPropertySchema = AuthenticationIdPropertySchema;
8199
8467
  exports.BaseSdkOptionsSchema = BaseSdkOptionsSchema;
8200
8468
  exports.CONTEXT_CACHE_MAX_SIZE = CONTEXT_CACHE_MAX_SIZE;
@@ -8204,6 +8472,7 @@ exports.ConnectionEntrySchema = ConnectionEntrySchema;
8204
8472
  exports.ConnectionIdPropertySchema = ConnectionIdPropertySchema;
8205
8473
  exports.ConnectionPropertySchema = ConnectionPropertySchema;
8206
8474
  exports.ConnectionsMapSchema = ConnectionsMapSchema;
8475
+ exports.ConnectionsPropertySchema = ConnectionsPropertySchema;
8207
8476
  exports.CredentialsFunctionSchema = CredentialsFunctionSchema;
8208
8477
  exports.CredentialsObjectSchema = CredentialsObjectSchema;
8209
8478
  exports.CredentialsSchema = CredentialsSchema;
@@ -8211,6 +8480,8 @@ exports.DEFAULT_ACTION_TIMEOUT_MS = DEFAULT_ACTION_TIMEOUT_MS;
8211
8480
  exports.DEFAULT_CONFIG_PATH = DEFAULT_CONFIG_PATH;
8212
8481
  exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
8213
8482
  exports.DebugPropertySchema = DebugPropertySchema;
8483
+ exports.FieldsPropertySchema = FieldsPropertySchema;
8484
+ exports.InputFieldPropertySchema = InputFieldPropertySchema;
8214
8485
  exports.InputsPropertySchema = InputsPropertySchema;
8215
8486
  exports.LimitPropertySchema = LimitPropertySchema;
8216
8487
  exports.MAX_PAGE_LIMIT = MAX_PAGE_LIMIT;
@@ -8218,9 +8489,13 @@ exports.OffsetPropertySchema = OffsetPropertySchema;
8218
8489
  exports.OutputPropertySchema = OutputPropertySchema;
8219
8490
  exports.ParamsPropertySchema = ParamsPropertySchema;
8220
8491
  exports.PkceCredentialsObjectSchema = PkceCredentialsObjectSchema;
8492
+ exports.RecordPropertySchema = RecordPropertySchema;
8493
+ exports.RecordsPropertySchema = RecordsPropertySchema;
8221
8494
  exports.RelayFetchSchema = RelayFetchSchema;
8222
8495
  exports.RelayRequestSchema = RelayRequestSchema;
8223
8496
  exports.ResolvedCredentialsSchema = ResolvedCredentialsSchema;
8497
+ exports.TablePropertySchema = TablePropertySchema;
8498
+ exports.TablesPropertySchema = TablesPropertySchema;
8224
8499
  exports.ZAPIER_BASE_URL = ZAPIER_BASE_URL;
8225
8500
  exports.ZAPIER_MAX_NETWORK_RETRIES = ZAPIER_MAX_NETWORK_RETRIES;
8226
8501
  exports.ZAPIER_MAX_NETWORK_RETRY_DELAY_MS = ZAPIER_MAX_NETWORK_RETRY_DELAY_MS;