@zapier/zapier-sdk-cli 0.52.10 → 0.52.12

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +19 -1
  3. package/dist/cli.cjs +80 -82
  4. package/dist/cli.mjs +81 -83
  5. package/dist/experimental.cjs +17 -26
  6. package/dist/experimental.d.mts +1 -1
  7. package/dist/experimental.d.ts +1 -1
  8. package/dist/experimental.mjs +16 -25
  9. package/dist/index.cjs +18 -27
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.mjs +16 -25
  13. package/dist/login.cjs +8 -10
  14. package/dist/login.d.mts +2 -10
  15. package/dist/login.d.ts +2 -10
  16. package/dist/login.mjs +5 -9
  17. package/dist/package.json +1 -1
  18. package/dist/{sdk-B3nKAZdN.d.mts → sdk-Sa1HjzUj.d.mts} +14 -14
  19. package/dist/{sdk-B3nKAZdN.d.ts → sdk-Sa1HjzUj.d.ts} +14 -14
  20. package/dist/src/experimental.js +29 -27
  21. package/dist/src/login/index.d.ts +1 -9
  22. package/dist/src/login/index.js +12 -14
  23. package/dist/src/plugins/add/index.d.ts +15 -15
  24. package/dist/src/plugins/add/index.js +1 -1
  25. package/dist/src/plugins/buildManifest/index.d.ts +2 -2
  26. package/dist/src/plugins/bundleCode/index.d.ts +1 -1
  27. package/dist/src/plugins/bundleCode/index.js +2 -1
  28. package/dist/src/plugins/cliOverrides/index.d.ts +5 -10
  29. package/dist/src/plugins/cliOverrides/index.js +2 -6
  30. package/dist/src/plugins/curl/index.d.ts +2 -2
  31. package/dist/src/plugins/curl/schemas.d.ts +2 -2
  32. package/dist/src/plugins/feedback/index.d.ts +1 -1
  33. package/dist/src/plugins/generateAppTypes/index.d.ts +11 -11
  34. package/dist/src/plugins/getLoginConfigPath/index.d.ts +1 -1
  35. package/dist/src/plugins/index.d.ts +1 -1
  36. package/dist/src/plugins/index.js +1 -1
  37. package/dist/src/plugins/init/index.d.ts +1 -1
  38. package/dist/src/plugins/login/index.d.ts +1 -1
  39. package/dist/src/plugins/logout/index.d.ts +1 -1
  40. package/dist/src/plugins/mcp/index.d.ts +1 -1
  41. package/dist/src/sdk.js +31 -20
  42. package/dist/src/utils/cli-generator.js +14 -7
  43. package/dist/src/utils/cli-renderer.d.ts +13 -3
  44. package/dist/src/utils/cli-renderer.js +27 -20
  45. package/dist/src/utils/log.js +9 -4
  46. package/dist/src/utils/parameter-resolver.js +3 -1
  47. package/dist/src/utils/schema-formatter.d.ts +2 -2
  48. package/dist/src/utils/schema-formatter.js +4 -30
  49. package/dist/src/utils/version-checker.js +8 -3
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/package.json +3 -3
@@ -7,10 +7,10 @@ import crypto, { createHash } from 'crypto';
7
7
  import * as path from 'path';
8
8
  import { resolve, join, dirname, basename, relative, extname } from 'path';
9
9
  import * as lockfile from 'proper-lockfile';
10
+ import { definePlugin, createPluginMethod, getOrCreateApiClient, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, isCredentialsObject, invalidateCachedToken, buildApplicationLifecycleEvent, batch, toSnakeCase, ZapierAbortDrainSignal, ZapierAuthenticationError, ZapierError } from '@zapier/zapier-sdk';
10
11
  import { z } from 'zod';
11
- import { injectCliLogin, createZapierSdk } from '@zapier/zapier-sdk/experimental';
12
+ import { injectCliLogin, createZapierSdkStack, addPlugin } from '@zapier/zapier-sdk/experimental';
12
13
  import { hostname } from 'os';
13
- import { definePlugin, createPluginMethod, getOrCreateApiClient, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, isCredentialsObject, invalidateCachedToken, buildApplicationLifecycleEvent, batch, toSnakeCase, ZapierAbortDrainSignal, ZapierError } from '@zapier/zapier-sdk';
14
14
  import inquirer from 'inquirer';
15
15
  import open from 'open';
16
16
  import express from 'express';
