@zapier/zapier-sdk 0.83.3 → 0.84.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 +6 -0
- package/README.md +4 -4
- package/dist/experimental.cjs +45 -27
- package/dist/experimental.mjs +45 -27
- package/dist/index.cjs +13 -1
- package/dist/index.mjs +13 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.84.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e1896a3: Code Substrate methods now use the `/code-substrate-runner` and `/code-substrate-workflows` API path prefixes across the SDK, the CLI, and the MCP server, and `sdk.context.api` and the CLI `curl` command accept paths built on them. The previous `/sdkdurableapi` and `/durableworkflowzaps` prefixes remain supported.
|
|
8
|
+
|
|
3
9
|
## 0.83.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1300,7 +1300,7 @@ Get the workflow run associated with a deployed workflow's trigger. Useful immed
|
|
|
1300
1300
|
| ------------------------- | --------- | -------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
1301
1301
|
| `data` | `object` | ✅ | — | |
|
|
1302
1302
|
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1303
|
-
| ↳ `durable_run_id` | `string` | ✅ | — | Linked
|
|
1303
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked code-substrate-runner run ID. Null until the durable run is created. |
|
|
1304
1304
|
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to |
|
|
1305
1305
|
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1306
1306
|
| ↳ `input` | `unknown` | ✅ | — | Input passed to the run |
|
|
@@ -1390,7 +1390,7 @@ Get the current state of a workflow run (a triggered execution of a deployed wor
|
|
|
1390
1390
|
| `data` | `object` | ✅ | — | |
|
|
1391
1391
|
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1392
1392
|
| ↳ `trigger_id` | `string` | ✅ | — | ID of the trigger that fired this run, if any |
|
|
1393
|
-
| ↳ `durable_run_id` | `string` | ✅ | — | Linked
|
|
1393
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked code-substrate-runner run ID. Null until the durable run is created. |
|
|
1394
1394
|
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to |
|
|
1395
1395
|
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1396
1396
|
| ↳ `input` | `unknown` | ✅ | — | Input passed to the run |
|
|
@@ -1511,7 +1511,7 @@ List workflow runs (triggered executions) for a specific deployed workflow, newe
|
|
|
1511
1511
|
| `data[]` | `object[]` | ✅ | — | |
|
|
1512
1512
|
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1513
1513
|
| ↳ `trigger_id` | `string` | ✅ | — | ID of the trigger that fired this run, if any. Null for runs created without a trigger. |
|
|
1514
|
-
| ↳ `durable_run_id` | `string` | ✅ | — | Linked
|
|
1514
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked code-substrate-runner run ID. Null until the durable run is created. |
|
|
1515
1515
|
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to. Null in rare edge cases. |
|
|
1516
1516
|
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1517
1517
|
| ↳ `input` | `unknown` | ✅ | — | Input passed to the run |
|
|
@@ -1706,7 +1706,7 @@ const { data: workflowVersion } = await zapier.publishWorkflowVersion({
|
|
|
1706
1706
|
|
|
1707
1707
|
#### `runDurable` 🧪 _experimental_
|
|
1708
1708
|
|
|
1709
|
-
Run a workflow source file as a run-once durable run on
|
|
1709
|
+
Run a workflow source file as a run-once durable run on code-substrate-runner (no deployed workflow required). Returns the run ID immediately; poll via getDurableRun for terminal status.
|
|
1710
1710
|
|
|
1711
1711
|
**Parameters:**
|
|
1712
1712
|
|
package/dist/experimental.cjs
CHANGED
|
@@ -5198,7 +5198,7 @@ function parseDeprecationDate(value) {
|
|
|
5198
5198
|
}
|
|
5199
5199
|
|
|
5200
5200
|
// src/sdk-version.ts
|
|
5201
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
5201
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.0" : void 0) || "unknown";
|
|
5202
5202
|
|
|
5203
5203
|
// src/utils/open-url.ts
|
|
5204
5204
|
var nodePrefix = "node:";
|
|
@@ -5416,6 +5416,18 @@ var pathConfig = {
|
|
|
5416
5416
|
"/durableworkflowzaps": {
|
|
5417
5417
|
authHeader: "Authorization",
|
|
5418
5418
|
pathPrefix: "/api/v0/sdk/durableworkflowzaps"
|
|
5419
|
+
},
|
|
5420
|
+
// e.g. /code-substrate-runner -> https://sdkapi.zapier.com/api/v0/sdk/code-substrate-runner/...
|
|
5421
|
+
// sdkapi proxies to the code-substrate-runner backend.
|
|
5422
|
+
"/code-substrate-runner": {
|
|
5423
|
+
authHeader: "Authorization",
|
|
5424
|
+
pathPrefix: "/api/v0/sdk/code-substrate-runner"
|
|
5425
|
+
},
|
|
5426
|
+
// e.g. /code-substrate-workflows -> https://sdkapi.zapier.com/api/v0/sdk/code-substrate-workflows/...
|
|
5427
|
+
// sdkapi proxies to the code-substrate-workflows backend.
|
|
5428
|
+
"/code-substrate-workflows": {
|
|
5429
|
+
authHeader: "Authorization",
|
|
5430
|
+
pathPrefix: "/api/v0/sdk/code-substrate-workflows"
|
|
5419
5431
|
}
|
|
5420
5432
|
};
|
|
5421
5433
|
var ZapierApiClient = class {
|
|
@@ -14675,6 +14687,8 @@ var codeSubstrateDefaults = {
|
|
|
14675
14687
|
categories: ["code-workflow"],
|
|
14676
14688
|
experimental: true
|
|
14677
14689
|
};
|
|
14690
|
+
var CODE_SUBSTRATE_RUNNER_API = "/code-substrate-runner/api/v0";
|
|
14691
|
+
var CODE_SUBSTRATE_WORKFLOWS_API = "/code-substrate-workflows/api/v0";
|
|
14678
14692
|
var JsonPayloadSchema = zod.z.preprocess((val) => {
|
|
14679
14693
|
if (typeof val === "string") {
|
|
14680
14694
|
const trimmed = val.trim();
|
|
@@ -14867,7 +14881,7 @@ var listWorkflowsPlugin = defineMethod({
|
|
|
14867
14881
|
if (input.cursor) {
|
|
14868
14882
|
searchParams.cursor = input.cursor;
|
|
14869
14883
|
}
|
|
14870
|
-
const raw = await api.get(
|
|
14884
|
+
const raw = await api.get(`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows`, {
|
|
14871
14885
|
searchParams,
|
|
14872
14886
|
authRequired: true
|
|
14873
14887
|
});
|
|
@@ -14886,7 +14900,7 @@ var WorkflowVersionSchema = zod.z.object({
|
|
|
14886
14900
|
"Pinned semver of @zapier/zapier-durable used by this version's runs"
|
|
14887
14901
|
),
|
|
14888
14902
|
dependencies: zod.z.record(zod.z.string(), zod.z.string()).nullable().describe("Additional npm dependencies pinned for this version (or null)"),
|
|
14889
|
-
// Backend column is NOT NULL (see
|
|
14903
|
+
// Backend column is NOT NULL (see code-substrate-workflows prisma schema:
|
|
14890
14904
|
// workflow_versions.created_by_user_id), so this is always emitted.
|
|
14891
14905
|
created_by_user_id: zod.z.string().describe("ID of the user who published this version"),
|
|
14892
14906
|
created_at: zod.z.string().describe("When the version was published (ISO-8601)"),
|
|
@@ -14940,7 +14954,7 @@ var getWorkflowPlugin = defineMethod({
|
|
|
14940
14954
|
run: async ({ imports, input }) => {
|
|
14941
14955
|
const api = imports.api;
|
|
14942
14956
|
const raw = await api.get(
|
|
14943
|
-
|
|
14957
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}`,
|
|
14944
14958
|
{
|
|
14945
14959
|
authRequired: true,
|
|
14946
14960
|
resource: { type: "workflow", id: input.workflow }
|
|
@@ -14997,9 +15011,13 @@ var createWorkflowPlugin = defineMethod({
|
|
|
14997
15011
|
if (isPrivate !== void 0) {
|
|
14998
15012
|
body.is_private = isPrivate;
|
|
14999
15013
|
}
|
|
15000
|
-
const raw = await api.post(
|
|
15001
|
-
|
|
15002
|
-
|
|
15014
|
+
const raw = await api.post(
|
|
15015
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows`,
|
|
15016
|
+
body,
|
|
15017
|
+
{
|
|
15018
|
+
authRequired: true
|
|
15019
|
+
}
|
|
15020
|
+
);
|
|
15003
15021
|
return CreateWorkflowResponseSchema.parse(raw);
|
|
15004
15022
|
}
|
|
15005
15023
|
});
|
|
@@ -15045,7 +15063,7 @@ var updateWorkflowPlugin = defineMethod({
|
|
|
15045
15063
|
body.description = input.description;
|
|
15046
15064
|
}
|
|
15047
15065
|
const raw = await api.patch(
|
|
15048
|
-
|
|
15066
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}`,
|
|
15049
15067
|
body,
|
|
15050
15068
|
{
|
|
15051
15069
|
authRequired: true,
|
|
@@ -15077,7 +15095,7 @@ var enableWorkflowPlugin = defineMethod({
|
|
|
15077
15095
|
run: async ({ imports, input }) => {
|
|
15078
15096
|
const api = imports.api;
|
|
15079
15097
|
const raw = await api.post(
|
|
15080
|
-
|
|
15098
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/enable`,
|
|
15081
15099
|
void 0,
|
|
15082
15100
|
{
|
|
15083
15101
|
authRequired: true,
|
|
@@ -15111,7 +15129,7 @@ var disableWorkflowPlugin = defineMethod({
|
|
|
15111
15129
|
run: async ({ imports, input }) => {
|
|
15112
15130
|
const api = imports.api;
|
|
15113
15131
|
const raw = await api.post(
|
|
15114
|
-
|
|
15132
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/disable`,
|
|
15115
15133
|
void 0,
|
|
15116
15134
|
{
|
|
15117
15135
|
authRequired: true,
|
|
@@ -15145,7 +15163,7 @@ var deleteWorkflowPlugin = defineMethod({
|
|
|
15145
15163
|
run: async ({ imports, input }) => {
|
|
15146
15164
|
const api = imports.api;
|
|
15147
15165
|
await api.delete(
|
|
15148
|
-
|
|
15166
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}`,
|
|
15149
15167
|
void 0,
|
|
15150
15168
|
{
|
|
15151
15169
|
authRequired: true,
|
|
@@ -15222,7 +15240,7 @@ var listDurableRunsPlugin = defineMethod({
|
|
|
15222
15240
|
if (input.cursor) {
|
|
15223
15241
|
searchParams.cursor = input.cursor;
|
|
15224
15242
|
}
|
|
15225
|
-
const raw = await api.get(
|
|
15243
|
+
const raw = await api.get(`${CODE_SUBSTRATE_RUNNER_API}/runs`, {
|
|
15226
15244
|
searchParams,
|
|
15227
15245
|
authRequired: true
|
|
15228
15246
|
});
|
|
@@ -15335,7 +15353,7 @@ var getDurableRunPlugin = defineMethod({
|
|
|
15335
15353
|
run: async ({ imports, input }) => {
|
|
15336
15354
|
const api = imports.api;
|
|
15337
15355
|
const raw = await api.get(
|
|
15338
|
-
|
|
15356
|
+
`${CODE_SUBSTRATE_RUNNER_API}/runs/${encodeURIComponent(input.run)}`,
|
|
15339
15357
|
{
|
|
15340
15358
|
authRequired: true,
|
|
15341
15359
|
resource: { type: "run", id: input.run }
|
|
@@ -15380,7 +15398,7 @@ var RunDurableBaseSchema = zod.z.object({
|
|
|
15380
15398
|
"Webhook subscribers for run lifecycle events. Each entry specifies a URL and the events it subscribes to."
|
|
15381
15399
|
)
|
|
15382
15400
|
});
|
|
15383
|
-
var RunDurableDescription = "Run a workflow source file as a run-once durable run on
|
|
15401
|
+
var RunDurableDescription = "Run a workflow source file as a run-once durable run on code-substrate-runner (no deployed workflow required). Returns the run ID immediately; poll via getDurableRun for terminal status.";
|
|
15384
15402
|
var RunDurableSchema = zod.z.object({ sourceFiles: SourceFilesSchema }).merge(RunDurableBaseSchema).describe(RunDurableDescription).meta({
|
|
15385
15403
|
aliases: {
|
|
15386
15404
|
source_files: "sourceFiles",
|
|
@@ -15438,7 +15456,7 @@ var runDurablePlugin = defineMethod({
|
|
|
15438
15456
|
if (input.notifications !== void 0) {
|
|
15439
15457
|
body.notifications = input.notifications;
|
|
15440
15458
|
}
|
|
15441
|
-
const raw = await api.post(
|
|
15459
|
+
const raw = await api.post(`${CODE_SUBSTRATE_RUNNER_API}/runs`, body, {
|
|
15442
15460
|
authRequired: true
|
|
15443
15461
|
});
|
|
15444
15462
|
return RunDurableResponseSchema.parse(raw);
|
|
@@ -15470,7 +15488,7 @@ var cancelDurableRunPlugin = defineMethod({
|
|
|
15470
15488
|
run: async ({ imports, input }) => {
|
|
15471
15489
|
const api = imports.api;
|
|
15472
15490
|
await api.post(
|
|
15473
|
-
|
|
15491
|
+
`${CODE_SUBSTRATE_RUNNER_API}/runs/${encodeURIComponent(input.run)}/cancel`,
|
|
15474
15492
|
void 0,
|
|
15475
15493
|
{
|
|
15476
15494
|
authRequired: true,
|
|
@@ -15611,7 +15629,7 @@ var publishWorkflowVersionPlugin = defineMethod({
|
|
|
15611
15629
|
body.trigger = toWireTrigger(input.trigger);
|
|
15612
15630
|
}
|
|
15613
15631
|
const raw = await api.post(
|
|
15614
|
-
|
|
15632
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/versions`,
|
|
15615
15633
|
body,
|
|
15616
15634
|
{
|
|
15617
15635
|
authRequired: true,
|
|
@@ -15677,7 +15695,7 @@ var listWorkflowVersionsPlugin = defineMethod({
|
|
|
15677
15695
|
searchParams.cursor = input.cursor;
|
|
15678
15696
|
}
|
|
15679
15697
|
const raw = await api.get(
|
|
15680
|
-
|
|
15698
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/versions`,
|
|
15681
15699
|
{
|
|
15682
15700
|
searchParams,
|
|
15683
15701
|
authRequired: true,
|
|
@@ -15728,7 +15746,7 @@ var getWorkflowVersionPlugin = defineMethod({
|
|
|
15728
15746
|
run: async ({ imports, input }) => {
|
|
15729
15747
|
const api = imports.api;
|
|
15730
15748
|
const raw = await api.get(
|
|
15731
|
-
|
|
15749
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/versions/${encodeURIComponent(input.version)}`,
|
|
15732
15750
|
{
|
|
15733
15751
|
authRequired: true,
|
|
15734
15752
|
resource: { type: "workflow-version", id: input.version }
|
|
@@ -15749,7 +15767,7 @@ var WorkflowRunListItemSchema = zod.z.object({
|
|
|
15749
15767
|
"ID of the trigger that fired this run, if any. Null for runs created without a trigger."
|
|
15750
15768
|
),
|
|
15751
15769
|
durable_run_id: zod.z.string().nullable().describe(
|
|
15752
|
-
"Linked
|
|
15770
|
+
"Linked code-substrate-runner run ID. Null until the durable run is created."
|
|
15753
15771
|
),
|
|
15754
15772
|
workflow_version_id: zod.z.string().nullable().describe("Workflow version the run is bound to. Null in rare edge cases."),
|
|
15755
15773
|
status: WorkflowRunStatusSchema,
|
|
@@ -15805,7 +15823,7 @@ var listWorkflowRunsPlugin = defineMethod({
|
|
|
15805
15823
|
searchParams.cursor = input.cursor;
|
|
15806
15824
|
}
|
|
15807
15825
|
const raw = await api.get(
|
|
15808
|
-
|
|
15826
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/runs`,
|
|
15809
15827
|
{
|
|
15810
15828
|
searchParams,
|
|
15811
15829
|
authRequired: true,
|
|
@@ -15835,7 +15853,7 @@ var GetWorkflowRunResponseSchema = zod.z.object({
|
|
|
15835
15853
|
id: zod.z.string().describe("Workflow run ID (UUID)"),
|
|
15836
15854
|
trigger_id: zod.z.string().nullable().describe("ID of the trigger that fired this run, if any"),
|
|
15837
15855
|
durable_run_id: zod.z.string().nullable().describe(
|
|
15838
|
-
"Linked
|
|
15856
|
+
"Linked code-substrate-runner run ID. Null until the durable run is created."
|
|
15839
15857
|
),
|
|
15840
15858
|
workflow_version_id: zod.z.string().nullable().describe("Workflow version the run is bound to"),
|
|
15841
15859
|
status: WorkflowRunStatusSchema,
|
|
@@ -15862,7 +15880,7 @@ var getWorkflowRunPlugin = defineMethod({
|
|
|
15862
15880
|
run: async ({ imports, input }) => {
|
|
15863
15881
|
const api = imports.api;
|
|
15864
15882
|
const raw = await api.get(
|
|
15865
|
-
|
|
15883
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/runs/${encodeURIComponent(input.run)}`,
|
|
15866
15884
|
{
|
|
15867
15885
|
authRequired: true,
|
|
15868
15886
|
resource: { type: "workflow-run", id: input.run }
|
|
@@ -15879,7 +15897,7 @@ var GetTriggerRunOptionsSchema = zod.z.object({
|
|
|
15879
15897
|
var GetTriggerRunResponseSchema = zod.z.object({
|
|
15880
15898
|
id: zod.z.string().describe("Workflow run ID (UUID)"),
|
|
15881
15899
|
durable_run_id: zod.z.string().nullable().describe(
|
|
15882
|
-
"Linked
|
|
15900
|
+
"Linked code-substrate-runner run ID. Null until the durable run is created."
|
|
15883
15901
|
),
|
|
15884
15902
|
workflow_version_id: zod.z.string().nullable().describe("Workflow version the run is bound to"),
|
|
15885
15903
|
status: WorkflowRunStatusSchema,
|
|
@@ -15906,7 +15924,7 @@ var getTriggerRunPlugin = defineMethod({
|
|
|
15906
15924
|
run: async ({ imports, input }) => {
|
|
15907
15925
|
const api = imports.api;
|
|
15908
15926
|
const raw = await api.get(
|
|
15909
|
-
|
|
15927
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/triggers/${encodeURIComponent(input.trigger)}/run`,
|
|
15910
15928
|
{
|
|
15911
15929
|
authRequired: true,
|
|
15912
15930
|
resource: { type: "workflow-trigger", id: input.trigger }
|
|
@@ -15946,7 +15964,7 @@ var triggerWorkflowPlugin = defineMethod({
|
|
|
15946
15964
|
run: async ({ imports, input }) => {
|
|
15947
15965
|
const api = imports.api;
|
|
15948
15966
|
const rawWorkflow = await api.get(
|
|
15949
|
-
|
|
15967
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}`,
|
|
15950
15968
|
{
|
|
15951
15969
|
authRequired: true,
|
|
15952
15970
|
resource: { type: "workflow", id: input.workflow }
|
|
@@ -15962,7 +15980,7 @@ var triggerWorkflowPlugin = defineMethod({
|
|
|
15962
15980
|
);
|
|
15963
15981
|
}
|
|
15964
15982
|
const raw = await api.post(
|
|
15965
|
-
|
|
15983
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/trigger/${encodeURIComponent(triggerToken)}`,
|
|
15966
15984
|
input.input,
|
|
15967
15985
|
{
|
|
15968
15986
|
authRequired: true,
|
package/dist/experimental.mjs
CHANGED
|
@@ -5196,7 +5196,7 @@ function parseDeprecationDate(value) {
|
|
|
5196
5196
|
}
|
|
5197
5197
|
|
|
5198
5198
|
// src/sdk-version.ts
|
|
5199
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
5199
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.0" : void 0) || "unknown";
|
|
5200
5200
|
|
|
5201
5201
|
// src/utils/open-url.ts
|
|
5202
5202
|
var nodePrefix = "node:";
|
|
@@ -5414,6 +5414,18 @@ var pathConfig = {
|
|
|
5414
5414
|
"/durableworkflowzaps": {
|
|
5415
5415
|
authHeader: "Authorization",
|
|
5416
5416
|
pathPrefix: "/api/v0/sdk/durableworkflowzaps"
|
|
5417
|
+
},
|
|
5418
|
+
// e.g. /code-substrate-runner -> https://sdkapi.zapier.com/api/v0/sdk/code-substrate-runner/...
|
|
5419
|
+
// sdkapi proxies to the code-substrate-runner backend.
|
|
5420
|
+
"/code-substrate-runner": {
|
|
5421
|
+
authHeader: "Authorization",
|
|
5422
|
+
pathPrefix: "/api/v0/sdk/code-substrate-runner"
|
|
5423
|
+
},
|
|
5424
|
+
// e.g. /code-substrate-workflows -> https://sdkapi.zapier.com/api/v0/sdk/code-substrate-workflows/...
|
|
5425
|
+
// sdkapi proxies to the code-substrate-workflows backend.
|
|
5426
|
+
"/code-substrate-workflows": {
|
|
5427
|
+
authHeader: "Authorization",
|
|
5428
|
+
pathPrefix: "/api/v0/sdk/code-substrate-workflows"
|
|
5417
5429
|
}
|
|
5418
5430
|
};
|
|
5419
5431
|
var ZapierApiClient = class {
|
|
@@ -14673,6 +14685,8 @@ var codeSubstrateDefaults = {
|
|
|
14673
14685
|
categories: ["code-workflow"],
|
|
14674
14686
|
experimental: true
|
|
14675
14687
|
};
|
|
14688
|
+
var CODE_SUBSTRATE_RUNNER_API = "/code-substrate-runner/api/v0";
|
|
14689
|
+
var CODE_SUBSTRATE_WORKFLOWS_API = "/code-substrate-workflows/api/v0";
|
|
14676
14690
|
var JsonPayloadSchema = z.preprocess((val) => {
|
|
14677
14691
|
if (typeof val === "string") {
|
|
14678
14692
|
const trimmed = val.trim();
|
|
@@ -14865,7 +14879,7 @@ var listWorkflowsPlugin = defineMethod({
|
|
|
14865
14879
|
if (input.cursor) {
|
|
14866
14880
|
searchParams.cursor = input.cursor;
|
|
14867
14881
|
}
|
|
14868
|
-
const raw = await api.get(
|
|
14882
|
+
const raw = await api.get(`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows`, {
|
|
14869
14883
|
searchParams,
|
|
14870
14884
|
authRequired: true
|
|
14871
14885
|
});
|
|
@@ -14884,7 +14898,7 @@ var WorkflowVersionSchema = z.object({
|
|
|
14884
14898
|
"Pinned semver of @zapier/zapier-durable used by this version's runs"
|
|
14885
14899
|
),
|
|
14886
14900
|
dependencies: z.record(z.string(), z.string()).nullable().describe("Additional npm dependencies pinned for this version (or null)"),
|
|
14887
|
-
// Backend column is NOT NULL (see
|
|
14901
|
+
// Backend column is NOT NULL (see code-substrate-workflows prisma schema:
|
|
14888
14902
|
// workflow_versions.created_by_user_id), so this is always emitted.
|
|
14889
14903
|
created_by_user_id: z.string().describe("ID of the user who published this version"),
|
|
14890
14904
|
created_at: z.string().describe("When the version was published (ISO-8601)"),
|
|
@@ -14938,7 +14952,7 @@ var getWorkflowPlugin = defineMethod({
|
|
|
14938
14952
|
run: async ({ imports, input }) => {
|
|
14939
14953
|
const api = imports.api;
|
|
14940
14954
|
const raw = await api.get(
|
|
14941
|
-
|
|
14955
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}`,
|
|
14942
14956
|
{
|
|
14943
14957
|
authRequired: true,
|
|
14944
14958
|
resource: { type: "workflow", id: input.workflow }
|
|
@@ -14995,9 +15009,13 @@ var createWorkflowPlugin = defineMethod({
|
|
|
14995
15009
|
if (isPrivate !== void 0) {
|
|
14996
15010
|
body.is_private = isPrivate;
|
|
14997
15011
|
}
|
|
14998
|
-
const raw = await api.post(
|
|
14999
|
-
|
|
15000
|
-
|
|
15012
|
+
const raw = await api.post(
|
|
15013
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows`,
|
|
15014
|
+
body,
|
|
15015
|
+
{
|
|
15016
|
+
authRequired: true
|
|
15017
|
+
}
|
|
15018
|
+
);
|
|
15001
15019
|
return CreateWorkflowResponseSchema.parse(raw);
|
|
15002
15020
|
}
|
|
15003
15021
|
});
|
|
@@ -15043,7 +15061,7 @@ var updateWorkflowPlugin = defineMethod({
|
|
|
15043
15061
|
body.description = input.description;
|
|
15044
15062
|
}
|
|
15045
15063
|
const raw = await api.patch(
|
|
15046
|
-
|
|
15064
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}`,
|
|
15047
15065
|
body,
|
|
15048
15066
|
{
|
|
15049
15067
|
authRequired: true,
|
|
@@ -15075,7 +15093,7 @@ var enableWorkflowPlugin = defineMethod({
|
|
|
15075
15093
|
run: async ({ imports, input }) => {
|
|
15076
15094
|
const api = imports.api;
|
|
15077
15095
|
const raw = await api.post(
|
|
15078
|
-
|
|
15096
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/enable`,
|
|
15079
15097
|
void 0,
|
|
15080
15098
|
{
|
|
15081
15099
|
authRequired: true,
|
|
@@ -15109,7 +15127,7 @@ var disableWorkflowPlugin = defineMethod({
|
|
|
15109
15127
|
run: async ({ imports, input }) => {
|
|
15110
15128
|
const api = imports.api;
|
|
15111
15129
|
const raw = await api.post(
|
|
15112
|
-
|
|
15130
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/disable`,
|
|
15113
15131
|
void 0,
|
|
15114
15132
|
{
|
|
15115
15133
|
authRequired: true,
|
|
@@ -15143,7 +15161,7 @@ var deleteWorkflowPlugin = defineMethod({
|
|
|
15143
15161
|
run: async ({ imports, input }) => {
|
|
15144
15162
|
const api = imports.api;
|
|
15145
15163
|
await api.delete(
|
|
15146
|
-
|
|
15164
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}`,
|
|
15147
15165
|
void 0,
|
|
15148
15166
|
{
|
|
15149
15167
|
authRequired: true,
|
|
@@ -15220,7 +15238,7 @@ var listDurableRunsPlugin = defineMethod({
|
|
|
15220
15238
|
if (input.cursor) {
|
|
15221
15239
|
searchParams.cursor = input.cursor;
|
|
15222
15240
|
}
|
|
15223
|
-
const raw = await api.get(
|
|
15241
|
+
const raw = await api.get(`${CODE_SUBSTRATE_RUNNER_API}/runs`, {
|
|
15224
15242
|
searchParams,
|
|
15225
15243
|
authRequired: true
|
|
15226
15244
|
});
|
|
@@ -15333,7 +15351,7 @@ var getDurableRunPlugin = defineMethod({
|
|
|
15333
15351
|
run: async ({ imports, input }) => {
|
|
15334
15352
|
const api = imports.api;
|
|
15335
15353
|
const raw = await api.get(
|
|
15336
|
-
|
|
15354
|
+
`${CODE_SUBSTRATE_RUNNER_API}/runs/${encodeURIComponent(input.run)}`,
|
|
15337
15355
|
{
|
|
15338
15356
|
authRequired: true,
|
|
15339
15357
|
resource: { type: "run", id: input.run }
|
|
@@ -15378,7 +15396,7 @@ var RunDurableBaseSchema = z.object({
|
|
|
15378
15396
|
"Webhook subscribers for run lifecycle events. Each entry specifies a URL and the events it subscribes to."
|
|
15379
15397
|
)
|
|
15380
15398
|
});
|
|
15381
|
-
var RunDurableDescription = "Run a workflow source file as a run-once durable run on
|
|
15399
|
+
var RunDurableDescription = "Run a workflow source file as a run-once durable run on code-substrate-runner (no deployed workflow required). Returns the run ID immediately; poll via getDurableRun for terminal status.";
|
|
15382
15400
|
var RunDurableSchema = z.object({ sourceFiles: SourceFilesSchema }).merge(RunDurableBaseSchema).describe(RunDurableDescription).meta({
|
|
15383
15401
|
aliases: {
|
|
15384
15402
|
source_files: "sourceFiles",
|
|
@@ -15436,7 +15454,7 @@ var runDurablePlugin = defineMethod({
|
|
|
15436
15454
|
if (input.notifications !== void 0) {
|
|
15437
15455
|
body.notifications = input.notifications;
|
|
15438
15456
|
}
|
|
15439
|
-
const raw = await api.post(
|
|
15457
|
+
const raw = await api.post(`${CODE_SUBSTRATE_RUNNER_API}/runs`, body, {
|
|
15440
15458
|
authRequired: true
|
|
15441
15459
|
});
|
|
15442
15460
|
return RunDurableResponseSchema.parse(raw);
|
|
@@ -15468,7 +15486,7 @@ var cancelDurableRunPlugin = defineMethod({
|
|
|
15468
15486
|
run: async ({ imports, input }) => {
|
|
15469
15487
|
const api = imports.api;
|
|
15470
15488
|
await api.post(
|
|
15471
|
-
|
|
15489
|
+
`${CODE_SUBSTRATE_RUNNER_API}/runs/${encodeURIComponent(input.run)}/cancel`,
|
|
15472
15490
|
void 0,
|
|
15473
15491
|
{
|
|
15474
15492
|
authRequired: true,
|
|
@@ -15609,7 +15627,7 @@ var publishWorkflowVersionPlugin = defineMethod({
|
|
|
15609
15627
|
body.trigger = toWireTrigger(input.trigger);
|
|
15610
15628
|
}
|
|
15611
15629
|
const raw = await api.post(
|
|
15612
|
-
|
|
15630
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/versions`,
|
|
15613
15631
|
body,
|
|
15614
15632
|
{
|
|
15615
15633
|
authRequired: true,
|
|
@@ -15675,7 +15693,7 @@ var listWorkflowVersionsPlugin = defineMethod({
|
|
|
15675
15693
|
searchParams.cursor = input.cursor;
|
|
15676
15694
|
}
|
|
15677
15695
|
const raw = await api.get(
|
|
15678
|
-
|
|
15696
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/versions`,
|
|
15679
15697
|
{
|
|
15680
15698
|
searchParams,
|
|
15681
15699
|
authRequired: true,
|
|
@@ -15726,7 +15744,7 @@ var getWorkflowVersionPlugin = defineMethod({
|
|
|
15726
15744
|
run: async ({ imports, input }) => {
|
|
15727
15745
|
const api = imports.api;
|
|
15728
15746
|
const raw = await api.get(
|
|
15729
|
-
|
|
15747
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/versions/${encodeURIComponent(input.version)}`,
|
|
15730
15748
|
{
|
|
15731
15749
|
authRequired: true,
|
|
15732
15750
|
resource: { type: "workflow-version", id: input.version }
|
|
@@ -15747,7 +15765,7 @@ var WorkflowRunListItemSchema = z.object({
|
|
|
15747
15765
|
"ID of the trigger that fired this run, if any. Null for runs created without a trigger."
|
|
15748
15766
|
),
|
|
15749
15767
|
durable_run_id: z.string().nullable().describe(
|
|
15750
|
-
"Linked
|
|
15768
|
+
"Linked code-substrate-runner run ID. Null until the durable run is created."
|
|
15751
15769
|
),
|
|
15752
15770
|
workflow_version_id: z.string().nullable().describe("Workflow version the run is bound to. Null in rare edge cases."),
|
|
15753
15771
|
status: WorkflowRunStatusSchema,
|
|
@@ -15803,7 +15821,7 @@ var listWorkflowRunsPlugin = defineMethod({
|
|
|
15803
15821
|
searchParams.cursor = input.cursor;
|
|
15804
15822
|
}
|
|
15805
15823
|
const raw = await api.get(
|
|
15806
|
-
|
|
15824
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/runs`,
|
|
15807
15825
|
{
|
|
15808
15826
|
searchParams,
|
|
15809
15827
|
authRequired: true,
|
|
@@ -15833,7 +15851,7 @@ var GetWorkflowRunResponseSchema = z.object({
|
|
|
15833
15851
|
id: z.string().describe("Workflow run ID (UUID)"),
|
|
15834
15852
|
trigger_id: z.string().nullable().describe("ID of the trigger that fired this run, if any"),
|
|
15835
15853
|
durable_run_id: z.string().nullable().describe(
|
|
15836
|
-
"Linked
|
|
15854
|
+
"Linked code-substrate-runner run ID. Null until the durable run is created."
|
|
15837
15855
|
),
|
|
15838
15856
|
workflow_version_id: z.string().nullable().describe("Workflow version the run is bound to"),
|
|
15839
15857
|
status: WorkflowRunStatusSchema,
|
|
@@ -15860,7 +15878,7 @@ var getWorkflowRunPlugin = defineMethod({
|
|
|
15860
15878
|
run: async ({ imports, input }) => {
|
|
15861
15879
|
const api = imports.api;
|
|
15862
15880
|
const raw = await api.get(
|
|
15863
|
-
|
|
15881
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/runs/${encodeURIComponent(input.run)}`,
|
|
15864
15882
|
{
|
|
15865
15883
|
authRequired: true,
|
|
15866
15884
|
resource: { type: "workflow-run", id: input.run }
|
|
@@ -15877,7 +15895,7 @@ var GetTriggerRunOptionsSchema = z.object({
|
|
|
15877
15895
|
var GetTriggerRunResponseSchema = z.object({
|
|
15878
15896
|
id: z.string().describe("Workflow run ID (UUID)"),
|
|
15879
15897
|
durable_run_id: z.string().nullable().describe(
|
|
15880
|
-
"Linked
|
|
15898
|
+
"Linked code-substrate-runner run ID. Null until the durable run is created."
|
|
15881
15899
|
),
|
|
15882
15900
|
workflow_version_id: z.string().nullable().describe("Workflow version the run is bound to"),
|
|
15883
15901
|
status: WorkflowRunStatusSchema,
|
|
@@ -15904,7 +15922,7 @@ var getTriggerRunPlugin = defineMethod({
|
|
|
15904
15922
|
run: async ({ imports, input }) => {
|
|
15905
15923
|
const api = imports.api;
|
|
15906
15924
|
const raw = await api.get(
|
|
15907
|
-
|
|
15925
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/triggers/${encodeURIComponent(input.trigger)}/run`,
|
|
15908
15926
|
{
|
|
15909
15927
|
authRequired: true,
|
|
15910
15928
|
resource: { type: "workflow-trigger", id: input.trigger }
|
|
@@ -15944,7 +15962,7 @@ var triggerWorkflowPlugin = defineMethod({
|
|
|
15944
15962
|
run: async ({ imports, input }) => {
|
|
15945
15963
|
const api = imports.api;
|
|
15946
15964
|
const rawWorkflow = await api.get(
|
|
15947
|
-
|
|
15965
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}`,
|
|
15948
15966
|
{
|
|
15949
15967
|
authRequired: true,
|
|
15950
15968
|
resource: { type: "workflow", id: input.workflow }
|
|
@@ -15960,7 +15978,7 @@ var triggerWorkflowPlugin = defineMethod({
|
|
|
15960
15978
|
);
|
|
15961
15979
|
}
|
|
15962
15980
|
const raw = await api.post(
|
|
15963
|
-
|
|
15981
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/trigger/${encodeURIComponent(triggerToken)}`,
|
|
15964
15982
|
input.input,
|
|
15965
15983
|
{
|
|
15966
15984
|
authRequired: true,
|
package/dist/index.cjs
CHANGED
|
@@ -5344,7 +5344,7 @@ function parseDeprecationDate(value) {
|
|
|
5344
5344
|
}
|
|
5345
5345
|
|
|
5346
5346
|
// src/sdk-version.ts
|
|
5347
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
5347
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.0" : void 0) || "unknown";
|
|
5348
5348
|
|
|
5349
5349
|
// src/utils/open-url.ts
|
|
5350
5350
|
var nodePrefix = "node:";
|
|
@@ -5562,6 +5562,18 @@ var pathConfig = {
|
|
|
5562
5562
|
"/durableworkflowzaps": {
|
|
5563
5563
|
authHeader: "Authorization",
|
|
5564
5564
|
pathPrefix: "/api/v0/sdk/durableworkflowzaps"
|
|
5565
|
+
},
|
|
5566
|
+
// e.g. /code-substrate-runner -> https://sdkapi.zapier.com/api/v0/sdk/code-substrate-runner/...
|
|
5567
|
+
// sdkapi proxies to the code-substrate-runner backend.
|
|
5568
|
+
"/code-substrate-runner": {
|
|
5569
|
+
authHeader: "Authorization",
|
|
5570
|
+
pathPrefix: "/api/v0/sdk/code-substrate-runner"
|
|
5571
|
+
},
|
|
5572
|
+
// e.g. /code-substrate-workflows -> https://sdkapi.zapier.com/api/v0/sdk/code-substrate-workflows/...
|
|
5573
|
+
// sdkapi proxies to the code-substrate-workflows backend.
|
|
5574
|
+
"/code-substrate-workflows": {
|
|
5575
|
+
authHeader: "Authorization",
|
|
5576
|
+
pathPrefix: "/api/v0/sdk/code-substrate-workflows"
|
|
5565
5577
|
}
|
|
5566
5578
|
};
|
|
5567
5579
|
var ZapierApiClient = class {
|
package/dist/index.mjs
CHANGED
|
@@ -5342,7 +5342,7 @@ function parseDeprecationDate(value) {
|
|
|
5342
5342
|
}
|
|
5343
5343
|
|
|
5344
5344
|
// src/sdk-version.ts
|
|
5345
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
5345
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.0" : void 0) || "unknown";
|
|
5346
5346
|
|
|
5347
5347
|
// src/utils/open-url.ts
|
|
5348
5348
|
var nodePrefix = "node:";
|
|
@@ -5560,6 +5560,18 @@ var pathConfig = {
|
|
|
5560
5560
|
"/durableworkflowzaps": {
|
|
5561
5561
|
authHeader: "Authorization",
|
|
5562
5562
|
pathPrefix: "/api/v0/sdk/durableworkflowzaps"
|
|
5563
|
+
},
|
|
5564
|
+
// e.g. /code-substrate-runner -> https://sdkapi.zapier.com/api/v0/sdk/code-substrate-runner/...
|
|
5565
|
+
// sdkapi proxies to the code-substrate-runner backend.
|
|
5566
|
+
"/code-substrate-runner": {
|
|
5567
|
+
authHeader: "Authorization",
|
|
5568
|
+
pathPrefix: "/api/v0/sdk/code-substrate-runner"
|
|
5569
|
+
},
|
|
5570
|
+
// e.g. /code-substrate-workflows -> https://sdkapi.zapier.com/api/v0/sdk/code-substrate-workflows/...
|
|
5571
|
+
// sdkapi proxies to the code-substrate-workflows backend.
|
|
5572
|
+
"/code-substrate-workflows": {
|
|
5573
|
+
authHeader: "Authorization",
|
|
5574
|
+
pathPrefix: "/api/v0/sdk/code-substrate-workflows"
|
|
5563
5575
|
}
|
|
5564
5576
|
};
|
|
5565
5577
|
var ZapierApiClient = class {
|