@dereekb/dbx-cli 13.11.1 → 13.11.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.
Files changed (32) hide show
  1. package/firebase-api-manifest/main.js +142 -25
  2. package/firebase-api-manifest/package.json +1 -1
  3. package/index.cjs.js +202 -26
  4. package/index.esm.js +201 -27
  5. package/manifest-extract/LICENSE +21 -0
  6. package/manifest-extract/index.cjs.default.js +1 -0
  7. package/manifest-extract/index.cjs.js +459 -0
  8. package/manifest-extract/index.cjs.mjs +2 -0
  9. package/manifest-extract/index.d.ts +1 -0
  10. package/manifest-extract/index.esm.js +457 -0
  11. package/manifest-extract/package.json +20 -0
  12. package/manifest-extract/src/index.d.ts +2 -0
  13. package/manifest-extract/src/lib/extract-crud.d.ts +36 -0
  14. package/manifest-extract/src/lib/types.d.ts +86 -0
  15. package/package.json +10 -4
  16. package/src/lib/api/call-model.command.factory.d.ts +1 -0
  17. package/src/lib/auth/auth.command.factory.d.ts +1 -0
  18. package/src/lib/auth/oidc.flow.d.ts +1 -0
  19. package/src/lib/config/env.d.ts +1 -1
  20. package/src/lib/config/paths.d.ts +1 -0
  21. package/src/lib/config/token.cache.d.ts +1 -0
  22. package/src/lib/context/cli.context.d.ts +1 -0
  23. package/src/lib/doctor/doctor.command.factory.d.ts +1 -0
  24. package/src/lib/env/env.command.factory.d.ts +1 -0
  25. package/src/lib/manifest/build-manifest-commands.d.ts +39 -0
  26. package/src/lib/manifest/types.d.ts +20 -0
  27. package/src/lib/middleware/auth.middleware.d.ts +1 -0
  28. package/src/lib/middleware/output.middleware.d.ts +1 -0
  29. package/src/lib/output/output.command.factory.d.ts +1 -0
  30. package/src/lib/runner/run.d.ts +1 -0
  31. package/src/lib/util/context.slot.d.ts +1 -0
  32. package/src/lib/util/output.d.ts +2 -0
