@dokebi/cli 0.4.1 → 0.4.26
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/AI.md +262 -57
- package/README.md +35 -10
- package/catalog.json +2519 -257
- package/describe.schema.json +748 -0
- package/dist/api-app.d.ts +2 -0
- package/dist/api-app.js +35 -0
- package/dist/app-urls.js +3 -2
- package/dist/bin.js +527 -35
- package/dist/capability-guide.d.ts +30 -0
- package/dist/capability-guide.js +122 -0
- package/dist/catalog.d.ts +16 -2
- package/dist/catalog.js +19 -7
- package/dist/check/asset-rules.d.ts +6 -0
- package/dist/check/asset-rules.js +163 -0
- package/dist/check/browser-sources.d.ts +20 -0
- package/dist/check/browser-sources.js +89 -0
- package/dist/check/console-rules.d.ts +6 -0
- package/dist/check/console-rules.js +40 -0
- package/dist/check/error-rules.d.ts +21 -0
- package/dist/check/error-rules.js +212 -0
- package/dist/check/form-rules.d.ts +12 -0
- package/dist/check/form-rules.js +69 -6
- package/dist/check/formatter-rules.d.ts +2 -0
- package/dist/check/formatter-rules.js +71 -0
- package/dist/check/i18n-rules.d.ts +27 -0
- package/dist/check/i18n-rules.js +353 -0
- package/dist/check/index.d.ts +15 -1
- package/dist/check/index.js +89 -11
- package/dist/check/mail-rules.d.ts +4 -0
- package/dist/check/mail-rules.js +72 -0
- package/dist/check/module-rules.d.ts +13 -0
- package/dist/check/module-rules.js +104 -0
- package/dist/check/packages.d.ts +8 -0
- package/dist/check/packages.js +16 -0
- package/dist/check/pool-rules.d.ts +8 -0
- package/dist/check/pool-rules.js +164 -0
- package/dist/check/problems.d.ts +6 -1
- package/dist/check/problems.js +100 -2
- package/dist/check/project-rules.d.ts +23 -3
- package/dist/check/project-rules.js +265 -23
- package/dist/check/seal-rules.d.ts +6 -0
- package/dist/check/seal-rules.js +68 -0
- package/dist/check/security-rules.d.ts +10 -0
- package/dist/check/security-rules.js +450 -0
- package/dist/check/shared-state-rules.d.ts +2 -0
- package/dist/check/shared-state-rules.js +114 -0
- package/dist/check/source-rules.d.ts +26 -3
- package/dist/check/source-rules.js +249 -28
- package/dist/check/structure-rules.d.ts +23 -0
- package/dist/check/structure-rules.js +502 -0
- package/dist/check/timer-rules.d.ts +7 -0
- package/dist/check/timer-rules.js +543 -0
- package/dist/check/typescript.d.ts +35 -5
- package/dist/check/typescript.js +163 -17
- package/dist/check/vite-rules.d.ts +2 -0
- package/dist/check/vite-rules.js +136 -0
- package/dist/check/wait-rules.d.ts +16 -0
- package/dist/check/wait-rules.js +337 -0
- package/dist/commands.d.ts +7 -0
- package/dist/commands.js +307 -31
- package/dist/config-diff.d.ts +42 -0
- package/dist/config-diff.js +289 -0
- package/dist/config-edit.d.ts +35 -2
- package/dist/config-edit.js +145 -13
- package/dist/config-init.d.ts +15 -0
- package/dist/config-init.js +61 -0
- package/dist/config-paths.d.ts +22 -0
- package/dist/config-paths.js +82 -0
- package/dist/config-show.d.ts +82 -0
- package/dist/config-show.js +563 -0
- package/dist/config-values.d.ts +8 -0
- package/dist/config-values.js +68 -0
- package/dist/configuration-scaffold.d.ts +42 -0
- package/dist/configuration-scaffold.js +258 -4
- package/dist/configuration.d.ts +63 -3
- package/dist/configuration.js +178 -4
- package/dist/deployment.d.ts +2 -0
- package/dist/deployment.js +111 -0
- package/dist/describe-db.d.ts +22 -0
- package/dist/describe-db.js +176 -0
- package/dist/describe.d.ts +92 -0
- package/dist/describe.js +417 -0
- package/dist/dev-compose.d.ts +20 -0
- package/dist/dev-compose.js +154 -0
- package/dist/dev-guard.js +44 -0
- package/dist/dev-host.d.ts +13 -0
- package/dist/dev-host.js +55 -0
- package/dist/dev-infra.d.ts +72 -4
- package/dist/dev-infra.js +237 -17
- package/dist/dev-watch.d.ts +34 -0
- package/dist/dev-watch.js +192 -0
- package/dist/diagnostics.d.ts +10 -7
- package/dist/diagnostics.js +22 -4
- package/dist/drift.d.ts +50 -0
- package/dist/drift.js +218 -0
- package/dist/env-file.d.ts +25 -1
- package/dist/env-file.js +64 -6
- package/dist/errors.d.ts +7 -1
- package/dist/example-config.d.ts +2 -0
- package/dist/example-config.js +3 -0
- package/dist/first-admin.d.ts +43 -0
- package/dist/first-admin.js +175 -0
- package/dist/formatter-ignore.d.ts +37 -0
- package/dist/formatter-ignore.js +344 -0
- package/dist/generator.d.ts +45 -3
- package/dist/generator.js +205 -15
- package/dist/guide.d.ts +1 -1
- package/dist/guide.js +42 -21
- package/dist/install-module.d.ts +29 -3
- package/dist/install-module.js +142 -13
- package/dist/install-plan.js +5 -3
- package/dist/layout.d.ts +12 -1
- package/dist/layout.js +19 -6
- package/dist/log-writer-control.d.ts +2 -0
- package/dist/log-writer-control.js +106 -27
- package/dist/log-writer.js +43 -10
- package/dist/logging-config.d.ts +8 -3
- package/dist/logging-config.js +19 -5
- package/dist/manifest.d.ts +29 -1
- package/dist/manifest.js +84 -6
- package/dist/merge-install-defaults.d.ts +0 -1
- package/dist/merge-install-defaults.js +13 -47
- package/dist/npm-client.d.ts +59 -4
- package/dist/npm-client.js +220 -16
- package/dist/npm-paths.js +18 -4
- package/dist/openapi.d.ts +27 -0
- package/dist/openapi.js +649 -0
- package/dist/option-fixes.d.ts +39 -0
- package/dist/option-fixes.js +130 -0
- package/dist/output.d.ts +1 -1
- package/dist/output.js +5 -5
- package/dist/plugin-lifecycle.d.ts +34 -2
- package/dist/plugin-lifecycle.js +206 -20
- package/dist/plugin-options.d.ts +19 -4
- package/dist/plugin-options.js +138 -6
- package/dist/plugins-command.js +44 -7
- package/dist/process-group.d.ts +39 -0
- package/dist/process-group.js +132 -0
- package/dist/project-guide.d.ts +19 -1
- package/dist/project-guide.js +119 -20
- package/dist/project-inspector.d.ts +15 -0
- package/dist/project-inspector.js +481 -33
- package/dist/project-state.d.ts +5 -0
- package/dist/project-state.js +8 -0
- package/dist/project.d.ts +203 -19
- package/dist/project.js +3016 -336
- package/dist/recipe-facts.d.ts +127 -0
- package/dist/recipe-facts.js +563 -0
- package/dist/recipe-login.d.ts +63 -0
- package/dist/recipe-login.js +464 -0
- package/dist/recipe-mail.d.ts +21 -0
- package/dist/recipe-mail.js +214 -0
- package/dist/recipe-members.d.ts +35 -0
- package/dist/recipe-members.js +178 -0
- package/dist/recipe-record.d.ts +82 -7
- package/dist/recipe-record.js +226 -22
- package/dist/recipe-reset.d.ts +2 -0
- package/dist/recipe-reset.js +117 -0
- package/dist/recipe-site.d.ts +48 -0
- package/dist/recipe-site.js +396 -0
- package/dist/recipe-step.d.ts +42 -0
- package/dist/recipe-step.js +89 -0
- package/dist/recipe.d.ts +56 -20
- package/dist/recipe.js +703 -131
- package/dist/registry.d.ts +98 -2
- package/dist/registry.js +171 -5
- package/dist/reloadable.d.ts +35 -0
- package/dist/reloadable.js +257 -0
- package/dist/server.d.ts +50 -4
- package/dist/server.js +790 -103
- package/dist/settings.d.ts +48 -0
- package/dist/settings.js +168 -0
- package/dist/site-auth.d.ts +39 -0
- package/dist/site-auth.js +195 -0
- package/dist/template-fixes.d.ts +26 -0
- package/dist/template-fixes.js +285 -0
- package/dist/test-reporter.d.ts +49 -0
- package/dist/test-reporter.js +190 -0
- package/dist/transaction.d.ts +67 -0
- package/dist/transaction.js +428 -46
- package/dist/verify-tests.d.ts +98 -0
- package/dist/verify-tests.js +449 -0
- package/dist/verify.d.ts +113 -4
- package/dist/verify.js +326 -28
- package/dist/view-choice.d.ts +58 -0
- package/dist/view-choice.js +131 -0
- package/dist/vite-watch.js +4 -2
- package/package.json +8 -6
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// What a config command changed, by option path and file (Studio v2 report, 2026-10-24): before
|
|
2
|
+
// d48f77b1 `config unset dokebi-logger.redact …` removed seven options of the live
|
|
3
|
+
// options.logging and answered only `changed: [dokebi.yaml, dokebi.example.yaml]`. The result now
|
|
4
|
+
// names every option path a file gained, lost or changed (never a value), and a change outside
|
|
5
|
+
// what the command was asked for is refused before anything is written (PATH_MISMATCH).
|
|
6
|
+
import { parseDocument } from 'yaml';
|
|
7
|
+
import { resolveItems } from './config-edit.js';
|
|
8
|
+
import { parseProjectConfig } from './configuration.js';
|
|
9
|
+
const isObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
10
|
+
/** The leaf paths (a scalar or a list each) that differ between the options of two sources. */
|
|
11
|
+
export function optionChanges(before, after) {
|
|
12
|
+
const removed = [];
|
|
13
|
+
const set = [];
|
|
14
|
+
const added = [];
|
|
15
|
+
const leaves = (value, path, into) => {
|
|
16
|
+
if (isObject(value) && Object.keys(value).length)
|
|
17
|
+
for (const [key, item] of Object.entries(value))
|
|
18
|
+
leaves(item, [...path, key], into);
|
|
19
|
+
else
|
|
20
|
+
into.push(path.join('.'));
|
|
21
|
+
};
|
|
22
|
+
const walk = (left, right, path, hasLeft, hasRight) => {
|
|
23
|
+
if (hasLeft && !hasRight)
|
|
24
|
+
return leaves(left, path, removed);
|
|
25
|
+
if (hasRight && !hasLeft)
|
|
26
|
+
return leaves(right, path, added);
|
|
27
|
+
if (isObject(left) &&
|
|
28
|
+
isObject(right) &&
|
|
29
|
+
(Object.keys(left).length || Object.keys(right).length)) {
|
|
30
|
+
for (const key of new Set([...Object.keys(left), ...Object.keys(right)]))
|
|
31
|
+
walk(left[key], right[key], [...path, key], Object.hasOwn(left, key), Object.hasOwn(right, key));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (JSON.stringify(left) !== JSON.stringify(right))
|
|
35
|
+
set.push(path.join('.'));
|
|
36
|
+
};
|
|
37
|
+
const a = parseProjectConfig(before).options;
|
|
38
|
+
const b = parseProjectConfig(after).options;
|
|
39
|
+
for (const key of new Set([...Object.keys(a), ...Object.keys(b)]))
|
|
40
|
+
walk(a[key], b[key], [key], Object.hasOwn(a, key), Object.hasOwn(b, key));
|
|
41
|
+
return { removed, set, added };
|
|
42
|
+
}
|
|
43
|
+
/** Each file's changes, the files nothing changed in left out. */
|
|
44
|
+
export function filePaths(files) {
|
|
45
|
+
const result = {};
|
|
46
|
+
for (const [file, before, after] of files) {
|
|
47
|
+
if (before === undefined || after === undefined || before === after)
|
|
48
|
+
continue;
|
|
49
|
+
const changes = optionChanges(before, after);
|
|
50
|
+
if (changes.removed.length || changes.set.length || changes.added.length)
|
|
51
|
+
result[file] = changes;
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A requested path as the files spell it: `<section>.<path>` with named list items turned into
|
|
57
|
+
* indexes in `source` (`logging.targets.studio.token` → `logging.targets.3.token`); as typed when
|
|
58
|
+
* the item is not there.
|
|
59
|
+
*/
|
|
60
|
+
export function requestedPath(source, section, path) {
|
|
61
|
+
const resolved = resolveItems(parseDocument(source, { version: '1.2' }), [
|
|
62
|
+
'options',
|
|
63
|
+
section,
|
|
64
|
+
...path,
|
|
65
|
+
]);
|
|
66
|
+
return resolved ? resolved.slice(1) : [section, ...path];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The changed paths outside the requested ones. A changed path is asked for when it is a
|
|
70
|
+
* requested path or below one, or when it is a list a requested path goes through (a list is
|
|
71
|
+
* compared whole).
|
|
72
|
+
*/
|
|
73
|
+
export function outsideRequested(changes, requested) {
|
|
74
|
+
const asked = requested.map((path) => path.join('.'));
|
|
75
|
+
const inside = (changed) => asked.some((path) => changed === path || changed.startsWith(`${path}.`) || path.startsWith(`${changed}.`));
|
|
76
|
+
const outside = new Set();
|
|
77
|
+
for (const paths of Object.values(changes))
|
|
78
|
+
for (const changed of [...paths.removed, ...paths.set, ...paths.added])
|
|
79
|
+
if (!inside(changed))
|
|
80
|
+
outside.add(changed);
|
|
81
|
+
return [...outside];
|
|
82
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type ConfigTarget } from './configuration.js';
|
|
2
|
+
/** What a hidden value is replaced with. */
|
|
3
|
+
export declare const SECRET_MARKER = "<secret: set>";
|
|
4
|
+
/** What the password of a URL is replaced with: `scheme://user:<secret>@host`. */
|
|
5
|
+
export declare const URL_SECRET_MARKER = "<secret>";
|
|
6
|
+
/**
|
|
7
|
+
* Text with its credentials hidden by core's rule (`redaction.maskCredentials`: the password of
|
|
8
|
+
* a URL, also one with a raw `/` or `@` in it, and `Password=…` of a connection string), or
|
|
9
|
+
* undefined when it holds none. The URL keeps its user: `scheme://user:<secret>@host`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function hideCredentials(text: string): string | undefined;
|
|
12
|
+
export interface ConfigShowWarning {
|
|
13
|
+
readonly code: 'OPTIONS_SCHEMA_UNREADABLE' | 'UNKNOWN_PLUGIN' | 'UNDECLARED_SECTION' | 'ENV_DOKEBI_CONFIG_IGNORED';
|
|
14
|
+
/** The section it is about (absent for ENV_DOKEBI_CONFIG_IGNORED). */
|
|
15
|
+
readonly plugin?: string;
|
|
16
|
+
/** ENV_DOKEBI_CONFIG_IGNORED: `.env:<line>`. */
|
|
17
|
+
readonly path?: string;
|
|
18
|
+
readonly hint: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfigShowResult {
|
|
21
|
+
/** The settings file shown: dokebi.yaml, or the file DOKEBI_CONFIG names (M50). */
|
|
22
|
+
readonly file: string;
|
|
23
|
+
/** The asked `<plugin-id>[.<path>]`, or null for every section. */
|
|
24
|
+
readonly path: string | null;
|
|
25
|
+
/** The options (or the asked part), secrets replaced by SECRET_MARKER. */
|
|
26
|
+
readonly value: unknown;
|
|
27
|
+
/** Option paths shown with their schema default because dokebi.yaml does not set them. */
|
|
28
|
+
readonly defaults: string[];
|
|
29
|
+
/** Option paths whose value was hidden (a whole list of secrets is one path). */
|
|
30
|
+
readonly secrets: string[];
|
|
31
|
+
/**
|
|
32
|
+
* D-0154: option paths a running app reads again (the topmost marked key; everything under it
|
|
33
|
+
* is reloadable too). Any other change needs a restart.
|
|
34
|
+
*/
|
|
35
|
+
readonly reloadable: string[];
|
|
36
|
+
readonly warnings?: ConfigShowWarning[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether an option named `key` that holds `value` is a secret by its name: core's rule, the one
|
|
40
|
+
* the logs use (`redaction.isSecretField`, D-0047). Text, a list or an object under a secret name
|
|
41
|
+
* is; a number only under a password, PIN or code name; a boolean never. Where the schema marks
|
|
42
|
+
* the option plain (`x-dokebi-secret: false`) the name is not asked.
|
|
43
|
+
*/
|
|
44
|
+
export declare function secretOption(key: string, value: unknown): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether a value at an option path is a secret (`config unset` warns `SECRET_REMOVED` for one;
|
|
47
|
+
* D-0165 dropped the `SECRET_ON_COMMAND_LINE` warning it gave `--set` and `config set`). The
|
|
48
|
+
* plugin's options schema decides
|
|
49
|
+
* (AI-M24: `tokens.driver=redis`, `tokens.connection=main` and `maxTokensPerUser=5` of
|
|
50
|
+
* @dokebi/auth warned because a path word matched /token/): a value at a `writeOnly` option
|
|
51
|
+
* (`o.string({ secret: true })`), a list of them, or anything inside an object value that
|
|
52
|
+
* reaches one. Where the schema says nothing (an option it does not declare, a schema that
|
|
53
|
+
* cannot be read: `schema` undefined), the name decides by core's rule (`secretOption`): text,
|
|
54
|
+
* or text inside a list or object, under a secret name; a number only under a password, PIN or
|
|
55
|
+
* code name. Credentials by core's `maskCredentials` (a `scheme://user:password@` URL,
|
|
56
|
+
* `Password=…`) are a secret anywhere. Booleans never are.
|
|
57
|
+
*/
|
|
58
|
+
export declare function commandLineSecret(path: readonly string[], value: unknown, schema: unknown): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The settings the app reads (M50): the file DOKEBI_CONFIG names, else dokebi.yaml. Reading one
|
|
61
|
+
* outside the project is allowed (as a linked dokebi.yaml is); a named file that is not there is
|
|
62
|
+
* READ_FAILED with the variable in the message.
|
|
63
|
+
*/
|
|
64
|
+
export declare function readSettings(root: string): Promise<{
|
|
65
|
+
target: ConfigTarget;
|
|
66
|
+
source: string;
|
|
67
|
+
}>;
|
|
68
|
+
/** `dokebi config show [<plugin-id>[.<path>]]`: options with secrets hidden. */
|
|
69
|
+
export declare function configShow(root: string, target?: {
|
|
70
|
+
readonly section: string;
|
|
71
|
+
readonly path: readonly string[];
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Another document than the settings file (config diff reads the sample's secrets with it, and
|
|
75
|
+
* the settings its transaction read).
|
|
76
|
+
*/
|
|
77
|
+
from?: {
|
|
78
|
+
readonly source: string;
|
|
79
|
+
readonly file?: string;
|
|
80
|
+
}): Promise<ConfigShowResult>;
|
|
81
|
+
/** The result for people: YAML, defaults marked with a comment, secrets already hidden. */
|
|
82
|
+
export declare function configShowText(result: ConfigShowResult): string;
|