@dereekb/dbx-cli 13.37.0 → 13.38.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 (69) hide show
  1. package/eslint/package.json +3 -3
  2. package/firebase-api-manifest/main.js +191 -166
  3. package/firebase-api-manifest/package.json +3 -3
  4. package/firestore-query-manifest/main.js +2063 -0
  5. package/firestore-query-manifest/package.json +13 -0
  6. package/firestore-rules/src/firestore-rules-scan.d.ts +89 -0
  7. package/firestore-rules/src/index.d.ts +1 -0
  8. package/generate-firestore-indexes/main.js +2 -2
  9. package/generate-firestore-indexes/package.json +2 -2
  10. package/generate-mcp-manifest/main.js +1 -0
  11. package/generate-mcp-manifest/package.json +3 -3
  12. package/generate-route-manifest/package.json +2 -2
  13. package/index.cjs.js +12672 -6861
  14. package/index.esm.js +12615 -6863
  15. package/lint-cache/package.json +2 -2
  16. package/manifest-extract/index.cjs.js +4 -1
  17. package/manifest-extract/index.esm.js +4 -1
  18. package/manifest-extract/package.json +2 -2
  19. package/manifest-extract/src/lib/types.d.ts +6 -0
  20. package/package.json +11 -6
  21. package/route/package.json +7 -7
  22. package/src/lib/api/firestore-session.client.d.ts +54 -0
  23. package/src/lib/api/get-args.helper.d.ts +4 -1
  24. package/src/lib/api/get-many.command.d.ts +8 -3
  25. package/src/lib/api/get.command.d.ts +13 -5
  26. package/src/lib/api/index.d.ts +1 -0
  27. package/src/lib/config/env.d.ts +106 -0
  28. package/src/lib/config/firestore-session.cache.d.ts +86 -0
  29. package/src/lib/config/index.d.ts +1 -0
  30. package/src/lib/config/paths.d.ts +3 -1
  31. package/src/lib/context/cli.context.d.ts +87 -3
  32. package/src/lib/doctor/firestore-session.check.d.ts +113 -0
  33. package/src/lib/doctor/index.d.ts +1 -0
  34. package/src/lib/firestore/firestore-get.command.d.ts +28 -0
  35. package/src/lib/firestore/firestore-queries.command.d.ts +26 -0
  36. package/src/lib/firestore/firestore-query.command.d.ts +25 -0
  37. package/src/lib/firestore/firestore.accessor.d.ts +85 -0
  38. package/src/lib/firestore/firestore.collection.d.ts +44 -0
  39. package/src/lib/firestore/firestore.error.d.ts +14 -0
  40. package/src/lib/firestore/firestore.models.d.ts +223 -0
  41. package/src/lib/firestore/firestore.query-params.d.ts +34 -0
  42. package/src/lib/firestore/firestore.query.d.ts +79 -0
  43. package/src/lib/firestore/firestore.read.d.ts +180 -0
  44. package/src/lib/firestore/firestore.session.d.ts +97 -0
  45. package/src/lib/firestore/index.d.ts +13 -0
  46. package/src/lib/firestore/query-info-utils.d.ts +48 -0
  47. package/src/lib/firestore/query-registry.d.ts +32 -0
  48. package/src/lib/index.d.ts +3 -0
  49. package/src/lib/manifest/types.d.ts +117 -0
  50. package/src/lib/mcp-scan/manifest/dbx-docs-ui-examples-schema.d.ts +2 -2
  51. package/src/lib/mcp-scan/manifest/model-snapshot-fields-schema.d.ts +2 -2
  52. package/src/lib/mcp-scan/manifest/pipes-schema.d.ts +2 -2
  53. package/src/lib/mcp-scan/manifest/ui-components-schema.d.ts +2 -2
  54. package/src/lib/mcp-scan/manifest/utils-schema.d.ts +2 -2
  55. package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-extract.d.ts +1 -1
  56. package/src/lib/mcp-scan/scan/extract-models/types.d.ts +5 -0
  57. package/src/lib/mcp-scan/scan/ui-components-extract.d.ts +1 -1
  58. package/src/lib/middleware/auth.middleware.d.ts +6 -0
  59. package/src/lib/runner/run.d.ts +28 -1
  60. package/src/lib/scan-helpers/emit-generated-ts.d.ts +76 -0
  61. package/src/lib/scan-helpers/exported-from-package.d.ts +29 -0
  62. package/src/lib/util/index.d.ts +1 -0
  63. package/src/lib/util/output.d.ts +10 -0
  64. package/src/lib/util/stdin.d.ts +39 -2
  65. package/src/lib/util/table.d.ts +40 -0
  66. package/test/index.cjs.js +4 -2
  67. package/test/index.esm.js +4 -2
  68. package/test/package.json +9 -9
  69. package/test/src/lib/cli-test.d.ts +12 -2
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@dereekb/dbx-cli-firestore-query-manifest",
3
+ "version": "13.38.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "devDependencies": {
7
+ "eslint": "10.4.0"
8
+ },
9
+ "peerDependencies": {
10
+ "@dereekb/dbx-cli": "13.38.0",
11
+ "@dereekb/util": "13.38.0"
12
+ }
13
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * A deliberately small `firestore.rules` reader.
3
+ *
4
+ * This is NOT a CEL implementation and must not become one. It answers exactly one question per
5
+ * collection — "could a client read this at all?" — which needs only three things from the grammar:
6
+ *
7
+ * - `match /<segments> { … }` with brace nesting, `{var}` and `{path=**}` wildcards
8
+ * - `allow <ops>: if <expr>;`, where the only thing that matters about `<expr>` is whether it is
9
+ * literally `false`
10
+ * - everything else (functions, `let`, real conditions) ignored
11
+ *
12
+ * Keeping it to match-nesting plus constant-`false` detection is what makes it tractable and keeps
13
+ * it from rotting. `apps/demo-api/src/test/tests/firestore.rules.spec.ts` remains the DYNAMIC oracle
14
+ * (it drives the real rules engine via `@firebase/rules-unit-testing`); this scanner is the static
15
+ * routing source, cross-checked against it.
16
+ */
17
+ /**
18
+ * How a client read of one operation on one collection resolves under the rules.
19
+ *
20
+ * - `allowed` — some `allow` covering the op has a condition that is not constant-`false`.
21
+ * - `denied` — the op is covered only by `allow`s whose condition is literally `false`.
22
+ * - `unmatched` — no `allow` covers the op at all, so Firestore's implicit default-deny applies.
23
+ *
24
+ * `denied` and `unmatched` are both refusals; they are kept distinct because they mean different
25
+ * things to a reviewer — `denied` is a deliberate written-down "no", `unmatched` is an absence.
26
+ */
27
+ export type FirestoreRulesAccess = 'allowed' | 'denied' | 'unmatched';
28
+ /**
29
+ * The read posture of one collection, as written in the rules file.
30
+ */
31
+ export interface FirestoreRulesCollectionEntry {
32
+ /**
33
+ * Short collection name — the same token `firestoreModelIdentity('guestbook', 'gb')` produces,
34
+ * which the CLI model manifest already carries as `collectionPrefix`.
35
+ */
36
+ readonly collection: string;
37
+ /**
38
+ * Every fully-qualified match path that reached this collection.
39
+ */
40
+ readonly paths: readonly string[];
41
+ readonly get: FirestoreRulesAccess;
42
+ readonly list: FirestoreRulesAccess;
43
+ /**
44
+ * True when a `/{path=**}/<collection>/{id}` block exists — the collection is reachable as a
45
+ * collection group, not only under its parent.
46
+ */
47
+ readonly collectionGroup: boolean;
48
+ /**
49
+ * True when neither {@link get} nor {@link list} is `allowed` — no client can read this model, so
50
+ * it is server-only.
51
+ */
52
+ readonly serverOnly: boolean;
53
+ }
54
+ /**
55
+ * The result of scanning one rules file.
56
+ */
57
+ export interface FirestoreRulesScan {
58
+ readonly collections: readonly FirestoreRulesCollectionEntry[];
59
+ }
60
+ /**
61
+ * Scans `firestore.rules` source and reports the read posture of every collection it names.
62
+ *
63
+ * A collection with no match block does not appear in the result at all — absence IS the answer,
64
+ * and {@link firestoreRulesAccessForCollection} synthesizes the `unmatched` entry for it.
65
+ *
66
+ * @param source - The full text of a `firestore.rules` file.
67
+ * @returns The per-collection read posture, in collection-name order.
68
+ */
69
+ export declare function scanFirestoreRules(source: string): FirestoreRulesScan;
70
+ /**
71
+ * Looks a collection up in a scan, synthesizing the `unmatched` (and therefore server-only) entry
72
+ * for a collection the rules file never names.
73
+ *
74
+ * @param scan - The scan result.
75
+ * @param collection - The short collection name to look up.
76
+ * @returns The collection's read posture, never `undefined`.
77
+ *
78
+ * @__NO_SIDE_EFFECTS__
79
+ */
80
+ export declare function firestoreRulesAccessForCollection(scan: FirestoreRulesScan, collection: string): FirestoreRulesCollectionEntry;
81
+ /**
82
+ * The collections a scan reports as server-only — no client read grant of any kind.
83
+ *
84
+ * @param scan - The scan result.
85
+ * @returns The server-only collection names, in scan order.
86
+ *
87
+ * @__NO_SIDE_EFFECTS__
88
+ */
89
+ export declare function serverOnlyCollections(scan: FirestoreRulesScan): readonly string[];
@@ -0,0 +1 @@
1
+ export * from './firestore-rules-scan.js';
@@ -5,14 +5,14 @@ const require = __createRequire(import.meta.url);
5
5
  // packages/dbx-cli/generate-firestore-indexes/package.json