@@ -36,6 +36,7 @@ export interface CreateCliTokenCacheStoreInput {
36
36
  * @param input - The cache store inputs.
37
37
  * @param input.tokenCachePath - Absolute path to the JSON file backing the cache.
38
38
  * @returns A {@link CliTokenCacheStore} keyed by env name.
39
+ * @__NO_SIDE_EFFECTS__
39
40
  */
40
41
  export declare function createCliTokenCacheStore(input: CreateCliTokenCacheStoreInput): CliTokenCacheStore;
41
42
  /**
@@ -37,5 +37,6 @@ export interface CreateCliContextInput {
37
37
  * @param input.env - The resolved {@link CliEnvConfig} for the active env.
38
38
  * @param input.accessToken - The Bearer access token to include on outgoing API calls.
39
39
  * @returns The constructed {@link CliContext}.
40
+ * @__NO_SIDE_EFFECTS__
40
41
  */
41
42
  export declare function createCliContext(input: CreateCliContextInput): CliContext;
@@ -44,5 +44,6 @@ export interface CreateDoctorCommandInput {
44
44
  * @param input.checks - Additional checks to append after the default check list.
45
45
  * @param input.defaultEnvs - Built-in env presets merged underneath the user's stored env when names match.
46
46
  * @returns A yargs `CommandModule` exposing the `doctor` command.
47
+ * @__NO_SIDE_EFFECTS__
47
48
  */
48
49
  export declare function createDoctorCommand(input: CreateDoctorCommandInput): CommandModule;
@@ -18,5 +18,6 @@ export interface CreateEnvCommandInput {
18
18
  * @param input.cliName - The CLI's binary name.
19
19
  * @param input.defaultEnvs - Built-in env presets merged underneath the user's stored env when names match.
20
20
  * @returns A yargs `CommandModule` exposing the full `env` subcommand surface.
21
+ * @__NO_SIDE_EFFECTS__
21
22
  */
22
23
  export declare function createEnvCommand(input: CreateEnvCommandInput): CommandModule;
@@ -1,5 +1,22 @@
1
1
  import { type CommandModule } from 'yargs';
2
2
  import { type CliApiManifest } from './types';
3
+ /**
4
+ * Controls which sections of an action's `--help` epilogue are rendered.
5
+ *
6
+ * - `action` (just the action explainer): only the action description JSDoc.
7
+ * Useful when you already know the params shape and want to remember what
8
+ * the command does.
9
+ * - `params` (just the params explainer): only the params interface
10
+ * description, per-field descriptions, schema, result, and source. Useful
11
+ * when you already know what the command does and need to remember the
12
+ * input shape.
13
+ * - `both` (default): both sections together.
14
+ */
15
+ export type ManifestHelpMode = 'action' | 'params' | 'both';
16
+ /**
17
+ * Default help mode when no override is supplied.
18
+ */
19
+ export declare const DEFAULT_MANIFEST_HELP_MODE: ManifestHelpMode;
3
20
  /**
4
21
  * Format used for the `Params Schema` section of a manifest command's `--help`
5
22
  * epilogue.
@@ -33,6 +50,14 @@ export interface BuildManifestCommandsOptions {
33
50
  * {@link DEFAULT_MANIFEST_HELP_DATA_FORMAT}.
34
51
  */
35
52
  readonly dataHelpFormat?: ManifestHelpDataFormat;
53
+ /**
54
+ * Which sections of the help epilogue to render.
55
+ *
56
+ * When omitted, the configured argv is scanned for `--help-mode=<mode>` (or
57
+ * `--help-mode <mode>`). Falls back to {@link DEFAULT_MANIFEST_HELP_MODE}
58
+ * (`both`).
59
+ */
60
+ readonly helpMode?: ManifestHelpMode;
36
61
  /**
37
62
  * Whether to hide unrelated global options (like `--verbose`, `--dump-dir`,
38
63
  * `--pick`, …) from `--help` when the user passed `--data-help`. Defaults
@@ -78,6 +103,7 @@ export declare const DEFAULT_MANIFEST_MODEL_COMMAND_NAME = "model";
78
103
  * @param options - Optional overrides; see {@link BuildManifestCommandsOptions}.
79
104
  * @returns The yargs `CommandModule[]` ready to be passed to `runCli({ apiCommands })`. Empty
80
105
  * when the manifest has no callable entries.
106
+ * @__NO_SIDE_EFFECTS__
81
107
  */
82
108
  export declare function buildManifestCommands(manifest: CliApiManifest, options?: BuildManifestCommandsOptions): CommandModule[];
83
109
  /**
@@ -92,3 +118,16 @@ export declare function buildManifestCommands(manifest: CliApiManifest, options?
92
118
  * @returns The detected format, or {@link DEFAULT_MANIFEST_HELP_DATA_FORMAT}.
93
119
  */
94
120
  export declare function detectDataHelpFormat(argv?: readonly string[]): ManifestHelpDataFormat;
121
+ /**
122
+ * Inspects an argv array for `--help-mode=<mode>` or `--help-mode <mode>` and
123
+ * returns the requested {@link ManifestHelpMode}. Unrecognized values fall
124
+ * back to {@link DEFAULT_MANIFEST_HELP_MODE}.
125
+ *
126
+ * Implemented as a raw argv scan (rather than going through yargs) because the
127
+ * value is needed when each command's builder runs — which is before yargs
128
+ * parses argv.
129
+ *
130
+ * @param argv - argv to inspect (defaults to `process.argv`).
131
+ * @returns The detected mode, or {@link DEFAULT_MANIFEST_HELP_MODE}.
132
+ */
133
+ export declare function detectHelpMode(argv?: readonly string[]): ManifestHelpMode;
@@ -14,7 +14,27 @@ export interface CliApiManifestEntry {
14
14
  readonly resultTypeName?: string;
15
15
  readonly groupName: string;
16
16
  readonly sourceFile: string;
17
+ /**
18
+ * Per-action description, rendered as the command's `describe` in `--help`.
19
+ */
17
20
  readonly description?: string;
21
+ /**
22
+ * Description from the params interface's own JSDoc (e.g. on `ResetProfilePasswordParams`).
23
+ * Rendered in the `--help` epilogue under the params section.
24
+ */
25
+ readonly paramsTypeDescription?: string;
26
+ /**
27
+ * Per-field params descriptions read from the params interface's property JSDocs.
28
+ */
18
29
  readonly paramsFields?: readonly CliApiManifestField[];
30
+ /**
31
+ * Description from the result interface's own JSDoc (e.g. on `DownloadProfileArchiveResult`).
32
+ * Surfaces the same way `paramsTypeDescription` does, but for the response side.
33
+ */
34
+ readonly resultTypeDescription?: string;
35
+ /**
36
+ * Per-field result descriptions read from the result interface's property JSDocs.
37
+ */
38
+ readonly resultFields?: readonly CliApiManifestField[];
19
39
  }
20
40
  export type CliApiManifest = readonly CliApiManifestEntry[];
@@ -25,5 +25,6 @@ export interface CreateAuthMiddlewareInput {
25
25
  * @param input.skipCommands - Top-level command names that bypass authentication entirely.
26
26
  * @param input.defaultEnvs - Built-in env presets merged underneath the user's stored env when names match.
27
27
  * @returns A yargs middleware function suitable for `.middleware([..., true])`.
28
+ * @__NO_SIDE_EFFECTS__
28
29
  */
29
30
  export declare function createAuthMiddleware(input: CreateAuthMiddlewareInput): MiddlewareFunction;
@@ -50,5 +50,6 @@ export interface CreateOutputMiddlewareInput {
50
50
  * @param input.loadOutputConfig - Optional override for how the output config is read.
51
51
  * @param input.saveCommandOutputConfig - Optional override for how a per-command output config is persisted.
52
52
  * @returns A yargs middleware function suitable for `.middleware([..., true])`.
53
+ * @__NO_SIDE_EFFECTS__
53
54
  */
54
55
  export declare function createOutputMiddleware(input: CreateOutputMiddlewareInput): MiddlewareFunction;
@@ -51,5 +51,6 @@ export interface CreateOutputCommandInput {
51
51
  * @param input.mergeOutputConfig - Optional override for persisting partial output-config updates.
52
52
  * @param input.clearOutputConfig - Optional override for clearing the persisted output config entirely.
53
53
  * @returns A yargs `CommandModule` exposing the full `output` subcommand surface.
54
+ * @__NO_SIDE_EFFECTS__
54
55
  */
55
56
  export declare function createOutputCommand(input: CreateOutputCommandInput): CommandModule;
@@ -62,6 +62,7 @@ export interface CreateCliInput {
62
62
  * @param input.argv - Argv to parse. Defaults to `hideBin(process.argv)`.
63
63
  * @param input.disableCallPassthrough - When `true`, omits the built-in `call` passthrough.
64
64
  * @returns The configured yargs `Argv` ready to be `.parse()`-d.
65
+ * @__NO_SIDE_EFFECTS__
65
66
  */
66
67
  export declare function createCli(input: CreateCliInput): Argv;
67
68
  /**
@@ -46,5 +46,6 @@ export interface CreateContextSlotInput {
46
46
  * @param input - Optional slot configuration.
47
47
  * @param input.notInitializedMessage - Custom error message thrown by `require()` when the slot is unset.
48
48
  * @returns A new {@link ContextSlot} for type `T`.
49
+ * @__NO_SIDE_EFFECTS__
49
50
  */
50
51
  export declare function createContextSlot<T>(input?: CreateContextSlotInput): ContextSlot<T>;
@@ -95,6 +95,7 @@ export declare function dumpTimestamp(): string;
95
95
  * @param extension - File extension to append (`json` for full responses, `ndjson` for streaming dumps).
96
96
  * @param suffix - Optional suffix appended to the filename before the extension.
97
97
  * @returns The absolute file path, or `undefined` when `dumpDir` is not configured.
98
+ * @__NO_SIDE_EFFECTS__
98
99
  */
99
100
  export declare function buildDumpFilePath(extension: 'json' | 'ndjson', suffix?: string): Maybe<string>;
100
101
  /**
@@ -148,5 +149,6 @@ export declare class CliError extends Error {
148
149
  *
149
150
  * @param error - The thrown value to convert.
150
151
  * @returns The structured {@link CliErrorOutput}.
152
+ * @__NO_SIDE_EFFECTS__
151
153
  */
152
154
  export declare function buildErrorOutput(error: unknown): CliErrorOutput;