@zapier/zapier-sdk-cli 0.53.1 → 0.54.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,20 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.54.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9f1e934: Switched `watchTriggerInbox` from backoff polling to a Server-Sent Events subscription, so it now wakes on near-real-time inbox notifications instead of repeatedly polling for new messages.
8
+ - The `maxDrainIntervalSeconds` option now controls a periodic safety drain that backstops the SSE stream — guaranteeing forward progress if events are missed or the connection drops — and its default changed from 60 to 300 seconds.
9
+ - Real-time wake-up health is now reported on stderr: a warning when wake-ups pause and the watch falls back to the safety drain, plus transient reconnect notices in debug mode. stdout (including `--json` NDJSON output) is unaffected.
10
+ - Added a `fetchStream` method to the API client, along with an exported `SseMessage` type, for opening Server-Sent Events connections through the standard request pipeline (auth, base URL, 429 retry, approval, and concurrency).
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [9f1e934]
15
+ - @zapier/zapier-sdk@0.69.0
16
+ - @zapier/zapier-sdk-mcp@0.13.24
17
+
3
18
  ## 0.53.1
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -1465,7 +1465,7 @@ npx zapier-sdk update-trigger-inbox <inbox> [--notification-url]
1465
1465
 
1466
1466
  #### `watch-trigger-inbox` 🧪 _experimental_
1467
1467
 
1468
- Continuously consume a trigger inbox: drain currently-available messages via onMessage, then poll with backoff for new arrivals, until aborted. Resolves cleanly on signal abort or ZapierAbortDrainSignal from a handler; rejects on fatal SDK errors or fail-fast handler errors.
1468
+ Continuously consume a trigger inbox: drain currently-available messages via onMessage, then subscribe to SSE notifications for new arrivals until aborted. A periodic safety drain runs every maxDrainIntervalSeconds (default: 300) to guarantee forward progress if SSE events are missed. Resolves cleanly on signal abort or ZapierAbortDrainSignal from a handler; rejects on fatal SDK errors or fail-fast handler errors. Real-time wake-up health is reported on stderr: a warning when wake-ups pause and the watch falls back to the safety drain, plus (with debug) transient reconnect notices. stdout (including --json NDJSON) is unaffected.
1469
1469
 
1470
1470
  **Options:**
1471
1471
 
@@ -1477,7 +1477,7 @@ Continuously consume a trigger inbox: drain currently-available messages via onM
1477
1477
  | `--lease-seconds` | `number` | ❌ | — | — | Seconds until the lease expires; messages return to available if not acked. API default is 300 (5 minutes). |
1478
1478
  | `--release-on-error` | `boolean` | ❌ | — | — | If true, errors release the message when the drain finishes. If false (default), errors leave it leased until the lease timeout. `ZapierReleaseTriggerMessageSignal` always releases regardless. |
1479
1479
  | `--continue-on-error` | `boolean` | ❌ | — | — | If false (default, fail-fast), the first handler error rejects and stops the drain. If true, handler errors are observed via `onError` and the drain continues. SDK-level errors (lease / ack / release) reject regardless. |
1480
- | `--max-drain-interval-seconds` | `number` | ❌ | — | — | Maximum seconds between empty-inbox poll attempts (default: 60). Caps the back-off cadence. |
1480
+ | `--max-drain-interval-seconds` | `number` | ❌ | — | — | Maximum seconds between safety drain attempts (default: 300). The watcher subscribes to SSE notifications for near-real-time wake-ups; this interval is the backstop that guarantees forward progress if SSE events are missed or the connection drops undetected. |
1481
1481
  | `--exec` | `string` | ❌ | — | — | Run a binary per message with no shell interpretation. Message JSON is piped to stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Pass extra argv after `--` (e.g. `--exec ./handler -- --verbose`). Mutually exclusive with --exec-shell and --json. |
1482
1482
  | `--exec-shell` | `string` | ❌ | — | — | Run a shell command per message. Message JSON is piped to the subprocess on stdin; exit code 0 acks, non-zero records the error per the same rules as a thrown handler. Interpreted by the platform's default shell (sh on POSIX, cmd.exe on Windows). Mutually exclusive with --exec and --json. |
