@dereekb/dbx-cli 14.1.0 → 14.3.0

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 (38) hide show
  1. package/eslint/index.esm.js +0 -195
  2. package/eslint/package.json +4 -3
  3. package/firebase-api-manifest/main.js +124 -13
  4. package/firebase-api-manifest/package.json +4 -3
  5. package/firestore-indexes/src/model-firebase-index-schema.d.ts +4 -4
  6. package/firestore-query-manifest/main.js +4 -3
  7. package/firestore-query-manifest/package.json +4 -3
  8. package/generate-firestore-indexes/main.js +3 -2
  9. package/generate-firestore-indexes/package.json +3 -2
  10. package/generate-mcp-manifest/package.json +4 -3
  11. package/generate-route-manifest/package.json +3 -2
  12. package/index.esm.js +4228 -1344
  13. package/lint-cache/package.json +3 -2
  14. package/manifest-extract/index.esm.js +113 -7
  15. package/manifest-extract/package.json +8 -8
  16. package/manifest-extract/src/lib/types.d.ts +10 -0
  17. package/model-test/package.json +2 -2
  18. package/package.json +6 -6
  19. package/route/package.json +7 -7
  20. package/src/lib/auth/index.d.ts +1 -0
  21. package/src/lib/auth/oidc.loopback.d.ts +127 -0
  22. package/src/lib/cache/cache.command.factory.d.ts +44 -0
  23. package/src/lib/cache/data-cache.codec.d.ts +36 -0
  24. package/src/lib/cache/data-cache.d.ts +272 -0
  25. package/src/lib/cache/data-cache.fingerprint.d.ts +109 -0
  26. package/src/lib/cache/data-cache.options.d.ts +98 -0
  27. package/src/lib/cache/index.d.ts +5 -0
  28. package/src/lib/config/env.d.ts +43 -7
  29. package/src/lib/config/env.resolve.d.ts +4 -3
  30. package/src/lib/config/paths.d.ts +11 -1
  31. package/src/lib/firestore/firestore-query.command.d.ts +25 -1
  32. package/src/lib/index.d.ts +1 -0
  33. package/src/lib/runner/run.d.ts +11 -0
  34. package/src/lib/util/browser.d.ts +23 -0
  35. package/src/lib/util/index.d.ts +1 -0
  36. package/src/lib/util/interactive.d.ts +10 -1
  37. package/test/package.json +10 -9
  38. package/validate/package.json +3 -3
@@ -1,6 +1,7 @@
1
1
  export * from './action';
2
2
  export * from './api';
3
3
  export * from './auth';
4
+ export * from './cache';
4
5
  export * from './config';
5
6
  export * from './context';
6
7
  export * from './doctor';
@@ -1,5 +1,6 @@
1
1
  import { type Argv, type CommandModule } from 'yargs';
2
2
  import { type ActionCommandSpec } from '../action/action.command.factory';
3
+ import { type CreateCacheCommandInput } from '../cache/cache.command.factory';
3
4
  import { type CliEnvDefault } from '../config/env';
4
5
  import { type CliContext } from '../context/cli.context';
5
6
  import { type DoctorCheck } from '../doctor/doctor.command.factory';
@@ -127,6 +128,15 @@ export interface CreateCliInput extends CliLifecycleHooks {
127
128
  * Disable the built-in `firestore-get` command even when {@link firestore} is provided.
128
129
  */
129
130
  readonly disableFirestoreGet?: boolean;
131
+ /**
132
+ * Enables the recorded query/export dataset cache: the auth-free `cache` command group, and the
133
+ * `--cache` / `--refresh` global flags that `firestore-query` and app actions honour.
134
+ *
135
+ * Pass `true` for the defaults (`<configDir>/cache`, the CLI's `version` as the recorded build
136
+ * stamp), or an object to override the cache instance (tests point it at a temp dir), the build
137
+ * stamp, or the command name.
138
+ */
139
+ readonly dataCache?: boolean | Omit<CreateCacheCommandInput, 'cliName'>;
130
140
  /**
131
141
  * Test-only override that bypasses the auth middleware entirely and attaches the supplied
132
142
  * {@link CliContext} on every command invocation.
@@ -199,6 +209,7 @@ export interface CreateCliInput extends CliLifecycleHooks {
199
209
  * if {@link CreateCliInput.modelManifest} is provided.
200
210
  * @param input.firestore - The app-supplied direct-Firestore binding; enables `firestore-get` / `firestore-query`.
201
211
  * @param input.firestoreQueryManifest - The generated Firestore query catalog; enables `firestore-queries`.
212
+ * @param input.dataCache - Enables the recorded dataset cache: the `cache` command group plus the `--cache` / `--refresh` global flags.
202
213
  * @param input.manifestGeneratorVersion - The `@dereekb/dbx-cli` version that emitted the app's generated
203
214
  * manifests, for the built-in `cli-build-not-stale` doctor check.
204
215
  * @param input.setup - App hook run once before the command's handler; a throw aborts the command.
@@ -0,0 +1,23 @@
1
+ import { type WebsiteUrl } from '@dereekb/util';
2
+ export interface OpenUrlInBrowserInput {
3
+ /**
4
+ * The URL to hand to the platform's default handler.
5
+ */
6
+ readonly url: WebsiteUrl;
7
+ }
8
+ /**
9
+ * Opens a URL in the user's default browser.
10
+ *
11
+ * Shells out to the platform's URL handler (`open` on macOS, `start` on Windows, `xdg-open`
12
+ * elsewhere) rather than taking a dependency for what is a single spawn. The child is detached with
13
+ * its stdio ignored, so the browser neither holds the CLI's event loop open nor interleaves output
14
+ * into the CLI's own stdout/stderr.
15
+ *
16
+ * Never throws or rejects: a headless machine with no handler registered is an ordinary outcome, and
17
+ * the caller falls back to the printed URL.
18
+ *
19
+ * @param input - The open inputs.
20
+ * @param input.url - The URL to open.
21
+ * @returns `true` when the handler process was spawned, `false` when it could not be.
22
+ */
23
+ export declare function openUrlInBrowser(input: OpenUrlInBrowserInput): Promise<boolean>;
@@ -1,4 +1,5 @@
1
1
  export * from './args';
