configorama 1.1.0 → 1.2.1
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/README.md +10 -1
- package/cli.js +14 -1
- package/package.json +9 -4
- package/plugins/onepassword/index.js +15 -4
- package/plugins/onepassword/normalize.js +13 -1
- package/src/errors.js +3 -0
- package/src/index.js +19 -0
- package/src/main.js +18 -29
- package/src/utils/parsing/detectFormat.js +70 -0
- package/src/utils/parsing/detectFormat.test.js +68 -0
- package/src/utils/parsing/parse.js +1 -35
- package/src/utils/setup/applyAnswers.js +41 -0
- package/src/utils/setup/setupEngine.js +85 -0
- package/src/utils/setup/stdoutRedirect.js +48 -0
- package/src/utils/setup/writeAnswers.js +50 -0
- package/src/utils/setup/writeDotenv.js +142 -0
- package/src/utils/ui/configWizard.js +20 -1
- package/types/src/capabilities.d.ts +8 -0
- package/types/src/capabilities.d.ts.map +1 -0
- package/types/src/display.d.ts +62 -0
- package/types/src/display.d.ts.map +1 -0
- package/types/src/errors.d.ts +20 -0
- package/types/src/errors.d.ts.map +1 -0
- package/types/src/index.d.ts +119 -0
- package/types/src/index.d.ts.map +1 -1
- package/types/src/main.d.ts +23 -16
- package/types/src/main.d.ts.map +1 -1
- package/types/src/metadata.d.ts +28 -0
- package/types/src/metadata.d.ts.map +1 -0
- package/types/src/parsers/dotenv.d.ts +6 -0
- package/types/src/parsers/dotenv.d.ts.map +1 -0
- package/types/src/parsers/esm.d.ts.map +1 -1
- package/types/src/parsers/typescript.d.ts.map +1 -1
- package/types/src/resolvers/valueFromCron.d.ts.map +1 -1
- package/types/src/resolvers/valueFromEval.d.ts.map +1 -1
- package/types/src/resolvers/valueFromFile.d.ts +4 -0
- package/types/src/resolvers/valueFromFile.d.ts.map +1 -1
- package/types/src/resolvers/valueFromGit.d.ts.map +1 -1
- package/types/src/resolvers/valueFromOptions.d.ts +1 -0
- package/types/src/resolvers/valueFromOptions.d.ts.map +1 -1
- package/types/src/sync.d.ts.map +1 -1
- package/types/src/utils/BoundedMap.d.ts +10 -0
- package/types/src/utils/BoundedMap.d.ts.map +1 -0
- package/types/src/utils/PromiseTracker.d.ts +1 -1
- package/types/src/utils/PromiseTracker.d.ts.map +1 -1
- package/types/src/utils/filters/filterArgs.d.ts +13 -0
- package/types/src/utils/filters/filterArgs.d.ts.map +1 -0
- package/types/src/utils/filters/oneOf.d.ts +7 -0
- package/types/src/utils/filters/oneOf.d.ts.map +1 -0
- package/types/src/utils/introspection/audit.d.ts +14 -0
- package/types/src/utils/introspection/audit.d.ts.map +1 -0
- package/types/src/utils/introspection/graph.d.ts +4 -0
- package/types/src/utils/introspection/graph.d.ts.map +1 -0
- package/types/src/utils/introspection/model.d.ts +43 -0
- package/types/src/utils/introspection/model.d.ts.map +1 -0
- package/types/src/utils/parsing/commentAnnotations.d.ts +18 -0
- package/types/src/utils/parsing/commentAnnotations.d.ts.map +1 -0
- package/types/src/utils/parsing/detectFormat.d.ts +17 -0
- package/types/src/utils/parsing/detectFormat.d.ts.map +1 -0
- package/types/src/utils/parsing/enrichMetadata.d.ts.map +1 -1
- package/types/src/utils/parsing/extractComment.d.ts +20 -0
- package/types/src/utils/parsing/extractComment.d.ts.map +1 -0
- package/types/src/utils/parsing/parse.d.ts.map +1 -1
- package/types/src/utils/parsing/preProcess.d.ts.map +1 -1
- package/types/src/utils/paths/fileType.d.ts +15 -0
- package/types/src/utils/paths/fileType.d.ts.map +1 -0
- package/types/src/utils/paths/findLineForKey.d.ts +9 -0
- package/types/src/utils/paths/findLineForKey.d.ts.map +1 -1
- package/types/src/utils/paths/ignorePaths.d.ts +5 -0
- package/types/src/utils/paths/ignorePaths.d.ts.map +1 -0
- package/types/src/utils/redaction/redact.d.ts +10 -0
- package/types/src/utils/redaction/redact.d.ts.map +1 -0
- package/types/src/utils/redaction/setupRedaction.d.ts +5 -0
- package/types/src/utils/redaction/setupRedaction.d.ts.map +1 -0
- package/types/src/utils/requirements/configRequirements.d.ts +70 -0
- package/types/src/utils/requirements/configRequirements.d.ts.map +1 -0
- package/types/src/utils/requirements/serializeRequirements.d.ts +63 -0
- package/types/src/utils/requirements/serializeRequirements.d.ts.map +1 -0
- package/types/src/utils/security/dotenvFileRefs.d.ts +13 -0
- package/types/src/utils/security/dotenvFileRefs.d.ts.map +1 -0
- package/types/src/utils/security/evalSafety.d.ts +17 -0
- package/types/src/utils/security/evalSafety.d.ts.map +1 -0
- package/types/src/utils/security/safetyPolicy.d.ts +15 -0
- package/types/src/utils/security/safetyPolicy.d.ts.map +1 -0
- package/types/src/utils/setup/applyAnswers.d.ts +34 -0
- package/types/src/utils/setup/applyAnswers.d.ts.map +1 -0
- package/types/src/utils/setup/setupEngine.d.ts +89 -0
- package/types/src/utils/setup/setupEngine.d.ts.map +1 -0
- package/types/src/utils/setup/stdoutRedirect.d.ts +10 -0
- package/types/src/utils/setup/stdoutRedirect.d.ts.map +1 -0
- package/types/src/utils/setup/writeAnswers.d.ts +17 -0
- package/types/src/utils/setup/writeAnswers.d.ts.map +1 -0
- package/types/src/utils/setup/writeDotenv.d.ts +27 -0
- package/types/src/utils/setup/writeDotenv.d.ts.map +1 -0
- package/types/src/utils/strings/didYouMean.d.ts +23 -0
- package/types/src/utils/strings/didYouMean.d.ts.map +1 -0
- package/types/src/utils/strings/formatFunctionArgs.d.ts.map +1 -1
- package/types/src/utils/strings/replaceAll.d.ts.map +1 -1
- package/types/src/utils/strings/splitByComma.d.ts.map +1 -1
- package/types/src/utils/ui/configWizard.d.ts +51 -7
- package/types/src/utils/ui/configWizard.d.ts.map +1 -1
- package/types/src/utils/ui/createEditorLink.d.ts +7 -0
- package/types/src/utils/ui/createEditorLink.d.ts.map +1 -1
- package/types/src/utils/ui/promptDescriptors.d.ts +39 -0
- package/types/src/utils/ui/promptDescriptors.d.ts.map +1 -0
- package/types/src/utils/variables/cleanVariable.d.ts.map +1 -1
- package/types/src/utils/variables/getVariableType.d.ts.map +1 -1
- package/types/src/utils/variables/variableUtils.d.ts +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export type SetupAnswers = {
|
|
2
|
+
/**
|
|
3
|
+
* - answers for ${opt:...} variables
|
|
4
|
+
*/
|
|
5
|
+
options: {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* - answers for ${env:...} variables
|
|
10
|
+
*/
|
|
11
|
+
env: {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* - answers for ${self:...} variables
|
|
16
|
+
*/
|
|
17
|
+
self: {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* - answers for dot-prop config references
|
|
22
|
+
*/
|
|
23
|
+
dotProp: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type SetupResult = {
|
|
28
|
+
/**
|
|
29
|
+
* - result shape version
|
|
30
|
+
*/
|
|
31
|
+
schemaVersion: number;
|
|
32
|
+
/**
|
|
33
|
+
* - absolute path to the config file, null for object input
|
|
34
|
+
*/
|
|
35
|
+
configPath: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* - prompt requirements from buildConfigRequirements
|
|
38
|
+
*/
|
|
39
|
+
requirements: Array<any>;
|
|
40
|
+
/**
|
|
41
|
+
* - raw user answers grouped by variable type
|
|
42
|
+
*/
|
|
43
|
+
answers: SetupAnswers;
|
|
44
|
+
/**
|
|
45
|
+
* - answers with sensitive values redacted for display
|
|
46
|
+
*/
|
|
47
|
+
redactedAnswers: SetupAnswers;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Run the setup flow: analyze the config, prompt for unresolved values, return answers.
|
|
51
|
+
* Pure orchestration - applies nothing to process.env, config, or disk.
|
|
52
|
+
* @param {string|Object} configPathOrObject - path to config file or raw config object
|
|
53
|
+
* @param {Object} [settings] - configorama settings, plus:
|
|
54
|
+
* @param {Function} [settings.promptRenderer] - replaces the interactive wizard (mocks, answers files)
|
|
55
|
+
* @param {Object} [settings.streams] - stream overrides forwarded to the prompt renderer
|
|
56
|
+
* @param {Object} deps - injected dependencies
|
|
57
|
+
* @param {Function} [deps.analyze] - configorama.analyze, injected to avoid a require cycle
|
|
58
|
+
* @param {Object} [deps.analysis] - pre-computed analysis; skips the analyze call
|
|
59
|
+
* @returns {Promise<SetupResult>} collected answers and requirements
|
|
60
|
+
*/
|
|
61
|
+
export function runSetup(configPathOrObject: string | any, settings?: {
|
|
62
|
+
promptRenderer?: Function;
|
|
63
|
+
streams?: any;
|
|
64
|
+
}, deps?: {
|
|
65
|
+
analyze?: Function;
|
|
66
|
+
analysis?: any;
|
|
67
|
+
}): Promise<SetupResult>;
|
|
68
|
+
/**
|
|
69
|
+
* @typedef {Object} SetupAnswers
|
|
70
|
+
* @property {Object.<string, any>} options - answers for ${opt:...} variables
|
|
71
|
+
* @property {Object.<string, any>} env - answers for ${env:...} variables
|
|
72
|
+
* @property {Object.<string, any>} self - answers for ${self:...} variables
|
|
73
|
+
* @property {Object.<string, any>} dotProp - answers for dot-prop config references
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* @typedef {Object} SetupResult
|
|
77
|
+
* @property {number} schemaVersion - result shape version
|
|
78
|
+
* @property {string|null} configPath - absolute path to the config file, null for object input
|
|
79
|
+
* @property {Array<Object>} requirements - prompt requirements from buildConfigRequirements
|
|
80
|
+
* @property {SetupAnswers} answers - raw user answers grouped by variable type
|
|
81
|
+
* @property {SetupAnswers} redactedAnswers - answers with sensitive values redacted for display
|
|
82
|
+
*/
|
|
83
|
+
/**
|
|
84
|
+
* Ensure every answer group exists so callers get a stable shape
|
|
85
|
+
* @param {Object|undefined} userInputs - answers from the prompt renderer
|
|
86
|
+
* @returns {SetupAnswers} answers with all groups present
|
|
87
|
+
*/
|
|
88
|
+
export function normalizeAnswerGroups(userInputs: any | undefined): SetupAnswers;
|
|
89
|
+
//# sourceMappingURL=setupEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupEngine.d.ts","sourceRoot":"","sources":["../../../../src/utils/setup/setupEngine.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAmBc,MAAM;;;;gBACN,MAAM,GAAC,IAAI;;;;kBACX,KAAK,KAAQ;;;;aACb,YAAY;;;;qBACZ,YAAY;;AAiB1B;;;;;;;;;;;GAWG;AACH,6CATW,MAAM,MAAO,aAErB;IAA4B,cAAc;IAChB,OAAO;CACjC,SACA;IAAwB,OAAO;IACT,QAAQ;CAC9B,GAAU,OAAO,CAAC,WAAW,CAAC,CA6BhC;AAtED;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;GAIG;AACH,kDAHW,MAAO,SAAS,GACd,YAAY,CASxB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run fn with all process.stdout writes forwarded to target.
|
|
3
|
+
* TTY dimensions are mirrored from target so prompt layout matches the
|
|
4
|
+
* stream it actually renders on (stdout is often a pipe in --export mode).
|
|
5
|
+
* @param {import('stream').Writable} target - stream that receives the writes
|
|
6
|
+
* @param {Function} fn - async function to run while redirected
|
|
7
|
+
* @returns {Promise<any>} fn's result
|
|
8
|
+
*/
|
|
9
|
+
export function withStdoutRedirected(target: import("stream").Writable, fn: Function): Promise<any>;
|
|
10
|
+
//# sourceMappingURL=stdoutRedirect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdoutRedirect.d.ts","sourceRoot":"","sources":["../../../../src/utils/setup/stdoutRedirect.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,6CAJW,OAAO,QAAQ,EAAE,QAAQ,iBAEvB,OAAO,CAAC,GAAG,CAAC,CAgCxB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write setup answers to a JSON file
|
|
3
|
+
* @param {string} filePath - target path
|
|
4
|
+
* @param {Object} answers - answer groups { options, env, self, dotProp }
|
|
5
|
+
* @param {Object} [opts] - write behavior
|
|
6
|
+
* @param {boolean} [opts.force] - overwrite an existing file
|
|
7
|
+
* @returns {{ path: string, groups: Object.<string, string[]> }} written target and key names per group
|
|
8
|
+
*/
|
|
9
|
+
export function writeAnswers(filePath: string, answers: any, opts?: {
|
|
10
|
+
force?: boolean;
|
|
11
|
+
}): {
|
|
12
|
+
path: string;
|
|
13
|
+
groups: {
|
|
14
|
+
[x: string]: string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=writeAnswers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeAnswers.d.ts","sourceRoot":"","sources":["../../../../src/utils/setup/writeAnswers.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,uCANW,MAAM,uBAGd;IAAuB,KAAK,GAApB,OAAO;CACf,GAAU;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;YAAQ,MAAM,GAAE,MAAM,EAAE;KAAC,CAAA;CAAE,CAgC/D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write env answers to a dotenv file
|
|
3
|
+
* @param {string} filePath - target dotenv path
|
|
4
|
+
* @param {Object.<string, any>} values - env key/value pairs to write
|
|
5
|
+
* @param {Object} [opts] - write behavior
|
|
6
|
+
* @param {boolean} [opts.merge] - replace/append the managed block, preserving other content
|
|
7
|
+
* @param {boolean} [opts.force] - overwrite the whole file if it exists
|
|
8
|
+
* @returns {{ path: string, keys: string[] }} written target and key names for summaries
|
|
9
|
+
*/
|
|
10
|
+
export function writeDotenv(filePath: string, values: {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
}, opts?: {
|
|
13
|
+
merge?: boolean;
|
|
14
|
+
force?: boolean;
|
|
15
|
+
}): {
|
|
16
|
+
path: string;
|
|
17
|
+
keys: string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Quote a value so common dotenv parsers read it back verbatim
|
|
21
|
+
* @param {string} value - raw value
|
|
22
|
+
* @returns {string} dotenv-safe representation
|
|
23
|
+
*/
|
|
24
|
+
export function quoteDotenvValue(value: string): string;
|
|
25
|
+
export const MANAGED_BLOCK_START: "# >>> configx setup values >>>";
|
|
26
|
+
export const MANAGED_BLOCK_END: "# <<< configx setup values <<<";
|
|
27
|
+
//# sourceMappingURL=writeDotenv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeDotenv.d.ts","sourceRoot":"","sources":["../../../../src/utils/setup/writeDotenv.js"],"names":[],"mappings":"AA4FA;;;;;;;;GAQG;AACH,sCAPW,MAAM;;UAGd;IAAuB,KAAK,GAApB,OAAO;IACQ,KAAK,GAApB,OAAO;CACf,GAAU;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAmC5C;AA1HD;;;;GAIG;AACH,wCAHW,MAAM,GACJ,MAAM,CAYlB;AArBD,kCAA4B,gCAAgC,CAAA;AAC5D,gCAA0B,gCAAgC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optimal string alignment (Damerau) edit distance between two strings.
|
|
3
|
+
* Counts an adjacent transposition (e.g. "fromat" -> "format") as one edit,
|
|
4
|
+
* which keeps real single typos close while keeping unrelated words far apart.
|
|
5
|
+
* @param {string} a
|
|
6
|
+
* @param {string} b
|
|
7
|
+
* @returns {number} minimum edits (insert/delete/substitute/transpose)
|
|
8
|
+
*/
|
|
9
|
+
export function editDistance(a: string, b: string): number;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the candidate closest to input within an edit-distance threshold.
|
|
12
|
+
* Defaults to threshold 1 so only near-certain typos are suggested; this avoids
|
|
13
|
+
* hijacking legitimate passthrough options (e.g. `--stage`) that happen to sit a
|
|
14
|
+
* couple of edits away from a known flag.
|
|
15
|
+
* @param {string} input - the user-provided (possibly misspelled) token
|
|
16
|
+
* @param {string[]} candidates - known valid strings
|
|
17
|
+
* @param {{ threshold?: number }} [options]
|
|
18
|
+
* @returns {string|null} closest candidate, or null if none is close enough
|
|
19
|
+
*/
|
|
20
|
+
export function didYouMean(input: string, candidates: string[], options?: {
|
|
21
|
+
threshold?: number;
|
|
22
|
+
}): string | null;
|
|
23
|
+
//# sourceMappingURL=didYouMean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"didYouMean.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/didYouMean.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,gCAJW,MAAM,KACN,MAAM,GACJ,MAAM,CA8BlB;AAED;;;;;;;;;GASG;AACH,kCALW,MAAM,cACN,MAAM,EAAE,YACR;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpB,MAAM,GAAC,IAAI,CAkBvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatFunctionArgs.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/formatFunctionArgs.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatFunctionArgs.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/formatFunctionArgs.js"],"names":[],"mappings":"AAsBiB,0CAWhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceAll.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/replaceAll.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replaceAll.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/replaceAll.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wCALW,MAAM,YACN,MAAM,UACN,MAAM,GACJ,MAAM,CAelB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitByComma.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/splitByComma.js"],"names":[],"mappings":"AAiBA,
|
|
1
|
+
{"version":3,"file":"splitByComma.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/splitByComma.js"],"names":[],"mappings":"AAiBA,oEAqGC"}
|
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
* Runs config setup wizard
|
|
3
3
|
* @param {object} metadata - Enriched metadata from configorama
|
|
4
4
|
* @param {object} originalConfig - The original config before resolution
|
|
5
|
+
* @param {string} [configFilePath] - Path to the config file for display
|
|
6
|
+
* @param {object} [streams] - Stream overrides for the prompt UI
|
|
7
|
+
* @param {import('stream').Writable} [streams.output] - Where prompt UI renders; stdout stays clean when set
|
|
5
8
|
* @returns {Promise<object>} User inputs by variable type
|
|
6
9
|
*/
|
|
7
|
-
export function runConfigWizard(metadata: object, originalConfig?: object, configFilePath?: string
|
|
10
|
+
export function runConfigWizard(metadata: object, originalConfig?: object, configFilePath?: string, streams?: {
|
|
11
|
+
output?: import("stream").Writable;
|
|
12
|
+
}): Promise<object>;
|
|
8
13
|
/**
|
|
9
14
|
* Groups variables by type for wizard flow
|
|
10
15
|
* @param {object} uniqueVariables - The uniqueVariables from enriched metadata
|
|
@@ -12,12 +17,35 @@ export function runConfigWizard(metadata: object, originalConfig?: object, confi
|
|
|
12
17
|
* @returns {object} Grouped variables by type
|
|
13
18
|
*/
|
|
14
19
|
export function groupVariablesByType(uniqueVariables: object, originalConfig?: object): object;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
export function groupPromptDescriptorsForWizard(descriptors: any): {
|
|
21
|
+
options: any[];
|
|
22
|
+
env: any[];
|
|
23
|
+
self: any[];
|
|
24
|
+
dotProp: any[];
|
|
25
|
+
};
|
|
26
|
+
export function descriptorToVarInfo(descriptor: any): {
|
|
27
|
+
key: any;
|
|
28
|
+
variable: any;
|
|
29
|
+
cleanName: any;
|
|
30
|
+
variableType: any;
|
|
31
|
+
type: any;
|
|
32
|
+
isRequired: any;
|
|
33
|
+
defaultValue: any;
|
|
34
|
+
hasFallback: boolean;
|
|
35
|
+
resolvedValue: any;
|
|
36
|
+
occurrences: any;
|
|
37
|
+
descriptions: any[];
|
|
38
|
+
allowedValues: any;
|
|
39
|
+
conflictWarning: any;
|
|
40
|
+
obtainHint: any;
|
|
41
|
+
examples: any;
|
|
42
|
+
defaultHint: any;
|
|
43
|
+
group: any;
|
|
44
|
+
deprecationMessage: any;
|
|
45
|
+
sensitive: any;
|
|
46
|
+
};
|
|
47
|
+
import { isSensitiveVariable } from "../redaction/redact";
|
|
48
|
+
export function isVarInfoSensitive(varInfo: any): any;
|
|
21
49
|
/**
|
|
22
50
|
* Creates a human-readable prompt message
|
|
23
51
|
* @param {object} varInfo - Variable info
|
|
@@ -64,4 +92,20 @@ export function prefixMultilineText(count: number, text: string): string;
|
|
|
64
92
|
* @returns {string} Formatted text with pipe prefix and indentation
|
|
65
93
|
*/
|
|
66
94
|
export function formatWizardMultilineText(indentCount: number, text: string, addLeadingEmptyLine?: boolean): string;
|
|
95
|
+
/**
|
|
96
|
+
* Shortens a file path for display so long absolute paths don't wrap the prompt box.
|
|
97
|
+
* Prefers a path relative to cwd when shorter, then truncates the front, keeping the filename.
|
|
98
|
+
* @param {string} filePath - Path to display
|
|
99
|
+
* @param {number} maxLen - Maximum display length (default 56)
|
|
100
|
+
* @returns {string} Display-friendly path
|
|
101
|
+
*/
|
|
102
|
+
export function formatPathForDisplay(filePath: string, maxLen?: number): string;
|
|
103
|
+
/**
|
|
104
|
+
* Removes a single pair of matching surrounding quotes from a string.
|
|
105
|
+
* Mirrors how configorama strips quotes from inline fallback values like `'us-east-1'`.
|
|
106
|
+
* @param {*} val - Value to clean
|
|
107
|
+
* @returns {*} The value without surrounding quotes (non-strings pass through)
|
|
108
|
+
*/
|
|
109
|
+
export function stripQuotes(val: any): any;
|
|
110
|
+
export { isSensitiveVariable };
|
|
67
111
|
//# sourceMappingURL=configWizard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configWizard.d.ts","sourceRoot":"","sources":["../../../../src/utils/ui/configWizard.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configWizard.d.ts","sourceRoot":"","sources":["../../../../src/utils/ui/configWizard.js"],"names":[],"mappings":"AAomBA;;;;;;;;GAQG;AACH,0CAPW,MAAM,mBACN,MAAM,mBACN,MAAM,YAEd;IAA4C,MAAM,GAA1C,OAAO,QAAQ,EAAE,QAAQ;CACjC,GAAU,OAAO,CAAC,MAAM,CAAC,CAQ3B;AA/iBD;;;;;GAKG;AACH,sDAJW,MAAM,mBACN,MAAM,GACJ,MAAM,CAgKlB;AA2CD;;;;;EAkBC;AAnDD;;;;;;;;;;;;;;;;;;;;EA+BC;;AAsBD,sDAGC;AA0LD;;;;GAIG;AACH,6CAHW,MAAM,GACJ,MAAM,CA2HlB;AA7ND;;;;GAIG;AACH,yCAHW,MAAM,GACJ,MAAM,GAAC,IAAI,CA8BvB;AAED;;;;GAIG;AACH,qCAHW,MAAM,GACJ,MAAM,GAAC,IAAI,CA4BvB;AAED;;;;GAIG;AACH,0CAHW,MAAM,GACJ,MAAM,EAAE,GAAC,IAAI,CAsBzB;AAlKD;;;;;GAKG;AACH,oCAJW,MAAM,gBACN,MAAM,GACJ,MAAM,GAAC,SAAS,CA+D5B;AArXD;;;;;GAKG;AACH,2CAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAMlB;AAED;;;;;;GAMG;AACH,uDALW,MAAM,QACN,MAAM,wBACN,OAAO,GACL,MAAM,CASlB;AAcD;;;;;;GAMG;AACH,+CAJW,MAAM,WACN,MAAM,GACJ,MAAM,CAOlB;AAxBD;;;;;GAKG;AACH,iCAHW,GAAC,GACC,GAAC,CAMb"}
|
|
@@ -8,4 +8,11 @@
|
|
|
8
8
|
* @returns {string} The hyperlink string
|
|
9
9
|
*/
|
|
10
10
|
export function createEditorLink(filePath: string, line?: number, column?: number, customDisplay?: string, color?: string | false): string;
|
|
11
|
+
/**
|
|
12
|
+
* Returns a click-to-open path: relative to cwd with a leading './' when the file
|
|
13
|
+
* lives under cwd, otherwise the absolute path. Editors linkify both forms.
|
|
14
|
+
* @param {string} filePath - The file path
|
|
15
|
+
* @returns {string} Display path that editors can open on click
|
|
16
|
+
*/
|
|
17
|
+
export function toClickablePath(filePath: string): string;
|
|
11
18
|
//# sourceMappingURL=createEditorLink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEditorLink.d.ts","sourceRoot":"","sources":["../../../../src/utils/ui/createEditorLink.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,2CAPW,MAAM,SACN,MAAM,WACN,MAAM,kBACN,MAAM,UACN,MAAM,GAAC,KAAK,GACV,MAAM,CAiBlB"}
|
|
1
|
+
{"version":3,"file":"createEditorLink.d.ts","sourceRoot":"","sources":["../../../../src/utils/ui/createEditorLink.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,2CAPW,MAAM,SACN,MAAM,WACN,MAAM,kBACN,MAAM,UACN,MAAM,GAAC,KAAK,GACV,MAAM,CAiBlB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACJ,MAAM,CASlB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function createPromptDescriptor(requirement: any): {
|
|
2
|
+
name: any;
|
|
3
|
+
variable: any;
|
|
4
|
+
variableType: any;
|
|
5
|
+
group: any;
|
|
6
|
+
promptType: string;
|
|
7
|
+
type: any;
|
|
8
|
+
required: boolean;
|
|
9
|
+
sensitive: boolean;
|
|
10
|
+
description: any;
|
|
11
|
+
obtainHint: any;
|
|
12
|
+
examples: any;
|
|
13
|
+
defaultHint: any;
|
|
14
|
+
deprecationMessage: any;
|
|
15
|
+
defaultValue: any;
|
|
16
|
+
placeholder: any;
|
|
17
|
+
allowedValues: any;
|
|
18
|
+
paths: any;
|
|
19
|
+
occurrences: any;
|
|
20
|
+
conflicts: any;
|
|
21
|
+
conflictWarning: any;
|
|
22
|
+
normalize: (value: any) => any;
|
|
23
|
+
validate: (value: any) => string;
|
|
24
|
+
};
|
|
25
|
+
export function createPromptDescriptors(requirements: any): any;
|
|
26
|
+
export function getRequirementGroup(requirement: any): any;
|
|
27
|
+
export function groupRequirementsForWizard(requirements: any): {
|
|
28
|
+
options: any[];
|
|
29
|
+
env: any[];
|
|
30
|
+
self: any[];
|
|
31
|
+
dotProp: any[];
|
|
32
|
+
files: any[];
|
|
33
|
+
other: any[];
|
|
34
|
+
};
|
|
35
|
+
export function normalizePromptValue(value: any, descriptor: any): any;
|
|
36
|
+
export function selectPromptType(requirement: any): "text" | "password" | "multiselect" | "select" | "confirm";
|
|
37
|
+
export function stripPromptQuotes(value: any): any;
|
|
38
|
+
export function validatePromptValue(value: any, descriptor: any): string;
|
|
39
|
+
//# sourceMappingURL=promptDescriptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDescriptors.d.ts","sourceRoot":"","sources":["../../../../src/utils/ui/promptDescriptors.js"],"names":[],"mappings":"AAgJA;;;;;;;;;;;;;;;;;;;;;;;EAoCC;AAED,gEAEC;AAzKD,2DAEC;AAED;;;;;;;EAiBC;AAsFD,uEAoBC;AAxGD,+GAOC;AA7CD,mDAIC;AAqED,yEA+CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanVariable.d.ts","sourceRoot":"","sources":["../../../../src/utils/variables/cleanVariable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cleanVariable.d.ts","sourceRoot":"","sources":["../../../../src/utils/variables/cleanVariable.js"],"names":[],"mappings":"AAaiB,2GAFJ,MAAM,CAuElB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVariableType.d.ts","sourceRoot":"","sources":["../../../../src/utils/variables/getVariableType.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getVariableType.d.ts","sourceRoot":"","sources":["../../../../src/utils/variables/getVariableType.js"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,2CAJW,MAAM,yBAEJ,MAAM,CAwClB"}
|
|
@@ -23,7 +23,7 @@ export function verifyVariable(variableString: any, valueObject: any, variableTy
|
|
|
23
23
|
* Excludes suffix characters from the allowed set to prevent parsing issues
|
|
24
24
|
* @param {string} [prefix='${'] - Variable prefix
|
|
25
25
|
* @param {string} [suffix='}'] - Variable suffix
|
|
26
|
-
* @param {string[]} [excludePatterns=['AWS', 'stageVariables']] - Patterns to exclude via negative lookahead
|
|
26
|
+
* @param {string[]} [excludePatterns=['AWS', 'aws:', 'stageVariables']] - Patterns to exclude via negative lookahead
|
|
27
27
|
* @returns {string} Regex source string
|
|
28
28
|
*/
|
|
29
29
|
export function buildVariableSyntax(prefix?: string, suffix?: string, excludePatterns?: string[]): string;
|