@zapier/zapier-sdk 0.22.1 → 0.23.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.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7cf2b12: Add debug logging to zapier-sdk-cli-login. Only allow one token refresh at a time.
8
+
3
9
  ## 0.22.1
4
10
 
5
11
  ### Patch Changes
@@ -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,EAGjB,MAAM,SAAS,CAAC;AA0gBjB,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,SAW3D,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,EAGjB,MAAM,SAAS,CAAC;AA2gBjB,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,SAW3D,CAAC"}
@@ -77,6 +77,7 @@ class ZapierApiClient {
77
77
  fetch: this.options.fetch,
78
78
  baseUrl: this.options.baseUrl,
79
79
  requiredScopes: options?.requiredScopes,
80
+ debug: this.options.debug,
80
81
  });
81
82
  }
82
83
  // Helper to handle responses
@@ -37,6 +37,8 @@ describe("ApiClient", () => {
37
37
  onEvent: undefined,
38
38
  fetch: expect.any(Function),
39
39
  baseUrl: "https://api.custom.zapier.dev",
40
+ requiredScopes: undefined,
41
+ debug: false,
40
42
  });
41
43
  });
42
44
  it("should pass undefined credentials when not provided", async () => {
@@ -53,6 +55,8 @@ describe("ApiClient", () => {
53
55
  onEvent: undefined,
54
56
  fetch: expect.any(Function),
55
57
  baseUrl: "https://api.custom.zapier.dev",
58
+ requiredScopes: undefined,
59
+ debug: false,
56
60
  });
57
61
  });
58
62
  it("should pass deprecated token option to resolveAuthToken", async () => {
@@ -71,6 +75,8 @@ describe("ApiClient", () => {
71
75
  onEvent: undefined,
72
76
  fetch: expect.any(Function),
73
77
  baseUrl: "https://api.custom.zapier.dev",
78
+ requiredScopes: undefined,
79
+ debug: false,
74
80
  });
75
81
  });
76
82
  it("should pass string credentials to resolveAuthToken", async () => {
@@ -87,6 +93,8 @@ describe("ApiClient", () => {
87
93
  onEvent: undefined,
88
94
  fetch: expect.any(Function),
89
95
  baseUrl: "https://api.custom.zapier.dev",
96
+ requiredScopes: undefined,
97
+ debug: false,
90
98
  });
91
99
  });
92
100
  it("should pass credentials function to resolveAuthToken", async () => {
@@ -104,6 +112,8 @@ describe("ApiClient", () => {
104
112
  onEvent: undefined,
105
113
  fetch: expect.any(Function),
106
114
  baseUrl: "https://api.custom.zapier.dev",
115
+ requiredScopes: undefined,
116
+ debug: false,
107
117
  });
108
118
  });
109
119
  });
package/dist/auth.d.ts CHANGED
@@ -29,6 +29,8 @@ export interface ResolveAuthTokenOptions {
29
29
  * the credentials object during token exchange.
30
30
  */
31
31
  requiredScopes?: string[];
32
+ /** Enable debug logging for auth operations. */
33
+ debug?: boolean;
32
34
  }
