@zapier/zapier-sdk 0.72.0 → 0.73.1
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 +9 -0
- package/dist/api/types.d.ts +5 -4
- package/dist/api/types.d.ts.map +1 -1
- package/dist/experimental.cjs +175 -65
- 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 +175 -65
- package/dist/{index-B43uST61.d.mts → index-D1O7Pcex.d.mts} +5 -4
- package/dist/{index-B43uST61.d.ts → index-D1O7Pcex.d.ts} +5 -4
- package/dist/index.cjs +10 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +10 -1
- 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/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.73.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6c7627c: CamelCase the input params on `runDurable` and `publishWorkflowVersion` (`sourceFiles`, `zapierDurableVersion`, `appVersions`, and the nested connection / app-version / trigger fields), keeping the old snake_case names as deprecated aliases. Handlers map them back to the snake_case wire body; output fields are unchanged.
|
|
8
|
+
|
|
9
|
+
## 0.73.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- f963a9d: Emit the standard `zapier-sdk-version`, `zapier-sdk-package`, `zapier-sdk-package-version`, and `zapier-service` telemetry headers (per the Zapier API header guidance) alongside the existing `x-zapier-*` headers. The legacy `x-zapier-*` headers continue to be sent for backward compatibility.
|
|
14
|
+
|
|
3
15
|
## 0.72.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1658,21 +1658,21 @@ Publish a new version of a durable workflow. Enables the workflow by default.
|
|
|
1658
1658
|
|
|
1659
1659
|
**Parameters:**
|
|
1660
1660
|
|
|
1661
|
-
| Name
|
|
1662
|
-
|
|
|
1663
|
-
| `options`
|
|
1664
|
-
| ↳ `workflow`
|
|
1665
|
-
| ↳ `
|
|
1666
|
-
| ↳ `dependencies`
|
|
1667
|
-
| ↳ `
|
|
1668
|
-
| ↳ `enabled`
|
|
1669
|
-
| ↳ `connections`
|
|
1670
|
-
| ↳ `
|
|
1671
|
-
| ↳ `trigger`
|
|
1672
|
-
| ↳ `
|
|
1673
|
-
| ↳ `action`
|
|
1674
|
-
| ↳ `
|
|
1675
|
-
| ↳ `params`
|
|
1661
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1662
|
+
| -------------------------- | --------- | -------- | ------- | --------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
1663
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1664
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1665
|
+
| ↳ `sourceFiles` | `object` | ✅ | — | — | Source files keyed by filename → contents |
|
|
1666
|
+
| ↳ `dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
|
|
1667
|
+
| ↳ `zapierDurableVersion` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted. |
|
|
1668
|
+
| ↳ `enabled` | `boolean` | ❌ | — | — | Enable the workflow after publishing. Defaults to true; pass false to publish without enabling. |
|
|
1669
|
+
| ↳ `connections` | `object` | ❌ | — | — | Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding. |
|
|
1670
|
+
| ↳ `appVersions` | `object` | ❌ | — | — | Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding. |
|
|
1671
|
+
| ↳ `trigger` | `object` | ❌ | — | — | Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; omit for webhook-only workflows. |
|
|
1672
|
+
| ↳ `selectedApi` | `string` | ❌ | — | — | Zapier app/API identifier (e.g. 'GoogleSheetsAPI'). Required when a trigger is configured. |
|
|
1673
|
+
| ↳ `action` | `string` | ✅ | — | — | Trigger action key (e.g. 'new_row') |
|
|
1674
|
+
| ↳ `authenticationId` | `string` | ❌ | — | — | Connection ID for the trigger source. Omit or pass null for no-auth triggers (e.g. Schedule by Zapier). |
|
|
1675
|
+
| ↳ `params` | `object` | ❌ | — | — | Trigger parameters as a JSON object |
|
|
1676
1676
|
|
|
1677
1677
|
**Returns:** `Promise<WorkflowVersionItem>`
|
|
1678
1678
|
|
|
@@ -1695,7 +1695,7 @@ Publish a new version of a durable workflow. Enables the workflow by default.
|
|
|
1695
1695
|
```typescript
|
|
1696
1696
|
const result = await zapier.publishWorkflowVersion({
|
|
1697
1697
|
workflow: "example-workflow",
|
|
1698
|
-
|
|
1698
|
+
sourceFiles: {},
|
|
1699
1699
|
});
|
|
1700
1700
|
```
|
|
1701
1701
|
|
|
@@ -1705,21 +1705,21 @@ Run a workflow source file as a run-once durable run on sdkdurableapi (no deploy
|
|
|
1705
1705
|
|
|
1706
1706
|
**Parameters:**
|
|
1707
1707
|
|
|
1708
|
-
| Name
|
|
1709
|
-
|
|
|
1710
|
-
| `options`
|
|
1711
|
-
| ↳ `
|
|
1712
|
-
| ↳ `input`
|
|
1713
|
-
| ↳ `dependencies`
|
|
1714
|
-
| ↳ `
|
|
1715
|
-
| ↳ `connections`
|
|
1716
|
-
| ↳ `
|
|
1717
|
-
| ↳ `private`
|
|
1718
|
-
| ↳ `notifications[]`
|
|
1719
|
-
| ↳ `type`
|
|
1720
|
-
| ↳ `url`
|
|
1721
|
-
| ↳ `max_retries`
|
|
1722
|
-
| ↳ `events`
|
|
1708
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1709
|
+
| -------------------------- | ---------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1710
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1711
|
+
| ↳ `sourceFiles` | `object` | ✅ | — | — | Source files keyed by filename → contents |
|
|
1712
|
+
| ↳ `input` | `unknown` | ❌ | — | — | Input data passed to the run |
|
|
1713
|
+
| ↳ `dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
|
|
1714
|
+
| ↳ `zapierDurableVersion` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted. |
|
|
1715
|
+
| ↳ `connections` | `object` | ❌ | — | — | Named connection aliases. Maps each alias to an object holding its Zapier connection ID, e.g. `{ "slack": { "connectionId": "123" } }`. |
|
|
1716
|
+
| ↳ `appVersions` | `object` | ❌ | — | — | Pinned app versions. Maps app keys (slugs) to implementation names and versions. |
|
|
1717
|
+
| ↳ `private` | `boolean` | ❌ | — | — | Only the creating user can see the run (default false) |
|
|
1718
|
+
| ↳ `notifications[]` | `object[]` | ❌ | — | — | Webhook subscribers for run lifecycle events. Each entry specifies a URL and the events it subscribes to. |
|
|
1719
|
+
| ↳ `type` | `string` | ❌ | — | `webhook` | Notification transport. Webhook is the only supported type. |
|
|
1720
|
+
| ↳ `url` | `string` | ✅ | — | — | URL to POST event notifications to. Payload is `{run_id, event}`. |
|
|
1721
|
+
| ↳ `max_retries` | `number` | ❌ | — | — | Max delivery attempts with exponential backoff. Defaults to 3 server-side. |
|
|
1722
|
+
| ↳ `events` | `array` | ✅ | — | — | One or more lifecycle events to subscribe this URL to. |
|
|
1723
1723
|
|
|
1724
1724
|
**Returns:** `Promise<DurableRunItem>`
|
|
1725
1725
|
|
|
@@ -1735,7 +1735,7 @@ Run a workflow source file as a run-once durable run on sdkdurableapi (no deploy
|
|
|
1735
1735
|
|
|
1736
1736
|
```typescript
|
|
1737
1737
|
const result = await zapier.runDurable({
|
|
1738
|
-
|
|
1738
|
+
sourceFiles: {},
|
|
1739
1739
|
});
|
|
1740
1740
|
```
|
|
1741
1741
|
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAIjB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAIjB,MAAM,SAAS,CAAC;AAokDjB,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,SAW3D,CAAC"}
|
package/dist/api/client.js
CHANGED
|
@@ -752,15 +752,24 @@ class ZapierApiClient {
|
|
|
752
752
|
// Applied at the outbound layer (after caller-supplied header merging) so
|
|
753
753
|
// they always reflect the SDK's actual identity and can't be spoofed via
|
|
754
754
|
// options.headers.
|
|
755
|
+
//
|
|
756
|
+
// We emit both the standard `zapier-*` names (per the API header guidance the
|
|
757
|
+
// gateway now expects) and the legacy `x-zapier-*` names. The legacy names are
|
|
758
|
+
// kept for backward compatibility with consumers that haven't migrated yet;
|
|
759
|
+
// they can be removed once nothing reads them.
|
|
755
760
|
applyTelemetryHeaders(headers) {
|
|
761
|
+
headers.set("zapier-sdk-version", SDK_VERSION);
|
|
756
762
|
headers.set("x-zapier-sdk-version", SDK_VERSION);
|
|
757
763
|
const sdkService = getZapierSdkService();
|
|
758
764
|
if (sdkService) {
|
|
765
|
+
headers.set("zapier-service", sdkService);
|
|
759
766
|
headers.set("x-zapier-service", sdkService);
|
|
760
767
|
}
|
|
761
768
|
const callerPackage = this.options.callerPackage;
|
|
762
769
|
if (callerPackage) {
|
|
770
|
+
headers.set("zapier-sdk-package", callerPackage.name);
|
|
763
771
|
headers.set("x-zapier-sdk-package", callerPackage.name);
|
|
772
|
+
headers.set("zapier-sdk-package-version", callerPackage.version);
|
|
764
773
|
headers.set("x-zapier-sdk-package-version", callerPackage.version);
|
|
765
774
|
}
|
|
766
775
|
}
|
package/dist/api/types.d.ts
CHANGED
|
@@ -82,10 +82,11 @@ export interface ApiClientOptions {
|
|
|
82
82
|
maxApprovalRetries?: number;
|
|
83
83
|
/**
|
|
84
84
|
* Identifies the wrapping package that built this client (e.g., the CLI or
|
|
85
|
-
* MCP server). When set, emitted as `
|
|
86
|
-
* `
|
|
87
|
-
* `
|
|
88
|
-
* `
|
|
85
|
+
* MCP server). When set, emitted as `zapier-sdk-package` /
|
|
86
|
+
* `zapier-sdk-package-version` telemetry headers (plus the legacy
|
|
87
|
+
* `x-zapier-sdk-package` / `x-zapier-sdk-package-version` for backward
|
|
88
|
+
* compatibility). Omitted by direct `createZapierSdk` callers — their
|
|
89
|
+
* identity is captured by `zapier-sdk-version` alone.
|
|
89
90
|
*/
|
|
90
91
|
callerPackage?: {
|
|
91
92
|
name: string;
|
package/dist/api/types.d.ts.map
CHANGED
|
@@ -1 +1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|
|
3289
3289
|
// src/sdk-version.ts
|
|
3290
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
3290
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.73.1" : void 0) || "unknown";
|
|
3291
3291
|
|
|
3292
3292
|
// src/utils/open-url.ts
|
|
3293
3293
|
var nodePrefix = "node:";
|
|
@@ -3992,15 +3992,24 @@ var ZapierApiClient = class {
|
|
|
3992
3992
|
// Applied at the outbound layer (after caller-supplied header merging) so
|
|
3993
3993
|
// they always reflect the SDK's actual identity and can't be spoofed via
|
|
3994
3994
|
// options.headers.
|
|
3995
|
+
//
|
|
3996
|
+
// We emit both the standard `zapier-*` names (per the API header guidance the
|
|
3997
|
+
// gateway now expects) and the legacy `x-zapier-*` names. The legacy names are
|
|
3998
|
+
// kept for backward compatibility with consumers that haven't migrated yet;
|
|
3999
|
+
// they can be removed once nothing reads them.
|
|
3995
4000
|
applyTelemetryHeaders(headers) {
|
|
4001
|
+
headers.set("zapier-sdk-version", SDK_VERSION);
|
|
3996
4002
|
headers.set("x-zapier-sdk-version", SDK_VERSION);
|
|
3997
4003
|
const sdkService = getZapierSdkService();
|
|
3998
4004
|
if (sdkService) {
|
|
4005
|
+
headers.set("zapier-service", sdkService);
|
|
3999
4006
|
headers.set("x-zapier-service", sdkService);
|
|
4000
4007
|
}
|
|
4001
4008
|
const callerPackage = this.options.callerPackage;
|
|
4002
4009
|
if (callerPackage) {
|
|
4010
|
+
headers.set("zapier-sdk-package", callerPackage.name);
|
|
4003
4011
|
headers.set("x-zapier-sdk-package", callerPackage.name);
|
|
4012
|
+
headers.set("zapier-sdk-package-version", callerPackage.version);
|
|
4004
4013
|
headers.set("x-zapier-sdk-package-version", callerPackage.version);
|
|
4005
4014
|
}
|
|
4006
4015
|
}
|
|
@@ -11747,13 +11756,62 @@ var getTriggerInputFieldsSchemaPlugin = definePlugin(
|
|
|
11747
11756
|
}
|
|
11748
11757
|
})
|
|
11749
11758
|
);
|
|
11750
|
-
|
|
11751
|
-
// src/plugins/codeSubstrate/shared.ts
|
|
11752
11759
|
var codeSubstrateDefaults = {
|
|
11753
11760
|
categories: ["code-workflow"],
|
|
11754
11761
|
experimental: true
|
|
11755
11762
|
};
|
|
11763
|
+
var SourceFilesSchema = zod.z.record(zod.z.string(), zod.z.string()).refine((files) => Object.keys(files).length > 0, {
|
|
11764
|
+
message: "sourceFiles must contain at least one file"
|
|
11765
|
+
}).describe("Source files keyed by filename \u2192 contents");
|
|
11766
|
+
var UUID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
11767
|
+
var ConnectionIdValueSchema = zod.z.union([
|
|
11768
|
+
zod.z.string().regex(/^[1-9][0-9]*$/, "must be a positive integer string"),
|
|
11769
|
+
zod.z.string().regex(UUID_PATTERN, "must be a UUID"),
|
|
11770
|
+
zod.z.number().int().positive()
|
|
11771
|
+
]).describe(
|
|
11772
|
+
"Zapier connection ID. Accepts a positive integer (legacy) or a UUID string (newer connections)."
|
|
11773
|
+
);
|
|
11756
11774
|
var ConnectionBindingSchema = zod.z.object({
|
|
11775
|
+
connectionId: ConnectionIdValueSchema.optional(),
|
|
11776
|
+
/** @deprecated Use `connectionId` instead. */
|
|
11777
|
+
connection_id: ConnectionIdValueSchema.optional().meta({ deprecated: true })
|
|
11778
|
+
});
|
|
11779
|
+
var AppVersionBindingSchema = zod.z.object({
|
|
11780
|
+
implementationName: zod.z.string().min(1).optional().describe("Zapier app implementation name (e.g. `SlackCLIAPI`)"),
|
|
11781
|
+
/** @deprecated Use `implementationName` instead. */
|
|
11782
|
+
implementation_name: zod.z.string().min(1).optional().meta({ deprecated: true }),
|
|
11783
|
+
version: zod.z.string().optional().describe("Pinned app version (e.g. `1.27.1`). Latest if omitted.")
|
|
11784
|
+
});
|
|
11785
|
+
function toWireConnections(connections) {
|
|
11786
|
+
const wire = {};
|
|
11787
|
+
for (const [alias, entry] of Object.entries(connections)) {
|
|
11788
|
+
const connectionId = entry.connectionId ?? entry.connection_id;
|
|
11789
|
+
if (connectionId === void 0) {
|
|
11790
|
+
throw new ZapierValidationError(
|
|
11791
|
+
`connections["${alias}"] is missing connectionId`
|
|
11792
|
+
);
|
|
11793
|
+
}
|
|
11794
|
+
wire[alias] = { connection_id: connectionId };
|
|
11795
|
+
}
|
|
11796
|
+
return wire;
|
|
11797
|
+
}
|
|
11798
|
+
function toWireAppVersions(appVersions) {
|
|
11799
|
+
const wire = {};
|
|
11800
|
+
for (const [key, entry] of Object.entries(appVersions)) {
|
|
11801
|
+
const implementationName = entry.implementationName ?? entry.implementation_name;
|
|
11802
|
+
if (implementationName === void 0) {
|
|
11803
|
+
throw new ZapierValidationError(
|
|
11804
|
+
`appVersions["${key}"] is missing implementationName`
|
|
11805
|
+
);
|
|
11806
|
+
}
|
|
11807
|
+
wire[key] = {
|
|
11808
|
+
implementation_name: implementationName,
|
|
11809
|
+
...entry.version !== void 0 ? { version: entry.version } : {}
|
|
11810
|
+
};
|
|
11811
|
+
}
|
|
11812
|
+
return wire;
|
|
11813
|
+
}
|
|
11814
|
+
var ConnectionBindingSchema2 = zod.z.object({
|
|
11757
11815
|
connection_id: zod.z.union([
|
|
11758
11816
|
zod.z.number().int().positive(),
|
|
11759
11817
|
zod.z.string().regex(/^[1-9][0-9]*$/, "must be a positive integer string"),
|
|
@@ -11764,7 +11822,7 @@ var ConnectionBindingSchema = zod.z.object({
|
|
|
11764
11822
|
}).describe(
|
|
11765
11823
|
"Connection binding: maps a single alias to a concrete connection."
|
|
11766
11824
|
);
|
|
11767
|
-
var
|
|
11825
|
+
var AppVersionBindingSchema2 = zod.z.object({
|
|
11768
11826
|
implementation_name: zod.z.string().describe("App implementation identifier (e.g. 'SlackCLIAPI')"),
|
|
11769
11827
|
version: zod.z.string().optional().describe("App implementation version (e.g. '1.27.1')")
|
|
11770
11828
|
}).describe("App-version binding: maps a single alias to an app version.");
|
|
@@ -11882,8 +11940,8 @@ var WorkflowVersionSchema = zod.z.object({
|
|
|
11882
11940
|
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
11883
11941
|
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
11884
11942
|
),
|
|
11885
|
-
connections: zod.z.record(zod.z.string(),
|
|
11886
|
-
app_versions: zod.z.record(zod.z.string(),
|
|
11943
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
11944
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
11887
11945
|
});
|
|
11888
11946
|
var GetWorkflowOptionsSchema = zod.z.object({
|
|
11889
11947
|
workflow: zod.z.string().uuid().describe("Durable workflow ID")
|
|
@@ -12334,19 +12392,6 @@ var getDurableRunPlugin = definePlugin(
|
|
|
12334
12392
|
}
|
|
12335
12393
|
})
|
|
12336
12394
|
);
|
|
12337
|
-
var ConnectionMapEntrySchema = zod.z.object({
|
|
12338
|
-
connection_id: zod.z.union([
|
|
12339
|
-
zod.z.string().regex(/^[1-9][0-9]*$/, "must be a positive integer string"),
|
|
12340
|
-
zod.z.string().uuid("must be a UUID"),
|
|
12341
|
-
zod.z.number().int().positive()
|
|
12342
|
-
]).describe(
|
|
12343
|
-
"Zapier connection ID. Accepts a positive integer (legacy) or a UUID string (newer connections)."
|
|
12344
|
-
)
|
|
12345
|
-
});
|
|
12346
|
-
var AppVersionMapEntrySchema = zod.z.object({
|
|
12347
|
-
implementation_name: zod.z.string().min(1).describe("Zapier app implementation name (e.g. `SlackCLIAPI`)"),
|
|
12348
|
-
version: zod.z.string().optional().describe("Pinned app version (e.g. `1.27.1`). Latest if omitted.")
|
|
12349
|
-
});
|
|
12350
12395
|
var RunNotificationEventSchema = zod.z.enum(["started", "progress", "completed", "error", "cancelled"]).describe("Run lifecycle event this notification subscribes to");
|
|
12351
12396
|
var RunNotificationSchema = zod.z.object({
|
|
12352
12397
|
type: zod.z.literal("webhook").optional().describe("Notification transport. Webhook is the only supported type."),
|
|
@@ -12360,28 +12405,37 @@ var RunNotificationSchema = zod.z.object({
|
|
|
12360
12405
|
}).describe(
|
|
12361
12406
|
"Webhook subscriber for run lifecycle events. Server POSTs `{run_id, event}` on each subscribed transition."
|
|
12362
12407
|
);
|
|
12363
|
-
var
|
|
12364
|
-
source_files: zod.z.record(zod.z.string(), zod.z.string()).refine((files) => Object.keys(files).length > 0, {
|
|
12365
|
-
message: "source_files must contain at least one file"
|
|
12366
|
-
}).describe("Source files keyed by filename \u2192 contents"),
|
|
12408
|
+
var RunDurableBaseSchema = zod.z.object({
|
|
12367
12409
|
input: zod.z.unknown().optional().describe("Input data passed to the run"),
|
|
12368
12410
|
dependencies: zod.z.record(zod.z.string(), zod.z.string()).optional().describe("Optional npm package dependencies"),
|
|
12369
|
-
|
|
12411
|
+
zapierDurableVersion: zod.z.string().optional().describe(
|
|
12370
12412
|
'Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted.'
|
|
12371
12413
|
),
|
|
12372
|
-
|
|
12373
|
-
|
|
12414
|
+
/** @deprecated Use `zapierDurableVersion` instead. */
|
|
12415
|
+
zapier_durable_version: zod.z.string().optional().meta({ deprecated: true }),
|
|
12416
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema).optional().describe(
|
|
12417
|
+
'Named connection aliases. Maps each alias to an object holding its Zapier connection ID, e.g. `{ "slack": { "connectionId": "123" } }`.'
|
|
12374
12418
|
),
|
|
12375
|
-
|
|
12419
|
+
appVersions: zod.z.record(zod.z.string(), AppVersionBindingSchema).optional().describe(
|
|
12376
12420
|
"Pinned app versions. Maps app keys (slugs) to implementation names and versions."
|
|
12377
12421
|
),
|
|
12422
|
+
/** @deprecated Use `appVersions` instead. */
|
|
12423
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema).optional().meta({ deprecated: true }),
|
|
12378
12424
|
private: zod.z.boolean().optional().describe("Only the creating user can see the run (default false)"),
|
|
12379
12425
|
notifications: zod.z.array(RunNotificationSchema).optional().describe(
|
|
12380
12426
|
"Webhook subscribers for run lifecycle events. Each entry specifies a URL and the events it subscribes to."
|
|
12381
12427
|
)
|
|
12382
|
-
})
|
|
12383
|
-
|
|
12384
|
-
)
|
|
12428
|
+
});
|
|
12429
|
+
var 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.";
|
|
12430
|
+
var RunDurableSchema = zod.z.object({ sourceFiles: SourceFilesSchema }).merge(RunDurableBaseSchema).describe(RunDurableDescription).meta({
|
|
12431
|
+
aliases: {
|
|
12432
|
+
source_files: "sourceFiles",
|
|
12433
|
+
zapier_durable_version: "zapierDurableVersion",
|
|
12434
|
+
app_versions: "appVersions"
|
|
12435
|
+
}
|
|
12436
|
+
});
|
|
12437
|
+
var RunDurableSchemaDeprecated = zod.z.object({ source_files: SourceFilesSchema }).merge(RunDurableBaseSchema);
|
|
12438
|
+
var RunDurableOptionsSchema = zod.z.union([RunDurableSchema, RunDurableSchemaDeprecated]).describe(RunDurableDescription);
|
|
12385
12439
|
var RunDurableResponseSchema = zod.z.object({
|
|
12386
12440
|
id: zod.z.string().describe("Run ID (UUID) \u2014 server-generated, time-sortable"),
|
|
12387
12441
|
status: zod.z.literal("initialized").describe(
|
|
@@ -12403,23 +12457,24 @@ var runDurablePlugin = definePlugin(
|
|
|
12403
12457
|
inputSchema: RunDurableOptionsSchema,
|
|
12404
12458
|
outputSchema: RunDurableResponseSchema,
|
|
12405
12459
|
handler: async ({ sdk: sdk2, options }) => {
|
|
12406
|
-
const
|
|
12407
|
-
|
|
12408
|
-
|
|
12460
|
+
const sourceFiles = "sourceFiles" in options ? options.sourceFiles : options.source_files;
|
|
12461
|
+
const zapierDurableVersion = options.zapierDurableVersion ?? options.zapier_durable_version;
|
|
12462
|
+
const appVersions = options.appVersions ?? options.app_versions;
|
|
12463
|
+
const body = { source_files: sourceFiles };
|
|
12409
12464
|
if (options.input !== void 0) {
|
|
12410
12465
|
body.input = options.input;
|
|
12411
12466
|
}
|
|
12412
12467
|
if (options.dependencies !== void 0) {
|
|
12413
12468
|
body.dependencies = options.dependencies;
|
|
12414
12469
|
}
|
|
12415
|
-
if (
|
|
12416
|
-
body.zapier_durable_version =
|
|
12470
|
+
if (zapierDurableVersion !== void 0) {
|
|
12471
|
+
body.zapier_durable_version = zapierDurableVersion;
|
|
12417
12472
|
}
|
|
12418
12473
|
if (options.connections !== void 0) {
|
|
12419
|
-
body.connections = options.connections;
|
|
12474
|
+
body.connections = toWireConnections(options.connections);
|
|
12420
12475
|
}
|
|
12421
|
-
if (
|
|
12422
|
-
body.app_versions =
|
|
12476
|
+
if (appVersions !== void 0) {
|
|
12477
|
+
body.app_versions = toWireAppVersions(appVersions);
|
|
12423
12478
|
}
|
|
12424
12479
|
if (options.private !== void 0) {
|
|
12425
12480
|
body.is_private = options.private;
|
|
@@ -12474,30 +12529,61 @@ var cancelDurableRunPlugin = definePlugin(
|
|
|
12474
12529
|
}
|
|
12475
12530
|
})
|
|
12476
12531
|
);
|
|
12477
|
-
var
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12532
|
+
var TriggerConfigSchema = zod.z.object({
|
|
12533
|
+
selectedApi: zod.z.string().optional().describe(
|
|
12534
|
+
"Zapier app/API identifier (e.g. 'GoogleSheetsAPI'). Required when a trigger is configured."
|
|
12535
|
+
),
|
|
12536
|
+
/** @deprecated Use `selectedApi` instead. */
|
|
12537
|
+
selected_api: zod.z.string().optional().meta({ deprecated: true }),
|
|
12538
|
+
action: zod.z.string().describe("Trigger action key (e.g. 'new_row')"),
|
|
12539
|
+
authenticationId: zod.z.string().nullish().describe(
|
|
12540
|
+
"Connection ID for the trigger source. Omit or pass null for no-auth triggers (e.g. Schedule by Zapier)."
|
|
12541
|
+
),
|
|
12542
|
+
/** @deprecated Use `authenticationId` instead. */
|
|
12543
|
+
authentication_id: zod.z.string().nullish().meta({ deprecated: true }),
|
|
12544
|
+
params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Trigger parameters as a JSON object")
|
|
12545
|
+
}).describe(
|
|
12546
|
+
"Zapier trigger configuration. When set, the workflow subscribes to trigger events."
|
|
12547
|
+
);
|
|
12548
|
+
var PublishWorkflowVersionDescription = "Publish a new version of a durable workflow. Enables the workflow by default.";
|
|
12549
|
+
var PublishWorkflowVersionBaseSchema = zod.z.object({
|
|
12482
12550
|
dependencies: zod.z.record(zod.z.string(), zod.z.string()).optional().describe("Optional npm package dependencies"),
|
|
12483
|
-
|
|
12551
|
+
zapierDurableVersion: zod.z.string().optional().describe(
|
|
12484
12552
|
'Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted.'
|
|
12485
12553
|
),
|
|
12554
|
+
/** @deprecated Use `zapierDurableVersion` instead. */
|
|
12555
|
+
zapier_durable_version: zod.z.string().optional().meta({ deprecated: true }),
|
|
12486
12556
|
enabled: zod.z.boolean().optional().describe(
|
|
12487
12557
|
"Enable the workflow after publishing. Defaults to true; pass false to publish without enabling."
|
|
12488
12558
|
),
|
|
12489
12559
|
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema).nullish().describe(
|
|
12490
12560
|
"Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding."
|
|
12491
12561
|
),
|
|
12492
|
-
|
|
12562
|
+
appVersions: zod.z.record(zod.z.string(), AppVersionBindingSchema).nullish().describe(
|
|
12493
12563
|
"Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding."
|
|
12494
12564
|
),
|
|
12495
|
-
|
|
12565
|
+
/** @deprecated Use `appVersions` instead. */
|
|
12566
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema).nullish().meta({ deprecated: true }),
|
|
12567
|
+
trigger: TriggerConfigSchema.optional().describe(
|
|
12496
12568
|
"Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; omit for webhook-only workflows."
|
|
12497
12569
|
)
|
|
12498
|
-
})
|
|
12499
|
-
|
|
12500
|
-
|
|
12570
|
+
});
|
|
12571
|
+
var WorkflowPropertySchema = zod.z.string().uuid().describe("Durable workflow ID");
|
|
12572
|
+
var PublishWorkflowVersionSchema = zod.z.object({
|
|
12573
|
+
workflow: WorkflowPropertySchema,
|
|
12574
|
+
sourceFiles: SourceFilesSchema
|
|
12575
|
+
}).merge(PublishWorkflowVersionBaseSchema).describe(PublishWorkflowVersionDescription).meta({
|
|
12576
|
+
aliases: {
|
|
12577
|
+
source_files: "sourceFiles",
|
|
12578
|
+
zapier_durable_version: "zapierDurableVersion",
|
|
12579
|
+
app_versions: "appVersions"
|
|
12580
|
+
}
|
|
12581
|
+
});
|
|
12582
|
+
var PublishWorkflowVersionSchemaDeprecated = zod.z.object({
|
|
12583
|
+
workflow: WorkflowPropertySchema,
|
|
12584
|
+
source_files: SourceFilesSchema
|
|
12585
|
+
}).merge(PublishWorkflowVersionBaseSchema);
|
|
12586
|
+
var PublishWorkflowVersionOptionsSchema = zod.z.union([PublishWorkflowVersionSchema, PublishWorkflowVersionSchemaDeprecated]).describe(PublishWorkflowVersionDescription);
|
|
12501
12587
|
var PublishWorkflowVersionResponseSchema = zod.z.object({
|
|
12502
12588
|
id: zod.z.string().describe("Workflow version ID (UUID)"),
|
|
12503
12589
|
workflow_id: zod.z.string().describe("Parent workflow ID (UUID)"),
|
|
@@ -12511,11 +12597,30 @@ var PublishWorkflowVersionResponseSchema = zod.z.object({
|
|
|
12511
12597
|
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
12512
12598
|
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
12513
12599
|
),
|
|
12514
|
-
connections: zod.z.record(zod.z.string(),
|
|
12515
|
-
app_versions: zod.z.record(zod.z.string(),
|
|
12600
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
12601
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
12516
12602
|
});
|
|
12517
12603
|
|
|
12518
12604
|
// src/plugins/codeSubstrate/publishWorkflowVersion/index.ts
|
|
12605
|
+
function toWireTrigger(trigger) {
|
|
12606
|
+
const selectedApi = trigger.selectedApi ?? trigger.selected_api;
|
|
12607
|
+
if (selectedApi === void 0) {
|
|
12608
|
+
throw new ZapierValidationError("trigger is missing selectedApi");
|
|
12609
|
+
}
|
|
12610
|
+
const wire = {
|
|
12611
|
+
selected_api: selectedApi,
|
|
12612
|
+
action: trigger.action
|
|
12613
|
+
};
|
|
12614
|
+
if ("authenticationId" in trigger) {
|
|
12615
|
+
wire.authentication_id = trigger.authenticationId;
|
|
12616
|
+
} else if ("authentication_id" in trigger) {
|
|
12617
|
+
wire.authentication_id = trigger.authentication_id;
|
|
12618
|
+
}
|
|
12619
|
+
if (trigger.params !== void 0) {
|
|
12620
|
+
wire.params = trigger.params;
|
|
12621
|
+
}
|
|
12622
|
+
return wire;
|
|
12623
|
+
}
|
|
12519
12624
|
var publishWorkflowVersionPlugin = definePlugin(
|
|
12520
12625
|
(sdk) => createPluginMethod(sdk, {
|
|
12521
12626
|
...codeSubstrateDefaults,
|
|
@@ -12526,26 +12631,31 @@ var publishWorkflowVersionPlugin = definePlugin(
|
|
|
12526
12631
|
outputSchema: PublishWorkflowVersionResponseSchema,
|
|
12527
12632
|
resolvers: { workflow: workflowIdResolver },
|
|
12528
12633
|
handler: async ({ sdk: sdk2, options }) => {
|
|
12529
|
-
const
|
|
12530
|
-
|
|
12531
|
-
|
|
12634
|
+
const sourceFiles = "sourceFiles" in options ? options.sourceFiles : options.source_files;
|
|
12635
|
+
const zapierDurableVersion = options.zapierDurableVersion ?? options.zapier_durable_version;
|
|
12636
|
+
const appVersions = "appVersions" in options ? options.appVersions : options.app_versions;
|
|
12637
|
+
const body = { source_files: sourceFiles };
|
|
12532
12638
|
if (options.dependencies !== void 0) {
|
|
12533
12639
|
body.dependencies = options.dependencies;
|
|
12534
12640
|
}
|
|
12535
|
-
if (
|
|
12536
|
-
body.zapier_durable_version =
|
|
12641
|
+
if (zapierDurableVersion !== void 0) {
|
|
12642
|
+
body.zapier_durable_version = zapierDurableVersion;
|
|
12537
12643
|
}
|
|
12538
12644
|
if (options.enabled !== void 0) {
|
|
12539
12645
|
body.enabled = options.enabled;
|
|
12540
12646
|
}
|
|
12541
|
-
if (options.connections
|
|
12542
|
-
body.connections =
|
|
12647
|
+
if (options.connections === null) {
|
|
12648
|
+
body.connections = null;
|
|
12649
|
+
} else if (options.connections !== void 0) {
|
|
12650
|
+
body.connections = toWireConnections(options.connections);
|
|
12543
12651
|
}
|
|
12544
|
-
if (
|
|
12545
|
-
body.app_versions =
|
|
12652
|
+
if (appVersions === null) {
|
|
12653
|
+
body.app_versions = null;
|
|
12654
|
+
} else if (appVersions !== void 0) {
|
|
12655
|
+
body.app_versions = toWireAppVersions(appVersions);
|
|
12546
12656
|
}
|
|
12547
12657
|
if (options.trigger !== void 0) {
|
|
12548
|
-
body.trigger = options.trigger;
|
|
12658
|
+
body.trigger = toWireTrigger(options.trigger);
|
|
12549
12659
|
}
|
|
12550
12660
|
const raw = await sdk2.context.api.post(
|
|
12551
12661
|
`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}/versions`,
|
|
@@ -12572,8 +12682,8 @@ var WorkflowVersionListItemSchema = zod.z.object({
|
|
|
12572
12682
|
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
12573
12683
|
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
12574
12684
|
),
|
|
12575
|
-
connections: zod.z.record(zod.z.string(),
|
|
12576
|
-
app_versions: zod.z.record(zod.z.string(),
|
|
12685
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
12686
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
12577
12687
|
});
|
|
12578
12688
|
var ListWorkflowVersionsOptionsSchema = zod.z.object({
|
|
12579
12689
|
workflow: zod.z.string().uuid().describe("Durable workflow ID"),
|
|
@@ -12645,8 +12755,8 @@ var GetWorkflowVersionResponseSchema = zod.z.object({
|
|
|
12645
12755
|
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
12646
12756
|
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
12647
12757
|
),
|
|
12648
|
-
connections: zod.z.record(zod.z.string(),
|
|
12649
|
-
app_versions: zod.z.record(zod.z.string(),
|
|
12758
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
12759
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
12650
12760
|
});
|
|
12651
12761
|
|
|
12652
12762
|
// src/plugins/codeSubstrate/getWorkflowVersion/index.ts
|