@zapier/zapier-sdk 0.119.6 → 0.120.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.
- package/CHANGELOG.md +10 -0
- package/README.md +166 -166
- package/dist/beta.cjs +287 -287
- package/dist/beta.d.mts +34 -34
- package/dist/beta.d.ts +34 -34
- package/dist/beta.mjs +2 -2
- package/dist/{chunk-2XVA36IO.mjs → chunk-CKZGXKRK.mjs} +49 -17
- package/dist/{chunk-5FVYDLIN.cjs → chunk-CYPVUHGJ.cjs} +136 -104
- package/dist/{chunk-FXUI47PZ.cjs → chunk-VLYXR2T6.cjs} +1 -1
- package/dist/{chunk-CQ3C7UWQ.mjs → chunk-ZSALKPF6.mjs} +1 -1
- package/dist/experimental.cjs +318 -318
- package/dist/experimental.d.mts +32 -32
- package/dist/experimental.d.ts +32 -32
- package/dist/experimental.mjs +4 -4
- package/dist/index.cjs +281 -281
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVLYXR2T6_cjs = require('./chunk-VLYXR2T6.cjs');
|
|
4
4
|
var kitcore = require('@zapier/kitcore');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
var codeSubstrateDefaults = {
|
|
8
|
-
categories: [
|
|
8
|
+
categories: [chunkVLYXR2T6_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:
|
|
22
|
+
sdk_version: chunkVLYXR2T6_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
|
|
65
|
+
throw new chunkVLYXR2T6_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
|
|
92
|
+
throw new chunkVLYXR2T6_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
|
|
113
|
+
throw new chunkVLYXR2T6_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
|
-
|
|
288
|
-
|
|
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: [
|
|
326
|
+
imports: [chunkVLYXR2T6_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:
|
|
334
|
+
output: { type: "list", defaultPageSize: chunkVLYXR2T6_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
|
-
|
|
389
|
-
|
|
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: [
|
|
415
|
+
imports: [chunkVLYXR2T6_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:
|
|
421
|
+
resolvers: { workflow: chunkVLYXR2T6_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
|
-
|
|
450
|
-
|
|
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: [
|
|
473
|
+
imports: [chunkVLYXR2T6_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
|
-
|
|
531
|
-
|
|
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: [
|
|
573
|
+
imports: [chunkVLYXR2T6_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 =
|
|
590
|
-
return new
|
|
605
|
+
const detail = chunkVLYXR2T6_cjs.extractErrorDetail(data)?.replace(/[.!?]+$/, "");
|
|
606
|
+
return new chunkVLYXR2T6_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
|
-
|
|
617
|
-
|
|
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: [
|
|
648
|
+
imports: [chunkVLYXR2T6_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:
|
|
655
|
+
resolvers: { workflow: chunkVLYXR2T6_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: [
|
|
688
|
+
imports: [chunkVLYXR2T6_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:
|
|
695
|
+
resolvers: { workflow: chunkVLYXR2T6_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: [
|
|
723
|
+
imports: [chunkVLYXR2T6_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:
|
|
730
|
+
resolvers: { workflow: chunkVLYXR2T6_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: [
|
|
757
|
+
imports: [chunkVLYXR2T6_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:
|
|
765
|
+
resolvers: { workflow: chunkVLYXR2T6_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
|
-
|
|
781
|
-
|
|
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: [
|
|
833
|
+
imports: [chunkVLYXR2T6_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:
|
|
841
|
+
output: { type: "list", defaultPageSize: chunkVLYXR2T6_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
|
-
|
|
924
|
-
|
|
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: [
|
|
962
|
+
imports: [chunkVLYXR2T6_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:
|
|
968
|
+
resolvers: { run: chunkVLYXR2T6_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
|
-
|
|
1007
|
-
|
|
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: [
|
|
1066
|
+
imports: [chunkVLYXR2T6_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: [
|
|
1123
|
+
imports: [chunkVLYXR2T6_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:
|
|
1130
|
+
resolvers: { run: chunkVLYXR2T6_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: [
|
|
1245
|
+
imports: [chunkVLYXR2T6_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:
|
|
1252
|
+
resolvers: { workflow: chunkVLYXR2T6_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
|
|
1275
|
-
|
|
1306
|
+
return new chunkVLYXR2T6_cjs.ZapierConflictError(
|
|
1307
|
+
chunkVLYXR2T6_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
|
|
1312
|
+
return new chunkVLYXR2T6_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: [
|
|
1368
|
+
imports: [chunkVLYXR2T6_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:
|
|
1345
|
-
resolvers: { workflow:
|
|
1376
|
+
output: { type: "list", defaultPageSize: chunkVLYXR2T6_cjs.DEFAULT_PAGE_SIZE },
|
|
1377
|
+
resolvers: { workflow: chunkVLYXR2T6_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: [
|
|
1412
|
+
imports: [chunkVLYXR2T6_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:
|
|
1388
|
-
version:
|
|
1419
|
+
workflow: chunkVLYXR2T6_cjs.workflowIdResolver,
|
|
1420
|
+
version: chunkVLYXR2T6_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: [
|
|
1480
|
+
imports: [chunkVLYXR2T6_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:
|
|
1457
|
-
resolvers: { workflow:
|
|
1488
|
+
output: { type: "list", defaultPageSize: chunkVLYXR2T6_cjs.DEFAULT_PAGE_SIZE },
|
|
1489
|
+
resolvers: { workflow: chunkVLYXR2T6_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: [
|
|
1530
|
+
imports: [chunkVLYXR2T6_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:
|
|
1506
|
-
draft:
|
|
1537
|
+
workflow: chunkVLYXR2T6_cjs.workflowIdResolver,
|
|
1538
|
+
draft: chunkVLYXR2T6_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: [
|
|
1567
|
+
imports: [chunkVLYXR2T6_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:
|
|
1574
|
+
resolvers: { workflow: chunkVLYXR2T6_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: [
|
|
1632
|
+
imports: [chunkVLYXR2T6_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:
|
|
1609
|
-
draft:
|
|
1640
|
+
workflow: chunkVLYXR2T6_cjs.workflowIdResolver,
|
|
1641
|
+
draft: chunkVLYXR2T6_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 =
|
|
1659
|
-
return new
|
|
1690
|
+
const detail = chunkVLYXR2T6_cjs.extractErrorDetail(data);
|
|
1691
|
+
return new chunkVLYXR2T6_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: [
|
|
1715
|
+
imports: [chunkVLYXR2T6_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:
|
|
1698
|
-
draft:
|
|
1729
|
+
workflow: chunkVLYXR2T6_cjs.workflowIdResolver,
|
|
1730
|
+
draft: chunkVLYXR2T6_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: [
|
|
1774
|
+
imports: [chunkVLYXR2T6_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:
|
|
1754
|
-
draft:
|
|
1785
|
+
workflow: chunkVLYXR2T6_cjs.workflowIdResolver,
|
|
1786
|
+
draft: chunkVLYXR2T6_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 =
|
|
1792
|
-
return new
|
|
1823
|
+
const detail = chunkVLYXR2T6_cjs.extractErrorDetail(data);
|
|
1824
|
+
return new chunkVLYXR2T6_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 =
|
|
1799
|
-
return new
|
|
1830
|
+
const detail = chunkVLYXR2T6_cjs.extractErrorDetail(data);
|
|
1831
|
+
return new chunkVLYXR2T6_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 || !
|
|
1871
|
+
if (!pendingWhileNotFound || !chunkVLYXR2T6_cjs.isZapierNotFoundError(error)) throw error;
|
|
1840
1872
|
notFound = error;
|
|
1841
1873
|
}
|
|
1842
1874
|
if (Date.now() - askedAt < requestWaitSeconds * 1e3 / 2) {
|
|
1843
|
-
await
|
|
1875
|
+
await chunkVLYXR2T6_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: [
|
|
1995
|
+
imports: [chunkVLYXR2T6_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:
|
|
1971
|
-
run:
|
|
2002
|
+
workflow: chunkVLYXR2T6_cjs.workflowIdResolver,
|
|
2003
|
+
run: chunkVLYXR2T6_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: [
|
|
2061
|
+
imports: [chunkVLYXR2T6_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:
|
|
2042
|
-
draft:
|
|
2043
|
-
draftRevision:
|
|
2073
|
+
workflow: chunkVLYXR2T6_cjs.workflowIdResolver,
|
|
2074
|
+
draft: chunkVLYXR2T6_cjs.workflowDraftIdResolver,
|
|
2075
|
+
draftRevision: chunkVLYXR2T6_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 =
|
|
2066
|
-
return new
|
|
2097
|
+
const detail = chunkVLYXR2T6_cjs.extractErrorDetail(data);
|
|
2098
|
+
return new chunkVLYXR2T6_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: [
|
|
2119
|
+
imports: [chunkVLYXR2T6_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:
|
|
2096
|
-
resolvers: { workflow:
|
|
2127
|
+
output: { type: "list", defaultPageSize: chunkVLYXR2T6_cjs.DEFAULT_PAGE_SIZE },
|
|
2128
|
+
resolvers: { workflow: chunkVLYXR2T6_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: [
|
|
2180
|
+
imports: [chunkVLYXR2T6_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: [
|
|
2232
|
+
imports: [chunkVLYXR2T6_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:
|
|
2239
|
+
resolvers: { workflow: chunkVLYXR2T6_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
|
|
2253
|
+
throw new chunkVLYXR2T6_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:
|
|
2296
|
+
resolvers: { workflow: chunkVLYXR2T6_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 (!
|
|
2279
|
-
throw new
|
|
2310
|
+
if (!chunkVLYXR2T6_cjs.isZapierNotFoundError(error)) throw error;
|
|
2311
|
+
throw new chunkVLYXR2T6_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
|
);
|
|
@@ -2346,7 +2378,7 @@ var ValidateWorkflowResponseSchema = zod.z.object({
|
|
|
2346
2378
|
var validateWorkflowPlugin = kitcore.defineMethod({
|
|
2347
2379
|
...codeSubstrateDefaults,
|
|
2348
2380
|
name: "validateWorkflow",
|
|
2349
|
-
imports: [
|
|
2381
|
+
imports: [chunkVLYXR2T6_cjs.apiPluginRef],
|
|
2350
2382
|
itemType: "WorkflowValidation",
|
|
2351
2383
|
inputSchema: ValidateWorkflowOptionsSchema,
|
|
2352
2384
|
outputSchema: ValidateWorkflowResponseSchema,
|
|
@@ -2374,7 +2406,7 @@ var zapierBetaSdkPlugin = kitcore.definePlugin({
|
|
|
2374
2406
|
namespace: "zapier",
|
|
2375
2407
|
name: "beta-sdk",
|
|
2376
2408
|
exports: [
|
|
2377
|
-
|
|
2409
|
+
chunkVLYXR2T6_cjs.zapierSdkPlugin,
|
|
2378
2410
|
// Next Gen Zaps (workflows, drafts, runs). `list*` plugins are exported
|
|
2379
2411
|
// before their `get*` / mutation siblings because per-row resolvers
|
|
2380
2412
|
// reach the listing methods.
|
|
@@ -2411,8 +2443,8 @@ var zapierBetaSdkPlugin = kitcore.definePlugin({
|
|
|
2411
2443
|
function createZapierSdk(options = {}) {
|
|
2412
2444
|
return kitcore.createSdk(zapierBetaSdkPlugin, {
|
|
2413
2445
|
configuration: {
|
|
2414
|
-
[
|
|
2415
|
-
[kitcore.CORE_OPTIONS_ID]:
|
|
2446
|
+
[chunkVLYXR2T6_cjs.SDK_OPTIONS_ID]: options,
|
|
2447
|
+
[kitcore.CORE_OPTIONS_ID]: chunkVLYXR2T6_cjs.zapierCoreOptions
|
|
2416
2448
|
}
|
|
2417
2449
|
});
|
|
2418
2450
|
}
|