@zapier/zapier-sdk-cli 0.13.6 → 0.13.8

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,26 @@
1
1
  # @zapier/zapier-sdk-cli
2
2
 
3
+ ## 0.13.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c1d3c9c]
8
+ - Updated dependencies [16b4930]
9
+ - @zapier/zapier-sdk@0.13.7
10
+ - @zapier/zapier-sdk-mcp@0.3.20
11
+
12
+ ## 0.13.7
13
+
14
+ ### Patch Changes
15
+
16
+ - 9b7a954: Change OAuth client ID.
17
+ - a563cda: Extend ZapierCliSdkOptions with the base ZapierSdkOptions so we can see the token and other properties when initializing with createZapierSdkCli
18
+ - Updated dependencies [9b7a954]
19
+ - Updated dependencies [a563cda]
20
+ - @zapier/zapier-sdk-cli-login@0.3.3
21
+ - @zapier/zapier-sdk@0.13.6
22
+ - @zapier/zapier-sdk-mcp@0.3.19
23
+
3
24
  ## 0.13.6
4
25
 
5
26
  ### Patch Changes
package/dist/cli.cjs CHANGED
@@ -11,8 +11,8 @@ var open = require('open');
11
11
  var crypto = require('crypto');
12
12
  var express = require('express');
13
13
  var pkceChallenge = require('pkce-challenge');
14
- var ora = require('ora');
15
14
  var zapierSdkCliLogin = require('@zapier/zapier-sdk-cli-login');
15
+ var ora = require('ora');
16
16
  var zapierSdkMcp = require('@zapier/zapier-sdk-mcp');
17
17
  var esbuild = require('esbuild');
18
18
  var fs = require('fs');
@@ -1191,13 +1191,8 @@ function getListTitleFromMethod(methodName, functionInfo) {
1191
1191
  }
1192
1192
  return `${methodName} items`;
1193
1193
  }
1194
-
1195
- // src/utils/constants.ts
1196
- var ZAPIER_BASE = "https://zapier.com";
1197
- var LOGIN_CLIENT_ID = "K5eEnRE9TTmSFATdkkWhKF8NOKwoiOnYAyIqJjae";
1198
1194
  var LOGIN_PORTS = [49505, 50575, 52804, 55981, 61010, 63851];
1199
1195
  var LOGIN_TIMEOUT_MS = 3e5;