33
35
  /**
34
36
  * Clear the token cache. Useful for testing or forcing re-authentication.
@@ -51,6 +53,7 @@ interface CliLoginOptions {
51
53
  baseUrl?: string;
52
54
  scope?: string;
53
55
  };
56
+ debug?: boolean;
54
57
  }
55
58
  /**
56
59
  * Attempts to get a token by optionally importing from CLI login package.
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,qBAAqB,CAAC;AAM5E,YAAY,EACV,QAAQ,E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AAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EAAE,GACf,IAAI,CAIN;AA6HD;;GAEG;AACH,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC,WAAW,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgB7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkB7B;AA6ED;;;;GAIG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE;IACxD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhB"}
package/dist/auth.js CHANGED
@@ -220,6 +220,7 @@ export async function resolveAuthToken(options = {}) {
220
220
  return getTokenFromCliLogin({
221
221
  onEvent: options.onEvent,
222
222
  fetch: options.fetch,
223
+ debug: options.debug,
223
224
  });
224
225
  }
225
226
  /**
@@ -269,6 +270,7 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
269
270
  onEvent: options.onEvent,
270
271
  fetch: options.fetch,
271
272
  credentials,
273
+ debug: options.debug,
272
274
  });
273
275
  if (storedToken) {
274
276
  return storedToken;
package/dist/index.cjs CHANGED
@@ -4068,7 +4068,8 @@ async function resolveAuthToken(options = {}) {
4068
4068
  }
4069
4069
  return getTokenFromCliLogin({
4070
4070
  onEvent: options.onEvent,
4071
- fetch: options.fetch
4071
+ fetch: options.fetch,
4072
+ debug: options.debug
4072
4073
  });
4073
4074
  }
4074
4075
  async function resolveAuthTokenFromCredentials(credentials, options) {
@@ -4105,7 +4106,8 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
4105
4106
  const storedToken = await getTokenFromCliLogin({
4106
4107
  onEvent: options.onEvent,
4107
4108
  fetch: options.fetch,
4108
- credentials
4109
+ credentials,
4110
+ debug: options.debug
4109
4111
  });
4110
4112
  if (storedToken) {
4111
4113
  return storedToken;
@@ -4189,7 +4191,8 @@ var ZapierApiClient = class {
4189
4191
  onEvent: this.options.onEvent,
4190
4192
  fetch: this.options.fetch,
4191
4193
  baseUrl: this.options.baseUrl,
4192
- requiredScopes: options?.requiredScopes
4194
+ requiredScopes: options?.requiredScopes,
4195
+ debug: this.options.debug
4193
4196
  });
4194
4197
  }
4195
4198
  // Helper to handle responses
@@ -5081,7 +5084,7 @@ function getCpuTime() {
5081
5084
 
5082
5085
  // package.json
5083
5086
  var package_default = {
5084
- version: "0.22.1"};
5087
+ version: "0.23.0"};
5085
5088
 
5086
5089
  // src/plugins/eventEmission/builders.ts
5087
5090
  function createBaseEvent(context = {}) {
package/dist/index.d.mts CHANGED
@@ -2360,6 +2360,8 @@ interface ResolveAuthTokenOptions {
2360
2360
  * the credentials object during token exchange.
2361
2361
  */
2362
2362
  requiredScopes?: string[];
2363
+ /** Enable debug logging for auth operations. */
2364
+ debug?: boolean;
2363
2365
  }
2364
2366
  /**
2365
2367
  * Clear the token cache. Useful for testing or forcing re-authentication.
@@ -2382,6 +2384,7 @@ interface CliLoginOptions {
2382
2384
  baseUrl?: string;
2383
2385
  scope?: string;
2384
2386
  };
2387
+ debug?: boolean;
2385
2388
  }
2386
2389
  /**
2387
2390
  * Attempts to get a token by optionally importing from CLI login package.
package/dist/index.mjs CHANGED
@@ -4046,7 +4046,8 @@ async function resolveAuthToken(options = {}) {
4046
4046
  }
4047
4047
  return getTokenFromCliLogin({
4048
4048
  onEvent: options.onEvent,
4049
- fetch: options.fetch
4049
+ fetch: options.fetch,
4050
+ debug: options.debug
4050
4051
  });
4051
4052
  }
4052
4053
  async function resolveAuthTokenFromCredentials(credentials, options) {
@@ -4083,7 +4084,8 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
4083
4084
  const storedToken = await getTokenFromCliLogin({
4084
4085
  onEvent: options.onEvent,
4085
4086
  fetch: options.fetch,
4086
- credentials
4087
+ credentials,
4088
+ debug: options.debug
4087
4089
  });
4088
4090
  if (storedToken) {
4089
4091
  return storedToken;
@@ -4167,7 +4169,8 @@ var ZapierApiClient = class {
4167
4169
  onEvent: this.options.onEvent,
4168
4170
  fetch: this.options.fetch,
4169
4171
  baseUrl: this.options.baseUrl,
4170
- requiredScopes: options?.requiredScopes
4172
+ requiredScopes: options?.requiredScopes,
4173
+ debug: this.options.debug
4171
4174
  });
4172
4175
  }
4173
4176
  // Helper to handle responses
@@ -5059,7 +5062,7 @@ function getCpuTime() {
5059
5062
 
5060
5063
  // package.json
5061
5064
  var package_default = {
5062
- version: "0.22.1"};
5065
+ version: "0.23.0"};
5063
5066
 
5064
5067
  // src/plugins/eventEmission/builders.ts
5065
5068
  function createBaseEvent(context = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.22.1",
3
+ "version": "0.23.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -44,7 +44,7 @@
44
44
  "tsup": "^8.5.0",
45
45
  "typescript": "^5.8.3",
46
46
  "vitest": "^3.2.3",
47
- "@zapier/zapier-sdk-cli-login": "0.6.0"
47
+ "@zapier/zapier-sdk-cli-login": "0.7.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsup",