@zapier/zapier-sdk-cli 0.48.2 → 0.49.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/dist/cli.cjs CHANGED
@@ -5,7 +5,8 @@ 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 chalk7 = require('chalk');
8
+ var search = require('@inquirer/search');
9
+ var chalk = require('chalk');
9
10
  var ora = require('ora');
10
11
  var util = require('util');
11
12
  var wrapAnsi = require('wrap-ansi');
@@ -54,7 +55,8 @@ function _interopNamespace(e) {
54
55
  }
55
56
 
56
57
  var inquirer__default = /*#__PURE__*/_interopDefault(inquirer);
57
- var chalk7__default = /*#__PURE__*/_interopDefault(chalk7);
58
+ var search__default = /*#__PURE__*/_interopDefault(search);
59
+ var chalk__default = /*#__PURE__*/_interopDefault(chalk);
58
60
  var ora__default = /*#__PURE__*/_interopDefault(ora);
59
61
  var util__default = /*#__PURE__*/_interopDefault(util);
60
62
  var wrapAnsi__default = /*#__PURE__*/_interopDefault(wrapAnsi);
@@ -184,7 +186,7 @@ var SchemaParameterResolver = class {
184
186
  debugLog(message) {
185
187
  if (this.debug) {
186
188
  this.stopSpinner();
187
- console.log(chalk7__default.default.gray(`[Zapier CLI] ${message}`));
189
+ console.log(chalk__default.default.gray(`[Zapier CLI] ${message}`));
188
190
  }
189
191
  }
190
192
  startSpinner() {
@@ -275,7 +277,7 @@ var SchemaParameterResolver = class {
275
277
  }
276
278
  } catch (error) {
277
279
  if (this.isUserCancellation(error)) {
278
- console.log(chalk7__default.default.yellow("\n\nOperation cancelled by user"));
280
+ console.log(chalk__default.default.yellow("\n\nOperation cancelled by user"));
279
281
  throw new ZapierCliUserCancellationError();
280
282
  }
281
283
  throw error;
@@ -312,7 +314,7 @@ var SchemaParameterResolver = class {
312
314
  }
313
315
  } catch (error) {
314
316
  if (this.isUserCancellation(error)) {
315
- console.log(chalk7__default.default.yellow("\n\nOperation cancelled by user"));
317
+ console.log(chalk__default.default.yellow("\n\nOperation cancelled by user"));
316
318
  throw new ZapierCliUserCancellationError();
317
319
  }
318
320
  throw error;
@@ -423,6 +425,237 @@ var SchemaParameterResolver = class {
423
425
  throw new ZapierCliMissingParametersError(missingParams);
424
426
  }
425
427
  }
428
+ /**
429
+ * Wrap a PromptConfig.validate so internal sentinels (Symbols) bypass
430
+ * it. The resolver's validator is intended for actual user values; our
431
+ * Skip / Custom / Load-more sentinels are internal control-flow and
432
+ * should pass through. Returns `undefined` when the resolver didn't
433
+ * supply a validator (so `await search({ ...rest })` doesn't get a
434
+ * pass-through identity function).
435
+ */
436
+ wrapPromptValidate(validate) {
437
+ if (!validate) return void 0;
438
+ return (value) => typeof value === "symbol" ? true : validate(value);
439
+ }
440
+ /**
441
+ * Apply a PromptConfig.filter to a selected value, but only when the
442
+ * value is a real data choice (not an internal sentinel). @inquirer/search
443
+ * has no built-in filter hook, so the search-backed paths call this
444
+ * explicitly before returning.
445
+ */
446
+ applyPromptFilter(filter, value) {
447
+ if (!filter || typeof value === "symbol") return value;
448
+ return filter(value);
449
+ }
450
+ /**
451
+ * If the resolver's PromptConfig sets a `default` value, move the
452
+ * matching choice to the front so it's the first selectable item in
453
+ * the rendered source. @inquirer/search has no built-in `default`
454
+ * option; first-selectable is what Enter picks, so reordering achieves
455
+ * the same semantics inquirer.prompt's list had natively.
456
+ *
457
+ * Returns the original array if no default is set or the default
458
+ * doesn't match any current choice.
459
+ */
460
+ reorderForDefault(matches, defaultValue) {
461
+ if (defaultValue === void 0) return matches;
462
+ const idx = matches.findIndex((c) => c.value === defaultValue);
463
+ if (idx <= 0) return matches;
464
+ return [matches[idx], ...matches.slice(0, idx), ...matches.slice(idx + 1)];
465
+ }
466
+ /**
467
+ * Build the disabled "if you had X capability, more results would show"
468
+ * hints for any unmet capabilities the resolver declared. Returns the
469
+ * raw hint strings — callers wrap them into choice objects with whatever
470
+ * sentinel value they prefer (disabled choices' values are inert).
471
+ */
472
+ async computeCapabilityHints(resolver, context) {
473
+ if (!resolver.requireCapabilities) return [];
474
+ const capContext = context.sdk.context;
475
+ if (!capContext.hasCapability) return [];
476
+ const messages = [];
477
+ for (const cap of resolver.requireCapabilities) {
478
+ const enabled = await capContext.hasCapability(cap);
479
+ if (!enabled) messages.push(zapierSdk.buildCapabilityMessage(cap));
480
+ }
481
+ return messages;
482
+ }
483
+ /**
484
+ * Unpack a DynamicResolver.fetch result into the three shapes the caller
485
+ * cares about: a flat items array, an optional AsyncIterator for further
486
+ * pagination, and a hasMore flag. Centralizing keeps the AsyncIterable /
487
+ * `{data, nextCursor}` / `TItem[]` discrimination in one place — both
488
+ * the main dropdown loop and the search-mode flow consume it.
489
+ *
490
+ * The function is `async` for the AsyncIterable branch only (we eagerly
491
+ * consume the first page so callers don't have to discriminate). The
492
+ * other two branches return synchronously; an explicit Promise.resolve
493
+ * is unnecessary because async automatically wraps.
494
+ *
495
+ * Note: callers in search mode intentionally drop `pageIterator` /
496
+ * `hasMore` because each search() invocation re-prompts from scratch;
497
+ * pagination only matters when the prompt is the dropdown itself.
498
+ */
499
+ async unpackFetchResult(fetchResult, promptLabel) {
500
+ if (fetchResult != null && typeof fetchResult === "object" && Symbol.asyncIterator in fetchResult) {
501
+ const pageIterator = fetchResult[Symbol.asyncIterator]();
502
+ const first = await pageIterator.next();
503
+ if (!first.done && first.value) {
504
+ return {
505
+ items: Array.isArray(first.value.data) ? first.value.data : [],
506
+ pageIterator,
507
+ hasMore: first.value.nextCursor != null
508
+ };
509
+ }
510
+ return { items: [], pageIterator, hasMore: false };
511
+ }
512
+ if (fetchResult != null && typeof fetchResult === "object" && "data" in fetchResult) {
513
+ const page = fetchResult;
514
+ const hasMore = page.nextCursor != null;
515
+ if (hasMore) {
516
+ this.debugLog(
517
+ `Resolver for ${promptLabel} has more pages but no iterator. Use toIterable() to enable "Load more..." support.`
518
+ );
519
+ }
520
+ return {
521
+ items: Array.isArray(page.data) ? page.data : [],
522
+ pageIterator: null,
523
+ hasMore
524
+ };
525
+ }
526
+ return {
527
+ items: Array.isArray(fetchResult) ? fetchResult : [],
528
+ pageIterator: null,
529
+ hasMore: false
530
+ };
531
+ }
532
+ /**
533
+ * Search-mode dynamic resolver: prompts the user for free-form text, passes
534
+ * it to fetch via `search`, and either short-circuits on a primitive return
535
+ * (exact match) or renders the results as a search-filterable dropdown.
536
+ * Empty results still render the dropdown so the user can fall through to
537
+ * "(Use 'foo' as-is)" or "(Try a different search)" rather than being
538
+ * stuck.
539
+ *
540
+ * Known limitation: pagination beyond the first page is dropped. Each
541
+ * search() invocation re-prompts from scratch and the user is expected
542
+ * to refine their query if too many results came back. If a future
543
+ * high-cardinality search resolver needs Load-more here, the
544
+ * `pageIterator` / `hasMore` from `unpackFetchResult` is what to wire in.
545
+ */
546
+ async resolveDynamicWithSearchInput({
547
+ resolver,
548
+ context,
549
+ promptLabel,
550
+ isOptional
551
+ }) {
552
+ const parenParts = [];
553
+ if (isOptional) parenParts.push("optional");
554
+ if (resolver.placeholder) parenParts.push(resolver.placeholder);
555
+ const parens = parenParts.length > 0 ? ` (${parenParts.join(", ")})` : "";
556
+ const message = `Enter or search ${promptLabel}${parens}:`;
557
+ const SKIP_SENTINEL = Symbol("SKIP");
558
+ const USE_AS_IS_SENTINEL = Symbol("USE_AS_IS");
559
+ const TRY_AGAIN_SENTINEL = Symbol("TRY_AGAIN");
560
+ let lastNote;
561
+ while (true) {
562
+ this.stopSpinner();
563
+ if (lastNote) {
564
+ console.log(chalk__default.default.yellow(lastNote));
565
+ lastNote = void 0;
566
+ }
567
+ const answers = await inquirer__default.default.prompt([
568
+ { type: "input", name: "search", message }
569
+ ]);
570
+ const rawInput = answers.search;
571
+ const searchInput = typeof rawInput === "string" ? rawInput.trim() : "";
572
+ if (!searchInput) {
573
+ if (isOptional) return void 0;
574
+ lastNote = `${promptLabel} is required.`;
575
+ continue;
576
+ }
577
+ const searchParams = {
578
+ ...context.resolvedParams,
579
+ search: searchInput
580
+ };
581
+ this.startSpinner();
582
+ this.debugLog(`Searching ${promptLabel} for "${searchInput}"`);
583
+ let fetchResult;
584
+ try {
585
+ fetchResult = await resolver.fetch(context.sdk, searchParams);
586
+ } finally {
587
+ this.stopSpinner();
588
+ }
589
+ if (typeof fetchResult === "string" || typeof fetchResult === "number") {
590
+ return fetchResult;
591
+ }
592
+ const { items } = await this.unpackFetchResult(fetchResult, promptLabel);
593
+ const choicesConfig = resolver.prompt(items, searchParams);
594
+ const dataChoices = choicesConfig.choices ?? [];
595
+ const capabilityHintMessages = await this.computeCapabilityHints(
596
+ resolver,
597
+ context
598
+ );
599
+ const selected = await search__default.default({
600
+ message: choicesConfig.message,
601
+ validate: this.wrapPromptValidate(choicesConfig.validate),
602
+ // @inquirer/search passes an AbortSignal as the second arg for
603
+ // cancelling async sources. All three of our source callbacks are
604
+ // pure-local (filter an already-fetched array), so we intentionally
605
+ // ignore the signal. A future server-side filter implementation
606
+ // would need to honor it.
607
+ source: (term) => {
608
+ const trimmed = (term ?? "").trim();
609
+ const lower = trimmed.toLowerCase();
610
+ const matches = trimmed ? dataChoices.filter((c) => c.name.toLowerCase().includes(lower)) : dataChoices;
611
+ const orderedMatches = trimmed ? matches : this.reorderForDefault(matches, choicesConfig.default);
612
+ const skipChoice = isOptional ? [{ name: chalk__default.default.dim("(Skip)"), value: SKIP_SENTINEL }] : [];
613
+ const useAsIsChoice = {
614
+ name: chalk__default.default.dim(`(Use ${JSON.stringify(searchInput)} as-is)`),
615
+ value: USE_AS_IS_SENTINEL
616
+ };
617
+ const tryAgainChoice = {
618
+ name: chalk__default.default.dim("(Try a different search)"),
619
+ value: TRY_AGAIN_SENTINEL
620
+ };
621
+ const out = [];
622
+ if (orderedMatches.length === 0) {
623
+ out.push(useAsIsChoice);
624
+ out.push(tryAgainChoice);
625
+ out.push(...skipChoice);
626
+ } else {
627
+ out.push(...orderedMatches);
628
+ out.push(...skipChoice);
629
+ out.push(useAsIsChoice);
630
+ out.push(tryAgainChoice);
631
+ }
632
+ for (const message2 of capabilityHintMessages) {
633
+ out.push({
634
+ name: chalk__default.default.dim(message2),
635
+ value: SKIP_SENTINEL,
636
+ disabled: true
637
+ });
638
+ }
639
+ return out;
640
+ }
641
+ });
642
+ if (selected === SKIP_SENTINEL) return void 0;
643
+ if (selected === USE_AS_IS_SENTINEL) {
644
+ const validationResult = choicesConfig.validate?.(searchInput);
645
+ if (validationResult === false) {
646
+ lastNote = `${promptLabel}: invalid value.`;
647
+ continue;
648
+ }
649
+ if (typeof validationResult === "string") {
650
+ lastNote = validationResult;
651
+ continue;
652
+ }
653
+ return this.applyPromptFilter(choicesConfig.filter, searchInput);
654
+ }
655
+ if (selected === TRY_AGAIN_SENTINEL) continue;
656
+ return this.applyPromptFilter(choicesConfig.filter, selected);
657
+ }
658
+ }
426
659
  async resolveParameter(param, context, functionName, options) {
427
660
  const resolver = this.getResolver(
428
661
  param.name,
@@ -436,6 +669,27 @@ var SchemaParameterResolver = class {
436
669
  isOptional: options?.isOptional
437
670
  });
438
671
  }
672
+ /**
673
+ * Run a resolver to obtain a value for one parameter, prompting the
674
+ * user when necessary. Routes to one of several prompt backends and
675
+ * has to keep the `PromptConfig` contract honest across each one.
676
+ *
677
+ * `PromptConfig` field × prompt-backend handling:
678
+ *
679
+ * | field | list (search()) | checkbox/confirm (inquirer.prompt) | search-mode dropdown (search()) |
680
+ * | -------- | --------------- | ---------------------------------- | ------------------------------- |
681
+ * | type | required | required | required |
682
+ * | name | (set internally)| forwarded | (set internally) |
683
+ * | message | forwarded | forwarded | forwarded |
684
+ * | choices | filtered in src | passed to inquirer | filtered in src |
685
+ * | default | reorder matches | passed (also internal cursor jump) | reorder matches |
686
+ * | validate | wrapped | passed (inquirer native) | wrapped + manual for (Use as-is)|
687
+ * | filter | manual once | inquirer native (do NOT double) | manual once |
688
+ *
689
+ * Escape-hatch sentinels (Skip / Custom value / Use as-is / Load more
690
+ * / Try again) bypass the resolver's validate/filter because they
691
+ * aren't real user values — they're CLI control-flow.
692
+ */
439
693
  async resolveWithResolver(resolver, param, context, options = {}) {
440
694
  const { arrayIndex, isOptional } = options;
441
695
  const inArrayContext = arrayIndex != null;
@@ -474,41 +728,52 @@ var SchemaParameterResolver = class {
474
728
  this.stopSpinner();
475
729
  return autoResolution.resolvedValue;
476
730
  }
731
+ if (dynamicResolver.inputType === "search") {
732
+ this.stopSpinner();
733
+ return await this.resolveDynamicWithSearchInput({
734
+ resolver: dynamicResolver,
735
+ context,
736
+ promptLabel,
737
+ isOptional: isOptional ?? false
738
+ });
739
+ }
477
740
  this.debugLog(`Fetching options for ${promptLabel}`);
478
- const fetchResult = await dynamicResolver.fetch(
479
- context.sdk,
480
- context.resolvedParams
481
- );
482
- let pageIterator = null;
483
- let items;
484
- let hasMore = false;
485
- if (fetchResult != null && typeof fetchResult === "object" && Symbol.asyncIterator in fetchResult) {
486
- pageIterator = fetchResult[Symbol.asyncIterator]();
487
- const first = await pageIterator.next();
488
- if (!first.done && first.value) {
489
- items = first.value.data;
490
- hasMore = first.value.nextCursor != null;
491
- } else {
492
- items = [];
493
- }
494
- } else if (fetchResult != null && typeof fetchResult === "object" && "data" in fetchResult) {
495
- const page = fetchResult;
496
- items = page.data;
497
- hasMore = page.nextCursor != null;
498
- if (hasMore) {
499
- this.debugLog(
500
- `Resolver for ${promptLabel} has more pages but no iterator. Use toIterable() to enable "Load more..." support.`
501
- );
741
+ let fetchResult;
742
+ try {
743
+ fetchResult = await dynamicResolver.fetch(
744
+ context.sdk,
745
+ context.resolvedParams
746
+ );
747
+ } finally {
748
+ this.stopSpinner();
749
+ }
750
+ if (typeof fetchResult === "string" || typeof fetchResult === "number") {
751
+ console.error(
752
+ chalk__default.default.yellow(
753
+ `Resolver for ${promptLabel} returned a primitive value but is not in search mode. Set inputType: "search" on the resolver if you want exact-match short-circuit. Falling back to manual entry.`
754
+ )
755
+ );
756
+ const fallbackAnswers = await inquirer__default.default.prompt([
757
+ {
758
+ type: "input",
759
+ name: promptName,
760
+ message: `Enter ${promptLabel}${isOptional ? " (optional)" : ""}:`
761
+ }
762
+ ]);
763
+ const fallbackValue = fallbackAnswers[promptName];
764
+ if (isOptional && (fallbackValue === void 0 || fallbackValue === "")) {
765
+ return void 0;
502
766
  }
503
- } else {
504
- items = fetchResult || [];
505
- pageIterator = null;
767
+ return fallbackValue;
506
768
  }
769
+ const unpacked = await this.unpackFetchResult(fetchResult, promptLabel);
770
+ let pageIterator = unpacked.pageIterator;
771
+ let items = unpacked.items;
772
+ let hasMore = unpacked.hasMore;
507
773
  const LOAD_MORE_SENTINEL = Symbol("LOAD_MORE");
508
774
  const SKIP_SENTINEL = Symbol("SKIP");
509
775
  const CUSTOM_VALUE_SENTINEL = Symbol("CUSTOM_VALUE");
510
776
  let newItemsStartIndex = -1;
511
- this.stopSpinner();
512
777
  while (true) {
513
778
  const promptConfig = dynamicResolver.prompt(
514
779
  items,
@@ -523,50 +788,97 @@ var SchemaParameterResolver = class {
523
788
  `No ${promptLabel} available to select.`
524
789
  );
525
790
  }
526
- if (isOptional && promptConfig.choices) {
527
- promptConfig.choices.unshift({
528
- name: chalk7__default.default.dim("(Skip)"),
529
- value: SKIP_SENTINEL
530
- });
531
- }
532
- if (promptConfig.choices && promptConfig.type === "list") {
533
- const insertAt = isOptional ? 1 : 0;
534
- promptConfig.choices.splice(insertAt, 0, {
535
- name: chalk7__default.default.dim("(Enter custom value)"),
536
- value: CUSTOM_VALUE_SENTINEL
537
- });
538
- }
539
- if (hasMore && pageIterator && promptConfig.choices) {
540
- promptConfig.choices.push({
541
- name: chalk7__default.default.dim("(Load more...)"),
542
- value: LOAD_MORE_SENTINEL
543
- });
791
+ const capabilityHints = [];
792
+ if (!hasMore) {
793
+ const hintMessages = await this.computeCapabilityHints(
794
+ dynamicResolver,
795
+ context
796
+ );
797
+ for (const message of hintMessages) {
798
+ capabilityHints.push({
799
+ name: chalk__default.default.dim(message),
800
+ value: SKIP_SENTINEL,
801
+ disabled: true
802
+ });
803
+ }
544
804
  }
545
- if (!hasMore && promptConfig.choices && dynamicResolver.requireCapabilities) {
546
- const capContext = context.sdk.context;
547
- if (capContext.hasCapability) {
548
- for (const cap of dynamicResolver.requireCapabilities) {
549
- const enabled = await capContext.hasCapability(cap);
550
- if (!enabled) {
551
- promptConfig.choices.push({
552
- name: chalk7__default.default.dim(zapierSdk.buildCapabilityMessage(cap)),
553
- value: SKIP_SENTINEL,
554
- disabled: true
555
- });
805
+ let selected;
806
+ if (promptConfig.type === "list") {
807
+ const dataChoices = promptConfig.choices ?? [];
808
+ selected = await search__default.default({
809
+ message: promptConfig.message,
810
+ validate: this.wrapPromptValidate(promptConfig.validate),
811
+ source: (term) => {
812
+ const trimmed = (term ?? "").trim();
813
+ const lower = trimmed.toLowerCase();
814
+ const matches = trimmed ? dataChoices.filter(
815
+ (c) => c.name.toLowerCase().includes(lower)
816
+ ) : dataChoices;
817
+ const out = [];
818
+ const skipChoice = isOptional ? [
819
+ {
820
+ name: chalk__default.default.dim("(Skip)"),
821
+ value: SKIP_SENTINEL
822
+ }
823
+ ] : [];
824
+ const customValueChoice = {
825
+ name: chalk__default.default.dim("(Enter custom value)"),
826
+ value: CUSTOM_VALUE_SENTINEL
827
+ };
828
+ const orderedMatches = trimmed ? matches : this.reorderForDefault(matches, promptConfig.default);
829
+ const matchesFirst = trimmed || promptConfig.default !== void 0;
830
+ const loadMoreChoice = hasMore && pageIterator ? {
831
+ name: chalk__default.default.dim("(Load more...)"),
832
+ value: LOAD_MORE_SENTINEL
833
+ } : null;
834
+ if (matchesFirst && orderedMatches.length > 0) {
835
+ out.push(...orderedMatches);
836
+ out.push(...skipChoice);
837
+ out.push(customValueChoice);
838
+ if (loadMoreChoice) out.push(loadMoreChoice);
839
+ } else if (matchesFirst) {
840
+ out.push(customValueChoice);
841
+ if (loadMoreChoice) out.push(loadMoreChoice);
842
+ out.push(...skipChoice);
843
+ } else {
844
+ out.push(...skipChoice);
845
+ out.push(customValueChoice);
846
+ out.push(...orderedMatches);
847
+ if (loadMoreChoice) out.push(loadMoreChoice);
848
+ }
849
+ if (capabilityHints.length > 0 && (!trimmed || matches.length > 0)) {
850
+ out.push(...capabilityHints);
556
851
  }
852
+ return out;
557
853
  }
854
+ });
855
+ } else {
856
+ if (isOptional && promptConfig.choices) {
857
+ promptConfig.choices.unshift({
858
+ name: chalk__default.default.dim("(Skip)"),
859
+ value: SKIP_SENTINEL
860
+ });
558
861
  }
559
- }
560
- if (newItemsStartIndex >= 0 && promptConfig.choices) {
561
- const injectedBefore = (isOptional ? 1 : 0) + (promptConfig.type === "list" ? 1 : 0);
562
- const adjustedIndex = newItemsStartIndex + injectedBefore;
563
- if (promptConfig.choices[adjustedIndex]) {
564
- promptConfig.default = promptConfig.choices[adjustedIndex].value;
862
+ if (hasMore && pageIterator && promptConfig.choices) {
863
+ promptConfig.choices.push({
864
+ name: chalk__default.default.dim("(Load more...)"),
865
+ value: LOAD_MORE_SENTINEL
866
+ });
867
+ }
868
+ if (capabilityHints.length > 0 && promptConfig.choices) {
869
+ promptConfig.choices.push(...capabilityHints);
565
870
  }
566
- newItemsStartIndex = -1;
871
+ if (newItemsStartIndex >= 0 && promptConfig.choices) {
872
+ const injectedBefore = isOptional ? 1 : 0;
873
+ const adjustedIndex = newItemsStartIndex + injectedBefore;
874
+ if (promptConfig.choices[adjustedIndex]) {
875
+ promptConfig.default = promptConfig.choices[adjustedIndex].value;
876
+ }
877
+ newItemsStartIndex = -1;
878
+ }
879
+ const answers = await inquirer__default.default.prompt([promptConfig]);
880
+ selected = answers[promptName];
567
881
  }
568
- const answers = await inquirer__default.default.prompt([promptConfig]);
569
- let selected = answers[promptName];
570
882
  if (selected === SKIP_SENTINEL) {
571
883
  return void 0;
572
884
  }
@@ -605,7 +917,7 @@ var SchemaParameterResolver = class {
605
917
  }
606
918
  continue;
607
919
  }
608
- return selected;
920
+ return promptConfig.type === "list" ? this.applyPromptFilter(promptConfig.filter, selected) : selected;
609
921
  }
610
922
  } else if (resolver.type === "fields") {
611
923
  if (isOptional && !inArrayContext) {
@@ -663,7 +975,7 @@ var SchemaParameterResolver = class {
663
975
  if (!rootFieldItems || rootFieldItems.length === 0) {
664
976
  if (iteration === 1) {
665
977
  console.log(
666
- chalk7__default.default.yellow(`No input fields required for this action.`)
978
+ chalk__default.default.yellow(`No input fields required for this action.`)
667
979
  );
668
980
  }
669
981
  break;
@@ -686,7 +998,7 @@ var SchemaParameterResolver = class {
686
998
  }
687
999
  if (iteration >= maxIterations) {
688
1000
  console.log(
689
- chalk7__default.default.yellow(
1001
+ chalk__default.default.yellow(
690
1002
  `
691
1003
  \u26A0\uFE0F Maximum field resolution iterations reached. Some dynamic fields may not have been discovered.`
692
1004
  )
@@ -737,7 +1049,7 @@ var SchemaParameterResolver = class {
737
1049
  };
738
1050
  }
739
1051
  if (items.length >= maxItems) {
740
- console.log(chalk7__default.default.gray(`Maximum of ${maxItems} items reached.`));
1052
+ console.log(chalk__default.default.gray(`Maximum of ${maxItems} items reached.`));
741
1053
  }
742
1054
  return items;
743
1055
  }
@@ -755,7 +1067,7 @@ var SchemaParameterResolver = class {
755
1067
  const fieldsetTitle = typedItem.title || typedItem.key;
756
1068
  const pathDisplay = fieldsetPath.length > 0 ? ` (in ${fieldsetPath.join(" > ")})` : "";
757
1069
  console.log(
758
- chalk7__default.default.cyan(
1070
+ chalk__default.default.cyan(
759
1071
  `
760
1072
  \u{1F4C1} Processing fieldset: ${fieldsetTitle}${pathDisplay}`
761
1073
  )
@@ -823,7 +1135,7 @@ var SchemaParameterResolver = class {
823
1135
  }
824
1136
  } else {
825
1137
  console.log(
826
- chalk7__default.default.gray(
1138
+ chalk__default.default.gray(
827
1139
  `
828
1140
  There are ${optionalFields.length} ${iteration === 1 ? "" : "additional "}optional field(s) available${pathContext}.`
829
1141
  )
@@ -838,7 +1150,7 @@ There are ${optionalFields.length} ${iteration === 1 ? "" : "additional "}option
838
1150
  }
839
1151
  ]);
840
1152
  if (shouldConfigureOptional.configure) {
841
- console.log(chalk7__default.default.cyan(`
1153
+ console.log(chalk__default.default.cyan(`
842
1154
  Optional fields${pathContext}:`));
843
1155
  for (const field of optionalFields) {
844
1156
  await this.promptForField(field, targetInputs, context);
@@ -854,7 +1166,7 @@ Optional fields${pathContext}:`));
854
1166
  }
855
1167
  } catch (error) {
856
1168
  if (this.isUserCancellation(error)) {
857
- console.log(chalk7__default.default.yellow("\n\nOperation cancelled by user"));
1169
+ console.log(chalk__default.default.yellow("\n\nOperation cancelled by user"));
858
1170
  throw new ZapierCliUserCancellationError();
859
1171
  }
860
1172
  throw error;
@@ -930,7 +1242,7 @@ Optional fields${pathContext}:`));
930
1242
  }));
931
1243
  if (choices.length === 0 && !cursor) {
932
1244
  console.log(
933
- chalk7__default.default.yellow(`No choices available for ${fieldMeta.title}`)
1245
+ chalk__default.default.yellow(`No choices available for ${fieldMeta.title}`)
934
1246
  );
935
1247
  }
936
1248
  return {
@@ -940,14 +1252,17 @@ Optional fields${pathContext}:`));
940
1252
  } catch (error) {
941
1253
  this.stopSpinner();
942
1254
  console.warn(
943
- chalk7__default.default.yellow(`Failed to fetch choices for ${fieldMeta.title}:`),
1255
+ chalk__default.default.yellow(`Failed to fetch choices for ${fieldMeta.title}:`),
944
1256
  error
945
1257
  );
946
1258
  return { choices: [] };
947
1259
  }
948
1260
  }
949
1261
  /**
950
- * Prompt user with choices (handles both single and multi-select with pagination)
1262
+ * Prompt user with choices (handles both single and multi-select with pagination).
1263
+ * Single-select goes through @inquirer/search so users can type-to-filter long
1264
+ * dropdowns (SELECT fields); multi-select stays on inquirer.prompt since search
1265
+ * is single-select only.
951
1266
  */
952
1267
  async promptWithChoices({
953
1268
  fieldMeta,
@@ -960,45 +1275,81 @@ Optional fields${pathContext}:`));
960
1275
  const choices = [...initialChoices];
961
1276
  let nextCursor = initialCursor;
962
1277
  const LOAD_MORE_SENTINEL = Symbol("LOAD_MORE");
1278
+ const SKIP_SENTINEL = Symbol("SKIP");
963
1279
  const CUSTOM_VALUE_SENTINEL = Symbol("CUSTOM_VALUE");
1280
+ const message = `${fieldMeta.title}${fieldMeta.isRequired ? " (required)" : " (optional)"}:`;
964
1281
  while (true) {
965
- const promptChoices = choices.map((choice) => ({
966
- name: choice.label,
967
- value: choice.value
968
- }));
1282
+ let selectedValue;
969
1283
  if (!fieldMeta.isMultiSelect) {
970
- promptChoices.unshift({
971
- name: chalk7__default.default.dim("(Enter custom value)"),
972
- value: CUSTOM_VALUE_SENTINEL
973
- });
974
- }
975
- if (nextCursor) {
976
- promptChoices.push({
977
- name: chalk7__default.default.dim("(Load more...)"),
978
- value: LOAD_MORE_SENTINEL
1284
+ const dataChoices = choices.map((c) => ({
1285
+ name: c.label,
1286
+ value: c.value
1287
+ }));
1288
+ selectedValue = await search__default.default({
1289
+ message,
1290
+ source: (term) => {
1291
+ const trimmed = (term ?? "").trim();
1292
+ const lower = trimmed.toLowerCase();
1293
+ const matches = trimmed ? dataChoices.filter((c) => c.name.toLowerCase().includes(lower)) : dataChoices;
1294
+ const out = [];
1295
+ const skipChoice = !fieldMeta.isRequired ? [{ name: chalk__default.default.dim("(Skip)"), value: SKIP_SENTINEL }] : [];
1296
+ const customValueChoice = {
1297
+ name: chalk__default.default.dim("(Enter custom value)"),
1298
+ value: CUSTOM_VALUE_SENTINEL
1299
+ };
1300
+ const loadMoreChoice = nextCursor && context ? {
1301
+ name: chalk__default.default.dim("(Load more...)"),
1302
+ value: LOAD_MORE_SENTINEL
1303
+ } : null;
1304
+ if (trimmed && matches.length > 0) {
1305
+ out.push(...matches);
1306
+ out.push(...skipChoice);
1307
+ out.push(customValueChoice);
1308
+ if (loadMoreChoice) out.push(loadMoreChoice);
1309
+ } else if (trimmed) {
1310
+ out.push(customValueChoice);
1311
+ if (loadMoreChoice) out.push(loadMoreChoice);
1312
+ out.push(...skipChoice);
1313
+ } else {
1314
+ out.push(...skipChoice);
1315
+ out.push(customValueChoice);
1316
+ out.push(...matches);
1317
+ if (loadMoreChoice) out.push(loadMoreChoice);
1318
+ }
1319
+ return out;
1320
+ }
979
1321
  });
980
- }
981
- if (!fieldMeta.isRequired && !fieldMeta.isMultiSelect) {
982
- promptChoices.push({ name: "(Skip)", value: void 0 });
983
- }
984
- const promptConfig = {
985
- type: fieldMeta.isMultiSelect ? "checkbox" : "list",
986
- name: fieldMeta.key,
987
- message: `${fieldMeta.title}${fieldMeta.isRequired ? " (required)" : " (optional)"}:`,
988
- choices: promptChoices,
989
- ...fieldMeta.isMultiSelect && {
1322
+ if (selectedValue === SKIP_SENTINEL) {
1323
+ return void 0;
1324
+ }
1325
+ if (selectedValue === CUSTOM_VALUE_SENTINEL) {
1326
+ return await this.promptFreeForm(fieldMeta);
1327
+ }
1328
+ } else {
1329
+ const promptChoices = choices.map((c) => ({
1330
+ name: c.label,
1331
+ value: c.value
1332
+ }));
1333
+ if (nextCursor) {
1334
+ promptChoices.push({
1335
+ name: chalk__default.default.dim("(Load more...)"),
1336
+ value: LOAD_MORE_SENTINEL
1337
+ });
1338
+ }
1339
+ const promptConfig = {
1340
+ type: "checkbox",
1341
+ name: fieldMeta.key,
1342
+ message,
1343
+ choices: promptChoices,
990
1344
  validate: (input) => {
991
1345
  if (fieldMeta.isRequired && (!input || input.length === 0)) {
992
1346
  return "At least one selection is required";
993
1347
  }
994
1348
  return true;
995
1349
  }
996
- }
997
- };
998
- const answer = await inquirer__default.default.prompt([promptConfig]);
999
- let selectedValue = answer[fieldMeta.key];
1000
- if (selectedValue === CUSTOM_VALUE_SENTINEL) {
1001
- return await this.promptFreeForm(fieldMeta);
1350
+ };
1351
+ const answer = await inquirer__default.default.prompt([promptConfig]);
1352
+ selectedValue = answer[fieldMeta.key];
1002
1353
  }
1003
1354
  const wantsMore = fieldMeta.isMultiSelect ? Array.isArray(selectedValue) && selectedValue.includes(LOAD_MORE_SENTINEL) : selectedValue === LOAD_MORE_SENTINEL;
1004
1355
  if (wantsMore && nextCursor && context) {
@@ -1061,7 +1412,7 @@ Optional fields${pathContext}:`));
1061
1412
  };
1062
1413
  }
1063
1414
  if (fieldMeta.description) {
1064
- promptConfig.prefix = chalk7__default.default.gray(`\u2139 ${fieldMeta.description}
1415
+ promptConfig.prefix = chalk__default.default.gray(`\u2139 ${fieldMeta.description}
1065
1416
  `);
1066
1417
  }
1067
1418
  try {
@@ -1069,7 +1420,7 @@ Optional fields${pathContext}:`));
1069
1420
  return answer[fieldMeta.key];
1070
1421
  } catch (error) {
1071
1422
  if (this.isUserCancellation(error)) {
1072
- console.log(chalk7__default.default.yellow("\n\nOperation cancelled by user"));
1423
+ console.log(chalk__default.default.yellow("\n\nOperation cancelled by user"));
1073
1424
  throw new ZapierCliUserCancellationError();
1074
1425
  }
1075
1426
  throw error;
@@ -1087,7 +1438,7 @@ Optional fields${pathContext}:`));
1087
1438
  }
1088
1439
  } catch (error) {
1089
1440
  if (this.isUserCancellation(error)) {
1090
- console.log(chalk7__default.default.yellow("\n\nOperation cancelled by user"));
1441
+ console.log(chalk__default.default.yellow("\n\nOperation cancelled by user"));
1091
1442
  throw new ZapierCliUserCancellationError();
1092
1443
  }
1093
1444
  throw error;
@@ -1210,7 +1561,7 @@ var SHARED_COMMAND_CLI_OPTIONS = [
1210
1561
 
1211
1562
  // package.json
1212
1563
  var package_default = {
1213
- version: "0.48.2"};
1564
+ version: "0.49.0"};
1214
1565
 
1215
1566
  // src/telemetry/builders.ts
1216
1567
  function createCliBaseEvent(context = {}) {
@@ -1295,7 +1646,7 @@ async function formatItemsFromSchema(functionInfo, items, startingNumber = 0, op
1295
1646
  });
1296
1647
  }
1297
1648
  function formatSingleItem(formatted, itemNumber) {
1298
- let titleLine = `${chalk7__default.default.gray(`${itemNumber + 1}.`)} ${chalk7__default.default.cyan(formatted.title)}`;
1649
+ let titleLine = `${chalk__default.default.gray(`${itemNumber + 1}.`)} ${chalk__default.default.cyan(formatted.title)}`;
1299
1650
  const subtitleParts = [];
1300
1651
  if (formatted.keys) {
1301
1652
  subtitleParts.push(...formatted.keys);
@@ -1307,11 +1658,11 @@ function formatSingleItem(formatted, itemNumber) {
1307
1658
  }
1308
1659
  const uniqueParts = [...new Set(subtitleParts)];
1309
1660
  if (uniqueParts.length > 0) {
1310
- titleLine += ` ${chalk7__default.default.gray(`(${uniqueParts.join(", ")})`)}`;
1661
+ titleLine += ` ${chalk__default.default.gray(`(${uniqueParts.join(", ")})`)}`;
1311
1662
  }
1312
1663
  console.log(titleLine);
1313
1664
  if (formatted.description) {
1314
- console.log(` ${chalk7__default.default.dim(formatted.description)}`);
1665
+ console.log(` ${chalk__default.default.dim(formatted.description)}`);
1315
1666
  }
1316
1667
  if (formatted.data !== void 0) {
1317
1668
  formatJsonOutput(formatted.data);
@@ -1322,7 +1673,7 @@ function formatSingleItem(formatted, itemNumber) {
1322
1673
  if (detail.label) {
1323
1674
  const isMultiline = detail.text.includes("\n");
1324
1675
  if (isMultiline) {
1325
- console.log(` ${chalk7__default.default.gray(detail.label + ":")}`);
1676
+ console.log(` ${chalk__default.default.gray(detail.label + ":")}`);
1326
1677
  const displayText = formatDetailText(
1327
1678
  detail.text,
1328
1679
  DETAIL_INDENT + " "
@@ -1331,7 +1682,7 @@ function formatSingleItem(formatted, itemNumber) {
1331
1682
  console.log(`${DETAIL_INDENT} ${styledText}`);
1332
1683
  } else {
1333
1684
  const styledValue = applyStyle(detail.text, detail.style);
1334
- console.log(` ${chalk7__default.default.gray(detail.label + ":")} ${styledValue}`);
1685
+ console.log(` ${chalk__default.default.gray(detail.label + ":")} ${styledValue}`);
1335
1686
  }
1336
1687
  } else {
1337
1688
  const displayText = formatDetailText(detail.text, DETAIL_INDENT);
@@ -1355,16 +1706,16 @@ function formatDetailText(text, indent = DETAIL_INDENT) {
1355
1706
  function applyStyle(value, style) {
1356
1707
  switch (style) {
1357
1708
  case "dim":
1358
- return chalk7__default.default.dim(value);
1709
+ return chalk__default.default.dim(value);
1359
1710
  case "accent":
1360
- return chalk7__default.default.magenta(value);
1711
+ return chalk__default.default.magenta(value);
1361
1712
  case "warning":
1362
- return chalk7__default.default.red(value);
1713
+ return chalk__default.default.red(value);
1363
1714
  case "success":
1364
- return chalk7__default.default.green(value);
1715
+ return chalk__default.default.green(value);
1365
1716
  case "normal":
1366
1717
  default:
1367
- return chalk7__default.default.blue(value);
1718
+ return chalk__default.default.blue(value);
1368
1719
  }
1369
1720
  }
1370
1721
  function convertGenericItemToFormattedItem(item) {
@@ -1496,10 +1847,10 @@ function renderItemsForDisplay(items, functionInfo, startingNumber = 0) {
1496
1847
  const obj = item;
1497
1848
  const name = obj?.name || obj?.key || obj?.id || "Item";
1498
1849
  console.log(
1499
- `${chalk7__default.default.gray(`${startingNumber + index + 1}.`)} ${chalk7__default.default.cyan(String(name))}`
1850
+ `${chalk__default.default.gray(`${startingNumber + index + 1}.`)} ${chalk__default.default.cyan(String(name))}`
1500
1851
  );
1501
1852
  if (obj?.description)
1502
- console.log(` ${chalk7__default.default.dim(String(obj.description))}`);
1853
+ console.log(` ${chalk__default.default.dim(String(obj.description))}`);
1503
1854
  console.log();
1504
1855
  });
1505
1856
  }
@@ -1511,35 +1862,35 @@ function createInteractiveRenderer() {
1511
1862
  if (!(Symbol.asyncIterator in Object(source))) {
1512
1863
  const items = source?.data;
1513
1864
  if (!Array.isArray(items) || items.length === 0) {
1514
- console.log(chalk7__default.default.yellow(`No ${itemName} found.`));
1865
+ console.log(chalk__default.default.yellow(`No ${itemName} found.`));
1515
1866
  return;
1516
1867
  }
1517
1868
  renderItemsForDisplay(items, functionInfo, 0);
1518
- console.log(chalk7__default.default.green(`
1869
+ console.log(chalk__default.default.green(`
1519
1870
  \u2705 Showing ${items.length} ${itemName}`));
1520
1871
  return;
1521
1872
  }
1522
1873
  let totalShown = 0;
1523
1874
  let pageCount = 0;
1524
- console.log(chalk7__default.default.blue(`\u{1F4CB} ${getListTitle(functionInfo)}
1875
+ console.log(chalk__default.default.blue(`\u{1F4CB} ${getListTitle(functionInfo)}
1525
1876
  `));
1526
1877
  for await (const page of source) {
1527
1878
  const items = page.data ?? [];
1528
1879
  pageCount++;
1529
1880
  if (items.length === 0 && pageCount === 1) {
1530
- console.log(chalk7__default.default.yellow(`No ${itemName} found.`));
1881
+ console.log(chalk__default.default.yellow(`No ${itemName} found.`));
1531
1882
  return;
1532
1883
  }
1533
1884
  if (items.length === 0) break;
1534
1885
  if (pageCount > 1) {
1535
1886
  console.clear();
1536
- console.log(chalk7__default.default.blue(`\u{1F4CB} ${getListTitle(functionInfo)}
1887
+ console.log(chalk__default.default.blue(`\u{1F4CB} ${getListTitle(functionInfo)}
1537
1888
  `));
1538
1889
  }
1539
1890
  renderItemsForDisplay(items, functionInfo, totalShown);
1540
1891
  totalShown += items.length;
1541
1892
  console.log(
1542
- chalk7__default.default.green(
1893
+ chalk__default.default.green(
1543
1894
  `
1544
1895
  \u2705 Showing ${totalShown} ${itemName} (page ${pageCount})`
1545
1896
  )
@@ -1558,7 +1909,7 @@ function createInteractiveRenderer() {
1558
1909
  break;
1559
1910
  }
1560
1911
  }
1561
- console.log(chalk7__default.default.gray(`
1912
+ console.log(chalk__default.default.gray(`
1562
1913
  \u{1F4C4} Finished browsing ${itemName}`));
1563
1914
  },
1564
1915
  renderCollectedList(items, { maxItems, userSpecifiedMaxItems, functionInfo } = {}) {
@@ -1568,30 +1919,30 @@ function createInteractiveRenderer() {
1568
1919
  }
1569
1920
  const itemName = getItemName(functionInfo);
1570
1921
  if (items.length === 0) {
1571
- console.log(chalk7__default.default.yellow(`No ${itemName} found.`));
1922
+ console.log(chalk__default.default.yellow(`No ${itemName} found.`));
1572
1923
  return;
1573
1924
  }
1574
- console.log(chalk7__default.default.green(`
1925
+ console.log(chalk__default.default.green(`
1575
1926
  \u2705 Found ${items.length} ${itemName}:
1576
1927
  `));
1577
1928
  renderItemsForDisplay(items, functionInfo);
1578
1929
  if (userSpecifiedMaxItems && maxItems) {
1579
1930
  console.log(
1580
- chalk7__default.default.gray(
1931
+ chalk__default.default.gray(
1581
1932
  `
1582
1933
  \u{1F4C4} Showing up to ${maxItems} ${itemName} (--max-items ${maxItems})`
1583
1934
  )
1584
1935
  );
1585
1936
  } else {
1586
- console.log(chalk7__default.default.gray(`
1937
+ console.log(chalk__default.default.gray(`
1587
1938
  \u{1F4C4} All available ${itemName} shown`));
1588
1939
  }
1589
1940
  },
1590
1941
  renderItem(value, options) {
1591
1942
  if (options?.outputFile) {
1592
1943
  const label = options.commandName ? `\u2705 ${options.commandName} completed successfully!` : "\u2705 Done!";
1593
- console.log(chalk7__default.default.green(label));
1594
- console.log(chalk7__default.default.gray(`Output written to: ${options.outputFile}`));
1944
+ console.log(chalk__default.default.green(label));
1945
+ console.log(chalk__default.default.gray(`Output written to: ${options.outputFile}`));
1595
1946
  } else {
1596
1947
  formatJsonOutput(value);
1597
1948
  }
@@ -1601,17 +1952,17 @@ function createInteractiveRenderer() {
1601
1952
  },
1602
1953
  renderError(error) {
1603
1954
  if (error instanceof ZapierCliMissingParametersError) {
1604
- console.error(chalk7__default.default.red("\u274C " + formatMissingParamsError(error)));
1605
- console.error("\n" + chalk7__default.default.dim("Use --help to see available options"));
1955
+ console.error(chalk__default.default.red("\u274C " + formatMissingParamsError(error)));
1956
+ console.error("\n" + chalk__default.default.dim("Use --help to see available options"));
1606
1957
  throw new ZapierCliExitError(error.message, 1);
1607
1958
  }
1608
1959
  if (error instanceof zapierSdk.ZapierError) {
1609
1960
  const formattedMessage = zapierSdk.formatErrorMessage(error);
1610
- console.error(chalk7__default.default.red("\u274C Error:"), formattedMessage);
1961
+ console.error(chalk__default.default.red("\u274C Error:"), formattedMessage);
1611
1962
  throw new ZapierCliExitError(formattedMessage, 1);
1612
1963
  }
1613
1964
  const msg = error instanceof Error ? error.message : "Unknown error";
1614
- console.error(chalk7__default.default.red("\u274C Error:"), msg);
1965
+ console.error(chalk__default.default.red("\u274C Error:"), msg);
1615
1966
  throw new ZapierCliExitError(msg, 1);
1616
1967
  }
1617
1968
  };
@@ -1721,7 +2072,7 @@ async function promptConfirm(confirmType, itemType) {
1721
2072
  }
1722
2073
  const configOrFn = CONFIRM_MESSAGES[confirmType];
1723
2074
  const { messageBefore, messageAfter } = typeof configOrFn === "function" ? configOrFn(itemType) : configOrFn;
1724
- console.log(chalk7__default.default.yellow(`
2075
+ console.log(chalk__default.default.yellow(`
1725
2076
  ${messageBefore}
1726
2077
  `));
1727
2078
  const { confirmed } = await inquirer__default.default.prompt([
@@ -1743,9 +2094,9 @@ function emitDeprecationWarning({
1743
2094
  }
1744
2095
  console.warn();
1745
2096
  console.warn(
1746
- chalk7__default.default.yellow.bold("\u26A0\uFE0F DEPRECATION WARNING") + chalk7__default.default.yellow(` - \`${cliCommandName}\` is deprecated.`)
2097
+ chalk__default.default.yellow.bold("\u26A0\uFE0F DEPRECATION WARNING") + chalk__default.default.yellow(` - \`${cliCommandName}\` is deprecated.`)
1747
2098
  );
1748
- console.warn(chalk7__default.default.yellow(` ${deprecation.message}`));
2099
+ console.warn(chalk__default.default.yellow(` ${deprecation.message}`));
1749
2100
  console.warn();
1750
2101
  }
1751
2102
  function emitParamDeprecationWarnings({
@@ -1759,12 +2110,12 @@ function emitParamDeprecationWarnings({
1759
2110
  if (Array.isArray(value) && value.length === 0) continue;
1760
2111
  console.warn();
1761
2112
  console.warn(
1762
- chalk7__default.default.yellow.bold("\u26A0\uFE0F DEPRECATION WARNING") + chalk7__default.default.yellow(
2113
+ chalk__default.default.yellow.bold("\u26A0\uFE0F DEPRECATION WARNING") + chalk__default.default.yellow(
1763
2114
  ` - \`${toKebabCase(param.name)}\` is deprecated and may be removed in a future release.`
1764
2115
  )
1765
2116
  );
1766
2117
  if (param.deprecationMessage) {
1767
- console.warn(chalk7__default.default.yellow(` ${param.deprecationMessage}`));
2118
+ console.warn(chalk__default.default.yellow(` ${param.deprecationMessage}`));
1768
2119
  }
1769
2120
  console.warn();
1770
2121
  }
@@ -2095,7 +2446,7 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
2095
2446
  functionInfo.itemType
2096
2447
  );
2097
2448
  if (!confirmResult.confirmed) {
2098
- console.log(chalk7__default.default.yellow("Operation cancelled."));
2449
+ console.log(chalk__default.default.yellow("Operation cancelled."));
2099
2450
  return;
2100
2451
  }
2101
2452
  confirmMessageAfter = confirmResult.messageAfter;
@@ -2157,7 +2508,7 @@ function createCommandConfig(cliCommandName, functionInfo, sdk) {
2157
2508
  renderer.renderItem(normalizedResult.value);
2158
2509
  }
2159
2510
  if (confirmMessageAfter) {
2160
- console.log(chalk7__default.default.yellow(`
2511
+ console.log(chalk__default.default.yellow(`
2161
2512
  ${confirmMessageAfter}`));
2162
2513
  }
2163
2514
  break;
@@ -3200,20 +3551,20 @@ var spinPromise = async (promise, text) => {
3200
3551
  };
3201
3552
  var log = {
3202
3553
  info: (message, ...args) => {
3203
- console.log(chalk7__default.default.blue("\u2139"), message, ...args);
3554
+ console.log(chalk__default.default.blue("\u2139"), message, ...args);
3204
3555
  },
3205
3556
  error: (message, ...args) => {
3206
- console.error(chalk7__default.default.red("\u2716"), message, ...args);
3557
+ console.error(chalk__default.default.red("\u2716"), message, ...args);
3207
3558
  },
3208
3559
  success: (message, ...args) => {
3209
- console.log(chalk7__default.default.green("\u2713"), message, ...args);
3560
+ console.log(chalk__default.default.green("\u2713"), message, ...args);
3210
3561
  },
3211
3562
  warn: (message, ...args) => {
3212
- console.log(chalk7__default.default.yellow("\u26A0"), message, ...args);
3563
+ console.log(chalk__default.default.yellow("\u26A0"), message, ...args);
3213
3564
  },
3214
3565
  debug: (message, ...args) => {
3215
3566
  if (process.env.DEBUG === "true" || process.argv.includes("--debug")) {
3216
- console.log(chalk7__default.default.gray("\u{1F41B}"), message, ...args);
3567
+ console.log(chalk__default.default.gray("\u{1F41B}"), message, ...args);
3217
3568
  }
3218
3569
  }
3219
3570
  };
@@ -5423,7 +5774,7 @@ function buildTemplateVariables({
5423
5774
  };
5424
5775
  }
5425
5776
  function cleanupProject({ projectDir }) {
5426
- console.log("\n" + chalk7__default.default.yellow("!") + " Cleaning up...");
5777
+ console.log("\n" + chalk__default.default.yellow("!") + " Cleaning up...");
5427
5778
  fs.rmSync(projectDir, { recursive: true, force: true });
5428
5779
  }
5429
5780
  async function withInterruptCleanup(cleanup, fn) {
@@ -5633,8 +5984,8 @@ function buildNextSteps({
5633
5984
  }
5634
5985
  function createConsoleDisplayHooks() {
5635
5986
  return {
5636
- onItemComplete: (message) => console.log(" " + chalk7__default.default.green("\u2713") + " " + chalk7__default.default.dim(message)),
5637
- onWarn: (message) => console.warn(chalk7__default.default.yellow("!") + " " + message),
5987
+ onItemComplete: (message) => console.log(" " + chalk__default.default.green("\u2713") + " " + chalk__default.default.dim(message)),
5988
+ onWarn: (message) => console.warn(chalk__default.default.yellow("!") + " " + message),
5638
5989
  onStepStart: ({
5639
5990
  description,
5640
5991
  stepNumber,
@@ -5643,31 +5994,31 @@ function createConsoleDisplayHooks() {
5643
5994
  skipPrompts
5644
5995
  }) => {
5645
5996
  const progressMessage = `${description}...`;
5646
- const stepCounter = chalk7__default.default.dim(`${stepNumber}/${totalSteps}`);
5997
+ const stepCounter = chalk__default.default.dim(`${stepNumber}/${totalSteps}`);
5647
5998
  if (skipPrompts) {
5648
5999
  console.log(
5649
- "\n" + chalk7__default.default.bold(`\u276F ${progressMessage}`) + " " + stepCounter + "\n"
6000
+ "\n" + chalk__default.default.bold(`\u276F ${progressMessage}`) + " " + stepCounter + "\n"
5650
6001
  );
5651
6002
  } else {
5652
6003
  console.log(
5653
- chalk7__default.default.dim("\u2192") + " " + progressMessage + " " + stepCounter
6004
+ chalk__default.default.dim("\u2192") + " " + progressMessage + " " + stepCounter
5654
6005
  );
5655
6006
  }
5656
6007
  if (command) {
5657
- console.log(" " + chalk7__default.default.cyan(`$ ${command}`));
6008
+ console.log(" " + chalk__default.default.cyan(`$ ${command}`));
5658
6009
  }
5659
6010
  },
5660
6011
  onStepSuccess: ({ stepNumber, totalSteps }) => console.log(
5661
- "\n" + chalk7__default.default.green("\u2713") + " " + chalk7__default.default.dim(`Step ${stepNumber}/${totalSteps} complete`) + "\n"
6012
+ "\n" + chalk__default.default.green("\u2713") + " " + chalk__default.default.dim(`Step ${stepNumber}/${totalSteps} complete`) + "\n"
5662
6013
  ),
5663
6014
  onStepError: ({ description, command, err }) => {
5664
6015
  const detail = err instanceof Error && err.message ? `
5665
- ${chalk7__default.default.dim(err.message)}` : "";
6016
+ ${chalk__default.default.dim(err.message)}` : "";
5666
6017
  const hint = command ? `
5667
- ${chalk7__default.default.dim("run manually:")} ${chalk7__default.default.cyan(`$ ${command}`)}` : "";
6018
+ ${chalk__default.default.dim("run manually:")} ${chalk__default.default.cyan(`$ ${command}`)}` : "";
5668
6019
  console.error(
5669
6020
  `
5670
- ${chalk7__default.default.red("\u2716")} ${chalk7__default.default.bold(description)}${chalk7__default.default.dim(" failed")}${detail}${hint}`
6021
+ ${chalk__default.default.red("\u2716")} ${chalk__default.default.bold(description)}${chalk__default.default.dim(" failed")}${detail}${hint}`
5671
6022
  );
5672
6023
  }
5673
6024
  };
@@ -5679,22 +6030,22 @@ function displaySummaryAndNextSteps({
5679
6030
  packageManager
5680
6031
  }) {
5681
6032
  const formatStatus = (complete) => ({
5682
- icon: complete ? chalk7__default.default.green("\u2713") : chalk7__default.default.yellow("!"),
5683
- text: complete ? chalk7__default.default.green("Setup complete") : chalk7__default.default.yellow("Setup interrupted")
6033
+ icon: complete ? chalk__default.default.green("\u2713") : chalk__default.default.yellow("!"),
6034
+ text: complete ? chalk__default.default.green("Setup complete") : chalk__default.default.yellow("Setup interrupted")
5684
6035
  });
5685
- const formatNextStep = (step, i) => " " + chalk7__default.default.dim(`${i + 1}.`) + " " + chalk7__default.default.bold(step.description);
5686
- const formatCommand = (cmd) => " " + chalk7__default.default.cyan(`$ ${cmd}`);
5687
- const formatCompletedStep = (step) => " " + chalk7__default.default.green("\u2713") + " " + step.description;
6036
+ const formatNextStep = (step, i) => " " + chalk__default.default.dim(`${i + 1}.`) + " " + chalk__default.default.bold(step.description);
6037
+ const formatCommand = (cmd) => " " + chalk__default.default.cyan(`$ ${cmd}`);
6038
+ const formatCompletedStep = (step) => " " + chalk__default.default.green("\u2713") + " " + step.description;
5688
6039
  const { execCmd } = getPackageManagerCommands({ packageManager });
5689
6040
  const leftoverSteps = steps.filter(
5690
6041
  (s) => !completedSetupStepIds.includes(s.id)
5691
6042
  );
5692
6043
  const isComplete = leftoverSteps.length === 0;
5693
6044
  const status = formatStatus(isComplete);
5694
- console.log("\n" + chalk7__default.default.bold("\u276F Summary") + "\n");
5695
- console.log(" " + chalk7__default.default.dim("Project") + " " + chalk7__default.default.bold(projectName));
6045
+ console.log("\n" + chalk__default.default.bold("\u276F Summary") + "\n");
6046
+ console.log(" " + chalk__default.default.dim("Project") + " " + chalk__default.default.bold(projectName));
5696
6047
  console.log(
5697
- " " + chalk7__default.default.dim("Status") + " " + status.icon + " " + status.text
6048
+ " " + chalk__default.default.dim("Status") + " " + status.icon + " " + status.text
5698
6049
  );
5699
6050
  const completedSteps = steps.filter(
5700
6051
  (s) => completedSetupStepIds.includes(s.id)
@@ -5704,7 +6055,7 @@ function displaySummaryAndNextSteps({
5704
6055
  for (const step of completedSteps) console.log(formatCompletedStep(step));
5705
6056
  }
5706
6057
  const nextSteps = buildNextSteps({ projectName, leftoverSteps, execCmd });
5707
- console.log("\n" + chalk7__default.default.bold("\u276F Next Steps") + "\n");
6058
+ console.log("\n" + chalk__default.default.bold("\u276F Next Steps") + "\n");
5708
6059
  nextSteps.forEach((step, i) => {
5709
6060
  console.log(formatNextStep(step, i));
5710
6061
  if (step.command) console.log(formatCommand(step.command));
@@ -5780,13 +6131,13 @@ function createInteractiveCallback() {
5780
6131
  const attrs = message.message_attributes;
5781
6132
  console.log(
5782
6133
  `
5783
- ${chalk7__default.default.bold(`Message #${messageNumber}`)} ${chalk7__default.default.dim(message.id)} ${chalk7__default.default.dim(`(lease #${attrs.lease_count})`)}`
6134
+ ${chalk__default.default.bold(`Message #${messageNumber}`)} ${chalk__default.default.dim(message.id)} ${chalk__default.default.dim(`(lease #${attrs.lease_count})`)}`
5784
6135
  );
5785
6136
  if (attrs.error_message) {
5786
- console.log(chalk7__default.default.yellow(` upstream error: ${attrs.error_message}`));
6137
+ console.log(chalk__default.default.yellow(` upstream error: ${attrs.error_message}`));
5787
6138
  }
5788
6139
  if (attrs.possible_duplicate_data) {
5789
- console.log(chalk7__default.default.yellow(" possible duplicate data"));
6140
+ console.log(chalk__default.default.yellow(" possible duplicate data"));
5790
6141
  }
5791
6142
  while (true) {
5792
6143
  let action;
@@ -5816,7 +6167,7 @@ ${chalk7__default.default.bold(`Message #${messageNumber}`)} ${chalk7__default.d
5816
6167
  throw error;
5817
6168
  }
5818
6169
  if (action === "view") {
5819
- console.log(chalk7__default.default.dim(JSON.stringify(message.payload, null, 2)));
6170
+ console.log(chalk__default.default.dim(JSON.stringify(message.payload, null, 2)));
5820
6171
  continue;
5821
6172
  }
5822
6173
  if (action === "ack") {
@@ -5919,7 +6270,7 @@ function describeReason(reason) {
5919
6270
  }
5920
6271
  function printDrainError(reason, message) {
5921
6272
  console.error(
5922
- chalk7__default.default.red(`Error processing ${message.id}: ${describeReason(reason)}`)
6273
+ chalk__default.default.red(`Error processing ${message.id}: ${describeReason(reason)}`)
5923
6274
  );
5924
6275
  }
5925
6276
  function printDrainSummary(counts) {
@@ -5929,7 +6280,7 @@ function printDrainSummary(counts) {
5929
6280
  if (skipped > 0) parts.push(`${skipped} skipped`);
5930
6281
  parts.push(`${counts.rejected} rejected`);
5931
6282
  console.log(
5932
- chalk7__default.default.dim(
6283
+ chalk__default.default.dim(
5933
6284
  `
5934
6285
  Processed ${total} message${total === 1 ? "" : "s"} (${parts.join(", ")}).`
5935
6286
  )
@@ -5937,7 +6288,7 @@ Processed ${total} message${total === 1 ? "" : "s"} (${parts.join(", ")}).`
5937
6288
  }
5938
6289
  function warnInteractiveContinueOnErrorOverride() {
5939
6290
  console.warn(
5940
- chalk7__default.default.yellow(
6291
+ chalk__default.default.yellow(
5941
6292
  'Note: continueOnError=false is overridden to true in interactive mode (the "Skip (let lease expire)" choice would otherwise terminate the drain).'
5942
6293
  )
5943
6294
  );
@@ -6241,7 +6592,7 @@ var watchTriggerInboxCliPlugin = zapierSdk.definePlugin(
6241
6592
  // package.json with { type: 'json' }
6242
6593
  var package_default2 = {
6243
6594
  name: "@zapier/zapier-sdk-cli",
6244
- version: "0.48.2"};
6595
+ version: "0.49.0"};
6245
6596
 
6246
6597
  // src/sdk.ts
6247
6598
  zapierSdk.injectCliLogin(login_exports);
@@ -6448,26 +6799,26 @@ function displayUpdateNotification(versionInfo, packageName) {
6448
6799
  if (versionInfo.isDeprecated) {
6449
6800
  console.error();
6450
6801
  console.error(
6451
- chalk7__default.default.red.bold("\u26A0\uFE0F DEPRECATION WARNING") + chalk7__default.default.red(
6802
+ chalk__default.default.red.bold("\u26A0\uFE0F DEPRECATION WARNING") + chalk__default.default.red(
6452
6803
  ` - ${packageName} v${versionInfo.currentVersion} is deprecated.`
6453
6804
  )
6454
6805
  );
6455
6806
  if (versionInfo.deprecationMessage) {
6456
- console.error(chalk7__default.default.red(` ${versionInfo.deprecationMessage}`));
6807
+ console.error(chalk__default.default.red(` ${versionInfo.deprecationMessage}`));
6457
6808
  }
6458
- console.error(chalk7__default.default.red(` Please update to the latest version.`));
6809
+ console.error(chalk__default.default.red(` Please update to the latest version.`));
6459
6810
  console.error();
6460
6811
  }
6461
6812
  if (versionInfo.hasUpdate) {
6462
6813
  console.error();
6463
6814
  console.error(
6464
- chalk7__default.default.yellow.bold("\u{1F4E6} Update available!") + chalk7__default.default.yellow(
6815
+ chalk__default.default.yellow.bold("\u{1F4E6} Update available!") + chalk__default.default.yellow(
6465
6816
  ` ${packageName} v${versionInfo.currentVersion} \u2192 v${versionInfo.latestVersion}`
6466
6817
  )
6467
6818
  );
6468
6819
  console.error(
6469
- chalk7__default.default.yellow(
6470
- ` Run ${chalk7__default.default.bold(getUpdateCommand(packageName))} to update.`
6820
+ chalk__default.default.yellow(
6821
+ ` Run ${chalk__default.default.bold(getUpdateCommand(packageName))} to update.`
6471
6822
  )
6472
6823
  );
6473
6824
  console.error();