@metaobjectsdev/codegen-ts 0.24.5 → 0.25.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 (237) hide show
  1. package/README.md +37 -12
  2. package/dist/api-surface.d.ts +29 -0
  3. package/dist/api-surface.d.ts.map +1 -1
  4. package/dist/api-surface.js +47 -0
  5. package/dist/api-surface.js.map +1 -1
  6. package/dist/column-mapper.d.ts +12 -0
  7. package/dist/column-mapper.d.ts.map +1 -1
  8. package/dist/column-mapper.js +1 -0
  9. package/dist/column-mapper.js.map +1 -1
  10. package/dist/constants.d.ts +24 -11
  11. package/dist/constants.d.ts.map +1 -1
  12. package/dist/constants.js +54 -19
  13. package/dist/constants.js.map +1 -1
  14. package/dist/db-emitting.d.ts +6 -0
  15. package/dist/db-emitting.d.ts.map +1 -0
  16. package/dist/db-emitting.js +26 -0
  17. package/dist/db-emitting.js.map +1 -0
  18. package/dist/generator-registry.d.ts.map +1 -1
  19. package/dist/generator-registry.js +7 -1
  20. package/dist/generator-registry.js.map +1 -1
  21. package/dist/generator.d.ts +5 -0
  22. package/dist/generator.d.ts.map +1 -1
  23. package/dist/generator.js.map +1 -1
  24. package/dist/generators/agent-docs-file.d.ts +19 -0
  25. package/dist/generators/agent-docs-file.d.ts.map +1 -0
  26. package/dist/generators/agent-docs-file.js +257 -0
  27. package/dist/generators/agent-docs-file.js.map +1 -0
  28. package/dist/generators/agent-requirements-page.d.ts +22 -0
  29. package/dist/generators/agent-requirements-page.d.ts.map +1 -0
  30. package/dist/generators/agent-requirements-page.js +175 -0
  31. package/dist/generators/agent-requirements-page.js.map +1 -0
  32. package/dist/generators/agent-schema-input.d.ts +69 -0
  33. package/dist/generators/agent-schema-input.d.ts.map +1 -0
  34. package/dist/generators/agent-schema-input.js +23 -0
  35. package/dist/generators/agent-schema-input.js.map +1 -0
  36. package/dist/generators/agent-schema-page.d.ts +21 -0
  37. package/dist/generators/agent-schema-page.d.ts.map +1 -0
  38. package/dist/generators/agent-schema-page.js +241 -0
  39. package/dist/generators/agent-schema-page.js.map +1 -0
  40. package/dist/generators/agent-ui-page.d.ts +22 -0
  41. package/dist/generators/agent-ui-page.d.ts.map +1 -0
  42. package/dist/generators/agent-ui-page.js +253 -0
  43. package/dist/generators/agent-ui-page.js.map +1 -0
  44. package/dist/generators/api-docs-file.d.ts.map +1 -1
  45. package/dist/generators/api-docs-file.js +13 -6
  46. package/dist/generators/api-docs-file.js.map +1 -1
  47. package/dist/generators/api-model.d.ts +6 -0
  48. package/dist/generators/api-model.d.ts.map +1 -1
  49. package/dist/generators/api-model.js +54 -35
  50. package/dist/generators/api-model.js.map +1 -1
  51. package/dist/generators/callable-file.js +1 -1
  52. package/dist/generators/callable-file.js.map +1 -1
  53. package/dist/generators/docs-data-builder.d.ts.map +1 -1
  54. package/dist/generators/docs-data-builder.js +47 -2
  55. package/dist/generators/docs-data-builder.js.map +1 -1
  56. package/dist/generators/docs-data.d.ts +6 -2
  57. package/dist/generators/docs-data.d.ts.map +1 -1
  58. package/dist/generators/index.d.ts +3 -0
  59. package/dist/generators/index.d.ts.map +1 -1
  60. package/dist/generators/index.js +4 -0
  61. package/dist/generators/index.js.map +1 -1
  62. package/dist/generators/names-file.d.ts +17 -0
  63. package/dist/generators/names-file.d.ts.map +1 -0
  64. package/dist/generators/names-file.js +95 -0
  65. package/dist/generators/names-file.js.map +1 -0
  66. package/dist/generators/requirements-markdown.d.ts +18 -1
  67. package/dist/generators/requirements-markdown.d.ts.map +1 -1
  68. package/dist/generators/requirements-markdown.js +11 -9
  69. package/dist/generators/requirements-markdown.js.map +1 -1
  70. package/dist/generators/routes-file-hono.d.ts +17 -2
  71. package/dist/generators/routes-file-hono.d.ts.map +1 -1
  72. package/dist/generators/routes-file-hono.js +9 -11
  73. package/dist/generators/routes-file-hono.js.map +1 -1
  74. package/dist/generators/routes-file.d.ts +17 -2
  75. package/dist/generators/routes-file.d.ts.map +1 -1
  76. package/dist/generators/routes-file.js +10 -8
  77. package/dist/generators/routes-file.js.map +1 -1
  78. package/dist/generators/template-generator.d.ts.map +1 -1
  79. package/dist/generators/template-generator.js +20 -6
  80. package/dist/generators/template-generator.js.map +1 -1
  81. package/dist/index.d.ts +18 -4
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +35 -3
  84. package/dist/index.js.map +1 -1
  85. package/dist/metaobjects-config.d.ts +38 -1
  86. package/dist/metaobjects-config.d.ts.map +1 -1
  87. package/dist/metaobjects-config.js +9 -1
  88. package/dist/metaobjects-config.js.map +1 -1
  89. package/dist/names.d.ts +275 -0
  90. package/dist/names.d.ts.map +1 -0
  91. package/dist/names.js +434 -0
  92. package/dist/names.js.map +1 -0
  93. package/dist/overwrite-policy.d.ts.map +1 -1
  94. package/dist/overwrite-policy.js +15 -3
  95. package/dist/overwrite-policy.js.map +1 -1
  96. package/dist/projection/extract-view-spec.d.ts +25 -1
  97. package/dist/projection/extract-view-spec.d.ts.map +1 -1
  98. package/dist/projection/extract-view-spec.js +79 -6
  99. package/dist/projection/extract-view-spec.js.map +1 -1
  100. package/dist/reference-templates.d.ts +1 -1
  101. package/dist/reference-templates.d.ts.map +1 -1
  102. package/dist/reference-templates.js +1 -1
  103. package/dist/reference-templates.js.map +1 -1
  104. package/dist/render-context.d.ts +12 -1
  105. package/dist/render-context.d.ts.map +1 -1
  106. package/dist/render-context.js +1 -0
  107. package/dist/render-context.js.map +1 -1
  108. package/dist/retired-codegen-attrs.d.ts +32 -0
  109. package/dist/retired-codegen-attrs.d.ts.map +1 -0
  110. package/dist/retired-codegen-attrs.js +47 -0
  111. package/dist/retired-codegen-attrs.js.map +1 -0
  112. package/dist/routes-expose.d.ts +63 -0
  113. package/dist/routes-expose.d.ts.map +1 -0
  114. package/dist/routes-expose.js +57 -0
  115. package/dist/routes-expose.js.map +1 -0
  116. package/dist/runner.d.ts +18 -0
  117. package/dist/runner.d.ts.map +1 -1
  118. package/dist/runner.js +109 -7
  119. package/dist/runner.js.map +1 -1
  120. package/dist/templates/callable-file.d.ts +7 -2
  121. package/dist/templates/callable-file.d.ts.map +1 -1
  122. package/dist/templates/callable-file.js +54 -9
  123. package/dist/templates/callable-file.js.map +1 -1
  124. package/dist/templates/drizzle-schema.d.ts.map +1 -1
  125. package/dist/templates/drizzle-schema.js +236 -65
  126. package/dist/templates/drizzle-schema.js.map +1 -1
  127. package/dist/templates/entity-constants.d.ts +15 -6
  128. package/dist/templates/entity-constants.d.ts.map +1 -1
  129. package/dist/templates/entity-constants.js +85 -161
  130. package/dist/templates/entity-constants.js.map +1 -1
  131. package/dist/templates/entity-file.d.ts.map +1 -1
  132. package/dist/templates/entity-file.js +38 -4
  133. package/dist/templates/entity-file.js.map +1 -1
  134. package/dist/templates/entity-meta-file.d.ts +15 -1
  135. package/dist/templates/entity-meta-file.d.ts.map +1 -1
  136. package/dist/templates/entity-meta-file.js +12 -2
  137. package/dist/templates/entity-meta-file.js.map +1 -1
  138. package/dist/templates/entity-ui-descriptor.d.ts +112 -0
  139. package/dist/templates/entity-ui-descriptor.d.ts.map +1 -0
  140. package/dist/templates/entity-ui-descriptor.js +238 -0
  141. package/dist/templates/entity-ui-descriptor.js.map +1 -0
  142. package/dist/templates/field-meta.d.ts +46 -9
  143. package/dist/templates/field-meta.d.ts.map +1 -1
  144. package/dist/templates/field-meta.js +95 -21
  145. package/dist/templates/field-meta.js.map +1 -1
  146. package/dist/templates/names-decl.d.ts +38 -0
  147. package/dist/templates/names-decl.d.ts.map +1 -0
  148. package/dist/templates/names-decl.js +104 -0
  149. package/dist/templates/names-decl.js.map +1 -0
  150. package/dist/templates/projection-decl.d.ts +21 -0
  151. package/dist/templates/projection-decl.d.ts.map +1 -1
  152. package/dist/templates/projection-decl.js +53 -29
  153. package/dist/templates/projection-decl.js.map +1 -1
  154. package/dist/templates/queries-file.d.ts.map +1 -1
  155. package/dist/templates/queries-file.js +17 -2
  156. package/dist/templates/queries-file.js.map +1 -1
  157. package/dist/templates/requirement-test.d.ts.map +1 -1
  158. package/dist/templates/requirement-test.js +13 -2
  159. package/dist/templates/requirement-test.js.map +1 -1
  160. package/dist/templates/routes-file-hono.d.ts +2 -1
  161. package/dist/templates/routes-file-hono.d.ts.map +1 -1
  162. package/dist/templates/routes-file-hono.js +11 -2
  163. package/dist/templates/routes-file-hono.js.map +1 -1
  164. package/dist/templates/routes-file.d.ts +2 -1
  165. package/dist/templates/routes-file.d.ts.map +1 -1
  166. package/dist/templates/routes-file.js +54 -21
  167. package/dist/templates/routes-file.js.map +1 -1
  168. package/dist/templates/value-object-file.d.ts.map +1 -1
  169. package/dist/templates/value-object-file.js +15 -1
  170. package/dist/templates/value-object-file.js.map +1 -1
  171. package/dist/templates/view-decl.d.ts +37 -1
  172. package/dist/templates/view-decl.d.ts.map +1 -1
  173. package/dist/templates/view-decl.js +27 -3
  174. package/dist/templates/view-decl.js.map +1 -1
  175. package/dist/templates/zod-validators.d.ts +21 -0
  176. package/dist/templates/zod-validators.d.ts.map +1 -1
  177. package/dist/templates/zod-validators.js +40 -5
  178. package/dist/templates/zod-validators.js.map +1 -1
  179. package/dist/view-context.d.ts +24 -0
  180. package/dist/view-context.d.ts.map +1 -0
  181. package/dist/view-context.js +81 -0
  182. package/dist/view-context.js.map +1 -0
  183. package/package.json +6 -6
  184. package/src/api-surface.ts +53 -0
  185. package/src/column-mapper.ts +13 -0
  186. package/src/constants.ts +91 -16
  187. package/src/db-emitting.ts +31 -0
  188. package/src/generator-registry.ts +7 -0
  189. package/src/generator.ts +5 -0
  190. package/src/generators/agent-docs-file.ts +297 -0
  191. package/src/generators/agent-requirements-page.ts +199 -0
  192. package/src/generators/agent-schema-input.ts +88 -0
  193. package/src/generators/agent-schema-page.ts +297 -0
  194. package/src/generators/agent-ui-page.ts +290 -0
  195. package/src/generators/api-docs-file.ts +13 -6
  196. package/src/generators/api-model.ts +63 -34
  197. package/src/generators/callable-file.ts +1 -1
  198. package/src/generators/docs-data-builder.ts +46 -2
  199. package/src/generators/docs-data.ts +6 -2
  200. package/src/generators/index.ts +10 -0
  201. package/src/generators/names-file.ts +98 -0
  202. package/src/generators/requirements-markdown.ts +36 -2
  203. package/src/generators/routes-file-hono.ts +19 -10
  204. package/src/generators/routes-file.ts +20 -7
  205. package/src/generators/template-generator.ts +20 -6
  206. package/src/index.ts +57 -4
  207. package/src/metaobjects-config.ts +48 -2
  208. package/src/names.ts +630 -0
  209. package/src/overwrite-policy.ts +15 -3
  210. package/src/projection/extract-view-spec.ts +85 -6
  211. package/src/reference/entity.ts +21 -2
  212. package/src/reference/names.ts +125 -0
  213. package/src/reference/queries.ts +9 -2
  214. package/src/reference/routes-hono.ts +19 -9
  215. package/src/reference/routes.ts +25 -9
  216. package/src/reference-templates.ts +1 -1
  217. package/src/render-context.ts +13 -1
  218. package/src/retired-codegen-attrs.ts +52 -0
  219. package/src/routes-expose.ts +86 -0
  220. package/src/runner.ts +122 -11
  221. package/src/templates/callable-file.ts +60 -8
  222. package/src/templates/drizzle-schema.ts +248 -60
  223. package/src/templates/entity-constants.ts +95 -184
  224. package/src/templates/entity-file.ts +46 -4
  225. package/src/templates/entity-meta-file.ts +16 -3
  226. package/src/templates/entity-ui-descriptor.ts +305 -0
  227. package/src/templates/field-meta.ts +100 -19
  228. package/src/templates/names-decl.ts +165 -0
  229. package/src/templates/projection-decl.ts +72 -31
  230. package/src/templates/queries-file.ts +17 -2
  231. package/src/templates/requirement-test.ts +13 -2
  232. package/src/templates/routes-file-hono.ts +14 -2
  233. package/src/templates/routes-file.ts +69 -24
  234. package/src/templates/value-object-file.ts +15 -1
  235. package/src/templates/view-decl.ts +53 -3
  236. package/src/templates/zod-validators.ts +41 -5
  237. package/src/view-context.ts +88 -0