1483
1483
  | `--json` | `boolean` | ❌ | — | — | Stream each message as JSON to stdout (one record per line, NDJSON), acking as each write completes. Use for piping to other tools. Mutually exclusive with --exec / --exec-shell and the interactive default. |
package/dist/cli.cjs CHANGED
@@ -1573,7 +1573,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1573
1573
 
1574
1574
  // package.json
1575
1575
  var package_default = {
1576
- version: "0.53.1"};
1576
+ version: "0.54.0"};
1577
1577
 
1578
1578
  // src/telemetry/builders.ts
1579
1579
  function createCliBaseEvent(context = {}) {
@@ -7040,6 +7040,8 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
7040
7040
  const original = sdk.watchTriggerInbox;
7041
7041
  const existingMeta = sdk.context.meta.watchTriggerInbox;
7042
7042
  const baseInputSchema = existingMeta.inputSchema;
7043
+ const baseDescription = typeof existingMeta.description === "string" ? existingMeta.description : "";
7044
+ const cliDescription = `${baseDescription} stdout (including --json NDJSON) is unaffected.`;
7043
7045
  const extendedInputSchema = baseInputSchema ? baseInputSchema.extend({
7044
7046
  exec: ExecCliProperty2,
7045
7047
  execShell: ExecShellCliProperty2,
@@ -7138,6 +7140,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
7138
7140
  meta: {
7139
7141
  watchTriggerInbox: {
7140
7142
  ...existingMeta,
7143
+ description: cliDescription,
7141
7144
  inputSchema: extendedInputSchema,
7142
7145
  packages: void 0
7143
7146
  }
@@ -7150,7 +7153,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
7150
7153
  // package.json with { type: 'json' }
7151
7154
  var package_default2 = {
7152
7155
  name: "@zapier/zapier-sdk-cli",
7153
- version: "0.53.1"};
7156
+ version: "0.54.0"};
7154
7157
 
7155
7158
  // src/sdk.ts
7156
7159
  zapierSdk.injectCliLogin(login_exports);
package/dist/cli.mjs CHANGED
@@ -1531,7 +1531,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1531
1531
 
1532
1532
  // package.json
1533
1533
  var package_default = {
1534
- version: "0.53.1"};
1534
+ version: "0.54.0"};
1535
1535
 
1536
1536
  // src/telemetry/builders.ts
1537
1537
  function createCliBaseEvent(context = {}) {
@@ -6998,6 +6998,8 @@ var watchTriggerInboxCliPlugin = definePlugin(
6998
6998
  const original = sdk.watchTriggerInbox;
6999
6999
  const existingMeta = sdk.context.meta.watchTriggerInbox;
7000
7000
  const baseInputSchema = existingMeta.inputSchema;
7001
+ const baseDescription = typeof existingMeta.description === "string" ? existingMeta.description : "";
7002
+ const cliDescription = `${baseDescription} stdout (including --json NDJSON) is unaffected.`;
7001
7003
  const extendedInputSchema = baseInputSchema ? baseInputSchema.extend({
7002
7004
  exec: ExecCliProperty2,
7003
7005
  execShell: ExecShellCliProperty2,
@@ -7096,6 +7098,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
7096
7098
  meta: {
7097
7099
  watchTriggerInbox: {
7098
7100
  ...existingMeta,
7101
+ description: cliDescription,
7099
7102
  inputSchema: extendedInputSchema,
7100
7103
  packages: void 0
7101
7104
  }
@@ -7108,7 +7111,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
7108
7111
  // package.json with { type: 'json' }
7109
7112
  var package_default2 = {
7110
7113
  name: "@zapier/zapier-sdk-cli",
7111
- version: "0.53.1"};
7114
+ version: "0.54.0"};
7112
7115
 
7113
7116
  // src/sdk.ts
7114
7117
  injectCliLogin(login_exports);
@@ -4393,6 +4393,8 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
4393
4393
  const original = sdk.watchTriggerInbox;
4394
4394
  const existingMeta = sdk.context.meta.watchTriggerInbox;
4395
4395
  const baseInputSchema = existingMeta.inputSchema;
4396
+ const baseDescription = typeof existingMeta.description === "string" ? existingMeta.description : "";
4397
+ const cliDescription = `${baseDescription} stdout (including --json NDJSON) is unaffected.`;
4396
4398
  const extendedInputSchema = baseInputSchema ? baseInputSchema.extend({
4397
4399
  exec: ExecCliProperty2,
4398
4400
  execShell: ExecShellCliProperty2,
@@ -4491,6 +4493,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
4491
4493
  meta: {
4492
4494
  watchTriggerInbox: {
4493
4495
  ...existingMeta,
4496
+ description: cliDescription,
4494
4497
  inputSchema: extendedInputSchema,
4495
4498
  packages: void 0
4496
4499
  }
@@ -4503,7 +4506,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
4503
4506
  // package.json with { type: 'json' }
4504
4507
  var package_default = {
4505
4508
  name: "@zapier/zapier-sdk-cli",
4506
- version: "0.53.1"};
4509
+ version: "0.54.0"};
4507
4510
 
4508
4511
  // src/experimental.ts
4509
4512
  experimental.injectCliLogin(login_exports);
@@ -4357,6 +4357,8 @@ var watchTriggerInboxCliPlugin = definePlugin(
4357
4357
  const original = sdk.watchTriggerInbox;
4358
4358
  const existingMeta = sdk.context.meta.watchTriggerInbox;
4359
4359
  const baseInputSchema = existingMeta.inputSchema;
4360
+ const baseDescription = typeof existingMeta.description === "string" ? existingMeta.description : "";
4361
+ const cliDescription = `${baseDescription} stdout (including --json NDJSON) is unaffected.`;
4360
4362
  const extendedInputSchema = baseInputSchema ? baseInputSchema.extend({
4361
4363
  exec: ExecCliProperty2,
4362
4364
  execShell: ExecShellCliProperty2,
@@ -4455,6 +4457,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
4455
4457
  meta: {
4456
4458
  watchTriggerInbox: {
4457
4459
  ...existingMeta,
4460
+ description: cliDescription,
4458
4461
  inputSchema: extendedInputSchema,
4459
4462
  packages: void 0
4460
4463
  }
@@ -4467,7 +4470,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
4467
4470
  // package.json with { type: 'json' }
4468
4471
  var package_default = {
4469
4472
  name: "@zapier/zapier-sdk-cli",
4470
- version: "0.53.1"};
4473
+ version: "0.54.0"};
4471
4474
 
4472
4475
  // src/experimental.ts
4473
4476
  injectCliLogin(login_exports);
package/dist/index.cjs CHANGED
@@ -4392,6 +4392,8 @@ zapierSdk.definePlugin(
4392
4392
  const original = sdk.watchTriggerInbox;
4393
4393
  const existingMeta = sdk.context.meta.watchTriggerInbox;
4394
4394
  const baseInputSchema = existingMeta.inputSchema;
4395
+ const baseDescription = typeof existingMeta.description === "string" ? existingMeta.description : "";
4396
+ const cliDescription = `${baseDescription} stdout (including --json NDJSON) is unaffected.`;
4395
4397
  const extendedInputSchema = baseInputSchema ? baseInputSchema.extend({
4396
4398
  exec: ExecCliProperty2,
4397
4399
  execShell: ExecShellCliProperty2,
@@ -4490,6 +4492,7 @@ zapierSdk.definePlugin(
4490
4492
  meta: {
4491
4493
  watchTriggerInbox: {
4492
4494
  ...existingMeta,
4495
+ description: cliDescription,
4493
4496
  inputSchema: extendedInputSchema,
4494
4497
  packages: void 0
4495
4498
  }
@@ -4502,7 +4505,7 @@ zapierSdk.definePlugin(
4502
4505
  // package.json with { type: 'json' }
4503
4506
  var package_default = {
4504
4507
  name: "@zapier/zapier-sdk-cli",
4505
- version: "0.53.1"};
4508
+ version: "0.54.0"};
4506
4509
 
4507
4510
  // src/sdk.ts
4508
4511
  zapierSdk.injectCliLogin(login_exports);
@@ -4530,7 +4533,7 @@ function createZapierCliSdk(options = {}) {
4530
4533
 
4531
4534
  // package.json
4532
4535
  var package_default2 = {
4533
- version: "0.53.1"};
4536
+ version: "0.54.0"};
4534
4537
 
4535
4538
  // src/telemetry/builders.ts
4536
4539
  function createCliBaseEvent(context = {}) {
package/dist/index.mjs CHANGED
@@ -4356,6 +4356,8 @@ definePlugin(
4356
4356
  const original = sdk.watchTriggerInbox;
4357
4357
  const existingMeta = sdk.context.meta.watchTriggerInbox;
4358
4358
  const baseInputSchema = existingMeta.inputSchema;
4359
+ const baseDescription = typeof existingMeta.description === "string" ? existingMeta.description : "";
4360
+ const cliDescription = `${baseDescription} stdout (including --json NDJSON) is unaffected.`;
4359
4361
  const extendedInputSchema = baseInputSchema ? baseInputSchema.extend({
4360
4362
  exec: ExecCliProperty2,
4361
4363
  execShell: ExecShellCliProperty2,
@@ -4454,6 +4456,7 @@ definePlugin(
4454
4456
  meta: {
4455
4457
  watchTriggerInbox: {
4456
4458
  ...existingMeta,
4459
+ description: cliDescription,
4457
4460
  inputSchema: extendedInputSchema,
4458
4461
  packages: void 0
4459
4462
  }
@@ -4466,7 +4469,7 @@ definePlugin(
4466
4469
  // package.json with { type: 'json' }
4467
4470
  var package_default = {
4468
4471
  name: "@zapier/zapier-sdk-cli",
4469
- version: "0.53.1"};
4472
+ version: "0.54.0"};
4470
4473
 
4471
4474
  // src/sdk.ts
4472
4475
  injectCliLogin(login_exports);
@@ -4494,7 +4497,7 @@ function createZapierCliSdk(options = {}) {
4494
4497
 
4495
4498
  // package.json
4496
4499
  var package_default2 = {
4497
- version: "0.53.1"};
4500
+ version: "0.54.0"};
4498
4501
 
4499
4502
  // src/telemetry/builders.ts
4500
4503
  function createCliBaseEvent(context = {}) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.53.1",
3
+ "version": "0.54.0",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -50,6 +50,7 @@ function createSignupTestApi() {
50
50
  delete: emptyApiResult,
51
51
  poll: emptyApiResult,
52
52
  fetch: () => Promise.resolve(new Response()),
53
+ fetchStream: async function* () { },
53
54
  };
54
55
  }
55
56
  export function buildSignupTestContext(vi, mockEmit = () => undefined) {
@@ -32,6 +32,7 @@ export declare const watchTriggerInboxCliPlugin: (sdk: SdkWithWatchTriggerInbox
32
32
  context: {
33
33
  meta: {
34
34
  watchTriggerInbox: {
35
+ description: string;
35
36
  inputSchema: z.ZodObject<{
36
37
  exec: z.ZodOptional<z.ZodString>;
37
38
  execShell: z.ZodOptional<z.ZodString>;
@@ -30,6 +30,14 @@ export const watchTriggerInboxCliPlugin = definePlugin((sdk) => {
30
30
  const original = sdk.watchTriggerInbox;
31
31
  const existingMeta = sdk.context.meta.watchTriggerInbox;
32
32
  const baseInputSchema = existingMeta.inputSchema;
33
+ // The SDK already documents that real-time health is reported on stderr;
34
+ // append only the CLI-specific clarification that stdout stays clean for
35
+ // piping. This flows into the CLI README via the doc generator's per-command
36
+ // `description` rendering.
37
+ const baseDescription = typeof existingMeta.description === "string"
38
+ ? existingMeta.description
39
+ : "";
40
+ const cliDescription = `${baseDescription} stdout (including --json NDJSON) is unaffected.`;
33
41
  const extendedInputSchema = baseInputSchema
34
42
  ? baseInputSchema.extend({
35
43
  exec: ExecCliProperty,
@@ -148,6 +156,7 @@ export const watchTriggerInboxCliPlugin = definePlugin((sdk) => {
148
156
  meta: {
149
157
  watchTriggerInbox: {
150
158
  ...existingMeta,
159
+ description: cliDescription,
151
160
  inputSchema: extendedInputSchema,
152
161
  packages: undefined,
153
162
  },