6
6
  var package_default = {
7
7
  name: "@dereekb/dbx-cli-generate-firestore-indexes",
8
- version: "13.37.0",
8
+ version: "13.38.0",
9
9
  private: true,
10
10
  type: "module",
11
11
  devDependencies: {
12
12
  eslint: "10.4.0"
13
13
  },
14
14
  peerDependencies: {
15
- "@dereekb/dbx-cli": "13.37.0"
15
+ "@dereekb/dbx-cli": "13.38.0"
16
16
  }
17
17
  };
18
18
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-cli-generate-firestore-indexes",
3
- "version": "13.37.0",
3
+ "version": "13.38.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "devDependencies": {
7
7
  "eslint": "10.4.0"
8
8
  },
9
9
  "peerDependencies": {
10
- "@dereekb/dbx-cli": "13.37.0"
10
+ "@dereekb/dbx-cli": "13.38.0"
11
11
  }
12
12
  }
@@ -1134,6 +1134,7 @@ function projectModelEntry(entry) {
1134
1134
  ...entry.description == null ? {} : { description: entry.description },
1135
1135
  ...entry.mcpToolNameSegment == null ? {} : { mcpToolNameSegment: entry.mcpToolNameSegment },
1136
1136
  ...entry.read == null ? {} : { read: entry.read },
1137
+ ...entry.serverOnly == null ? {} : { serverOnly: entry.serverOnly },
1137
1138
  ...entry.serviceFactory == null ? {} : { serviceFactory: entry.serviceFactory }
1138
1139
  };
1139
1140
  return projected;
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-cli-generate-mcp-manifest",
3
- "version": "13.37.0",
3
+ "version": "13.38.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/dbx-cli": "13.37.0",
8
- "@dereekb/model": "13.37.0",
7
+ "@dereekb/dbx-cli": "13.38.0",
8
+ "@dereekb/model": "13.38.0",
9
9
  "arktype": "^2.2.0",
10
10
  "jiti": "2.6.1"
11
11
  }
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-cli-generate-route-manifest",
3
- "version": "13.37.0",
3
+ "version": "13.38.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "peerDependencies": {
7
- "@dereekb/dbx-cli": "13.37.0",
7
+ "@dereekb/dbx-cli": "13.38.0",
8
8
  "ts-morph": "^21.0.0"
9
9
  }
10
10
  }