@zapier/zapier-sdk-cli 0.34.9 → 0.34.11
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 +18 -0
- package/dist/cli.cjs +244 -219
- package/dist/cli.mjs +244 -219
- package/dist/index.cjs +5 -2
- package/dist/index.mjs +5 -2
- package/dist/package.json +1 -1
- package/dist/src/plugins/cliOverrides/index.d.ts +2 -1
- package/dist/src/plugins/cliOverrides/index.js +3 -0
- package/dist/src/utils/cli-generator.js +14 -0
- package/dist/src/utils/parameter-resolver.d.ts +1 -1
- package/dist/src/utils/parameter-resolver.js +144 -140
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/cli.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var commander = require('commander');
|
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
var zapierSdk = require('@zapier/zapier-sdk');
|
|
7
7
|
var inquirer = require('inquirer');
|
|
8
|
-
var
|
|
8
|
+
var chalk3 = require('chalk');
|
|
9
9
|
var util = require('util');
|
|
10
10
|
var cliLogin = require('@zapier/zapier-sdk-cli-login');
|
|
11
11
|
var open = require('open');
|
|
@@ -48,7 +48,7 @@ function _interopNamespace(e) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
var inquirer__default = /*#__PURE__*/_interopDefault(inquirer);
|
|
51
|
-
var
|
|
51
|
+
var chalk3__default = /*#__PURE__*/_interopDefault(chalk3);
|
|
52
52
|
var util__default = /*#__PURE__*/_interopDefault(util);
|
|
53
53
|
var cliLogin__namespace = /*#__PURE__*/_interopNamespace(cliLogin);
|
|
54
54
|
var open__default = /*#__PURE__*/_interopDefault(open);
|
|
@@ -119,139 +119,105 @@ function getLocalResolutionOrderForParams(paramNames, resolvers) {
|
|
|
119
119
|
}
|
|
120
120
|
var SchemaParameterResolver = class {
|
|
121
121
|
async resolveParameters(schema, providedParams, sdk2, functionName) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const missingResolvable = resolvableParams.filter((param) => {
|
|
128
|
-
const hasValue = this.getNestedValue(providedParams, param.path) !== void 0;
|
|
129
|
-
return !hasValue;
|
|
130
|
-
});
|
|
131
|
-
const functionallyRequired = missingResolvable.filter((param) => {
|
|
132
|
-
if (param.isRequired) return true;
|
|
133
|
-
if (param.name === "inputs") {
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
136
|
-
return false;
|
|
137
|
-
});
|
|
138
|
-
const alwaysPrompt = missingResolvable.filter((param) => {
|
|
139
|
-
if (functionallyRequired.includes(param)) return false;
|
|
140
|
-
if (param.name === "connectionId") {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
return false;
|
|
144
|
-
});
|
|
145
|
-
const trulyOptional = missingResolvable.filter(
|
|
146
|
-
(param) => !functionallyRequired.includes(param) && !alwaysPrompt.includes(param)
|
|
147
|
-
);
|
|
148
|
-
if (parseResult.success && functionallyRequired.length === 0 && alwaysPrompt.length === 0) {
|
|
149
|
-
return parseResult.data;
|
|
150
|
-
}
|
|
151
|
-
if (functionallyRequired.length === 0 && alwaysPrompt.length === 0) {
|
|
152
|
-
if (!parseResult.success) {
|
|
153
|
-
throw parseResult.error;
|
|
154
|
-
}
|
|
155
|
-
return parseResult.data;
|
|
156
|
-
}
|
|
157
|
-
const resolvedParams = { ...providedParams };
|
|
158
|
-
const context = {
|
|
159
|
-
sdk: sdk2,
|
|
160
|
-
currentParams: providedParams,
|
|
161
|
-
resolvedParams,
|
|
162
|
-
functionName
|
|
163
|
-
};
|
|
164
|
-
const localResolvers = this.getLocalResolvers(sdk2, functionName);
|
|
165
|
-
if (functionallyRequired.length > 0) {
|
|
166
|
-
const requiredParamNames = functionallyRequired.map((p) => p.name);
|
|
167
|
-
const requiredResolutionOrder = getLocalResolutionOrderForParams(
|
|
168
|
-
requiredParamNames,
|
|
169
|
-
localResolvers
|
|
122
|
+
return zapierSdk.runWithTelemetryContext(async () => {
|
|
123
|
+
const parseResult = schema.safeParse(providedParams);
|
|
124
|
+
const allParams = this.extractParametersFromSchema(schema);
|
|
125
|
+
const resolvableParams = allParams.filter(
|
|
126
|
+
(param) => this.hasResolver(param.name, sdk2, functionName)
|
|
170
127
|
);
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
128
|
+
const missingResolvable = resolvableParams.filter((param) => {
|
|
129
|
+
const hasValue = this.getNestedValue(providedParams, param.path) !== void 0;
|
|
130
|
+
return !hasValue;
|
|
131
|
+
});
|
|
132
|
+
const functionallyRequired = missingResolvable.filter((param) => {
|
|
133
|
+
if (param.isRequired) return true;
|
|
134
|
+
if (param.name === "inputs") {
|
|
135
|
+
return true;
|
|
175
136
|
}
|
|
176
|
-
|
|
177
|
-
|
|
137
|
+
return false;
|
|
138
|
+
});
|
|
139
|
+
const alwaysPrompt = missingResolvable.filter((param) => {
|
|
140
|
+
if (functionallyRequired.includes(param)) return false;
|
|
141
|
+
if (param.name === "connectionId") {
|
|
142
|
+
return true;
|
|
178
143
|
}
|
|
179
|
-
return
|
|
180
|
-
})
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
} catch (error) {
|
|
191
|
-
if (this.isUserCancellation(error)) {
|
|
192
|
-
console.log(chalk6__default.default.yellow("\n\nOperation cancelled by user"));
|
|
193
|
-
throw new ZapierCliUserCancellationError();
|
|
194
|
-
}
|
|
195
|
-
throw error;
|
|
144
|
+
return false;
|
|
145
|
+
});
|
|
146
|
+
const trulyOptional = missingResolvable.filter(
|
|
147
|
+
(param) => !functionallyRequired.includes(param) && !alwaysPrompt.includes(param)
|
|
148
|
+
);
|
|
149
|
+
if (parseResult.success && functionallyRequired.length === 0 && alwaysPrompt.length === 0) {
|
|
150
|
+
return parseResult.data;
|
|
151
|
+
}
|
|
152
|
+
if (functionallyRequired.length === 0 && alwaysPrompt.length === 0) {
|
|
153
|
+
if (!parseResult.success) {
|
|
154
|
+
throw parseResult.error;
|
|
196
155
|
}
|
|
156
|
+
return parseResult.data;
|
|
197
157
|
}
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
158
|
+
const resolvedParams = { ...providedParams };
|
|
159
|
+
const context = {
|
|
160
|
+
sdk: sdk2,
|
|
161
|
+
currentParams: providedParams,
|
|
162
|
+
resolvedParams,
|
|
163
|
+
functionName
|
|
164
|
+
};
|
|
165
|
+
const localResolvers = this.getLocalResolvers(sdk2, functionName);
|
|
166
|
+
if (functionallyRequired.length > 0) {
|
|
167
|
+
const requiredParamNames = functionallyRequired.map((p) => p.name);
|
|
168
|
+
const requiredResolutionOrder = getLocalResolutionOrderForParams(
|
|
169
|
+
requiredParamNames,
|
|
170
|
+
localResolvers
|
|
171
|
+
);
|
|
172
|
+
const orderedRequiredParams = requiredResolutionOrder.map((paramName) => {
|
|
173
|
+
let param = functionallyRequired.find((p) => p.name === paramName);
|
|
174
|
+
if (!param) {
|
|
175
|
+
param = alwaysPrompt.find((p) => p.name === paramName);
|
|
176
|
+
}
|
|
177
|
+
if (!param) {
|
|
178
|
+
param = trulyOptional.find((p) => p.name === paramName);
|
|
179
|
+
}
|
|
180
|
+
return param;
|
|
181
|
+
}).filter((param) => param !== void 0);
|
|
182
|
+
for (const param of orderedRequiredParams) {
|
|
183
|
+
try {
|
|
184
|
+
const value = await this.resolveParameter(
|
|
185
|
+
param,
|
|
186
|
+
context,
|
|
187
|
+
functionName
|
|
188
|
+
);
|
|
189
|
+
this.setNestedValue(resolvedParams, param.path, value);
|
|
190
|
+
context.resolvedParams = resolvedParams;
|
|
191
|
+
} catch (error) {
|
|
192
|
+
if (this.isUserCancellation(error)) {
|
|
193
|
+
console.log(chalk3__default.default.yellow("\n\nOperation cancelled by user"));
|
|
194
|
+
throw new ZapierCliUserCancellationError();
|
|
195
|
+
}
|
|
196
|
+
throw error;
|
|
232
197
|
}
|
|
233
|
-
throw error;
|
|
234
198
|
}
|
|
199
|
+
const resolvedParamNames = new Set(
|
|
200
|
+
orderedRequiredParams.map((p) => p.name)
|
|
201
|
+
);
|
|
202
|
+
alwaysPrompt.splice(
|
|
203
|
+
0,
|
|
204
|
+
alwaysPrompt.length,
|
|
205
|
+
...alwaysPrompt.filter((p) => !resolvedParamNames.has(p.name))
|
|
206
|
+
);
|
|
207
|
+
trulyOptional.splice(
|
|
208
|
+
0,
|
|
209
|
+
trulyOptional.length,
|
|
210
|
+
...trulyOptional.filter((p) => !resolvedParamNames.has(p.name))
|
|
211
|
+
);
|
|
235
212
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
{
|
|
241
|
-
type: "confirm",
|
|
242
|
-
name: "resolveOptional",
|
|
243
|
-
message: `Would you like to be prompted for optional parameters (${optionalNames})?`,
|
|
244
|
-
default: false
|
|
245
|
-
}
|
|
246
|
-
]);
|
|
247
|
-
if (shouldResolveOptional.resolveOptional) {
|
|
248
|
-
const optionalParamNames = trulyOptional.map((p) => p.name);
|
|
249
|
-
const optionalResolutionOrder = getLocalResolutionOrderForParams(
|
|
250
|
-
optionalParamNames,
|
|
213
|
+
if (alwaysPrompt.length > 0) {
|
|
214
|
+
const alwaysPromptNames = alwaysPrompt.map((p) => p.name);
|
|
215
|
+
const alwaysPromptResolutionOrder = getLocalResolutionOrderForParams(
|
|
216
|
+
alwaysPromptNames,
|
|
251
217
|
localResolvers
|
|
252
218
|
);
|
|
253
|
-
const
|
|
254
|
-
for (const param of
|
|
219
|
+
const orderedAlwaysPromptParams = alwaysPromptResolutionOrder.map((paramName) => alwaysPrompt.find((p) => p.name === paramName)).filter((param) => param !== void 0);
|
|
220
|
+
for (const param of orderedAlwaysPromptParams) {
|
|
255
221
|
try {
|
|
256
222
|
const value = await this.resolveParameter(
|
|
257
223
|
param,
|
|
@@ -262,22 +228,60 @@ var SchemaParameterResolver = class {
|
|
|
262
228
|
context.resolvedParams = resolvedParams;
|
|
263
229
|
} catch (error) {
|
|
264
230
|
if (this.isUserCancellation(error)) {
|
|
265
|
-
console.log(
|
|
231
|
+
console.log(chalk3__default.default.yellow("\n\nOperation cancelled by user"));
|
|
266
232
|
throw new ZapierCliUserCancellationError();
|
|
267
233
|
}
|
|
268
234
|
throw error;
|
|
269
235
|
}
|
|
270
236
|
}
|
|
271
237
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
238
|
+
if (trulyOptional.length > 0) {
|
|
239
|
+
const optionalNames = trulyOptional.map((p) => p.name).join(", ");
|
|
240
|
+
const shouldResolveOptional = await inquirer__default.default.prompt([
|
|
241
|
+
{
|
|
242
|
+
type: "confirm",
|
|
243
|
+
name: "resolveOptional",
|
|
244
|
+
message: `Would you like to be prompted for optional parameters (${optionalNames})?`,
|
|
245
|
+
default: false
|
|
246
|
+
}
|
|
247
|
+
]);
|
|
248
|
+
if (shouldResolveOptional.resolveOptional) {
|
|
249
|
+
const optionalParamNames = trulyOptional.map((p) => p.name);
|
|
250
|
+
const optionalResolutionOrder = getLocalResolutionOrderForParams(
|
|
251
|
+
optionalParamNames,
|
|
252
|
+
localResolvers
|
|
253
|
+
);
|
|
254
|
+
const orderedOptionalParams = optionalResolutionOrder.map((paramName) => trulyOptional.find((p) => p.name === paramName)).filter(
|
|
255
|
+
(param) => param !== void 0
|
|
256
|
+
);
|
|
257
|
+
for (const param of orderedOptionalParams) {
|
|
258
|
+
try {
|
|
259
|
+
const value = await this.resolveParameter(
|
|
260
|
+
param,
|
|
261
|
+
context,
|
|
262
|
+
functionName
|
|
263
|
+
);
|
|
264
|
+
this.setNestedValue(resolvedParams, param.path, value);
|
|
265
|
+
context.resolvedParams = resolvedParams;
|
|
266
|
+
} catch (error) {
|
|
267
|
+
if (this.isUserCancellation(error)) {
|
|
268
|
+
console.log(chalk3__default.default.yellow("\n\nOperation cancelled by user"));
|
|
269
|
+
throw new ZapierCliUserCancellationError();
|
|
270
|
+
}
|
|
271
|
+
throw error;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const finalResult = schema.safeParse(resolvedParams);
|
|
277
|
+
if (!finalResult.success) {
|
|
278
|
+
console.error(
|
|
279
|
+
chalk3__default.default.red("\u274C Parameter validation failed after resolution:")
|
|
280
|
+
);
|
|
281
|
+
throw finalResult.error;
|
|
282
|
+
}
|
|
283
|
+
return finalResult.data;
|
|
284
|
+
});
|
|
281
285
|
}
|
|
282
286
|
extractParametersFromSchema(schema) {
|
|
283
287
|
const parameters = [];
|
|
@@ -325,7 +329,7 @@ var SchemaParameterResolver = class {
|
|
|
325
329
|
if (!resolver) {
|
|
326
330
|
throw new Error(`No resolver found for parameter: ${param.name}`);
|
|
327
331
|
}
|
|
328
|
-
console.log(
|
|
332
|
+
console.log(chalk3__default.default.blue(`
|
|
329
333
|
\u{1F50D} Resolving ${param.name}...`));
|
|
330
334
|
if (resolver.type === "static") {
|
|
331
335
|
const staticResolver = resolver;
|
|
@@ -354,7 +358,7 @@ var SchemaParameterResolver = class {
|
|
|
354
358
|
}
|
|
355
359
|
}
|
|
356
360
|
if (param.isRequired && param.name !== "connectionId") {
|
|
357
|
-
console.log(
|
|
361
|
+
console.log(chalk3__default.default.gray(`Fetching options for ${param.name}...`));
|
|
358
362
|
}
|
|
359
363
|
const items = await dynamicResolver.fetch(
|
|
360
364
|
context.sdk,
|
|
@@ -391,7 +395,7 @@ var SchemaParameterResolver = class {
|
|
|
391
395
|
}
|
|
392
396
|
};
|
|
393
397
|
console.log(
|
|
394
|
-
|
|
398
|
+
chalk3__default.default.gray(
|
|
395
399
|
`Fetching input fields for ${param.name}${iteration > 1 ? ` (iteration ${iteration})` : ""}...`
|
|
396
400
|
)
|
|
397
401
|
);
|
|
@@ -402,7 +406,7 @@ var SchemaParameterResolver = class {
|
|
|
402
406
|
if (!rootFieldItems || rootFieldItems.length === 0) {
|
|
403
407
|
if (iteration === 1) {
|
|
404
408
|
console.log(
|
|
405
|
-
|
|
409
|
+
chalk3__default.default.yellow(`No input fields required for this action.`)
|
|
406
410
|
);
|
|
407
411
|
}
|
|
408
412
|
break;
|
|
@@ -424,7 +428,7 @@ var SchemaParameterResolver = class {
|
|
|
424
428
|
}
|
|
425
429
|
if (iteration >= maxIterations) {
|
|
426
430
|
console.log(
|
|
427
|
-
|
|
431
|
+
chalk3__default.default.yellow(
|
|
428
432
|
`
|
|
429
433
|
\u26A0\uFE0F Maximum field resolution iterations reached. Some dynamic fields may not have been discovered.`
|
|
430
434
|
)
|
|
@@ -446,7 +450,7 @@ var SchemaParameterResolver = class {
|
|
|
446
450
|
const fieldsetTitle = typedItem.title || typedItem.key;
|
|
447
451
|
const pathDisplay = fieldsetPath.length > 0 ? ` (in ${fieldsetPath.join(" > ")})` : "";
|
|
448
452
|
console.log(
|
|
449
|
-
|
|
453
|
+
chalk3__default.default.cyan(
|
|
450
454
|
`
|
|
451
455
|
\u{1F4C1} Processing fieldset: ${fieldsetTitle}${pathDisplay}`
|
|
452
456
|
)
|
|
@@ -478,7 +482,7 @@ var SchemaParameterResolver = class {
|
|
|
478
482
|
newRequiredCount++;
|
|
479
483
|
if (newRequiredCount === 1 && fieldsetPath.length === 0) {
|
|
480
484
|
console.log(
|
|
481
|
-
|
|
485
|
+
chalk3__default.default.blue(
|
|
482
486
|
`
|
|
483
487
|
\u{1F4DD} Please provide values for the following ${iteration === 1 ? "" : "additional "}input fields:`
|
|
484
488
|
)
|
|
@@ -499,7 +503,7 @@ var SchemaParameterResolver = class {
|
|
|
499
503
|
if (optionalFields.length > 0) {
|
|
500
504
|
const pathContext = fieldsetPath.length > 0 ? ` in ${fieldsetPath.join(" > ")}` : "";
|
|
501
505
|
console.log(
|
|
502
|
-
|
|
506
|
+
chalk3__default.default.gray(
|
|
503
507
|
`
|
|
504
508
|
There are ${optionalFields.length} ${iteration === 1 ? "" : "additional "}optional field(s) available${pathContext}.`
|
|
505
509
|
)
|
|
@@ -514,7 +518,7 @@ There are ${optionalFields.length} ${iteration === 1 ? "" : "additional "}option
|
|
|
514
518
|
}
|
|
515
519
|
]);
|
|
516
520
|
if (shouldConfigureOptional.configure) {
|
|
517
|
-
console.log(
|
|
521
|
+
console.log(chalk3__default.default.cyan(`
|
|
518
522
|
Optional fields${pathContext}:`));
|
|
519
523
|
for (const field of optionalFields) {
|
|
520
524
|
await this.promptForField(field, targetInputs, context);
|
|
@@ -530,7 +534,7 @@ Optional fields${pathContext}:`));
|
|
|
530
534
|
}
|
|
531
535
|
} catch (error) {
|
|
532
536
|
if (this.isUserCancellation(error)) {
|
|
533
|
-
console.log(
|
|
537
|
+
console.log(chalk3__default.default.yellow("\n\nOperation cancelled by user"));
|
|
534
538
|
throw new ZapierCliUserCancellationError();
|
|
535
539
|
}
|
|
536
540
|
throw error;
|
|
@@ -585,7 +589,7 @@ Optional fields${pathContext}:`));
|
|
|
585
589
|
async fetchChoices(fieldMeta, inputs, context, cursor) {
|
|
586
590
|
try {
|
|
587
591
|
console.log(
|
|
588
|
-
|
|
592
|
+
chalk3__default.default.gray(
|
|
589
593
|
cursor ? ` Fetching more choices...` : ` Fetching choices for ${fieldMeta.title}...`
|
|
590
594
|
)
|
|
591
595
|
);
|
|
@@ -604,7 +608,7 @@ Optional fields${pathContext}:`));
|
|
|
604
608
|
}));
|
|
605
609
|
if (choices.length === 0 && !cursor) {
|
|
606
610
|
console.log(
|
|
607
|
-
|
|
611
|
+
chalk3__default.default.yellow(` No choices available for ${fieldMeta.title}`)
|
|
608
612
|
);
|
|
609
613
|
}
|
|
610
614
|
return {
|
|
@@ -613,7 +617,7 @@ Optional fields${pathContext}:`));
|
|
|
613
617
|
};
|
|
614
618
|
} catch (error) {
|
|
615
619
|
console.warn(
|
|
616
|
-
|
|
620
|
+
chalk3__default.default.yellow(` \u26A0\uFE0F Failed to fetch choices for ${fieldMeta.title}:`),
|
|
617
621
|
error
|
|
618
622
|
);
|
|
619
623
|
return { choices: [] };
|
|
@@ -639,7 +643,7 @@ Optional fields${pathContext}:`));
|
|
|
639
643
|
}));
|
|
640
644
|
if (nextCursor) {
|
|
641
645
|
promptChoices.push({
|
|
642
|
-
name:
|
|
646
|
+
name: chalk3__default.default.dim("(Load more...)"),
|
|
643
647
|
value: LOAD_MORE_SENTINEL
|
|
644
648
|
});
|
|
645
649
|
}
|
|
@@ -702,7 +706,7 @@ Optional fields${pathContext}:`));
|
|
|
702
706
|
};
|
|
703
707
|
}
|
|
704
708
|
if (fieldMeta.description) {
|
|
705
|
-
promptConfig.prefix =
|
|
709
|
+
promptConfig.prefix = chalk3__default.default.gray(`\u2139 ${fieldMeta.description}
|
|
706
710
|
`);
|
|
707
711
|
}
|
|
708
712
|
try {
|
|
@@ -710,7 +714,7 @@ Optional fields${pathContext}:`));
|
|
|
710
714
|
return answer[fieldMeta.key];
|
|
711
715
|
} catch (error) {
|
|
712
716
|
if (this.isUserCancellation(error)) {
|
|
713
|
-
console.log(
|
|
717
|
+
console.log(chalk3__default.default.yellow("\n\nOperation cancelled by user"));
|
|
714
718
|
throw new ZapierCliUserCancellationError();
|
|
715
719
|
}
|
|
716
720
|
throw error;
|
|
@@ -728,7 +732,7 @@ Optional fields${pathContext}:`));
|
|
|
728
732
|
}
|
|
729
733
|
} catch (error) {
|
|
730
734
|
if (this.isUserCancellation(error)) {
|
|
731
|
-
console.log(
|
|
735
|
+
console.log(chalk3__default.default.yellow("\n\nOperation cancelled by user"));
|
|
732
736
|
throw new ZapierCliUserCancellationError();
|
|
733
737
|
}
|
|
734
738
|
throw error;
|
|
@@ -832,7 +836,7 @@ function formatItemsFromSchema(functionInfo, items, startingNumber = 0) {
|
|
|
832
836
|
});
|
|
833
837
|
}
|
|
834
838
|
function formatSingleItem(formatted, itemNumber) {
|
|
835
|
-
let titleLine = `${
|
|
839
|
+
let titleLine = `${chalk3__default.default.gray(`${itemNumber + 1}.`)} ${chalk3__default.default.cyan(formatted.title)}`;
|
|
836
840
|
const subtitleParts = [];
|
|
837
841
|
if (formatted.keys) {
|
|
838
842
|
subtitleParts.push(...formatted.keys);
|
|
@@ -844,11 +848,11 @@ function formatSingleItem(formatted, itemNumber) {
|
|
|
844
848
|
}
|
|
845
849
|
const uniqueParts = [...new Set(subtitleParts)];
|
|
846
850
|
if (uniqueParts.length > 0) {
|
|
847
|
-
titleLine += ` ${
|
|
851
|
+
titleLine += ` ${chalk3__default.default.gray(`(${uniqueParts.join(", ")})`)}`;
|
|
848
852
|
}
|
|
849
853
|
console.log(titleLine);
|
|
850
854
|
if (formatted.description) {
|
|
851
|
-
console.log(` ${
|
|
855
|
+
console.log(` ${chalk3__default.default.dim(formatted.description)}`);
|
|
852
856
|
}
|
|
853
857
|
if (formatted.data !== void 0) {
|
|
854
858
|
formatJsonOutput(formatted.data);
|
|
@@ -864,16 +868,16 @@ function formatSingleItem(formatted, itemNumber) {
|
|
|
864
868
|
function applyStyle(value, style) {
|
|
865
869
|
switch (style) {
|
|
866
870
|
case "dim":
|
|
867
|
-
return
|
|
871
|
+
return chalk3__default.default.dim(value);
|
|
868
872
|
case "accent":
|
|
869
|
-
return
|
|
873
|
+
return chalk3__default.default.magenta(value);
|
|
870
874
|
case "warning":
|
|
871
|
-
return
|
|
875
|
+
return chalk3__default.default.red(value);
|
|
872
876
|
case "success":
|
|
873
|
-
return
|
|
877
|
+
return chalk3__default.default.green(value);
|
|
874
878
|
case "normal":
|
|
875
879
|
default:
|
|
876
|
-
return
|
|
880
|
+
return chalk3__default.default.blue(value);
|
|
877
881
|
}
|
|
878
882
|
}
|
|
879
883
|
function convertGenericItemToFormattedItem(item) {
|
|
@@ -923,7 +927,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
|
|
|
923
927
|
|
|
924
928
|
// package.json
|
|
925
929
|
var package_default = {
|
|
926
|
-
version: "0.34.
|
|
930
|
+
version: "0.34.11"};
|
|
927
931
|
|
|
928
932
|
// src/telemetry/builders.ts
|
|
929
933
|
function createCliBaseEvent(context = {}) {
|
|
@@ -1024,7 +1028,7 @@ async function promptConfirm(confirmType) {
|
|
|
1024
1028
|
return { confirmed: true };
|
|
1025
1029
|
}
|
|
1026
1030
|
const { messageBefore, messageAfter } = CONFIRM_MESSAGES[confirmType];
|
|
1027
|
-
console.log(
|
|
1031
|
+
console.log(chalk3__default.default.yellow(`
|
|
1028
1032
|
${messageBefore}
|
|
1029
1033
|
`));
|
|
1030
1034
|
const { confirmed } = await inquirer__default.default.prompt([
|
|
@@ -1037,6 +1041,20 @@ ${messageBefore}
|
|
|
1037
1041
|
]);
|
|
1038
1042
|
return { confirmed, messageAfter };
|
|
1039
1043
|
}
|
|
1044
|
+
function emitDeprecationWarning({
|
|
1045
|
+
cliCommandName,
|
|
1046
|
+
deprecation
|
|
1047
|
+
}) {
|
|
1048
|
+
if (!deprecation) {
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
console.warn();
|
|
1052
|
+
console.warn(
|
|
1053
|
+
chalk3__default.default.yellow.bold("\u26A0\uFE0F DEPRECATION WARNING") + chalk3__default.default.yellow(` - \`${cliCommandName}\` is deprecated.`)
|
|
1054
|
+
);
|
|
1055
|
+
console.warn(chalk3__default.default.yellow(` ${deprecation.message}`));
|
|
1056
|
+
console.warn();
|
|
1057
|
+
}
|
|
1040
1058
|
function analyzeZodSchema(schema, functionInfo) {
|
|
1041
1059
|
const parameters = [];
|
|
1042
1060
|
const schemaDef = schema._zod?.def;
|
|
@@ -1271,6 +1289,10 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1271
1289
|
try {
|
|
1272
1290
|
const commandObj = args[args.length - 1];
|
|
1273
1291
|
const options = commandObj.opts();
|
|
1292
|
+
emitDeprecationWarning({
|
|
1293
|
+
cliCommandName,
|
|
1294
|
+
deprecation: functionInfo.deprecation
|
|
1295
|
+
});
|
|
1274
1296
|
const isListCommand = functionInfo.type === "list";
|
|
1275
1297
|
const hasPaginationParams = parameters.some(
|
|
1276
1298
|
(p) => p.name === "maxItems" || p.name === "pageSize"
|
|
@@ -1298,7 +1320,7 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1298
1320
|
if (confirm && !shouldUseJson) {
|
|
1299
1321
|
const confirmResult = await promptConfirm(confirm);
|
|
1300
1322
|
if (!confirmResult.confirmed) {
|
|
1301
|
-
console.log(
|
|
1323
|
+
console.log(chalk3__default.default.yellow("Operation cancelled."));
|
|
1302
1324
|
return;
|
|
1303
1325
|
}
|
|
1304
1326
|
confirmMessageAfter = confirmResult.messageAfter;
|
|
@@ -1317,9 +1339,9 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1317
1339
|
const sdkObj = sdk2;
|
|
1318
1340
|
await sdkObj[functionInfo.name](resolvedParams);
|
|
1319
1341
|
console.log(
|
|
1320
|
-
|
|
1342
|
+
chalk3__default.default.green(`\u2705 ${cliCommandName} completed successfully!`)
|
|
1321
1343
|
);
|
|
1322
|
-
console.log(
|
|
1344
|
+
console.log(chalk3__default.default.gray(`Output written to: ${hasOutputFile}`));
|
|
1323
1345
|
return;
|
|
1324
1346
|
}
|
|
1325
1347
|
let result;
|
|
@@ -1366,7 +1388,7 @@ function createCommandConfig(cliCommandName, functionInfo, sdk2) {
|
|
|
1366
1388
|
formatJsonOutput(items);
|
|
1367
1389
|
}
|
|
1368
1390
|
if (confirmMessageAfter) {
|
|
1369
|
-
console.log(
|
|
1391
|
+
console.log(chalk3__default.default.yellow(`
|
|
1370
1392
|
${confirmMessageAfter}`));
|
|
1371
1393
|
}
|
|
1372
1394
|
}
|
|
@@ -1376,23 +1398,23 @@ ${confirmMessageAfter}`));
|
|
|
1376
1398
|
if (error instanceof Error && error.message.includes('"code"')) {
|
|
1377
1399
|
try {
|
|
1378
1400
|
const validationErrors = JSON.parse(error.message);
|
|
1379
|
-
console.error(
|
|
1401
|
+
console.error(chalk3__default.default.red("\u274C Validation Error:"));
|
|
1380
1402
|
validationErrors.forEach((err) => {
|
|
1381
1403
|
const errorObj = err;
|
|
1382
1404
|
const field = errorObj?.path?.join(".") || "unknown";
|
|
1383
1405
|
console.error(
|
|
1384
|
-
|
|
1406
|
+
chalk3__default.default.yellow(
|
|
1385
1407
|
` \u2022 ${field}: ${errorObj?.message || "Unknown error"}`
|
|
1386
1408
|
)
|
|
1387
1409
|
);
|
|
1388
1410
|
});
|
|
1389
1411
|
console.error(
|
|
1390
|
-
"\n" +
|
|
1412
|
+
"\n" + chalk3__default.default.dim(`Use --help to see available options`)
|
|
1391
1413
|
);
|
|
1392
1414
|
throw new ZapierCliExitError("Validation failed", 1);
|
|
1393
1415
|
} catch {
|
|
1394
1416
|
console.error(
|
|
1395
|
-
|
|
1417
|
+
chalk3__default.default.red("Error:"),
|
|
1396
1418
|
error instanceof Error ? error.message : String(error)
|
|
1397
1419
|
);
|
|
1398
1420
|
throw new ZapierCliExitError(
|
|
@@ -1404,11 +1426,11 @@ ${confirmMessageAfter}`));
|
|
|
1404
1426
|
throw error;
|
|
1405
1427
|
} else if (error instanceof zapierSdk.ZapierError) {
|
|
1406
1428
|
const formattedMessage = zapierSdk.formatErrorMessage(error);
|
|
1407
|
-
console.error(
|
|
1429
|
+
console.error(chalk3__default.default.red("\u274C Error:"), formattedMessage);
|
|
1408
1430
|
throw new ZapierCliExitError(formattedMessage, 1);
|
|
1409
1431
|
} else {
|
|
1410
1432
|
const msg = error instanceof Error ? error.message : "Unknown error";
|
|
1411
|
-
console.error(
|
|
1433
|
+
console.error(chalk3__default.default.red("\u274C Error:"), msg);
|
|
1412
1434
|
throw new ZapierCliExitError(msg, 1);
|
|
1413
1435
|
}
|
|
1414
1436
|
} finally {
|
|
@@ -1572,7 +1594,7 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1572
1594
|
let totalShown = 0;
|
|
1573
1595
|
let pageCount = 0;
|
|
1574
1596
|
console.log(
|
|
1575
|
-
|
|
1597
|
+
chalk3__default.default.blue(`\u{1F4CB} ${getListTitleFromMethod(sdkMethodName, functionInfo)}
|
|
1576
1598
|
`)
|
|
1577
1599
|
);
|
|
1578
1600
|
try {
|
|
@@ -1580,11 +1602,11 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1580
1602
|
const items = page.data || page;
|
|
1581
1603
|
pageCount++;
|
|
1582
1604
|
if (!Array.isArray(items)) {
|
|
1583
|
-
console.log(
|
|
1605
|
+
console.log(chalk3__default.default.yellow(`No ${itemName} found.`));
|
|
1584
1606
|
return;
|
|
1585
1607
|
}
|
|
1586
1608
|
if (items.length === 0 && pageCount === 1) {
|
|
1587
|
-
console.log(
|
|
1609
|
+
console.log(chalk3__default.default.yellow(`No ${itemName} found.`));
|
|
1588
1610
|
return;
|
|
1589
1611
|
}
|
|
1590
1612
|
if (items.length === 0) {
|
|
@@ -1593,7 +1615,7 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1593
1615
|
if (pageCount > 1) {
|
|
1594
1616
|
console.clear();
|
|
1595
1617
|
console.log(
|
|
1596
|
-
|
|
1618
|
+
chalk3__default.default.blue(
|
|
1597
1619
|
`\u{1F4CB} ${getListTitleFromMethod(sdkMethodName, functionInfo)}
|
|
1598
1620
|
`
|
|
1599
1621
|
)
|
|
@@ -1610,7 +1632,7 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1610
1632
|
}
|
|
1611
1633
|
totalShown += items.length;
|
|
1612
1634
|
console.log(
|
|
1613
|
-
|
|
1635
|
+
chalk3__default.default.green(
|
|
1614
1636
|
`
|
|
1615
1637
|
\u2705 Showing ${totalShown} ${itemName} (page ${pageCount})`
|
|
1616
1638
|
)
|
|
@@ -1631,13 +1653,13 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1631
1653
|
break;
|
|
1632
1654
|
}
|
|
1633
1655
|
}
|
|
1634
|
-
console.log(
|
|
1656
|
+
console.log(chalk3__default.default.gray(`
|
|
1635
1657
|
\u{1F4C4} Finished browsing ${itemName}`));
|
|
1636
1658
|
} catch (error) {
|
|
1637
1659
|
const items = sdkResult?.data || sdkResult;
|
|
1638
1660
|
if (Array.isArray(items)) {
|
|
1639
1661
|
if (items.length === 0) {
|
|
1640
|
-
console.log(
|
|
1662
|
+
console.log(chalk3__default.default.yellow(`No ${itemName} found.`));
|
|
1641
1663
|
return;
|
|
1642
1664
|
}
|
|
1643
1665
|
if (functionInfo && functionInfo.inputSchema) {
|
|
@@ -1649,7 +1671,7 @@ async function handlePaginatedListWithAsyncIteration(sdkMethodName, sdkResult, f
|
|
|
1649
1671
|
} else {
|
|
1650
1672
|
formatItemsGeneric2(items, 0);
|
|
1651
1673
|
}
|
|
1652
|
-
console.log(
|
|
1674
|
+
console.log(chalk3__default.default.green(`
|
|
1653
1675
|
\u2705 Showing ${items.length} ${itemName}`));
|
|
1654
1676
|
} else {
|
|
1655
1677
|
throw error;
|
|
@@ -1671,10 +1693,10 @@ function formatNonPaginatedResults(result, requestedMaxItems, userSpecifiedMaxIt
|
|
|
1671
1693
|
}
|
|
1672
1694
|
const itemName = functionInfo ? getItemNameFromMethod(functionInfo) : "items";
|
|
1673
1695
|
if (result.length === 0) {
|
|
1674
|
-
console.log(
|
|
1696
|
+
console.log(chalk3__default.default.yellow(`No ${itemName} found.`));
|
|
1675
1697
|
return;
|
|
1676
1698
|
}
|
|
1677
|
-
console.log(
|
|
1699
|
+
console.log(chalk3__default.default.green(`
|
|
1678
1700
|
\u2705 Found ${result.length} ${itemName}:
|
|
1679
1701
|
`));
|
|
1680
1702
|
if (functionInfo && functionInfo.inputSchema) {
|
|
@@ -1687,13 +1709,13 @@ function formatNonPaginatedResults(result, requestedMaxItems, userSpecifiedMaxIt
|
|
|
1687
1709
|
}
|
|
1688
1710
|
if (userSpecifiedMaxItems && requestedMaxItems) {
|
|
1689
1711
|
console.log(
|
|
1690
|
-
|
|
1712
|
+
chalk3__default.default.gray(
|
|
1691
1713
|
`
|
|
1692
1714
|
\u{1F4C4} Showing up to ${requestedMaxItems} ${itemName} (--max-items ${requestedMaxItems})`
|
|
1693
1715
|
)
|
|
1694
1716
|
);
|
|
1695
1717
|
} else {
|
|
1696
|
-
console.log(
|
|
1718
|
+
console.log(chalk3__default.default.gray(`
|
|
1697
1719
|
\u{1F4C4} All available ${itemName} shown`));
|
|
1698
1720
|
}
|
|
1699
1721
|
}
|
|
@@ -1702,10 +1724,10 @@ function formatItemsGeneric2(items, startingNumber = 0) {
|
|
|
1702
1724
|
const itemObj = item;
|
|
1703
1725
|
const name = itemObj?.name || itemObj?.key || itemObj?.id || "Item";
|
|
1704
1726
|
console.log(
|
|
1705
|
-
`${
|
|
1727
|
+
`${chalk3__default.default.gray(`${startingNumber + index + 1}.`)} ${chalk3__default.default.cyan(String(name))}`
|
|
1706
1728
|
);
|
|
1707
1729
|
if (itemObj?.description) {
|
|
1708
|
-
console.log(` ${
|
|
1730
|
+
console.log(` ${chalk3__default.default.dim(String(itemObj.description))}`);
|
|
1709
1731
|
}
|
|
1710
1732
|
console.log();
|
|
1711
1733
|
});
|
|
@@ -1741,20 +1763,20 @@ var spinPromise = async (promise, text) => {
|
|
|
1741
1763
|
};
|
|
1742
1764
|
var log = {
|
|
1743
1765
|
info: (message, ...args) => {
|
|
1744
|
-
console.log(
|
|
1766
|
+
console.log(chalk3__default.default.blue("\u2139"), message, ...args);
|
|
1745
1767
|
},
|
|
1746
1768
|
error: (message, ...args) => {
|
|
1747
|
-
console.error(
|
|
1769
|
+
console.error(chalk3__default.default.red("\u2716"), message, ...args);
|
|
1748
1770
|
},
|
|
1749
1771
|
success: (message, ...args) => {
|
|
1750
|
-
console.log(
|
|
1772
|
+
console.log(chalk3__default.default.green("\u2713"), message, ...args);
|
|
1751
1773
|
},
|
|
1752
1774
|
warn: (message, ...args) => {
|
|
1753
|
-
console.log(
|
|
1775
|
+
console.log(chalk3__default.default.yellow("\u26A0"), message, ...args);
|
|
1754
1776
|
},
|
|
1755
1777
|
debug: (message, ...args) => {
|
|
1756
1778
|
if (process.env.DEBUG === "true" || process.argv.includes("--debug")) {
|
|
1757
|
-
console.log(
|
|
1779
|
+
console.log(chalk3__default.default.gray("\u{1F41B}"), message, ...args);
|
|
1758
1780
|
}
|
|
1759
1781
|
}
|
|
1760
1782
|
};
|
|
@@ -3662,7 +3684,10 @@ var cliOverridesPlugin = ({ context }) => {
|
|
|
3662
3684
|
meta: {
|
|
3663
3685
|
fetch: {
|
|
3664
3686
|
...context.meta.fetch,
|
|
3665
|
-
categories: [...context.meta.fetch.categories || [], "deprecated"]
|
|
3687
|
+
categories: [...context.meta.fetch.categories || [], "deprecated"],
|
|
3688
|
+
deprecation: {
|
|
3689
|
+
message: "This command is deprecated and will be removed soon. Use `curl` instead. Learn more: https://docs.zapier.com/sdk/cli-reference#curl"
|
|
3690
|
+
}
|
|
3666
3691
|
}
|
|
3667
3692
|
}
|
|
3668
3693
|
}
|
|
@@ -3816,7 +3841,7 @@ function buildTemplateVariables({
|
|
|
3816
3841
|
};
|
|
3817
3842
|
}
|
|
3818
3843
|
function cleanupProject({ projectDir }) {
|
|
3819
|
-
console.log("\n" +
|
|
3844
|
+
console.log("\n" + chalk3__default.default.yellow("!") + " Cleaning up...");
|
|
3820
3845
|
fs.rmSync(projectDir, { recursive: true, force: true });
|
|
3821
3846
|
}
|
|
3822
3847
|
async function withInterruptCleanup(cleanup, fn) {
|
|
@@ -4026,8 +4051,8 @@ function buildNextSteps({
|
|
|
4026
4051
|
}
|
|
4027
4052
|
function createConsoleDisplayHooks() {
|
|
4028
4053
|
return {
|
|
4029
|
-
onItemComplete: (message) => console.log(" " +
|
|
4030
|
-
onWarn: (message) => console.warn(
|
|
4054
|
+
onItemComplete: (message) => console.log(" " + chalk3__default.default.green("\u2713") + " " + chalk3__default.default.dim(message)),
|
|
4055
|
+
onWarn: (message) => console.warn(chalk3__default.default.yellow("!") + " " + message),
|
|
4031
4056
|
onStepStart: ({
|
|
4032
4057
|
description,
|
|
4033
4058
|
stepNumber,
|
|
@@ -4036,31 +4061,31 @@ function createConsoleDisplayHooks() {
|
|
|
4036
4061
|
skipPrompts
|
|
4037
4062
|
}) => {
|
|
4038
4063
|
const progressMessage = `${description}...`;
|
|
4039
|
-
const stepCounter =
|
|
4064
|
+
const stepCounter = chalk3__default.default.dim(`${stepNumber}/${totalSteps}`);
|
|
4040
4065
|
if (skipPrompts) {
|
|
4041
4066
|
console.log(
|
|
4042
|
-
"\n" +
|
|
4067
|
+
"\n" + chalk3__default.default.bold(`\u276F ${progressMessage}`) + " " + stepCounter + "\n"
|
|
4043
4068
|
);
|
|
4044
4069
|
} else {
|
|
4045
4070
|
console.log(
|
|
4046
|
-
|
|
4071
|
+
chalk3__default.default.dim("\u2192") + " " + progressMessage + " " + stepCounter
|
|
4047
4072
|
);
|
|
4048
4073
|
}
|
|
4049
4074
|
if (command) {
|
|
4050
|
-
console.log(" " +
|
|
4075
|
+
console.log(" " + chalk3__default.default.cyan(`$ ${command}`));
|
|
4051
4076
|
}
|
|
4052
4077
|
},
|
|
4053
4078
|
onStepSuccess: ({ stepNumber, totalSteps }) => console.log(
|
|
4054
|
-
"\n" +
|
|
4079
|
+
"\n" + chalk3__default.default.green("\u2713") + " " + chalk3__default.default.dim(`Step ${stepNumber}/${totalSteps} complete`) + "\n"
|
|
4055
4080
|
),
|
|
4056
4081
|
onStepError: ({ description, command, err }) => {
|
|
4057
4082
|
const detail = err instanceof Error && err.message ? `
|
|
4058
|
-
${
|
|
4083
|
+
${chalk3__default.default.dim(err.message)}` : "";
|
|
4059
4084
|
const hint = command ? `
|
|
4060
|
-
${
|
|
4085
|
+
${chalk3__default.default.dim("run manually:")} ${chalk3__default.default.cyan(`$ ${command}`)}` : "";
|
|
4061
4086
|
console.error(
|
|
4062
4087
|
`
|
|
4063
|
-
${
|
|
4088
|
+
${chalk3__default.default.red("\u2716")} ${chalk3__default.default.bold(description)}${chalk3__default.default.dim(" failed")}${detail}${hint}`
|
|
4064
4089
|
);
|
|
4065
4090
|
}
|
|
4066
4091
|
};
|
|
@@ -4072,22 +4097,22 @@ function displaySummaryAndNextSteps({
|
|
|
4072
4097
|
packageManager
|
|
4073
4098
|
}) {
|
|
4074
4099
|
const formatStatus = (complete) => ({
|
|
4075
|
-
icon: complete ?
|
|
4076
|
-
text: complete ?
|
|
4100
|
+
icon: complete ? chalk3__default.default.green("\u2713") : chalk3__default.default.yellow("!"),
|
|
4101
|
+
text: complete ? chalk3__default.default.green("Setup complete") : chalk3__default.default.yellow("Setup interrupted")
|
|
4077
4102
|
});
|
|
4078
|
-
const formatNextStep = (step, i) => " " +
|
|
4079
|
-
const formatCommand = (cmd) => " " +
|
|
4080
|
-
const formatCompletedStep = (step) => " " +
|
|
4103
|
+
const formatNextStep = (step, i) => " " + chalk3__default.default.dim(`${i + 1}.`) + " " + chalk3__default.default.bold(step.description);
|
|
4104
|
+
const formatCommand = (cmd) => " " + chalk3__default.default.cyan(`$ ${cmd}`);
|
|
4105
|
+
const formatCompletedStep = (step) => " " + chalk3__default.default.green("\u2713") + " " + step.description;
|
|
4081
4106
|
const { execCmd } = getPackageManagerCommands({ packageManager });
|
|
4082
4107
|
const leftoverSteps = steps.filter(
|
|
4083
4108
|
(s) => !completedSetupStepIds.includes(s.id)
|
|
4084
4109
|
);
|
|
4085
4110
|
const isComplete = leftoverSteps.length === 0;
|
|
4086
4111
|
const status = formatStatus(isComplete);
|
|
4087
|
-
console.log("\n" +
|
|
4088
|
-
console.log(" " +
|
|
4112
|
+
console.log("\n" + chalk3__default.default.bold("\u276F Summary") + "\n");
|
|
4113
|
+
console.log(" " + chalk3__default.default.dim("Project") + " " + chalk3__default.default.bold(projectName));
|
|
4089
4114
|
console.log(
|
|
4090
|
-
" " +
|
|
4115
|
+
" " + chalk3__default.default.dim("Status") + " " + status.icon + " " + status.text
|
|
4091
4116
|
);
|
|
4092
4117
|
const completedSteps = steps.filter(
|
|
4093
4118
|
(s) => completedSetupStepIds.includes(s.id)
|
|
@@ -4097,7 +4122,7 @@ function displaySummaryAndNextSteps({
|
|
|
4097
4122
|
for (const step of completedSteps) console.log(formatCompletedStep(step));
|
|
4098
4123
|
}
|
|
4099
4124
|
const nextSteps = buildNextSteps({ projectName, leftoverSteps, execCmd });
|
|
4100
|
-
console.log("\n" +
|
|
4125
|
+
console.log("\n" + chalk3__default.default.bold("\u276F Next Steps") + "\n");
|
|
4101
4126
|
nextSteps.forEach((step, i) => {
|
|
4102
4127
|
console.log(formatNextStep(step, i));
|
|
4103
4128
|
if (step.command) console.log(formatCommand(step.command));
|
|
@@ -4178,7 +4203,7 @@ function createZapierCliSdk(options = {}) {
|
|
|
4178
4203
|
// package.json with { type: 'json' }
|
|
4179
4204
|
var package_default2 = {
|
|
4180
4205
|
name: "@zapier/zapier-sdk-cli",
|
|
4181
|
-
version: "0.34.
|
|
4206
|
+
version: "0.34.11"};
|
|
4182
4207
|
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
4183
4208
|
var CACHE_RESET_INTERVAL_MS = (() => {
|
|
4184
4209
|
const { ZAPIER_SDK_UPDATE_CHECK_INTERVAL_MS = `${ONE_DAY_MS}` } = process.env;
|
|
@@ -4288,26 +4313,26 @@ function displayUpdateNotification(versionInfo, packageName) {
|
|
|
4288
4313
|
if (versionInfo.isDeprecated) {
|
|
4289
4314
|
console.error();
|
|
4290
4315
|
console.error(
|
|
4291
|
-
|
|
4316
|
+
chalk3__default.default.red.bold("\u26A0\uFE0F DEPRECATION WARNING") + chalk3__default.default.red(
|
|
4292
4317
|
` - ${packageName} v${versionInfo.currentVersion} is deprecated.`
|
|
4293
4318
|
)
|
|
4294
4319
|
);
|
|
4295
4320
|
if (versionInfo.deprecationMessage) {
|
|
4296
|
-
console.error(
|
|
4321
|
+
console.error(chalk3__default.default.red(` ${versionInfo.deprecationMessage}`));
|
|
4297
4322
|
}
|
|
4298
|
-
console.error(
|
|
4323
|
+
console.error(chalk3__default.default.red(` Please update to the latest version.`));
|
|
4299
4324
|
console.error();
|
|
4300
4325
|
}
|
|
4301
4326
|
if (versionInfo.hasUpdate) {
|
|
4302
4327
|
console.error();
|
|
4303
4328
|
console.error(
|
|
4304
|
-
|
|
4329
|
+
chalk3__default.default.yellow.bold("\u{1F4E6} Update available!") + chalk3__default.default.yellow(
|
|
4305
4330
|
` ${packageName} v${versionInfo.currentVersion} \u2192 v${versionInfo.latestVersion}`
|
|
4306
4331
|
)
|
|
4307
4332
|
);
|
|
4308
4333
|
console.error(
|
|
4309
|
-
|
|
4310
|
-
` Run ${
|
|
4334
|
+
chalk3__default.default.yellow(
|
|
4335
|
+
` Run ${chalk3__default.default.bold(getUpdateCommand(packageName))} to update.`
|
|
4311
4336
|
)
|
|
4312
4337
|
);
|
|
4313
4338
|
console.error();
|