@zapier/zapier-sdk-cli 0.16.7 → 0.16.9

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.16.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [79b47f7]
8
+ - @zapier/zapier-sdk@0.17.0
9
+ - @zapier/zapier-sdk-mcp@0.4.5
10
+
11
+ ## 0.16.8
12
+
13
+ ### Patch Changes
14
+
15
+ - 870f2aa: Fix CLI process hanging after login and on signal handling
16
+ - Clear login timeout timer after successful authentication to allow process exit
17
+ - Use timer.unref() on telemetry timeouts so they don't block process exit
18
+ - Add explicit process.exit() in signal handlers with correct exit codes
19
+
20
+ - Updated dependencies [870f2aa]
21
+ - @zapier/zapier-sdk@0.16.3
22
+ - @zapier/zapier-sdk-mcp@0.4.4
23
+
3
24
  ## 0.16.7
4
25
 
5
26
  ### Patch Changes
package/dist/cli.cjs CHANGED
@@ -1586,23 +1586,27 @@ var login = async ({
1586
1586
  log_default.info("Opening your browser to log in.");
1587
1587
  log_default.info("If it doesn't open, visit:", authUrl);
1588
1588
  open__default.default(authUrl);
1589
+ let timeoutTimer;
1589
1590
  try {
1590
1591
  await spinPromise(
1591
1592
  Promise.race([
1592
1593
  promisedCode,
1593
- new Promise(
1594
- (_resolve, reject) => setTimeout(() => {
1594
+ new Promise((_resolve, reject) => {
1595
+ timeoutTimer = setTimeout(() => {
1595
1596
  reject(
1596
1597
  new Error(
1597
1598
  `Login timed out after ${Math.round(timeoutMs / 1e3)} seconds.`
1598
1599
  )
1599
1600
  );
1600
- }, timeoutMs)
1601
- )
1601
+ }, timeoutMs);
1602
+ })
1602
1603
  ]),
1603
1604
  "Waiting for you to login and authorize"
1604
1605
  );
1605
1606
  } finally {
1607
+ if (timeoutTimer) {
1608
+ clearTimeout(timeoutTimer);
1609
+ }
1606
1610
  process.off("SIGINT", cleanup);
1607
1611
  process.off("SIGTERM", cleanup);
1608
1612
  await new Promise((resolve4) => {
@@ -1645,7 +1649,7 @@ var LoginSchema = zod.z.object({
1645
1649
 
1646
1650
  // package.json
1647
1651
  var package_default = {
1648
- version: "0.16.7"};
1652
+ version: "0.16.9"};
1649
1653
 
1650
1654
  // src/telemetry/builders.ts
1651
1655
  function createCliBaseEvent(context = {}) {
@@ -2924,7 +2928,7 @@ function createZapierCliSdk(options = {}) {
2924
2928
  // package.json with { type: 'json' }
2925
2929
  var package_default2 = {
2926
2930
  name: "@zapier/zapier-sdk-cli",
2927
- version: "0.16.7"};
2931
+ version: "0.16.9"};
2928
2932
  function detectPackageManager(cwd = process.cwd()) {
2929
2933
  const ua = process.env.npm_config_user_agent;
2930
2934
  if (ua) {
package/dist/cli.mjs CHANGED
@@ -1550,23 +1550,27 @@ var login = async ({
1550
1550
  log_default.info("Opening your browser to log in.");
1551
1551
  log_default.info("If it doesn't open, visit:", authUrl);
1552
1552
  open(authUrl);
1553
+ let timeoutTimer;
1553
1554
  try {
1554
1555
  await spinPromise(
1555
1556
  Promise.race([
1556
1557
  promisedCode,
1557
- new Promise(
1558
- (_resolve, reject) => setTimeout(() => {
1558
+ new Promise((_resolve, reject) => {
1559
+ timeoutTimer = setTimeout(() => {
1559
1560
  reject(
1560
1561
  new Error(
1561
1562
  `Login timed out after ${Math.round(timeoutMs / 1e3)} seconds.`
1562
1563
  )
1563
1564
  );
1564
- }, timeoutMs)
1565
- )
1565
+ }, timeoutMs);
1566
+ })
1566
1567
  ]),
1567
1568
  "Waiting for you to login and authorize"
1568
1569
  );
1569
1570
  } finally {
1571
+ if (timeoutTimer) {
1572
+ clearTimeout(timeoutTimer);
1573
+ }
1570
1574
  process.off("SIGINT", cleanup);
1571
1575
  process.off("SIGTERM", cleanup);
1572
1576
  await new Promise((resolve4) => {
@@ -1609,7 +1613,7 @@ var LoginSchema = z.object({
1609
1613
 
1610
1614
  // package.json
1611
1615
  var package_default = {
1612
- version: "0.16.7"};
1616
+ version: "0.16.9"};
1613
1617
 
1614
1618
  // src/telemetry/builders.ts
1615
1619
  function createCliBaseEvent(context = {}) {
@@ -2888,7 +2892,7 @@ function createZapierCliSdk(options = {}) {
2888
2892
  // package.json with { type: 'json' }
2889
2893
  var package_default2 = {
2890
2894
  name: "@zapier/zapier-sdk-cli",
2891
- version: "0.16.7"};
2895
+ version: "0.16.9"};
2892
2896
  function detectPackageManager(cwd = process.cwd()) {
2893
2897
  const ua = process.env.npm_config_user_agent;
2894
2898
  if (ua) {
package/dist/index.cjs CHANGED
@@ -232,23 +232,27 @@ var login = async ({
232
232
  log_default.info("Opening your browser to log in.");
233
233
  log_default.info("If it doesn't open, visit:", authUrl);
234
234
  open__default.default(authUrl);
235
+ let timeoutTimer;
235
236
  try {
236
237
  await spinPromise(
237
238
  Promise.race([
238
239
  promisedCode,
239
- new Promise(
240
- (_resolve, reject) => setTimeout(() => {
240
+ new Promise((_resolve, reject) => {
241
+ timeoutTimer = setTimeout(() => {
241
242
  reject(
242
243
  new Error(
243
244
  `Login timed out after ${Math.round(timeoutMs / 1e3)} seconds.`
244
245
  )
245
246
  );
246
- }, timeoutMs)
247
- )
247
+ }, timeoutMs);
248
+ })
248
249
  ]),
249
250
  "Waiting for you to login and authorize"
250
251
  );
251
252
  } finally {
253
+ if (timeoutTimer) {
254
+ clearTimeout(timeoutTimer);
255
+ }
252
256
  process.off("SIGINT", cleanup);
253
257
  process.off("SIGTERM", cleanup);
254
258
  await new Promise((resolve4) => {
@@ -291,7 +295,7 @@ var LoginSchema = zod.z.object({
291
295
 
292
296
  // package.json
293
297
  var package_default = {
294
- version: "0.16.7"};
298
+ version: "0.16.9"};
295
299
 
296
300
  // src/telemetry/builders.ts
297
301
  function createCliBaseEvent(context = {}) {
package/dist/index.mjs CHANGED
@@ -201,23 +201,27 @@ var login = async ({
201
201
  log_default.info("Opening your browser to log in.");
202
202
  log_default.info("If it doesn't open, visit:", authUrl);
203
203
  open(authUrl);
204
+ let timeoutTimer;
204
205
  try {
205
206
  await spinPromise(
206
207
  Promise.race([
207
208
  promisedCode,
208
- new Promise(
209
- (_resolve, reject) => setTimeout(() => {
209
+ new Promise((_resolve, reject) => {
210
+ timeoutTimer = setTimeout(() => {
210
211
  reject(
211
212
  new Error(
212
213
  `Login timed out after ${Math.round(timeoutMs / 1e3)} seconds.`
213
214
  )
214
215
  );
215
- }, timeoutMs)
216
- )
216
+ }, timeoutMs);
217
+ })
217
218
  ]),
218
219
  "Waiting for you to login and authorize"
219
220
  );
220
221
  } finally {
222
+ if (timeoutTimer) {
223
+ clearTimeout(timeoutTimer);
224
+ }
221
225
  process.off("SIGINT", cleanup);
222
226
  process.off("SIGTERM", cleanup);
223
227
  await new Promise((resolve4) => {
@@ -260,7 +264,7 @@ var LoginSchema = z.object({
260
264
 
261
265
  // package.json
262
266
  var package_default = {
263
- version: "0.16.7"};
267
+ version: "0.16.9"};
264
268
 
265
269
  // src/telemetry/builders.ts
266
270
  function createCliBaseEvent(context = {}) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-cli",
3
- "version": "0.16.7",
3
+ "version": "0.16.9",
4
4
  "description": "Command line interface for Zapier SDK",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -92,15 +92,23 @@ const login = async ({ timeoutMs = LOGIN_TIMEOUT_MS, baseUrl, authBaseUrl, authC
92
92
  log.info("Opening your browser to log in.");
93
93
  log.info("If it doesn't open, visit:", authUrl);
94
94
  open(authUrl);
95
+ // Track the timeout timer so we can cancel it after login succeeds
96
+ let timeoutTimer;
95
97
  try {
96
98
  await spinPromise(Promise.race([
97
99
  promisedCode,
98
- new Promise((_resolve, reject) => setTimeout(() => {
99
- reject(new Error(`Login timed out after ${Math.round(timeoutMs / 1000)} seconds.`));
100
- }, timeoutMs)),
100
+ new Promise((_resolve, reject) => {
101
+ timeoutTimer = setTimeout(() => {
102
+ reject(new Error(`Login timed out after ${Math.round(timeoutMs / 1000)} seconds.`));
103
+ }, timeoutMs);
104
+ }),
101
105
  ]), "Waiting for you to login and authorize");
102
106
  }
103
107
  finally {
108
+ // Clear the timeout timer to prevent it from keeping the process alive
109
+ if (timeoutTimer) {
110
+ clearTimeout(timeoutTimer);
111
+ }
104
112
  // Remove signal handlers
105
113
  process.off("SIGINT", cleanup);
106
114
  process.off("SIGTERM", cleanup);