@@ -442,12 +442,6 @@ async function deleteStoredClientCredentials({
442
442
  }
443
443
 
444
444
  // src/login/index.ts
445
- var ZapierAuthenticationError = class extends Error {
446
- constructor(message) {
447
- super(message);
448
- this.name = "ZapierAuthenticationError";
449
- }
450
- };
451
445
  var DEFAULT_AUTH_CLIENT_ID = "grwWZD5hUWGvb4V8ODBuOtXer3h0DBEZ2HR8aay6";
452
446
  var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
453
447
  function createDebugLog(enabled) {
@@ -457,9 +451,9 @@ function createDebugLog(enabled) {
457
451
  }
458
452
  return (message, data) => {
459
453
  if (data === void 0) {
460
- console.log(`[Zapier SDK CLI Login] ${message}`);
454
+ console.error(`[Zapier SDK CLI Login] ${message}`);
461
455
  } else {
462
- console.log(`[Zapier SDK CLI Login] ${message}`, data);
456
+ console.error(`[Zapier SDK CLI Login] ${message}`, data);
463
457
  }
464
458
  };
465
459
  }
@@ -907,20 +901,20 @@ var spinPromise = async (promise, text) => {
907
901
  };
908
902
  var log = {
909
903
  info: (message, ...args) => {
910
- console.log(chalk3.blue("\u2139"), message, ...args);
904
+ console.error(chalk3.blue("\u2139"), message, ...args);
911
905
  },
912
906
  error: (message, ...args) => {
913
907
  console.error(chalk3.red("\u2716"), message, ...args);
914
908
  },
915
909
  success: (message, ...args) => {
916
- console.log(chalk3.green("\u2713"), message, ...args);
910
+ console.error(chalk3.green("\u2713"), message, ...args);
917
911
  },
918
912
  warn: (message, ...args) => {
919
- console.log(chalk3.yellow("\u26A0"), message, ...args);
913
+ console.error(chalk3.yellow("\u26A0"), message, ...args);
920
914
  },
921
915
  debug: (message, ...args) => {
922
916
  if (process.env.DEBUG === "true" || process.argv.includes("--debug")) {
923
- console.log(chalk3.gray("\u{1F41B}"), message, ...args);
917
+ console.error(chalk3.gray("\u{1F41B}"), message, ...args);
924
918
  }
925
919
  }
926
920
  };
@@ -1509,7 +1503,8 @@ var BundleCodeSchema = z.object({
1509
1503
  var bundleCodePlugin = definePlugin(
1510
1504
  (sdk) => createPluginMethod(sdk, {
1511
1505
  name: "bundleCode",
1512
- categories: ["utility", "deprecated"],
1506
+ categories: ["utility"],
1507
+ deprecation: { message: "bundleCode is no longer maintained." },
1513
1508
  inputSchema: BundleCodeSchema,
1514
1509
  handler: async ({ options }) => bundleCode(options)
1515
1510
  })
@@ -1605,7 +1600,7 @@ async function detectTypesOutputDirectory() {
1605
1600
  }
1606
1601
  return "./zapier/apps/";
1607
1602
  }
1608
- var addPlugin = definePlugin(
1603
+ var addAppsPlugin = definePlugin(
1609
1604
  (sdk) => createPluginMethod(sdk, {
1610
1605
  name: "add",
1611
1606
  categories: ["utility"],
@@ -3010,10 +3005,6 @@ var cliOverridesPlugin = definePlugin(
3010
3005
  if (sdk.context.meta.fetch) {
3011
3006
  meta.fetch = {
3012
3007
  ...sdk.context.meta.fetch,
3013
- categories: [
3014
- ...sdk.context.meta.fetch.categories || [],
3015
- "deprecated"
3016
- ],
3017
3008
  deprecation: {
3018
3009
  message: "This command is deprecated and will be removed soon. Use `curl` instead. Learn more: https://docs.zapier.com/sdk/cli-reference#curl"
3019
3010
  }
@@ -3977,7 +3968,7 @@ var watchTriggerInboxCliPlugin = definePlugin(
3977
3968
  // package.json with { type: 'json' }
3978
3969
  var package_default = {
3979
3970
  name: "@zapier/zapier-sdk-cli",
3980
- version: "0.52.10"};
3971
+ version: "0.52.12"};
3981
3972
 
3982
3973
  // src/experimental.ts
3983
3974
  injectCliLogin(login_exports);
@@ -3989,21 +3980,21 @@ function createZapierCliSdk(options = {}) {
3989
3980
  const experimentalContextPlugin = () => ({
3990
3981
  context: { experimental: true }
3991
3982
  });
3992
- let chain = createZapierSdk({
3983
+ const sdk = createZapierSdkStack({
3993
3984
  ...sdkOptions,
3994
3985
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
3995
3986
  callerPackage: { name: package_default.name, version: package_default.version }
3996
- }).addPlugin(extensionsContextPlugin).addPlugin(experimentalContextPlugin).addPlugin(generateAppTypesPlugin).addPlugin(buildManifestPlugin).addPlugin(bundleCodePlugin).addPlugin(getLoginConfigPathPlugin).addPlugin(addPlugin).addPlugin(feedbackPlugin).addPlugin(curlPlugin).addPlugin(initPlugin).addPlugin(drainTriggerInboxCliPlugin, { override: true }).addPlugin(watchTriggerInboxCliPlugin, { override: true }).addPlugin(mcpPlugin).addPlugin(loginPlugin).addPlugin(logoutPlugin).addPlugin(cliOverridesPlugin);
3987
+ }).use(extensionsContextPlugin).use(experimentalContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(drainTriggerInboxCliPlugin, { override: true }).use(watchTriggerInboxCliPlugin, { override: true }).use(mcpPlugin).use(loginPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
3997
3988
  for (const ext of extensions) {
3998
3989
  try {
3999
- chain = chain.addPlugin(ext);
3990
+ addPlugin(sdk, ext);
4000
3991
  } catch (err) {
4001
3992
  console.warn(
4002
3993
  `Extension plugin failed to construct: ${err.message}; skipping.`
4003
3994
  );
4004
3995
  }
4005
3996
  }
4006
- return chain;
3997
+ return sdk;
4007
3998
  }
4008
3999
 
4009
4000
  export { createZapierCliSdk };
package/dist/index.cjs CHANGED
@@ -7,8 +7,8 @@ var fs = require('fs');
7
7
  var crypto = require('crypto');
8
8
  var path = require('path');
9
9
  var lockfile = require('proper-lockfile');
10
- var zod = require('zod');
11
10
  var zapierSdk = require('@zapier/zapier-sdk');
11
+ var zod = require('zod');
12
12
  var os = require('os');
13
13
  var inquirer = require('inquirer');
14
14
  var open = require('open');
@@ -73,7 +73,7 @@ var login_exports = {};
73
73
  __export(login_exports, {
74
74
  AUTH_MODE_HEADER: () => AUTH_MODE_HEADER,
75
75
  DEFAULT_AUTH_BASE_URL: () => DEFAULT_AUTH_BASE_URL,
76
- ZapierAuthenticationError: () => ZapierAuthenticationError,
76
+ ZapierAuthenticationError: () => zapierSdk.ZapierAuthenticationError,
77
77
  clearTokensFromKeychain: () => clearTokensFromKeychain,
78
78
  createCache: () => createCache,
79
79
  getActiveCredentials: () => getActiveCredentials,
@@ -477,12 +477,6 @@ async function deleteStoredClientCredentials({
477
477
  }
478
478
 
479
479
  // src/login/index.ts
480
- var ZapierAuthenticationError = class extends Error {
481
- constructor(message) {
482
- super(message);
483
- this.name = "ZapierAuthenticationError";
484
- }
485
- };
486
480
  var DEFAULT_AUTH_CLIENT_ID = "grwWZD5hUWGvb4V8ODBuOtXer3h0DBEZ2HR8aay6";
487
481
  var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
488
482
  function createDebugLog(enabled) {
@@ -492,9 +486,9 @@ function createDebugLog(enabled) {
492
486
  }
493
487
  return (message, data) => {
494
488
  if (data === void 0) {
495
- console.log(`[Zapier SDK CLI Login] ${message}`);
489
+ console.error(`[Zapier SDK CLI Login] ${message}`);
496
490
  } else {
497
- console.log(`[Zapier SDK CLI Login] ${message}`, data);
491
+ console.error(`[Zapier SDK CLI Login] ${message}`, data);
498
492
  }
499
493
  };
500
494
  }
@@ -740,7 +734,7 @@ async function getToken(options = {}) {
740
734
  return await resolveOrRefreshToken(options);
741
735
  } catch (error) {
742
736
  const message = error instanceof Error ? error.message : "Token refresh failed";
743
- throw new ZapierAuthenticationError(
737
+ throw new zapierSdk.ZapierAuthenticationError(
744
738
  `${message}
745
739
  Please run 'login' to authenticate again.`
746
740
  );
@@ -942,20 +936,20 @@ var spinPromise = async (promise, text) => {
942
936
  };
943
937
  var log = {
944
938
  info: (message, ...args) => {
945
- console.log(chalk3__default.default.blue("\u2139"), message, ...args);
939
+ console.error(chalk3__default.default.blue("\u2139"), message, ...args);
946
940
  },
947
941
  error: (message, ...args) => {
948
942
  console.error(chalk3__default.default.red("\u2716"), message, ...args);
949
943
  },
950
944
  success: (message, ...args) => {
951
- console.log(chalk3__default.default.green("\u2713"), message, ...args);
945
+ console.error(chalk3__default.default.green("\u2713"), message, ...args);
952
946
  },
953
947
  warn: (message, ...args) => {
954
- console.log(chalk3__default.default.yellow("\u26A0"), message, ...args);
948
+ console.error(chalk3__default.default.yellow("\u26A0"), message, ...args);
955
949
  },
956
950
  debug: (message, ...args) => {
957
951
  if (process.env.DEBUG === "true" || process.argv.includes("--debug")) {
958
- console.log(chalk3__default.default.gray("\u{1F41B}"), message, ...args);
952
+ console.error(chalk3__default.default.gray("\u{1F41B}"), message, ...args);
959
953
  }
960
954
  }
961
955
  };
@@ -1544,7 +1538,8 @@ var BundleCodeSchema = zod.z.object({
1544
1538
  var bundleCodePlugin = zapierSdk.definePlugin(
1545
1539
  (sdk) => zapierSdk.createPluginMethod(sdk, {
1546
1540
  name: "bundleCode",
1547
- categories: ["utility", "deprecated"],
1541
+ categories: ["utility"],
1542
+ deprecation: { message: "bundleCode is no longer maintained." },
1548
1543
  inputSchema: BundleCodeSchema,
1549
1544
  handler: async ({ options }) => bundleCode(options)
1550
1545
  })
@@ -1640,7 +1635,7 @@ async function detectTypesOutputDirectory() {
1640
1635
  }
1641
1636
  return "./zapier/apps/";
1642
1637
  }
1643
- var addPlugin = zapierSdk.definePlugin(
1638
+ var addAppsPlugin = zapierSdk.definePlugin(
1644
1639
  (sdk) => zapierSdk.createPluginMethod(sdk, {
1645
1640
  name: "add",
1646
1641
  categories: ["utility"],
@@ -3045,10 +3040,6 @@ var cliOverridesPlugin = zapierSdk.definePlugin(
3045
3040
  if (sdk.context.meta.fetch) {
3046
3041
  meta.fetch = {
3047
3042
  ...sdk.context.meta.fetch,
3048
- categories: [
3049
- ...sdk.context.meta.fetch.categories || [],
3050
- "deprecated"
3051
- ],
3052
3043
  deprecation: {
3053
3044
  message: "This command is deprecated and will be removed soon. Use `curl` instead. Learn more: https://docs.zapier.com/sdk/cli-reference#curl"
3054
3045
  }
@@ -4012,7 +4003,7 @@ zapierSdk.definePlugin(
4012
4003
  // package.json with { type: 'json' }
4013
4004
  var package_default = {
4014
4005
  name: "@zapier/zapier-sdk-cli",
4015
- version: "0.52.10"};
4006
+ version: "0.52.12"};
4016
4007
 
4017
4008
  // src/sdk.ts
4018
4009
  zapierSdk.injectCliLogin(login_exports);
@@ -4021,26 +4012,26 @@ function createZapierCliSdk(options = {}) {
4021
4012
  const extensionsContextPlugin = () => ({
4022
4013
  context: { extensions }
4023
4014
  });
4024
- let chain = zapierSdk.createZapierSdk({
4015
+ const sdk = zapierSdk.createZapierSdkStack({
4025
4016
  ...sdkOptions,
4026
4017
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
4027
4018
  callerPackage: { name: package_default.name, version: package_default.version }
4028
- }).addPlugin(extensionsContextPlugin).addPlugin(generateAppTypesPlugin).addPlugin(buildManifestPlugin).addPlugin(bundleCodePlugin).addPlugin(getLoginConfigPathPlugin).addPlugin(addPlugin).addPlugin(feedbackPlugin).addPlugin(curlPlugin).addPlugin(initPlugin).addPlugin(mcpPlugin).addPlugin(loginPlugin).addPlugin(logoutPlugin).addPlugin(cliOverridesPlugin);
4019
+ }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
4029
4020
  for (const ext of extensions) {
4030
4021
  try {
4031
- chain = chain.addPlugin(ext);
4022
+ zapierSdk.addPlugin(sdk, ext);
4032
4023
  } catch (err) {
4033
4024
  console.warn(
4034
4025
  `Extension plugin failed to construct: ${err.message}; skipping.`
4035
4026
  );
4036
4027
  }
4037
4028
  }
4038
- return chain;
4029
+ return sdk;
4039
4030
  }
4040
4031
 
4041
4032
  // package.json
4042
4033
  var package_default2 = {
4043
- version: "0.52.10"};
4034
+ version: "0.52.12"};
4044
4035
 
4045
4036
  // src/telemetry/builders.ts
4046
4037
  function createCliBaseEvent(context = {}) {
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ZapierSdkOptions, Plugin, PluginProvides, BaseEvent } from '@zapier/zapier-sdk';
2
- import { Z as ZapierSdkCli } from './sdk-B3nKAZdN.mjs';
2
+ import { Z as ZapierSdkCli } from './sdk-Sa1HjzUj.mjs';
3
3
  import 'zod';
4
4
 
5
5
  interface ZapierCliSdkOptions extends ZapierSdkOptions {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ZapierSdkOptions, Plugin, PluginProvides, BaseEvent } from '@zapier/zapier-sdk';
2
- import { Z as ZapierSdkCli } from './sdk-B3nKAZdN.js';
2
+ import { Z as ZapierSdkCli } from './sdk-Sa1HjzUj.js';
3
3
  import 'zod';
4
4
 
5
5
  interface ZapierCliSdkOptions extends ZapierSdkOptions {
package/dist/index.mjs CHANGED
@@ -7,8 +7,8 @@ import crypto, { createHash } from 'crypto';
7
7
  import * as path from 'path';
8
8
  import { resolve, join, dirname, basename, relative, extname } from 'path';
9
9
  import * as lockfile from 'proper-lockfile';
10
+ import { definePlugin, createPluginMethod, getOrCreateApiClient, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, isCredentialsObject, invalidateCachedToken, buildApplicationLifecycleEvent, batch, toSnakeCase, ZapierAbortDrainSignal, ZapierAuthenticationError, ZapierError, createZapierSdkStack, addPlugin, getOsInfo, getPlatformVersions, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
10
11
  import { z } from 'zod';
11
- import { definePlugin, createPluginMethod, getOrCreateApiClient, OutputPropertySchema, ZapierBundleError, DEFAULT_CONFIG_PATH, ZapierValidationError, ZapierUnknownError, ZapierReleaseTriggerMessageSignal, injectCliLogin, isCredentialsObject, invalidateCachedToken, buildApplicationLifecycleEvent, batch, toSnakeCase, ZapierAbortDrainSignal, ZapierError, createZapierSdk, getOsInfo, getPlatformVersions, getCiPlatform, isCi, getReleaseId, getCurrentTimestamp, generateEventId } from '@zapier/zapier-sdk';
12
12
  import { hostname } from 'os';
13
13
  import inquirer from 'inquirer';
14
14
  import open from 'open';
@@ -441,12 +441,6 @@ async function deleteStoredClientCredentials({
441
441
  }
442
442
 
443
443
  // src/login/index.ts
444
- var ZapierAuthenticationError = class extends Error {
445
- constructor(message) {
446
- super(message);
447
- this.name = "ZapierAuthenticationError";
448
- }
449
- };
450
444
  var DEFAULT_AUTH_CLIENT_ID = "grwWZD5hUWGvb4V8ODBuOtXer3h0DBEZ2HR8aay6";
451
445
  var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
452
446
  function createDebugLog(enabled) {
@@ -456,9 +450,9 @@ function createDebugLog(enabled) {
456
450
  }
457
451
  return (message, data) => {
458
452
  if (data === void 0) {
459
- console.log(`[Zapier SDK CLI Login] ${message}`);
453
+ console.error(`[Zapier SDK CLI Login] ${message}`);
460
454
  } else {
461
- console.log(`[Zapier SDK CLI Login] ${message}`, data);
455
+ console.error(`[Zapier SDK CLI Login] ${message}`, data);
462
456
  }
463
457
  };
464
458
  }
@@ -906,20 +900,20 @@ var spinPromise = async (promise, text) => {
906
900
  };
907
901
  var log = {
908
902
  info: (message, ...args) => {
909
- console.log(chalk3.blue("\u2139"), message, ...args);
903
+ console.error(chalk3.blue("\u2139"), message, ...args);
910
904
  },
911
905
  error: (message, ...args) => {
912
906
  console.error(chalk3.red("\u2716"), message, ...args);
913
907
  },
914
908
  success: (message, ...args) => {
915
- console.log(chalk3.green("\u2713"), message, ...args);
909
+ console.error(chalk3.green("\u2713"), message, ...args);
916
910
  },
917
911
  warn: (message, ...args) => {
918
- console.log(chalk3.yellow("\u26A0"), message, ...args);
912
+ console.error(chalk3.yellow("\u26A0"), message, ...args);
919
913
  },
920
914
  debug: (message, ...args) => {
921
915
  if (process.env.DEBUG === "true" || process.argv.includes("--debug")) {
922
- console.log(chalk3.gray("\u{1F41B}"), message, ...args);
916
+ console.error(chalk3.gray("\u{1F41B}"), message, ...args);
923
917
  }
924
918
  }
925
919
  };
@@ -1508,7 +1502,8 @@ var BundleCodeSchema = z.object({
1508
1502
  var bundleCodePlugin = definePlugin(
1509
1503
  (sdk) => createPluginMethod(sdk, {
1510
1504
  name: "bundleCode",
1511
- categories: ["utility", "deprecated"],
1505
+ categories: ["utility"],
1506
+ deprecation: { message: "bundleCode is no longer maintained." },
1512
1507
  inputSchema: BundleCodeSchema,
1513
1508
  handler: async ({ options }) => bundleCode(options)
1514
1509
  })
@@ -1604,7 +1599,7 @@ async function detectTypesOutputDirectory() {
1604
1599
  }
1605
1600
  return "./zapier/apps/";
1606
1601
  }
1607
- var addPlugin = definePlugin(
1602
+ var addAppsPlugin = definePlugin(
1608
1603
  (sdk) => createPluginMethod(sdk, {
1609
1604
  name: "add",
1610
1605
  categories: ["utility"],
@@ -3009,10 +3004,6 @@ var cliOverridesPlugin = definePlugin(
3009
3004
  if (sdk.context.meta.fetch) {
3010
3005
  meta.fetch = {
3011
3006
  ...sdk.context.meta.fetch,
3012
- categories: [
3013
- ...sdk.context.meta.fetch.categories || [],
3014
- "deprecated"
3015
- ],
3016
3007
  deprecation: {
3017
3008
  message: "This command is deprecated and will be removed soon. Use `curl` instead. Learn more: https://docs.zapier.com/sdk/cli-reference#curl"
3018
3009
  }
@@ -3976,7 +3967,7 @@ definePlugin(
3976
3967
  // package.json with { type: 'json' }
3977
3968
  var package_default = {
3978
3969
  name: "@zapier/zapier-sdk-cli",
3979
- version: "0.52.10"};
3970
+ version: "0.52.12"};
3980
3971
 
3981
3972
  // src/sdk.ts
3982
3973
  injectCliLogin(login_exports);
@@ -3985,26 +3976,26 @@ function createZapierCliSdk(options = {}) {
3985
3976
  const extensionsContextPlugin = () => ({
3986
3977
  context: { extensions }
3987
3978
  });
3988
- let chain = createZapierSdk({
3979
+ const sdk = createZapierSdkStack({
3989
3980
  ...sdkOptions,
3990
3981
  eventEmission: { ...sdkOptions.eventEmission, callContext: "cli" },
3991
3982
  callerPackage: { name: package_default.name, version: package_default.version }
3992
- }).addPlugin(extensionsContextPlugin).addPlugin(generateAppTypesPlugin).addPlugin(buildManifestPlugin).addPlugin(bundleCodePlugin).addPlugin(getLoginConfigPathPlugin).addPlugin(addPlugin).addPlugin(feedbackPlugin).addPlugin(curlPlugin).addPlugin(initPlugin).addPlugin(mcpPlugin).addPlugin(loginPlugin).addPlugin(logoutPlugin).addPlugin(cliOverridesPlugin);
3983
+ }).use(extensionsContextPlugin).use(generateAppTypesPlugin).use(buildManifestPlugin).use(bundleCodePlugin).use(getLoginConfigPathPlugin).use(addAppsPlugin).use(feedbackPlugin).use(curlPlugin).use(initPlugin).use(mcpPlugin).use(loginPlugin).use(logoutPlugin).use(cliOverridesPlugin, { override: true }).toSdk();
3993
3984
  for (const ext of extensions) {
3994
3985
  try {
3995
- chain = chain.addPlugin(ext);
3986
+ addPlugin(sdk, ext);
3996
3987
  } catch (err) {
3997
3988
  console.warn(
3998
3989
  `Extension plugin failed to construct: ${err.message}; skipping.`
3999
3990
  );
4000
3991
  }
4001
3992
  }
4002
- return chain;
3993
+ return sdk;
4003
3994
  }
4004
3995
 
4005
3996
  // package.json
4006
3997
  var package_default2 = {
4007
- version: "0.52.10"};
3998
+ version: "0.52.12"};
4008
3999
 
4009
4000
  // src/telemetry/builders.ts
4010
4001
  function createCliBaseEvent(context = {}) {
package/dist/login.cjs CHANGED
@@ -7,6 +7,7 @@ var fs = require('fs');
7
7
  var crypto = require('crypto');
8
8
  var path = require('path');
9
9
  var lockfile = require('proper-lockfile');
10
+ var zapierSdk = require('@zapier/zapier-sdk');
10
11
  var zod = require('zod');
11
12
 
12
13
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -319,12 +320,6 @@ async function getStoredClientCredentials(options) {
319
320
  }
320
321
 
321
322
  // src/login/index.ts
322
- var ZapierAuthenticationError = class extends Error {
323
- constructor(message) {
324
- super(message);
325
- this.name = "ZapierAuthenticationError";
326
- }
327
- };
328
323
  var DEFAULT_AUTH_CLIENT_ID = "grwWZD5hUWGvb4V8ODBuOtXer3h0DBEZ2HR8aay6";
329
324
  var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
330
325
  function createDebugLog(enabled) {
@@ -334,9 +329,9 @@ function createDebugLog(enabled) {
334
329
  }
335
330
  return (message, data) => {
336
331
  if (data === void 0) {
337
- console.log(`[Zapier SDK CLI Login] ${message}`);
332
+ console.error(`[Zapier SDK CLI Login] ${message}`);
338
333
  } else {
339
- console.log(`[Zapier SDK CLI Login] ${message}`, data);
334
+ console.error(`[Zapier SDK CLI Login] ${message}`, data);
340
335
  }
341
336
  };
342
337
  }
@@ -582,7 +577,7 @@ async function getToken(options = {}) {
582
577
  return await resolveOrRefreshToken(options);
583
578
  } catch (error) {
584
579
  const message = error instanceof Error ? error.message : "Token refresh failed";
585
- throw new ZapierAuthenticationError(
580
+ throw new zapierSdk.ZapierAuthenticationError(
586
581
  `${message}
587
582
  Please run 'login' to authenticate again.`
588
583
  );
@@ -653,9 +648,12 @@ function getConfigPath() {
653
648
  return cfg.path;
654
649
  }
655
650
 
651
+ Object.defineProperty(exports, "ZapierAuthenticationError", {
652
+ enumerable: true,
653
+ get: function () { return zapierSdk.ZapierAuthenticationError; }
654
+ });
656
655
  exports.AUTH_MODE_HEADER = AUTH_MODE_HEADER;
657
656
  exports.DEFAULT_AUTH_BASE_URL = DEFAULT_AUTH_BASE_URL;
658
- exports.ZapierAuthenticationError = ZapierAuthenticationError;
659
657
  exports.clearTokensFromKeychain = clearTokensFromKeychain;
660
658
  exports.createCache = createCache;
661
659
  exports.getActiveCredentials = getActiveCredentials;
package/dist/login.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Conf from 'conf';
2
2
  import { ClientCredentialsObject } from '@zapier/zapier-sdk';
3
+ export { ZapierAuthenticationError } from '@zapier/zapier-sdk';
3
4
  import { z } from 'zod';
4
5
 
5
6
  declare const DEFAULT_AUTH_BASE_URL = "https://zapier.com";
@@ -59,15 +60,6 @@ declare function clearTokensFromKeychain({ debugLog, }?: {
59
60
  * Provides getToken function that can be optionally imported by zapier-sdk.
60
61
  */
61
62
 
62
- /**
63
- * Authentication error for token refresh failures.
64
- * This is a standalone clone of ZapierAuthenticationError from the SDK.
65
- * We can't import from SDK because cli-login must remain a standalone package
66
- * with no SDK dependencies. The SDK recognizes this error by name.
67
- */
68
- declare class ZapierAuthenticationError extends Error {
69
- constructor(message: string);
70
- }
71
63
  interface PkceCredentials {
72
64
  type: "pkce";
73
65
  clientId: string;
@@ -168,4 +160,4 @@ declare function logout(options?: Pick<AuthOptions, "onEvent">): Promise<void>;
168
160
  */
169
161
  declare function getConfigPath(): string;
170
162
 
171
- export { AUTH_MODE_HEADER, type AuthOptions, DEFAULT_AUTH_BASE_URL, type LoginData, type LoginStorageMode, type PkceCredentials, type PkceLoginConfig, ZapierAuthenticationError, clearTokensFromKeychain, createCache, getActiveCredentials, getAuthAuthorizeUrl, getAuthTokenUrl, getConfig, getConfigPath, getLoggedInUser, getLoginStorageMode, getPkceLoginConfig, getStoredClientCredentials, getToken, logout, unloadConfig, updateLogin };
163
+ export { AUTH_MODE_HEADER, type AuthOptions, DEFAULT_AUTH_BASE_URL, type LoginData, type LoginStorageMode, type PkceCredentials, type PkceLoginConfig, clearTokensFromKeychain, createCache, getActiveCredentials, getAuthAuthorizeUrl, getAuthTokenUrl, getConfig, getConfigPath, getLoggedInUser, getLoginStorageMode, getPkceLoginConfig, getStoredClientCredentials, getToken, logout, unloadConfig, updateLogin };
package/dist/login.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Conf from 'conf';
2
2
  import { ClientCredentialsObject } from '@zapier/zapier-sdk';
3
+ export { ZapierAuthenticationError } from '@zapier/zapier-sdk';
3
4
  import { z } from 'zod';
4
5
 
5
6
  declare const DEFAULT_AUTH_BASE_URL = "https://zapier.com";
@@ -59,15 +60,6 @@ declare function clearTokensFromKeychain({ debugLog, }?: {
59
60
  * Provides getToken function that can be optionally imported by zapier-sdk.
60
61
  */
61
62
 
62
- /**
63
- * Authentication error for token refresh failures.
64
- * This is a standalone clone of ZapierAuthenticationError from the SDK.
65
- * We can't import from SDK because cli-login must remain a standalone package
66
- * with no SDK dependencies. The SDK recognizes this error by name.
67
- */
68
- declare class ZapierAuthenticationError extends Error {
69
- constructor(message: string);
70
- }
71
63
  interface PkceCredentials {
72
64
  type: "pkce";
73
65
  clientId: string;
@@ -168,4 +160,4 @@ declare function logout(options?: Pick<AuthOptions, "onEvent">): Promise<void>;
168
160
  */
169
161
  declare function getConfigPath(): string;
170
162
 
171
- export { AUTH_MODE_HEADER, type AuthOptions, DEFAULT_AUTH_BASE_URL, type LoginData, type LoginStorageMode, type PkceCredentials, type PkceLoginConfig, ZapierAuthenticationError, clearTokensFromKeychain, createCache, getActiveCredentials, getAuthAuthorizeUrl, getAuthTokenUrl, getConfig, getConfigPath, getLoggedInUser, getLoginStorageMode, getPkceLoginConfig, getStoredClientCredentials, getToken, logout, unloadConfig, updateLogin };
163
+ export { AUTH_MODE_HEADER, type AuthOptions, DEFAULT_AUTH_BASE_URL, type LoginData, type LoginStorageMode, type PkceCredentials, type PkceLoginConfig, clearTokensFromKeychain, createCache, getActiveCredentials, getAuthAuthorizeUrl, getAuthTokenUrl, getConfig, getConfigPath, getLoggedInUser, getLoginStorageMode, getPkceLoginConfig, getStoredClientCredentials, getToken, logout, unloadConfig, updateLogin };
package/dist/login.mjs CHANGED
@@ -5,6 +5,8 @@ import { existsSync, mkdirSync, writeFileSync } from 'fs';
5
5
  import { createHash } from 'crypto';
6
6
  import { dirname } from 'path';
7
7
  import * as lockfile from 'proper-lockfile';
8
+ import { ZapierAuthenticationError } from '@zapier/zapier-sdk';
9
+ export { ZapierAuthenticationError } from '@zapier/zapier-sdk';
8
10
  import { z } from 'zod';
9
11
 
10
12
  // src/login/index.ts
@@ -293,12 +295,6 @@ async function getStoredClientCredentials(options) {
293
295
  }
294
296
 
295
297
  // src/login/index.ts
296
- var ZapierAuthenticationError = class extends Error {
297
- constructor(message) {
298
- super(message);
299
- this.name = "ZapierAuthenticationError";
300
- }
301
- };
302
298
  var DEFAULT_AUTH_CLIENT_ID = "grwWZD5hUWGvb4V8ODBuOtXer3h0DBEZ2HR8aay6";
303
299
  var TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1e3;
304
300
  function createDebugLog(enabled) {
@@ -308,9 +304,9 @@ function createDebugLog(enabled) {
308
304
  }
309
305
  return (message, data) => {
310
306
  if (data === void 0) {
311
- console.log(`[Zapier SDK CLI Login] ${message}`);
307
+ console.error(`[Zapier SDK CLI Login] ${message}`);
312
308
  } else {
313
- console.log(`[Zapier SDK CLI Login] ${message}`, data);
309
+ console.error(`[Zapier SDK CLI Login] ${message}`, data);
314
310
  }
315
311
  };
316
312
  }
@@ -627,4 +623,4 @@ function getConfigPath() {
627
623
  return cfg.path;
628
624
  }
629
625
 
630
- export { AUTH_MODE_HEADER, DEFAULT_AUTH_BASE_URL, ZapierAuthenticationError, clearTokensFromKeychain, createCache, getActiveCredentials, getAuthAuthorizeUrl, getAuthTokenUrl, getConfig, getConfigPath, getLoggedInUser, getLoginStorageMode, getPkceLoginConfig, getStoredClientCredentials, getToken, logout, unloadConfig, updateLogin };
626
+ export { AUTH_MODE_HEADER, DEFAULT_AUTH_BASE_URL, clearTokensFromKeychain, createCache, getActiveCredentials, getAuthAuthorizeUrl, getAuthTokenUrl, getConfig, getConfigPath, getLoggedInUser, getLoginStorageMode, getPkceLoginConfig, getStoredClientCredentials, getToken, logout, unloadConfig, updateLogin };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.52.10",
3
+ "version": "0.52.12",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",