@zapier/zapier-sdk-cli 0.16.6 → 0.16.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 +19 -0
- package/dist/cli.cjs +14 -10
- package/dist/cli.mjs +14 -10
- package/dist/index.cjs +9 -5
- package/dist/index.mjs +9 -5
- package/dist/package.json +1 -1
- package/dist/src/utils/auth/login.js +11 -3
- package/dist/src/utils/version-checker.js +5 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @zapier/zapier-sdk-cli
|
|
2
2
|
|
|
3
|
+
## 0.16.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 870f2aa: Fix CLI process hanging after login and on signal handling
|
|
8
|
+
- Clear login timeout timer after successful authentication to allow process exit
|
|
9
|
+
- Use timer.unref() on telemetry timeouts so they don't block process exit
|
|
10
|
+
- Add explicit process.exit() in signal handlers with correct exit codes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [870f2aa]
|
|
13
|
+
- @zapier/zapier-sdk@0.16.3
|
|
14
|
+
- @zapier/zapier-sdk-mcp@0.4.4
|
|
15
|
+
|
|
16
|
+
## 0.16.7
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 759d2d5: Fix update notification writing to stdout instead of stderr, which broke piping JSON output to jq
|
|
21
|
+
|
|
3
22
|
## 0.16.6
|
|
4
23
|
|
|
5
24
|
### 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
|
-
|
|
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.
|
|
1652
|
+
version: "0.16.8"};
|
|
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.
|
|
2931
|
+
version: "0.16.8"};
|
|
2928
2932
|
function detectPackageManager(cwd = process.cwd()) {
|
|
2929
2933
|
const ua = process.env.npm_config_user_agent;
|
|
2930
2934
|
if (ua) {
|
|
@@ -3104,18 +3108,18 @@ function displayUpdateNotification(versionInfo, packageName) {
|
|
|
3104
3108
|
console.error();
|
|
3105
3109
|
}
|
|
3106
3110
|
if (versionInfo.hasUpdate) {
|
|
3107
|
-
console.
|
|
3108
|
-
console.
|
|
3111
|
+
console.error();
|
|
3112
|
+
console.error(
|
|
3109
3113
|
chalk3__default.default.yellow.bold("\u{1F4E6} Update available!") + chalk3__default.default.yellow(
|
|
3110
3114
|
` ${packageName} v${versionInfo.currentVersion} \u2192 v${versionInfo.latestVersion}`
|
|
3111
3115
|
)
|
|
3112
3116
|
);
|
|
3113
|
-
console.
|
|
3117
|
+
console.error(
|
|
3114
3118
|
chalk3__default.default.yellow(
|
|
3115
3119
|
` Run ${chalk3__default.default.bold(getUpdateCommand(packageName))} to update.`
|
|
3116
3120
|
)
|
|
3117
3121
|
);
|
|
3118
|
-
console.
|
|
3122
|
+
console.error();
|
|
3119
3123
|
}
|
|
3120
3124
|
}
|
|
3121
3125
|
async function checkAndNotifyUpdates({
|
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
|
-
|
|
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.
|
|
1616
|
+
version: "0.16.8"};
|
|
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.
|
|
2895
|
+
version: "0.16.8"};
|
|
2892
2896
|
function detectPackageManager(cwd = process.cwd()) {
|
|
2893
2897
|
const ua = process.env.npm_config_user_agent;
|
|
2894
2898
|
if (ua) {
|
|
@@ -3068,18 +3072,18 @@ function displayUpdateNotification(versionInfo, packageName) {
|
|
|
3068
3072
|
console.error();
|
|
3069
3073
|
}
|
|
3070
3074
|
if (versionInfo.hasUpdate) {
|
|
3071
|
-
console.
|
|
3072
|
-
console.
|
|
3075
|
+
console.error();
|
|
3076
|
+
console.error(
|
|
3073
3077
|
chalk3.yellow.bold("\u{1F4E6} Update available!") + chalk3.yellow(
|
|
3074
3078
|
` ${packageName} v${versionInfo.currentVersion} \u2192 v${versionInfo.latestVersion}`
|
|
3075
3079
|
)
|
|
3076
3080
|
);
|
|
3077
|
-
console.
|
|
3081
|
+
console.error(
|
|
3078
3082
|
chalk3.yellow(
|
|
3079
3083
|
` Run ${chalk3.bold(getUpdateCommand(packageName))} to update.`
|
|
3080
3084
|
)
|
|
3081
3085
|
);
|
|
3082
|
-
console.
|
|
3086
|
+
console.error();
|
|
3083
3087
|
}
|
|
3084
3088
|
}
|
|
3085
3089
|
async function checkAndNotifyUpdates({
|
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
|
-
|
|
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.
|
|
298
|
+
version: "0.16.8"};
|
|
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
|
-
|
|
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.
|
|
267
|
+
version: "0.16.8"};
|
|
264
268
|
|
|
265
269
|
// src/telemetry/builders.ts
|
|
266
270
|
function createCliBaseEvent(context = {}) {
|
package/dist/package.json
CHANGED
|
@@ -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) =>
|
|
99
|
-
|
|
100
|
-
|
|
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);
|
|
@@ -138,12 +138,13 @@ export function displayUpdateNotification(versionInfo, packageName) {
|
|
|
138
138
|
console.error(chalk.red(` Please update to the latest version.`));
|
|
139
139
|
console.error();
|
|
140
140
|
}
|
|
141
|
+
// Use stderr so update notifications don't pollute stdout when piping JSON to jq
|
|
141
142
|
if (versionInfo.hasUpdate) {
|
|
142
|
-
console.
|
|
143
|
-
console.
|
|
143
|
+
console.error();
|
|
144
|
+
console.error(chalk.yellow.bold("📦 Update available!") +
|
|
144
145
|
chalk.yellow(` ${packageName} v${versionInfo.currentVersion} → v${versionInfo.latestVersion}`));
|
|
145
|
-
console.
|
|
146
|
-
console.
|
|
146
|
+
console.error(chalk.yellow(` Run ${chalk.bold(getUpdateCommand(packageName))} to update.`));
|
|
147
|
+
console.error();
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
150
|
export async function checkAndNotifyUpdates({ packageName, currentVersion, }) {
|