@oktis-works/cms 0.15.2 → 0.15.3
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/generated/app-versions.js +3 -3
- package/dist/prompt.d.ts +53 -30
- package/dist/prompt.d.ts.map +1 -1
- package/dist/prompt.js +609 -376
- package/dist/prompt.js.map +1 -1
- package/package.json +5 -4
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// by `bun run build`. Used as the offline fallback for `okcms init` ranges
|
|
4
4
|
// when the npm registry cannot be reached.
|
|
5
5
|
export const APP_VERSIONS = {
|
|
6
|
-
'@oktis-works/api': '0.18.
|
|
6
|
+
'@oktis-works/api': '0.18.1',
|
|
7
7
|
'@oktis-works/admin': '0.26.0',
|
|
8
8
|
'@oktis-works/web': '0.15.0',
|
|
9
9
|
'@oktis-works/worker': '0.8.17',
|
|
10
|
-
'@oktis-works/core': '0.18.
|
|
10
|
+
'@oktis-works/core': '0.18.1',
|
|
11
11
|
'@oktis-works/plugin-runtime': '0.8.1',
|
|
12
|
-
'@oktis-works/cms': '0.15.
|
|
12
|
+
'@oktis-works/cms': '0.15.3',
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=app-versions.js.map
|
package/dist/prompt.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Readable, Writable } from 'node:stream';
|
|
2
|
+
/** Resultado de cancelamento do usuário (Ctrl+C ou AbortSignal). */
|
|
3
|
+
export declare class CancelError extends Error {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
2
6
|
export interface PromptIO {
|
|
3
7
|
input: Readable;
|
|
4
8
|
output: Writable;
|
|
@@ -16,7 +20,7 @@ export declare const style: {
|
|
|
16
20
|
cyan: (text: string) => string;
|
|
17
21
|
gray: (text: string) => string;
|
|
18
22
|
};
|
|
19
|
-
/** Canonical glyphs —
|
|
23
|
+
/** Canonical glyphs — os mesmos símbolos usados pelo prompt anterior. */
|
|
20
24
|
export declare const symbol: {
|
|
21
25
|
readonly ask: "?";
|
|
22
26
|
readonly ok: "✓";
|
|
@@ -26,22 +30,26 @@ export declare const symbol: {
|
|
|
26
30
|
readonly warn: "⚠";
|
|
27
31
|
readonly cursor: "❯";
|
|
28
32
|
};
|
|
29
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Returns terminal width from COLUMNS env var or a fallback.
|
|
35
|
+
*/
|
|
30
36
|
export declare function terminalWidth(fallback?: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Returns visible length of text (strips ANSI escape codes).
|
|
39
|
+
*/
|
|
31
40
|
export declare function visibleLength(text: string): number;
|
|
41
|
+
/**
|
|
42
|
+
* Truncates text to fit within max width, adding ellipsis if needed.
|
|
43
|
+
*/
|
|
32
44
|
export declare function truncateText(text: string, max?: number): string;
|
|
45
|
+
/**
|
|
46
|
+
* Wraps text to fit within max width, splitting on word boundaries.
|
|
47
|
+
*/
|
|
33
48
|
export declare function wrapText(text: string, max?: number): string[];
|
|
34
|
-
export declare function asciiSymbol(name: keyof typeof symbol): string;
|
|
35
|
-
/** Named keys the menus understand. Printable characters are their own token. */
|
|
36
|
-
export type KeyToken = string;
|
|
37
49
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* Arrow keys arrive as a single chunk (`ESC [ A`), so the CSI introducer is
|
|
41
|
-
* matched first and the rest of the sequence swallowed; a lone ESC becomes
|
|
42
|
-
* `escape`. Everything else is the character itself.
|
|
50
|
+
* Returns ASCII fallback symbol if OKCMS_ASCII=1 or TERM=dumb.
|
|
43
51
|
*/
|
|
44
|
-
export declare function
|
|
52
|
+
export declare function asciiSymbol(name: keyof typeof symbol): string;
|
|
45
53
|
export interface SelectChoice<T> {
|
|
46
54
|
value: T;
|
|
47
55
|
label: string;
|
|
@@ -67,9 +75,11 @@ export interface InputOptions {
|
|
|
67
75
|
}
|
|
68
76
|
export declare class Prompt {
|
|
69
77
|
private readonly io;
|
|
70
|
-
private readonly
|
|
78
|
+
private readonly useClack;
|
|
79
|
+
private readonly simpleInput;
|
|
71
80
|
private closed;
|
|
72
81
|
constructor(io?: Partial<PromptIO>);
|
|
82
|
+
/** true somente quando há terminal nos DOIS lados (TTY de verdade). */
|
|
73
83
|
get interactive(): boolean;
|
|
74
84
|
write(text: string): void;
|
|
75
85
|
/** Título de seção do wizard. */
|
|
@@ -79,37 +89,50 @@ export declare class Prompt {
|
|
|
79
89
|
warn(text: string): void;
|
|
80
90
|
error(text: string): void;
|
|
81
91
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* all — so a CI never triggers a deploy by accident.
|
|
92
|
+
* Converte uma função de validação do tipo antigo ((v: string) => string | null)
|
|
93
|
+
* para o tipo esperado pelo Clack ((v: string | undefined) => string | Error | undefined | void).
|
|
85
94
|
*/
|
|
86
|
-
|
|
95
|
+
private static wrapValidate;
|
|
87
96
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
97
|
+
* Arrow-key menu (↑/↓ + Enter). Sem TTY, retorna defaultValue ou lança erro.
|
|
98
|
+
* Usa o Clack select() por baixo para TTY real; fallback numerado/teclado para testes/CI.
|
|
90
99
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
select<T>(title: string, choices: Array<SelectChoice<T>>, opts?: SelectOptions<T>): Promise<T>;
|
|
101
|
+
/** Raw mode select for FakeTTY (arrow keys + numbered input). */
|
|
102
|
+
private selectRawMode;
|
|
94
103
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* Every repaint clears the previous block (`ESC[<n>A` + `ESC[0J`), so the
|
|
98
|
-
* menu never leaves scrollback debris. `inline` lays the options on one line
|
|
99
|
-
* (confirm), `aliases` maps single keys straight to an option.
|
|
104
|
+
* Fallback numbered menu for tests and non-TTY environments.
|
|
105
|
+
* Mimics the old readline-based select behavior.
|
|
100
106
|
*/
|
|
101
|
-
private
|
|
107
|
+
private selectNumbered;
|
|
102
108
|
/** Texto livre com validação, repetindo até aceitar. */
|
|
103
109
|
ask(title: string, opts?: InputOptions): Promise<string>;
|
|
104
|
-
/** Segredo: sem eco no TTY (mostra `*`)
|
|
110
|
+
/** Segredo: sem eco no TTY (mostra `*`). */
|
|
105
111
|
secret(title: string, opts?: InputOptions): Promise<string>;
|
|
112
|
+
/** Raw mode secret input for FakeTTY (masks with *). */
|
|
113
|
+
private secretRawMode;
|
|
114
|
+
/**
|
|
115
|
+
* Fallback line-based input with validation for non-Clack environments.
|
|
116
|
+
*/
|
|
117
|
+
private askLineFallback;
|
|
106
118
|
/** Texto livre com validação + suporte a voltar (tecla 'b'). Retorna '__BACK__' para voltar. */
|
|
107
119
|
askWithBack(title: string, opts?: InputOptions): Promise<string>;
|
|
108
120
|
/** Segredo com suporte a voltar (digite 'b' para voltar). Retorna '__BACK__' para voltar. */
|
|
109
121
|
secretWithBack(title: string, opts?: InputOptions): Promise<string>;
|
|
110
|
-
/** Lê uma linha
|
|
122
|
+
/** Lê uma linha crua (também usada pelos testes). */
|
|
111
123
|
askLine(question: string): Promise<string | null>;
|
|
112
124
|
close(): void;
|
|
125
|
+
/** Configurações globais do Clack (i18n, mensagens, guide lines). */
|
|
126
|
+
static setSettings(settings: {
|
|
127
|
+
messages?: {
|
|
128
|
+
cancel?: string;
|
|
129
|
+
error?: string;
|
|
130
|
+
};
|
|
131
|
+
}): void;
|
|
132
|
+
/** Yes/No confirmation. Sem TTY, retorna defaultValue. */
|
|
133
|
+
confirm(title: string, opts?: {
|
|
134
|
+
defaultValue?: boolean;
|
|
135
|
+
}): Promise<boolean>;
|
|
113
136
|
}
|
|
114
137
|
export declare function select<T>(title: string, choices: Array<SelectChoice<T>>, opts?: SelectOptions<T>, io?: Partial<PromptIO>): Promise<T>;
|
|
115
138
|
export declare function confirm(title: string, opts?: {
|
package/dist/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.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