2
+ export * from './browser';
2
3
  export * from './context.slot';
3
4
  export * from './handler';
4
5
  export * from './interactive';
@@ -1,6 +1,14 @@
1
1
  export interface PromptInput {
2
2
  readonly question: string;
3
3
  readonly mask?: boolean;
4
+ /**
5
+ * Optional signal that cancels the prompt, rejecting it with {@link PROMPT_CANCELLED_ERROR_CODE}
6
+ * and releasing stdin.
7
+ *
8
+ * Lets a prompt race another source of the same answer — `auth login` offers the paste prompt
9
+ * while its loopback listener waits, and aborts the prompt the moment the redirect lands.
10
+ */
11
+ readonly signal?: AbortSignal;
4
12
  }
5
13
  /**
6
14
  * Error code thrown by {@link promptLine} when the user cancels a masked prompt with Ctrl-C.
@@ -16,11 +24,12 @@ export declare const PROMPT_CANCELLED_ERROR_CODE = "PROMPT_CANCELLED";
16
24
  * pasted redirect URL.
17
25
  *
18
26
  * Rejects with a {@link CliError} (`code: 'PROMPT_CANCELLED'`) when the user presses Ctrl-C
19
- * during a masked prompt, instead of forcibly terminating the process.
27
+ * during a masked prompt, or when `signal` aborts, instead of forcibly terminating the process.
20
28
  *
21
29
  * @param input - The prompt inputs.
22
30
  * @param input.question - The prompt text written to stdout (or stderr when masking).
23
31
  * @param input.mask - When `true`, characters are echoed as `*` and Ctrl-C cancels the prompt.
32
+ * @param input.signal - Optional signal that cancels the prompt and releases stdin.
24
33
  * @returns The line entered by the user (without the trailing newline).
25
34
  */
26
35
  export declare function promptLine(input: PromptInput): Promise<string>;
package/test/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-cli/test",
3
- "version": "14.1.0",
3
+ "version": "14.3.0",
4
+ "sideEffects": false,
4
5
  "type": "module",
5
6
  "peerDependencies": {
6
- "@dereekb/date": "14.1.0",
7
- "@dereekb/dbx-cli": "14.1.0",
8
- "@dereekb/firebase": "14.1.0",
9
- "@dereekb/firebase-server/test": "14.1.0",
10
- "@dereekb/model": "14.1.0",
11
- "@dereekb/nestjs": "14.1.0",
12
- "@dereekb/rxjs": "14.1.0",
13
- "@dereekb/util": "14.1.0",
7
+ "@dereekb/date": "14.3.0",
8
+ "@dereekb/dbx-cli": "14.3.0",
9
+ "@dereekb/firebase": "14.3.0",
10
+ "@dereekb/firebase-server/test": "14.3.0",
11
+ "@dereekb/model": "14.3.0",
12
+ "@dereekb/nestjs": "14.3.0",
13
+ "@dereekb/rxjs": "14.3.0",
14
+ "@dereekb/util": "14.3.0",
14
15
  "@nestjs/common": "^12.0.1",
15
16
  "arktype": "^2.2.0",
16
17
  "vitest": "4.1.11",
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-cli/validate",
3
- "version": "14.1.0",
3
+ "version": "14.3.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
- "@dereekb/dbx-cli": "14.1.0",
8
- "@dereekb/util": "14.1.0",
7
+ "@dereekb/dbx-cli": "14.3.0",
8
+ "@dereekb/util": "14.3.0",
9
9
  "ts-morph": "^28.0.0"
10
10
  }
11
11
  }