@metaobjectsdev/codegen-ts 0.24.5 → 1.0.0-rc.1
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/README.md +37 -12
- package/dist/api-surface.d.ts +29 -0
- package/dist/api-surface.d.ts.map +1 -1
- package/dist/api-surface.js +47 -0
- package/dist/api-surface.js.map +1 -1
- package/dist/column-mapper.d.ts +12 -0
- package/dist/column-mapper.d.ts.map +1 -1
- package/dist/column-mapper.js +1 -0
- package/dist/column-mapper.js.map +1 -1
- package/dist/constants.d.ts +24 -11
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +54 -19
- package/dist/constants.js.map +1 -1
- package/dist/db-emitting.d.ts +6 -0
- package/dist/db-emitting.d.ts.map +1 -0
- package/dist/db-emitting.js +26 -0
- package/dist/db-emitting.js.map +1 -0
- package/dist/generator-registry.d.ts.map +1 -1
- package/dist/generator-registry.js +14 -1
- package/dist/generator-registry.js.map +1 -1
- package/dist/generator.d.ts +5 -0
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js.map +1 -1
- package/dist/generators/agent-docs-file.d.ts +19 -0
- package/dist/generators/agent-docs-file.d.ts.map +1 -0
- package/dist/generators/agent-docs-file.js +257 -0
- package/dist/generators/agent-docs-file.js.map +1 -0
- package/dist/generators/agent-requirements-page.d.ts +22 -0
- package/dist/generators/agent-requirements-page.d.ts.map +1 -0
- package/dist/generators/agent-requirements-page.js +175 -0
- package/dist/generators/agent-requirements-page.js.map +1 -0
- package/dist/generators/agent-schema-input.d.ts +69 -0
- package/dist/generators/agent-schema-input.d.ts.map +1 -0
- package/dist/generators/agent-schema-input.js +23 -0
- package/dist/generators/agent-schema-input.js.map +1 -0
- package/dist/generators/agent-schema-page.d.ts +21 -0
- package/dist/generators/agent-schema-page.d.ts.map +1 -0
- package/dist/generators/agent-schema-page.js +241 -0
- package/dist/generators/agent-schema-page.js.map +1 -0
- package/dist/generators/agent-ui-page.d.ts +22 -0
- package/dist/generators/agent-ui-page.d.ts.map +1 -0
- package/dist/generators/agent-ui-page.js +253 -0
- package/dist/generators/agent-ui-page.js.map +1 -0
- package/dist/generators/api-docs-file.d.ts.map +1 -1
- package/dist/generators/api-docs-file.js +13 -6
- package/dist/generators/api-docs-file.js.map +1 -1
- package/dist/generators/api-model.d.ts +6 -0
- package/dist/generators/api-model.d.ts.map +1 -1
- package/dist/generators/api-model.js +54 -35
- package/dist/generators/api-model.js.map +1 -1
- package/dist/generators/callable-file.js +1 -1
- package/dist/generators/callable-file.js.map +1 -1
- package/dist/generators/docs-data-builder.d.ts.map +1 -1
- package/dist/generators/docs-data-builder.js +47 -2
- package/dist/generators/docs-data-builder.js.map +1 -1
- package/dist/generators/docs-data.d.ts +6 -2
- package/dist/generators/docs-data.d.ts.map +1 -1
- package/dist/generators/index.d.ts +3 -8
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +19 -14
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/names-file.d.ts +17 -0
- package/dist/generators/names-file.d.ts.map +1 -0
- package/dist/generators/names-file.js +95 -0
- package/dist/generators/names-file.js.map +1 -0
- package/dist/generators/requirements-markdown.d.ts +18 -1
- package/dist/generators/requirements-markdown.d.ts.map +1 -1
- package/dist/generators/requirements-markdown.js +11 -9
- package/dist/generators/requirements-markdown.js.map +1 -1
- package/dist/generators/routes-file-hono.d.ts +17 -2
- package/dist/generators/routes-file-hono.d.ts.map +1 -1
- package/dist/generators/routes-file-hono.js +9 -11
- package/dist/generators/routes-file-hono.js.map +1 -1
- package/dist/generators/routes-file.d.ts +17 -2
- package/dist/generators/routes-file.d.ts.map +1 -1
- package/dist/generators/routes-file.js +10 -8
- package/dist/generators/routes-file.js.map +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +20 -6
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/index.d.ts +20 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -4
- package/dist/index.js.map +1 -1
- package/dist/metaobjects-config.d.ts +38 -1
- package/dist/metaobjects-config.d.ts.map +1 -1
- package/dist/metaobjects-config.js +9 -1
- package/dist/metaobjects-config.js.map +1 -1
- package/dist/names.d.ts +275 -0
- package/dist/names.d.ts.map +1 -0
- package/dist/names.js +433 -0
- package/dist/names.js.map +1 -0
- package/dist/overwrite-policy.d.ts.map +1 -1
- package/dist/overwrite-policy.js +15 -3
- package/dist/overwrite-policy.js.map +1 -1
- package/dist/projection/extract-view-spec.d.ts +25 -1
- package/dist/projection/extract-view-spec.d.ts.map +1 -1
- package/dist/projection/extract-view-spec.js +79 -6
- package/dist/projection/extract-view-spec.js.map +1 -1
- package/dist/reference-templates.d.ts +1 -1
- package/dist/reference-templates.d.ts.map +1 -1
- package/dist/reference-templates.js +1 -1
- package/dist/reference-templates.js.map +1 -1
- package/dist/render-context.d.ts +12 -1
- package/dist/render-context.d.ts.map +1 -1
- package/dist/render-context.js +1 -0
- package/dist/render-context.js.map +1 -1
- package/dist/retired-codegen-attrs.d.ts +32 -0
- package/dist/retired-codegen-attrs.d.ts.map +1 -0
- package/dist/retired-codegen-attrs.js +47 -0
- package/dist/retired-codegen-attrs.js.map +1 -0
- package/dist/routes-expose.d.ts +63 -0
- package/dist/routes-expose.d.ts.map +1 -0
- package/dist/routes-expose.js +57 -0
- package/dist/routes-expose.js.map +1 -0
- package/dist/runner.d.ts +18 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +109 -7
- package/dist/runner.js.map +1 -1
- package/dist/templates/callable-file.d.ts +7 -2
- package/dist/templates/callable-file.d.ts.map +1 -1
- package/dist/templates/callable-file.js +54 -9
- package/dist/templates/callable-file.js.map +1 -1
- package/dist/templates/drizzle-schema.d.ts.map +1 -1
- package/dist/templates/drizzle-schema.js +236 -65
- package/dist/templates/drizzle-schema.js.map +1 -1
- package/dist/templates/entity-constants.d.ts +15 -6
- package/dist/templates/entity-constants.d.ts.map +1 -1
- package/dist/templates/entity-constants.js +85 -161
- package/dist/templates/entity-constants.js.map +1 -1
- package/dist/templates/entity-file.d.ts.map +1 -1
- package/dist/templates/entity-file.js +38 -4
- package/dist/templates/entity-file.js.map +1 -1
- package/dist/templates/entity-meta-file.d.ts +15 -1
- package/dist/templates/entity-meta-file.d.ts.map +1 -1
- package/dist/templates/entity-meta-file.js +12 -2
- package/dist/templates/entity-meta-file.js.map +1 -1
- package/dist/templates/entity-ui-descriptor.d.ts +112 -0
- package/dist/templates/entity-ui-descriptor.d.ts.map +1 -0
- package/dist/templates/entity-ui-descriptor.js +238 -0
- package/dist/templates/entity-ui-descriptor.js.map +1 -0
- package/dist/templates/field-meta.d.ts +46 -9
- package/dist/templates/field-meta.d.ts.map +1 -1
- package/dist/templates/field-meta.js +95 -21
- package/dist/templates/field-meta.js.map +1 -1
- package/dist/templates/names-decl.d.ts +38 -0
- package/dist/templates/names-decl.d.ts.map +1 -0
- package/dist/templates/names-decl.js +104 -0
- package/dist/templates/names-decl.js.map +1 -0
- package/dist/templates/projection-decl.d.ts +21 -0
- package/dist/templates/projection-decl.d.ts.map +1 -1
- package/dist/templates/projection-decl.js +53 -29
- package/dist/templates/projection-decl.js.map +1 -1
- package/dist/templates/queries-file.d.ts.map +1 -1
- package/dist/templates/queries-file.js +17 -2
- package/dist/templates/queries-file.js.map +1 -1
- package/dist/templates/requirement-test.d.ts.map +1 -1
- package/dist/templates/requirement-test.js +13 -2
- package/dist/templates/requirement-test.js.map +1 -1
- package/dist/templates/routes-file-hono.d.ts +2 -1
- package/dist/templates/routes-file-hono.d.ts.map +1 -1
- package/dist/templates/routes-file-hono.js +11 -2
- package/dist/templates/routes-file-hono.js.map +1 -1
- package/dist/templates/routes-file.d.ts +2 -1
- package/dist/templates/routes-file.d.ts.map +1 -1
- package/dist/templates/routes-file.js +54 -21
- package/dist/templates/routes-file.js.map +1 -1
- package/dist/templates/value-object-file.d.ts.map +1 -1
- package/dist/templates/value-object-file.js +15 -1
- package/dist/templates/value-object-file.js.map +1 -1
- package/dist/templates/view-decl.d.ts +37 -1
- package/dist/templates/view-decl.d.ts.map +1 -1
- package/dist/templates/view-decl.js +27 -3
- package/dist/templates/view-decl.js.map +1 -1
- package/dist/templates/zod-validators.d.ts +21 -0
- package/dist/templates/zod-validators.d.ts.map +1 -1
- package/dist/templates/zod-validators.js +40 -5
- package/dist/templates/zod-validators.js.map +1 -1
- package/dist/view-context.d.ts +24 -0
- package/dist/view-context.d.ts.map +1 -0
- package/dist/view-context.js +81 -0
- package/dist/view-context.js.map +1 -0
- package/package.json +6 -6
- package/src/api-surface.ts +53 -0
- package/src/column-mapper.ts +13 -0
- package/src/constants.ts +91 -16
- package/src/db-emitting.ts +31 -0
- package/src/generator-registry.ts +14 -4
- package/src/generator.ts +5 -0
- package/src/generators/agent-docs-file.ts +297 -0
- package/src/generators/agent-requirements-page.ts +199 -0
- package/src/generators/agent-schema-input.ts +88 -0
- package/src/generators/agent-schema-page.ts +297 -0
- package/src/generators/agent-ui-page.ts +290 -0
- package/src/generators/api-docs-file.ts +13 -6
- package/src/generators/api-model.ts +63 -34
- package/src/generators/callable-file.ts +1 -1
- package/src/generators/docs-data-builder.ts +46 -2
- package/src/generators/docs-data.ts +6 -2
- package/src/generators/index.ts +25 -14
- package/src/generators/names-file.ts +98 -0
- package/src/generators/requirements-markdown.ts +36 -2
- package/src/generators/routes-file-hono.ts +19 -10
- package/src/generators/routes-file.ts +20 -7
- package/src/generators/template-generator.ts +20 -6
- package/src/index.ts +64 -4
- package/src/metaobjects-config.ts +48 -2
- package/src/names.ts +629 -0
- package/src/overwrite-policy.ts +15 -3
- package/src/projection/extract-view-spec.ts +85 -6
- package/src/reference/entity.ts +21 -2
- package/src/reference/names.ts +125 -0
- package/src/reference/queries.ts +19 -3
- package/src/reference/routes-hono.ts +19 -9
- package/src/reference/routes.ts +25 -9
- package/src/reference-templates.ts +1 -1
- package/src/render-context.ts +13 -1
- package/src/retired-codegen-attrs.ts +52 -0
- package/src/routes-expose.ts +86 -0
- package/src/runner.ts +122 -11
- package/src/templates/callable-file.ts +60 -8
- package/src/templates/drizzle-schema.ts +248 -60
- package/src/templates/entity-constants.ts +95 -184
- package/src/templates/entity-file.ts +46 -4
- package/src/templates/entity-meta-file.ts +16 -3
- package/src/templates/entity-ui-descriptor.ts +305 -0
- package/src/templates/field-meta.ts +100 -19
- package/src/templates/names-decl.ts +165 -0
- package/src/templates/projection-decl.ts +72 -31
- package/src/templates/queries-file.ts +17 -2
- package/src/templates/requirement-test.ts +13 -2
- package/src/templates/routes-file-hono.ts +14 -2
- package/src/templates/routes-file.ts +69 -24
- package/src/templates/value-object-file.ts +15 -1
- package/src/templates/view-decl.ts +53 -3
- package/src/templates/zod-validators.ts +41 -5
- package/src/view-context.ts +88 -0
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAClG,YAAY,EAAE,iBAAiB,EAAE,gBAAg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,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAKxE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,YAAY,EACV,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAO3E,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,14 @@ export { parseTemplateSpec, templateSpecToGenerators } from "./template-codegen/
|
|
|
12
12
|
// ADR-0021 D3 — stable-name generator registry + discoverability surface.
|
|
13
13
|
export { generatorRegistry, listGenerators, getGenerator, } from "./generator-registry.js";
|
|
14
14
|
export { defineConfig, normalizeConfig, resolveGenerators, resolveDocsConfig } from "./metaobjects-config.js";
|
|
15
|
+
// The dialect every generator falls back to when a config declares none. Exported because
|
|
16
|
+
// `meta docs` must apply the SAME default `normalizeConfig` does — a command that resolved
|
|
17
|
+
// the dialect differently would document a schema the toolchain does not produce.
|
|
18
|
+
export { DEFAULT_DIALECT } from "./metaobjects-config.js";
|
|
19
|
+
// The runner's own "does this model need a dialect?" guard. `meta docs` must ask it rather
|
|
20
|
+
// than defaulting, because DEFAULT_DIALECT is inert and a DB project with no dialect is one
|
|
21
|
+
// `meta gen` REFUSES — documenting it as sqlite states an answer the toolchain never gave.
|
|
22
|
+
export { dbEmittingObjects, missingDialectMessage } from "./db-emitting.js";
|
|
15
23
|
export { apiLabel } from "./generators/api-label.js";
|
|
16
24
|
export { mapColumnType } from "./column-mapper.js";
|
|
17
25
|
export { buildPkMap } from "./pk-resolver.js";
|
|
@@ -26,7 +34,8 @@ export { decideAndWrite, GitMissingError } from "./overwrite-policy.js";
|
|
|
26
34
|
// convicting every stranger's file that happens to sit in the same directory.
|
|
27
35
|
export { contentHash, readGeneratedHash, listGeneratedPaths } from "./overwrite-policy.js";
|
|
28
36
|
export { CodegenError } from "./errors.js";
|
|
29
|
-
export { GENERATED_HEADER,
|
|
37
|
+
export { GENERATED_HEADER, DEFAULT_OUT_DIR, RETIRED_CODEGEN_ATTRS } from "./constants.js";
|
|
38
|
+
export { warnRetiredCodegenAttrs } from "./retired-codegen-attrs.js";
|
|
30
39
|
export { formatTs } from "./format.js";
|
|
31
40
|
export { pluralize, columnNameFromField, tableNameFromEntity, viewNameFromProjection } from "./naming.js";
|
|
32
41
|
export { packageToPath, entityOutputPath, crossEntitySpecifier, barrelEntrySpecifier, relativeModuleSpecifier, entityModuleSpecifier, siblingSpecifier, barrelModuleSpecifier } from "./import-path.js";
|
|
@@ -34,13 +43,28 @@ export { docPageOutputPath, docPageHref, docPageNode, effectivePackage, assertNo
|
|
|
34
43
|
export { isProjection, isWriteThrough } from "./projection/projection-detector.js";
|
|
35
44
|
export { isAbstract, emitsInstanceArtifacts, emitsWriteArtifacts } from "./instance-artifacts.js";
|
|
36
45
|
// The UI tier asks THESE — "is there an endpoint?" — never the storage predicates.
|
|
37
|
-
export { servesReadApi, servesWriteApi } from "./api-surface.js";
|
|
46
|
+
export { hasGeneratedForm, restPath, servesReadApi, servesWriteApi } from "./api-surface.js";
|
|
47
|
+
// #356 — every emitter selects a field's view by the SURFACE it renders, never by
|
|
48
|
+
// declaration position. An owned generator (FR-040) composing the render layer must
|
|
49
|
+
// use this too, or it reinstates the order-dependence in its own copy.
|
|
50
|
+
export { viewForContext, VIEW_CONTEXT_FORM, VIEW_CONTEXT_GRID } from "./view-context.js";
|
|
51
|
+
// The shared per-field UI derivation. `valueObjectFor` is the predicate the React form
|
|
52
|
+
// generator and the `agent/ui.md` docs page must both ask — it decides whether a field is
|
|
53
|
+
// rendered as an input at all — and `humanize` is the one body behind every generated
|
|
54
|
+
// label. Both are exported so the react tier reads them rather than keeping a copy.
|
|
55
|
+
export { humanize, inferViewKind, labelFor, currencyMetaFor, valueObjectFor } from "./templates/field-meta.js";
|
|
38
56
|
// The DB-free descriptor module the UI tier imports from (see entity-meta-file.ts).
|
|
39
57
|
export { renderEntityMetaFile, entityMetaFileName, entityMetaSpecifier } from "./templates/entity-meta-file.js";
|
|
40
58
|
// FR-017 TPH helpers — used by the per-framework codegen packages (tanstack,
|
|
41
59
|
// react) to dispatch polymorphic/per-subtype emission and skip subtype files.
|
|
42
60
|
export { isTphDiscriminatorBase, tphConcreteSubtypes, collectTphSubtypeFields, tphPlan, tphRouteSegment } from "./templates/tph-discriminator.js";
|
|
43
|
-
export { isTphSubtype, tphDiscriminatorPin } from "./templates/zod-validators.js";
|
|
61
|
+
export { isTphSubtype, tphDiscriminatorBase, tphDiscriminatorPin } from "./templates/zod-validators.js";
|
|
62
|
+
// The ONE sortability rule. It builds the server-side `<Entity>SortAllowlist` and the
|
|
63
|
+
// client-side sort union, and it is public so a UI-tier generator (a data-grid column
|
|
64
|
+
// emitter, say) marks a column sortable by ASKING the server's rule rather than
|
|
65
|
+
// reimplementing its three branches out of tree. A hand-copied predicate is how the
|
|
66
|
+
// grid came to offer headers the allowlist rejects (#352/#354).
|
|
67
|
+
export { isSortableField, sortableFields } from "./templates/filter-shared.js";
|
|
44
68
|
// ADR-0034 reference-template composition helpers. Promoted to the public engine
|
|
45
69
|
// surface so a COPIED reference generator (src/reference/*.ts → consumer's
|
|
46
70
|
// codegen/generators/*.ts) imports only `@metaobjectsdev/codegen-ts`, never a
|
|
@@ -64,7 +88,14 @@ export { resolveReferenceRoot, readReferenceTemplate, REFERENCE_GENERATOR_NAMES,
|
|
|
64
88
|
// TS2300 on the adopter's first tsc). Gated by
|
|
65
89
|
// cli/test/gen-split-tree-single-import.test.ts.
|
|
66
90
|
export { code, imp, joinCode } from "ts-poet";
|
|
67
|
-
export { renderFindByIdFn, renderListFn, renderCreateFn,
|
|
91
|
+
export { renderFindByIdFn, renderListFn, renderCreateFn,
|
|
92
|
+
// #203 — the `insertPreserving<Entity>` escape hatch, emitted only for an entity with an
|
|
93
|
+
// `@autoSet` timestamp. Public because an OWNED queries generator must be able to emit it:
|
|
94
|
+
// without this primitive (and `hasAutoSetFields` below) an ejected copy silently drops the
|
|
95
|
+
// escape hatch on exactly the entities that have one, and the caller loses the only
|
|
96
|
+
// generated way to insert a row preserving its own `@autoSet` values.
|
|
97
|
+
renderInsertPreservingFn, renderUpdateFn, renderDeleteByIdFn, renderReverseFinderFns, reverseFksFor, getPkInfo, } from "./templates/queries.js";
|
|
98
|
+
export { hasAutoSetFields } from "./templates/zod-validators.js";
|
|
68
99
|
// Built-in template render functions — the composition seam for adopters who
|
|
69
100
|
// want to call a built-in template, then post-process / append to its output
|
|
70
101
|
// from their own Generator (added to `generators: [...]`) WITHOUT forking the
|
|
@@ -79,9 +110,14 @@ export { renderFilterType } from "./templates/filter-type.js";
|
|
|
79
110
|
export { renderFilterAllowlist, renderSortAllowlist } from "./templates/filter-allowlist.js";
|
|
80
111
|
export { renderEntityConstants, resourcePath } from "./templates/entity-constants.js";
|
|
81
112
|
export { renderQueriesFile } from "./templates/queries-file.js";
|
|
113
|
+
// #348 — which CRUD verbs a generated routes file mounts. Public because an OWNED
|
|
114
|
+
// routes generator (ADR-0034) composes the same render call and needs the same option.
|
|
115
|
+
export { CRUD_VERBS, resolveExpose, intersectExpose, exposeLine } from "./routes-expose.js";
|
|
82
116
|
export { renderRoutesFile } from "./templates/routes-file.js";
|
|
83
117
|
export { renderRoutesFileHono } from "./templates/routes-file-hono.js";
|
|
84
118
|
export { renderValueObjectFile } from "./templates/value-object-file.js";
|
|
119
|
+
export { renderNamesDecl } from "./templates/names-decl.js";
|
|
120
|
+
export { resolveObjectNames, resolveSuperFragmentNames, namesArtifactSuperOf, namesRef, namesConstArg, physicalNameExpr, columnExpr, } from "./names.js";
|
|
85
121
|
export { renderProjectionDecl } from "./templates/projection-decl.js";
|
|
86
122
|
export { extractViewSpec } from "./projection/extract-view-spec.js";
|
|
87
123
|
export { emitViewDdl } from "./projection/view-ddl-emit.js";
|
|
@@ -104,6 +140,9 @@ export { buildTemplateDocData } from "./generators/template-doc-builder.js";
|
|
|
104
140
|
// worse than the bug report this is meant to avoid.
|
|
105
141
|
export { requirementTests } from "./generators/requirement-tests.js";
|
|
106
142
|
export { requirementsFile } from "./generators/requirements-file.js";
|
|
143
|
+
// The `agent` docs surface. `AgentSchemaInput` is exported because the CLI SUPPLIES it —
|
|
144
|
+
// codegen-ts deliberately does not compute the physical schema (see agent-schema-input.ts).
|
|
145
|
+
export { agentDocsFile } from "./generators/agent-docs-file.js";
|
|
107
146
|
// The projection itself, not just its type: it is the authority on WHICH doc slots a
|
|
108
147
|
// requirement surface actually renders, and `meta verify`'s authoring lint tells an
|
|
109
148
|
// author that `summary` is invisible while `title` is the entry's label. Both halves of
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,yCAAyC;AACzC,wEAAwE;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE7E,+EA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6 +49,14 @@ export interface ResolvedGenConfig {
|
|
|
49
49
|
* api-docs reads this to AUTO-DETECT whether to document the Hono CRUD surface
|
|
50
50
|
* (it otherwise mirrors the default Fastify-only suite). Undefined ⇒ false. */
|
|
51
51
|
includeHonoRoutes?: boolean;
|
|
52
|
+
/** §A6 — whether the OPT-IN names generator (namesFile) is active in the run,
|
|
53
|
+
* aggregated by the runner from the suite's `emitsNames` markers. A generator that
|
|
54
|
+
* wants to REFERENCE `<Entity>Names` reads this to know the artifact will exist:
|
|
55
|
+
* the names generator is opt-in under ADR-0034 scaffold-and-own, so an
|
|
56
|
+
* unconditional import would break every project that has not enabled it.
|
|
57
|
+
* Undefined ⇒ false. Templates read the same fact off `RenderContext.includeNames`,
|
|
58
|
+
* which the runner sets from this same aggregation. */
|
|
59
|
+
includeNames?: boolean;
|
|
52
60
|
/**
|
|
53
61
|
* FR-019 / ADR-0026: the module specifier from which an externally-PROVIDED
|
|
54
62
|
* shared enum (`@provided: true` on an abstract package-level `field.enum`) is
|
|
@@ -163,6 +171,9 @@ export interface MetaobjectsGenConfig extends Omit<ResolvedGenConfig, "dbImport"
|
|
|
163
171
|
emitAbstractShapes?: boolean;
|
|
164
172
|
/** Docs-output config consumed by the `meta docs` door. See {@link DocsConfig}. */
|
|
165
173
|
docs?: DocsConfig;
|
|
174
|
+
/** `meta verify` / `meta gen` advisory settings. Nothing here affects codegen.
|
|
175
|
+
* See {@link VerifyConfig}. */
|
|
176
|
+
verify?: VerifyConfig;
|
|
166
177
|
/** Named output destinations. Generators reference one via `target`. */
|
|
167
178
|
targets?: Record<string, TargetConfig>;
|
|
168
179
|
/** importBase for the default target (top-level outDir). */
|
|
@@ -210,7 +221,7 @@ export interface NormalizedMetaobjectsGenConfig extends Omit<MetaobjectsGenConfi
|
|
|
210
221
|
outputLayout: OutputLayout;
|
|
211
222
|
targets: Record<string, ResolvedTarget>;
|
|
212
223
|
}
|
|
213
|
-
export type DocsSurface = "model" | "api" | "requirements";
|
|
224
|
+
export type DocsSurface = "model" | "api" | "requirements" | "agent";
|
|
214
225
|
export interface ApiSurface {
|
|
215
226
|
lang: string;
|
|
216
227
|
subDir: string;
|
|
@@ -219,6 +230,32 @@ export interface ApiSurface {
|
|
|
219
230
|
/** The single docs-output config: where ALL doc surfaces go, how pages are laid
|
|
220
231
|
* out, and which surfaces to emit. Read by the `meta docs` door (and, when the
|
|
221
232
|
* api surface fans out, by each port's docs command). */
|
|
233
|
+
/**
|
|
234
|
+
* `meta verify` settings. Nothing here changes what codegen emits.
|
|
235
|
+
*
|
|
236
|
+
* This block existed once before, for `verify.testFiles`, and was removed in 0.24.0 with
|
|
237
|
+
* the `@verifiedBy` vocabulary it served. It returns for exactly the reason it was added:
|
|
238
|
+
* the advisory scans carry a list of conventions that is, unavoidably, a guess about
|
|
239
|
+
* someone else's repository. Built-in defaults for the layouts that demonstrably exist,
|
|
240
|
+
* PLUS a project-declared list, is the shape that survives being wrong.
|
|
241
|
+
*/
|
|
242
|
+
export interface VerifyConfig {
|
|
243
|
+
/**
|
|
244
|
+
* Path globs the "you hand-rolled what MetaObjects models" advisory skips entirely.
|
|
245
|
+
* Relative to the project root, forward-slash, `**` spans separators; a glob matching a
|
|
246
|
+
* directory prunes the whole subtree. ADDS to the built-in exclusions rather than
|
|
247
|
+
* replacing them.
|
|
248
|
+
*
|
|
249
|
+
* verify: { antiPatternIgnore: ["db/changelog/**", "vendor/sql/**"] }
|
|
250
|
+
*
|
|
251
|
+
* Reach for this when the advisory reports a file you cannot act on — a vendored SQL
|
|
252
|
+
* archive, read-only reference DDL, a migration tool whose naming the built-ins do not
|
|
253
|
+
* recognise. It is deliberately narrower than `--no-antipatterns`: silencing the whole
|
|
254
|
+
* scan to quiet one directory is how a useful advisory gets switched off wholesale, the
|
|
255
|
+
* same failure `--no-requirement-lint` was carved out to avoid.
|
|
256
|
+
*/
|
|
257
|
+
antiPatternIgnore?: string[];
|
|
258
|
+
}
|
|
222
259
|
export interface DocsConfig {
|
|
223
260
|
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AAE,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAwB3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,EAAE,CAqB9E;AAED,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,8BAA8B,CAoB5F"}
|
|
@@ -19,7 +19,15 @@ export function resolveDocsConfig(block, cli, fallbackLayout) {
|
|
|
19
19
|
// files for a project declaring no `requirement.*` node — not an empty page. A
|
|
20
20
|
// project without a ledger sees byte-identical output to before the surface
|
|
21
21
|
// existed; see requirements-file.ts.
|
|
22
|
-
|
|
22
|
+
//
|
|
23
|
+
// `agent` defaults ON for the same reason and under the same discipline: each of
|
|
24
|
+
// its three pages renders "" when its tier has nothing to describe, and an empty
|
|
25
|
+
// render emits no file. It is additionally gated on a loadable gen config, exactly
|
|
26
|
+
// as `api` is — physical names, the dialect and view dispatch all come from there,
|
|
27
|
+
// so without one there is nothing true to say. Turning it on by default is what
|
|
28
|
+
// makes the always-on agent-context pointer able to name the files: a pointer to a
|
|
29
|
+
// page an adopter has to opt into is a pointer at nothing.
|
|
30
|
+
surfaces: cli.surfaces ?? block?.surfaces ?? ["model", "api", "requirements", "agent"],
|
|
23
31
|
apiSurfaces: cli.apiSurfaces ?? block?.apiSurfaces ?? [{ lang: "ts", subDir: "api" }],
|
|
24
32
|
};
|
|
25
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metaobjects-config.js","sourceRoot":"","sources":["../src/metaobjects-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAwD,MAAM,0BAA0B,CAAC;AAIhI,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAqB5D,4FAA4F;AAC5F,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"metaobjects-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AI,IAAI;QACrD,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,MAAM;QAC3C,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC;KAChC,CAAC;AACJ,CAAC"}
|
package/dist/names.d.ts
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
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 { type ColumnNamingStrategy, type MetaObject } from "@metaobjectsdev/metadata";
|
|
10
|
+
import { type Code } from "ts-poet";
|
|
11
|
+
import type { RenderContext } from "./render-context.js";
|
|
12
|
+
export interface FieldNames {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly column: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* One `source.rdb` child, under the ROLE it plays.
|
|
18
|
+
*
|
|
19
|
+
* The physical name is carried under a key NAMED FOR THE KIND — `table`, `view`,
|
|
20
|
+
* `materializedView`, `proc`, `function` — and that key is not invented here: it is
|
|
21
|
+
* `PHYSICAL_NAME_ATTR_BY_KIND`, the metamodel's own FR-016/ADR-0018 alias map, the same
|
|
22
|
+
* one the canonical serializer rewrites through. So the artifact spells a physical name
|
|
23
|
+
* the way the metadata that declared it does.
|
|
24
|
+
*
|
|
25
|
+
* This is the half of the shape that earns the restructure. A single flat `name` held a
|
|
26
|
+
* table, a view and a stored procedure in the same run, told apart only by a sibling
|
|
27
|
+
* `kind`; under `as const`, `LedgerNames.sources.replica.table` is now a compile error,
|
|
28
|
+
* because that source is a view. The read site answers the question instead of the reader
|
|
29
|
+
* having to.
|
|
30
|
+
*/
|
|
31
|
+
export interface SourceNames {
|
|
32
|
+
readonly type: string;
|
|
33
|
+
readonly subType: string;
|
|
34
|
+
/** The `@kind` value, defaulted per ADR-0007 Rule 3 — the discriminator for the alias below. */
|
|
35
|
+
readonly kind: string;
|
|
36
|
+
readonly schema?: string | undefined;
|
|
37
|
+
/** The physical name, under the alias for `kind`. Exactly one of these is present. */
|
|
38
|
+
readonly table?: string | undefined;
|
|
39
|
+
readonly view?: string | undefined;
|
|
40
|
+
readonly materializedView?: string | undefined;
|
|
41
|
+
readonly proc?: string | undefined;
|
|
42
|
+
readonly function?: string | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One `identity.*` or `index.*` child.
|
|
46
|
+
*
|
|
47
|
+
* `subType` is load-bearing rather than decorative: it is the ONLY thing distinguishing a
|
|
48
|
+
* unique alternate key from a non-unique lookup index, which is the whole reason ADR-0040
|
|
49
|
+
* put uniqueness in the type rather than in an attribute.
|
|
50
|
+
*
|
|
51
|
+
* `index` — the database name — is present only where a shared resolver produces it:
|
|
52
|
+
* `identity.secondary` and `index.lookup`, via `resolveIndexName`. It is deliberately
|
|
53
|
+
* ABSENT on `identity.primary`, because no such name exists to carry: migrate hardcodes
|
|
54
|
+
* `<table>_pkey` on Postgres, emits an unnamed PK on SQLite, and no port's codegen names a
|
|
55
|
+
* primary key at all. Carrying it would restate a migrate-only, dialect-conditional
|
|
56
|
+
* formula in an artifact whose entire promise is that a name is spelled once — the #293
|
|
57
|
+
* defect, re-created by the mechanism built to prevent it.
|
|
58
|
+
*/
|
|
59
|
+
export interface KeyNames {
|
|
60
|
+
readonly type: string;
|
|
61
|
+
readonly subType: string;
|
|
62
|
+
readonly name: string;
|
|
63
|
+
/** The database index name. Present for `identity.secondary` and `index.lookup` only. */
|
|
64
|
+
readonly index?: string | undefined;
|
|
65
|
+
}
|
|
66
|
+
/** The object whose names artifact this one extends. */
|
|
67
|
+
export interface SuperNames {
|
|
68
|
+
readonly name: string;
|
|
69
|
+
readonly package?: string | undefined;
|
|
70
|
+
}
|
|
71
|
+
export interface ObjectNames {
|
|
72
|
+
/** The metamodel type — always `object`. */
|
|
73
|
+
readonly type: string;
|
|
74
|
+
/** The metamodel subType — `entity` | `projection` | `value`. */
|
|
75
|
+
readonly subType: string;
|
|
76
|
+
/**
|
|
77
|
+
* The object's OWN name — `"Customer"`, not `"TBL_CUST_MASTER"`.
|
|
78
|
+
*
|
|
79
|
+
* It held the physical name until 0.25.0, which is the one change here that a hand-
|
|
80
|
+
* written consumer can adopt WITHOUT a compile error: `pgTable(CustomerNames.name, …)`
|
|
81
|
+
* still compiles and now binds a table called `Customer`. The release note leads with
|
|
82
|
+
* that; no gate here can see it, because the code that breaks is not generated.
|
|
83
|
+
*/
|
|
84
|
+
readonly name: string;
|
|
85
|
+
/**
|
|
86
|
+
* Every `source.rdb` child, keyed by effective `@role` (`primary` | `replica`).
|
|
87
|
+
*
|
|
88
|
+
* Role is the honest axis: the loader requires exactly one primary, and every consumer
|
|
89
|
+
* that binds a second source picks it by role. Keying by role is also what finally gives
|
|
90
|
+
* a WRITE-THROUGH entity's replica view a home — it declares two physical names, the
|
|
91
|
+
* artifact carried one, and both TypeScript and C# emitted the second as a literal.
|
|
92
|
+
*
|
|
93
|
+
* Empty on a FRAGMENT: an abstract base with no source of its own contributes columns
|
|
94
|
+
* and must never acquire a physical name it never declared.
|
|
95
|
+
*/
|
|
96
|
+
readonly sources: Readonly<Record<string, SourceNames>>;
|
|
97
|
+
/** The sources DECLARED HERE — what this artifact emits. See `ownFields`. */
|
|
98
|
+
readonly ownSources: Readonly<Record<string, SourceNames>>;
|
|
99
|
+
/**
|
|
100
|
+
* Every field, INHERITED INCLUDED. This is what a consumer looks a column up in, so a
|
|
101
|
+
* lookup for an inherited field must hit — miss and the caller falls back to a literal
|
|
102
|
+
* (see `columnExpr`), which is the whole defect this artifact exists to remove.
|
|
103
|
+
*/
|
|
104
|
+
readonly fields: Readonly<Record<string, FieldNames>>;
|
|
105
|
+
/**
|
|
106
|
+
* The fields DECLARED HERE — what the artifact EMITS. Inherited ones are declared by
|
|
107
|
+
* the super's artifact and reached through it, so a subtype states each physical name
|
|
108
|
+
* once instead of restating its parent's.
|
|
109
|
+
*
|
|
110
|
+
* ADR-0039's ONE sanctioned own-accessor use, in the exact form the ADR names: codegen
|
|
111
|
+
* emitting a generated subclass, iterating own members so inherited ones are not
|
|
112
|
+
* re-emitted.
|
|
113
|
+
*/
|
|
114
|
+
readonly ownFields: Readonly<Record<string, FieldNames>>;
|
|
115
|
+
/** Every `identity.*` child, inherited included; keyed by metamodel name. */
|
|
116
|
+
readonly identities: Readonly<Record<string, KeyNames>>;
|
|
117
|
+
/** The identities DECLARED HERE. See `ownFields`. */
|
|
118
|
+
readonly ownIdentities: Readonly<Record<string, KeyNames>>;
|
|
119
|
+
/** Every `index.*` child, inherited included; keyed by metamodel name. */
|
|
120
|
+
readonly indexes: Readonly<Record<string, KeyNames>>;
|
|
121
|
+
/** The indexes DECLARED HERE. See `ownFields`. */
|
|
122
|
+
readonly ownIndexes: Readonly<Record<string, KeyNames>>;
|
|
123
|
+
/** The nearest ancestor carrying an artifact of its own, when there is one. */
|
|
124
|
+
readonly superNames?: SuperNames | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* True when the primary source is the SUPER's rather than declared here — a TPH
|
|
127
|
+
* subtype, which shares its base's single table. Structural (the two resolve to the
|
|
128
|
+
* SAME source node), never an equality test on the resolved strings: the physical
|
|
129
|
+
* name, kind and schema then all come from the super's artifact rather than being
|
|
130
|
+
* restated.
|
|
131
|
+
*/
|
|
132
|
+
readonly inheritsSource: boolean;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The nearest ancestor of `obj` that carries a names artifact of its own, or undefined.
|
|
136
|
+
*
|
|
137
|
+
* Walks past an ancestor with nothing to contribute — an abstract marker with no fields,
|
|
138
|
+
* no keys and no source emits no artifact, so there is nothing to extend and the search
|
|
139
|
+
* continues upward rather than stopping at a name that does not exist.
|
|
140
|
+
*/
|
|
141
|
+
export declare function namesArtifactSuperOf(obj: MetaObject): MetaObject | undefined;
|
|
142
|
+
export declare function resolveObjectNames(obj: MetaObject, strategy?: ColumnNamingStrategy): ObjectNames | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* The names FRAGMENT for an object that a sourced object extends but which declares no
|
|
145
|
+
* source of its own — the `BaseEntity` pattern: shared fields, no table.
|
|
146
|
+
*
|
|
147
|
+
* Separate from {@link resolveObjectNames} on purpose, and the separation is the #248 rule
|
|
148
|
+
* intact rather than weakened. "Has a primary source" still decides whether an object is a
|
|
149
|
+
* database participant, so an `object.value` carrying fields resolves to nothing here as it
|
|
150
|
+
* always has. A fragment is emitted only for an object REACHED from a participant by
|
|
151
|
+
* walking `extends` upward — which is the only context in which its fields are columns at
|
|
152
|
+
* all. It carries no `kind`/`name`/`readOnly`, because it has no physical name and must
|
|
153
|
+
* never acquire one.
|
|
154
|
+
*
|
|
155
|
+
* Returns undefined when the object declares nothing of its own: an abstract marker has
|
|
156
|
+
* nothing to extend, and emitting an empty artifact for it would put a name in the import
|
|
157
|
+
* graph that says nothing. "Nothing" is {@link declaresNamesContent} — fields OR keys, the
|
|
158
|
+
* same question {@link namesArtifactSuperOf} asks, so the walk and the emit cannot disagree
|
|
159
|
+
* about which ancestors exist.
|
|
160
|
+
*/
|
|
161
|
+
export declare function resolveSuperFragmentNames(obj: MetaObject, strategy?: ColumnNamingStrategy): ObjectNames | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* §B2 — the shared builder every `<Object>Names` reference call site used to hand-roll:
|
|
164
|
+
* check whether the artifact exists in this run (`ctx.includeNames`), resolve the
|
|
165
|
+
* constant (`resolveObjectNames`), and build the ts-poet import symbol pointing at
|
|
166
|
+
* `<Object>.names.ts`. Returns undefined whenever the artifact does not exist for this
|
|
167
|
+
* object in this run — a PRESENCE guard ("is the artifact in this run at all"), never the
|
|
168
|
+
* divergence refusal that `primaryRdbSource` owns: this function never compares a
|
|
169
|
+
* resolved value to a literal, it only asks whether the constant exists.
|
|
170
|
+
*
|
|
171
|
+
* `fromPackage` is the package of the FILE BEING EMITTED — the file that will hold the
|
|
172
|
+
* `import { <Object>Names } from …` line — and defaults to `obj.package`, correct for
|
|
173
|
+
* every site that emits `obj`'s OWN module (the entity generator referencing its own
|
|
174
|
+
* names artifact, same object on both ends). A caller emitting a DIFFERENT object's file
|
|
175
|
+
* and reaching across packages for `obj`'s names artifact — an M:N routes file, which
|
|
176
|
+
* lives in the SOURCE entity's package, importing the junction/target's `<X>Names` — MUST
|
|
177
|
+
* pass the emitting file's own package explicitly. Making this an explicit parameter
|
|
178
|
+
* (rather than assuming same-package the way a plain sibling specifier does) is what
|
|
179
|
+
* surfaces that choice: see routes-file.ts's `resolveJunctionColumn`, the one site that
|
|
180
|
+
* got it wrong by assuming same-package.
|
|
181
|
+
*/
|
|
182
|
+
export declare function namesRef(obj: MetaObject, ctx: RenderContext, fromPackage?: string | undefined): {
|
|
183
|
+
readonly resolved: ObjectNames;
|
|
184
|
+
readonly symbol: Code;
|
|
185
|
+
} | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Adapts a `namesRef()` result to the `{ name, symbol }` shape `renderEntityConstants` /
|
|
188
|
+
* `renderEntityMetaFile` accept. Kept as a separate, narrower shape from `namesRef`'s own
|
|
189
|
+
* `{ resolved, symbol }` rather than folded together: those two functions' parameter
|
|
190
|
+
* predates this helper, and an adopter who already ejected the ADR-0034 reference
|
|
191
|
+
* template calls them with exactly this `{ name, symbol }` shape — widening the required
|
|
192
|
+
* shape to `resolved` would fail to compile in every such copy.
|
|
193
|
+
*/
|
|
194
|
+
export declare function namesConstArg(names: {
|
|
195
|
+
readonly resolved: ObjectNames;
|
|
196
|
+
readonly symbol: Code;
|
|
197
|
+
} | undefined, role?: string): {
|
|
198
|
+
readonly name: string;
|
|
199
|
+
readonly symbol: Code;
|
|
200
|
+
} | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* The physical-name expression every §A6 `$table` / view-name site builds: the constant
|
|
203
|
+
* when the artifact is present, the literal otherwise. No equality guard — but the two
|
|
204
|
+
* branches earn that two different ways, and both are worth naming:
|
|
205
|
+
*
|
|
206
|
+
* - A TABLE literal (`drizzle-schema.ts`, `entity-constants.ts`) comes from
|
|
207
|
+
* `dbTable`/`resolveTableName`, which delegate to `primaryRdbSource` — the same lookup
|
|
208
|
+
* `resolveObjectNames` uses — so a disagreeing object has already thrown.
|
|
209
|
+
* - A VIEW literal (`projection-decl.ts`, `view-decl.ts`) comes from `viewName()`
|
|
210
|
+
* (`extract-view-spec.ts`), which reads OWN read-only sources only. That cannot diverge:
|
|
211
|
+
* a concrete projection may not inherit a source (`ERR_PROJECTION_INHERITED_SOURCE`) and
|
|
212
|
+
* the loader allows one own primary, so there is nothing for it to disagree with.
|
|
213
|
+
*
|
|
214
|
+
* Either way a reference here is the single spelling, never a lookalike computed twice.
|
|
215
|
+
*
|
|
216
|
+
* `role` selects WHICH source — the parameter that did not exist while the artifact held
|
|
217
|
+
* one name. A write-through entity declares two physical names; passing `replica` is how
|
|
218
|
+
* the read view stops being a literal in TypeScript and C# alike.
|
|
219
|
+
*/
|
|
220
|
+
export declare function physicalNameExpr(names: {
|
|
221
|
+
readonly symbol: Code;
|
|
222
|
+
} | undefined, literal: string, obj: MetaObject, role?: string): Code;
|
|
223
|
+
/**
|
|
224
|
+
* The physical-name alias key for `obj`'s source in `role` — `table`, `view`, `proc`, …
|
|
225
|
+
*
|
|
226
|
+
* Derived from the object rather than taken as a parameter, so a call site cannot pass an
|
|
227
|
+
* alias that disagrees with the source it is describing. Reads the metamodel's own
|
|
228
|
+
* `PHYSICAL_NAME_ATTR_BY_KIND`; a local switch here would be a second answer to a
|
|
229
|
+
* question the metamodel already answers, which is the defect class this file exists for.
|
|
230
|
+
*/
|
|
231
|
+
export declare function sourceAliasOf(obj: MetaObject, role?: string): string | undefined;
|
|
232
|
+
/**
|
|
233
|
+
* A source's `@schema` expression, or undefined when the source declares none.
|
|
234
|
+
*
|
|
235
|
+
* Undefined rather than a literal fallback: an absent `@schema` means "the dialect's
|
|
236
|
+
* default", which a caller expresses by omitting the qualifier entirely — emitting `""`
|
|
237
|
+
* or `"public"` would be this artifact inventing a name the author never wrote.
|
|
238
|
+
*/
|
|
239
|
+
export declare function sourceSchemaExpr(names: {
|
|
240
|
+
readonly resolved: ObjectNames;
|
|
241
|
+
readonly symbol: Code;
|
|
242
|
+
} | undefined, role?: string): Code | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* An index's database-name expression — the constant when the artifact carries the node,
|
|
245
|
+
* the literal otherwise.
|
|
246
|
+
*
|
|
247
|
+
* The literal arm goes through `resolveIndexName` rather than reading `node.name`, so the
|
|
248
|
+
* names-off path and the names-on path answer with the same function. That is the whole
|
|
249
|
+
* lesson of `fdb4118f1`: two spellings of one name agree until they do not.
|
|
250
|
+
*/
|
|
251
|
+
export declare function indexNameExpr(names: {
|
|
252
|
+
readonly resolved: ObjectNames;
|
|
253
|
+
readonly symbol: Code;
|
|
254
|
+
} | undefined, node: {
|
|
255
|
+
readonly name: string;
|
|
256
|
+
readonly type: string;
|
|
257
|
+
readonly subType: string;
|
|
258
|
+
}): Code;
|
|
259
|
+
/**
|
|
260
|
+
* A field's physical-column expression: the constant when the given artifact carries the
|
|
261
|
+
* field, the literal otherwise.
|
|
262
|
+
*
|
|
263
|
+
* The literal arm is a PRESENCE guard — "no artifact in this run", the documented ADR-0034
|
|
264
|
+
* opt-out — and NOT a divergence guard. It used to carry a second sanctioned case: a TPH
|
|
265
|
+
* fold emitting a subtype's own columns, which the BASE's artifact never saw. That was
|
|
266
|
+
* never a presence question; the constant existed the whole time, in the subtype's own
|
|
267
|
+
* artifact. Callers now resolve the declaring entity's ref before falling back
|
|
268
|
+
* (`drizzle-schema.ts`), so a miss no longer has a known-good explanation and the fallback
|
|
269
|
+
* is the last resort it was meant to be.
|
|
270
|
+
*/
|
|
271
|
+
export declare function columnExpr(names: {
|
|
272
|
+
readonly resolved: ObjectNames;
|
|
273
|
+
readonly symbol: Code;
|
|
274
|
+
} | undefined, fieldName: string, literal: string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