@zapier/zapier-sdk-cli 0.59.1 → 0.59.2
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 +24 -0
- package/dist/cli.cjs +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/experimental.cjs +1 -1
- package/dist/experimental.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
- package/dist/package.json +0 -121
- package/dist/src/cli.d.ts +0 -2
- package/dist/src/cli.js +0 -219
- package/dist/src/experimental.d.ts +0 -33
- package/dist/src/experimental.js +0 -86
- package/dist/src/generators/ast-generator.d.ts +0 -41
- package/dist/src/generators/ast-generator.js +0 -405
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.js +0 -5
- package/dist/src/login/config.d.ts +0 -4
- package/dist/src/login/config.js +0 -21
- package/dist/src/login/credentials-revoke.d.ts +0 -14
- package/dist/src/login/credentials-revoke.js +0 -95
- package/dist/src/login/credentials-store.d.ts +0 -60
- package/dist/src/login/credentials-store.js +0 -181
- package/dist/src/login/filesystem-cache.d.ts +0 -25
- package/dist/src/login/filesystem-cache.js +0 -195
- package/dist/src/login/index.d.ts +0 -110
- package/dist/src/login/index.js +0 -424
- package/dist/src/login/keychain.d.ts +0 -18
- package/dist/src/login/keychain.js +0 -74
- package/dist/src/login/legacy-jwt.d.ts +0 -4
- package/dist/src/login/legacy-jwt.js +0 -18
- package/dist/src/login.d.ts +0 -10
- package/dist/src/login.js +0 -10
- package/dist/src/paths.d.ts +0 -1
- package/dist/src/paths.js +0 -6
- package/dist/src/plugins/add/index.d.ts +0 -254
- package/dist/src/plugins/add/index.js +0 -95
- package/dist/src/plugins/add/schemas.d.ts +0 -8
- package/dist/src/plugins/add/schemas.js +0 -22
- package/dist/src/plugins/auth/credentials-base-url.d.ts +0 -11
- package/dist/src/plugins/auth/credentials-base-url.js +0 -24
- package/dist/src/plugins/buildManifest/index.d.ts +0 -120
- package/dist/src/plugins/buildManifest/index.js +0 -71
- package/dist/src/plugins/buildManifest/schemas.d.ts +0 -44
- package/dist/src/plugins/buildManifest/schemas.js +0 -17
- package/dist/src/plugins/bundleCode/index.d.ts +0 -23
- package/dist/src/plugins/bundleCode/index.js +0 -62
- package/dist/src/plugins/bundleCode/schemas.d.ts +0 -10
- package/dist/src/plugins/bundleCode/schemas.js +0 -19
- package/dist/src/plugins/cliOverrides/index.d.ts +0 -21
- package/dist/src/plugins/cliOverrides/index.js +0 -17
- package/dist/src/plugins/curl/index.d.ts +0 -76
- package/dist/src/plugins/curl/index.js +0 -236
- package/dist/src/plugins/curl/schemas.d.ts +0 -40
- package/dist/src/plugins/curl/schemas.js +0 -108
- package/dist/src/plugins/curl/utils.d.ts +0 -34
- package/dist/src/plugins/curl/utils.js +0 -150
- package/dist/src/plugins/drainTriggerInbox/index.d.ts +0 -46
- package/dist/src/plugins/drainTriggerInbox/index.js +0 -178
- package/dist/src/plugins/feedback/index.d.ts +0 -24
- package/dist/src/plugins/feedback/index.js +0 -52
- package/dist/src/plugins/feedback/schemas.d.ts +0 -5
- package/dist/src/plugins/feedback/schemas.js +0 -8
- package/dist/src/plugins/generateAppTypes/index.d.ts +0 -265
- package/dist/src/plugins/generateAppTypes/index.js +0 -129
- package/dist/src/plugins/generateAppTypes/schemas.d.ts +0 -58
- package/dist/src/plugins/generateAppTypes/schemas.js +0 -21
- package/dist/src/plugins/getLoginConfigPath/index.d.ts +0 -16
- package/dist/src/plugins/getLoginConfigPath/index.js +0 -9
- package/dist/src/plugins/getLoginConfigPath/schemas.d.ts +0 -3
- package/dist/src/plugins/getLoginConfigPath/schemas.js +0 -5
- package/dist/src/plugins/index.d.ts +0 -15
- package/dist/src/plugins/index.js +0 -15
- package/dist/src/plugins/init/display.d.ts +0 -9
- package/dist/src/plugins/init/display.js +0 -72
- package/dist/src/plugins/init/index.d.ts +0 -21
- package/dist/src/plugins/init/index.js +0 -56
- package/dist/src/plugins/init/schemas.d.ts +0 -9
- package/dist/src/plugins/init/schemas.js +0 -19
- package/dist/src/plugins/init/steps.d.ts +0 -39
- package/dist/src/plugins/init/steps.js +0 -141
- package/dist/src/plugins/init/types.d.ts +0 -31
- package/dist/src/plugins/init/types.js +0 -1
- package/dist/src/plugins/init/utils.d.ts +0 -48
- package/dist/src/plugins/init/utils.js +0 -135
- package/dist/src/plugins/login/index.d.ts +0 -25
- package/dist/src/plugins/login/index.js +0 -12
- package/dist/src/plugins/login/schemas.d.ts +0 -9
- package/dist/src/plugins/login/schemas.js +0 -27
- package/dist/src/plugins/logout/index.d.ts +0 -30
- package/dist/src/plugins/logout/index.js +0 -33
- package/dist/src/plugins/logout/schemas.d.ts +0 -2
- package/dist/src/plugins/logout/schemas.js +0 -4
- package/dist/src/plugins/mcp/index.d.ts +0 -28
- package/dist/src/plugins/mcp/index.js +0 -24
- package/dist/src/plugins/mcp/schemas.d.ts +0 -5
- package/dist/src/plugins/mcp/schemas.js +0 -10
- package/dist/src/plugins/signup/index.d.ts +0 -25
- package/dist/src/plugins/signup/index.js +0 -12
- package/dist/src/plugins/signup/schemas.d.ts +0 -9
- package/dist/src/plugins/signup/schemas.js +0 -26
- package/dist/src/plugins/signup/test-harness.d.ts +0 -34
- package/dist/src/plugins/signup/test-harness.js +0 -76
- package/dist/src/plugins/watchTriggerInbox/index.d.ts +0 -46
- package/dist/src/plugins/watchTriggerInbox/index.js +0 -166
- package/dist/src/sdk.d.ts +0 -17
- package/dist/src/sdk.js +0 -67
- package/dist/src/telemetry/builders.d.ts +0 -44
- package/dist/src/telemetry/builders.js +0 -59
- package/dist/src/telemetry/events.d.ts +0 -40
- package/dist/src/telemetry/events.js +0 -4
- package/dist/src/types/sdk.d.ts +0 -6
- package/dist/src/types/sdk.js +0 -1
- package/dist/src/utils/api/client.d.ts +0 -15
- package/dist/src/utils/api/client.js +0 -27
- package/dist/src/utils/approval-errors.d.ts +0 -1
- package/dist/src/utils/approval-errors.js +0 -9
- package/dist/src/utils/approval-progress.d.ts +0 -12
- package/dist/src/utils/approval-progress.js +0 -179
- package/dist/src/utils/auth/account-auth.d.ts +0 -33
- package/dist/src/utils/auth/account-auth.js +0 -302
- package/dist/src/utils/auth/client-credentials.d.ts +0 -26
- package/dist/src/utils/auth/client-credentials.js +0 -67
- package/dist/src/utils/auth/oauth-callback.d.ts +0 -6
- package/dist/src/utils/auth/oauth-callback.js +0 -28
- package/dist/src/utils/auth/oauth-errors.d.ts +0 -2
- package/dist/src/utils/auth/oauth-errors.js +0 -39
- package/dist/src/utils/auth/oauth-flow.d.ts +0 -37
- package/dist/src/utils/auth/oauth-flow.js +0 -313
- package/dist/src/utils/auth/oauth-transaction.d.ts +0 -35
- package/dist/src/utils/auth/oauth-transaction.js +0 -69
- package/dist/src/utils/cli-generator-utils.d.ts +0 -14
- package/dist/src/utils/cli-generator-utils.js +0 -122
- package/dist/src/utils/cli-generator.d.ts +0 -4
- package/dist/src/utils/cli-generator.js +0 -831
- package/dist/src/utils/cli-options.d.ts +0 -16
- package/dist/src/utils/cli-options.js +0 -34
- package/dist/src/utils/cli-renderer.d.ts +0 -53
- package/dist/src/utils/cli-renderer.js +0 -265
- package/dist/src/utils/constants.d.ts +0 -3
- package/dist/src/utils/constants.js +0 -5
- package/dist/src/utils/directory-detection.d.ts +0 -5
- package/dist/src/utils/directory-detection.js +0 -21
- package/dist/src/utils/errors.d.ts +0 -33
- package/dist/src/utils/errors.js +0 -36
- package/dist/src/utils/extensions.d.ts +0 -20
- package/dist/src/utils/extensions.js +0 -66
- package/dist/src/utils/getCallablePromise.d.ts +0 -6
- package/dist/src/utils/getCallablePromise.js +0 -14
- package/dist/src/utils/log.d.ts +0 -8
- package/dist/src/utils/log.js +0 -26
- package/dist/src/utils/manifest-helpers.d.ts +0 -10
- package/dist/src/utils/manifest-helpers.js +0 -19
- package/dist/src/utils/non-interactive.d.ts +0 -14
- package/dist/src/utils/non-interactive.js +0 -15
- package/dist/src/utils/package-manager-detector.d.ts +0 -18
- package/dist/src/utils/package-manager-detector.js +0 -72
- package/dist/src/utils/parameter-resolver.d.ts +0 -179
- package/dist/src/utils/parameter-resolver.js +0 -1554
- package/dist/src/utils/retry.d.ts +0 -6
- package/dist/src/utils/retry.js +0 -21
- package/dist/src/utils/schema-formatter.d.ts +0 -11
- package/dist/src/utils/schema-formatter.js +0 -131
- package/dist/src/utils/serializeAsync.d.ts +0 -2
- package/dist/src/utils/serializeAsync.js +0 -16
- package/dist/src/utils/spinner.d.ts +0 -1
- package/dist/src/utils/spinner.js +0 -21
- package/dist/src/utils/string-utils.d.ts +0 -1
- package/dist/src/utils/string-utils.js +0 -6
- package/dist/src/utils/triggerDrain.d.ts +0 -144
- package/dist/src/utils/triggerDrain.js +0 -351
- package/dist/src/utils/version-checker.d.ts +0 -17
- package/dist/src/utils/version-checker.js +0 -154
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve whether a CLI invocation should run non-interactively.
|
|
3
|
-
*
|
|
4
|
-
* A command is non-interactive when the user explicitly opts out via
|
|
5
|
-
* `--non-interactive`, OR when stdin or stdout isn't a TTY (CI, piped output,
|
|
6
|
-
* etc.). The TTY check matters because prompting against a non-TTY stream
|
|
7
|
-
* hangs or crashes — every plugin that gates inquirer prompts on this flag
|
|
8
|
-
* needs the same answer.
|
|
9
|
-
*/
|
|
10
|
-
export declare function resolveNonInteractive(options: {
|
|
11
|
-
nonInteractive?: boolean;
|
|
12
|
-
/** @deprecated Use `nonInteractive` instead. */
|
|
13
|
-
skipPrompts?: boolean;
|
|
14
|
-
}): boolean;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve whether a CLI invocation should run non-interactively.
|
|
3
|
-
*
|
|
4
|
-
* A command is non-interactive when the user explicitly opts out via
|
|
5
|
-
* `--non-interactive`, OR when stdin or stdout isn't a TTY (CI, piped output,
|
|
6
|
-
* etc.). The TTY check matters because prompting against a non-TTY stream
|
|
7
|
-
* hangs or crashes — every plugin that gates inquirer prompts on this flag
|
|
8
|
-
* needs the same answer.
|
|
9
|
-
*/
|
|
10
|
-
export function resolveNonInteractive(options) {
|
|
11
|
-
return (options.nonInteractive === true ||
|
|
12
|
-
options.skipPrompts === true ||
|
|
13
|
-
!process.stdin.isTTY ||
|
|
14
|
-
!process.stdout.isTTY);
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const PACKAGE_MANAGERS: readonly ["npm", "pnpm", "yarn", "bun"];
|
|
2
|
-
export type PackageManager = (typeof PACKAGE_MANAGERS)[number];
|
|
3
|
-
export interface PackageManagerInfo {
|
|
4
|
-
name: PackageManager | "unknown";
|
|
5
|
-
source: "runtime" | "lockfile" | "fallback";
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Detect which package manager is being used or configured for this project.
|
|
9
|
-
*
|
|
10
|
-
* Returns an object like:
|
|
11
|
-
* { name: 'npm' | 'yarn' | 'pnpm' | 'bun' | 'unknown', source: 'runtime' | 'lockfile' | 'fallback' }
|
|
12
|
-
*/
|
|
13
|
-
export declare function detectPackageManager(cwd?: string): PackageManagerInfo;
|
|
14
|
-
/**
|
|
15
|
-
* Get the appropriate update command for the detected package manager.
|
|
16
|
-
* Returns global update commands if globally installed, local commands if locally installed.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getUpdateCommand(packageName: string): string;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "fs";
|
|
2
|
-
import { join } from "path";
|
|
3
|
-
import isInstalledGlobally from "is-installed-globally";
|
|
4
|
-
export const PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
|
|
5
|
-
/**
|
|
6
|
-
* Detect which package manager is being used or configured for this project.
|
|
7
|
-
*
|
|
8
|
-
* Returns an object like:
|
|
9
|
-
* { name: 'npm' | 'yarn' | 'pnpm' | 'bun' | 'unknown', source: 'runtime' | 'lockfile' | 'fallback' }
|
|
10
|
-
*/
|
|
11
|
-
export function detectPackageManager(cwd = process.cwd()) {
|
|
12
|
-
// --- 1. Runtime detection (based on env)
|
|
13
|
-
const ua = process.env.npm_config_user_agent;
|
|
14
|
-
if (ua) {
|
|
15
|
-
if (ua.includes("yarn"))
|
|
16
|
-
return { name: "yarn", source: "runtime" };
|
|
17
|
-
if (ua.includes("pnpm"))
|
|
18
|
-
return { name: "pnpm", source: "runtime" };
|
|
19
|
-
if (ua.includes("bun"))
|
|
20
|
-
return { name: "bun", source: "runtime" };
|
|
21
|
-
if (ua.includes("npm"))
|
|
22
|
-
return { name: "npm", source: "runtime" };
|
|
23
|
-
}
|
|
24
|
-
// --- 2. Lockfile detection (based on files in cwd)
|
|
25
|
-
const files = [
|
|
26
|
-
["pnpm-lock.yaml", "pnpm"],
|
|
27
|
-
["yarn.lock", "yarn"],
|
|
28
|
-
["bun.lockb", "bun"],
|
|
29
|
-
["package-lock.json", "npm"],
|
|
30
|
-
];
|
|
31
|
-
for (const [file, name] of files) {
|
|
32
|
-
if (existsSync(join(cwd, file))) {
|
|
33
|
-
return { name, source: "lockfile" };
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// --- 3. Fallback
|
|
37
|
-
return { name: "unknown", source: "fallback" };
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Get the appropriate update command for the detected package manager.
|
|
41
|
-
* Returns global update commands if globally installed, local commands if locally installed.
|
|
42
|
-
*/
|
|
43
|
-
export function getUpdateCommand(packageName) {
|
|
44
|
-
const pm = detectPackageManager();
|
|
45
|
-
const isGlobal = isInstalledGlobally;
|
|
46
|
-
if (isGlobal) {
|
|
47
|
-
// Global update commands
|
|
48
|
-
switch (pm.name) {
|
|
49
|
-
case "yarn":
|
|
50
|
-
return `yarn global upgrade ${packageName}@latest`;
|
|
51
|
-
case "pnpm":
|
|
52
|
-
return `pnpm update -g ${packageName}@latest`;
|
|
53
|
-
case "bun":
|
|
54
|
-
return `bun update -g ${packageName}@latest`;
|
|
55
|
-
default:
|
|
56
|
-
return `npm install -g ${packageName}@latest`;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
// Local update commands
|
|
61
|
-
switch (pm.name) {
|
|
62
|
-
case "yarn":
|
|
63
|
-
return `yarn upgrade ${packageName}@latest`;
|
|
64
|
-
case "pnpm":
|
|
65
|
-
return `pnpm update ${packageName}@latest`;
|
|
66
|
-
case "bun":
|
|
67
|
-
return `bun update ${packageName}@latest`;
|
|
68
|
-
default:
|
|
69
|
-
return `npm install ${packageName}@latest`;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { type ZapierSdk } from "@zapier/zapier-sdk";
|
|
3
|
-
/**
|
|
4
|
-
* Append a choice's `hint` to its name as dimmed parens, returning a new
|
|
5
|
-
* choice object. An array hint is joined with ", ". Used by every prompt
|
|
6
|
-
* backend that renders resolver-supplied choices so the dim styling lives
|
|
7
|
-
* in one place.
|
|
8
|
-
*
|
|
9
|
-
* Default-when-unset: if `hint` is not provided and the choice's `value`
|
|
10
|
-
* is a primitive (string or number), the value is auto-rendered as the
|
|
11
|
-
* hint. So a resolver returning `{ name: "Slack", value: "SlackCLIAPI" }`
|
|
12
|
-
* with no `hint` renders as `Slack (SlackCLIAPI)`. To opt out of the
|
|
13
|
-
* auto-default, set `hint: ""` or `hint: []` explicitly.
|
|
14
|
-
*
|
|
15
|
-
* Skip-when-equal: a hint that matches the rendered name verbatim is
|
|
16
|
-
* suppressed so primitive-enum resolvers (where `name === String(value)`)
|
|
17
|
-
* don't render "read (read)". Case differences still render both.
|
|
18
|
-
*/
|
|
19
|
-
export declare function renderChoiceLabel<T extends {
|
|
20
|
-
name: string;
|
|
21
|
-
value: unknown;
|
|
22
|
-
hint?: string | string[];
|
|
23
|
-
}>(choice: T): T;
|
|
24
|
-
export declare class SchemaParameterResolver {
|
|
25
|
-
private debug;
|
|
26
|
-
private spinner;
|
|
27
|
-
private debugLog;
|
|
28
|
-
private startSpinner;
|
|
29
|
-
private stopSpinner;
|
|
30
|
-
resolveParameters(schema: z.ZodSchema, providedParams: unknown, sdk: ZapierSdk, functionName?: string, options?: {
|
|
31
|
-
interactiveMode?: boolean;
|
|
32
|
-
debug?: boolean;
|
|
33
|
-
}): Promise<unknown>;
|
|
34
|
-
private extractParametersFromSchema;
|
|
35
|
-
private analyzeFieldSchema;
|
|
36
|
-
private createResolvableParameter;
|
|
37
|
-
/**
|
|
38
|
-
* Calls `tryResolveWithoutPrompt` on a dynamic resolver.
|
|
39
|
-
* Returns the resolution result object, or null if unresolvable / throws.
|
|
40
|
-
* Note: { resolvedValue: undefined } is a valid result (e.g. connection when app has no auth);
|
|
41
|
-
* only a null return from the resolver itself means "could not auto-resolve".
|
|
42
|
-
*/
|
|
43
|
-
private tryAutoResolve;
|
|
44
|
-
/**
|
|
45
|
-
* Non-interactive resolution: auto-resolves what it can via tryAutoResolve,
|
|
46
|
-
* throws ZapierCliMissingParametersError for anything that requires user input.
|
|
47
|
-
*/
|
|
48
|
-
private resolveRequiredParamsNonInteractive;
|
|
49
|
-
/**
|
|
50
|
-
* Wrap a PromptConfig.validate so internal sentinels (Symbols) bypass
|
|
51
|
-
* it. The resolver's validator is intended for actual user values; our
|
|
52
|
-
* Skip / Custom / Load-more sentinels are internal control-flow and
|
|
53
|
-
* should pass through. Returns `undefined` when the resolver didn't
|
|
54
|
-
* supply a validator (so `await search({ ...rest })` doesn't get a
|
|
55
|
-
* pass-through identity function).
|
|
56
|
-
*/
|
|
57
|
-
private wrapPromptValidate;
|
|
58
|
-
/**
|
|
59
|
-
* Apply a PromptConfig.filter to a selected value, but only when the
|
|
60
|
-
* value is a real data choice (not an internal sentinel). @inquirer/search
|
|
61
|
-
* has no built-in filter hook, so the search-backed paths call this
|
|
62
|
-
* explicitly before returning.
|
|
63
|
-
*/
|
|
64
|
-
private applyPromptFilter;
|
|
65
|
-
/**
|
|
66
|
-
* If the resolver's PromptConfig sets a `default` value, move the
|
|
67
|
-
* matching choice to the front so it's the first selectable item in
|
|
68
|
-
* the rendered source. @inquirer/search has no built-in `default`
|
|
69
|
-
* option; first-selectable is what Enter picks, so reordering achieves
|
|
70
|
-
* the same semantics inquirer.prompt's list had natively.
|
|
71
|
-
*
|
|
72
|
-
* Returns the original array if no default is set or the default
|
|
73
|
-
* doesn't match any current choice.
|
|
74
|
-
*/
|
|
75
|
-
private reorderForDefault;
|
|
76
|
-
/**
|
|
77
|
-
* Build the disabled "if you had X capability, more results would show"
|
|
78
|
-
* hints for any unmet capabilities the resolver declared. Returns the
|
|
79
|
-
* raw hint strings — callers wrap them into choice objects with whatever
|
|
80
|
-
* sentinel value they prefer (disabled choices' values are inert).
|
|
81
|
-
*/
|
|
82
|
-
private computeCapabilityHints;
|
|
83
|
-
/**
|
|
84
|
-
* Unpack a DynamicResolver.fetch result into the three shapes the caller
|
|
85
|
-
* cares about: a flat items array, an optional AsyncIterator for further
|
|
86
|
-
* pagination, and a hasMore flag. Centralizing keeps the AsyncIterable /
|
|
87
|
-
* `{data, nextCursor}` / `TItem[]` discrimination in one place — both
|
|
88
|
-
* the main dropdown loop and the search-mode flow consume it.
|
|
89
|
-
*
|
|
90
|
-
* The function is `async` for the AsyncIterable branch only (we eagerly
|
|
91
|
-
* consume the first page so callers don't have to discriminate). The
|
|
92
|
-
* other two branches return synchronously; an explicit Promise.resolve
|
|
93
|
-
* is unnecessary because async automatically wraps.
|
|
94
|
-
*
|
|
95
|
-
* Note: callers in search mode intentionally drop `pageIterator` /
|
|
96
|
-
* `hasMore` because each search() invocation re-prompts from scratch;
|
|
97
|
-
* pagination only matters when the prompt is the dropdown itself.
|
|
98
|
-
*/
|
|
99
|
-
private unpackFetchResult;
|
|
100
|
-
/**
|
|
101
|
-
* Search-mode dynamic resolver: prompts the user for free-form text, passes
|
|
102
|
-
* it to fetch via `search`, and either short-circuits on a primitive return
|
|
103
|
-
* (exact match) or renders the results as a search-filterable dropdown.
|
|
104
|
-
* Empty results still render the dropdown so the user can fall through to
|
|
105
|
-
* "(Use 'foo' as-is)" or "(Try a different search)" rather than being
|
|
106
|
-
* stuck.
|
|
107
|
-
*
|
|
108
|
-
* Known limitation: pagination beyond the first page is dropped. Each
|
|
109
|
-
* search() invocation re-prompts from scratch and the user is expected
|
|
110
|
-
* to refine their query if too many results came back. If a future
|
|
111
|
-
* high-cardinality search resolver needs Load-more here, the
|
|
112
|
-
* `pageIterator` / `hasMore` from `unpackFetchResult` is what to wire in.
|
|
113
|
-
*/
|
|
114
|
-
private resolveDynamicWithSearchInput;
|
|
115
|
-
private resolveParameter;
|
|
116
|
-
/**
|
|
117
|
-
* Run a resolver to obtain a value for one parameter, prompting the
|
|
118
|
-
* user when necessary. Routes to one of several prompt backends and
|
|
119
|
-
* has to keep the `PromptConfig` contract honest across each one.
|
|
120
|
-
*
|
|
121
|
-
* `PromptConfig` field × prompt-backend handling:
|
|
122
|
-
*
|
|
123
|
-
* | field | list (search()) | checkbox/confirm (inquirer.prompt) | search-mode dropdown (search()) |
|
|
124
|
-
* | -------- | --------------- | ---------------------------------- | ------------------------------- |
|
|
125
|
-
* | type | required | required | required |
|
|
126
|
-
* | name | (set internally)| forwarded | (set internally) |
|
|
127
|
-
* | message | forwarded | forwarded | forwarded |
|
|
128
|
-
* | choices | filtered in src | passed to inquirer | filtered in src |
|
|
129
|
-
* | default | reorder matches | passed (also internal cursor jump) | reorder matches |
|
|
130
|
-
* | validate | wrapped | passed (inquirer native) | wrapped + manual for (Use as-is)|
|
|
131
|
-
* | filter | manual once | inquirer native (do NOT double) | manual once |
|
|
132
|
-
*
|
|
133
|
-
* Escape-hatch sentinels (Skip / Custom value / Use as-is / Load more
|
|
134
|
-
* / Try again) bypass the resolver's validate/filter because they
|
|
135
|
-
* aren't real user values — they're CLI control-flow.
|
|
136
|
-
*/
|
|
137
|
-
private resolveWithResolver;
|
|
138
|
-
private resolveFieldsRecursively;
|
|
139
|
-
/**
|
|
140
|
-
* Resolves an array parameter by repeatedly prompting for items until user says no
|
|
141
|
-
*/
|
|
142
|
-
private resolveArrayRecursively;
|
|
143
|
-
/**
|
|
144
|
-
* Recursively processes fieldsets and their fields, maintaining natural structure
|
|
145
|
-
* and creating nested inputs as needed (e.g., fieldset "foo" becomes inputs.foo = [{}])
|
|
146
|
-
*/
|
|
147
|
-
private processFieldItems;
|
|
148
|
-
private getNestedValue;
|
|
149
|
-
private setNestedValue;
|
|
150
|
-
/**
|
|
151
|
-
* Extract and normalize field metadata from raw field object
|
|
152
|
-
*/
|
|
153
|
-
private extractFieldMetadata;
|
|
154
|
-
/**
|
|
155
|
-
* Fetch a page of choices for a dropdown field
|
|
156
|
-
*/
|
|
157
|
-
private fetchChoices;
|
|
158
|
-
/**
|
|
159
|
-
* Prompt user with choices (handles both single and multi-select with pagination).
|
|
160
|
-
* Single-select goes through @inquirer/search so users can type-to-filter long
|
|
161
|
-
* dropdowns (SELECT fields); multi-select stays on inquirer.prompt since search
|
|
162
|
-
* is single-select only.
|
|
163
|
-
*/
|
|
164
|
-
private promptWithChoices;
|
|
165
|
-
/**
|
|
166
|
-
* Prompt user for free-form input (text or boolean)
|
|
167
|
-
*/
|
|
168
|
-
private promptFreeForm;
|
|
169
|
-
/**
|
|
170
|
-
* Store field value in inputs object with validation
|
|
171
|
-
*/
|
|
172
|
-
private storeFieldValue;
|
|
173
|
-
private promptForField;
|
|
174
|
-
private isUserCancellation;
|
|
175
|
-
private hasResolver;
|
|
176
|
-
private getResolver;
|
|
177
|
-
private getLocalResolvers;
|
|
178
|
-
private getResolverConstants;
|
|
179
|
-
}
|