package/dist/names.js ADDED
@@ -0,0 +1,434 @@
1
+ /**
2
+ * §A2/§A3 — the ONE place a data name is resolved for a generator run.
3
+ *
4
+ * Both the names artifact (namesFile) and the entity generator that consumes it call this,
5
+ * so the constant and the binding it describes cannot be produced by different resolvers or
6
+ * different arguments. That is the whole rule; a name computed twice is a name that can
7
+ * disagree with itself.
8
+ */
9
+ import { primaryRdbSource, resolveColumnName, resolveIndexName, resolveTableSchema, isMetaObject, isMetaSource, PHYSICAL_NAME_ATTR_BY_KIND, SOURCE_ATTR_SCHEMA, SOURCE_ROLE_PRIMARY, TYPE_INDEX, TYPE_OBJECT, TYPE_SOURCE, } from "@metaobjectsdev/metadata";
10
+ import { code, imp } from "ts-poet";
11
+ import { crossEntitySpecifier } from "./import-path.js";
12
+ /**
13
+ * One source node's names, keyed by the metamodel's own kind→alias map.
14
+ *
15
+ * `readOnly` is deliberately NOT carried, and its removal is the shape's own rule applied
16
+ * to itself: it is not metadata at all but a derivation over `@kind` (`source.isReadOnly()`),
17
+ * and a sweep of all five ports found ZERO consumers, generated or hand-written. An
18
+ * artifact that mirrors the metadata tree carries what was declared; a reader who wants
19
+ * read-only-ness asks `kind`, which is the thing the author actually wrote.
20
+ */
21
+ function sourceNamesOf(source) {
22
+ const kind = source.effectiveKind;
23
+ // The metamodel's map, never a local switch: a sixth @kind must not need an edit here to
24
+ // be spelled correctly, and a local copy is a second answer to a question that has one.
25
+ const alias = PHYSICAL_NAME_ATTR_BY_KIND.get(kind);
26
+ const schema = source.attr(SOURCE_ATTR_SCHEMA);
27
+ return {
28
+ type: TYPE_SOURCE,
29
+ subType: source.subType,
30
+ kind,
31
+ ...(typeof schema === "string" && schema !== "" ? { schema } : {}),
32
+ ...(alias === undefined ? {} : { [alias]: source.physicalName }),
33
+ };
34
+ }
35
+ /** Every `source.rdb` child of `obj`, keyed by effective role. */
36
+ function sourcesOf(sources, where) {
37
+ const out = {};
38
+ for (const src of sources) {
39
+ const role = src.role;
40
+ const resolved = sourceNamesOf(src);
41
+ const existing = out[role];
42
+ if (existing === undefined) {
43
+ out[role] = resolved;
44
+ continue;
45
+ }
46
+ // The refusal is about DISAGREEMENT, not about the count. An abstract base and the
47
+ // child that extends it may each declare a `@role: primary` source naming the same
48
+ // relation; that is legal and stays legal, because the records then compare equal.
49
+ //
50
+ // Two sources in one role that resolve DIFFERENTLY is the real problem, and silently
51
+ // keeping one is the `dropped` failure mode this artifact makes impossible: the second
52
+ // name is carried nowhere, read by nobody, and the binding quietly takes the first's.
53
+ //
54
+ // WHAT IS COMPARED, AND HOW IT DIFFERS FROM `primaryRdbSource`. This compares the whole
55
+ // resolved record — kind, schema and the physical name under its alias — for EVERY
56
+ // role. `primaryRdbSource` compares the bare physical name, and only for `primary`.
57
+ // This comment used to claim the two were "deliberately the SAME rule"; they are not,
58
+ // and the gap is reachable: two `@role: primary` sources agreeing on `@table` but
59
+ // disagreeing on `@schema` load with zero errors, are accepted by `primaryRdbSource`,
60
+ // and are refused here — so `meta gen` fails on a model every other door admits.
61
+ //
62
+ // The strict half is the defensible one: a schema is part of the address, so those two
63
+ // sources name DIFFERENT tables and "every consumer binds ONE name" is not satisfied
64
+ // merely because the unqualified names match. Loosening this to match would enshrine
65
+ // that. Tightening `primaryRdbSource` instead is the real fix and is deliberately NOT
66
+ // made here: it is the shared authority, implemented in all five ports, and a model
67
+ // that loads today would begin to throw. `names.test.ts` pins BOTH sides of the
68
+ // divergence so it stays visible until it is decided.
69
+ if (JSON.stringify(existing) !== JSON.stringify(resolved)) {
70
+ throw new Error(`${where} declares more than one source.rdb with @role: "${role}", and they do ` +
71
+ `not agree: ${JSON.stringify(existing)} vs ${JSON.stringify(resolved)}. The names ` +
72
+ `artifact keys sources by role, so the second has nowhere to go.`);
73
+ }
74
+ }
75
+ return out;
76
+ }
77
+ /** Every `source.rdb` child of `obj`. `own` restricts to those declared here. */
78
+ function rdbSourcesOf(obj, own) {
79
+ // ADR-0039: children() resolves through `extends`; ownChildren() is the sanctioned
80
+ // own-only twin for "what does THIS artifact declare".
81
+ const kids = own ? obj.ownChildren() : obj.children();
82
+ return kids.filter((c) => isMetaSource(c));
83
+ }
84
+ /** Every `identity.*` / `index.*` child, keyed by metamodel name. */
85
+ function keysOf(nodes) {
86
+ const out = {};
87
+ for (const node of nodes) {
88
+ // resolveIndexName owns BOTH the package strip and the empty-name refusal, so the
89
+ // artifact and the DDL cannot disagree about what an index is called — and an
90
+ // `index.lookup` with an empty name (which the loader accepts, unlike an identity)
91
+ // fails here instead of reaching an emitter.
92
+ const hasIndexName = INDEX_NAMED_SUBTYPES.has(`${node.type}.${node.subType}`);
93
+ out[node.name] = {
94
+ type: node.type,
95
+ subType: node.subType,
96
+ name: node.name,
97
+ ...(hasIndexName ? { index: resolveIndexName(node) } : {}),
98
+ };
99
+ }
100
+ return out;
101
+ }
102
+ /**
103
+ * The nodes whose database index name the artifact carries.
104
+ *
105
+ * A closed set rather than "anything with a name", because the rule is narrow and worth
106
+ * stating: the artifact carries a physical name only where ONE resolver, shared by codegen
107
+ * and migrate, produces it. `identity.primary` and `identity.reference` have names that are
108
+ * addressing handles, not database names — see {@link KeyNames}.
109
+ */
110
+ const INDEX_NAMED_SUBTYPES = new Set([
111
+ "identity.secondary",
112
+ "index.lookup",
113
+ ]);
114
+ /**
115
+ * Whether `obj` DECLARES anything a names artifact carries.
116
+ *
117
+ * One predicate, because the artifact has four collections and the two places that ask
118
+ * this question must agree about all four. They used to ask about fields alone, and the
119
+ * cost was precise: an intermediate abstract declaring only an `identity.secondary` — a
120
+ * key hoisted onto a chain, which is the whole reason such a node exists — answered "no".
121
+ * {@link namesArtifactSuperOf} then walked past it and {@link resolveSuperFragmentNames}
122
+ * emitted nothing for it, so its key appeared in NEITHER the child's own set nor the
123
+ * grandparent's spread. `drizzle-schema.ts` still emitted `uniqueIndex(<E>Names.
124
+ * identities.<key>.index)` against it, and the generated code did not compile.
125
+ *
126
+ * ADR-0039's sanctioned own-accessor use: the question is what this node declares, not
127
+ * what it can see. An inherited key belongs to the ancestor that declared it, and is
128
+ * reached through that ancestor's artifact.
129
+ */
130
+ function declaresNamesContent(obj) {
131
+ return obj.ownFields().length > 0 ||
132
+ obj.ownIdentities().length > 0 ||
133
+ obj.ownLookupIndexes().length > 0;
134
+ }
135
+ /**
136
+ * The nearest ancestor of `obj` that carries a names artifact of its own, or undefined.
137
+ *
138
+ * Walks past an ancestor with nothing to contribute — an abstract marker with no fields,
139
+ * no keys and no source emits no artifact, so there is nothing to extend and the search
140
+ * continues upward rather than stopping at a name that does not exist.
141
+ */
142
+ export function namesArtifactSuperOf(obj) {
143
+ let cur = obj.superData;
144
+ while (cur !== undefined) {
145
+ // The exported guard, never `as MetaObject` and never a duck-type check on a method
146
+ // name: `superData` is only a MetaData, and CLAUDE.md makes this the required
147
+ // mechanism — two physical copies of the package in one process give a class object
148
+ // and an instance different identities, so `instanceof` returns false for a real node.
149
+ if (isMetaObject(cur) && (declaresNamesContent(cur) || primaryRdbSource(cur) !== undefined)) {
150
+ return cur;
151
+ }
152
+ cur = cur.superData;
153
+ }
154
+ return undefined;
155
+ }
156
+ export function resolveObjectNames(obj, strategy) {
157
+ // #248: an object participates in the database iff it declares (or inherits) a primary
158
+ // source. Never gate on the object subtype. ADR-0039: resolving children().
159
+ //
160
+ // primaryRdbSource, not a scan of our own: it is THE primary-source lookup for the whole
161
+ // toolchain, and it carries the divergence refusal that used to live in this function
162
+ // (see below). A second scan here would be a lookup written twice — the same defect one
163
+ // level down from the one this file exists to prevent (a NAME resolved twice).
164
+ const source = primaryRdbSource(obj);
165
+ if (source === undefined)
166
+ return undefined;
167
+ const ownFieldList = obj.ownFields();
168
+ const fields = {};
169
+ // ADR-0039: fields() is the RESOLVING accessor — inherited fields must appear, and an
170
+ // inherited @column must resolve, or the constant disagrees with the DDL.
171
+ for (const f of obj.fields()) {
172
+ fields[f.name] = { name: f.name, column: resolveColumnName(f, strategy) };
173
+ }
174
+ // ADR-0039's sanctioned own-accessor use: what this artifact DECLARES. See ObjectNames.
175
+ const ownFields = {};
176
+ for (const f of ownFieldList) {
177
+ ownFields[f.name] = { name: f.name, column: resolveColumnName(f, strategy) };
178
+ }
179
+ const superObj = namesArtifactSuperOf(obj);
180
+ const superNames = superObj === undefined
181
+ ? undefined
182
+ : { name: superObj.name, package: superObj.package };
183
+ // Identity of the resolved source NODE, not equality of the resolved strings: a
184
+ // divergence guard is exactly what this codebase forbids here, and the question being
185
+ // asked is structural — did this object declare a source, or is it using its parent's?
186
+ const inheritsSource = source !== undefined && superObj !== undefined &&
187
+ primaryRdbSource(superObj) === source;
188
+ // Read the physical name off the primary SOURCE ALREADY IN HAND rather than calling
189
+ // resolveTableName() for it. Both now delegate to primaryRdbSource, so this is no longer
190
+ // about avoiding a second, differently-written lookup — it is that resolveTableName adds
191
+ // a no-source FALLBACK (pluralize(snake(name))) this function must not take: an object
192
+ // with no primary source returns undefined above, and must never acquire a table name it
193
+ // never declared. Mirrors the C# port (CSharpNaming.ResolveObjectNames).
194
+ const name = source.physicalName;
195
+ // The divergence refusal — an object whose @role: primary sources resolve to more than
196
+ // one physical name — used to live HERE, and that was the defect. Every consumer
197
+ // downstream references this name unconditionally (no per-site equality guard; see
198
+ // drizzle-schema.ts), but this function runs only when the `names` generator is in the
199
+ // run, so with namesFile() unwired nothing refused at all: `meta migrate` emitted DDL
200
+ // against the PARENT's table and ObjectManager read and wrote it, silently, on every
201
+ // run. A refusal that depends on which consumer asked is not a refusal.
202
+ //
203
+ // It now lives in primaryRdbSource (@metaobjectsdev/metadata's naming.ts), called
204
+ // above, so resolveTableName, resolveTableSchema, MetaObject.dbTable and this function
205
+ // all inherit it from one implementation. See that function's doc for the reachability
206
+ // analysis — the shape loads with ZERO errors — and for why the check must be
207
+ // DIRECTION-BLIND rather than comparing against the first primary WRITABLE source.
208
+ // names.test.ts pins both directions through this entry point; naming.test.ts (in
209
+ // @metaobjectsdev/metadata) pins the other three doors.
210
+ return {
211
+ type: TYPE_OBJECT,
212
+ subType: obj.subType,
213
+ // The object's OWN name. `source.physicalName` (resolved above as `name`) is now
214
+ // reached through `sources.<role>.<alias>`, which is the point of the restructure:
215
+ // one key stopped meaning a table, a view and a procedure depending on the object.
216
+ name: obj.name,
217
+ sources: sourcesOf(rdbSourcesOf(obj, false), obj.name),
218
+ ownSources: sourcesOf(rdbSourcesOf(obj, true), obj.name),
219
+ fields,
220
+ ownFields,
221
+ identities: keysOf(obj.identities()),
222
+ ownIdentities: keysOf(obj.ownIdentities()),
223
+ indexes: keysOf(obj.lookupIndexes()),
224
+ ownIndexes: keysOf(obj.ownLookupIndexes()),
225
+ superNames,
226
+ inheritsSource,
227
+ };
228
+ }
229
+ /**
230
+ * The names FRAGMENT for an object that a sourced object extends but which declares no
231
+ * source of its own — the `BaseEntity` pattern: shared fields, no table.
232
+ *
233
+ * Separate from {@link resolveObjectNames} on purpose, and the separation is the #248 rule
234
+ * intact rather than weakened. "Has a primary source" still decides whether an object is a
235
+ * database participant, so an `object.value` carrying fields resolves to nothing here as it
236
+ * always has. A fragment is emitted only for an object REACHED from a participant by
237
+ * walking `extends` upward — which is the only context in which its fields are columns at
238
+ * all. It carries no `kind`/`name`/`readOnly`, because it has no physical name and must
239
+ * never acquire one.
240
+ *
241
+ * Returns undefined when the object declares nothing of its own: an abstract marker has
242
+ * nothing to extend, and emitting an empty artifact for it would put a name in the import
243
+ * graph that says nothing. "Nothing" is {@link declaresNamesContent} — fields OR keys, the
244
+ * same question {@link namesArtifactSuperOf} asks, so the walk and the emit cannot disagree
245
+ * about which ancestors exist.
246
+ */
247
+ export function resolveSuperFragmentNames(obj, strategy) {
248
+ if (!declaresNamesContent(obj))
249
+ return undefined;
250
+ const ownFieldList = obj.ownFields();
251
+ const fields = {};
252
+ for (const f of obj.fields()) {
253
+ fields[f.name] = { name: f.name, column: resolveColumnName(f, strategy) };
254
+ }
255
+ const ownFields = {};
256
+ for (const f of ownFieldList) {
257
+ ownFields[f.name] = { name: f.name, column: resolveColumnName(f, strategy) };
258
+ }
259
+ const superObj = namesArtifactSuperOf(obj);
260
+ return {
261
+ type: TYPE_OBJECT,
262
+ subType: obj.subType,
263
+ name: obj.name,
264
+ // Empty, and emitted as empty rather than omitted: a child spreads `...Super.sources`
265
+ // unconditionally, so the key has to exist. A fragment declares no source and must
266
+ // never acquire a physical name it never wrote.
267
+ sources: {},
268
+ ownSources: {},
269
+ fields,
270
+ ownFields,
271
+ identities: keysOf(obj.identities()),
272
+ ownIdentities: keysOf(obj.ownIdentities()),
273
+ indexes: keysOf(obj.lookupIndexes()),
274
+ ownIndexes: keysOf(obj.ownLookupIndexes()),
275
+ superNames: superObj === undefined
276
+ ? undefined
277
+ : { name: superObj.name, package: superObj.package },
278
+ inheritsSource: false,
279
+ };
280
+ }
281
+ /**
282
+ * §B2 — the shared builder every `<Object>Names` reference call site used to hand-roll:
283
+ * check whether the artifact exists in this run (`ctx.includeNames`), resolve the
284
+ * constant (`resolveObjectNames`), and build the ts-poet import symbol pointing at
285
+ * `<Object>.names.ts`. Returns undefined whenever the artifact does not exist for this
286
+ * object in this run — a PRESENCE guard ("is the artifact in this run at all"), never the
287
+ * divergence refusal that `primaryRdbSource` owns: this function never compares a
288
+ * resolved value to a literal, it only asks whether the constant exists.
289
+ *
290
+ * `fromPackage` is the package of the FILE BEING EMITTED — the file that will hold the
291
+ * `import { <Object>Names } from …` line — and defaults to `obj.package`, correct for
292
+ * every site that emits `obj`'s OWN module (the entity generator referencing its own
293
+ * names artifact, same object on both ends). A caller emitting a DIFFERENT object's file
294
+ * and reaching across packages for `obj`'s names artifact — an M:N routes file, which
295
+ * lives in the SOURCE entity's package, importing the junction/target's `<X>Names` — MUST
296
+ * pass the emitting file's own package explicitly. Making this an explicit parameter
297
+ * (rather than assuming same-package the way a plain sibling specifier does) is what
298
+ * surfaces that choice: see routes-file.ts's `resolveJunctionColumn`, the one site that
299
+ * got it wrong by assuming same-package.
300
+ */
301
+ export function namesRef(obj, ctx, fromPackage = obj.package) {
302
+ if (!ctx.includeNames)
303
+ return undefined;
304
+ const resolved = resolveObjectNames(obj, ctx.columnNamingStrategy);
305
+ if (resolved === undefined)
306
+ return undefined;
307
+ const symbol = code `${imp(`${obj.name}Names@${crossEntitySpecifier(ctx.selfTarget.outputLayout, fromPackage, obj.package, `${obj.name}.names`, ctx.extStyle)}`)}`;
308
+ return { resolved, symbol };
309
+ }
310
+ /**
311
+ * Adapts a `namesRef()` result to the `{ name, symbol }` shape `renderEntityConstants` /
312
+ * `renderEntityMetaFile` accept. Kept as a separate, narrower shape from `namesRef`'s own
313
+ * `{ resolved, symbol }` rather than folded together: those two functions' parameter
314
+ * predates this helper, and an adopter who already ejected the ADR-0034 reference
315
+ * template calls them with exactly this `{ name, symbol }` shape — widening the required
316
+ * shape to `resolved` would fail to compile in every such copy.
317
+ */
318
+ export function namesConstArg(names, role = SOURCE_ROLE_PRIMARY) {
319
+ // `resolved.name` is optional because a FRAGMENT (an abstract base contributing columns,
320
+ // with no source of its own) genuinely has no physical name. No caller reaches here with
321
+ // one — `namesRef` goes through `resolveObjectNames`, which requires a primary source —
322
+ // but returning undefined rather than asserting keeps the fragment case from acquiring a
323
+ // `$table` it never declared, which is the phantom-table failure #248 exists to prevent.
324
+ const src = names?.resolved.sources[role];
325
+ if (names === undefined || src === undefined)
326
+ return undefined;
327
+ const alias = PHYSICAL_NAME_ATTR_BY_KIND.get(src.kind);
328
+ const physical = alias === undefined ? undefined : src[alias];
329
+ // A fragment (an abstract base contributing columns, no source of its own) genuinely
330
+ // has no physical name. Returning undefined rather than asserting keeps it from
331
+ // acquiring a `$table` it never declared — the phantom-table failure #248 prevents.
332
+ if (typeof physical !== "string")
333
+ return undefined;
334
+ return { name: physical, symbol: names.symbol };
335
+ }
336
+ /**
337
+ * A member access that stays valid whatever the key is: `.email` for an identifier,
338
+ * `["2fa-idx"]` otherwise.
339
+ *
340
+ * Needed because two of the artifact's four collections are keyed by an AUTHOR-CHOSEN
341
+ * name. Field keys are field names and are always identifiers; an index name is whatever
342
+ * the author wrote (`uq_cust_email` is an identifier, `2fa-idx` is not), so a dot access
343
+ * built from it does not parse. One helper rather than a per-site guess.
344
+ */
345
+ function member(key) {
346
+ return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
347
+ }
348
+ /**
349
+ * The physical-name expression every §A6 `$table` / view-name site builds: the constant
350
+ * when the artifact is present, the literal otherwise. No equality guard — but the two
351
+ * branches earn that two different ways, and both are worth naming:
352
+ *
353
+ * - A TABLE literal (`drizzle-schema.ts`, `entity-constants.ts`) comes from
354
+ * `dbTable`/`resolveTableName`, which delegate to `primaryRdbSource` — the same lookup
355
+ * `resolveObjectNames` uses — so a disagreeing object has already thrown.
356
+ * - A VIEW literal (`projection-decl.ts`, `view-decl.ts`) comes from `viewName()`
357
+ * (`extract-view-spec.ts`), which reads OWN read-only sources only. That cannot diverge:
358
+ * a concrete projection may not inherit a source (`ERR_PROJECTION_INHERITED_SOURCE`) and
359
+ * the loader allows one own primary, so there is nothing for it to disagree with.
360
+ *
361
+ * Either way a reference here is the single spelling, never a lookalike computed twice.
362
+ *
363
+ * `role` selects WHICH source — the parameter that did not exist while the artifact held
364
+ * one name. A write-through entity declares two physical names; passing `replica` is how
365
+ * the read view stops being a literal in TypeScript and C# alike.
366
+ */
367
+ export function physicalNameExpr(names, literal, obj, role = SOURCE_ROLE_PRIMARY) {
368
+ const alias = sourceAliasOf(obj, role);
369
+ // No alias means either no source in that role or a @kind carrying no physical-name
370
+ // slot. Falling back to the literal keeps a future @kind from emitting `undefined` into
371
+ // a table binding, which would fail at the database rather than at the compiler.
372
+ if (names === undefined || alias === undefined)
373
+ return code `${JSON.stringify(literal)}`;
374
+ return code `${names.symbol}.sources${member(role)}.${alias}`;
375
+ }
376
+ /**
377
+ * The physical-name alias key for `obj`'s source in `role` — `table`, `view`, `proc`, …
378
+ *
379
+ * Derived from the object rather than taken as a parameter, so a call site cannot pass an
380
+ * alias that disagrees with the source it is describing. Reads the metamodel's own
381
+ * `PHYSICAL_NAME_ATTR_BY_KIND`; a local switch here would be a second answer to a
382
+ * question the metamodel already answers, which is the defect class this file exists for.
383
+ */
384
+ export function sourceAliasOf(obj, role = SOURCE_ROLE_PRIMARY) {
385
+ const src = rdbSourcesOf(obj, false).find((c) => c.role === role);
386
+ return src === undefined ? undefined : PHYSICAL_NAME_ATTR_BY_KIND.get(src.effectiveKind);
387
+ }
388
+ /**
389
+ * A source's `@schema` expression, or undefined when the source declares none.
390
+ *
391
+ * Undefined rather than a literal fallback: an absent `@schema` means "the dialect's
392
+ * default", which a caller expresses by omitting the qualifier entirely — emitting `""`
393
+ * or `"public"` would be this artifact inventing a name the author never wrote.
394
+ */
395
+ export function sourceSchemaExpr(names, role = SOURCE_ROLE_PRIMARY) {
396
+ const src = names?.resolved.sources[role];
397
+ if (names === undefined || src === undefined || src.schema === undefined)
398
+ return undefined;
399
+ return code `${names.symbol}.sources${member(role)}.schema`;
400
+ }
401
+ /**
402
+ * An index's database-name expression — the constant when the artifact carries the node,
403
+ * the literal otherwise.
404
+ *
405
+ * The literal arm goes through `resolveIndexName` rather than reading `node.name`, so the
406
+ * names-off path and the names-on path answer with the same function. That is the whole
407
+ * lesson of `fdb4118f1`: two spellings of one name agree until they do not.
408
+ */
409
+ export function indexNameExpr(names, node) {
410
+ const collection = node.type === TYPE_INDEX ? "indexes" : "identities";
411
+ const entry = names?.resolved[collection][node.name];
412
+ return names !== undefined && entry !== undefined && entry.index !== undefined
413
+ ? code `${names.symbol}.${collection}${member(node.name)}.index`
414
+ : code `${JSON.stringify(resolveIndexName(node))}`;
415
+ }
416
+ /**
417
+ * A field's physical-column expression: the constant when the given artifact carries the
418
+ * field, the literal otherwise.
419
+ *
420
+ * The literal arm is a PRESENCE guard — "no artifact in this run", the documented ADR-0034
421
+ * opt-out — and NOT a divergence guard. It used to carry a second sanctioned case: a TPH
422
+ * fold emitting a subtype's own columns, which the BASE's artifact never saw. That was
423
+ * never a presence question; the constant existed the whole time, in the subtype's own
424
+ * artifact. Callers now resolve the declaring entity's ref before falling back
425
+ * (`drizzle-schema.ts`), so a miss no longer has a known-good explanation and the fallback
426
+ * is the last resort it was meant to be.
427
+ */
428
+ export function columnExpr(names, fieldName, literal) {
429
+ const entry = names?.resolved.fields[fieldName];
430
+ return names !== undefined && entry !== undefined
431
+ ? code `${names.symbol}.fields.${fieldName}.column`
432
+ : code `${JSON.stringify(literal)}`;
433
+ }
434
+ //# sourceMappingURL=names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"names.js","sourceRoot":"","sources":["../src/names.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,WAAW,GAIZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAa,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AA+HxD;;;;;;;;GAQG;AACH,SAAS,aAAa,CAAC,MAAkB;IACvC,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa,CAAC;IAClC,yFAAyF;IACzF,wFAAwF;IACxF,MAAM,KAAK,GAAG,0BAA0B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC/C,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,IAAI;QACJ,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;KACjE,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,SAAS,SAAS,CAAC,OAA8B,EAAE,KAAa;IAC9D,MAAM,GAAG,GAAgC,EAAE,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ACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAEpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,GACzB,IAAI,CAYN;AAID;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAazE;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAM5E;AAwCD;gDACgD;AAChD,qBAAa,eAAgB,SAAQ,KAAK;;CAQzC;AA+FD;;;;;;8CAM8C;AAC9C,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE5D;AA+FD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,cAAc,GAAE,kBAAkB,GAAG,aAAkB,GACtD,WAAW,CAmBb;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,cAAc,GAAE,kBAAkB,GAAG,aAAkB,GACtD,WAAW,CA0Fb"}
@@ -443,10 +443,22 @@ export function decideAndWrite(path, content, optsOrStrategy = {}) {
443
443
  return {
444
444
  path,
445
445
  status: "refused",
446
+ // The hint states WHAT HAPPENED, per file, and points at the recovery rather
447
+ // than restating it. The two remedies it used to name were both WRONG for the
448
+ // generator with the most at stake: `requirementTests()` emits a stub whose
449
+ // entire value is the body you write over it, and whose own header says "do not
450
+ // rename the test — the name is the link", so "move your edits into a
451
+ // non-generated file" asks for something the artifact forbids, and
452
+ // "--baseline=fresh to discard them" discards the only content the file has.
453
+ // The sequence that actually keeps an edit is three commands long and identical
454
+ // for every file in the run, so `runner.ts` prints it once; a doc pointer is
455
+ // what a direct `decideAndWrite` caller (a public export — no runner involved)
456
+ // gets instead, and it is never wrong.
446
457
  conflictHint: kase.hasRecord
447
- ? "this file has been edited since it was generated it was NOT " +
448
- "overwritten. Move your edits into a non-generated file, or re-run " +
449
- "with --baseline=fresh to discard them and adopt fresh output."
458
+ ? "this file has been edited since it was generated, and there is no " +
459
+ ".gen-state snapshot body on this machine to merge against it was NOT " +
460
+ "overwritten, and your version is intact on disk. Recovery: " +
461
+ "docs/features/own-your-codegen.md."
450
462
  : "no record of generating this file, and its content differs from fresh " +
451
463
  "output — it was NOT overwritten. Move it aside, or re-run with " +
452
464
  "--baseline=fresh to overwrite it and adopt fresh output as the baseline.",
@@ -1 +1 @@
1
- {"version":3,"file":"overwrite-policy.js","sourceRoot":"","sources":["../src/overwrite-policy.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4DAA4D;AAC5D,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,2DAA2D;AAC3D,EAAE;AACF,iBAAiB;AACjB,EAAE;AACF,0CAA0C;AAC1C,kEAAkE;AAClE,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,yEAAyE;AACzE,yEAAyE;AACzE,gFAAgF;AAChF,8EAA8E;AAC9E,4EAA4E;AAC5E,kFAAkF;AAClF,EAAE;AACF,2EAA2E;AAC3E,yCAAyC;AACzC,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,gDAAgD;AAEhD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,YAAY,EACZ,MAAM,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,SAAS,EAA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gBAClB,YAAY,EACV,sEAAsE;oBACtE,8BAA8B;aACjC,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type MetaData, type MetaRoot, MetaObject } from "@metaobjectsdev/metadata";
1
+ import { type MetaData, type MetaRoot, type MetaSource, MetaObject } from "@metaobjectsdev/metadata";
2
2
  import type { ColumnNamingStrategy } from "../metaobjects-config.js";
3
3
  import type { ViewSpec } from "./view-spec.js";
4
4
  export interface ExtractContext {
@@ -15,6 +15,30 @@ export interface ExtractContext {
15
15
  * base entity to extend.
16
16
  */
17
17
  export declare function projectionViewName(projection: MetaObject, columnNamingStrategy: ColumnNamingStrategy): string;
18
+ /**
19
+ * The `@schema` of the SAME source node {@link projectionViewName} names, or undefined.
20
+ *
21
+ * It re-uses that function's selection rule ("prefer role:primary read-only, else the first
22
+ * read-only own source") deliberately, rather than asking the object for its schema: for a
23
+ * write-through ENTITY the object's primary source is the WRITABLE table, so
24
+ * `resolveTableSchema` would hand back the table's schema and qualify the replica view with
25
+ * it. A view and the table it replicates need not live in the same schema, and a name paired
26
+ * with someone else's schema is worse than no schema at all — it is confidently wrong.
27
+ */
28
+ export declare function projectionViewSchema(projection: MetaObject): string | undefined;
29
+ /**
30
+ * The source node {@link projectionViewName} names — the ONE selection, so the name, the
31
+ * schema and the role cannot be picked by three functions that agree until they do not.
32
+ *
33
+ * Hoisted out of `projectionViewSchema`, which used to be the only place the rule was
34
+ * written twice-removed from `viewName`. The third caller is what forced it: the names
35
+ * artifact keys its sources by ROLE, so a consumer reaching for a write-through entity's
36
+ * replica view has to know which role that view plays, and guessing `"replica"` would be
37
+ * exactly the second derivation this file exists to avoid.
38
+ */
39
+ export declare function projectionViewSource(projection: MetaObject): MetaSource | undefined;
40
+ /** The ROLE of that source — the key its entry has in `<Entity>Names.sources`. */
41
+ export declare function projectionViewRole(projection: MetaObject): string | undefined;
18
42
  /**
19
43
  * FR-024 (ADR-0029): the entity NAMED by a node's dotted extends ref — the
20
44
  * owner part of `<owner>.<child>...` resolved as an object. Mirrors the
@@ -1 +1 @@
1
- {"version":3,"file":"extract-view-spec.d.ts","sourceRoot":"","sources":["../../src/projection/extract-view-spec.ts"],"names":[],"mappings":"AAmDA,OAAO,EAAE,KAAK,QAAQ,EAAkB,KAAK,QAAQ,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAYpG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EACoC,QAAQ,EAEvD,MAAM,gBAAgB,CAAC;AAwNxB,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;CACrD;AA+DD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,oBAAoB,GACzC,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAYpF;AAosBD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,QAAQ,EACd,GAAG,EAAE,cAAc,GAClB,QAAQ,CAyCV"}
1
+ {"version":3,"file":"extract-view-spec.d.ts","sourceRoot":"","sources":["../../src/projection/extract-view-spec.ts"],"names":[],"mappings":"AAqDA,OAAO,EAAE,KAAK,QAAQ,EAAkB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAYrH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EACoC,QAAQ,EAEvD,MAAM,gBAAgB,CAAC;AAwNxB,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;CACrD;AAyGD;;;;;;;;;GASG;AACH,wBAAgB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