@zapier/zapier-sdk 0.122.1 → 0.122.2
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 +6 -0
- package/dist/beta.cjs +287 -287
- package/dist/beta.mjs +2 -2
- package/dist/{chunk-QNDRHQ3C.mjs → chunk-3WRZWB3X.mjs} +3 -3
- package/dist/{chunk-WBBHWTQU.mjs → chunk-7NTLOQZI.mjs} +1 -1
- package/dist/{chunk-5LWEOOZO.cjs → chunk-W7TKBIW6.cjs} +88 -88
- package/dist/{chunk-D454Q4PO.cjs → chunk-YVMXEARO.cjs} +3 -3
- package/dist/experimental.cjs +318 -318
- package/dist/experimental.d.mts +42 -42
- package/dist/experimental.d.ts +42 -42
- 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 chunkYVMXEARO_cjs = require('./chunk-YVMXEARO.cjs');
|
|
4
4
|
var kitcore = require('@zapier/kitcore');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
var codeSubstrateDefaults = {
|
|
8
|
-
categories: [
|
|
8
|
+
categories: [chunkYVMXEARO_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: chunkYVMXEARO_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 chunkYVMXEARO_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 chunkYVMXEARO_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 chunkYVMXEARO_cjs.ZapierValidationError(
|
|
114
114
|
`appVersions["${key}"] is missing implementationName`
|
|
115
115
|
);
|
|
116
116
|
}
|
|
@@ -323,7 +323,7 @@ var ListWorkflowsApiResponseSchema = zod.z.object({
|
|
|
323
323
|
var listWorkflowsPlugin = kitcore.defineMethod({
|
|
324
324
|
...codeSubstrateDefaults,
|
|
325
325
|
name: "listWorkflows",
|
|
326
|
-
imports: [
|
|
326
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
327
327
|
type: "list",
|
|
328
328
|
itemType: "Workflow",
|
|
329
329
|
inputSchema: ListWorkflowsOptionsSchema,
|
|
@@ -331,7 +331,7 @@ var listWorkflowsPlugin = kitcore.defineMethod({
|
|
|
331
331
|
skipOutputValidation: true,
|
|
332
332
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
333
333
|
// standard list output (no `adaptPage`) applies.
|
|
334
|
-
output: { type: "list", defaultPageSize:
|
|
334
|
+
output: { type: "list", defaultPageSize: chunkYVMXEARO_cjs.DEFAULT_PAGE_SIZE },
|
|
335
335
|
run: async ({ imports, input }) => {
|
|
336
336
|
const api = imports.api;
|
|
337
337
|
const searchParams = {};
|
|
@@ -412,13 +412,13 @@ var GetWorkflowResponseSchema = zod.z.object({
|
|
|
412
412
|
var getWorkflowPlugin = kitcore.defineMethod({
|
|
413
413
|
...codeSubstrateDefaults,
|
|
414
414
|
name: "getWorkflow",
|
|
415
|
-
imports: [
|
|
415
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
416
416
|
itemType: "Workflow",
|
|
417
417
|
inputSchema: GetWorkflowOptionsSchema,
|
|
418
418
|
outputSchema: GetWorkflowResponseSchema,
|
|
419
419
|
skipOutputValidation: true,
|
|
420
420
|
output: "item",
|
|
421
|
-
resolvers: { workflow:
|
|
421
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
422
422
|
run: async ({ imports, input }) => {
|
|
423
423
|
const api = imports.api;
|
|
424
424
|
const raw = await api.get(
|
|
@@ -470,7 +470,7 @@ var CreateWorkflowResponseSchema = zod.z.object({
|
|
|
470
470
|
var createWorkflowPlugin = kitcore.defineMethod({
|
|
471
471
|
...codeSubstrateDefaults,
|
|
472
472
|
name: "createWorkflow",
|
|
473
|
-
imports: [
|
|
473
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
474
474
|
type: "create",
|
|
475
475
|
itemType: "Workflow",
|
|
476
476
|
inputSchema: CreateWorkflowOptionsSchema,
|
|
@@ -570,7 +570,7 @@ var ImportWorkflowResponseSchema = zod.z.object({
|
|
|
570
570
|
var importWorkflowPlugin = kitcore.defineMethod({
|
|
571
571
|
...codeSubstrateDefaults,
|
|
572
572
|
name: "importWorkflow",
|
|
573
|
-
imports: [
|
|
573
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
574
574
|
type: "create",
|
|
575
575
|
itemType: "Workflow",
|
|
576
576
|
// The response is the composite `{ workflow, draft, issues }`, not the bare
|
|
@@ -602,8 +602,8 @@ var importWorkflowPlugin = kitcore.defineMethod({
|
|
|
602
602
|
// and add only what a caller can't infer from a bare 403.
|
|
603
603
|
customErrorHandler: ({ status, data }) => {
|
|
604
604
|
if (status === 403) {
|
|
605
|
-
const detail =
|
|
606
|
-
return new
|
|
605
|
+
const detail = chunkYVMXEARO_cjs.extractErrorDetail(data)?.replace(/[.!?]+$/, "");
|
|
606
|
+
return new chunkYVMXEARO_cjs.ZapierApiError(
|
|
607
607
|
`${detail || "Zap import forbidden"}. Retrying will not help.`,
|
|
608
608
|
{ statusCode: status }
|
|
609
609
|
);
|
|
@@ -645,14 +645,14 @@ var UpdateWorkflowResponseSchema = zod.z.object({
|
|
|
645
645
|
var updateWorkflowPlugin = kitcore.defineMethod({
|
|
646
646
|
...codeSubstrateDefaults,
|
|
647
647
|
name: "updateWorkflow",
|
|
648
|
-
imports: [
|
|
648
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
649
649
|
type: "update",
|
|
650
650
|
itemType: "Workflow",
|
|
651
651
|
inputSchema: UpdateWorkflowOptionsSchema,
|
|
652
652
|
outputSchema: UpdateWorkflowResponseSchema,
|
|
653
653
|
skipOutputValidation: true,
|
|
654
654
|
output: "item",
|
|
655
|
-
resolvers: { workflow:
|
|
655
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
656
656
|
run: async ({ imports, input }) => {
|
|
657
657
|
const api = imports.api;
|
|
658
658
|
const body = {};
|
|
@@ -685,14 +685,14 @@ var EnableWorkflowResponseSchema = zod.z.object({
|
|
|
685
685
|
var enableWorkflowPlugin = kitcore.defineMethod({
|
|
686
686
|
...codeSubstrateDefaults,
|
|
687
687
|
name: "enableWorkflow",
|
|
688
|
-
imports: [
|
|
688
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
689
689
|
type: "update",
|
|
690
690
|
itemType: "Workflow",
|
|
691
691
|
inputSchema: EnableWorkflowOptionsSchema,
|
|
692
692
|
outputSchema: EnableWorkflowResponseSchema,
|
|
693
693
|
skipOutputValidation: true,
|
|
694
694
|
output: "item",
|
|
695
|
-
resolvers: { workflow:
|
|
695
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
696
696
|
run: async ({ imports, input }) => {
|
|
697
697
|
const api = imports.api;
|
|
698
698
|
const raw = await api.post(
|
|
@@ -720,14 +720,14 @@ var DisableWorkflowResponseSchema = zod.z.object({
|
|
|
720
720
|
var disableWorkflowPlugin = kitcore.defineMethod({
|
|
721
721
|
...codeSubstrateDefaults,
|
|
722
722
|
name: "disableWorkflow",
|
|
723
|
-
imports: [
|
|
723
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
724
724
|
type: "update",
|
|
725
725
|
itemType: "Workflow",
|
|
726
726
|
inputSchema: DisableWorkflowOptionsSchema,
|
|
727
727
|
outputSchema: DisableWorkflowResponseSchema,
|
|
728
728
|
skipOutputValidation: true,
|
|
729
729
|
output: "item",
|
|
730
|
-
resolvers: { workflow:
|
|
730
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
731
731
|
run: async ({ imports, input }) => {
|
|
732
732
|
const api = imports.api;
|
|
733
733
|
const raw = await api.post(
|
|
@@ -754,7 +754,7 @@ var DeleteWorkflowResponseSchema = zod.z.object({
|
|
|
754
754
|
var deleteWorkflowPlugin = kitcore.defineMethod({
|
|
755
755
|
...codeSubstrateDefaults,
|
|
756
756
|
name: "deleteWorkflow",
|
|
757
|
-
imports: [
|
|
757
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
758
758
|
type: "delete",
|
|
759
759
|
itemType: "Workflow",
|
|
760
760
|
confirm: "delete",
|
|
@@ -762,7 +762,7 @@ var deleteWorkflowPlugin = kitcore.defineMethod({
|
|
|
762
762
|
outputSchema: DeleteWorkflowResponseSchema,
|
|
763
763
|
skipOutputValidation: true,
|
|
764
764
|
output: "raw",
|
|
765
|
-
resolvers: { workflow:
|
|
765
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
766
766
|
run: async ({ imports, input }) => {
|
|
767
767
|
const api = imports.api;
|
|
768
768
|
await api.delete(
|
|
@@ -830,7 +830,7 @@ var ListDurableRunsApiResponseSchema = zod.z.object({
|
|
|
830
830
|
var listDurableRunsPlugin = kitcore.defineMethod({
|
|
831
831
|
...codeSubstrateDefaults,
|
|
832
832
|
name: "listDurableRuns",
|
|
833
|
-
imports: [
|
|
833
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
834
834
|
type: "list",
|
|
835
835
|
itemType: "DurableRun",
|
|
836
836
|
inputSchema: ListDurableRunsOptionsSchema,
|
|
@@ -838,7 +838,7 @@ var listDurableRunsPlugin = kitcore.defineMethod({
|
|
|
838
838
|
skipOutputValidation: true,
|
|
839
839
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
840
840
|
// standard list output (no `adaptPage`) applies.
|
|
841
|
-
output: { type: "list", defaultPageSize:
|
|
841
|
+
output: { type: "list", defaultPageSize: chunkYVMXEARO_cjs.DEFAULT_PAGE_SIZE },
|
|
842
842
|
run: async ({ imports, input }) => {
|
|
843
843
|
const api = imports.api;
|
|
844
844
|
const searchParams = {};
|
|
@@ -959,13 +959,13 @@ var GetDurableRunResponseSchema = zod.z.object({
|
|
|
959
959
|
var getDurableRunPlugin = kitcore.defineMethod({
|
|
960
960
|
...codeSubstrateDefaults,
|
|
961
961
|
name: "getDurableRun",
|
|
962
|
-
imports: [
|
|
962
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
963
963
|
itemType: "DurableRun",
|
|
964
964
|
inputSchema: GetDurableRunOptionsSchema,
|
|
965
965
|
outputSchema: GetDurableRunResponseSchema,
|
|
966
966
|
skipOutputValidation: true,
|
|
967
967
|
output: "item",
|
|
968
|
-
resolvers: { run:
|
|
968
|
+
resolvers: { run: chunkYVMXEARO_cjs.durableRunIdResolver },
|
|
969
969
|
run: async ({ imports, input }) => {
|
|
970
970
|
const api = imports.api;
|
|
971
971
|
const raw = await api.get(
|
|
@@ -1063,7 +1063,7 @@ var sourceFilesResolver = kitcore.defineResolver({
|
|
|
1063
1063
|
var runDurablePlugin = kitcore.defineMethod({
|
|
1064
1064
|
...codeSubstrateDefaults,
|
|
1065
1065
|
name: "runDurable",
|
|
1066
|
-
imports: [
|
|
1066
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1067
1067
|
type: "create",
|
|
1068
1068
|
itemType: "DurableRun",
|
|
1069
1069
|
inputSchema: RunDurableOptionsSchema,
|
|
@@ -1120,14 +1120,14 @@ var CancelDurableRunResponseSchema = zod.z.object({
|
|
|
1120
1120
|
var cancelDurableRunPlugin = kitcore.defineMethod({
|
|
1121
1121
|
...codeSubstrateDefaults,
|
|
1122
1122
|
name: "cancelDurableRun",
|
|
1123
|
-
imports: [
|
|
1123
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1124
1124
|
type: "update",
|
|
1125
1125
|
itemType: "DurableRun",
|
|
1126
1126
|
inputSchema: CancelDurableRunOptionsSchema,
|
|
1127
1127
|
outputSchema: CancelDurableRunResponseSchema,
|
|
1128
1128
|
skipOutputValidation: true,
|
|
1129
1129
|
output: "item",
|
|
1130
|
-
resolvers: { run:
|
|
1130
|
+
resolvers: { run: chunkYVMXEARO_cjs.durableRunIdResolver },
|
|
1131
1131
|
run: async ({ imports, input }) => {
|
|
1132
1132
|
const api = imports.api;
|
|
1133
1133
|
await api.post(
|
|
@@ -1242,14 +1242,14 @@ function describeOpenDraft(draft) {
|
|
|
1242
1242
|
var publishWorkflowVersionPlugin = kitcore.defineMethod({
|
|
1243
1243
|
...codeSubstrateDefaults,
|
|
1244
1244
|
name: "publishWorkflowVersion",
|
|
1245
|
-
imports: [
|
|
1245
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1246
1246
|
type: "create",
|
|
1247
1247
|
itemType: "WorkflowVersion",
|
|
1248
1248
|
inputSchema: PublishWorkflowVersionOptionsSchema,
|
|
1249
1249
|
outputSchema: PublishWorkflowVersionResponseSchema,
|
|
1250
1250
|
skipOutputValidation: true,
|
|
1251
1251
|
output: "item",
|
|
1252
|
-
resolvers: { workflow:
|
|
1252
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver, sourceFiles: sourceFilesResolver },
|
|
1253
1253
|
run: async ({ imports, input }) => {
|
|
1254
1254
|
const api = imports.api;
|
|
1255
1255
|
const sourceFiles = "sourceFiles" in input ? input.sourceFiles : input.source_files;
|
|
@@ -1303,13 +1303,13 @@ var publishWorkflowVersionPlugin = kitcore.defineMethod({
|
|
|
1303
1303
|
if (status !== 409) return void 0;
|
|
1304
1304
|
const conflict = extractOpenDraftConflict(data);
|
|
1305
1305
|
if (!conflict) {
|
|
1306
|
-
return new
|
|
1307
|
-
|
|
1306
|
+
return new chunkYVMXEARO_cjs.ZapierConflictError(
|
|
1307
|
+
chunkYVMXEARO_cjs.extractErrorDetail(data) ?? "Workflow version publish conflict.",
|
|
1308
1308
|
{ statusCode: status, resourceType: "workflow" }
|
|
1309
1309
|
);
|
|
1310
1310
|
}
|
|
1311
1311
|
const detail = conflict.detail ?? "Cannot publish over open draft(s).";
|
|
1312
|
-
return new
|
|
1312
|
+
return new chunkYVMXEARO_cjs.ZapierConflictError(
|
|
1313
1313
|
[
|
|
1314
1314
|
`${detail} Blocking draft(s):`,
|
|
1315
1315
|
...conflict.openDrafts.map(describeOpenDraft),
|
|
@@ -1365,7 +1365,7 @@ var ListWorkflowVersionsApiResponseSchema = zod.z.object({
|
|
|
1365
1365
|
var listWorkflowVersionsPlugin = kitcore.defineMethod({
|
|
1366
1366
|
...codeSubstrateDefaults,
|
|
1367
1367
|
name: "listWorkflowVersions",
|
|
1368
|
-
imports: [
|
|
1368
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1369
1369
|
type: "list",
|
|
1370
1370
|
itemType: "WorkflowVersion",
|
|
1371
1371
|
inputSchema: ListWorkflowVersionsOptionsSchema,
|
|
@@ -1373,8 +1373,8 @@ var listWorkflowVersionsPlugin = kitcore.defineMethod({
|
|
|
1373
1373
|
skipOutputValidation: true,
|
|
1374
1374
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
1375
1375
|
// standard list output (no `adaptPage`) applies.
|
|
1376
|
-
output: { type: "list", defaultPageSize:
|
|
1377
|
-
resolvers: { workflow:
|
|
1376
|
+
output: { type: "list", defaultPageSize: chunkYVMXEARO_cjs.DEFAULT_PAGE_SIZE },
|
|
1377
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
1378
1378
|
run: async ({ imports, input }) => {
|
|
1379
1379
|
const api = imports.api;
|
|
1380
1380
|
const searchParams = {};
|
|
@@ -1409,15 +1409,15 @@ var GetWorkflowVersionResponseSchema = WorkflowVersionSchema;
|
|
|
1409
1409
|
var getWorkflowVersionPlugin = kitcore.defineMethod({
|
|
1410
1410
|
...codeSubstrateDefaults,
|
|
1411
1411
|
name: "getWorkflowVersion",
|
|
1412
|
-
imports: [
|
|
1412
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1413
1413
|
itemType: "WorkflowVersion",
|
|
1414
1414
|
inputSchema: GetWorkflowVersionOptionsSchema,
|
|
1415
1415
|
outputSchema: GetWorkflowVersionResponseSchema,
|
|
1416
1416
|
skipOutputValidation: true,
|
|
1417
1417
|
output: "item",
|
|
1418
1418
|
resolvers: {
|
|
1419
|
-
workflow:
|
|
1420
|
-
version:
|
|
1419
|
+
workflow: chunkYVMXEARO_cjs.workflowIdResolver,
|
|
1420
|
+
version: chunkYVMXEARO_cjs.workflowVersionIdResolver
|
|
1421
1421
|
},
|
|
1422
1422
|
run: async ({ imports, input }) => {
|
|
1423
1423
|
const api = imports.api;
|
|
@@ -1477,7 +1477,7 @@ var ListWorkflowDraftsApiResponseSchema = zod.z.object({
|
|
|
1477
1477
|
var listWorkflowDraftsPlugin = kitcore.defineMethod({
|
|
1478
1478
|
...codeSubstrateDefaults,
|
|
1479
1479
|
name: "listWorkflowDrafts",
|
|
1480
|
-
imports: [
|
|
1480
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1481
1481
|
type: "list",
|
|
1482
1482
|
itemType: "WorkflowDraft",
|
|
1483
1483
|
inputSchema: ListWorkflowDraftsOptionsSchema,
|
|
@@ -1485,8 +1485,8 @@ var listWorkflowDraftsPlugin = kitcore.defineMethod({
|
|
|
1485
1485
|
skipOutputValidation: true,
|
|
1486
1486
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
1487
1487
|
// standard list output (no `adaptPage`) applies.
|
|
1488
|
-
output: { type: "list", defaultPageSize:
|
|
1489
|
-
resolvers: { workflow:
|
|
1488
|
+
output: { type: "list", defaultPageSize: chunkYVMXEARO_cjs.DEFAULT_PAGE_SIZE },
|
|
1489
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
1490
1490
|
run: async ({ imports, input }) => {
|
|
1491
1491
|
const api = imports.api;
|
|
1492
1492
|
const searchParams = {};
|
|
@@ -1527,15 +1527,15 @@ var GetWorkflowDraftResponseSchema = WorkflowDraftSchema;
|
|
|
1527
1527
|
var getWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1528
1528
|
...codeSubstrateDefaults,
|
|
1529
1529
|
name: "getWorkflowDraft",
|
|
1530
|
-
imports: [
|
|
1530
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1531
1531
|
itemType: "WorkflowDraft",
|
|
1532
1532
|
inputSchema: GetWorkflowDraftOptionsSchema,
|
|
1533
1533
|
outputSchema: GetWorkflowDraftResponseSchema,
|
|
1534
1534
|
skipOutputValidation: true,
|
|
1535
1535
|
output: "item",
|
|
1536
1536
|
resolvers: {
|
|
1537
|
-
workflow:
|
|
1538
|
-
draft:
|
|
1537
|
+
workflow: chunkYVMXEARO_cjs.workflowIdResolver,
|
|
1538
|
+
draft: chunkYVMXEARO_cjs.workflowDraftIdResolver
|
|
1539
1539
|
},
|
|
1540
1540
|
run: async ({ imports, input }) => {
|
|
1541
1541
|
const api = imports.api;
|
|
@@ -1564,14 +1564,14 @@ var CreateWorkflowDraftResponseSchema = WorkflowDraftSchema;
|
|
|
1564
1564
|
var createWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1565
1565
|
...codeSubstrateDefaults,
|
|
1566
1566
|
name: "createWorkflowDraft",
|
|
1567
|
-
imports: [
|
|
1567
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1568
1568
|
type: "create",
|
|
1569
1569
|
itemType: "WorkflowDraft",
|
|
1570
1570
|
inputSchema: CreateWorkflowDraftOptionsSchema,
|
|
1571
1571
|
outputSchema: CreateWorkflowDraftResponseSchema,
|
|
1572
1572
|
skipOutputValidation: true,
|
|
1573
1573
|
output: "item",
|
|
1574
|
-
resolvers: { workflow:
|
|
1574
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
1575
1575
|
run: async ({ imports, input }) => {
|
|
1576
1576
|
const api = imports.api;
|
|
1577
1577
|
const body = {};
|
|
@@ -1629,7 +1629,7 @@ var UpdateWorkflowDraftResponseSchema = WorkflowDraftSchema;
|
|
|
1629
1629
|
var updateWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1630
1630
|
...codeSubstrateDefaults,
|
|
1631
1631
|
name: "updateWorkflowDraft",
|
|
1632
|
-
imports: [
|
|
1632
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1633
1633
|
type: "update",
|
|
1634
1634
|
itemType: "WorkflowDraft",
|
|
1635
1635
|
inputSchema: UpdateWorkflowDraftOptionsSchema,
|
|
@@ -1637,8 +1637,8 @@ var updateWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1637
1637
|
skipOutputValidation: true,
|
|
1638
1638
|
output: "item",
|
|
1639
1639
|
resolvers: {
|
|
1640
|
-
workflow:
|
|
1641
|
-
draft:
|
|
1640
|
+
workflow: chunkYVMXEARO_cjs.workflowIdResolver,
|
|
1641
|
+
draft: chunkYVMXEARO_cjs.workflowDraftIdResolver,
|
|
1642
1642
|
sourceFiles: sourceFilesResolver
|
|
1643
1643
|
},
|
|
1644
1644
|
run: async ({ imports, input }) => {
|
|
@@ -1687,8 +1687,8 @@ var updateWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1687
1687
|
// re-read the draft, and retry instead of blind-overwriting.
|
|
1688
1688
|
customErrorHandler: ({ status, data }) => {
|
|
1689
1689
|
if (status === 409) {
|
|
1690
|
-
const detail =
|
|
1691
|
-
return new
|
|
1690
|
+
const detail = chunkYVMXEARO_cjs.extractErrorDetail(data);
|
|
1691
|
+
return new chunkYVMXEARO_cjs.ZapierConflictError(
|
|
1692
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.`,
|
|
1693
1693
|
{ statusCode: status, resourceType: "workflow-draft" }
|
|
1694
1694
|
);
|
|
@@ -1712,7 +1712,7 @@ var DiscardWorkflowDraftResponseSchema = WorkflowDraftSchema;
|
|
|
1712
1712
|
var discardWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1713
1713
|
...codeSubstrateDefaults,
|
|
1714
1714
|
name: "discardWorkflowDraft",
|
|
1715
|
-
imports: [
|
|
1715
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1716
1716
|
type: "delete",
|
|
1717
1717
|
itemType: "WorkflowDraft",
|
|
1718
1718
|
// Soft delete returns the discarded draft, not the `{ success: boolean }`
|
|
@@ -1726,8 +1726,8 @@ var discardWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1726
1726
|
skipOutputValidation: true,
|
|
1727
1727
|
output: "item",
|
|
1728
1728
|
resolvers: {
|
|
1729
|
-
workflow:
|
|
1730
|
-
draft:
|
|
1729
|
+
workflow: chunkYVMXEARO_cjs.workflowIdResolver,
|
|
1730
|
+
draft: chunkYVMXEARO_cjs.workflowDraftIdResolver
|
|
1731
1731
|
},
|
|
1732
1732
|
run: async ({ imports, input }) => {
|
|
1733
1733
|
const api = imports.api;
|
|
@@ -1771,7 +1771,7 @@ var PublishWorkflowDraftResponseSchema = zod.z.object({
|
|
|
1771
1771
|
var publishWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1772
1772
|
...codeSubstrateDefaults,
|
|
1773
1773
|
name: "publishWorkflowDraft",
|
|
1774
|
-
imports: [
|
|
1774
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1775
1775
|
type: "create",
|
|
1776
1776
|
itemType: "WorkflowVersion",
|
|
1777
1777
|
// The response is the composite `{ draft, version }`, not the bare
|
|
@@ -1782,8 +1782,8 @@ var publishWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1782
1782
|
skipOutputValidation: true,
|
|
1783
1783
|
output: "item",
|
|
1784
1784
|
resolvers: {
|
|
1785
|
-
workflow:
|
|
1786
|
-
draft:
|
|
1785
|
+
workflow: chunkYVMXEARO_cjs.workflowIdResolver,
|
|
1786
|
+
draft: chunkYVMXEARO_cjs.workflowDraftIdResolver
|
|
1787
1787
|
},
|
|
1788
1788
|
run: async ({ imports, input }) => {
|
|
1789
1789
|
const api = imports.api;
|
|
@@ -1820,15 +1820,15 @@ var publishWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1820
1820
|
// to ZapierValidationError via the client's default handling.
|
|
1821
1821
|
customErrorHandler: ({ status, data }) => {
|
|
1822
1822
|
if (status === 409) {
|
|
1823
|
-
const detail =
|
|
1824
|
-
return new
|
|
1823
|
+
const detail = chunkYVMXEARO_cjs.extractErrorDetail(data);
|
|
1824
|
+
return new chunkYVMXEARO_cjs.ZapierConflictError(
|
|
1825
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.`,
|
|
1826
1826
|
{ statusCode: status, resourceType: "workflow-draft" }
|
|
1827
1827
|
);
|
|
1828
1828
|
}
|
|
1829
1829
|
if (status === 503) {
|
|
1830
|
-
const detail =
|
|
1831
|
-
return new
|
|
1830
|
+
const detail = chunkYVMXEARO_cjs.extractErrorDetail(data);
|
|
1831
|
+
return new chunkYVMXEARO_cjs.ZapierApiError(
|
|
1832
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.",
|
|
1833
1833
|
{ statusCode: status }
|
|
1834
1834
|
);
|
|
@@ -1868,11 +1868,11 @@ async function readRunUntilEnded({
|
|
|
1868
1868
|
latest = await read(requestWaitSeconds);
|
|
1869
1869
|
if (TERMINAL_RUN_STATUSES.has(latest.status)) return latest;
|
|
1870
1870
|
} catch (error) {
|
|
1871
|
-
if (!pendingWhileNotFound || !
|
|
1871
|
+
if (!pendingWhileNotFound || !chunkYVMXEARO_cjs.isZapierNotFoundError(error)) throw error;
|
|
1872
1872
|
notFound = error;
|
|
1873
1873
|
}
|
|
1874
1874
|
if (Date.now() - askedAt < requestWaitSeconds * 1e3 / 2) {
|
|
1875
|
-
await
|
|
1875
|
+
await chunkYVMXEARO_cjs.sleep(Math.min(backoffMilliseconds, deadline - Date.now()));
|
|
1876
1876
|
backoffMilliseconds = Math.min(
|
|
1877
1877
|
backoffMilliseconds * 2,
|
|
1878
1878
|
MAX_BACKOFF_MILLISECONDS
|
|
@@ -1992,15 +1992,15 @@ var GetWorkflowRunResponseSchema = zod.z.discriminatedUnion("kind", [
|
|
|
1992
1992
|
var getWorkflowRunPlugin = kitcore.defineMethod({
|
|
1993
1993
|
...codeSubstrateDefaults,
|
|
1994
1994
|
name: "getWorkflowRun",
|
|
1995
|
-
imports: [
|
|
1995
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
1996
1996
|
itemType: "WorkflowRun",
|
|
1997
1997
|
inputSchema: GetWorkflowRunOptionsSchema,
|
|
1998
1998
|
outputSchema: GetWorkflowRunResponseSchema,
|
|
1999
1999
|
skipOutputValidation: true,
|
|
2000
2000
|
output: "item",
|
|
2001
2001
|
resolvers: {
|
|
2002
|
-
workflow:
|
|
2003
|
-
run:
|
|
2002
|
+
workflow: chunkYVMXEARO_cjs.workflowIdResolver,
|
|
2003
|
+
run: chunkYVMXEARO_cjs.workflowRunIdResolver
|
|
2004
2004
|
},
|
|
2005
2005
|
run: async ({ imports, input }) => {
|
|
2006
2006
|
const api = imports.api;
|
|
@@ -2058,7 +2058,7 @@ var RunWorkflowDraftResponseSchema = zod.z.object({
|
|
|
2058
2058
|
var runWorkflowDraftPlugin = kitcore.defineMethod({
|
|
2059
2059
|
...codeSubstrateDefaults,
|
|
2060
2060
|
name: "runWorkflowDraft",
|
|
2061
|
-
imports: [
|
|
2061
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef, getWorkflowRunPlugin],
|
|
2062
2062
|
type: "create",
|
|
2063
2063
|
itemType: "WorkflowRun",
|
|
2064
2064
|
// The response is the draft variant of the run resource (`kind: "draft"`,
|
|
@@ -2070,9 +2070,9 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
2070
2070
|
skipOutputValidation: true,
|
|
2071
2071
|
output: "item",
|
|
2072
2072
|
resolvers: {
|
|
2073
|
-
workflow:
|
|
2074
|
-
draft:
|
|
2075
|
-
draftRevision:
|
|
2073
|
+
workflow: chunkYVMXEARO_cjs.workflowIdResolver,
|
|
2074
|
+
draft: chunkYVMXEARO_cjs.workflowDraftIdResolver,
|
|
2075
|
+
draftRevision: chunkYVMXEARO_cjs.workflowDraftRevisionResolver
|
|
2076
2076
|
},
|
|
2077
2077
|
run: async ({ imports, input }) => {
|
|
2078
2078
|
const api = imports.api;
|
|
@@ -2094,8 +2094,8 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
2094
2094
|
// retries with backoff and then throws ZapierRateLimitError.
|
|
2095
2095
|
customErrorHandler: ({ status, data }) => {
|
|
2096
2096
|
if (status === 409) {
|
|
2097
|
-
const detail =
|
|
2098
|
-
return new
|
|
2097
|
+
const detail = chunkYVMXEARO_cjs.extractErrorDetail(data);
|
|
2098
|
+
return new chunkYVMXEARO_cjs.ZapierConflictError(
|
|
2099
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.`,
|
|
2100
2100
|
{ statusCode: status, resourceType: "workflow-draft" }
|
|
2101
2101
|
);
|
|
@@ -2116,7 +2116,7 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
2116
2116
|
var listWorkflowRunsPlugin = kitcore.defineMethod({
|
|
2117
2117
|
...codeSubstrateDefaults,
|
|
2118
2118
|
name: "listWorkflowRuns",
|
|
2119
|
-
imports: [
|
|
2119
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
2120
2120
|
type: "list",
|
|
2121
2121
|
itemType: "WorkflowRun",
|
|
2122
2122
|
inputSchema: ListWorkflowRunsOptionsSchema,
|
|
@@ -2124,8 +2124,8 @@ var listWorkflowRunsPlugin = kitcore.defineMethod({
|
|
|
2124
2124
|
skipOutputValidation: true,
|
|
2125
2125
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
2126
2126
|
// standard list output (no `adaptPage`) applies.
|
|
2127
|
-
output: { type: "list", defaultPageSize:
|
|
2128
|
-
resolvers: { workflow:
|
|
2127
|
+
output: { type: "list", defaultPageSize: chunkYVMXEARO_cjs.DEFAULT_PAGE_SIZE },
|
|
2128
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
2129
2129
|
run: async ({ imports, input }) => {
|
|
2130
2130
|
const api = imports.api;
|
|
2131
2131
|
const searchParams = {};
|
|
@@ -2177,7 +2177,7 @@ var GetTriggerRunResponseSchema = zod.z.object({
|
|
|
2177
2177
|
var getTriggerRunPlugin = kitcore.defineMethod({
|
|
2178
2178
|
...codeSubstrateDefaults,
|
|
2179
2179
|
name: "getTriggerRun",
|
|
2180
|
-
imports: [
|
|
2180
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
2181
2181
|
itemType: "WorkflowRun",
|
|
2182
2182
|
inputSchema: GetTriggerRunOptionsSchema,
|
|
2183
2183
|
outputSchema: GetTriggerRunResponseSchema,
|
|
@@ -2229,14 +2229,14 @@ var TriggerWorkflowResponseSchema = zod.z.object({
|
|
|
2229
2229
|
var triggerWorkflowPlugin = kitcore.defineMethod({
|
|
2230
2230
|
...codeSubstrateDefaults,
|
|
2231
2231
|
name: "triggerWorkflow",
|
|
2232
|
-
imports: [
|
|
2232
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
2233
2233
|
type: "create",
|
|
2234
2234
|
itemType: "WorkflowRun",
|
|
2235
2235
|
inputSchema: TriggerWorkflowOptionsSchema,
|
|
2236
2236
|
outputSchema: TriggerWorkflowResponseSchema,
|
|
2237
2237
|
skipOutputValidation: true,
|
|
2238
2238
|
output: "item",
|
|
2239
|
-
resolvers: { workflow:
|
|
2239
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
2240
2240
|
run: async ({ imports, input }) => {
|
|
2241
2241
|
const api = imports.api;
|
|
2242
2242
|
const rawWorkflow = await api.get(
|
|
@@ -2250,7 +2250,7 @@ var triggerWorkflowPlugin = kitcore.defineMethod({
|
|
|
2250
2250
|
const segments = new URL(workflow.trigger_url).pathname.split("/");
|
|
2251
2251
|
const triggerToken = segments[segments.length - 1];
|
|
2252
2252
|
if (!triggerToken) {
|
|
2253
|
-
throw new
|
|
2253
|
+
throw new chunkYVMXEARO_cjs.ZapierApiError(
|
|
2254
2254
|
`Workflow ${input.workflow} returned a malformed trigger_url`,
|
|
2255
2255
|
{ statusCode: 0, response: workflow.trigger_url }
|
|
2256
2256
|
);
|
|
@@ -2293,7 +2293,7 @@ var runWorkflowPlugin = kitcore.defineMethod({
|
|
|
2293
2293
|
outputSchema: RunWorkflowResponseSchema,
|
|
2294
2294
|
skipOutputValidation: true,
|
|
2295
2295
|
output: "item",
|
|
2296
|
-
resolvers: { workflow:
|
|
2296
|
+
resolvers: { workflow: chunkYVMXEARO_cjs.workflowIdResolver },
|
|
2297
2297
|
run: async ({ imports, input }) => {
|
|
2298
2298
|
const { data: trigger } = await imports.triggerWorkflow({
|
|
2299
2299
|
workflow: input.workflow,
|
|
@@ -2307,8 +2307,8 @@ var runWorkflowPlugin = kitcore.defineMethod({
|
|
|
2307
2307
|
});
|
|
2308
2308
|
return { data: { ...run, trigger_id: trigger.id } };
|
|
2309
2309
|
} catch (error) {
|
|
2310
|
-
if (!
|
|
2311
|
-
throw new
|
|
2310
|
+
if (!chunkYVMXEARO_cjs.isZapierNotFoundError(error)) throw error;
|
|
2311
|
+
throw new chunkYVMXEARO_cjs.ZapierTimeoutError(
|
|
2312
2312
|
`The run for trigger ${trigger.id} had not started after ${waitSeconds}s. Check it later with getTriggerRun.`,
|
|
2313
2313
|
{ cause: error }
|
|
2314
2314
|
);
|
|
@@ -2485,7 +2485,7 @@ function toWireTriggerConfigurations(triggers) {
|
|
|
2485
2485
|
var validateWorkflowPlugin = kitcore.defineMethod({
|
|
2486
2486
|
...codeSubstrateDefaults,
|
|
2487
2487
|
name: "validateWorkflow",
|
|
2488
|
-
imports: [
|
|
2488
|
+
imports: [chunkYVMXEARO_cjs.apiPluginRef],
|
|
2489
2489
|
itemType: "WorkflowValidation",
|
|
2490
2490
|
inputSchema: ValidateWorkflowOptionsSchema,
|
|
2491
2491
|
outputSchema: ValidateWorkflowResponseSchema,
|
|
@@ -2534,7 +2534,7 @@ var zapierBetaSdkPlugin = kitcore.definePlugin({
|
|
|
2534
2534
|
namespace: "zapier",
|
|
2535
2535
|
name: "beta-sdk",
|
|
2536
2536
|
exports: [
|
|
2537
|
-
|
|
2537
|
+
chunkYVMXEARO_cjs.zapierSdkPlugin,
|
|
2538
2538
|
// Next Gen Zaps (workflows, drafts, runs). `list*` plugins are exported
|
|
2539
2539
|
// before their `get*` / mutation siblings because per-row resolvers
|
|
2540
2540
|
// reach the listing methods.
|
|
@@ -2571,8 +2571,8 @@ var zapierBetaSdkPlugin = kitcore.definePlugin({
|
|
|
2571
2571
|
function createZapierSdk(options = {}) {
|
|
2572
2572
|
return kitcore.createSdk(zapierBetaSdkPlugin, {
|
|
2573
2573
|
configuration: {
|
|
2574
|
-
[
|
|
2575
|
-
[kitcore.CORE_OPTIONS_ID]:
|
|
2574
|
+
[chunkYVMXEARO_cjs.SDK_OPTIONS_ID]: options,
|
|
2575
|
+
[kitcore.CORE_OPTIONS_ID]: chunkYVMXEARO_cjs.zapierCoreOptions
|
|
2576
2576
|
}
|
|
2577
2577
|
});
|
|
2578
2578
|
}
|
|
@@ -2843,7 +2843,7 @@ function logRouteOverride({
|
|
|
2843
2843
|
}
|
|
2844
2844
|
|
|
2845
2845
|
// src/sdk-version.ts
|
|
2846
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.122.
|
|
2846
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.122.2" : void 0) || "unknown";
|
|
2847
2847
|
|
|
2848
2848
|
// src/utils/open-url.ts
|
|
2849
2849
|
var nodePrefix = "node:";
|
|
@@ -8596,7 +8596,7 @@ var listActionInputFieldChoicesPlugin = kitcore.defineMethod({
|
|
|
8596
8596
|
}
|
|
8597
8597
|
annotate({ selectedApi });
|
|
8598
8598
|
const { data: action } = await imports.getAction({
|
|
8599
|
-
app:
|
|
8599
|
+
app: selectedApi,
|
|
8600
8600
|
actionType,
|
|
8601
8601
|
action: actionKey
|
|
8602
8602
|
});
|
|
@@ -8747,7 +8747,7 @@ var getActionInputFieldsSchemaPlugin = kitcore.defineMethod({
|
|
|
8747
8747
|
}
|
|
8748
8748
|
annotate({ selectedApi });
|
|
8749
8749
|
const { data: action } = await imports.getAction({
|
|
8750
|
-
app:
|
|
8750
|
+
app: selectedApi,
|
|
8751
8751
|
actionType,
|
|
8752
8752
|
action: actionKey
|
|
8753
8753
|
});
|