@zapier/zapier-sdk 0.99.0 → 0.100.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.100.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 22a885c: Added `validateWorkflow` (experimental) to check durable workflow source without publishing it. Pass `sourceFiles` (absolute logical path → TypeScript source) and an optional `entrypointFile`, which defaults to `/workflow.ts`. The response carries an `issues` array that is empty when the source is valid; each issue has a `kind`, a `message`, a `severity` (`error`, `warning`, `info`, or `hint`), an optional `suggestion`, and usually the `source` location it points at. New `kind` values are added over time, so treat an unfamiliar one as a diagnostic rather than an error.
8
+
3
9
  ## 0.99.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -53,6 +53,7 @@
53
53
  - [`triggerWorkflow`](#triggerworkflow--experimental)
54
54
  - [`updateWorkflow`](#updateworkflow--experimental)
55
55
  - [`updateWorkflowDraft`](#updateworkflowdraft--experimental)
56
+ - [`validateWorkflow`](#validateworkflow--experimental)
56
57
  - [Connections](#connections)
57
58
  - [`createConnection`](#createconnection)
58
59
  - [`findFirstConnection`](#findfirstconnection)
@@ -2213,6 +2214,48 @@ const { data: workflowDraft } = await zapier.updateWorkflowDraft({
2213
2214
  });
2214
2215
  ```
2215
2216
 
2217
+ #### `validateWorkflow` 🧪 _experimental_
2218
+
2219
+ Validate durable workflow source without publishing it. Returns source diagnostics; issue kinds are extensible and may be unfamiliar to the client.
2220
+
2221
+ **Parameters:**
2222
+
2223
+ | Name | Type | Required | Default | Possible Values | Description |
2224
+ | -------------------- | -------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------- |
2225
+ | `options` | `object` | ✅ | — | — | |
2226
+ | ​ ↳ `sourceFiles` | `object` | ✅ | — | — | Exact TypeScript sources keyed by absolute logical path. |
2227
+ | ​ ↳ `entrypointFile` | `string` | ❌ | — | — | Absolute logical path of the entry file in sourceFiles. Defaults to /workflow.ts. |
2228
+
2229
+ **Returns:** `Promise<WorkflowValidationItem>`
2230
+
2231
+ | Name | Type | Required | Possible Values | Description |
2232
+ | ---------------------- | ---------- | -------- | ---------------------------------- | ----------------------------------------------------------------------------------- |
2233
+ | `data` | `object` | ✅ | — | |
2234
+ | ​ ↳ `issues[]` | `object[]` | ✅ | — | Source diagnostics, or an empty array when validation passes. |
2235
+ | ​   ↳ `kind` | `string` | ✅ | — | Extensible diagnostic category; clients must accept unfamiliar values. |
2236
+ | ​   ↳ `message` | `string` | ✅ | — | Safe human-readable explanation. |
2237
+ | ​   ↳ `severity` | `string` | ✅ | `error`, `warning`, `info`, `hint` | Diagnostic severity. |
2238
+ | ​   ↳ `suggestion` | `string` | ❌ | — | Actionable fix hint. |
2239
+ | ​   ↳ `source` | `object` | ❌ | — | Affected source location. |
2240
+ | ​     ↳ `file_id` | `string` | ✅ | — | Source file containing the diagnostic. |
2241
+ | ​     ↳ `start_line` | `number` | ✅ | — | Inclusive 1-based start line. |
2242
+ | ​     ↳ `start_column` | `number` | ✅ | — | Inclusive 1-based start column. |
2243
+ | ​     ↳ `end_line` | `number` | ✅ | — | Inclusive 1-based end line. |
2244
+ | ​     ↳ `end_column` | `number` | ✅ | — | Inclusive 1-based end column. |
2245
+ | ​   ↳ `source_excerpt` | `string` | ❌ | — | Source text the diagnostic was raised against, truncated to 240 characters. |
2246
+ | ​   ↳ `syntax_kind` | `string` | ❌ | — | TypeScript AST node kind the diagnostic was raised against (e.g. `CallExpression`). |
2247
+
2248
+ **Example:**
2249
+
2250
+ ```typescript
2251
+ const { data: workflowValidation } = await zapier.validateWorkflow({
2252
+ sourceFiles: {
2253
+ "/workflow.ts":
2254
+ 'import { defineDurable } from "@zapier/zapier-durable"; export default defineDurable("hello-world", async (ctx, input) => { return ctx.step("greet", async () => "Hello, world!"); });',
2255
+ },
2256
+ });
2257
+ ```
2258
+
2216
2259
  ### Connections
2217
2260
 
2218
2261
  #### `createConnection`
@@ -6903,7 +6903,7 @@ function parseDeprecationDate(value) {
6903
6903
  }
6904
6904
 
6905
6905
  // src/sdk-version.ts
6906
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.99.0" : void 0) || "unknown";
6906
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.100.0" : void 0) || "unknown";
6907
6907
 
6908
6908
  // src/utils/open-url.ts
6909
6909
  var nodePrefix = "node:";
@@ -7138,6 +7138,13 @@ var pathConfig = {
7138
7138
  authHeader: "Authorization",
7139
7139
  pathPrefix: "/api/v0/sdk/code-substrate-workflows"
7140
7140
  },
7141
+ // e.g. /code-substrate-analyzer/validations ->
7142
+ // https://api.zapier.com/code-substrate-analyzer/v0/validations
7143
+ "/code-substrate-analyzer": {
7144
+ authHeader: "Authorization",
7145
+ pathPrefix: "/code-substrate-analyzer/v0",
7146
+ subdomain: "api"
7147
+ },
7141
7148
  // e.g. /forms/v0/forms -> https://api.zapier.com/forms/v0/forms
7142
7149
  // The Forms API is registered on the Public API Gateway and has no sdkapi
7143
7150
  // proxy route, so it goes straight to the gateway. Its governance metadata
@@ -6901,7 +6901,7 @@ function parseDeprecationDate(value) {
6901
6901
  }
6902
6902
 
6903
6903
  // src/sdk-version.ts
6904
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.99.0" : void 0) || "unknown";
6904
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.100.0" : void 0) || "unknown";
6905
6905
 
6906
6906
  // src/utils/open-url.ts
6907
6907
  var nodePrefix = "node:";
@@ -7136,6 +7136,13 @@ var pathConfig = {
7136
7136
  authHeader: "Authorization",
7137
7137
  pathPrefix: "/api/v0/sdk/code-substrate-workflows"
7138
7138
  },
7139
+ // e.g. /code-substrate-analyzer/validations ->
7140
+ // https://api.zapier.com/code-substrate-analyzer/v0/validations
7141
+ "/code-substrate-analyzer": {
7142
+ authHeader: "Authorization",
7143
+ pathPrefix: "/code-substrate-analyzer/v0",
7144
+ subdomain: "api"
7145
+ },
7139
7146
  // e.g. /forms/v0/forms -> https://api.zapier.com/forms/v0/forms
7140
7147
  // The Forms API is registered on the Public API Gateway and has no sdkapi
7141
7148
  // proxy route, so it goes straight to the gateway. Its governance metadata