@zapier/zapier-sdk 0.119.6 → 0.121.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.
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkFXUI47PZ_cjs = require('./chunk-FXUI47PZ.cjs');
3
+ var chunkC7DJO3NC_cjs = require('./chunk-C7DJO3NC.cjs');
4
4
  var kitcore = require('@zapier/kitcore');
5
5
  var zod = require('zod');
6
6
 
7
7
  var codeSubstrateDefaults = {
8
- categories: [chunkFXUI47PZ_cjs.taxonomy.categories["code-workflow"]],
8
+ categories: [chunkC7DJO3NC_cjs.taxonomy.categories["code-workflow"]],
9
9
  stability: "beta"
10
10
  };
11
11
  var CODE_SUBSTRATE_ANALYZER_API = "/code-substrate-analyzer";
@@ -19,7 +19,7 @@ function toWireWorkflowClientAttribution({
19
19
  return {
20
20
  ...creationHarness === void 0 ? {} : { harness: creationHarness },
21
21
  access_method: creationAccessMethod,
22
- sdk_version: chunkFXUI47PZ_cjs.SDK_VERSION
22
+ sdk_version: chunkC7DJO3NC_cjs.SDK_VERSION
23
23
  };
24
24
  }
25
25
  var JsonPayloadSchema = zod.z.preprocess((val) => {
@@ -62,7 +62,7 @@ function toWireConnections(connections) {
62
62
  for (const [alias, entry] of Object.entries(connections)) {
63
63
  const connectionId = entry.connectionId ?? entry.connection_id;
64
64
  if (connectionId === void 0) {
65
- throw new chunkFXUI47PZ_cjs.ZapierValidationError(
65
+ throw new chunkC7DJO3NC_cjs.ZapierValidationError(
66
66
  `connections["${alias}"] is missing connectionId`
67
67
  );
68
68
  }
@@ -89,7 +89,7 @@ var TriggerConfigSchema = zod.z.object({
89
89
  function toWireTrigger(trigger) {
90
90
  const selectedApi = trigger.selectedApi ?? trigger.selected_api;
91
91
  if (selectedApi === void 0) {
92
- throw new chunkFXUI47PZ_cjs.ZapierValidationError("trigger is missing selectedApi");
92
+ throw new chunkC7DJO3NC_cjs.ZapierValidationError("trigger is missing selectedApi");
93
93
  }
94
94
  const wire = {
95
95
  selected_api: selectedApi,
@@ -110,7 +110,7 @@ function toWireAppVersions(appVersions) {
110
110
  for (const [key, entry] of Object.entries(appVersions)) {
111
111
  const implementationName = entry.implementationName ?? entry.implementation_name;
112
112
  if (implementationName === void 0) {
113
- throw new chunkFXUI47PZ_cjs.ZapierValidationError(
113
+ throw new chunkC7DJO3NC_cjs.ZapierValidationError(
114
114
  `appVersions["${key}"] is missing implementationName`
115
115
  );
116
116
  }
@@ -284,8 +284,12 @@ var WorkflowItemSchema = zod.z.object({
284
284
  disabled_reason: WorkflowDisabledReasonSchema.nullable().optional().describe(
285
285
  "Why the workflow is off, when system-disabled. Null when not system-disabled."
286
286
  ),
287
- is_private: zod.z.boolean().describe(
288
- "Whether the workflow is private to the creating user. False means account-visible."
287
+ // No `.meta({ deprecated: true })`: that flag drops a field from the
288
+ // generated README, and the API still returns this one, so it stays
289
+ // documented while deprecated.
290
+ /** @deprecated May be removed from the API in a future release. No replacement; do not rely on this value. */
291
+ is_private: zod.z.boolean().nullish().describe(
292
+ "Whether the workflow is private to the creating user. False means account-visible. Deprecated: may be removed from the API in a future release. There is no replacement field; do not rely on it. An absent or null value means unknown, not false."
289
293
  ),
290
294
  created_by_user_id: zod.z.string().nullable().describe("User ID of the workflow creator (null in legacy data)"),
291
295
  current_version_id: zod.z.string().nullable().describe(
@@ -319,7 +323,7 @@ var ListWorkflowsApiResponseSchema = zod.z.object({
319
323
  var listWorkflowsPlugin = kitcore.defineMethod({
320
324
  ...codeSubstrateDefaults,
321
325
  name: "listWorkflows",
322
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
326
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
323
327
  type: "list",
324
328
  itemType: "Workflow",
325
329
  inputSchema: ListWorkflowsOptionsSchema,
@@ -327,7 +331,7 @@ var listWorkflowsPlugin = kitcore.defineMethod({
327
331
  skipOutputValidation: true,
328
332
  // The handler already returns a clean `{ data, nextCursor }` page, so the
329
333
  // standard list output (no `adaptPage`) applies.
330
- output: { type: "list", defaultPageSize: chunkFXUI47PZ_cjs.DEFAULT_PAGE_SIZE },
334
+ output: { type: "list", defaultPageSize: chunkC7DJO3NC_cjs.DEFAULT_PAGE_SIZE },
331
335
  run: async ({ imports, input }) => {
332
336
  const api = imports.api;
333
337
  const searchParams = {};
@@ -385,8 +389,12 @@ var GetWorkflowResponseSchema = zod.z.object({
385
389
  disabled_reason: WorkflowDisabledReasonSchema.nullable().optional().describe(
386
390
  "Why the workflow is off, when system-disabled. Null when not system-disabled. Independent of per-trigger claim status: an enabled workflow can still have a failed trigger."
387
391
  ),
388
- is_private: zod.z.boolean().describe(
389
- "Whether the workflow is private to the creating user. False means account-visible."
392
+ // No `.meta({ deprecated: true })`: that flag drops a field from the
393
+ // generated README, and the API still returns this one, so it stays
394
+ // documented while deprecated.
395
+ /** @deprecated May be removed from the API in a future release. No replacement; do not rely on this value. */
396
+ is_private: zod.z.boolean().nullish().describe(
397
+ "Whether the workflow is private to the creating user. False means account-visible. Deprecated: may be removed from the API in a future release. There is no replacement field; do not rely on it. An absent or null value means unknown, not false."
390
398
  ),
391
399
  created_by_user_id: zod.z.string().nullable().describe("User ID of the workflow creator (null in legacy data)"),
392
400
  current_version: WorkflowVersionSchema2.optional().describe(
@@ -404,13 +412,13 @@ var GetWorkflowResponseSchema = zod.z.object({
404
412
  var getWorkflowPlugin = kitcore.defineMethod({
405
413
  ...codeSubstrateDefaults,
406
414
  name: "getWorkflow",
407
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
415
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
408
416
  itemType: "Workflow",
409
417
  inputSchema: GetWorkflowOptionsSchema,
410
418
  outputSchema: GetWorkflowResponseSchema,
411
419
  skipOutputValidation: true,
412
420
  output: "item",
413
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
421
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
414
422
  run: async ({ imports, input }) => {
415
423
  const api = imports.api;
416
424
  const raw = await api.get(
@@ -446,8 +454,12 @@ var CreateWorkflowResponseSchema = zod.z.object({
446
454
  enabled: zod.z.boolean().describe(
447
455
  "Whether the workflow currently accepts triggers. Always false on a new workflow until enabled."
448
456
  ),
449
- is_private: zod.z.boolean().describe(
450
- "Whether the workflow is private to the creating user. False means account-visible."
457
+ // No `.meta({ deprecated: true })`: that flag drops a field from the
458
+ // generated README, and the API still returns this one, so it stays
459
+ // documented while deprecated.
460
+ /** @deprecated May be removed from the API in a future release. No replacement; do not rely on this value. */
461
+ is_private: zod.z.boolean().nullish().describe(
462
+ "Whether the workflow is private to the creating user. False means account-visible. Deprecated: may be removed from the API in a future release. There is no replacement field; do not rely on it. An absent or null value means unknown, not false."
451
463
  ),
452
464
  created_by_user_id: zod.z.string().nullable().describe("User ID of the workflow creator (null in legacy data)"),
453
465
  created_at: zod.z.string().describe("When the workflow was created (ISO-8601)"),
@@ -458,7 +470,7 @@ var CreateWorkflowResponseSchema = zod.z.object({
458
470
  var createWorkflowPlugin = kitcore.defineMethod({
459
471
  ...codeSubstrateDefaults,
460
472
  name: "createWorkflow",
461
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
473
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
462
474
  type: "create",
463
475
  itemType: "Workflow",
464
476
  inputSchema: CreateWorkflowOptionsSchema,
@@ -527,8 +539,12 @@ var ImportedWorkflowSchema = zod.z.object({
527
539
  "Whether the workflow accepts triggers. An import always lands disabled."
528
540
  ),
529
541
  disabled_reason: WorkflowDisabledReasonSchema.nullable().optional().describe("Why the workflow is off, when system-disabled."),
530
- is_private: zod.z.boolean().describe(
531
- "Whether the workflow is private to the creating user. False means account-visible."
542
+ // No `.meta({ deprecated: true })`: that flag drops a field from the
543
+ // generated README, and the API still returns this one, so it stays
544
+ // documented while deprecated.
545
+ /** @deprecated May be removed from the API in a future release. No replacement; do not rely on this value. */
546
+ is_private: zod.z.boolean().nullish().describe(
547
+ "Whether the workflow is private to the creating user. False means account-visible. Deprecated: may be removed from the API in a future release. There is no replacement field; do not rely on it. An absent or null value means unknown, not false."
532
548
  ),
533
549
  source_zap_id: zod.z.string().nullable().optional().describe("The Zap this workflow was imported from."),
534
550
  created_by_user_id: zod.z.string(),
@@ -554,7 +570,7 @@ var ImportWorkflowResponseSchema = zod.z.object({
554
570
  var importWorkflowPlugin = kitcore.defineMethod({
555
571
  ...codeSubstrateDefaults,
556
572
  name: "importWorkflow",
557
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
573
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
558
574
  type: "create",
559
575
  itemType: "Workflow",
560
576
  // The response is the composite `{ workflow, draft, issues }`, not the bare
@@ -586,8 +602,8 @@ var importWorkflowPlugin = kitcore.defineMethod({
586
602
  // and add only what a caller can't infer from a bare 403.
587
603
  customErrorHandler: ({ status, data }) => {
588
604
  if (status === 403) {
589
- const detail = chunkFXUI47PZ_cjs.extractErrorDetail(data)?.replace(/[.!?]+$/, "");
590
- return new chunkFXUI47PZ_cjs.ZapierApiError(
605
+ const detail = chunkC7DJO3NC_cjs.extractErrorDetail(data)?.replace(/[.!?]+$/, "");
606
+ return new chunkC7DJO3NC_cjs.ZapierApiError(
591
607
  `${detail || "Zap import forbidden"}. Retrying will not help.`,
592
608
  { statusCode: status }
593
609
  );
@@ -613,8 +629,12 @@ var UpdateWorkflowResponseSchema = zod.z.object({
613
629
  trigger_url: WorkflowTriggerUrlSchema,
614
630
  editor_url: WorkflowEditorUrlSchema,
615
631
  enabled: zod.z.boolean().describe("Whether the workflow currently accepts triggers"),
616
- is_private: zod.z.boolean().describe(
617
- "Whether the workflow is private to the creating user. False means account-visible."
632
+ // No `.meta({ deprecated: true })`: that flag drops a field from the
633
+ // generated README, and the API still returns this one, so it stays
634
+ // documented while deprecated.
635
+ /** @deprecated May be removed from the API in a future release. No replacement; do not rely on this value. */
636
+ is_private: zod.z.boolean().nullish().describe(
637
+ "Whether the workflow is private to the creating user. False means account-visible. Deprecated: may be removed from the API in a future release. There is no replacement field; do not rely on it. An absent or null value means unknown, not false."
618
638
  ),
619
639
  created_by_user_id: zod.z.string().nullable().describe("User ID of the workflow creator (null in legacy data)"),
620
640
  created_at: zod.z.string().describe("When the workflow was created (ISO-8601)"),
@@ -625,14 +645,14 @@ var UpdateWorkflowResponseSchema = zod.z.object({
625
645
  var updateWorkflowPlugin = kitcore.defineMethod({
626
646
  ...codeSubstrateDefaults,
627
647
  name: "updateWorkflow",
628
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
648
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
629
649
  type: "update",
630
650
  itemType: "Workflow",
631
651
  inputSchema: UpdateWorkflowOptionsSchema,
632
652
  outputSchema: UpdateWorkflowResponseSchema,
633
653
  skipOutputValidation: true,
634
654
  output: "item",
635
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
655
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
636
656
  run: async ({ imports, input }) => {
637
657
  const api = imports.api;
638
658
  const body = {};
@@ -665,14 +685,14 @@ var EnableWorkflowResponseSchema = zod.z.object({
665
685
  var enableWorkflowPlugin = kitcore.defineMethod({
666
686
  ...codeSubstrateDefaults,
667
687
  name: "enableWorkflow",
668
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
688
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
669
689
  type: "update",
670
690
  itemType: "Workflow",
671
691
  inputSchema: EnableWorkflowOptionsSchema,
672
692
  outputSchema: EnableWorkflowResponseSchema,
673
693
  skipOutputValidation: true,
674
694
  output: "item",
675
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
695
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
676
696
  run: async ({ imports, input }) => {
677
697
  const api = imports.api;
678
698
  const raw = await api.post(
@@ -700,14 +720,14 @@ var DisableWorkflowResponseSchema = zod.z.object({
700
720
  var disableWorkflowPlugin = kitcore.defineMethod({
701
721
  ...codeSubstrateDefaults,
702
722
  name: "disableWorkflow",
703
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
723
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
704
724
  type: "update",
705
725
  itemType: "Workflow",
706
726
  inputSchema: DisableWorkflowOptionsSchema,
707
727
  outputSchema: DisableWorkflowResponseSchema,
708
728
  skipOutputValidation: true,
709
729
  output: "item",
710
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
730
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
711
731
  run: async ({ imports, input }) => {
712
732
  const api = imports.api;
713
733
  const raw = await api.post(
@@ -734,7 +754,7 @@ var DeleteWorkflowResponseSchema = zod.z.object({
734
754
  var deleteWorkflowPlugin = kitcore.defineMethod({
735
755
  ...codeSubstrateDefaults,
736
756
  name: "deleteWorkflow",
737
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
757
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
738
758
  type: "delete",
739
759
  itemType: "Workflow",
740
760
  confirm: "delete",
@@ -742,7 +762,7 @@ var deleteWorkflowPlugin = kitcore.defineMethod({
742
762
  outputSchema: DeleteWorkflowResponseSchema,
743
763
  skipOutputValidation: true,
744
764
  output: "raw",
745
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
765
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
746
766
  run: async ({ imports, input }) => {
747
767
  const api = imports.api;
748
768
  await api.delete(
@@ -777,8 +797,12 @@ var RunItemSchema = zod.z.object({
777
797
  execution_id: zod.z.string().nullable().describe(
778
798
  "Linked execution ID. Null until the run leaves the `initialized` state."
779
799
  ),
780
- is_private: zod.z.boolean().describe(
781
- "When true, the run is visible only to the creating user; otherwise visible across the account."
800
+ // No `.meta({ deprecated: true })`: that flag drops a field from the
801
+ // generated README, and the API still returns this one, so it stays
802
+ // documented while deprecated.
803
+ /** @deprecated May be removed from the API in a future release. No replacement; do not rely on this value. */
804
+ is_private: zod.z.boolean().nullish().describe(
805
+ "When true, the run is visible only to the creating user; when false, it is visible across the account. Deprecated: may be removed from the API in a future release. There is no replacement field; do not rely on it. An absent or null value means unknown, not false."
782
806
  ),
783
807
  created_at: zod.z.string().describe("When the run was created (ISO-8601)"),
784
808
  updated_at: zod.z.string().describe("When the run was last updated (ISO-8601)")
@@ -806,7 +830,7 @@ var ListDurableRunsApiResponseSchema = zod.z.object({
806
830
  var listDurableRunsPlugin = kitcore.defineMethod({
807
831
  ...codeSubstrateDefaults,
808
832
  name: "listDurableRuns",
809
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
833
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
810
834
  type: "list",
811
835
  itemType: "DurableRun",
812
836
  inputSchema: ListDurableRunsOptionsSchema,
@@ -814,7 +838,7 @@ var listDurableRunsPlugin = kitcore.defineMethod({
814
838
  skipOutputValidation: true,
815
839
  // The handler already returns a clean `{ data, nextCursor }` page, so the
816
840
  // standard list output (no `adaptPage`) applies.
817
- output: { type: "list", defaultPageSize: chunkFXUI47PZ_cjs.DEFAULT_PAGE_SIZE },
841
+ output: { type: "list", defaultPageSize: chunkC7DJO3NC_cjs.DEFAULT_PAGE_SIZE },
818
842
  run: async ({ imports, input }) => {
819
843
  const api = imports.api;
820
844
  const searchParams = {};
@@ -920,8 +944,12 @@ var GetDurableRunResponseSchema = zod.z.object({
920
944
  execution: ExecutionSummarySchema.nullable().describe(
921
945
  "Linked execution, including the operations journal. Null while the run is still in `initialized` state."
922
946
  ),
923
- is_private: zod.z.boolean().describe(
924
- "When true, the run is visible only to the creating user; otherwise visible across the account."
947
+ // No `.meta({ deprecated: true })`: that flag drops a field from the
948
+ // generated README, and the API still returns this one, so it stays
949
+ // documented while deprecated.
950
+ /** @deprecated May be removed from the API in a future release. No replacement; do not rely on this value. */
951
+ is_private: zod.z.boolean().nullish().describe(
952
+ "When true, the run is visible only to the creating user; when false, it is visible across the account. Deprecated: may be removed from the API in a future release. There is no replacement field; do not rely on it. An absent or null value means unknown, not false."
925
953
  ),
926
954
  created_at: zod.z.string().describe("When the run was created (ISO-8601)"),
927
955
  updated_at: zod.z.string().describe("When the run was last updated (ISO-8601)")
@@ -931,13 +959,13 @@ var GetDurableRunResponseSchema = zod.z.object({
931
959
  var getDurableRunPlugin = kitcore.defineMethod({
932
960
  ...codeSubstrateDefaults,
933
961
  name: "getDurableRun",
934
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
962
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
935
963
  itemType: "DurableRun",
936
964
  inputSchema: GetDurableRunOptionsSchema,
937
965
  outputSchema: GetDurableRunResponseSchema,
938
966
  skipOutputValidation: true,
939
967
  output: "item",
940
- resolvers: { run: chunkFXUI47PZ_cjs.durableRunIdResolver },
968
+ resolvers: { run: chunkC7DJO3NC_cjs.durableRunIdResolver },
941
969
  run: async ({ imports, input }) => {
942
970
  const api = imports.api;
943
971
  const raw = await api.get(
@@ -1003,8 +1031,12 @@ var RunDurableResponseSchema = zod.z.object({
1003
1031
  status: zod.z.literal("initialized").describe(
1004
1032
  "Always `initialized` on creation. Poll via getDurableRun to observe the run advancing to `started` / `finished` / `failed` / `cancelled`."
1005
1033
  ),
1006
- is_private: zod.z.boolean().describe(
1007
- "When true, the run is visible only to the creating user; otherwise visible across the account."
1034
+ // No `.meta({ deprecated: true })`: that flag drops a field from the
1035
+ // generated README, and the API still returns this one, so it stays
1036
+ // documented while deprecated.
1037
+ /** @deprecated May be removed from the API in a future release. No replacement; do not rely on this value. */
1038
+ is_private: zod.z.boolean().nullish().describe(
1039
+ "When true, the run is visible only to the creating user; when false, it is visible across the account. Deprecated: may be removed from the API in a future release. There is no replacement field; do not rely on it. An absent or null value means unknown, not false."
1008
1040
  ),
1009
1041
  created_at: zod.z.string().describe("When the run was created (ISO-8601)")
1010
1042
  });
@@ -1031,7 +1063,7 @@ var sourceFilesResolver = kitcore.defineResolver({
1031
1063
  var runDurablePlugin = kitcore.defineMethod({
1032
1064
  ...codeSubstrateDefaults,
1033
1065
  name: "runDurable",
1034
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1066
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1035
1067
  type: "create",
1036
1068
  itemType: "DurableRun",
1037
1069
  inputSchema: RunDurableOptionsSchema,
@@ -1088,14 +1120,14 @@ var CancelDurableRunResponseSchema = zod.z.object({
1088
1120
  var cancelDurableRunPlugin = kitcore.defineMethod({
1089
1121
  ...codeSubstrateDefaults,
1090
1122
  name: "cancelDurableRun",
1091
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1123
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1092
1124
  type: "update",
1093
1125
  itemType: "DurableRun",
1094
1126
  inputSchema: CancelDurableRunOptionsSchema,
1095
1127
  outputSchema: CancelDurableRunResponseSchema,
1096
1128
  skipOutputValidation: true,
1097
1129
  output: "item",
1098
- resolvers: { run: chunkFXUI47PZ_cjs.durableRunIdResolver },
1130
+ resolvers: { run: chunkC7DJO3NC_cjs.durableRunIdResolver },
1099
1131
  run: async ({ imports, input }) => {
1100
1132
  const api = imports.api;
1101
1133
  await api.post(
@@ -1210,14 +1242,14 @@ function describeOpenDraft(draft) {
1210
1242
  var publishWorkflowVersionPlugin = kitcore.defineMethod({
1211
1243
  ...codeSubstrateDefaults,
1212
1244
  name: "publishWorkflowVersion",
1213
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1245
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1214
1246
  type: "create",
1215
1247
  itemType: "WorkflowVersion",
1216
1248
  inputSchema: PublishWorkflowVersionOptionsSchema,
1217
1249
  outputSchema: PublishWorkflowVersionResponseSchema,
1218
1250
  skipOutputValidation: true,
1219
1251
  output: "item",
1220
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver, sourceFiles: sourceFilesResolver },
1252
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver, sourceFiles: sourceFilesResolver },
1221
1253
  run: async ({ imports, input }) => {
1222
1254
  const api = imports.api;
1223
1255
  const sourceFiles = "sourceFiles" in input ? input.sourceFiles : input.source_files;
@@ -1271,13 +1303,13 @@ var publishWorkflowVersionPlugin = kitcore.defineMethod({
1271
1303
  if (status !== 409) return void 0;
1272
1304
  const conflict = extractOpenDraftConflict(data);
1273
1305
  if (!conflict) {
1274
- return new chunkFXUI47PZ_cjs.ZapierConflictError(
1275
- chunkFXUI47PZ_cjs.extractErrorDetail(data) ?? "Workflow version publish conflict.",
1306
+ return new chunkC7DJO3NC_cjs.ZapierConflictError(
1307
+ chunkC7DJO3NC_cjs.extractErrorDetail(data) ?? "Workflow version publish conflict.",
1276
1308
  { statusCode: status, resourceType: "workflow" }
1277
1309
  );
1278
1310
  }
1279
1311
  const detail = conflict.detail ?? "Cannot publish over open draft(s).";
1280
- return new chunkFXUI47PZ_cjs.ZapierConflictError(
1312
+ return new chunkC7DJO3NC_cjs.ZapierConflictError(
1281
1313
  [
1282
1314
  `${detail} Blocking draft(s):`,
1283
1315
  ...conflict.openDrafts.map(describeOpenDraft),
@@ -1333,7 +1365,7 @@ var ListWorkflowVersionsApiResponseSchema = zod.z.object({
1333
1365
  var listWorkflowVersionsPlugin = kitcore.defineMethod({
1334
1366
  ...codeSubstrateDefaults,
1335
1367
  name: "listWorkflowVersions",
1336
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1368
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1337
1369
  type: "list",
1338
1370
  itemType: "WorkflowVersion",
1339
1371
  inputSchema: ListWorkflowVersionsOptionsSchema,
@@ -1341,8 +1373,8 @@ var listWorkflowVersionsPlugin = kitcore.defineMethod({
1341
1373
  skipOutputValidation: true,
1342
1374
  // The handler already returns a clean `{ data, nextCursor }` page, so the
1343
1375
  // standard list output (no `adaptPage`) applies.
1344
- output: { type: "list", defaultPageSize: chunkFXUI47PZ_cjs.DEFAULT_PAGE_SIZE },
1345
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
1376
+ output: { type: "list", defaultPageSize: chunkC7DJO3NC_cjs.DEFAULT_PAGE_SIZE },
1377
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
1346
1378
  run: async ({ imports, input }) => {
1347
1379
  const api = imports.api;
1348
1380
  const searchParams = {};
@@ -1377,15 +1409,15 @@ var GetWorkflowVersionResponseSchema = WorkflowVersionSchema;
1377
1409
  var getWorkflowVersionPlugin = kitcore.defineMethod({
1378
1410
  ...codeSubstrateDefaults,
1379
1411
  name: "getWorkflowVersion",
1380
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1412
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1381
1413
  itemType: "WorkflowVersion",
1382
1414
  inputSchema: GetWorkflowVersionOptionsSchema,
1383
1415
  outputSchema: GetWorkflowVersionResponseSchema,
1384
1416
  skipOutputValidation: true,
1385
1417
  output: "item",
1386
1418
  resolvers: {
1387
- workflow: chunkFXUI47PZ_cjs.workflowIdResolver,
1388
- version: chunkFXUI47PZ_cjs.workflowVersionIdResolver
1419
+ workflow: chunkC7DJO3NC_cjs.workflowIdResolver,
1420
+ version: chunkC7DJO3NC_cjs.workflowVersionIdResolver
1389
1421
  },
1390
1422
  run: async ({ imports, input }) => {
1391
1423
  const api = imports.api;
@@ -1445,7 +1477,7 @@ var ListWorkflowDraftsApiResponseSchema = zod.z.object({
1445
1477
  var listWorkflowDraftsPlugin = kitcore.defineMethod({
1446
1478
  ...codeSubstrateDefaults,
1447
1479
  name: "listWorkflowDrafts",
1448
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1480
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1449
1481
  type: "list",
1450
1482
  itemType: "WorkflowDraft",
1451
1483
  inputSchema: ListWorkflowDraftsOptionsSchema,
@@ -1453,8 +1485,8 @@ var listWorkflowDraftsPlugin = kitcore.defineMethod({
1453
1485
  skipOutputValidation: true,
1454
1486
  // The handler already returns a clean `{ data, nextCursor }` page, so the
1455
1487
  // standard list output (no `adaptPage`) applies.
1456
- output: { type: "list", defaultPageSize: chunkFXUI47PZ_cjs.DEFAULT_PAGE_SIZE },
1457
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
1488
+ output: { type: "list", defaultPageSize: chunkC7DJO3NC_cjs.DEFAULT_PAGE_SIZE },
1489
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
1458
1490
  run: async ({ imports, input }) => {
1459
1491
  const api = imports.api;
1460
1492
  const searchParams = {};
@@ -1495,15 +1527,15 @@ var GetWorkflowDraftResponseSchema = WorkflowDraftSchema;
1495
1527
  var getWorkflowDraftPlugin = kitcore.defineMethod({
1496
1528
  ...codeSubstrateDefaults,
1497
1529
  name: "getWorkflowDraft",
1498
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1530
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1499
1531
  itemType: "WorkflowDraft",
1500
1532
  inputSchema: GetWorkflowDraftOptionsSchema,
1501
1533
  outputSchema: GetWorkflowDraftResponseSchema,
1502
1534
  skipOutputValidation: true,
1503
1535
  output: "item",
1504
1536
  resolvers: {
1505
- workflow: chunkFXUI47PZ_cjs.workflowIdResolver,
1506
- draft: chunkFXUI47PZ_cjs.workflowDraftIdResolver
1537
+ workflow: chunkC7DJO3NC_cjs.workflowIdResolver,
1538
+ draft: chunkC7DJO3NC_cjs.workflowDraftIdResolver
1507
1539
  },
1508
1540
  run: async ({ imports, input }) => {
1509
1541
  const api = imports.api;
@@ -1532,14 +1564,14 @@ var CreateWorkflowDraftResponseSchema = WorkflowDraftSchema;
1532
1564
  var createWorkflowDraftPlugin = kitcore.defineMethod({
1533
1565
  ...codeSubstrateDefaults,
1534
1566
  name: "createWorkflowDraft",
1535
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1567
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1536
1568
  type: "create",
1537
1569
  itemType: "WorkflowDraft",
1538
1570
  inputSchema: CreateWorkflowDraftOptionsSchema,
1539
1571
  outputSchema: CreateWorkflowDraftResponseSchema,
1540
1572
  skipOutputValidation: true,
1541
1573
  output: "item",
1542
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
1574
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
1543
1575
  run: async ({ imports, input }) => {
1544
1576
  const api = imports.api;
1545
1577
  const body = {};
@@ -1597,7 +1629,7 @@ var UpdateWorkflowDraftResponseSchema = WorkflowDraftSchema;
1597
1629
  var updateWorkflowDraftPlugin = kitcore.defineMethod({
1598
1630
  ...codeSubstrateDefaults,
1599
1631
  name: "updateWorkflowDraft",
1600
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1632
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1601
1633
  type: "update",
1602
1634
  itemType: "WorkflowDraft",
1603
1635
  inputSchema: UpdateWorkflowDraftOptionsSchema,
@@ -1605,8 +1637,8 @@ var updateWorkflowDraftPlugin = kitcore.defineMethod({
1605
1637
  skipOutputValidation: true,
1606
1638
  output: "item",
1607
1639
  resolvers: {
1608
- workflow: chunkFXUI47PZ_cjs.workflowIdResolver,
1609
- draft: chunkFXUI47PZ_cjs.workflowDraftIdResolver,
1640
+ workflow: chunkC7DJO3NC_cjs.workflowIdResolver,
1641
+ draft: chunkC7DJO3NC_cjs.workflowDraftIdResolver,
1610
1642
  sourceFiles: sourceFilesResolver
1611
1643
  },
1612
1644
  run: async ({ imports, input }) => {
@@ -1655,8 +1687,8 @@ var updateWorkflowDraftPlugin = kitcore.defineMethod({
1655
1687
  // re-read the draft, and retry instead of blind-overwriting.
1656
1688
  customErrorHandler: ({ status, data }) => {
1657
1689
  if (status === 409) {
1658
- const detail = chunkFXUI47PZ_cjs.extractErrorDetail(data);
1659
- return new chunkFXUI47PZ_cjs.ZapierConflictError(
1690
+ const detail = chunkC7DJO3NC_cjs.extractErrorDetail(data);
1691
+ return new chunkC7DJO3NC_cjs.ZapierConflictError(
1660
1692
  `${detail ?? "Draft revision conflict"} \u2014 the draft changed since it was last read. Re-read the draft to get the current draft_revision, merge your edits, and retry.`,
1661
1693
  { statusCode: status, resourceType: "workflow-draft" }
1662
1694
  );
@@ -1680,7 +1712,7 @@ var DiscardWorkflowDraftResponseSchema = WorkflowDraftSchema;
1680
1712
  var discardWorkflowDraftPlugin = kitcore.defineMethod({
1681
1713
  ...codeSubstrateDefaults,
1682
1714
  name: "discardWorkflowDraft",
1683
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1715
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1684
1716
  type: "delete",
1685
1717
  itemType: "WorkflowDraft",
1686
1718
  // Soft delete returns the discarded draft, not the `{ success: boolean }`
@@ -1694,8 +1726,8 @@ var discardWorkflowDraftPlugin = kitcore.defineMethod({
1694
1726
  skipOutputValidation: true,
1695
1727
  output: "item",
1696
1728
  resolvers: {
1697
- workflow: chunkFXUI47PZ_cjs.workflowIdResolver,
1698
- draft: chunkFXUI47PZ_cjs.workflowDraftIdResolver
1729
+ workflow: chunkC7DJO3NC_cjs.workflowIdResolver,
1730
+ draft: chunkC7DJO3NC_cjs.workflowDraftIdResolver
1699
1731
  },
1700
1732
  run: async ({ imports, input }) => {
1701
1733
  const api = imports.api;
@@ -1739,7 +1771,7 @@ var PublishWorkflowDraftResponseSchema = zod.z.object({
1739
1771
  var publishWorkflowDraftPlugin = kitcore.defineMethod({
1740
1772
  ...codeSubstrateDefaults,
1741
1773
  name: "publishWorkflowDraft",
1742
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1774
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1743
1775
  type: "create",
1744
1776
  itemType: "WorkflowVersion",
1745
1777
  // The response is the composite `{ draft, version }`, not the bare
@@ -1750,8 +1782,8 @@ var publishWorkflowDraftPlugin = kitcore.defineMethod({
1750
1782
  skipOutputValidation: true,
1751
1783
  output: "item",
1752
1784
  resolvers: {
1753
- workflow: chunkFXUI47PZ_cjs.workflowIdResolver,
1754
- draft: chunkFXUI47PZ_cjs.workflowDraftIdResolver
1785
+ workflow: chunkC7DJO3NC_cjs.workflowIdResolver,
1786
+ draft: chunkC7DJO3NC_cjs.workflowDraftIdResolver
1755
1787
  },
1756
1788
  run: async ({ imports, input }) => {
1757
1789
  const api = imports.api;
@@ -1788,15 +1820,15 @@ var publishWorkflowDraftPlugin = kitcore.defineMethod({
1788
1820
  // to ZapierValidationError via the client's default handling.
1789
1821
  customErrorHandler: ({ status, data }) => {
1790
1822
  if (status === 409) {
1791
- const detail = chunkFXUI47PZ_cjs.extractErrorDetail(data);
1792
- return new chunkFXUI47PZ_cjs.ZapierConflictError(
1823
+ const detail = chunkC7DJO3NC_cjs.extractErrorDetail(data);
1824
+ return new chunkC7DJO3NC_cjs.ZapierConflictError(
1793
1825
  `${detail ?? "Draft publish conflict"} \u2014 the draft changed since it was last read, or a trigger switchover is already in progress. Re-read the draft to get the current draft_revision, then retry the publish.`,
1794
1826
  { statusCode: status, resourceType: "workflow-draft" }
1795
1827
  );
1796
1828
  }
1797
1829
  if (status === 503) {
1798
- const detail = chunkFXUI47PZ_cjs.extractErrorDetail(data);
1799
- return new chunkFXUI47PZ_cjs.ZapierApiError(
1830
+ const detail = chunkC7DJO3NC_cjs.extractErrorDetail(data);
1831
+ return new chunkC7DJO3NC_cjs.ZapierApiError(
1800
1832
  detail !== void 0 ? `${detail} \u2014 the trigger config could not be validated against the platform catalog, so the publish was rejected (fail-closed). This is transient; retry the publish.` : "Draft publish temporarily unavailable \u2014 trigger validation is fail-closed, or the service is briefly unavailable. This is transient; retry the publish.",
1801
1833
  { statusCode: status }
1802
1834
  );
@@ -1836,11 +1868,11 @@ async function readRunUntilEnded({
1836
1868
  latest = await read(requestWaitSeconds);
1837
1869
  if (TERMINAL_RUN_STATUSES.has(latest.status)) return latest;
1838
1870
  } catch (error) {
1839
- if (!pendingWhileNotFound || !chunkFXUI47PZ_cjs.isZapierNotFoundError(error)) throw error;
1871
+ if (!pendingWhileNotFound || !chunkC7DJO3NC_cjs.isZapierNotFoundError(error)) throw error;
1840
1872
  notFound = error;
1841
1873
  }
1842
1874
  if (Date.now() - askedAt < requestWaitSeconds * 1e3 / 2) {
1843
- await chunkFXUI47PZ_cjs.sleep(Math.min(backoffMilliseconds, deadline - Date.now()));
1875
+ await chunkC7DJO3NC_cjs.sleep(Math.min(backoffMilliseconds, deadline - Date.now()));
1844
1876
  backoffMilliseconds = Math.min(
1845
1877
  backoffMilliseconds * 2,
1846
1878
  MAX_BACKOFF_MILLISECONDS
@@ -1960,15 +1992,15 @@ var GetWorkflowRunResponseSchema = zod.z.discriminatedUnion("kind", [
1960
1992
  var getWorkflowRunPlugin = kitcore.defineMethod({
1961
1993
  ...codeSubstrateDefaults,
1962
1994
  name: "getWorkflowRun",
1963
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
1995
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
1964
1996
  itemType: "WorkflowRun",
1965
1997
  inputSchema: GetWorkflowRunOptionsSchema,
1966
1998
  outputSchema: GetWorkflowRunResponseSchema,
1967
1999
  skipOutputValidation: true,
1968
2000
  output: "item",
1969
2001
  resolvers: {
1970
- workflow: chunkFXUI47PZ_cjs.workflowIdResolver,
1971
- run: chunkFXUI47PZ_cjs.workflowRunIdResolver
2002
+ workflow: chunkC7DJO3NC_cjs.workflowIdResolver,
2003
+ run: chunkC7DJO3NC_cjs.workflowRunIdResolver
1972
2004
  },
1973
2005
  run: async ({ imports, input }) => {
1974
2006
  const api = imports.api;
@@ -2026,7 +2058,7 @@ var RunWorkflowDraftResponseSchema = zod.z.object({
2026
2058
  var runWorkflowDraftPlugin = kitcore.defineMethod({
2027
2059
  ...codeSubstrateDefaults,
2028
2060
  name: "runWorkflowDraft",
2029
- imports: [chunkFXUI47PZ_cjs.apiPluginRef, getWorkflowRunPlugin],
2061
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef, getWorkflowRunPlugin],
2030
2062
  type: "create",
2031
2063
  itemType: "WorkflowRun",
2032
2064
  // The response is the draft variant of the run resource (`kind: "draft"`,
@@ -2038,9 +2070,9 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
2038
2070
  skipOutputValidation: true,
2039
2071
  output: "item",
2040
2072
  resolvers: {
2041
- workflow: chunkFXUI47PZ_cjs.workflowIdResolver,
2042
- draft: chunkFXUI47PZ_cjs.workflowDraftIdResolver,
2043
- draftRevision: chunkFXUI47PZ_cjs.workflowDraftRevisionResolver
2073
+ workflow: chunkC7DJO3NC_cjs.workflowIdResolver,
2074
+ draft: chunkC7DJO3NC_cjs.workflowDraftIdResolver,
2075
+ draftRevision: chunkC7DJO3NC_cjs.workflowDraftRevisionResolver
2044
2076
  },
2045
2077
  run: async ({ imports, input }) => {
2046
2078
  const api = imports.api;
@@ -2062,8 +2094,8 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
2062
2094
  // retries with backoff and then throws ZapierRateLimitError.
2063
2095
  customErrorHandler: ({ status, data }) => {
2064
2096
  if (status === 409) {
2065
- const detail = chunkFXUI47PZ_cjs.extractErrorDetail(data);
2066
- return new chunkFXUI47PZ_cjs.ZapierConflictError(
2097
+ const detail = chunkC7DJO3NC_cjs.extractErrorDetail(data);
2098
+ return new chunkC7DJO3NC_cjs.ZapierConflictError(
2067
2099
  `${detail ?? "Draft run conflict"} \u2014 the draft changed since it was last read. Re-read the draft to get the current draft_revision, then retry the run.`,
2068
2100
  { statusCode: status, resourceType: "workflow-draft" }
2069
2101
  );
@@ -2084,7 +2116,7 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
2084
2116
  var listWorkflowRunsPlugin = kitcore.defineMethod({
2085
2117
  ...codeSubstrateDefaults,
2086
2118
  name: "listWorkflowRuns",
2087
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
2119
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
2088
2120
  type: "list",
2089
2121
  itemType: "WorkflowRun",
2090
2122
  inputSchema: ListWorkflowRunsOptionsSchema,
@@ -2092,8 +2124,8 @@ var listWorkflowRunsPlugin = kitcore.defineMethod({
2092
2124
  skipOutputValidation: true,
2093
2125
  // The handler already returns a clean `{ data, nextCursor }` page, so the
2094
2126
  // standard list output (no `adaptPage`) applies.
2095
- output: { type: "list", defaultPageSize: chunkFXUI47PZ_cjs.DEFAULT_PAGE_SIZE },
2096
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
2127
+ output: { type: "list", defaultPageSize: chunkC7DJO3NC_cjs.DEFAULT_PAGE_SIZE },
2128
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
2097
2129
  run: async ({ imports, input }) => {
2098
2130
  const api = imports.api;
2099
2131
  const searchParams = {};
@@ -2145,7 +2177,7 @@ var GetTriggerRunResponseSchema = zod.z.object({
2145
2177
  var getTriggerRunPlugin = kitcore.defineMethod({
2146
2178
  ...codeSubstrateDefaults,
2147
2179
  name: "getTriggerRun",
2148
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
2180
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
2149
2181
  itemType: "WorkflowRun",
2150
2182
  inputSchema: GetTriggerRunOptionsSchema,
2151
2183
  outputSchema: GetTriggerRunResponseSchema,
@@ -2197,14 +2229,14 @@ var TriggerWorkflowResponseSchema = zod.z.object({
2197
2229
  var triggerWorkflowPlugin = kitcore.defineMethod({
2198
2230
  ...codeSubstrateDefaults,
2199
2231
  name: "triggerWorkflow",
2200
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
2232
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
2201
2233
  type: "create",
2202
2234
  itemType: "WorkflowRun",
2203
2235
  inputSchema: TriggerWorkflowOptionsSchema,
2204
2236
  outputSchema: TriggerWorkflowResponseSchema,
2205
2237
  skipOutputValidation: true,
2206
2238
  output: "item",
2207
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
2239
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
2208
2240
  run: async ({ imports, input }) => {
2209
2241
  const api = imports.api;
2210
2242
  const rawWorkflow = await api.get(
@@ -2218,7 +2250,7 @@ var triggerWorkflowPlugin = kitcore.defineMethod({
2218
2250
  const segments = new URL(workflow.trigger_url).pathname.split("/");
2219
2251
  const triggerToken = segments[segments.length - 1];
2220
2252
  if (!triggerToken) {
2221
- throw new chunkFXUI47PZ_cjs.ZapierApiError(
2253
+ throw new chunkC7DJO3NC_cjs.ZapierApiError(
2222
2254
  `Workflow ${input.workflow} returned a malformed trigger_url`,
2223
2255
  { statusCode: 0, response: workflow.trigger_url }
2224
2256
  );
@@ -2261,7 +2293,7 @@ var runWorkflowPlugin = kitcore.defineMethod({
2261
2293
  outputSchema: RunWorkflowResponseSchema,
2262
2294
  skipOutputValidation: true,
2263
2295
  output: "item",
2264
- resolvers: { workflow: chunkFXUI47PZ_cjs.workflowIdResolver },
2296
+ resolvers: { workflow: chunkC7DJO3NC_cjs.workflowIdResolver },
2265
2297
  run: async ({ imports, input }) => {
2266
2298
  const { data: trigger } = await imports.triggerWorkflow({
2267
2299
  workflow: input.workflow,
@@ -2275,8 +2307,8 @@ var runWorkflowPlugin = kitcore.defineMethod({
2275
2307
  });
2276
2308
  return { data: { ...run, trigger_id: trigger.id } };
2277
2309
  } catch (error) {
2278
- if (!chunkFXUI47PZ_cjs.isZapierNotFoundError(error)) throw error;
2279
- throw new chunkFXUI47PZ_cjs.ZapierTimeoutError(
2310
+ if (!chunkC7DJO3NC_cjs.isZapierNotFoundError(error)) throw error;
2311
+ throw new chunkC7DJO3NC_cjs.ZapierTimeoutError(
2280
2312
  `The run for trigger ${trigger.id} had not started after ${waitSeconds}s. Check it later with getTriggerRun.`,
2281
2313
  { cause: error }
2282
2314
  );
@@ -2285,7 +2317,10 @@ var runWorkflowPlugin = kitcore.defineMethod({
2285
2317
  });
2286
2318
  var MAX_SOURCE_FILES_COUNT = 50;
2287
2319
  var MAX_SOURCE_FILE_LENGTH = 2e5;
2320
+ var MAX_TRIGGER_CONFIGURATIONS_COUNT = 20;
2321
+ var MAX_CONNECTIONS_COUNT = 100;
2288
2322
  var DEFAULT_ENTRYPOINT_FILE = "/workflow.ts";
2323
+ var TRIGGER_NODE_ID_PATTERN = /^workflow-trigger-[0-9]+$/;
2289
2324
  var EXAMPLE_SOURCE_FILES = {
2290
2325
  [DEFAULT_ENTRYPOINT_FILE]: 'import { defineDurable } from "@zapier/zapier-durable"; export default defineDurable({ name: "hello-world", run: async (ctx) => { return ctx.step("greet", async () => "Hello, world!"); } });'
2291
2326
  };
@@ -2297,10 +2332,65 @@ var WorkflowValidationSourceFilesSchema = zod.z.record(
2297
2332
  }).refine((files) => Object.keys(files).length <= MAX_SOURCE_FILES_COUNT, {
2298
2333
  message: `sourceFiles must contain at most ${MAX_SOURCE_FILES_COUNT} files`
2299
2334
  }).describe("Exact TypeScript sources keyed by absolute logical path.").meta({ example: EXAMPLE_SOURCE_FILES });
2335
+ var WorkflowCheckGroupSchema = zod.z.enum(["source", "access"]).describe(
2336
+ "`source` runs checks that read only the request. `access` looks up the app, action, connection, and trigger references against Zapier and the caller's account."
2337
+ );
2338
+ var WorkflowIssueSeveritySchema = zod.z.enum(["error", "warning", "info", "hint"]).describe("Diagnostic severity.");
2339
+ var WorkflowValidationTriggerSchema = zod.z.object({
2340
+ selectedApi: zod.z.string().optional().describe(
2341
+ "Zapier implementation id the trigger is published with, e.g. `ScheduleCLIAPI@1.6.0`. Checked for a version pin and, with `action`, that the trigger exists."
2342
+ ),
2343
+ app: zod.z.string().optional().describe("Key of the app the trigger belongs to."),
2344
+ appTitle: zod.z.string().optional().describe("Display name of the app the trigger belongs to."),
2345
+ action: zod.z.string().optional().describe("Trigger action key on the app."),
2346
+ actionTitle: zod.z.string().optional().describe("Display name of the trigger action."),
2347
+ params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe(
2348
+ "Trigger settings keyed by field key. When set, checked against the trigger's fields."
2349
+ )
2350
+ }).describe("Trigger configuration for one trigger node.");
2300
2351
  var ValidateWorkflowOptionsSchema = zod.z.object({
2301
2352
  sourceFiles: WorkflowValidationSourceFilesSchema,
2302
2353
  entrypointFile: zod.z.string().regex(/^\//, "entrypointFile must start with /").optional().describe(
2303
2354
  "Absolute logical path of the entry file in sourceFiles. Defaults to /workflow.ts."
2355
+ ),
2356
+ zapierDurableVersion: zod.z.string().min(1).optional().describe(
2357
+ 'Version of @zapier/zapier-durable the workflow will run on, e.g. "1.2.3". Version checks are skipped when omitted or "latest".'
2358
+ ),
2359
+ dependencies: zod.z.record(zod.z.string(), zod.z.string()).optional().describe(
2360
+ "npm package dependencies keyed by package name. Dependency checks are skipped when omitted."
2361
+ ),
2362
+ checkGroups: zod.z.array(WorkflowCheckGroupSchema).min(1).refine((groups) => new Set(groups).size === groups.length, {
2363
+ message: "checkGroups must not repeat a group"
2364
+ }).optional().describe(
2365
+ "Check groups to run. Runs every group when omitted. Pass only `source` to skip the account lookups, e.g. while code is being edited."
2366
+ ),
2367
+ severity: WorkflowIssueSeveritySchema.optional().describe(
2368
+ "Return only issues with exactly this severity, and skip checks that only report other severities. Returns every issue when omitted."
2369
+ ),
2370
+ triggerConfigurations: zod.z.record(zod.z.string(), WorkflowValidationTriggerSchema).superRefine((triggers, ctx) => {
2371
+ for (const key of Object.keys(triggers)) {
2372
+ if (!TRIGGER_NODE_ID_PATTERN.test(key)) {
2373
+ ctx.addIssue({
2374
+ code: "custom",
2375
+ message: `triggerConfigurations keys must be trigger node ids like workflow-trigger-0; got '${key}'`
2376
+ });
2377
+ }
2378
+ }
2379
+ }).refine(
2380
+ (triggers) => Object.keys(triggers).length <= MAX_TRIGGER_CONFIGURATIONS_COUNT,
2381
+ {
2382
+ message: `triggerConfigurations must contain at most ${MAX_TRIGGER_CONFIGURATIONS_COUNT} triggers`
2383
+ }
2384
+ ).optional().describe(
2385
+ 'Trigger configurations keyed by trigger node id (`workflow-trigger-{i}`). The trigger isn\'t in the source, so it\'s only checked when sent, e.g. `{ "workflow-trigger-0": { "selectedApi": "ScheduleCLIAPI@1.6.0", "action": "everyDay" } }`.'
2386
+ ),
2387
+ connections: zod.z.record(zod.z.string(), ConnectionBindingSchema).refine(
2388
+ (connections) => Object.keys(connections).length <= MAX_CONNECTIONS_COUNT,
2389
+ {
2390
+ message: `connections must contain at most ${MAX_CONNECTIONS_COUNT} aliases`
2391
+ }
2392
+ ).optional().describe(
2393
+ 'Named connection aliases the source uses. Maps each alias to its Zapier connection ID, e.g. `{ "slack": { "connectionId": 123 } }`. Aliases are only checked when sent.'
2304
2394
  )
2305
2395
  }).refine(
2306
2396
  ({ sourceFiles, entrypointFile }) => (entrypointFile ?? DEFAULT_ENTRYPOINT_FILE) in sourceFiles,
@@ -2323,11 +2413,29 @@ var WorkflowValidationIssueSchema = zod.z.object({
2323
2413
  "Extensible diagnostic category; clients must accept unfamiliar values."
2324
2414
  ),
2325
2415
  message: zod.z.string().describe("Safe human-readable explanation."),
2326
- // Unlike `kind`, severity is a closed vocabulary on the analyzer side: a
2327
- // new value requires a new API version, and every issue carries one, so
2328
- // callers can rank findings without a missing-severity branch.
2329
- severity: zod.z.enum(["error", "warning", "info", "hint"]).describe("Diagnostic severity."),
2416
+ title: zod.z.string().optional().describe(
2417
+ "Short label for the issue, safe to show in place of `message` where space is short. Omitted for kinds with no title yet; fall back to `message`."
2418
+ ),
2419
+ severity: WorkflowIssueSeveritySchema,
2330
2420
  suggestion: zod.z.string().optional().describe("Actionable fix hint."),
2421
+ fix: zod.z.string().optional().describe(
2422
+ "Extensible: what resolves the issue. Known values are `agent` (change the source), `upgrade` (change the account's plan) and `retry` (a lookup failed; validate again). Omitted or unknown means `agent`."
2423
+ ),
2424
+ incomplete: zod.z.boolean().optional().describe(
2425
+ "`true` when the issue means the workflow isn't finished yet rather than wrong, e.g. no steps yet. Still blocks publish."
2426
+ ),
2427
+ app_key: zod.z.string().optional().describe(
2428
+ "Implementation id of the app the issue is about, e.g. `SlackCLIAPI`. Set on `admin-restricted-app`."
2429
+ ),
2430
+ connection_id: zod.z.string().optional().describe(
2431
+ "Zapier connection id the issue is about, as a string. Set on connection issues."
2432
+ ),
2433
+ connection_alias: zod.z.string().optional().describe(
2434
+ "Connection alias the source used, a key of the request's `connections`. Set on connection issues when the source named the connection by alias."
2435
+ ),
2436
+ unchecked_kind: zod.z.string().optional().describe(
2437
+ "On `check-unavailable`, the issue kind whose check couldn't run because a lookup failed. Validating again retries it."
2438
+ ),
2331
2439
  source: WorkflowValidationSourceLocationSchema.optional().describe(
2332
2440
  "Affected source location."
2333
2441
  ),
@@ -2336,6 +2444,19 @@ var WorkflowValidationIssueSchema = zod.z.object({
2336
2444
  ),
2337
2445
  syntax_kind: zod.z.string().optional().describe(
2338
2446
  "TypeScript AST node kind the diagnostic was raised against (e.g. `CallExpression`)."
2447
+ ),
2448
+ state_path: zod.z.string().optional().describe("Workflow state path the issue is about."),
2449
+ projection_node_id: zod.z.string().optional().describe(
2450
+ "Diagram node the issue is about. Validation sets it only on trigger issues, to the trigger node id (`workflow-trigger-{i}`)."
2451
+ ),
2452
+ configuration_id: zod.z.string().optional().describe(
2453
+ "Canonical configuration reference. Validation currently leaves it unset."
2454
+ ),
2455
+ operation_id: zod.z.string().optional().describe(
2456
+ "Canonical operation that owns the issue, when unambiguous. Match against diagram nodes' `operation_ids` for the same source."
2457
+ ),
2458
+ region_id: zod.z.string().optional().describe(
2459
+ "Immediate canonical parent region of the owning operation. May have no visible container in the diagram."
2339
2460
  )
2340
2461
  });
2341
2462
  var ValidateWorkflowResponseSchema = zod.z.object({
@@ -2343,10 +2464,28 @@ var ValidateWorkflowResponseSchema = zod.z.object({
2343
2464
  });
2344
2465
 
2345
2466
  // src/plugins/codeSubstrate/validateWorkflow/index.ts
2467
+ function toWireTriggerConfigurations(triggers) {
2468
+ return Object.fromEntries(
2469
+ Object.entries(triggers).map(([nodeId, trigger]) => {
2470
+ const wire = {};
2471
+ if (trigger.selectedApi !== void 0) {
2472
+ wire.selected_api = trigger.selectedApi;
2473
+ }
2474
+ if (trigger.app !== void 0) wire.app_key = trigger.app;
2475
+ if (trigger.appTitle !== void 0) wire.app_title = trigger.appTitle;
2476
+ if (trigger.action !== void 0) wire.action_key = trigger.action;
2477
+ if (trigger.actionTitle !== void 0) {
2478
+ wire.action_title = trigger.actionTitle;
2479
+ }
2480
+ if (trigger.params !== void 0) wire.params = trigger.params;
2481
+ return [nodeId, wire];
2482
+ })
2483
+ );
2484
+ }
2346
2485
  var validateWorkflowPlugin = kitcore.defineMethod({
2347
2486
  ...codeSubstrateDefaults,
2348
2487
  name: "validateWorkflow",
2349
- imports: [chunkFXUI47PZ_cjs.apiPluginRef],
2488
+ imports: [chunkC7DJO3NC_cjs.apiPluginRef],
2350
2489
  itemType: "WorkflowValidation",
2351
2490
  inputSchema: ValidateWorkflowOptionsSchema,
2352
2491
  outputSchema: ValidateWorkflowResponseSchema,
@@ -2360,10 +2499,31 @@ var validateWorkflowPlugin = kitcore.defineMethod({
2360
2499
  if (input.entrypointFile !== void 0) {
2361
2500
  body.entrypoint_file = input.entrypointFile;
2362
2501
  }
2502
+ if (input.zapierDurableVersion !== void 0) {
2503
+ body.zapier_durable_version = input.zapierDurableVersion;
2504
+ }
2505
+ if (input.dependencies !== void 0) {
2506
+ body.dependencies = input.dependencies;
2507
+ }
2508
+ if (input.checkGroups !== void 0) {
2509
+ body.check_groups = input.checkGroups;
2510
+ }
2511
+ if (input.triggerConfigurations !== void 0) {
2512
+ body.trigger_configurations = toWireTriggerConfigurations(
2513
+ input.triggerConfigurations
2514
+ );
2515
+ }
2516
+ if (input.connections !== void 0) {
2517
+ body.connections = toWireConnections(input.connections);
2518
+ }
2363
2519
  const raw = await imports.api.post(
2364
2520
  `${CODE_SUBSTRATE_ANALYZER_API}/validations`,
2365
2521
  body,
2366
- { authRequired: true }
2522
+ {
2523
+ authRequired: true,
2524
+ // The analyzer rejects `severity` in the body; it is a query parameter.
2525
+ ...input.severity === void 0 ? {} : { searchParams: { severity: input.severity } }
2526
+ }
2367
2527
  );
2368
2528
  return { data: ValidateWorkflowResponseSchema.parse(raw) };
2369
2529
  }
@@ -2374,7 +2534,7 @@ var zapierBetaSdkPlugin = kitcore.definePlugin({
2374
2534
  namespace: "zapier",
2375
2535
  name: "beta-sdk",
2376
2536
  exports: [
2377
- chunkFXUI47PZ_cjs.zapierSdkPlugin,
2537
+ chunkC7DJO3NC_cjs.zapierSdkPlugin,
2378
2538
  // Next Gen Zaps (workflows, drafts, runs). `list*` plugins are exported
2379
2539
  // before their `get*` / mutation siblings because per-row resolvers
2380
2540
  // reach the listing methods.
@@ -2411,8 +2571,8 @@ var zapierBetaSdkPlugin = kitcore.definePlugin({
2411
2571
  function createZapierSdk(options = {}) {
2412
2572
  return kitcore.createSdk(zapierBetaSdkPlugin, {
2413
2573
  configuration: {
2414
- [chunkFXUI47PZ_cjs.SDK_OPTIONS_ID]: options,
2415
- [kitcore.CORE_OPTIONS_ID]: chunkFXUI47PZ_cjs.zapierCoreOptions
2574
+ [chunkC7DJO3NC_cjs.SDK_OPTIONS_ID]: options,
2575
+ [kitcore.CORE_OPTIONS_ID]: chunkC7DJO3NC_cjs.zapierCoreOptions
2416
2576
  }
2417
2577
  });
2418
2578
  }