@zapier/zapier-sdk 0.73.0 → 0.74.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 +12 -0
- package/README.md +32 -32
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +5 -0
- package/dist/experimental.cjs +218 -80
- package/dist/experimental.d.mts +160 -12
- package/dist/experimental.d.ts +158 -10
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.mjs +217 -81
- package/dist/{index-D1O7Pcex.d.mts → index-WMit6fkJ.d.mts} +22 -1
- package/dist/{index-D1O7Pcex.d.ts → index-WMit6fkJ.d.ts} +22 -1
- package/dist/index.cjs +53 -16
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.mjs +52 -17
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts +42 -3
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.js +49 -11
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts +117 -5
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.js +77 -14
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts +37 -2
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/runDurable/index.js +10 -9
- package/dist/plugins/codeSubstrate/runDurable/schemas.d.ts +117 -4
- package/dist/plugins/codeSubstrate/runDurable/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/runDurable/schemas.js +38 -37
- package/dist/plugins/codeSubstrate/shared.d.ts +56 -0
- package/dist/plugins/codeSubstrate/shared.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/shared.js +100 -0
- package/dist/utils/caller-context.d.ts +21 -0
- package/dist/utils/caller-context.d.ts.map +1 -0
- package/dist/utils/caller-context.js +35 -0
- package/package.json +2 -2
|
@@ -1,25 +1,136 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
declare const TriggerConfigSchema: z.ZodObject<{
|
|
3
|
+
selectedApi: z.ZodOptional<z.ZodString>;
|
|
4
|
+
selected_api: z.ZodOptional<z.ZodString>;
|
|
5
|
+
action: z.ZodString;
|
|
6
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
authentication_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type TriggerConfig = z.infer<typeof TriggerConfigSchema>;
|
|
11
|
+
export declare const PublishWorkflowVersionSchema: z.ZodObject<{
|
|
12
|
+
workflow: z.ZodString;
|
|
13
|
+
sourceFiles: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
14
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
15
|
+
zapierDurableVersion: z.ZodOptional<z.ZodString>;
|
|
16
|
+
zapier_durable_version: z.ZodOptional<z.ZodString>;
|
|
17
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
connections: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
19
|
+
connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
20
|
+
connection_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
21
|
+
}, z.core.$strip>>>>;
|
|
22
|
+
appVersions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
23
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
24
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
25
|
+
version: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>>>>;
|
|
27
|
+
app_versions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
28
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
29
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
30
|
+
version: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>>>>;
|
|
32
|
+
trigger: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
selectedApi: z.ZodOptional<z.ZodString>;
|
|
34
|
+
selected_api: z.ZodOptional<z.ZodString>;
|
|
35
|
+
action: z.ZodString;
|
|
36
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
authentication_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
declare const PublishWorkflowVersionSchemaDeprecated: z.ZodObject<{
|
|
3
42
|
workflow: z.ZodString;
|
|
4
43
|
source_files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
5
44
|
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
45
|
+
zapierDurableVersion: z.ZodOptional<z.ZodString>;
|
|
6
46
|
zapier_durable_version: z.ZodOptional<z.ZodString>;
|
|
7
47
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
8
48
|
connections: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
9
|
-
|
|
49
|
+
connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
50
|
+
connection_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
51
|
+
}, z.core.$strip>>>>;
|
|
52
|
+
appVersions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
53
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
54
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
55
|
+
version: z.ZodOptional<z.ZodString>;
|
|
10
56
|
}, z.core.$strip>>>>;
|
|
11
57
|
app_versions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
12
|
-
|
|
58
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
59
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
13
60
|
version: z.ZodOptional<z.ZodString>;
|
|
14
61
|
}, z.core.$strip>>>>;
|
|
15
62
|
trigger: z.ZodOptional<z.ZodObject<{
|
|
16
|
-
|
|
63
|
+
selectedApi: z.ZodOptional<z.ZodString>;
|
|
64
|
+
selected_api: z.ZodOptional<z.ZodString>;
|
|
17
65
|
action: z.ZodString;
|
|
66
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
67
|
authentication_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
68
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
69
|
}, z.core.$strip>>;
|
|
21
70
|
}, z.core.$strip>;
|
|
22
|
-
export
|
|
71
|
+
export declare const PublishWorkflowVersionOptionsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
72
|
+
workflow: z.ZodString;
|
|
73
|
+
sourceFiles: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
74
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
75
|
+
zapierDurableVersion: z.ZodOptional<z.ZodString>;
|
|
76
|
+
zapier_durable_version: z.ZodOptional<z.ZodString>;
|
|
77
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
connections: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
79
|
+
connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
80
|
+
connection_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
81
|
+
}, z.core.$strip>>>>;
|
|
82
|
+
appVersions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
83
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
84
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
85
|
+
version: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>>>>;
|
|
87
|
+
app_versions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
88
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
89
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
90
|
+
version: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>>>>;
|
|
92
|
+
trigger: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
selectedApi: z.ZodOptional<z.ZodString>;
|
|
94
|
+
selected_api: z.ZodOptional<z.ZodString>;
|
|
95
|
+
action: z.ZodString;
|
|
96
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
97
|
+
authentication_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
101
|
+
workflow: z.ZodString;
|
|
102
|
+
source_files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
103
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
104
|
+
zapierDurableVersion: z.ZodOptional<z.ZodString>;
|
|
105
|
+
zapier_durable_version: z.ZodOptional<z.ZodString>;
|
|
106
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
connections: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
108
|
+
connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
109
|
+
connection_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
110
|
+
}, z.core.$strip>>>>;
|
|
111
|
+
appVersions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
112
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
113
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
114
|
+
version: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strip>>>>;
|
|
116
|
+
app_versions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
117
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
118
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
119
|
+
version: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>>>>;
|
|
121
|
+
trigger: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
selectedApi: z.ZodOptional<z.ZodString>;
|
|
123
|
+
selected_api: z.ZodOptional<z.ZodString>;
|
|
124
|
+
action: z.ZodString;
|
|
125
|
+
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
authentication_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
127
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
}, z.core.$strip>]>;
|
|
130
|
+
export type PublishWorkflowVersionOptions = z.infer<typeof PublishWorkflowVersionSchema> | (Omit<z.infer<typeof PublishWorkflowVersionSchemaDeprecated>, "source_files"> & {
|
|
131
|
+
/** @deprecated Use `sourceFiles` instead. */
|
|
132
|
+
source_files: z.infer<typeof PublishWorkflowVersionSchemaDeprecated>["source_files"];
|
|
133
|
+
});
|
|
23
134
|
export declare const PublishWorkflowVersionResponseSchema: z.ZodObject<{
|
|
24
135
|
id: z.ZodString;
|
|
25
136
|
workflow_id: z.ZodString;
|
|
@@ -43,4 +154,5 @@ export declare const PublishWorkflowVersionResponseSchema: z.ZodObject<{
|
|
|
43
154
|
}, z.core.$strip>>>;
|
|
44
155
|
}, z.core.$strip>;
|
|
45
156
|
export type PublishWorkflowVersionResponse = z.infer<typeof PublishWorkflowVersionResponseSchema>;
|
|
157
|
+
export {};
|
|
46
158
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/publishWorkflowVersion/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/publishWorkflowVersion/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,QAAA,MAAM,mBAAmB;;;;;;;iBA0BtB,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAyDhE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAarC,CAAC;AAGL,QAAA,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKF,CAAC;AAG3C,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEF,CAAC;AAE/C,MAAM,MAAM,6BAA6B,GACrC,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,GAC5C,CAAC,IAAI,CACH,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,EACtD,cAAc,CACf,GAAG;IACF,6CAA6C;IAC7C,YAAY,EAAE,CAAC,CAAC,KAAK,CACnB,OAAO,sCAAsC,CAC9C,CAAC,cAAc,CAAC,CAAC;CACnB,CAAC,CAAC;AAEP,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;iBA8B/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -1,37 +1,100 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { AppVersionBindingSchema as AppVersionBindingInputSchema, ConnectionBindingSchema as ConnectionBindingInputSchema, SourceFilesSchema, } from "../shared";
|
|
2
3
|
import { AppVersionBindingSchema, ConnectionBindingSchema, WorkflowVersionTriggerConfigSchema, } from "../shared-schemas";
|
|
3
|
-
|
|
4
|
+
// `selectedApi` is conceptually required when a trigger is configured, but it
|
|
5
|
+
// coexists with its deprecated snake_case alias. AGENTS.md rule 9 prescribes a
|
|
6
|
+
// union schema for a required renamed param; here we deliberately diverge —
|
|
7
|
+
// a union nested inside `trigger` would drop `.shape`, which the docs
|
|
8
|
+
// generator needs to render the trigger's fields. Instead both names are
|
|
9
|
+
// optional (so `.shape` survives, snake_case stays hidden via `deprecated`)
|
|
10
|
+
// and `toWireTrigger` enforces that one is present.
|
|
11
|
+
const TriggerConfigSchema = z
|
|
4
12
|
.object({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
})
|
|
11
|
-
|
|
13
|
+
selectedApi: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Zapier app/API identifier (e.g. 'GoogleSheetsAPI'). Required when a trigger is configured."),
|
|
17
|
+
/** @deprecated Use `selectedApi` instead. */
|
|
18
|
+
selected_api: z.string().optional().meta({ deprecated: true }),
|
|
19
|
+
action: z.string().describe("Trigger action key (e.g. 'new_row')"),
|
|
20
|
+
authenticationId: z
|
|
21
|
+
.string()
|
|
22
|
+
.nullish()
|
|
23
|
+
.describe("Connection ID for the trigger source. Omit or pass null for no-auth triggers (e.g. Schedule by Zapier)."),
|
|
24
|
+
/** @deprecated Use `authenticationId` instead. */
|
|
25
|
+
authentication_id: z.string().nullish().meta({ deprecated: true }),
|
|
26
|
+
params: z
|
|
27
|
+
.record(z.string(), z.unknown())
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Trigger parameters as a JSON object"),
|
|
30
|
+
})
|
|
31
|
+
.describe("Zapier trigger configuration. When set, the workflow subscribes to trigger events.");
|
|
32
|
+
const PublishWorkflowVersionDescription = "Publish a new version of a durable workflow. Enables the workflow by default.";
|
|
33
|
+
// Shared, non-renamed properties for both the canonical and deprecated
|
|
34
|
+
// `sourceFiles` variants. `workflow` and `sourceFiles` live on the variant
|
|
35
|
+
// objects (not here) so they stay the leading keys — the CLI derives
|
|
36
|
+
// positional args from key order, and the original order is
|
|
37
|
+
// `<workflow> <source-files>`.
|
|
38
|
+
const PublishWorkflowVersionBaseSchema = z.object({
|
|
12
39
|
dependencies: z
|
|
13
40
|
.record(z.string(), z.string())
|
|
14
41
|
.optional()
|
|
15
42
|
.describe("Optional npm package dependencies"),
|
|
16
|
-
|
|
43
|
+
zapierDurableVersion: z
|
|
17
44
|
.string()
|
|
18
45
|
.optional()
|
|
19
46
|
.describe('Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted.'),
|
|
47
|
+
/** @deprecated Use `zapierDurableVersion` instead. */
|
|
48
|
+
zapier_durable_version: z.string().optional().meta({ deprecated: true }),
|
|
20
49
|
enabled: z
|
|
21
50
|
.boolean()
|
|
22
51
|
.optional()
|
|
23
52
|
.describe("Enable the workflow after publishing. Defaults to true; pass false to publish without enabling."),
|
|
24
53
|
connections: z
|
|
25
|
-
.record(z.string(),
|
|
54
|
+
.record(z.string(), ConnectionBindingInputSchema)
|
|
26
55
|
.nullish()
|
|
27
56
|
.describe("Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding."),
|
|
28
|
-
|
|
29
|
-
.record(z.string(),
|
|
57
|
+
appVersions: z
|
|
58
|
+
.record(z.string(), AppVersionBindingInputSchema)
|
|
30
59
|
.nullish()
|
|
31
60
|
.describe("Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding."),
|
|
32
|
-
|
|
61
|
+
/** @deprecated Use `appVersions` instead. */
|
|
62
|
+
app_versions: z
|
|
63
|
+
.record(z.string(), AppVersionBindingInputSchema)
|
|
64
|
+
.nullish()
|
|
65
|
+
.meta({ deprecated: true }),
|
|
66
|
+
trigger: TriggerConfigSchema.optional().describe("Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; omit for webhook-only workflows."),
|
|
67
|
+
});
|
|
68
|
+
const WorkflowPropertySchema = z
|
|
69
|
+
.string()
|
|
70
|
+
.uuid()
|
|
71
|
+
.describe("Durable workflow ID");
|
|
72
|
+
// Canonical schema (new names only) — drives docs, CLI help, and the registry.
|
|
73
|
+
export const PublishWorkflowVersionSchema = z
|
|
74
|
+
.object({
|
|
75
|
+
workflow: WorkflowPropertySchema,
|
|
76
|
+
sourceFiles: SourceFilesSchema,
|
|
33
77
|
})
|
|
34
|
-
.
|
|
78
|
+
.merge(PublishWorkflowVersionBaseSchema)
|
|
79
|
+
.describe(PublishWorkflowVersionDescription)
|
|
80
|
+
.meta({
|
|
81
|
+
aliases: {
|
|
82
|
+
source_files: "sourceFiles",
|
|
83
|
+
zapier_durable_version: "zapierDurableVersion",
|
|
84
|
+
app_versions: "appVersions",
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
// Deprecated schema (backward compat) — keeps the old `source_files` name valid.
|
|
88
|
+
const PublishWorkflowVersionSchemaDeprecated = z
|
|
89
|
+
.object({
|
|
90
|
+
workflow: WorkflowPropertySchema,
|
|
91
|
+
source_files: SourceFilesSchema,
|
|
92
|
+
})
|
|
93
|
+
.merge(PublishWorkflowVersionBaseSchema);
|
|
94
|
+
// Union for runtime validation: accepts either the canonical or the old name.
|
|
95
|
+
export const PublishWorkflowVersionOptionsSchema = z
|
|
96
|
+
.union([PublishWorkflowVersionSchema, PublishWorkflowVersionSchemaDeprecated])
|
|
97
|
+
.describe(PublishWorkflowVersionDescription);
|
|
35
98
|
export const PublishWorkflowVersionResponseSchema = z.object({
|
|
36
99
|
id: z.string().describe("Workflow version ID (UUID)"),
|
|
37
100
|
workflow_id: z.string().describe("Parent workflow ID (UUID)"),
|
|
@@ -22,15 +22,50 @@ export declare const runDurablePlugin: (sdk: {
|
|
|
22
22
|
};
|
|
23
23
|
}) => {
|
|
24
24
|
runDurable: (options?: {
|
|
25
|
+
sourceFiles: Record<string, string>;
|
|
26
|
+
input?: unknown;
|
|
27
|
+
dependencies?: Record<string, string> | undefined;
|
|
28
|
+
zapierDurableVersion?: string | undefined;
|
|
29
|
+
zapier_durable_version?: string | undefined;
|
|
30
|
+
connections?: Record<string, {
|
|
31
|
+
connectionId?: string | number | undefined;
|
|
32
|
+
connection_id?: string | number | undefined;
|
|
33
|
+
}> | undefined;
|
|
34
|
+
appVersions?: Record<string, {
|
|
35
|
+
implementationName?: string | undefined;
|
|
36
|
+
implementation_name?: string | undefined;
|
|
37
|
+
version?: string | undefined;
|
|
38
|
+
}> | undefined;
|
|
39
|
+
app_versions?: Record<string, {
|
|
40
|
+
implementationName?: string | undefined;
|
|
41
|
+
implementation_name?: string | undefined;
|
|
42
|
+
version?: string | undefined;
|
|
43
|
+
}> | undefined;
|
|
44
|
+
private?: boolean | undefined;
|
|
45
|
+
notifications?: {
|
|
46
|
+
url: string;
|
|
47
|
+
events: ("error" | "started" | "cancelled" | "completed" | "progress")[];
|
|
48
|
+
type?: "webhook" | undefined;
|
|
49
|
+
max_retries?: number | undefined;
|
|
50
|
+
}[] | undefined;
|
|
51
|
+
} | {
|
|
25
52
|
source_files: Record<string, string>;
|
|
26
53
|
input?: unknown;
|
|
27
54
|
dependencies?: Record<string, string> | undefined;
|
|
55
|
+
zapierDurableVersion?: string | undefined;
|
|
28
56
|
zapier_durable_version?: string | undefined;
|
|
29
57
|
connections?: Record<string, {
|
|
30
|
-
|
|
58
|
+
connectionId?: string | number | undefined;
|
|
59
|
+
connection_id?: string | number | undefined;
|
|
60
|
+
}> | undefined;
|
|
61
|
+
appVersions?: Record<string, {
|
|
62
|
+
implementationName?: string | undefined;
|
|
63
|
+
implementation_name?: string | undefined;
|
|
64
|
+
version?: string | undefined;
|
|
31
65
|
}> | undefined;
|
|
32
66
|
app_versions?: Record<string, {
|
|
33
|
-
|
|
67
|
+
implementationName?: string | undefined;
|
|
68
|
+
implementation_name?: string | undefined;
|
|
34
69
|
version?: string | undefined;
|
|
35
70
|
}> | undefined;
|
|
36
71
|
private?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/runDurable/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/runDurable/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgD5B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { definePlugin, createPluginMethod } from "kitcore";
|
|
2
|
-
import { codeSubstrateDefaults } from "../shared";
|
|
2
|
+
import { codeSubstrateDefaults, toWireConnections, toWireAppVersions, } from "../shared";
|
|
3
3
|
import { RunDurableOptionsSchema, RunDurableResponseSchema } from "./schemas";
|
|
4
4
|
export const runDurablePlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
5
5
|
...codeSubstrateDefaults,
|
|
@@ -9,23 +9,24 @@ export const runDurablePlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
|
9
9
|
inputSchema: RunDurableOptionsSchema,
|
|
10
10
|
outputSchema: RunDurableResponseSchema,
|
|
11
11
|
handler: async ({ sdk, options }) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const sourceFiles = "sourceFiles" in options ? options.sourceFiles : options.source_files;
|
|
13
|
+
const zapierDurableVersion = options.zapierDurableVersion ?? options.zapier_durable_version;
|
|
14
|
+
const appVersions = options.appVersions ?? options.app_versions;
|
|
15
|
+
const body = { source_files: sourceFiles };
|
|
15
16
|
if (options.input !== undefined) {
|
|
16
17
|
body.input = options.input;
|
|
17
18
|
}
|
|
18
19
|
if (options.dependencies !== undefined) {
|
|
19
20
|
body.dependencies = options.dependencies;
|
|
20
21
|
}
|
|
21
|
-
if (
|
|
22
|
-
body.zapier_durable_version =
|
|
22
|
+
if (zapierDurableVersion !== undefined) {
|
|
23
|
+
body.zapier_durable_version = zapierDurableVersion;
|
|
23
24
|
}
|
|
24
25
|
if (options.connections !== undefined) {
|
|
25
|
-
body.connections = options.connections;
|
|
26
|
+
body.connections = toWireConnections(options.connections);
|
|
26
27
|
}
|
|
27
|
-
if (
|
|
28
|
-
body.app_versions =
|
|
28
|
+
if (appVersions !== undefined) {
|
|
29
|
+
body.app_versions = toWireAppVersions(appVersions);
|
|
29
30
|
}
|
|
30
31
|
if (options.private !== undefined) {
|
|
31
32
|
body.is_private = options.private;
|
|
@@ -1,14 +1,56 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const RunDurableSchema: z.ZodObject<{
|
|
3
|
+
sourceFiles: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
4
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
5
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
6
|
+
zapierDurableVersion: z.ZodOptional<z.ZodString>;
|
|
7
|
+
zapier_durable_version: z.ZodOptional<z.ZodString>;
|
|
8
|
+
connections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
9
|
+
connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
10
|
+
connection_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
11
|
+
}, z.core.$strip>>>;
|
|
12
|
+
appVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
13
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
14
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
version: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>>>;
|
|
17
|
+
app_versions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
18
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
19
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
20
|
+
version: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>>>;
|
|
22
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
notifications: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
type: z.ZodOptional<z.ZodLiteral<"webhook">>;
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
max_retries: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
events: z.ZodArray<z.ZodEnum<{
|
|
28
|
+
error: "error";
|
|
29
|
+
started: "started";
|
|
30
|
+
cancelled: "cancelled";
|
|
31
|
+
completed: "completed";
|
|
32
|
+
progress: "progress";
|
|
33
|
+
}>>;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
declare const RunDurableSchemaDeprecated: z.ZodObject<{
|
|
3
37
|
source_files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
4
38
|
input: z.ZodOptional<z.ZodUnknown>;
|
|
5
39
|
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
40
|
+
zapierDurableVersion: z.ZodOptional<z.ZodString>;
|
|
6
41
|
zapier_durable_version: z.ZodOptional<z.ZodString>;
|
|
7
42
|
connections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8
|
-
|
|
43
|
+
connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
44
|
+
connection_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
46
|
+
appVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
47
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
48
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
49
|
+
version: z.ZodOptional<z.ZodString>;
|
|
9
50
|
}, z.core.$strip>>>;
|
|
10
51
|
app_versions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
11
|
-
|
|
52
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
53
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
12
54
|
version: z.ZodOptional<z.ZodString>;
|
|
13
55
|
}, z.core.$strip>>>;
|
|
14
56
|
private: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -25,7 +67,77 @@ export declare const RunDurableOptionsSchema: z.ZodObject<{
|
|
|
25
67
|
}>>;
|
|
26
68
|
}, z.core.$strip>>>;
|
|
27
69
|
}, z.core.$strip>;
|
|
28
|
-
export
|
|
70
|
+
export declare const RunDurableOptionsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
71
|
+
sourceFiles: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
72
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
73
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
74
|
+
zapierDurableVersion: z.ZodOptional<z.ZodString>;
|
|
75
|
+
zapier_durable_version: z.ZodOptional<z.ZodString>;
|
|
76
|
+
connections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
77
|
+
connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
78
|
+
connection_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
80
|
+
appVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
81
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
82
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
83
|
+
version: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>>>;
|
|
85
|
+
app_versions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
86
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
87
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
88
|
+
version: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>>>;
|
|
90
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
notifications: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
type: z.ZodOptional<z.ZodLiteral<"webhook">>;
|
|
93
|
+
url: z.ZodString;
|
|
94
|
+
max_retries: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
events: z.ZodArray<z.ZodEnum<{
|
|
96
|
+
error: "error";
|
|
97
|
+
started: "started";
|
|
98
|
+
cancelled: "cancelled";
|
|
99
|
+
completed: "completed";
|
|
100
|
+
progress: "progress";
|
|
101
|
+
}>>;
|
|
102
|
+
}, z.core.$strip>>>;
|
|
103
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
104
|
+
source_files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
105
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
106
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
107
|
+
zapierDurableVersion: z.ZodOptional<z.ZodString>;
|
|
108
|
+
zapier_durable_version: z.ZodOptional<z.ZodString>;
|
|
109
|
+
connections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
110
|
+
connectionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
111
|
+
connection_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodNumber]>>;
|
|
112
|
+
}, z.core.$strip>>>;
|
|
113
|
+
appVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
114
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
115
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
116
|
+
version: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>>>;
|
|
118
|
+
app_versions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
119
|
+
implementationName: z.ZodOptional<z.ZodString>;
|
|
120
|
+
implementation_name: z.ZodOptional<z.ZodString>;
|
|
121
|
+
version: z.ZodOptional<z.ZodString>;
|
|
122
|
+
}, z.core.$strip>>>;
|
|
123
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
notifications: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
125
|
+
type: z.ZodOptional<z.ZodLiteral<"webhook">>;
|
|
126
|
+
url: z.ZodString;
|
|
127
|
+
max_retries: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
events: z.ZodArray<z.ZodEnum<{
|
|
129
|
+
error: "error";
|
|
130
|
+
started: "started";
|
|
131
|
+
cancelled: "cancelled";
|
|
132
|
+
completed: "completed";
|
|
133
|
+
progress: "progress";
|
|
134
|
+
}>>;
|
|
135
|
+
}, z.core.$strip>>>;
|
|
136
|
+
}, z.core.$strip>]>;
|
|
137
|
+
export type RunDurableOptions = z.infer<typeof RunDurableSchema> | (Omit<z.infer<typeof RunDurableSchemaDeprecated>, "source_files"> & {
|
|
138
|
+
/** @deprecated Use `sourceFiles` instead. */
|
|
139
|
+
source_files: z.infer<typeof RunDurableSchemaDeprecated>["source_files"];
|
|
140
|
+
});
|
|
29
141
|
export declare const RunDurableResponseSchema: z.ZodObject<{
|
|
30
142
|
id: z.ZodString;
|
|
31
143
|
status: z.ZodLiteral<"initialized">;
|
|
@@ -33,4 +145,5 @@ export declare const RunDurableResponseSchema: z.ZodObject<{
|
|
|
33
145
|
created_at: z.ZodString;
|
|
34
146
|
}, z.core.$strip>;
|
|
35
147
|
export type RunDurableResponse = z.infer<typeof RunDurableResponseSchema>;
|
|
148
|
+
export {};
|
|
36
149
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/runDurable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/runDurable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0FxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUzB,CAAC;AAGL,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEF,CAAC;AAG/B,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEF,CAAC;AAEnC,MAAM,MAAM,iBAAiB,GACzB,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GAChC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,EAAE,cAAc,CAAC,GAAG;IAClE,6CAA6C;IAC7C,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC,cAAc,CAAC,CAAC;CAC1E,CAAC,CAAC;AAEP,eAAO,MAAM,wBAAwB;;;;;iBAanC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
// `.min(1)` on implementation_name at the input boundary. The shared schema
|
|
4
|
-
// is response-side and intentionally looser.
|
|
5
|
-
const ConnectionMapEntrySchema = z.object({
|
|
6
|
-
connection_id: z
|
|
7
|
-
.union([
|
|
8
|
-
z.string().regex(/^[1-9][0-9]*$/, "must be a positive integer string"),
|
|
9
|
-
z.string().uuid("must be a UUID"),
|
|
10
|
-
z.number().int().positive(),
|
|
11
|
-
])
|
|
12
|
-
.describe("Zapier connection ID. Accepts a positive integer (legacy) or a UUID string (newer connections)."),
|
|
13
|
-
});
|
|
14
|
-
const AppVersionMapEntrySchema = z.object({
|
|
15
|
-
implementation_name: z
|
|
16
|
-
.string()
|
|
17
|
-
.min(1)
|
|
18
|
-
.describe("Zapier app implementation name (e.g. `SlackCLIAPI`)"),
|
|
19
|
-
version: z
|
|
20
|
-
.string()
|
|
21
|
-
.optional()
|
|
22
|
-
.describe("Pinned app version (e.g. `1.27.1`). Latest if omitted."),
|
|
23
|
-
});
|
|
2
|
+
import { AppVersionBindingSchema, ConnectionBindingSchema, SourceFilesSchema, } from "../shared";
|
|
24
3
|
const RunNotificationEventSchema = z
|
|
25
4
|
.enum(["started", "progress", "completed", "error", "cancelled"])
|
|
26
5
|
.describe("Run lifecycle event this notification subscribes to");
|
|
@@ -47,31 +26,33 @@ const RunNotificationSchema = z
|
|
|
47
26
|
.describe("One or more lifecycle events to subscribe this URL to."),
|
|
48
27
|
})
|
|
49
28
|
.describe("Webhook subscriber for run lifecycle events. Server POSTs `{run_id, event}` on each subscribed transition.");
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.record(z.string(), z.string())
|
|
54
|
-
.refine((files) => Object.keys(files).length > 0, {
|
|
55
|
-
message: "source_files must contain at least one file",
|
|
56
|
-
})
|
|
57
|
-
.describe("Source files keyed by filename → contents"),
|
|
29
|
+
// Shared, non-renamed properties. Lives in its own object so the canonical
|
|
30
|
+
// and deprecated `sourceFiles` variants can merge it without repetition.
|
|
31
|
+
const RunDurableBaseSchema = z.object({
|
|
58
32
|
input: z.unknown().optional().describe("Input data passed to the run"),
|
|
59
33
|
dependencies: z
|
|
60
34
|
.record(z.string(), z.string())
|
|
61
35
|
.optional()
|
|
62
36
|
.describe("Optional npm package dependencies"),
|
|
63
|
-
|
|
37
|
+
zapierDurableVersion: z
|
|
64
38
|
.string()
|
|
65
39
|
.optional()
|
|
66
40
|
.describe('Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted.'),
|
|
41
|
+
/** @deprecated Use `zapierDurableVersion` instead. */
|
|
42
|
+
zapier_durable_version: z.string().optional().meta({ deprecated: true }),
|
|
67
43
|
connections: z
|
|
68
|
-
.record(z.string(),
|
|
44
|
+
.record(z.string(), ConnectionBindingSchema)
|
|
69
45
|
.optional()
|
|
70
|
-
.describe('Named connection aliases. Maps each alias to an object holding its Zapier connection ID, e.g. `{ "slack": { "
|
|
71
|
-
|
|
72
|
-
.record(z.string(),
|
|
46
|
+
.describe('Named connection aliases. Maps each alias to an object holding its Zapier connection ID, e.g. `{ "slack": { "connectionId": "123" } }`.'),
|
|
47
|
+
appVersions: z
|
|
48
|
+
.record(z.string(), AppVersionBindingSchema)
|
|
73
49
|
.optional()
|
|
74
50
|
.describe("Pinned app versions. Maps app keys (slugs) to implementation names and versions."),
|
|
51
|
+
/** @deprecated Use `appVersions` instead. */
|
|
52
|
+
app_versions: z
|
|
53
|
+
.record(z.string(), AppVersionBindingSchema)
|
|
54
|
+
.optional()
|
|
55
|
+
.meta({ deprecated: true }),
|
|
75
56
|
private: z
|
|
76
57
|
.boolean()
|
|
77
58
|
.optional()
|
|
@@ -80,8 +61,28 @@ export const RunDurableOptionsSchema = z
|
|
|
80
61
|
.array(RunNotificationSchema)
|
|
81
62
|
.optional()
|
|
82
63
|
.describe("Webhook subscribers for run lifecycle events. Each entry specifies a URL and the events it subscribes to."),
|
|
83
|
-
})
|
|
84
|
-
|
|
64
|
+
});
|
|
65
|
+
const RunDurableDescription = "Run a workflow source file as a run-once durable run on sdkdurableapi (no deployed workflow required). Returns the run ID immediately; poll via getDurableRun for terminal status.";
|
|
66
|
+
// Canonical schema (new names only) — drives docs, CLI help, and the registry.
|
|
67
|
+
export const RunDurableSchema = z
|
|
68
|
+
.object({ sourceFiles: SourceFilesSchema })
|
|
69
|
+
.merge(RunDurableBaseSchema)
|
|
70
|
+
.describe(RunDurableDescription)
|
|
71
|
+
.meta({
|
|
72
|
+
aliases: {
|
|
73
|
+
source_files: "sourceFiles",
|
|
74
|
+
zapier_durable_version: "zapierDurableVersion",
|
|
75
|
+
app_versions: "appVersions",
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
// Deprecated schema (backward compat) — keeps the old `source_files` name valid.
|
|
79
|
+
const RunDurableSchemaDeprecated = z
|
|
80
|
+
.object({ source_files: SourceFilesSchema })
|
|
81
|
+
.merge(RunDurableBaseSchema);
|
|
82
|
+
// Union for runtime validation: accepts either the canonical or the old name.
|
|
83
|
+
export const RunDurableOptionsSchema = z
|
|
84
|
+
.union([RunDurableSchema, RunDurableSchemaDeprecated])
|
|
85
|
+
.describe(RunDurableDescription);
|
|
85
86
|
export const RunDurableResponseSchema = z.object({
|
|
86
87
|
id: z.string().describe("Run ID (UUID) — server-generated, time-sortable"),
|
|
87
88
|
status: z
|