@dereekb/dbx-cli 13.11.17 → 13.12.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.
- package/firebase-api-manifest/main.js +70 -9
- package/firebase-api-manifest/package.json +1 -1
- package/firestore-indexes/src/firestore-indexes-generate.d.ts +125 -0
- package/firestore-indexes/src/firestore-model-identity-resolver.d.ts +93 -0
- package/firestore-indexes/src/firestore-query-helpers.d.ts +108 -0
- package/firestore-indexes/src/generate-firestore-indexes-cli.d.ts +94 -0
- package/firestore-indexes/src/index.d.ts +7 -0
- package/firestore-indexes/src/model-firebase-index-analyze.d.ts +68 -0
- package/firestore-indexes/src/model-firebase-index-build-manifest.d.ts +123 -0
- package/firestore-indexes/src/model-firebase-index-extract.d.ts +246 -0
- package/firestore-indexes/src/model-firebase-index-runtime.d.ts +126 -0
- package/firestore-indexes/src/model-firebase-index-scan-config-schema.d.ts +58 -0
- package/firestore-indexes/src/model-firebase-index-schema.d.ts +366 -0
- package/generate-firestore-indexes/main.js +1 -1
- package/generate-firestore-indexes/package.json +1 -1
- package/generate-mcp-manifest/src/generate-mcp-manifest/main.d.ts +26 -0
- package/generate-mcp-manifest/src/generate-mcp-manifest/render.d.ts +38 -0
- package/generated/firebase-models.generated.d.ts +3 -0
- package/index.cjs.js +45234 -640
- package/index.esm.js +44941 -643
- package/lint-cache/main.js +19 -19
- package/lint-cache/package.json +2 -2
- package/manifest-extract/index.cjs.js +169 -4
- package/manifest-extract/index.esm.js +169 -4
- package/manifest-extract/package.json +1 -1
- package/manifest-extract/src/lib/types.d.ts +26 -1
- package/package.json +14 -10
- package/src/lib/index.d.ts +3 -0
- package/src/lib/manifest/types.d.ts +155 -0
- package/src/lib/mcp-scan/config/config-schema.d.ts +226 -0
- package/src/lib/mcp-scan/config/load-config.d.ts +63 -0
- package/src/lib/mcp-scan/index.d.ts +16 -0
- package/src/lib/mcp-scan/manifest/actions-loader.d.ts +49 -0
- package/src/lib/mcp-scan/manifest/actions-schema.d.ts +328 -0
- package/src/lib/mcp-scan/manifest/core-topics.d.ts +38 -0
- package/src/lib/mcp-scan/manifest/css-utilities-loader.d.ts +55 -0
- package/src/lib/mcp-scan/manifest/css-utilities-schema.d.ts +168 -0
- package/src/lib/mcp-scan/manifest/dbx-docs-ui-examples-loader.d.ts +33 -0
- package/src/lib/mcp-scan/manifest/dbx-docs-ui-examples-schema.d.ts +133 -0
- package/src/lib/mcp-scan/manifest/filters-loader.d.ts +61 -0
- package/src/lib/mcp-scan/manifest/filters-schema.d.ts +190 -0
- package/src/lib/mcp-scan/manifest/forge-fields-loader.d.ts +53 -0
- package/src/lib/mcp-scan/manifest/forge-fields-schema.d.ts +170 -0
- package/src/lib/mcp-scan/manifest/index.d.ts +43 -0
- package/src/lib/mcp-scan/manifest/load-actions-registry.d.ts +38 -0
- package/src/lib/mcp-scan/manifest/load-auth-registry.d.ts +82 -0
- package/src/lib/mcp-scan/manifest/load-css-utilities-registry.d.ts +67 -0
- package/src/lib/mcp-scan/manifest/load-dbx-docs-ui-examples-registry.d.ts +45 -0
- package/src/lib/mcp-scan/manifest/load-filters-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-forge-fields-registry.d.ts +70 -0
- package/src/lib/mcp-scan/manifest/load-model-firebase-index-registry.d.ts +61 -0
- package/src/lib/mcp-scan/manifest/load-model-snapshot-fields-registry.d.ts +74 -0
- package/src/lib/mcp-scan/manifest/load-pipes-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-registry.d.ts +76 -0
- package/src/lib/mcp-scan/manifest/load-tokens-registry.d.ts +69 -0
- package/src/lib/mcp-scan/manifest/load-ui-components-registry.d.ts +70 -0
- package/src/lib/mcp-scan/manifest/load-utils-registry.d.ts +73 -0
- package/src/lib/mcp-scan/manifest/loader.d.ts +120 -0
- package/src/lib/mcp-scan/manifest/manifest-loader-base.d.ts +130 -0
- package/src/lib/mcp-scan/manifest/model-firebase-index-loader.d.ts +53 -0
- package/src/lib/mcp-scan/manifest/model-snapshot-fields-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/model-snapshot-fields-schema.d.ts +127 -0
- package/src/lib/mcp-scan/manifest/pipes-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/pipes-schema.d.ts +125 -0
- package/src/lib/mcp-scan/manifest/semantic-types-schema.d.ts +108 -0
- package/src/lib/mcp-scan/manifest/tokens-loader.d.ts +55 -0
- package/src/lib/mcp-scan/manifest/tokens-schema.d.ts +116 -0
- package/src/lib/mcp-scan/manifest/ui-components-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/ui-components-schema.d.ts +149 -0
- package/src/lib/mcp-scan/manifest/utils-loader.d.ts +54 -0
- package/src/lib/mcp-scan/manifest/utils-schema.d.ts +120 -0
- package/src/lib/mcp-scan/registry/actions-runtime.d.ts +173 -0
- package/src/lib/mcp-scan/registry/archetypes.d.ts +235 -0
- package/src/lib/mcp-scan/registry/auth-builtin.d.ts +59 -0
- package/src/lib/mcp-scan/registry/auth-runtime.d.ts +343 -0
- package/src/lib/mcp-scan/registry/css-utilities-runtime.d.ts +133 -0
- package/src/lib/mcp-scan/registry/dbx-docs-ui-examples-runtime.d.ts +58 -0
- package/src/lib/mcp-scan/registry/downstream-models-runtime.d.ts +93 -0
- package/src/lib/mcp-scan/registry/filters-runtime.d.ts +128 -0
- package/src/lib/mcp-scan/registry/firebase-models.d.ts +387 -0
- package/src/lib/mcp-scan/registry/forge-fields.d.ts +101 -0
- package/src/lib/mcp-scan/registry/form-fields.d.ts +203 -0
- package/src/lib/mcp-scan/registry/index.d.ts +165 -0
- package/src/lib/mcp-scan/registry/model-snapshot-fields-runtime.d.ts +138 -0
- package/src/lib/mcp-scan/registry/pipes-runtime.d.ts +136 -0
- package/src/lib/mcp-scan/registry/reserved-model-folders.d.ts +29 -0
- package/src/lib/mcp-scan/registry/semantic-types.d.ts +81 -0
- package/src/lib/mcp-scan/registry/tokens-runtime.d.ts +96 -0
- package/src/lib/mcp-scan/registry/ui-components-runtime.d.ts +90 -0
- package/src/lib/mcp-scan/registry/utils-runtime.d.ts +136 -0
- package/src/lib/mcp-scan/scan/_jsdoc-tagged-export/extract-base.d.ts +245 -0
- package/src/lib/mcp-scan/scan/actions-build-manifest.d.ts +58 -0
- package/src/lib/mcp-scan/scan/actions-cli.d.ts +38 -0
- package/src/lib/mcp-scan/scan/actions-extract.d.ts +99 -0
- package/src/lib/mcp-scan/scan/actions-scan-config-schema.d.ts +42 -0
- package/src/lib/mcp-scan/scan/auth-extract.d.ts +120 -0
- package/src/lib/mcp-scan/scan/build-manifest.d.ts +76 -0
- package/src/lib/mcp-scan/scan/cli.d.ts +60 -0
- package/src/lib/mcp-scan/scan/css-utilities-build-manifest.d.ts +76 -0
- package/src/lib/mcp-scan/scan/css-utilities-cli.d.ts +36 -0
- package/src/lib/mcp-scan/scan/css-utilities-extract.d.ts +187 -0
- package/src/lib/mcp-scan/scan/css-utilities-scan-config-schema.d.ts +57 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-build-manifest.d.ts +68 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-cli.d.ts +20 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-extract.d.ts +160 -0
- package/src/lib/mcp-scan/scan/dbx-docs-ui-examples-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/discover-downstream-packages.d.ts +76 -0
- package/src/lib/mcp-scan/scan/discover-firebase-packages.d.ts +58 -0
- package/src/lib/mcp-scan/scan/extract-models/assemble.d.ts +105 -0
- package/src/lib/mcp-scan/scan/extract-models/collect-inherited.d.ts +22 -0
- package/src/lib/mcp-scan/scan/extract-models/find-converters.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-enums.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-identities.d.ts +25 -0
- package/src/lib/mcp-scan/scan/extract-models/find-interfaces.d.ts +31 -0
- package/src/lib/mcp-scan/scan/extract-models/find-model-groups.d.ts +21 -0
- package/src/lib/mcp-scan/scan/extract-models/find-service-factories.d.ts +19 -0
- package/src/lib/mcp-scan/scan/extract-models/find-sub-object-consts.d.ts +20 -0
- package/src/lib/mcp-scan/scan/extract-models/index.d.ts +74 -0
- package/src/lib/mcp-scan/scan/extract-models/infer-collection-kind.d.ts +22 -0
- package/src/lib/mcp-scan/scan/extract-models/service-factory-constants.d.ts +6 -0
- package/src/lib/mcp-scan/scan/extract-models/types.d.ts +171 -0
- package/src/lib/mcp-scan/scan/extract.d.ts +82 -0
- package/src/lib/mcp-scan/scan/filters-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/filters-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/filters-extract.d.ts +101 -0
- package/src/lib/mcp-scan/scan/filters-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/forge-fields-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/forge-fields-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/forge-fields-extract.d.ts +165 -0
- package/src/lib/mcp-scan/scan/forge-fields-scan-config-schema.d.ts +61 -0
- package/src/lib/mcp-scan/scan/index.d.ts +60 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-cli.d.ts +22 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-dispatcher-credit.d.ts +47 -0
- package/src/lib/mcp-scan/scan/model-firebase-index-reference-scan.d.ts +100 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-build-manifest.d.ts +79 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-extract.d.ts +115 -0
- package/src/lib/mcp-scan/scan/model-snapshot-fields-scan-config-schema.d.ts +59 -0
- package/src/lib/mcp-scan/scan/pipes-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/pipes-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/pipes-extract.d.ts +90 -0
- package/src/lib/mcp-scan/scan/pipes-scan-config-schema.d.ts +56 -0
- package/src/lib/mcp-scan/scan/scan-angular-io.d.ts +89 -0
- package/src/lib/mcp-scan/scan/scan-cli-base.d.ts +162 -0
- package/src/lib/mcp-scan/scan/scan-config-schema.d.ts +44 -0
- package/src/lib/mcp-scan/scan/ui-components-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/ui-components-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/ui-components-extract.d.ts +124 -0
- package/src/lib/mcp-scan/scan/ui-components-scan-config-schema.d.ts +62 -0
- package/src/lib/mcp-scan/scan/utils-build-manifest.d.ts +78 -0
- package/src/lib/mcp-scan/scan/utils-cli.d.ts +37 -0
- package/src/lib/mcp-scan/scan/utils-extract.d.ts +103 -0
- package/src/lib/mcp-scan/scan/utils-scan-config-schema.d.ts +57 -0
- package/test/package.json +9 -9
- package/index.cjs.default.js +0 -1
- package/index.cjs.mjs +0 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery for downstream `-firebase` component packages.
|
|
3
|
+
*
|
|
4
|
+
* `dbx_model_search` and `dbx_model_lookup` extend their reach beyond the
|
|
5
|
+
* upstream `@dereekb/firebase` registry by globbing the caller's workspace
|
|
6
|
+
* for `components/<name>-firebase` packages on first use, then handing each
|
|
7
|
+
* match's `src/lib/model/` directory to the runtime ts-morph extractor.
|
|
8
|
+
*
|
|
9
|
+
* The result is intentionally narrow: just the package name plus the model
|
|
10
|
+
* root that the extractor needs. Errors during package-json reads degrade
|
|
11
|
+
* to the directory basename so a malformed package never breaks discovery.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* One downstream `-firebase` component package discovered under the caller's
|
|
15
|
+
* workspace root. Both paths are workspace-relative and use forward slashes
|
|
16
|
+
* regardless of platform — the extractor and the formatter render them as-is.
|
|
17
|
+
*/
|
|
18
|
+
export interface DownstreamFirebasePackage {
|
|
19
|
+
/**
|
|
20
|
+
* Canonical package name from `package.json` (e.g. `'demo-firebase'`).
|
|
21
|
+
* Falls back to the directory basename when no `package.json` exists or
|
|
22
|
+
* the file is unreadable.
|
|
23
|
+
*/
|
|
24
|
+
readonly packageName: string;
|
|
25
|
+
/**
|
|
26
|
+
* Workspace-relative path to the component package root
|
|
27
|
+
* (e.g. `'components/demo-firebase'`).
|
|
28
|
+
*/
|
|
29
|
+
readonly componentDir: string;
|
|
30
|
+
/**
|
|
31
|
+
* Workspace-relative path to the model root, i.e.
|
|
32
|
+
* `<componentDir>/src/lib/model` (forward-slash form).
|
|
33
|
+
*/
|
|
34
|
+
readonly modelDir: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Globs `components/*-firebase/` under `workspaceRoot` and returns every
|
|
38
|
+
* directory whose `src/lib/model/` exists.
|
|
39
|
+
*
|
|
40
|
+
* Other layouts (`apps/*-firebase`, `libs/*-firebase`, `packages/*-firebase`)
|
|
41
|
+
* are deliberately not scanned — `dbx_model_search` / `dbx_model_lookup`
|
|
42
|
+
* accept an explicit `componentDirs` override for non-standard layouts.
|
|
43
|
+
*
|
|
44
|
+
* @param workspaceRoot - Absolute path to the caller's workspace root.
|
|
45
|
+
* @returns The discovered packages sorted by `packageName`
|
|
46
|
+
*/
|
|
47
|
+
export declare function discoverDownstreamFirebasePackages(workspaceRoot: string): Promise<readonly DownstreamFirebasePackage[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Resolves an explicit `componentDirs` override against the workspace root.
|
|
50
|
+
* Each entry is checked for a `src/lib/model/` directory; entries that
|
|
51
|
+
* don't have one are dropped. Mirrors the post-glob filtering in
|
|
52
|
+
* {@link discoverDownstreamFirebasePackages}.
|
|
53
|
+
*
|
|
54
|
+
* @param workspaceRoot - Absolute path to the caller's workspace root.
|
|
55
|
+
* @param componentDirs - Workspace-relative directories to inspect.
|
|
56
|
+
* @returns The resolved packages (may be shorter than `componentDirs`)
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolveExplicitFirebasePackages(workspaceRoot: string, componentDirs: readonly string[]): Promise<readonly DownstreamFirebasePackage[]>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-file model assembly. Combines the per-file outputs of
|
|
3
|
+
* {@link findIdentities}, {@link findInterfaces}, {@link findConverters},
|
|
4
|
+
* {@link findEnums}, {@link findModelGroups}, and
|
|
5
|
+
* {@link findCollectionFactoryCalls} into the {@link FirebaseModel} +
|
|
6
|
+
* {@link FirebaseModelGroup} entries the registry exposes.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors the per-file body of `extractFromFile` in
|
|
9
|
+
* `scripts/extract-firebase-models.mjs`.
|
|
10
|
+
*/
|
|
11
|
+
import type { FirebaseModel, FirebaseModelGroup, FirebaseSubObject, FirestoreCollectionKind } from '../../registry/firebase-models.js';
|
|
12
|
+
import type { ExtractedConverter, ExtractedEnum, ExtractedIdentity, ExtractedInterface, ExtractedModelGroup } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Field names that show up on many models and shouldn't seed
|
|
15
|
+
* {@link FirebaseModel.detectionHints}. Matches the `.mjs`
|
|
16
|
+
* extractor's `COMMON_FIELDS` set.
|
|
17
|
+
*/
|
|
18
|
+
export declare const COMMON_FIELDS: ReadonlySet<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Marker-interface name for documents whose Firestore id IS the user's
|
|
21
|
+
* Firebase Auth uid (sourced from `@dereekb/firebase` `user.ts`).
|
|
22
|
+
*/
|
|
23
|
+
export declare const USER_KEYED_BY_ID_MARKER = "UserRelatedById";
|
|
24
|
+
/**
|
|
25
|
+
* Marker-interface name for documents that carry an explicit `uid` field
|
|
26
|
+
* referencing a Firebase Auth user (sourced from `@dereekb/firebase`
|
|
27
|
+
* `user.ts`; alias of `FirebaseAuthUserIdRef`).
|
|
28
|
+
*/
|
|
29
|
+
export declare const USER_RELATED_MARKER = "UserRelated";
|
|
30
|
+
/**
|
|
31
|
+
* Marker-interface name for documents whose Firestore id IS a region key.
|
|
32
|
+
* Mirrors `REGION_KEYED_BY_ID_MARKER` in the `.mjs` extractor.
|
|
33
|
+
*/
|
|
34
|
+
export declare const REGION_KEYED_BY_ID_MARKER = "RegionRelatedById";
|
|
35
|
+
/**
|
|
36
|
+
* Marker-interface name for documents whose Firestore id IS a district key.
|
|
37
|
+
* Mirrors `DISTRICT_KEYED_BY_ID_MARKER` in the `.mjs` extractor.
|
|
38
|
+
*/
|
|
39
|
+
export declare const DISTRICT_KEYED_BY_ID_MARKER = "DistrictRelatedById";
|
|
40
|
+
/**
|
|
41
|
+
* Marker-interface name for documents whose Firestore id IS an external
|
|
42
|
+
* vendor's id, regardless of which vendor. Models extend
|
|
43
|
+
* `ExternalRelatedById<TId>` from `@dereekb/firebase`.
|
|
44
|
+
*/
|
|
45
|
+
export declare const EXTERNAL_ID_KEYED_BY_ID_MARKER = "ExternalRelatedById";
|
|
46
|
+
/**
|
|
47
|
+
* Marker-interface name suffixes for documents keyed by a temporal bucket
|
|
48
|
+
* code (year-week, year-month, …). Matched as suffixes so per-bucket markers
|
|
49
|
+
* like `YearWeekRelatedById` and `WeekRelatedById` are picked up.
|
|
50
|
+
*/
|
|
51
|
+
export declare const BUCKET_KEYED_BY_ID_SUFFIXES: readonly string[];
|
|
52
|
+
/**
|
|
53
|
+
* Result of assembling one source file's models + groups.
|
|
54
|
+
*/
|
|
55
|
+
export interface AssembledFile {
|
|
56
|
+
readonly models: readonly FirebaseModel[];
|
|
57
|
+
readonly modelGroups: readonly FirebaseModelGroup[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Configuration for assembling one source file.
|
|
61
|
+
*/
|
|
62
|
+
export interface AssembleFileInput {
|
|
63
|
+
readonly sourcePackage: string;
|
|
64
|
+
readonly sourceFile: string;
|
|
65
|
+
readonly identities: readonly ExtractedIdentity[];
|
|
66
|
+
readonly interfaces: readonly ExtractedInterface[];
|
|
67
|
+
readonly converters: readonly ExtractedConverter[];
|
|
68
|
+
readonly enums: readonly ExtractedEnum[];
|
|
69
|
+
readonly modelGroups: readonly ExtractedModelGroup[];
|
|
70
|
+
readonly factoryKinds: ReadonlyMap<string, FirestoreCollectionKind>;
|
|
71
|
+
/**
|
|
72
|
+
* Cross-file sub-object index built by the extractor's pre-pass. Maps
|
|
73
|
+
* a sub-object factory const name (e.g. `workerPayStubItem`) to the
|
|
74
|
+
* record describing the underlying interface plus its factory shape.
|
|
75
|
+
* When omitted (e.g. legacy callers, tests that don't exercise
|
|
76
|
+
* sub-objects), the assembler skips field-level sub-object resolution.
|
|
77
|
+
*/
|
|
78
|
+
readonly subObjectConstIndex?: ReadonlyMap<string, SubObjectConstEntry>;
|
|
79
|
+
/**
|
|
80
|
+
* Cross-file map of `@dbxModelSubObject`-tagged interface declarations
|
|
81
|
+
* keyed by interface name. Used together with {@link subObjectConstIndex}
|
|
82
|
+
* to recursively render nested sub-objects in the catalog.
|
|
83
|
+
*/
|
|
84
|
+
readonly subObjectInterfaceIndex?: ReadonlyMap<string, ExtractedInterface>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* One entry in the cross-file sub-object const index. The
|
|
88
|
+
* {@link interfaceName} resolves to a tagged
|
|
89
|
+
* `@dbxModelSubObject` declaration in
|
|
90
|
+
* {@link AssembleFileInput.subObjectInterfaceIndex}; the
|
|
91
|
+
* {@link factoryKind} drives the catalog's section label
|
|
92
|
+
* (`object` / `array` / `map`).
|
|
93
|
+
*/
|
|
94
|
+
export interface SubObjectConstEntry {
|
|
95
|
+
readonly interfaceName: string;
|
|
96
|
+
readonly factoryKind: FirebaseSubObject['factoryKind'];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Combines the per-file extraction outputs into ready-to-publish
|
|
100
|
+
* {@link FirebaseModel} / {@link FirebaseModelGroup} entries.
|
|
101
|
+
*
|
|
102
|
+
* @param input - The per-file extraction outputs.
|
|
103
|
+
* @returns The assembled models and groups for the file.
|
|
104
|
+
*/
|
|
105
|
+
export declare function assembleFile(input: AssembleFileInput): AssembledFile;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks an interface's `extends` chain through a same-file lookup map and
|
|
3
|
+
* merges every ancestor's properties into a single name → prop record.
|
|
4
|
+
* Closer ancestors override more distant ones, matching the `.mjs`
|
|
5
|
+
* extractor's `collectInheritedProps`.
|
|
6
|
+
*
|
|
7
|
+
* Cross-file inheritance is intentionally ignored — the registry only
|
|
8
|
+
* follows the chain inside the model's own file. Model interfaces in this
|
|
9
|
+
* codebase consistently keep their inheritance local, so this matches the
|
|
10
|
+
* existing behaviour.
|
|
11
|
+
*/
|
|
12
|
+
import type { ExtractedInterface, ExtractedInterfaceProp } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Returns a map of property-name → prop merged across the supplied
|
|
15
|
+
* interface and every ancestor reachable via `extendsNames`. Walk order
|
|
16
|
+
* is parents-first so the supplied interface's own props win on conflict.
|
|
17
|
+
*
|
|
18
|
+
* @param iface - The interface to start from.
|
|
19
|
+
* @param interfaceByName - Lookup map of every interface in the same file.
|
|
20
|
+
* @returns The merged property map.
|
|
21
|
+
*/
|
|
22
|
+
export declare function collectInheritedProps(iface: ExtractedInterface, interfaceByName: ReadonlyMap<string, ExtractedInterface>): ReadonlyMap<string, ExtractedInterfaceProp>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds `export const <x>Converter = snapshotConverterFunctions<<X>>({ fields: { ... } })`
|
|
3
|
+
* declarations and reads the canonical persisted-field list straight off the AST.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors `findConverters` + `parseFieldsBody` in the `.mjs` extractor; the
|
|
6
|
+
* AST replaces the manual brace/string state machine with ts-morph
|
|
7
|
+
* `getProperties()` walks.
|
|
8
|
+
*/
|
|
9
|
+
import { type SourceFile } from 'ts-morph';
|
|
10
|
+
import type { ExtractedConverter } from './types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Walks every exported variable declaration in the source file and returns
|
|
13
|
+
* the converter consts whose initializer is a `snapshotConverterFunctions`
|
|
14
|
+
* call.
|
|
15
|
+
*
|
|
16
|
+
* @param sf - The parsed source file to inspect.
|
|
17
|
+
* @returns One entry per detected converter.
|
|
18
|
+
*/
|
|
19
|
+
export declare function findConverters(sf: SourceFile): readonly ExtractedConverter[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks every exported `enum` in a ts-morph source file and captures the
|
|
3
|
+
* member name, persisted value, and JSDoc description. Mirrors the `.mjs`
|
|
4
|
+
* `findEnums` + `parseEnumBody` pair via the AST.
|
|
5
|
+
*
|
|
6
|
+
* Numeric enums auto-increment when no explicit value is supplied, matching
|
|
7
|
+
* TypeScript's runtime behaviour and the upstream extractor's expectations.
|
|
8
|
+
*/
|
|
9
|
+
import { type SourceFile } from 'ts-morph';
|
|
10
|
+
import type { ExtractedEnum } from './types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Returns every exported enum declared in the source file along with its
|
|
13
|
+
* members. Enum members without an explicit initializer auto-increment
|
|
14
|
+
* starting from 0 (or from the previous explicit numeric value + 1).
|
|
15
|
+
*
|
|
16
|
+
* @param sf - The parsed source file to inspect.
|
|
17
|
+
* @returns The enums in source order.
|
|
18
|
+
*/
|
|
19
|
+
export declare function findEnums(sf: SourceFile): readonly ExtractedEnum[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locates `export const <X>Identity = firestoreModelIdentity(...)` declarations
|
|
3
|
+
* in a ts-morph source file. Mirrors the regex-based extractor in
|
|
4
|
+
* `scripts/extract-firebase-models.mjs` (`findIdentities`) but operates on
|
|
5
|
+
* the AST so generic call shapes round-trip cleanly.
|
|
6
|
+
*/
|
|
7
|
+
import { type SourceFile } from 'ts-morph';
|
|
8
|
+
import type { ExtractedIdentity } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Walks every `export const` declaration in the source file and pulls the
|
|
11
|
+
* model-type / prefix / parent-identity arguments out of any
|
|
12
|
+
* `firestoreModelIdentity(...)` call.
|
|
13
|
+
*
|
|
14
|
+
* Mirrors the `.mjs` 1/2/3-arg branching:
|
|
15
|
+
*
|
|
16
|
+
* • `firestoreModelIdentity('user')` → `modelType: 'user'`
|
|
17
|
+
* • `firestoreModelIdentity('storageFile', 'sf')` → `modelType: 'storageFile'`, `prefix: 'sf'`
|
|
18
|
+
* • `firestoreModelIdentity(notificationBoxIdentity, 'notification')` → `parent: 'notificationBoxIdentity'`, `modelType: 'notification'`
|
|
19
|
+
* • `firestoreModelIdentity(guestbookIdentity, 'guestbookEntry', 'gbe')` → all three
|
|
20
|
+
*
|
|
21
|
+
* @param sf - The parsed source file to inspect.
|
|
22
|
+
* @returns The identity declarations in source order; entries with an
|
|
23
|
+
* unrecognisable shape are skipped.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findIdentities(sf: SourceFile): readonly ExtractedIdentity[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks every `export interface` declaration in a ts-morph source file and
|
|
3
|
+
* captures the JSDoc tag flags (`@dbxModel`), `extends` references, and
|
|
4
|
+
* per-property metadata (TS type, optionality, JSDoc description, and the
|
|
5
|
+
* `@dbxModelVariable` long-name tag).
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the regex-based extractor's `findInterfaces` + `parseInterfaceBody`
|
|
8
|
+
* pair from `scripts/extract-firebase-models.mjs`, but the AST drops the
|
|
9
|
+
* cumbersome property-by-property regex.
|
|
10
|
+
*/
|
|
11
|
+
import { type JSDoc, type SourceFile } from 'ts-morph';
|
|
12
|
+
import type { ExtractedInterface } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Returns every exported interface in the source file with the metadata the
|
|
15
|
+
* model assembler needs. Non-exported interfaces are skipped because the
|
|
16
|
+
* upstream registry only considers exported model interfaces (matching the
|
|
17
|
+
* `.mjs` extractor's `export interface` regex).
|
|
18
|
+
*
|
|
19
|
+
* @param sf - The parsed source file to inspect.
|
|
20
|
+
* @returns The interfaces in source order.
|
|
21
|
+
*/
|
|
22
|
+
export declare function findInterfaces(sf: SourceFile): readonly ExtractedInterface[];
|
|
23
|
+
/**
|
|
24
|
+
* Returns the first non-empty paragraph of the leading JSDoc description.
|
|
25
|
+
* Mirrors the `.mjs` `parseJsdocBlock` that splits on the first blank line
|
|
26
|
+
* before the first `@`-tag.
|
|
27
|
+
*
|
|
28
|
+
* @param jsDocs - The JSDoc blocks attached to a declaration.
|
|
29
|
+
* @returns The description paragraph, or `undefined` when none exists.
|
|
30
|
+
*/
|
|
31
|
+
export declare function readDescription(jsDocs: readonly JSDoc[]): string | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locates `<X>FirestoreCollections` containers tagged with `@dbxModelGroup`
|
|
3
|
+
* (either `export abstract class <X>FirestoreCollections` or
|
|
4
|
+
* `export interface <X>FirestoreCollections`) and lifts the group's name
|
|
5
|
+
* plus the model classes its body references.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors `findModelGroups` + `extractGroupModelNames` in
|
|
8
|
+
* `scripts/extract-firebase-models.mjs`.
|
|
9
|
+
*/
|
|
10
|
+
import { type SourceFile } from 'ts-morph';
|
|
11
|
+
import type { ExtractedModelGroup } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Returns every `<X>FirestoreCollections` container in the source file
|
|
14
|
+
* tagged with `@dbxModelGroup`. The group name comes from the explicit
|
|
15
|
+
* tag argument; bare `@dbxModelGroup` markers fall back to the container
|
|
16
|
+
* name with the `FirestoreCollections` suffix stripped.
|
|
17
|
+
*
|
|
18
|
+
* @param sf - The parsed source file to inspect.
|
|
19
|
+
* @returns The model-group containers in source order.
|
|
20
|
+
*/
|
|
21
|
+
export declare function findModelGroups(sf: SourceFile): readonly ExtractedModelGroup[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks every `@dbxModelServiceFactory <modelType>`-tagged variable export in a ts-morph
|
|
3
|
+
* source file and returns one {@link ExtractedServiceFactory} per tagged binding.
|
|
4
|
+
*
|
|
5
|
+
* The model extractor calls this once per parsed source file; the extractor's post-pass joins
|
|
6
|
+
* the resulting entries onto each {@link FirebaseModel} by `modelType`.
|
|
7
|
+
*/
|
|
8
|
+
import type { SourceFile } from 'ts-morph';
|
|
9
|
+
import type { ExtractedServiceFactory } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Collects every `@dbxModelServiceFactory <modelType>` tagged variable export from a source
|
|
12
|
+
* file. Each tagged statement yields one entry per declarator (mirroring the underlying
|
|
13
|
+
* `collectTaggedVariables` shape). Invalid or missing values are silently dropped — the
|
|
14
|
+
* ESLint rule is the user-facing gate.
|
|
15
|
+
*
|
|
16
|
+
* @param sf - The parsed source file to inspect.
|
|
17
|
+
* @returns The tagged factories in source order.
|
|
18
|
+
*/
|
|
19
|
+
export declare function findServiceFactories(sf: SourceFile): readonly ExtractedServiceFactory[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Walks every `export const <name> = firestoreSubObject<T>(...)` /
|
|
3
|
+
* `firestoreObjectArray<T>(...)` / `firestoreMap<T>(...)` declaration and
|
|
4
|
+
* records the const-name → type-arg-interface mapping the rich catalog
|
|
5
|
+
* uses to resolve sub-object converters back to their underlying
|
|
6
|
+
* interface.
|
|
7
|
+
*/
|
|
8
|
+
import { type SourceFile } from 'ts-morph';
|
|
9
|
+
import type { ExtractedSubObjectConst } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Returns one entry per detected `firestoreSubObject<T>` /
|
|
12
|
+
* `firestoreObjectArray<T>` / `firestoreMap<T>` declaration whose first
|
|
13
|
+
* generic type-argument is a bare type-reference identifier. Inline
|
|
14
|
+
* object types and generic parameters are skipped because they never
|
|
15
|
+
* resolve to a declared interface.
|
|
16
|
+
*
|
|
17
|
+
* @param sf - The parsed source file to inspect.
|
|
18
|
+
* @returns One entry per detected sub-object factory const, in source order.
|
|
19
|
+
*/
|
|
20
|
+
export declare function findSubObjectConsts(sf: SourceFile): readonly ExtractedSubObjectConst[];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry point for the rich Firebase-model ts-morph extractor.
|
|
3
|
+
*
|
|
4
|
+
* Walks every `.ts` file under `rootDir` (skipping `*.spec.ts`, `*.test.ts`,
|
|
5
|
+
* and `*.id.ts` as the build-time `.mjs` extractor does), parses each into an
|
|
6
|
+
* in-memory ts-morph project, and assembles {@link FirebaseModel} +
|
|
7
|
+
* {@link FirebaseModelGroup} entries with full parity to the upstream
|
|
8
|
+
* `scripts/extract-firebase-models.mjs`.
|
|
9
|
+
*
|
|
10
|
+
* Used by:
|
|
11
|
+
* - the runtime downstream-models cache to scan
|
|
12
|
+
* `components/<x>-firebase` packages on first use
|
|
13
|
+
* - `dbx_model_list_component`'s thin extractor (after refactor)
|
|
14
|
+
*
|
|
15
|
+
* The build-time `.mjs` script remains the canonical source for the
|
|
16
|
+
* upstream `firebase-models.generated.{json,ts}` catalog. A parity spec
|
|
17
|
+
* keeps the two implementations in lock-step on the upstream model corpus.
|
|
18
|
+
*/
|
|
19
|
+
import type { FirebaseModel, FirebaseModelGroup } from '../../registry/firebase-models.js';
|
|
20
|
+
/**
|
|
21
|
+
* Outcome of one model-root scan. The `errors` array carries per-file
|
|
22
|
+
* failures so an individual malformed file never blocks the rest.
|
|
23
|
+
*/
|
|
24
|
+
export interface ExtractModelsResult {
|
|
25
|
+
readonly models: readonly FirebaseModel[];
|
|
26
|
+
readonly modelGroups: readonly FirebaseModelGroup[];
|
|
27
|
+
readonly errors: readonly {
|
|
28
|
+
readonly sourceFile: string;
|
|
29
|
+
readonly message: string;
|
|
30
|
+
}[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Configuration for {@link extractModels}.
|
|
34
|
+
*/
|
|
35
|
+
export interface ExtractModelsInput {
|
|
36
|
+
/**
|
|
37
|
+
* Absolute path to the model-root directory. Typically
|
|
38
|
+
* `<componentRoot>/src/lib/model` for downstream packages, or
|
|
39
|
+
* `packages/firebase/src/lib/model` for the upstream catalog.
|
|
40
|
+
*/
|
|
41
|
+
readonly rootDir: string;
|
|
42
|
+
/**
|
|
43
|
+
* The `sourcePackage` value to stamp on every produced entry
|
|
44
|
+
* (e.g. `'@dereekb/firebase'` or `'demo-firebase'`).
|
|
45
|
+
*/
|
|
46
|
+
readonly sourcePackage: string;
|
|
47
|
+
/**
|
|
48
|
+
* Workspace root used to compute the workspace-relative `sourceFile`
|
|
49
|
+
* field on each entry. When omitted, the path is computed relative to
|
|
50
|
+
* `rootDir`'s parent (rare — only useful for ad-hoc tests).
|
|
51
|
+
*/
|
|
52
|
+
readonly workspaceRoot?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Reserved top-level folder names to skip during the walk
|
|
55
|
+
* (e.g. `system`, `notification`, `storagefile`). Files inside reserved
|
|
56
|
+
* folders are excluded from the scan.
|
|
57
|
+
*
|
|
58
|
+
* Provide the {@link RESERVED_MODEL_FOLDERS} set when scanning a
|
|
59
|
+
* downstream package that extends shared groups via dedicated
|
|
60
|
+
* validators; pass an empty array (or omit) when scanning the upstream
|
|
61
|
+
* `@dereekb/firebase` source where the same folders host the canonical
|
|
62
|
+
* group implementations.
|
|
63
|
+
*/
|
|
64
|
+
readonly skipReservedFolders?: readonly string[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Scans the supplied model root and returns every detected model and
|
|
68
|
+
* model-group entry. Per-file errors are aggregated rather than thrown so
|
|
69
|
+
* a single malformed file never blocks the rest of the scan.
|
|
70
|
+
*
|
|
71
|
+
* @param input - The scan configuration.
|
|
72
|
+
* @returns The assembled models, groups, and per-file errors.
|
|
73
|
+
*/
|
|
74
|
+
export declare function extractModels(input: ExtractModelsInput): Promise<ExtractModelsResult>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a map of `<modelType>FirestoreCollection(Factory)?` factory function
|
|
3
|
+
* names to the {@link FirestoreCollectionKind} their body declares.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the `findCollectionFactoryCalls` + `detectCollectionKindInBody`
|
|
6
|
+
* pair in `scripts/extract-firebase-models.mjs`. The kind is read off the
|
|
7
|
+
* first matching `firestoreContext.<method>(...)` call inside each
|
|
8
|
+
* function body — the pattern matches whether the call is direct
|
|
9
|
+
* (`firestoreContext.firestoreCollection({...})`) or returned from an
|
|
10
|
+
* inner factory closure.
|
|
11
|
+
*/
|
|
12
|
+
import { type SourceFile } from 'ts-morph';
|
|
13
|
+
import type { FirestoreCollectionKind } from '../../registry/firebase-models.js';
|
|
14
|
+
/**
|
|
15
|
+
* Returns a map of factory function name to its declared
|
|
16
|
+
* {@link FirestoreCollectionKind}. Functions that don't make a recognised
|
|
17
|
+
* `firestoreContext.*` call are omitted.
|
|
18
|
+
*
|
|
19
|
+
* @param sf - The parsed source file to inspect.
|
|
20
|
+
* @returns The factory-name → kind map (may be empty)
|
|
21
|
+
*/
|
|
22
|
+
export declare function findCollectionFactoryCalls(sf: SourceFile): ReadonlyMap<string, FirestoreCollectionKind>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSDoc tag that declares which Firestore model a `firebaseModelServiceFactory(...)` export
|
|
3
|
+
* implements. Value is the canonical `FirestoreModelIdentity.modelType` string. Mirrors the
|
|
4
|
+
* ESLint rule's `DBX_MODEL_SERVICE_FACTORY_TAG` constant so scanner + lint align.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DBX_MODEL_SERVICE_FACTORY_TAG = "dbxModelServiceFactory";
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal helper types for the rich Firebase-model ts-morph extractor.
|
|
3
|
+
*
|
|
4
|
+
* These types describe the per-file extraction outputs that
|
|
5
|
+
* {@link ../../scan/extract-models/index.ts} stitches together into
|
|
6
|
+
* {@link FirebaseModel} / {@link FirebaseModelGroup} entries.
|
|
7
|
+
*/
|
|
8
|
+
import type { FirestoreCollectionKind } from '../../registry/firebase-models.js';
|
|
9
|
+
/**
|
|
10
|
+
* One `firestoreModelIdentity(...)` declaration.
|
|
11
|
+
*/
|
|
12
|
+
export interface ExtractedIdentity {
|
|
13
|
+
readonly identityConst: string;
|
|
14
|
+
readonly modelType: string;
|
|
15
|
+
readonly collectionPrefix: string | undefined;
|
|
16
|
+
readonly parentIdentityConst: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One field declared on an interface body. Captures the JSDoc
|
|
20
|
+
* description plus the explicit `@dbxModelVariable` long-name tag and
|
|
21
|
+
* the optional `@dbxModelVariableSyncFlag` sync-description tag.
|
|
22
|
+
*/
|
|
23
|
+
export interface ExtractedInterfaceProp {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly tsType: string;
|
|
26
|
+
readonly optional: boolean;
|
|
27
|
+
readonly description: string | undefined;
|
|
28
|
+
readonly longName: string | undefined;
|
|
29
|
+
readonly syncFlag: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parsed `@dbxModelArchetype <slug>[ axisKey=val,...]` JSDoc override.
|
|
33
|
+
* Mirrors the `.mjs` extractor's `parseArchetypeTagValue` output.
|
|
34
|
+
*/
|
|
35
|
+
export interface ExtractedArchetypeTag {
|
|
36
|
+
readonly slug: string;
|
|
37
|
+
readonly axes: {
|
|
38
|
+
readonly [key: string]: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parsed `@dbxModelCompositeKey from=<ModelA>,<ModelB> encoding=<two-way|one-way>`
|
|
43
|
+
* JSDoc tag, applied to interfaces whose Firestore doc id is a composite-flat-key
|
|
44
|
+
* encoding of one or more source model keys. `from=*` is the wildcard form used
|
|
45
|
+
* by framework models that accept any source identity (e.g. `NotificationBox`).
|
|
46
|
+
*/
|
|
47
|
+
export interface ExtractedCompositeKeyTag {
|
|
48
|
+
/**
|
|
49
|
+
* `'*'` for the wildcard form, or an ordered list of source-model names
|
|
50
|
+
* (interface name, identity const name, or modelType — same resolution as
|
|
51
|
+
* `getFirebaseModel`). Empty array when the tag is malformed (missing `from=`).
|
|
52
|
+
*/
|
|
53
|
+
readonly from: readonly string[] | '*';
|
|
54
|
+
/**
|
|
55
|
+
* `'two-way'` for `twoWayFlatFirestoreModelKey` encoding, `'one-way'` for
|
|
56
|
+
* `flatFirestoreModelKey`. `undefined` when the tag is malformed.
|
|
57
|
+
*/
|
|
58
|
+
readonly encoding: 'two-way' | 'one-way' | undefined;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Allowed `@dbxModelRead` levels. Three statically-inferable cases plus the `permissions`
|
|
62
|
+
* escape hatch for any non-trivial computed read grant. Mirrors the ESLint rule's
|
|
63
|
+
* `READ_LEVEL_VALUES` (see `require-dbx-model-companion-tags.rule.ts`).
|
|
64
|
+
*/
|
|
65
|
+
export type DbxModelReadLevel = 'system' | 'owner' | 'admin-only' | 'permissions';
|
|
66
|
+
/**
|
|
67
|
+
* JSDoc-derived tag bag attached to one `export interface` declaration.
|
|
68
|
+
* `dbxModelArchetypes` is repeatable — every `@dbxModelArchetype` occurrence
|
|
69
|
+
* appends to the array. `dbxModelAggregatesFrom` is also repeatable.
|
|
70
|
+
* `dbxModelOrganizationalGroupRoot` is a boolean presence flag.
|
|
71
|
+
* `dbxModelCompositeKey` is at most one per interface — if multiple are
|
|
72
|
+
* declared, only the first is captured and the rest produce validation
|
|
73
|
+
* findings. `dbxModelRead` is at most one per interface; invalid values are
|
|
74
|
+
* dropped silently (the ESLint rule is the user-facing gate).
|
|
75
|
+
*/
|
|
76
|
+
export interface ExtractedInterfaceTags {
|
|
77
|
+
readonly dbxModel: boolean;
|
|
78
|
+
readonly dbxModelSubObject: boolean;
|
|
79
|
+
readonly dbxModelArchetypes: readonly ExtractedArchetypeTag[];
|
|
80
|
+
readonly dbxModelAggregatesFrom: readonly string[];
|
|
81
|
+
readonly dbxModelOrganizationalGroupRoot: boolean;
|
|
82
|
+
readonly dbxModelCompositeKey?: ExtractedCompositeKeyTag;
|
|
83
|
+
readonly dbxModelRead?: DbxModelReadLevel;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* One `export interface` declaration. The `tags` flags drive model
|
|
87
|
+
* detection (`@dbxModel`) and embedded-sub-object detection
|
|
88
|
+
* (`@dbxModelSubObject` — interfaces persisted as part of a parent
|
|
89
|
+
* model's converter via `firestoreSubObject<T>`, lacking their own
|
|
90
|
+
* `firestoreModelIdentity`). `dbxModelArchetypes` carries any explicit
|
|
91
|
+
* archetype-slug overrides; the heuristic only runs when the array is empty.
|
|
92
|
+
*/
|
|
93
|
+
export interface ExtractedInterface {
|
|
94
|
+
readonly name: string;
|
|
95
|
+
readonly description: string | undefined;
|
|
96
|
+
readonly tags: ExtractedInterfaceTags;
|
|
97
|
+
readonly extendsNames: readonly string[];
|
|
98
|
+
readonly props: readonly ExtractedInterfaceProp[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* One `<x>Converter = snapshotConverterFunctions<<X>>({ fields: { ... } })`
|
|
102
|
+
* declaration. The `fields` array preserves the canonical persisted name.
|
|
103
|
+
*/
|
|
104
|
+
export interface ExtractedConverter {
|
|
105
|
+
readonly converterConst: string;
|
|
106
|
+
readonly interfaceName: string;
|
|
107
|
+
readonly fields: readonly {
|
|
108
|
+
readonly key: string;
|
|
109
|
+
readonly converter: string;
|
|
110
|
+
}[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* One enum value with its persisted integer/string and JSDoc paragraph.
|
|
114
|
+
*/
|
|
115
|
+
export interface ExtractedEnumValue {
|
|
116
|
+
readonly name: string;
|
|
117
|
+
readonly value: number | string;
|
|
118
|
+
readonly description: string | undefined;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* One `export enum` declaration.
|
|
122
|
+
*/
|
|
123
|
+
export interface ExtractedEnum {
|
|
124
|
+
readonly name: string;
|
|
125
|
+
readonly values: readonly ExtractedEnumValue[];
|
|
126
|
+
readonly description: string | undefined;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* One `<X>FirestoreCollections` container tagged with `@dbxModelGroup`.
|
|
130
|
+
*/
|
|
131
|
+
export interface ExtractedModelGroup {
|
|
132
|
+
readonly name: string;
|
|
133
|
+
readonly containerName: string;
|
|
134
|
+
readonly description: string | undefined;
|
|
135
|
+
readonly modelNames: readonly string[];
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Map of `<modelType>FirestoreCollection(Factory)?` factory function names to
|
|
139
|
+
* the {@link FirestoreCollectionKind} their body declares.
|
|
140
|
+
*/
|
|
141
|
+
export type ExtractedFactoryKindMap = ReadonlyMap<string, FirestoreCollectionKind>;
|
|
142
|
+
/**
|
|
143
|
+
* One `export const <name> = firestoreSubObject<T>(...)` /
|
|
144
|
+
* `firestoreObjectArray<T>(...)` / `firestoreMap<T>(...)` declaration. The
|
|
145
|
+
* registered `interfaceName` is the bare type-argument (`T`); the
|
|
146
|
+
* `factoryName` discriminates the call shape so the catalog can surface
|
|
147
|
+
* an `array` or `map` annotation when rendering the embedded sub-object.
|
|
148
|
+
*/
|
|
149
|
+
export interface ExtractedSubObjectConst {
|
|
150
|
+
readonly constName: string;
|
|
151
|
+
readonly interfaceName: string;
|
|
152
|
+
readonly factoryName: 'firestoreSubObject' | 'firestoreObjectArray' | 'firestoreMap';
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* One `@dbxModelServiceFactory <modelType>`-tagged variable export. The model extractor
|
|
156
|
+
* joins these onto matching {@link ExtractedInterface}s by `modelType` so each
|
|
157
|
+
* {@link FirebaseModel} entry surfaces the factory that implements it.
|
|
158
|
+
*/
|
|
159
|
+
export interface ExtractedServiceFactory {
|
|
160
|
+
/**
|
|
161
|
+
* The `FirestoreModelIdentity.modelType` string declared by the tag (e.g. `guestbook`,
|
|
162
|
+
* `guestbookEntry`). Only camelCase identifiers are emitted — invalid values are dropped
|
|
163
|
+
* silently at scan time.
|
|
164
|
+
*/
|
|
165
|
+
readonly modelType: string;
|
|
166
|
+
/**
|
|
167
|
+
* Name of the exported binding the factory call was assigned to
|
|
168
|
+
* (e.g. `guestbookFirebaseModelServiceFactory`).
|
|
169
|
+
*/
|
|
170
|
+
readonly exportName: string;
|
|
171
|
+
}
|