1200
- var AUTH_MODE_HEADER = "X-Auth";
1201
1196
  var spinPromise = async (promise, text) => {
1202
1197
  const spinner = ora__default.default(text).start();
1203
1198
  try {
@@ -1336,9 +1331,9 @@ var login = async (timeoutMs = LOGIN_TIMEOUT_MS) => {
1336
1331
  process.on("SIGINT", cleanup);
1337
1332
  process.on("SIGTERM", cleanup);
1338
1333
  const { code_verifier: codeVerifier, code_challenge: codeChallenge } = await pkceChallenge__default.default();
1339
- const authUrl = `${ZAPIER_BASE}/oauth/authorize/?${new URLSearchParams({
1334
+ const authUrl = `${zapierSdkCliLogin.ZAPIER_BASE}/oauth/authorize/?${new URLSearchParams({
1340
1335
  response_type: "code",
1341
- client_id: LOGIN_CLIENT_ID,
1336
+ client_id: zapierSdkCliLogin.LOGIN_CLIENT_ID,
1342
1337
  redirect_uri: redirectUri,
1343
1338
  scope: "internal offline_access",
1344
1339
  state: generateRandomString(),
@@ -1381,17 +1376,17 @@ var login = async (timeoutMs = LOGIN_TIMEOUT_MS) => {
1381
1376
  }
1382
1377
  log_default.info("Exchanging authorization code for tokens...");
1383
1378
  const { data } = await client_default.post(
1384
- `${ZAPIER_BASE}/oauth/token/`,
1379
+ `${zapierSdkCliLogin.ZAPIER_BASE}/oauth/token/`,
1385
1380
  {
1386
1381
  grant_type: "authorization_code",
1387
1382
  code: await promisedCode,
1388
1383
  redirect_uri: redirectUri,
1389
- client_id: LOGIN_CLIENT_ID,
1384
+ client_id: zapierSdkCliLogin.LOGIN_CLIENT_ID,
1390
1385
  code_verifier: codeVerifier
1391
1386
  },
1392
1387
  {
1393
1388
  headers: {
1394
- [AUTH_MODE_HEADER]: "no",
1389
+ [zapierSdkCliLogin.AUTH_MODE_HEADER]: "no",
1395
1390
  "Content-Type": "application/x-www-form-urlencoded"
1396
1391
  }
1397
1392
  }
@@ -1407,7 +1402,7 @@ var LoginSchema = zod.z.object({
1407
1402
 
1408
1403
  // package.json
1409
1404
  var package_default = {
1410
- version: "0.13.6"};
1405
+ version: "0.13.8"};
1411
1406
 
1412
1407
  // src/telemetry/builders.ts
1413
1408
  function createCliBaseEvent(context = {}) {
@@ -2621,7 +2616,7 @@ var buildManifestPlugin = ({ sdk: sdk2, context }) => {
2621
2616
  type: "manifest_entry_built",
2622
2617
  appKey: app.key,
2623
2618
  manifestKey: manifestEntry.implementationName,
2624
- version: manifestEntry.version
2619
+ version: manifestEntry.version || ""
2625
2620
  });
2626
2621
  const [updatedManifestKey, , manifest] = await context.updateManifestEntry({
2627
2622
  appKey: app.key,
@@ -2635,7 +2630,7 @@ var buildManifestPlugin = ({ sdk: sdk2, context }) => {
2635
2630
  type: "manifest_updated",
2636
2631
  appKey: app.key,
2637
2632
  manifestKey: updatedManifestKey,
2638
- version: manifestEntry.version
2633
+ version: manifestEntry.version || ""
2639
2634
  });
2640
2635
  onProgress?.({ type: "app_processing_complete", appKey: app.key });
2641
2636
  } catch (error) {
@@ -2677,7 +2672,7 @@ function createZapierCliSdk(options = {}) {
2677
2672
 
2678
2673
  // package.json with { type: 'json' }
2679
2674
  var package_default2 = {
2680
- version: "0.13.6"};
2675
+ version: "0.13.8"};
2681
2676
 
2682
2677
  // src/cli.ts
2683
2678
  var program = new commander.Command();
package/dist/cli.mjs CHANGED
@@ -9,8 +9,8 @@ import open from 'open';
9
9
  import crypto from 'crypto';
10
10
  import express from 'express';
11
11
  import pkceChallenge from 'pkce-challenge';
12
+ import { getLoggedInUser, logout, ZAPIER_BASE, LOGIN_CLIENT_ID, AUTH_MODE_HEADER, updateLogin, getConfigPath } from '@zapier/zapier-sdk-cli-login';
12
13
  import ora from 'ora';
13
- import { getLoggedInUser, logout, updateLogin, getConfigPath } from '@zapier/zapier-sdk-cli-login';
14
14
  import { startMcpServerAsProcess } from '@zapier/zapier-sdk-mcp';
15
15
  import { buildSync } from 'esbuild';
16
16
  import * as fs from 'fs';
@@ -1158,13 +1158,8 @@ function getListTitleFromMethod(methodName, functionInfo) {
1158
1158
  }
1159
1159
  return `${methodName} items`;
1160
1160
  }
1161
-
1162
- // src/utils/constants.ts
1163
- var ZAPIER_BASE = "https://zapier.com";
1164
- var LOGIN_CLIENT_ID = "K5eEnRE9TTmSFATdkkWhKF8NOKwoiOnYAyIqJjae";
1165
1161
  var LOGIN_PORTS = [49505, 50575, 52804, 55981, 61010, 63851];
1166
1162
  var LOGIN_TIMEOUT_MS = 3e5;
1167
- var AUTH_MODE_HEADER = "X-Auth";
1168
1163
  var spinPromise = async (promise, text) => {
1169
1164
  const spinner = ora(text).start();
1170
1165
  try {
@@ -1374,7 +1369,7 @@ var LoginSchema = z.object({
1374
1369
 
1375
1370
  // package.json
1376
1371
  var package_default = {
1377
- version: "0.13.6"};
1372
+ version: "0.13.8"};
1378
1373
 
1379
1374
  // src/telemetry/builders.ts
1380
1375
  function createCliBaseEvent(context = {}) {
@@ -2588,7 +2583,7 @@ var buildManifestPlugin = ({ sdk: sdk2, context }) => {
2588
2583
  type: "manifest_entry_built",
2589
2584
  appKey: app.key,
2590
2585
  manifestKey: manifestEntry.implementationName,
2591
- version: manifestEntry.version
2586
+ version: manifestEntry.version || ""
2592
2587
  });
2593
2588
  const [updatedManifestKey, , manifest] = await context.updateManifestEntry({
2594
2589
  appKey: app.key,
@@ -2602,7 +2597,7 @@ var buildManifestPlugin = ({ sdk: sdk2, context }) => {
2602
2597
  type: "manifest_updated",
2603
2598
  appKey: app.key,
2604
2599
  manifestKey: updatedManifestKey,
2605
- version: manifestEntry.version
2600
+ version: manifestEntry.version || ""
2606
2601
  });
2607
2602
  onProgress?.({ type: "app_processing_complete", appKey: app.key });
2608
2603
  } catch (error) {
@@ -2644,7 +2639,7 @@ function createZapierCliSdk(options = {}) {
2644
2639
 
2645
2640
  // package.json with { type: 'json' }
2646
2641
  var package_default2 = {
2647
- version: "0.13.6"};
2642
+ version: "0.13.8"};
2648
2643
 
2649
2644
  // src/cli.ts
2650
2645
  var program = new Command();
package/dist/index.cjs CHANGED
@@ -5,9 +5,9 @@ var open = require('open');
5
5
  var crypto = require('crypto');
6
6
  var express = require('express');
7
7
  var pkceChallenge = require('pkce-challenge');
8
+ var zapierSdkCliLogin = require('@zapier/zapier-sdk-cli-login');
8
9
  var ora = require('ora');
9
10
  var chalk = require('chalk');
10
- var zapierSdkCliLogin = require('@zapier/zapier-sdk-cli-login');
11
11
  var zod = require('zod');
12
12
  var zapierSdkMcp = require('@zapier/zapier-sdk-mcp');
13
13
  var esbuild = require('esbuild');
@@ -47,13 +47,8 @@ var path__namespace = /*#__PURE__*/_interopNamespace(path);
47
47
  var ts__namespace = /*#__PURE__*/_interopNamespace(ts);
48
48
 
49
49
  // src/sdk.ts
50
-
51
- // src/utils/constants.ts
52
- var ZAPIER_BASE = "https://zapier.com";
53
- var LOGIN_CLIENT_ID = "K5eEnRE9TTmSFATdkkWhKF8NOKwoiOnYAyIqJjae";
54
50
  var LOGIN_PORTS = [49505, 50575, 52804, 55981, 61010, 63851];
55
51
  var LOGIN_TIMEOUT_MS = 3e5;
56
- var AUTH_MODE_HEADER = "X-Auth";
57
52
  var spinPromise = async (promise, text) => {
58
53
  const spinner = ora__default.default(text).start();
59
54
  try {
@@ -192,9 +187,9 @@ var login = async (timeoutMs = LOGIN_TIMEOUT_MS) => {
192
187
  process.on("SIGINT", cleanup);
193
188
  process.on("SIGTERM", cleanup);
194
189
  const { code_verifier: codeVerifier, code_challenge: codeChallenge } = await pkceChallenge__default.default();
195
- const authUrl = `${ZAPIER_BASE}/oauth/authorize/?${new URLSearchParams({
190
+ const authUrl = `${zapierSdkCliLogin.ZAPIER_BASE}/oauth/authorize/?${new URLSearchParams({
196
191
  response_type: "code",
197
- client_id: LOGIN_CLIENT_ID,
192
+ client_id: zapierSdkCliLogin.LOGIN_CLIENT_ID,
198
193
  redirect_uri: redirectUri,
199
194
  scope: "internal offline_access",
200
195
  state: generateRandomString(),
@@ -237,17 +232,17 @@ var login = async (timeoutMs = LOGIN_TIMEOUT_MS) => {
237
232
  }
238
233
  log_default.info("Exchanging authorization code for tokens...");
239
234
  const { data } = await client_default.post(
240
- `${ZAPIER_BASE}/oauth/token/`,
235
+ `${zapierSdkCliLogin.ZAPIER_BASE}/oauth/token/`,
241
236
  {
242
237
  grant_type: "authorization_code",
243
238
  code: await promisedCode,
244
239
  redirect_uri: redirectUri,
245
- client_id: LOGIN_CLIENT_ID,
240
+ client_id: zapierSdkCliLogin.LOGIN_CLIENT_ID,
246
241
  code_verifier: codeVerifier
247
242
  },
248
243
  {
249
244
  headers: {
250
- [AUTH_MODE_HEADER]: "no",
245
+ [zapierSdkCliLogin.AUTH_MODE_HEADER]: "no",
251
246
  "Content-Type": "application/x-www-form-urlencoded"
252
247
  }
253
248
  }
@@ -263,7 +258,7 @@ var LoginSchema = zod.z.object({
263
258
 
264
259
  // package.json
265
260
  var package_default = {
266
- version: "0.13.6"};
261
+ version: "0.13.8"};
267
262
 
268
263
  // src/telemetry/builders.ts
269
264
  function createCliBaseEvent(context = {}) {
@@ -1477,7 +1472,7 @@ var buildManifestPlugin = ({ sdk, context }) => {
1477
1472
  type: "manifest_entry_built",
1478
1473
  appKey: app.key,
1479
1474
  manifestKey: manifestEntry.implementationName,
1480
- version: manifestEntry.version
1475
+ version: manifestEntry.version || ""
1481
1476
  });
1482
1477
  const [updatedManifestKey, , manifest] = await context.updateManifestEntry({
1483
1478
  appKey: app.key,
@@ -1491,7 +1486,7 @@ var buildManifestPlugin = ({ sdk, context }) => {
1491
1486
  type: "manifest_updated",
1492
1487
  appKey: app.key,
1493
1488
  manifestKey: updatedManifestKey,
1494
- version: manifestEntry.version
1489
+ version: manifestEntry.version || ""
1495
1490
  });
1496
1491
  onProgress?.({ type: "app_processing_complete", appKey: app.key });
1497
1492
  } catch (error) {
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { AppItem, Manifest, GetSdkType, ZapierSdk, BaseEvent } from '@zapier/zapier-sdk';
1
+ import { AppItem, Manifest, GetSdkType, ZapierSdk, ZapierSdkOptions, BaseEvent } from '@zapier/zapier-sdk';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const BuildManifestSchema: z.ZodObject<{
@@ -152,7 +152,7 @@ interface GenerateAppTypesPluginProvides {
152
152
  interface ZapierSdkCli extends GetSdkType<ZapierSdk & BuildManifestPluginProvides & GenerateAppTypesPluginProvides> {
153
153
  }
154
154
 
155
- interface ZapierCliSdkOptions {
155
+ interface ZapierCliSdkOptions extends ZapierSdkOptions {
156
156
  debug?: boolean;
157
157
  eventEmission?: {
158
158
  enabled?: boolean;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AppItem, Manifest, GetSdkType, ZapierSdk, BaseEvent } from '@zapier/zapier-sdk';
1
+ import { AppItem, Manifest, GetSdkType, ZapierSdk, ZapierSdkOptions, BaseEvent } from '@zapier/zapier-sdk';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const BuildManifestSchema: z.ZodObject<{
@@ -152,7 +152,7 @@ interface GenerateAppTypesPluginProvides {
152
152
  interface ZapierSdkCli extends GetSdkType<ZapierSdk & BuildManifestPluginProvides & GenerateAppTypesPluginProvides> {
153
153
  }
154
154
 
155
- interface ZapierCliSdkOptions {
155
+ interface ZapierCliSdkOptions extends ZapierSdkOptions {
156
156
  debug?: boolean;
157
157
  eventEmission?: {
158
158
  enabled?: boolean;
package/dist/index.mjs CHANGED
@@ -3,9 +3,9 @@ import open from 'open';
3
3
  import crypto from 'crypto';
4
4
  import express from 'express';
5
5
  import pkceChallenge from 'pkce-challenge';
6
+ import { getLoggedInUser, logout, ZAPIER_BASE, LOGIN_CLIENT_ID, AUTH_MODE_HEADER, updateLogin, getConfigPath } from '@zapier/zapier-sdk-cli-login';
6
7
  import ora from 'ora';
7
8
  import chalk from 'chalk';
8
- import { getLoggedInUser, logout, updateLogin, getConfigPath } from '@zapier/zapier-sdk-cli-login';
9
9
  import { z } from 'zod';
10
10
  import { startMcpServerAsProcess } from '@zapier/zapier-sdk-mcp';
11
11
  import { buildSync } from 'esbuild';
@@ -16,13 +16,8 @@ import { mkdir, writeFile, access } from 'fs/promises';
16
16
  import * as ts from 'typescript';
17
17
 
18
18
  // src/sdk.ts
19
-
20
- // src/utils/constants.ts
21
- var ZAPIER_BASE = "https://zapier.com";
22
- var LOGIN_CLIENT_ID = "K5eEnRE9TTmSFATdkkWhKF8NOKwoiOnYAyIqJjae";
23
19
  var LOGIN_PORTS = [49505, 50575, 52804, 55981, 61010, 63851];
24
20
  var LOGIN_TIMEOUT_MS = 3e5;
25
- var AUTH_MODE_HEADER = "X-Auth";
26
21
  var spinPromise = async (promise, text) => {
27
22
  const spinner = ora(text).start();
28
23
  try {
@@ -232,7 +227,7 @@ var LoginSchema = z.object({
232
227
 
233
228
  // package.json
234
229
  var package_default = {
235
- version: "0.13.6"};
230
+ version: "0.13.8"};
236
231
 
237
232
  // src/telemetry/builders.ts
238
233
  function createCliBaseEvent(context = {}) {
@@ -1446,7 +1441,7 @@ var buildManifestPlugin = ({ sdk, context }) => {
1446
1441
  type: "manifest_entry_built",
1447
1442
  appKey: app.key,
1448
1443
  manifestKey: manifestEntry.implementationName,
1449
- version: manifestEntry.version
1444
+ version: manifestEntry.version || ""
1450
1445
  });
1451
1446
  const [updatedManifestKey, , manifest] = await context.updateManifestEntry({
1452
1447
  appKey: app.key,
@@ -1460,7 +1455,7 @@ var buildManifestPlugin = ({ sdk, context }) => {
1460
1455
  type: "manifest_updated",
1461
1456
  appKey: app.key,
1462
1457
  manifestKey: updatedManifestKey,
1463
- version: manifestEntry.version
1458
+ version: manifestEntry.version || ""
1464
1459
  });
1465
1460
  onProgress?.({ type: "app_processing_complete", appKey: app.key });
1466
1461
  } catch (error) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.13.6",
3
+ "version": "0.13.8",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -33,7 +33,7 @@ export const buildManifestPlugin = ({ sdk, context }) => {
33
33
  type: "manifest_entry_built",
34
34
  appKey: app.key,
35
35
  manifestKey: manifestEntry.implementationName,
36
- version: manifestEntry.version,
36
+ version: manifestEntry.version || "",
37
37
  });
38
38
  const [updatedManifestKey, , manifest] = await context.updateManifestEntry({
39
39
  appKey: app.key,
@@ -47,7 +47,7 @@ export const buildManifestPlugin = ({ sdk, context }) => {
47
47
  type: "manifest_updated",
48
48
  appKey: app.key,
49
49
  manifestKey: updatedManifestKey,
50
- version: manifestEntry.version,
50
+ version: manifestEntry.version || "",
51
51
  });
52
52
  onProgress?.({ type: "app_processing_complete", appKey: app.key });
53
53
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { AppItem, ManifestEntry, Manifest } from "@zapier/zapier-sdk";
2
+ import type { AppItem, Manifest } from "@zapier/zapier-sdk";
3
3
  export declare const BuildManifestSchema: z.ZodObject<{
4
4
  appKeys: z.ZodArray<z.ZodString, "many">;
5
5
  skipWrite: z.ZodOptional<z.ZodBoolean>;
@@ -54,4 +54,3 @@ export interface BuildManifestResult {
54
54
  error: string;
55
55
  }>;
56
56
  }
57
- export type { ManifestEntry };
package/dist/src/sdk.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { type ZapierSdkOptions } from "@zapier/zapier-sdk";
1
2
  import type { ZapierSdkCli } from "./types/sdk";
2
- export interface ZapierCliSdkOptions {
3
+ export interface ZapierCliSdkOptions extends ZapierSdkOptions {
3
4
  debug?: boolean;
4
5
  eventEmission?: {
5
6
  enabled?: boolean;
@@ -1,5 +1,3 @@
1
- export declare const ZAPIER_BASE = "https://zapier.com";
2
- export declare const LOGIN_CLIENT_ID = "K5eEnRE9TTmSFATdkkWhKF8NOKwoiOnYAyIqJjae";
1
+ export { ZAPIER_BASE, LOGIN_CLIENT_ID, AUTH_MODE_HEADER, } from "@zapier/zapier-sdk-cli-login";
3
2
  export declare const LOGIN_PORTS: number[];
4
3
  export declare const LOGIN_TIMEOUT_MS = 300000;
5
- export declare const AUTH_MODE_HEADER = "X-Auth";
@@ -1,6 +1,5 @@
1
- export const ZAPIER_BASE = "https://zapier.com";
2
- // OAuth client ID for zapier-sdk CLI
3
- export const LOGIN_CLIENT_ID = "K5eEnRE9TTmSFATdkkWhKF8NOKwoiOnYAyIqJjae";
1
+ // Import shared OAuth constants from login package
2
+ export { ZAPIER_BASE, LOGIN_CLIENT_ID, AUTH_MODE_HEADER, } from "@zapier/zapier-sdk-cli-login";
3
+ // CLI-specific constants
4
4
  export const LOGIN_PORTS = [49505, 50575, 52804, 55981, 61010, 63851];
5
5
  export const LOGIN_TIMEOUT_MS = 300000; // 5 minutes
6
- export const AUTH_MODE_HEADER = "X-Auth";
@@ -1,4 +1,4 @@
1
- import type { AppItem } from "@zapier/zapier-sdk";
1
+ import type { AppItem, ManifestEntry } from "@zapier/zapier-sdk";
2
2
  /**
3
3
  * Get the preferred key for a manifest entry
4
4
  * Prefers slug over implementation name
@@ -7,7 +7,4 @@ export declare function getManifestKey(app: AppItem): string;
7
7
  /**
8
8
  * Create a manifest entry from an app
9
9
  */
10
- export declare function createManifestEntry(app: AppItem): {
11
- implementationName: string;
12
- version: string;
13
- };
10
+ export declare function createManifestEntry(app: AppItem): ManifestEntry;