@zapier/zapier-sdk 0.119.3 → 0.119.5
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 +12 -0
- package/README.md +1 -1
- package/dist/beta.cjs +287 -287
- package/dist/beta.d.mts +248 -248
- package/dist/beta.d.ts +248 -248
- package/dist/beta.mjs +2 -2
- package/dist/{chunk-SR5UBRRB.cjs → chunk-6LPWOY7I.cjs} +1 -1
- package/dist/{chunk-GPR33J4Q.cjs → chunk-I6SF4BKR.cjs} +92 -93
- package/dist/{chunk-HR4LLC73.mjs → chunk-YIHKNF7S.mjs} +6 -7
- package/dist/{chunk-WVJTLSO7.mjs → chunk-YZMIF24O.mjs} +1 -1
- package/dist/experimental.cjs +318 -318
- package/dist/experimental.d.mts +248 -248
- package/dist/experimental.d.ts +248 -248
- package/dist/experimental.mjs +4 -4
- package/dist/{index-CEQsJI1V.d.mts → index-DR_2xqqX.d.mts} +442 -442
- package/dist/{index-CEQsJI1V.d.ts → index-DR_2xqqX.d.ts} +442 -442
- package/dist/index.cjs +281 -281
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6LPWOY7I_cjs = require('./chunk-6LPWOY7I.cjs');
|
|
4
4
|
var kitcore = require('@zapier/kitcore');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
var codeSubstrateDefaults = {
|
|
8
|
-
categories: [
|
|
8
|
+
categories: [chunk6LPWOY7I_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: chunk6LPWOY7I_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 chunk6LPWOY7I_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 chunk6LPWOY7I_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 chunk6LPWOY7I_cjs.ZapierValidationError(
|
|
114
114
|
`appVersions["${key}"] is missing implementationName`
|
|
115
115
|
);
|
|
116
116
|
}
|
|
@@ -319,7 +319,7 @@ var ListWorkflowsApiResponseSchema = zod.z.object({
|
|
|
319
319
|
var listWorkflowsPlugin = kitcore.defineMethod({
|
|
320
320
|
...codeSubstrateDefaults,
|
|
321
321
|
name: "listWorkflows",
|
|
322
|
-
imports: [
|
|
322
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
323
323
|
type: "list",
|
|
324
324
|
itemType: "Workflow",
|
|
325
325
|
inputSchema: ListWorkflowsOptionsSchema,
|
|
@@ -327,7 +327,7 @@ var listWorkflowsPlugin = kitcore.defineMethod({
|
|
|
327
327
|
skipOutputValidation: true,
|
|
328
328
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
329
329
|
// standard list output (no `adaptPage`) applies.
|
|
330
|
-
output: { type: "list", defaultPageSize:
|
|
330
|
+
output: { type: "list", defaultPageSize: chunk6LPWOY7I_cjs.DEFAULT_PAGE_SIZE },
|
|
331
331
|
run: async ({ imports, input }) => {
|
|
332
332
|
const api = imports.api;
|
|
333
333
|
const searchParams = {};
|
|
@@ -404,13 +404,13 @@ var GetWorkflowResponseSchema = zod.z.object({
|
|
|
404
404
|
var getWorkflowPlugin = kitcore.defineMethod({
|
|
405
405
|
...codeSubstrateDefaults,
|
|
406
406
|
name: "getWorkflow",
|
|
407
|
-
imports: [
|
|
407
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
408
408
|
itemType: "Workflow",
|
|
409
409
|
inputSchema: GetWorkflowOptionsSchema,
|
|
410
410
|
outputSchema: GetWorkflowResponseSchema,
|
|
411
411
|
skipOutputValidation: true,
|
|
412
412
|
output: "item",
|
|
413
|
-
resolvers: { workflow:
|
|
413
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
414
414
|
run: async ({ imports, input }) => {
|
|
415
415
|
const api = imports.api;
|
|
416
416
|
const raw = await api.get(
|
|
@@ -458,7 +458,7 @@ var CreateWorkflowResponseSchema = zod.z.object({
|
|
|
458
458
|
var createWorkflowPlugin = kitcore.defineMethod({
|
|
459
459
|
...codeSubstrateDefaults,
|
|
460
460
|
name: "createWorkflow",
|
|
461
|
-
imports: [
|
|
461
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
462
462
|
type: "create",
|
|
463
463
|
itemType: "Workflow",
|
|
464
464
|
inputSchema: CreateWorkflowOptionsSchema,
|
|
@@ -491,7 +491,7 @@ var createWorkflowPlugin = kitcore.defineMethod({
|
|
|
491
491
|
});
|
|
492
492
|
var ImportWorkflowOptionsSchema = zod.z.object({
|
|
493
493
|
zap: zod.z.string().min(1).max(128).describe(
|
|
494
|
-
"ID of the Zap to import.
|
|
494
|
+
"ID of the Zap to import. Recorded on the created workflow as source_zap_id."
|
|
495
495
|
),
|
|
496
496
|
name: zod.z.string().optional().describe(
|
|
497
497
|
`Name for the created workflow. Defaults to a kebab-cased form of the Zap's title, or "imported-workflow" when the Zap has no title.`
|
|
@@ -554,7 +554,7 @@ var ImportWorkflowResponseSchema = zod.z.object({
|
|
|
554
554
|
var importWorkflowPlugin = kitcore.defineMethod({
|
|
555
555
|
...codeSubstrateDefaults,
|
|
556
556
|
name: "importWorkflow",
|
|
557
|
-
imports: [
|
|
557
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
558
558
|
type: "create",
|
|
559
559
|
itemType: "Workflow",
|
|
560
560
|
// The response is the composite `{ workflow, draft, issues }`, not the bare
|
|
@@ -582,14 +582,13 @@ var importWorkflowPlugin = kitcore.defineMethod({
|
|
|
582
582
|
body,
|
|
583
583
|
{
|
|
584
584
|
authRequired: true,
|
|
585
|
-
//
|
|
586
|
-
//
|
|
587
|
-
// about which gate they hit or what to do, so name both.
|
|
585
|
+
// The API owns the wording of its access rule; pass its reason through
|
|
586
|
+
// and add only what a caller can't infer from a bare 403.
|
|
588
587
|
customErrorHandler: ({ status, data }) => {
|
|
589
588
|
if (status === 403) {
|
|
590
|
-
const detail =
|
|
591
|
-
return new
|
|
592
|
-
`${detail
|
|
589
|
+
const detail = chunk6LPWOY7I_cjs.extractErrorDetail(data)?.replace(/[.!?]+$/, "");
|
|
590
|
+
return new chunk6LPWOY7I_cjs.ZapierApiError(
|
|
591
|
+
`${detail || "Zap import forbidden"}. Retrying will not help.`,
|
|
593
592
|
{ statusCode: status }
|
|
594
593
|
);
|
|
595
594
|
}
|
|
@@ -626,14 +625,14 @@ var UpdateWorkflowResponseSchema = zod.z.object({
|
|
|
626
625
|
var updateWorkflowPlugin = kitcore.defineMethod({
|
|
627
626
|
...codeSubstrateDefaults,
|
|
628
627
|
name: "updateWorkflow",
|
|
629
|
-
imports: [
|
|
628
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
630
629
|
type: "update",
|
|
631
630
|
itemType: "Workflow",
|
|
632
631
|
inputSchema: UpdateWorkflowOptionsSchema,
|
|
633
632
|
outputSchema: UpdateWorkflowResponseSchema,
|
|
634
633
|
skipOutputValidation: true,
|
|
635
634
|
output: "item",
|
|
636
|
-
resolvers: { workflow:
|
|
635
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
637
636
|
run: async ({ imports, input }) => {
|
|
638
637
|
const api = imports.api;
|
|
639
638
|
const body = {};
|
|
@@ -666,14 +665,14 @@ var EnableWorkflowResponseSchema = zod.z.object({
|
|
|
666
665
|
var enableWorkflowPlugin = kitcore.defineMethod({
|
|
667
666
|
...codeSubstrateDefaults,
|
|
668
667
|
name: "enableWorkflow",
|
|
669
|
-
imports: [
|
|
668
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
670
669
|
type: "update",
|
|
671
670
|
itemType: "Workflow",
|
|
672
671
|
inputSchema: EnableWorkflowOptionsSchema,
|
|
673
672
|
outputSchema: EnableWorkflowResponseSchema,
|
|
674
673
|
skipOutputValidation: true,
|
|
675
674
|
output: "item",
|
|
676
|
-
resolvers: { workflow:
|
|
675
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
677
676
|
run: async ({ imports, input }) => {
|
|
678
677
|
const api = imports.api;
|
|
679
678
|
const raw = await api.post(
|
|
@@ -701,14 +700,14 @@ var DisableWorkflowResponseSchema = zod.z.object({
|
|
|
701
700
|
var disableWorkflowPlugin = kitcore.defineMethod({
|
|
702
701
|
...codeSubstrateDefaults,
|
|
703
702
|
name: "disableWorkflow",
|
|
704
|
-
imports: [
|
|
703
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
705
704
|
type: "update",
|
|
706
705
|
itemType: "Workflow",
|
|
707
706
|
inputSchema: DisableWorkflowOptionsSchema,
|
|
708
707
|
outputSchema: DisableWorkflowResponseSchema,
|
|
709
708
|
skipOutputValidation: true,
|
|
710
709
|
output: "item",
|
|
711
|
-
resolvers: { workflow:
|
|
710
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
712
711
|
run: async ({ imports, input }) => {
|
|
713
712
|
const api = imports.api;
|
|
714
713
|
const raw = await api.post(
|
|
@@ -735,7 +734,7 @@ var DeleteWorkflowResponseSchema = zod.z.object({
|
|
|
735
734
|
var deleteWorkflowPlugin = kitcore.defineMethod({
|
|
736
735
|
...codeSubstrateDefaults,
|
|
737
736
|
name: "deleteWorkflow",
|
|
738
|
-
imports: [
|
|
737
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
739
738
|
type: "delete",
|
|
740
739
|
itemType: "Workflow",
|
|
741
740
|
confirm: "delete",
|
|
@@ -743,7 +742,7 @@ var deleteWorkflowPlugin = kitcore.defineMethod({
|
|
|
743
742
|
outputSchema: DeleteWorkflowResponseSchema,
|
|
744
743
|
skipOutputValidation: true,
|
|
745
744
|
output: "raw",
|
|
746
|
-
resolvers: { workflow:
|
|
745
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
747
746
|
run: async ({ imports, input }) => {
|
|
748
747
|
const api = imports.api;
|
|
749
748
|
await api.delete(
|
|
@@ -807,7 +806,7 @@ var ListDurableRunsApiResponseSchema = zod.z.object({
|
|
|
807
806
|
var listDurableRunsPlugin = kitcore.defineMethod({
|
|
808
807
|
...codeSubstrateDefaults,
|
|
809
808
|
name: "listDurableRuns",
|
|
810
|
-
imports: [
|
|
809
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
811
810
|
type: "list",
|
|
812
811
|
itemType: "DurableRun",
|
|
813
812
|
inputSchema: ListDurableRunsOptionsSchema,
|
|
@@ -815,7 +814,7 @@ var listDurableRunsPlugin = kitcore.defineMethod({
|
|
|
815
814
|
skipOutputValidation: true,
|
|
816
815
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
817
816
|
// standard list output (no `adaptPage`) applies.
|
|
818
|
-
output: { type: "list", defaultPageSize:
|
|
817
|
+
output: { type: "list", defaultPageSize: chunk6LPWOY7I_cjs.DEFAULT_PAGE_SIZE },
|
|
819
818
|
run: async ({ imports, input }) => {
|
|
820
819
|
const api = imports.api;
|
|
821
820
|
const searchParams = {};
|
|
@@ -932,13 +931,13 @@ var GetDurableRunResponseSchema = zod.z.object({
|
|
|
932
931
|
var getDurableRunPlugin = kitcore.defineMethod({
|
|
933
932
|
...codeSubstrateDefaults,
|
|
934
933
|
name: "getDurableRun",
|
|
935
|
-
imports: [
|
|
934
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
936
935
|
itemType: "DurableRun",
|
|
937
936
|
inputSchema: GetDurableRunOptionsSchema,
|
|
938
937
|
outputSchema: GetDurableRunResponseSchema,
|
|
939
938
|
skipOutputValidation: true,
|
|
940
939
|
output: "item",
|
|
941
|
-
resolvers: { run:
|
|
940
|
+
resolvers: { run: chunk6LPWOY7I_cjs.durableRunIdResolver },
|
|
942
941
|
run: async ({ imports, input }) => {
|
|
943
942
|
const api = imports.api;
|
|
944
943
|
const raw = await api.get(
|
|
@@ -1032,7 +1031,7 @@ var sourceFilesResolver = kitcore.defineResolver({
|
|
|
1032
1031
|
var runDurablePlugin = kitcore.defineMethod({
|
|
1033
1032
|
...codeSubstrateDefaults,
|
|
1034
1033
|
name: "runDurable",
|
|
1035
|
-
imports: [
|
|
1034
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1036
1035
|
type: "create",
|
|
1037
1036
|
itemType: "DurableRun",
|
|
1038
1037
|
inputSchema: RunDurableOptionsSchema,
|
|
@@ -1089,14 +1088,14 @@ var CancelDurableRunResponseSchema = zod.z.object({
|
|
|
1089
1088
|
var cancelDurableRunPlugin = kitcore.defineMethod({
|
|
1090
1089
|
...codeSubstrateDefaults,
|
|
1091
1090
|
name: "cancelDurableRun",
|
|
1092
|
-
imports: [
|
|
1091
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1093
1092
|
type: "update",
|
|
1094
1093
|
itemType: "DurableRun",
|
|
1095
1094
|
inputSchema: CancelDurableRunOptionsSchema,
|
|
1096
1095
|
outputSchema: CancelDurableRunResponseSchema,
|
|
1097
1096
|
skipOutputValidation: true,
|
|
1098
1097
|
output: "item",
|
|
1099
|
-
resolvers: { run:
|
|
1098
|
+
resolvers: { run: chunk6LPWOY7I_cjs.durableRunIdResolver },
|
|
1100
1099
|
run: async ({ imports, input }) => {
|
|
1101
1100
|
const api = imports.api;
|
|
1102
1101
|
await api.post(
|
|
@@ -1211,14 +1210,14 @@ function describeOpenDraft(draft) {
|
|
|
1211
1210
|
var publishWorkflowVersionPlugin = kitcore.defineMethod({
|
|
1212
1211
|
...codeSubstrateDefaults,
|
|
1213
1212
|
name: "publishWorkflowVersion",
|
|
1214
|
-
imports: [
|
|
1213
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1215
1214
|
type: "create",
|
|
1216
1215
|
itemType: "WorkflowVersion",
|
|
1217
1216
|
inputSchema: PublishWorkflowVersionOptionsSchema,
|
|
1218
1217
|
outputSchema: PublishWorkflowVersionResponseSchema,
|
|
1219
1218
|
skipOutputValidation: true,
|
|
1220
1219
|
output: "item",
|
|
1221
|
-
resolvers: { workflow:
|
|
1220
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver, sourceFiles: sourceFilesResolver },
|
|
1222
1221
|
run: async ({ imports, input }) => {
|
|
1223
1222
|
const api = imports.api;
|
|
1224
1223
|
const sourceFiles = "sourceFiles" in input ? input.sourceFiles : input.source_files;
|
|
@@ -1272,13 +1271,13 @@ var publishWorkflowVersionPlugin = kitcore.defineMethod({
|
|
|
1272
1271
|
if (status !== 409) return void 0;
|
|
1273
1272
|
const conflict = extractOpenDraftConflict(data);
|
|
1274
1273
|
if (!conflict) {
|
|
1275
|
-
return new
|
|
1276
|
-
|
|
1274
|
+
return new chunk6LPWOY7I_cjs.ZapierConflictError(
|
|
1275
|
+
chunk6LPWOY7I_cjs.extractErrorDetail(data) ?? "Workflow version publish conflict.",
|
|
1277
1276
|
{ statusCode: status, resourceType: "workflow" }
|
|
1278
1277
|
);
|
|
1279
1278
|
}
|
|
1280
1279
|
const detail = conflict.detail ?? "Cannot publish over open draft(s).";
|
|
1281
|
-
return new
|
|
1280
|
+
return new chunk6LPWOY7I_cjs.ZapierConflictError(
|
|
1282
1281
|
[
|
|
1283
1282
|
`${detail} Blocking draft(s):`,
|
|
1284
1283
|
...conflict.openDrafts.map(describeOpenDraft),
|
|
@@ -1334,7 +1333,7 @@ var ListWorkflowVersionsApiResponseSchema = zod.z.object({
|
|
|
1334
1333
|
var listWorkflowVersionsPlugin = kitcore.defineMethod({
|
|
1335
1334
|
...codeSubstrateDefaults,
|
|
1336
1335
|
name: "listWorkflowVersions",
|
|
1337
|
-
imports: [
|
|
1336
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1338
1337
|
type: "list",
|
|
1339
1338
|
itemType: "WorkflowVersion",
|
|
1340
1339
|
inputSchema: ListWorkflowVersionsOptionsSchema,
|
|
@@ -1342,8 +1341,8 @@ var listWorkflowVersionsPlugin = kitcore.defineMethod({
|
|
|
1342
1341
|
skipOutputValidation: true,
|
|
1343
1342
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
1344
1343
|
// standard list output (no `adaptPage`) applies.
|
|
1345
|
-
output: { type: "list", defaultPageSize:
|
|
1346
|
-
resolvers: { workflow:
|
|
1344
|
+
output: { type: "list", defaultPageSize: chunk6LPWOY7I_cjs.DEFAULT_PAGE_SIZE },
|
|
1345
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
1347
1346
|
run: async ({ imports, input }) => {
|
|
1348
1347
|
const api = imports.api;
|
|
1349
1348
|
const searchParams = {};
|
|
@@ -1378,15 +1377,15 @@ var GetWorkflowVersionResponseSchema = WorkflowVersionSchema;
|
|
|
1378
1377
|
var getWorkflowVersionPlugin = kitcore.defineMethod({
|
|
1379
1378
|
...codeSubstrateDefaults,
|
|
1380
1379
|
name: "getWorkflowVersion",
|
|
1381
|
-
imports: [
|
|
1380
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1382
1381
|
itemType: "WorkflowVersion",
|
|
1383
1382
|
inputSchema: GetWorkflowVersionOptionsSchema,
|
|
1384
1383
|
outputSchema: GetWorkflowVersionResponseSchema,
|
|
1385
1384
|
skipOutputValidation: true,
|
|
1386
1385
|
output: "item",
|
|
1387
1386
|
resolvers: {
|
|
1388
|
-
workflow:
|
|
1389
|
-
version:
|
|
1387
|
+
workflow: chunk6LPWOY7I_cjs.workflowIdResolver,
|
|
1388
|
+
version: chunk6LPWOY7I_cjs.workflowVersionIdResolver
|
|
1390
1389
|
},
|
|
1391
1390
|
run: async ({ imports, input }) => {
|
|
1392
1391
|
const api = imports.api;
|
|
@@ -1446,7 +1445,7 @@ var ListWorkflowDraftsApiResponseSchema = zod.z.object({
|
|
|
1446
1445
|
var listWorkflowDraftsPlugin = kitcore.defineMethod({
|
|
1447
1446
|
...codeSubstrateDefaults,
|
|
1448
1447
|
name: "listWorkflowDrafts",
|
|
1449
|
-
imports: [
|
|
1448
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1450
1449
|
type: "list",
|
|
1451
1450
|
itemType: "WorkflowDraft",
|
|
1452
1451
|
inputSchema: ListWorkflowDraftsOptionsSchema,
|
|
@@ -1454,8 +1453,8 @@ var listWorkflowDraftsPlugin = kitcore.defineMethod({
|
|
|
1454
1453
|
skipOutputValidation: true,
|
|
1455
1454
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
1456
1455
|
// standard list output (no `adaptPage`) applies.
|
|
1457
|
-
output: { type: "list", defaultPageSize:
|
|
1458
|
-
resolvers: { workflow:
|
|
1456
|
+
output: { type: "list", defaultPageSize: chunk6LPWOY7I_cjs.DEFAULT_PAGE_SIZE },
|
|
1457
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
1459
1458
|
run: async ({ imports, input }) => {
|
|
1460
1459
|
const api = imports.api;
|
|
1461
1460
|
const searchParams = {};
|
|
@@ -1496,15 +1495,15 @@ var GetWorkflowDraftResponseSchema = WorkflowDraftSchema;
|
|
|
1496
1495
|
var getWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1497
1496
|
...codeSubstrateDefaults,
|
|
1498
1497
|
name: "getWorkflowDraft",
|
|
1499
|
-
imports: [
|
|
1498
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1500
1499
|
itemType: "WorkflowDraft",
|
|
1501
1500
|
inputSchema: GetWorkflowDraftOptionsSchema,
|
|
1502
1501
|
outputSchema: GetWorkflowDraftResponseSchema,
|
|
1503
1502
|
skipOutputValidation: true,
|
|
1504
1503
|
output: "item",
|
|
1505
1504
|
resolvers: {
|
|
1506
|
-
workflow:
|
|
1507
|
-
draft:
|
|
1505
|
+
workflow: chunk6LPWOY7I_cjs.workflowIdResolver,
|
|
1506
|
+
draft: chunk6LPWOY7I_cjs.workflowDraftIdResolver
|
|
1508
1507
|
},
|
|
1509
1508
|
run: async ({ imports, input }) => {
|
|
1510
1509
|
const api = imports.api;
|
|
@@ -1533,14 +1532,14 @@ var CreateWorkflowDraftResponseSchema = WorkflowDraftSchema;
|
|
|
1533
1532
|
var createWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1534
1533
|
...codeSubstrateDefaults,
|
|
1535
1534
|
name: "createWorkflowDraft",
|
|
1536
|
-
imports: [
|
|
1535
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1537
1536
|
type: "create",
|
|
1538
1537
|
itemType: "WorkflowDraft",
|
|
1539
1538
|
inputSchema: CreateWorkflowDraftOptionsSchema,
|
|
1540
1539
|
outputSchema: CreateWorkflowDraftResponseSchema,
|
|
1541
1540
|
skipOutputValidation: true,
|
|
1542
1541
|
output: "item",
|
|
1543
|
-
resolvers: { workflow:
|
|
1542
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
1544
1543
|
run: async ({ imports, input }) => {
|
|
1545
1544
|
const api = imports.api;
|
|
1546
1545
|
const body = {};
|
|
@@ -1598,7 +1597,7 @@ var UpdateWorkflowDraftResponseSchema = WorkflowDraftSchema;
|
|
|
1598
1597
|
var updateWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1599
1598
|
...codeSubstrateDefaults,
|
|
1600
1599
|
name: "updateWorkflowDraft",
|
|
1601
|
-
imports: [
|
|
1600
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1602
1601
|
type: "update",
|
|
1603
1602
|
itemType: "WorkflowDraft",
|
|
1604
1603
|
inputSchema: UpdateWorkflowDraftOptionsSchema,
|
|
@@ -1606,8 +1605,8 @@ var updateWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1606
1605
|
skipOutputValidation: true,
|
|
1607
1606
|
output: "item",
|
|
1608
1607
|
resolvers: {
|
|
1609
|
-
workflow:
|
|
1610
|
-
draft:
|
|
1608
|
+
workflow: chunk6LPWOY7I_cjs.workflowIdResolver,
|
|
1609
|
+
draft: chunk6LPWOY7I_cjs.workflowDraftIdResolver,
|
|
1611
1610
|
sourceFiles: sourceFilesResolver
|
|
1612
1611
|
},
|
|
1613
1612
|
run: async ({ imports, input }) => {
|
|
@@ -1656,8 +1655,8 @@ var updateWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1656
1655
|
// re-read the draft, and retry instead of blind-overwriting.
|
|
1657
1656
|
customErrorHandler: ({ status, data }) => {
|
|
1658
1657
|
if (status === 409) {
|
|
1659
|
-
const detail =
|
|
1660
|
-
return new
|
|
1658
|
+
const detail = chunk6LPWOY7I_cjs.extractErrorDetail(data);
|
|
1659
|
+
return new chunk6LPWOY7I_cjs.ZapierConflictError(
|
|
1661
1660
|
`${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.`,
|
|
1662
1661
|
{ statusCode: status, resourceType: "workflow-draft" }
|
|
1663
1662
|
);
|
|
@@ -1681,7 +1680,7 @@ var DiscardWorkflowDraftResponseSchema = WorkflowDraftSchema;
|
|
|
1681
1680
|
var discardWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1682
1681
|
...codeSubstrateDefaults,
|
|
1683
1682
|
name: "discardWorkflowDraft",
|
|
1684
|
-
imports: [
|
|
1683
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1685
1684
|
type: "delete",
|
|
1686
1685
|
itemType: "WorkflowDraft",
|
|
1687
1686
|
// Soft delete returns the discarded draft, not the `{ success: boolean }`
|
|
@@ -1695,8 +1694,8 @@ var discardWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1695
1694
|
skipOutputValidation: true,
|
|
1696
1695
|
output: "item",
|
|
1697
1696
|
resolvers: {
|
|
1698
|
-
workflow:
|
|
1699
|
-
draft:
|
|
1697
|
+
workflow: chunk6LPWOY7I_cjs.workflowIdResolver,
|
|
1698
|
+
draft: chunk6LPWOY7I_cjs.workflowDraftIdResolver
|
|
1700
1699
|
},
|
|
1701
1700
|
run: async ({ imports, input }) => {
|
|
1702
1701
|
const api = imports.api;
|
|
@@ -1740,7 +1739,7 @@ var PublishWorkflowDraftResponseSchema = zod.z.object({
|
|
|
1740
1739
|
var publishWorkflowDraftPlugin = kitcore.defineMethod({
|
|
1741
1740
|
...codeSubstrateDefaults,
|
|
1742
1741
|
name: "publishWorkflowDraft",
|
|
1743
|
-
imports: [
|
|
1742
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1744
1743
|
type: "create",
|
|
1745
1744
|
itemType: "WorkflowVersion",
|
|
1746
1745
|
// The response is the composite `{ draft, version }`, not the bare
|
|
@@ -1751,8 +1750,8 @@ var publishWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1751
1750
|
skipOutputValidation: true,
|
|
1752
1751
|
output: "item",
|
|
1753
1752
|
resolvers: {
|
|
1754
|
-
workflow:
|
|
1755
|
-
draft:
|
|
1753
|
+
workflow: chunk6LPWOY7I_cjs.workflowIdResolver,
|
|
1754
|
+
draft: chunk6LPWOY7I_cjs.workflowDraftIdResolver
|
|
1756
1755
|
},
|
|
1757
1756
|
run: async ({ imports, input }) => {
|
|
1758
1757
|
const api = imports.api;
|
|
@@ -1789,15 +1788,15 @@ var publishWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
1789
1788
|
// to ZapierValidationError via the client's default handling.
|
|
1790
1789
|
customErrorHandler: ({ status, data }) => {
|
|
1791
1790
|
if (status === 409) {
|
|
1792
|
-
const detail =
|
|
1793
|
-
return new
|
|
1791
|
+
const detail = chunk6LPWOY7I_cjs.extractErrorDetail(data);
|
|
1792
|
+
return new chunk6LPWOY7I_cjs.ZapierConflictError(
|
|
1794
1793
|
`${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.`,
|
|
1795
1794
|
{ statusCode: status, resourceType: "workflow-draft" }
|
|
1796
1795
|
);
|
|
1797
1796
|
}
|
|
1798
1797
|
if (status === 503) {
|
|
1799
|
-
const detail =
|
|
1800
|
-
return new
|
|
1798
|
+
const detail = chunk6LPWOY7I_cjs.extractErrorDetail(data);
|
|
1799
|
+
return new chunk6LPWOY7I_cjs.ZapierApiError(
|
|
1801
1800
|
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.",
|
|
1802
1801
|
{ statusCode: status }
|
|
1803
1802
|
);
|
|
@@ -1837,11 +1836,11 @@ async function readRunUntilEnded({
|
|
|
1837
1836
|
latest = await read(requestWaitSeconds);
|
|
1838
1837
|
if (TERMINAL_RUN_STATUSES.has(latest.status)) return latest;
|
|
1839
1838
|
} catch (error) {
|
|
1840
|
-
if (!pendingWhileNotFound || !
|
|
1839
|
+
if (!pendingWhileNotFound || !chunk6LPWOY7I_cjs.isZapierNotFoundError(error)) throw error;
|
|
1841
1840
|
notFound = error;
|
|
1842
1841
|
}
|
|
1843
1842
|
if (Date.now() - askedAt < requestWaitSeconds * 1e3 / 2) {
|
|
1844
|
-
await
|
|
1843
|
+
await chunk6LPWOY7I_cjs.sleep(Math.min(backoffMilliseconds, deadline - Date.now()));
|
|
1845
1844
|
backoffMilliseconds = Math.min(
|
|
1846
1845
|
backoffMilliseconds * 2,
|
|
1847
1846
|
MAX_BACKOFF_MILLISECONDS
|
|
@@ -1961,15 +1960,15 @@ var GetWorkflowRunResponseSchema = zod.z.discriminatedUnion("kind", [
|
|
|
1961
1960
|
var getWorkflowRunPlugin = kitcore.defineMethod({
|
|
1962
1961
|
...codeSubstrateDefaults,
|
|
1963
1962
|
name: "getWorkflowRun",
|
|
1964
|
-
imports: [
|
|
1963
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
1965
1964
|
itemType: "WorkflowRun",
|
|
1966
1965
|
inputSchema: GetWorkflowRunOptionsSchema,
|
|
1967
1966
|
outputSchema: GetWorkflowRunResponseSchema,
|
|
1968
1967
|
skipOutputValidation: true,
|
|
1969
1968
|
output: "item",
|
|
1970
1969
|
resolvers: {
|
|
1971
|
-
workflow:
|
|
1972
|
-
run:
|
|
1970
|
+
workflow: chunk6LPWOY7I_cjs.workflowIdResolver,
|
|
1971
|
+
run: chunk6LPWOY7I_cjs.workflowRunIdResolver
|
|
1973
1972
|
},
|
|
1974
1973
|
run: async ({ imports, input }) => {
|
|
1975
1974
|
const api = imports.api;
|
|
@@ -2027,7 +2026,7 @@ var RunWorkflowDraftResponseSchema = zod.z.object({
|
|
|
2027
2026
|
var runWorkflowDraftPlugin = kitcore.defineMethod({
|
|
2028
2027
|
...codeSubstrateDefaults,
|
|
2029
2028
|
name: "runWorkflowDraft",
|
|
2030
|
-
imports: [
|
|
2029
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef, getWorkflowRunPlugin],
|
|
2031
2030
|
type: "create",
|
|
2032
2031
|
itemType: "WorkflowRun",
|
|
2033
2032
|
// The response is the draft variant of the run resource (`kind: "draft"`,
|
|
@@ -2039,9 +2038,9 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
2039
2038
|
skipOutputValidation: true,
|
|
2040
2039
|
output: "item",
|
|
2041
2040
|
resolvers: {
|
|
2042
|
-
workflow:
|
|
2043
|
-
draft:
|
|
2044
|
-
draftRevision:
|
|
2041
|
+
workflow: chunk6LPWOY7I_cjs.workflowIdResolver,
|
|
2042
|
+
draft: chunk6LPWOY7I_cjs.workflowDraftIdResolver,
|
|
2043
|
+
draftRevision: chunk6LPWOY7I_cjs.workflowDraftRevisionResolver
|
|
2045
2044
|
},
|
|
2046
2045
|
run: async ({ imports, input }) => {
|
|
2047
2046
|
const api = imports.api;
|
|
@@ -2063,8 +2062,8 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
2063
2062
|
// retries with backoff and then throws ZapierRateLimitError.
|
|
2064
2063
|
customErrorHandler: ({ status, data }) => {
|
|
2065
2064
|
if (status === 409) {
|
|
2066
|
-
const detail =
|
|
2067
|
-
return new
|
|
2065
|
+
const detail = chunk6LPWOY7I_cjs.extractErrorDetail(data);
|
|
2066
|
+
return new chunk6LPWOY7I_cjs.ZapierConflictError(
|
|
2068
2067
|
`${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.`,
|
|
2069
2068
|
{ statusCode: status, resourceType: "workflow-draft" }
|
|
2070
2069
|
);
|
|
@@ -2085,7 +2084,7 @@ var runWorkflowDraftPlugin = kitcore.defineMethod({
|
|
|
2085
2084
|
var listWorkflowRunsPlugin = kitcore.defineMethod({
|
|
2086
2085
|
...codeSubstrateDefaults,
|
|
2087
2086
|
name: "listWorkflowRuns",
|
|
2088
|
-
imports: [
|
|
2087
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
2089
2088
|
type: "list",
|
|
2090
2089
|
itemType: "WorkflowRun",
|
|
2091
2090
|
inputSchema: ListWorkflowRunsOptionsSchema,
|
|
@@ -2093,8 +2092,8 @@ var listWorkflowRunsPlugin = kitcore.defineMethod({
|
|
|
2093
2092
|
skipOutputValidation: true,
|
|
2094
2093
|
// The handler already returns a clean `{ data, nextCursor }` page, so the
|
|
2095
2094
|
// standard list output (no `adaptPage`) applies.
|
|
2096
|
-
output: { type: "list", defaultPageSize:
|
|
2097
|
-
resolvers: { workflow:
|
|
2095
|
+
output: { type: "list", defaultPageSize: chunk6LPWOY7I_cjs.DEFAULT_PAGE_SIZE },
|
|
2096
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
2098
2097
|
run: async ({ imports, input }) => {
|
|
2099
2098
|
const api = imports.api;
|
|
2100
2099
|
const searchParams = {};
|
|
@@ -2146,7 +2145,7 @@ var GetTriggerRunResponseSchema = zod.z.object({
|
|
|
2146
2145
|
var getTriggerRunPlugin = kitcore.defineMethod({
|
|
2147
2146
|
...codeSubstrateDefaults,
|
|
2148
2147
|
name: "getTriggerRun",
|
|
2149
|
-
imports: [
|
|
2148
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
2150
2149
|
itemType: "WorkflowRun",
|
|
2151
2150
|
inputSchema: GetTriggerRunOptionsSchema,
|
|
2152
2151
|
outputSchema: GetTriggerRunResponseSchema,
|
|
@@ -2198,14 +2197,14 @@ var TriggerWorkflowResponseSchema = zod.z.object({
|
|
|
2198
2197
|
var triggerWorkflowPlugin = kitcore.defineMethod({
|
|
2199
2198
|
...codeSubstrateDefaults,
|
|
2200
2199
|
name: "triggerWorkflow",
|
|
2201
|
-
imports: [
|
|
2200
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
2202
2201
|
type: "create",
|
|
2203
2202
|
itemType: "WorkflowRun",
|
|
2204
2203
|
inputSchema: TriggerWorkflowOptionsSchema,
|
|
2205
2204
|
outputSchema: TriggerWorkflowResponseSchema,
|
|
2206
2205
|
skipOutputValidation: true,
|
|
2207
2206
|
output: "item",
|
|
2208
|
-
resolvers: { workflow:
|
|
2207
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
2209
2208
|
run: async ({ imports, input }) => {
|
|
2210
2209
|
const api = imports.api;
|
|
2211
2210
|
const rawWorkflow = await api.get(
|
|
@@ -2219,7 +2218,7 @@ var triggerWorkflowPlugin = kitcore.defineMethod({
|
|
|
2219
2218
|
const segments = new URL(workflow.trigger_url).pathname.split("/");
|
|
2220
2219
|
const triggerToken = segments[segments.length - 1];
|
|
2221
2220
|
if (!triggerToken) {
|
|
2222
|
-
throw new
|
|
2221
|
+
throw new chunk6LPWOY7I_cjs.ZapierApiError(
|
|
2223
2222
|
`Workflow ${input.workflow} returned a malformed trigger_url`,
|
|
2224
2223
|
{ statusCode: 0, response: workflow.trigger_url }
|
|
2225
2224
|
);
|
|
@@ -2262,7 +2261,7 @@ var runWorkflowPlugin = kitcore.defineMethod({
|
|
|
2262
2261
|
outputSchema: RunWorkflowResponseSchema,
|
|
2263
2262
|
skipOutputValidation: true,
|
|
2264
2263
|
output: "item",
|
|
2265
|
-
resolvers: { workflow:
|
|
2264
|
+
resolvers: { workflow: chunk6LPWOY7I_cjs.workflowIdResolver },
|
|
2266
2265
|
run: async ({ imports, input }) => {
|
|
2267
2266
|
const { data: trigger } = await imports.triggerWorkflow({
|
|
2268
2267
|
workflow: input.workflow,
|
|
@@ -2276,8 +2275,8 @@ var runWorkflowPlugin = kitcore.defineMethod({
|
|
|
2276
2275
|
});
|
|
2277
2276
|
return { data: { ...run, trigger_id: trigger.id } };
|
|
2278
2277
|
} catch (error) {
|
|
2279
|
-
if (!
|
|
2280
|
-
throw new
|
|
2278
|
+
if (!chunk6LPWOY7I_cjs.isZapierNotFoundError(error)) throw error;
|
|
2279
|
+
throw new chunk6LPWOY7I_cjs.ZapierTimeoutError(
|
|
2281
2280
|
`The run for trigger ${trigger.id} had not started after ${waitSeconds}s. Check it later with getTriggerRun.`,
|
|
2282
2281
|
{ cause: error }
|
|
2283
2282
|
);
|
|
@@ -2347,7 +2346,7 @@ var ValidateWorkflowResponseSchema = zod.z.object({
|
|
|
2347
2346
|
var validateWorkflowPlugin = kitcore.defineMethod({
|
|
2348
2347
|
...codeSubstrateDefaults,
|
|
2349
2348
|
name: "validateWorkflow",
|
|
2350
|
-
imports: [
|
|
2349
|
+
imports: [chunk6LPWOY7I_cjs.apiPluginRef],
|
|
2351
2350
|
itemType: "WorkflowValidation",
|
|
2352
2351
|
inputSchema: ValidateWorkflowOptionsSchema,
|
|
2353
2352
|
outputSchema: ValidateWorkflowResponseSchema,
|
|
@@ -2375,7 +2374,7 @@ var zapierBetaSdkPlugin = kitcore.definePlugin({
|
|
|
2375
2374
|
namespace: "zapier",
|
|
2376
2375
|
name: "beta-sdk",
|
|
2377
2376
|
exports: [
|
|
2378
|
-
|
|
2377
|
+
chunk6LPWOY7I_cjs.zapierSdkPlugin,
|
|
2379
2378
|
// Next Gen Zaps (workflows, drafts, runs). `list*` plugins are exported
|
|
2380
2379
|
// before their `get*` / mutation siblings because per-row resolvers
|
|
2381
2380
|
// reach the listing methods.
|
|
@@ -2412,8 +2411,8 @@ var zapierBetaSdkPlugin = kitcore.definePlugin({
|
|
|
2412
2411
|
function createZapierSdk(options = {}) {
|
|
2413
2412
|
return kitcore.createSdk(zapierBetaSdkPlugin, {
|
|
2414
2413
|
configuration: {
|
|
2415
|
-
[
|
|
2416
|
-
[kitcore.CORE_OPTIONS_ID]:
|
|
2414
|
+
[chunk6LPWOY7I_cjs.SDK_OPTIONS_ID]: options,
|
|
2415
|
+
[kitcore.CORE_OPTIONS_ID]: chunk6LPWOY7I_cjs.zapierCoreOptions
|
|
2417
2416
|
}
|
|
2418
2417
|
});
|
|
2419
2418
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { taxonomy, DEFAULT_PAGE_SIZE, apiPluginRef, workflowIdResolver, extractErrorDetail, ZapierApiError, durableRunIdResolver, ZapierConflictError, workflowVersionIdResolver, workflowDraftIdResolver, workflowRunIdResolver, workflowDraftRevisionResolver, isZapierNotFoundError, ZapierTimeoutError, zapierSdkPlugin, SDK_VERSION, ZapierValidationError, sleep, zapierCoreOptions, SDK_OPTIONS_ID } from './chunk-
|
|
1
|
+
import { taxonomy, DEFAULT_PAGE_SIZE, apiPluginRef, workflowIdResolver, extractErrorDetail, ZapierApiError, durableRunIdResolver, ZapierConflictError, workflowVersionIdResolver, workflowDraftIdResolver, workflowRunIdResolver, workflowDraftRevisionResolver, isZapierNotFoundError, ZapierTimeoutError, zapierSdkPlugin, SDK_VERSION, ZapierValidationError, sleep, zapierCoreOptions, SDK_OPTIONS_ID } from './chunk-YZMIF24O.mjs';
|
|
2
2
|
import { defineMethod, openEnum, defineResolver, definePlugin, createSdk, CORE_OPTIONS_ID } from '@zapier/kitcore';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
@@ -489,7 +489,7 @@ var createWorkflowPlugin = defineMethod({
|
|
|
489
489
|
});
|
|
490
490
|
var ImportWorkflowOptionsSchema = z.object({
|
|
491
491
|
zap: z.string().min(1).max(128).describe(
|
|
492
|
-
"ID of the Zap to import.
|
|
492
|
+
"ID of the Zap to import. Recorded on the created workflow as source_zap_id."
|
|
493
493
|
),
|
|
494
494
|
name: z.string().optional().describe(
|
|
495
495
|
`Name for the created workflow. Defaults to a kebab-cased form of the Zap's title, or "imported-workflow" when the Zap has no title.`
|
|
@@ -580,14 +580,13 @@ var importWorkflowPlugin = defineMethod({
|
|
|
580
580
|
body,
|
|
581
581
|
{
|
|
582
582
|
authRequired: true,
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
// about which gate they hit or what to do, so name both.
|
|
583
|
+
// The API owns the wording of its access rule; pass its reason through
|
|
584
|
+
// and add only what a caller can't infer from a bare 403.
|
|
586
585
|
customErrorHandler: ({ status, data }) => {
|
|
587
586
|
if (status === 403) {
|
|
588
|
-
const detail = extractErrorDetail(data);
|
|
587
|
+
const detail = extractErrorDetail(data)?.replace(/[.!?]+$/, "");
|
|
589
588
|
return new ZapierApiError(
|
|
590
|
-
`${detail
|
|
589
|
+
`${detail || "Zap import forbidden"}. Retrying will not help.`,
|
|
591
590
|
{ statusCode: status }
|
|
592
591
|
);
|
|
593
592
|
}
|