@prisma/orm-framework 8.0.0-rc.14-dev.6 → 8.0.0-rc.14-dev.8
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/dist/{authoring-e9U_0LWr.mjs → authoring-Bn_5zI9q.mjs} +69 -3
- package/dist/authoring-Bn_5zI9q.mjs.map +1 -0
- package/dist/{authoring-BYbSOseC.d.mts → authoring-C9lq8UGN.d.mts} +18 -4
- package/dist/authoring-C9lq8UGN.d.mts.map +1 -0
- package/dist/{capabilities-ByvrTdNS-BGxo8i2x.mjs → capabilities-M-lvaPSE-BMffxZqu.mjs} +3 -3
- package/dist/{capabilities-ByvrTdNS-BGxo8i2x.mjs.map → capabilities-M-lvaPSE-BMffxZqu.mjs.map} +1 -1
- package/dist/{codec-BEFSHNvn.d.mts → codec-D67Y03B_.d.mts} +43 -3
- package/dist/codec-D67Y03B_.d.mts.map +1 -0
- package/dist/codec-DOPctnmd.mjs +155 -0
- package/dist/codec-DOPctnmd.mjs.map +1 -0
- package/dist/{codec-types-Da9WpgoM-BCn5_Sfz.mjs → codec-types-CMqWkP1t-CjK8Cwfr.mjs} +3 -2
- package/dist/codec-types-CMqWkP1t-CjK8Cwfr.mjs.map +1 -0
- package/dist/{codec-types-DjklYAo0-DL7hUdjg.d.mts → codec-types-DrcxdLlC-CDdDe0_A.d.mts} +15 -14
- package/dist/{codec-types-DjklYAo0-DL7hUdjg.d.mts.map → codec-types-DrcxdLlC-CDdDe0_A.d.mts.map} +1 -1
- package/dist/{components-Dzqm9cyw.mjs → components-0Tccse_E.mjs} +2 -2
- package/dist/{components-Dzqm9cyw.mjs.map → components-0Tccse_E.mjs.map} +1 -1
- package/dist/{components-ByqLhwPu.d.mts → components-utVOE0ha.d.mts} +4 -4
- package/dist/{components-ByqLhwPu.d.mts.map → components-utVOE0ha.d.mts.map} +1 -1
- package/dist/components.d.mts +17 -17
- package/dist/components.mjs +9 -9
- package/dist/components__authoring.d.mts +4 -4
- package/dist/components__authoring.mjs +3 -3
- package/dist/components__codec.d.mts +3 -3
- package/dist/components__codec.mjs +4 -4
- package/dist/components__components.d.mts +3 -3
- package/dist/components__components.mjs +2 -2
- package/dist/components__control.d.mts +3 -3
- package/dist/components__control.mjs +2 -2
- package/dist/components__emission.d.mts +3 -3
- package/dist/components__execution.d.mts +1 -1
- package/dist/components__psl-ast.d.mts +3 -3
- package/dist/components__runtime.d.mts +1 -1
- package/dist/{config-types-DtyK6o50.d.mts → config-types-Bb2Sf7YP.d.mts} +7 -7
- package/dist/{config-types-DtyK6o50.d.mts.map → config-types-Bb2Sf7YP.d.mts.map} +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config__config-types.d.mts +1 -1
- package/dist/contract-authoring.d.mts +3 -3
- package/dist/contract-authoring.mjs +1 -1
- package/dist/{control-DF8jHnId-DtQyLTBV.mjs → control-BaynP47g-Bg8xTRS3.mjs} +3 -2
- package/dist/{control-DF8jHnId-DtQyLTBV.mjs.map → control-BaynP47g-Bg8xTRS3.mjs.map} +1 -1
- package/dist/{control-DxiV2F-o-BYFWr0js.d.mts → control-CJlRO0fS-DW9k9mRB.d.mts} +3 -2
- package/dist/{control-DxiV2F-o-BYFWr0js.d.mts.map → control-CJlRO0fS-DW9k9mRB.d.mts.map} +1 -1
- package/dist/{control-Bcsnrolt.d.mts → control-CqwbImYs.d.mts} +9 -9
- package/dist/{control-Bcsnrolt.d.mts.map → control-CqwbImYs.d.mts.map} +1 -1
- package/dist/{control-D3KZOhJA.mjs → control-uVHmDgha.mjs} +11 -8
- package/dist/control-uVHmDgha.mjs.map +1 -0
- package/dist/{declarations-CgS5vnfJ-BF8KYLQE.mjs → declarations-CgS5vnfJ-Dhi3X7oU.mjs} +2 -2
- package/dist/{declarations-CgS5vnfJ-BF8KYLQE.mjs.map → declarations-CgS5vnfJ-Dhi3X7oU.mjs.map} +1 -1
- package/dist/emission-B9RTq119.d.mts +2 -0
- package/dist/{emission-types-Dw6MEgKF-C3SqCXsF.d.mts → emission-types-CND9Xi8O-BxLcJq2c.d.mts} +4 -5
- package/dist/{emission-types-Dw6MEgKF-C3SqCXsF.d.mts.map → emission-types-CND9Xi8O-BxLcJq2c.d.mts.map} +1 -1
- package/dist/errors.d.mts +4 -4
- package/dist/errors.mjs +4 -4
- package/dist/errors__control.d.mts +1 -1
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.d.mts +1 -1
- package/dist/errors__execution.mjs +1 -1
- package/dist/errors__migration.d.mts +2 -2
- package/dist/errors__migration.mjs +2 -2
- package/dist/{execution-DBMzfziV.mjs → execution-BMTSK2eG.mjs} +2 -2
- package/dist/{execution-DBMzfziV.mjs.map → execution-BMTSK2eG.mjs.map} +1 -1
- package/dist/{execution-CRDks27n.d.mts → execution-BVq3wWK_.d.mts} +2 -2
- package/dist/{execution-CRDks27n.d.mts.map → execution-BVq3wWK_.d.mts.map} +1 -1
- package/dist/{execution-DHCKWpXe.d.mts → execution-BiivimSo.d.mts} +3 -3
- package/dist/{execution-DHCKWpXe.d.mts.map → execution-BiivimSo.d.mts.map} +1 -1
- package/dist/{framework-authoring-Lssvcd3X-DsgKz6mc.d.mts → framework-authoring-50f3xfDT-BEB5Y_Vg.d.mts} +8 -4
- package/dist/{framework-authoring-Lssvcd3X-DsgKz6mc.d.mts.map → framework-authoring-50f3xfDT-BEB5Y_Vg.d.mts.map} +1 -1
- package/dist/{framework-components-DsX8Ixd8-x6Ii6iXZ.d.mts → framework-components-CHaw_oBm-B5HHh_b7.d.mts} +6 -6
- package/dist/{framework-components-DsX8Ixd8-x6Ii6iXZ.d.mts.map → framework-components-CHaw_oBm-B5HHh_b7.d.mts.map} +1 -1
- package/dist/ids.d.mts +1 -1
- package/dist/{migration-B-vxpJrb.mjs → migration-C8GCVMjt.mjs} +19 -3
- package/dist/{migration-B-vxpJrb.mjs.map → migration-C8GCVMjt.mjs.map} +1 -1
- package/dist/{migration-D4svpE2x.d.mts → migration-o0OGRAcI.d.mts} +13 -3
- package/dist/{migration-D4svpE2x.d.mts.map → migration-o0OGRAcI.d.mts.map} +1 -1
- package/dist/{mutation-default-types-BdWAzv0O-B51RYl-A.d.mts → mutation-default-types-B5ij1r12-DG0aqkcM.d.mts} +3 -3
- package/dist/{mutation-default-types-BdWAzv0O-B51RYl-A.d.mts.map → mutation-default-types-B5ij1r12-DG0aqkcM.d.mts.map} +1 -1
- package/dist/{parse-1owoiwHJ-Cxz_KES2.mjs → parse-1owoiwHJ-CqCnC7Qx.mjs} +2 -2
- package/dist/{parse-1owoiwHJ-Cxz_KES2.mjs.map → parse-1owoiwHJ-CqCnC7Qx.mjs.map} +1 -1
- package/dist/{parse-C54e9842-DPzx1t4P.d.mts → parse-C54e9842-D-fu5Z8Y.d.mts} +6 -6
- package/dist/{parse-C54e9842-DPzx1t4P.d.mts.map → parse-C54e9842-D-fu5Z8Y.d.mts.map} +1 -1
- package/dist/{psl-ast-Dte0XPl8-CXSWV9CL.d.mts → psl-ast-DPyStNWj-XiHYf17a.d.mts} +3 -3
- package/dist/{psl-ast-Dte0XPl8-CXSWV9CL.d.mts.map → psl-ast-DPyStNWj-XiHYf17a.d.mts.map} +1 -1
- package/dist/psl-ast-Dgvia310.d.mts +2 -0
- package/dist/psl-parser.d.mts +9 -9
- package/dist/psl-parser.mjs +2 -2
- package/dist/psl-parser__format.d.mts +1 -1
- package/dist/psl-parser__format.mjs +2 -2
- package/dist/psl-parser__interpret.d.mts +11 -7
- package/dist/psl-parser__interpret.d.mts.map +1 -1
- package/dist/psl-parser__interpret.mjs +18 -3
- package/dist/psl-parser__interpret.mjs.map +1 -1
- package/dist/psl-parser__syntax.d.mts +1 -1
- package/dist/psl-parser__syntax.mjs +2 -2
- package/dist/psl-printer.d.mts +4 -4
- package/dist/psl-printer.mjs +1 -1
- package/dist/{resolve-codec-C2_QCA7R-B0SgAw45.mjs → resolve-codec-CxRICgbr-BLdoRYJc.mjs} +15 -6
- package/dist/resolve-codec-CxRICgbr-BLdoRYJc.mjs.map +1 -0
- package/dist/{runtime-Bz3UqSoT.d.mts → runtime-DM3z02wq.d.mts} +2 -2
- package/dist/{runtime-Bz3UqSoT.d.mts.map → runtime-DM3z02wq.d.mts.map} +1 -1
- package/dist/{symbol-table-D4guXoTO-BH50Hbj4.d.mts → symbol-table-D4guXoTO-CS6SD0MP.d.mts} +4 -4
- package/dist/{symbol-table-D4guXoTO-BH50Hbj4.d.mts.map → symbol-table-D4guXoTO-CS6SD0MP.d.mts.map} +1 -1
- package/dist/{temporal-presets-yQzaI_83-DfMU1Lm2.d.mts → temporal-presets-C3IeyYNF-Dkn3gjfg.d.mts} +4 -4
- package/dist/{temporal-presets-yQzaI_83-DfMU1Lm2.d.mts.map → temporal-presets-C3IeyYNF-Dkn3gjfg.d.mts.map} +1 -1
- package/dist/{temporal-presets-DMRKrfIa-HElHwGB2.mjs → temporal-presets-DsGuaFyT-DWzKyja_.mjs} +12 -3
- package/dist/temporal-presets-DsGuaFyT-DWzKyja_.mjs.map +1 -0
- package/dist/text-1AbzksP9.mjs +17 -0
- package/dist/text-1AbzksP9.mjs.map +1 -0
- package/dist/text-3bjr4s7K.d.mts +11 -0
- package/dist/text-3bjr4s7K.d.mts.map +1 -0
- package/dist/{types-import-spec-DmTizf98-qPzF424S.d.mts → types-import-spec-D-EPunhV-DxmpFe3l.d.mts} +3 -3
- package/dist/{types-import-spec-DmTizf98-qPzF424S.d.mts.map → types-import-spec-D-EPunhV-DxmpFe3l.d.mts.map} +1 -1
- package/dist/utils.d.mts +2 -1
- package/dist/utils.mjs +2 -1
- package/dist/utils__text.d.mts +2 -0
- package/dist/utils__text.mjs +2 -0
- package/package.json +16 -15
- package/dist/authoring-BYbSOseC.d.mts.map +0 -1
- package/dist/authoring-e9U_0LWr.mjs.map +0 -1
- package/dist/codec-BEFSHNvn.d.mts.map +0 -1
- package/dist/codec-BWFxotS7.mjs +0 -70
- package/dist/codec-BWFxotS7.mjs.map +0 -1
- package/dist/codec-types-Da9WpgoM-BCn5_Sfz.mjs.map +0 -1
- package/dist/control-D3KZOhJA.mjs.map +0 -1
- package/dist/emission-JIkHzrsz.d.mts +0 -2
- package/dist/psl-ast-BOzFRzI0.d.mts +0 -2
- package/dist/resolve-codec-C2_QCA7R-B0SgAw45.mjs.map +0 -1
- package/dist/temporal-presets-DMRKrfIa-HElHwGB2.mjs.map +0 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { r as isInternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
2
|
+
import { t as canonicalStringify } from "./canonical-stringify-DY4NaAJi.mjs";
|
|
1
3
|
import { t as canonicalizeJson } from "./canonicalize-json-ZPawceQR-Dua1VNEB.mjs";
|
|
2
|
-
import {
|
|
4
|
+
import { C as isAuthoringTypeConstructorDescriptor, _ as instantiateAuthoringTypeConstructor, b as isAuthoringFieldPresetDescriptor, m as hasRegisteredFieldNamespace, v as isAuthoringArgRef } from "./temporal-presets-DsGuaFyT-DWzKyja_.mjs";
|
|
3
5
|
//#region ../../../1-framework/1-core/framework-components/dist/authoring.mjs
|
|
4
6
|
function* typeConstructors(namespace, path = []) {
|
|
5
7
|
for (const [name, value] of Object.entries(namespace)) if (isAuthoringTypeConstructorDescriptor(value)) yield {
|
|
@@ -53,6 +55,70 @@ function findAuthoringTypeConstructorCall(namespace, output) {
|
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Reads the members of an `enum` block through its codec. A bare member is read from its own name.
|
|
60
|
+
* Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members
|
|
61
|
+
* store the same value, or when the block has no members. Shared by every family's enum factory.
|
|
62
|
+
*/
|
|
63
|
+
function readEnumBlockMembers(block, codecId, codec, ctx) {
|
|
64
|
+
const sourceId = ctx.sourceId ?? "unknown";
|
|
65
|
+
const diagnostics = ctx.diagnostics;
|
|
66
|
+
const memberByStoredValue = /* @__PURE__ */ new Map();
|
|
67
|
+
const members = [];
|
|
68
|
+
let memberError = false;
|
|
69
|
+
for (const [memberName, memberValue] of Object.entries(block.values)) {
|
|
70
|
+
const span = block.parameterSpans[memberName] ?? block.span;
|
|
71
|
+
const written = memberValue === void 0 ? memberName : memberValue;
|
|
72
|
+
let read;
|
|
73
|
+
try {
|
|
74
|
+
read = codec.decodeJson(written);
|
|
75
|
+
} catch (err) {
|
|
76
|
+
if (isInternalError(err)) throw err;
|
|
77
|
+
diagnostics?.push(memberValue === void 0 ? {
|
|
78
|
+
code: "PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC",
|
|
79
|
+
message: `enum "${block.name}" member "${memberName}" has no value and codec "${codecId}" does not accept a bare name as input`,
|
|
80
|
+
sourceId,
|
|
81
|
+
span
|
|
82
|
+
} : {
|
|
83
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
84
|
+
message: `enum "${block.name}" member "${memberName}" was rejected by codec "${codecId}": ${err instanceof Error ? err.message : String(err)}`,
|
|
85
|
+
sourceId,
|
|
86
|
+
span
|
|
87
|
+
});
|
|
88
|
+
memberError = true;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const stored = codec.encodeJson(read);
|
|
92
|
+
const storedKey = canonicalStringify(stored);
|
|
93
|
+
const earlier = memberByStoredValue.get(storedKey);
|
|
94
|
+
if (earlier !== void 0) {
|
|
95
|
+
diagnostics?.push({
|
|
96
|
+
code: "PSL_ENUM_DUPLICATE_MEMBER_VALUE",
|
|
97
|
+
message: `enum "${block.name}": members "${earlier}" and "${memberName}" both store ${JSON.stringify(stored)}`,
|
|
98
|
+
sourceId,
|
|
99
|
+
span
|
|
100
|
+
});
|
|
101
|
+
memberError = true;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
memberByStoredValue.set(storedKey, memberName);
|
|
105
|
+
members.push({
|
|
106
|
+
name: memberName,
|
|
107
|
+
value: read
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (memberError) return void 0;
|
|
111
|
+
if (members.length === 0) {
|
|
112
|
+
diagnostics?.push({
|
|
113
|
+
code: "PSL_ENUM_MISSING_TYPE",
|
|
114
|
+
message: `enum "${block.name}" must have at least one member`,
|
|
115
|
+
sourceId,
|
|
116
|
+
span: block.span
|
|
117
|
+
});
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
return members;
|
|
121
|
+
}
|
|
56
122
|
function presetSpellingsUnder(members, prefix) {
|
|
57
123
|
return Object.entries(members).flatMap(([name, member]) => isAuthoringFieldPresetDescriptor(member) ? [`${prefix}.${name}(${(member.args ?? []).map((arg, index) => arg.name ?? `argument${index + 1}`).join(", ")})`] : presetSpellingsUnder(member, `${prefix}.${name}`));
|
|
58
124
|
}
|
|
@@ -94,6 +160,6 @@ function checkUncomposedNamespace(attributeName, composedExtensions, context) {
|
|
|
94
160
|
return namespace;
|
|
95
161
|
}
|
|
96
162
|
//#endregion
|
|
97
|
-
export { getAuthoringFieldPreset as i, fieldPresetSpellings as n, findAuthoringTypeConstructorCall as r, checkUncomposedNamespace as t };
|
|
163
|
+
export { readEnumBlockMembers as a, getAuthoringFieldPreset as i, fieldPresetSpellings as n, findAuthoringTypeConstructorCall as r, checkUncomposedNamespace as t };
|
|
98
164
|
|
|
99
|
-
//# sourceMappingURL=authoring-
|
|
165
|
+
//# sourceMappingURL=authoring-Bn_5zI9q.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-Bn_5zI9q.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/authoring.mjs"],"sourcesContent":["import { t as canonicalizeJson } from \"./canonicalize-json-ZPawceQR.mjs\";\nimport { A as isAuthoringTypeConstructorDescriptor, C as instantiateAuthoringFieldPreset, D as isAuthoringFieldPresetDescriptor, E as isAuthoringEntityTypeDescriptor, F as validateAuthoringHelperArguments, M as mergeAuthoringNamespaces, N as resolveAuthoringTemplateValue, O as isAuthoringModelAttributeDescriptor, P as resolveEnumCodecId, S as instantiateAuthoringEntityType, T as isAuthoringArgRef, a as temporalCodecPreset, b as getAuthoringTypeConstructor, d as printTaggedLiteral, g as classifyEnumMemberType, h as assertResolvableTypeConstructorTemplates, i as temporalAuthoringPresets, k as isAuthoringPslBlockDescriptor, m as assertNoCrossRegistryCollisions, n as TEMPORAL_ON_UPDATE_ARG, o as temporalPhaseTemplate, r as TIMESTAMP_NOW_GENERATOR_ID, t as TEMPORAL_ON_CREATE_ARG, v as collectScalarTypeConstructors, w as instantiateAuthoringTypeConstructor, x as hasRegisteredFieldNamespace, y as flushAuthoringWarnings } from \"./temporal-presets-DsGuaFyT.mjs\";\nimport { isInternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\n//#region src/shared/authoring-type-constructor-call.ts\nfunction* typeConstructors(namespace, path = []) {\n\tfor (const [name, value] of Object.entries(namespace)) if (isAuthoringTypeConstructorDescriptor(value)) yield {\n\t\tpath: [...path, name],\n\t\tdescriptor: value\n\t};\n\telse yield* typeConstructors(value, [...path, name]);\n}\nfunction produces(produced, wanted) {\n\tconst wantedFields = {\n\t\t...wanted,\n\t\ttypeParams: wanted.typeParams ?? {}\n\t};\n\treturn Object.entries({\n\t\t...produced,\n\t\ttypeParams: produced.typeParams ?? {}\n\t}).every(([key, value]) => canonicalizeJson(value) === canonicalizeJson(wantedFields[key]));\n}\n/**\n* The arguments that make `descriptor` produce exactly `output`, when each of its type parameters\n* comes straight from one argument; `undefined` when it cannot produce `output`, including when\n* `output` has no value for an argument the constructor requires.\n*/\nfunction argumentsFor(descriptor, output) {\n\tif (descriptor.entityRefArg !== void 0 || descriptor.output.codecId !== output.codecId) return;\n\tconst args = [];\n\tfor (const [key, template] of Object.entries(descriptor.output.typeParams ?? {})) {\n\t\tconst value = output.typeParams?.[key];\n\t\tif (value !== void 0 && isAuthoringArgRef(template) && template.path === void 0) args[template.index] = value;\n\t}\n\tconst requiredArgs = (descriptor.args ?? []).filter((arg) => arg.optional !== true).length;\n\tif (args.length < requiredArgs || Array.from(args).includes(void 0)) return void 0;\n\ttry {\n\t\treturn produces(instantiateAuthoringTypeConstructor(descriptor, args), output) ? args : void 0;\n\t} catch {\n\t\treturn;\n\t}\n}\n/**\n* The first call, in namespace order, to a type constructor in `namespace` that produces exactly\n* `output`. The inverse of {@link instantiateAuthoringTypeConstructor} for constructors whose type\n* parameters each come straight from one argument. A constructor whose argument names another\n* entity is never chosen. `undefined` when no call produces `output`.\n*/\nfunction findAuthoringTypeConstructorCall(namespace, output) {\n\tfor (const { path, descriptor } of typeConstructors(namespace)) {\n\t\tconst args = argumentsFor(descriptor, output);\n\t\tif (args !== void 0) return {\n\t\t\tpath,\n\t\t\targs\n\t\t};\n\t}\n}\n//#endregion\n//#region src/shared/enum-block-members.ts\n/**\n* Reads the members of an `enum` block through its codec. A bare member is read from its own name.\n* Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members\n* store the same value, or when the block has no members. Shared by every family's enum factory.\n*/\nfunction readEnumBlockMembers(block, codecId, codec, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst memberByStoredValue = /* @__PURE__ */ new Map();\n\tconst members = [];\n\tlet memberError = false;\n\tfor (const [memberName, memberValue] of Object.entries(block.values)) {\n\t\tconst span = block.parameterSpans[memberName] ?? block.span;\n\t\tconst written = memberValue === void 0 ? memberName : memberValue;\n\t\tlet read;\n\t\ttry {\n\t\t\tread = codec.decodeJson(written);\n\t\t} catch (err) {\n\t\t\tif (isInternalError(err)) throw err;\n\t\t\tdiagnostics?.push(memberValue === void 0 ? {\n\t\t\t\tcode: \"PSL_ENUM_BARE_MEMBER_NON_STRING_CODEC\",\n\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t} : {\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${err instanceof Error ? err.message : String(err)}`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst stored = codec.encodeJson(read);\n\t\tconst storedKey = canonicalStringify(stored);\n\t\tconst earlier = memberByStoredValue.get(storedKey);\n\t\tif (earlier !== void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\": members \"${earlier}\" and \"${memberName}\" both store ${JSON.stringify(stored)}`,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tmemberByStoredValue.set(storedKey, memberName);\n\t\tmembers.push({\n\t\t\tname: memberName,\n\t\t\tvalue: read\n\t\t});\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_TYPE\",\n\t\t\tmessage: `enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn members;\n}\n//#endregion\n//#region src/shared/field-preset-resolution.ts\nfunction presetSpellingsUnder(members, prefix) {\n\treturn Object.entries(members).flatMap(([name, member]) => isAuthoringFieldPresetDescriptor(member) ? [`${prefix}.${name}(${(member.args ?? []).map((arg, index) => arg.name ?? `argument${index + 1}`).join(\", \")})`] : presetSpellingsUnder(member, `${prefix}.${name}`));\n}\n/**\n* How each field preset registered under `namespace`, at any depth, is written, with the names of its arguments: `temporal.timestamp(onCreate, onUpdate)`.\n*/\nfunction fieldPresetSpellings(contributions, namespace) {\n\tconst members = contributions?.field?.[namespace];\n\tif (members === void 0 || isAuthoringFieldPresetDescriptor(members)) return [];\n\treturn presetSpellingsUnder(members, namespace);\n}\n/**\n* Walks `authoringContributions.field` segment by segment and returns the field-preset descriptor at the path, or `undefined` when none is registered there.\n*/\nfunction getAuthoringFieldPreset(contributions, path) {\n\tlet current = contributions?.field;\n\tfor (const segment of path) {\n\t\tif (typeof current !== \"object\" || current === null || \"kind\" in current) return;\n\t\tcurrent = current[segment];\n\t}\n\treturn current !== void 0 && isAuthoringFieldPresetDescriptor(current) ? current : void 0;\n}\n/**\n* Returns the namespace prefix of `attributeName` when it names an extension namespace that is not composed, otherwise `undefined`. A namespace is recognized when it is:\n*\n* - `db` (native-type spec, always allowed),\n* - the active family id,\n* - the active target id,\n* - a registered field-preset namespace (e.g. `temporal`),\n* - present in `composedExtensions`.\n*\n* Family, target, and field-preset namespaces are exempt so an attribute that does not exist under them surfaces as an unsupported attribute rather than as an uncomposed extension namespace.\n*/\nfunction checkUncomposedNamespace(attributeName, composedExtensions, context) {\n\tconst dotIndex = attributeName.indexOf(\".\");\n\tif (dotIndex <= 0 || dotIndex === attributeName.length - 1) return;\n\tconst namespace = attributeName.slice(0, dotIndex);\n\tif (namespace === \"db\" || namespace === context?.familyId || namespace === context?.targetId || hasRegisteredFieldNamespace(context?.authoringContributions, namespace) || composedExtensions.has(namespace)) return;\n\treturn namespace;\n}\n//#endregion\nexport { TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, checkUncomposedNamespace, classifyEnumMemberType, collectScalarTypeConstructors, fieldPresetSpellings, findAuthoringTypeConstructorCall, flushAuthoringWarnings, getAuthoringFieldPreset, getAuthoringTypeConstructor, hasRegisteredFieldNamespace, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, mergeAuthoringNamespaces, printTaggedLiteral, readEnumBlockMembers, resolveAuthoringTemplateValue, resolveEnumCodecId, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, validateAuthoringHelperArguments };\n\n//# sourceMappingURL=authoring.mjs.map"],"mappings":";;;;;AAKA,UAAU,iBAAiB,WAAW,OAAO,CAAC,GAAG;CAChD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,SAAS,GAAG,IAAI,qCAAqC,KAAK,GAAG,MAAM;EAC7G,MAAM,CAAC,GAAG,MAAM,IAAI;EACpB,YAAY;CACb;MACK,OAAO,iBAAiB,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC;AACpD;AACA,SAAS,SAAS,UAAU,QAAQ;CACnC,MAAM,eAAe;EACpB,GAAG;EACH,YAAY,OAAO,cAAc,CAAC;CACnC;CACA,OAAO,OAAO,QAAQ;EACrB,GAAG;EACH,YAAY,SAAS,cAAc,CAAC;CACrC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,WAAW,iBAAiB,KAAK,MAAM,iBAAiB,aAAa,IAAI,CAAC;AAC3F;;;;;;AAMA,SAAS,aAAa,YAAY,QAAQ;CACzC,IAAI,WAAW,iBAAiB,KAAK,KAAK,WAAW,OAAO,YAAY,OAAO,SAAS;CACxF,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,WAAW,OAAO,cAAc,CAAC,CAAC,GAAG;EACjF,MAAM,QAAQ,OAAO,aAAa;EAClC,IAAI,UAAU,KAAK,KAAK,kBAAkB,QAAQ,KAAK,SAAS,SAAS,KAAK,GAAG,KAAK,SAAS,SAAS;CACzG;CACA,MAAM,gBAAgB,WAAW,QAAQ,CAAC,EAAA,CAAG,QAAQ,QAAQ,IAAI,aAAa,IAAI,CAAC,CAAC;CACpF,IAAI,KAAK,SAAS,gBAAgB,MAAM,KAAK,IAAI,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,OAAO,KAAK;CACjF,IAAI;EACH,OAAO,SAAS,oCAAoC,YAAY,IA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AAc,MAAM,GAAG,QAAQ;CACjD,IAAI,cAAc,QAAQ,cAAc,SAAS,YAAY,cAAc,SAAS,YAAY,4BAA4B,SAAS,wBAAwB,SAAS,KAAK,mBAAmB,IAAI,SAAS,GAAG;CAC9M,OAAO;AACR"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
1
|
+
import { V as JsonValue } from "./domain-envelope-gHv58hD1-B8mta2A6.mjs";
|
|
2
|
+
import { i as Codec } from "./codec-types-DrcxdLlC-CDdDe0_A.mjs";
|
|
3
|
+
import { F as ParsedPslExtensionBlock, a as AuthoringContributions, et as instantiateAuthoringTypeConstructor, k as AuthoringTypeNamespace, p as AuthoringFieldPresetDescriptor, s as AuthoringEntityContext } from "./framework-authoring-50f3xfDT-BEB5Y_Vg.mjs";
|
|
4
|
+
import "./temporal-presets-C3IeyYNF-Dkn3gjfg.mjs";
|
|
3
5
|
//#region ../../../1-framework/1-core/framework-components/dist/authoring.d.mts
|
|
4
6
|
//#region src/shared/authoring-type-constructor-call.d.ts
|
|
5
7
|
/** What a type constructor call produces for a column. */
|
|
@@ -17,6 +19,18 @@ interface AuthoringTypeConstructorCall {
|
|
|
17
19
|
*/
|
|
18
20
|
declare function findAuthoringTypeConstructorCall(namespace: AuthoringTypeNamespace, output: AuthoringTypeConstructorOutput): AuthoringTypeConstructorCall | undefined;
|
|
19
21
|
//#endregion
|
|
22
|
+
//#region src/shared/enum-block-members.d.ts
|
|
23
|
+
interface EnumBlockMember {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly value: unknown;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Reads the members of an `enum` block through its codec. A bare member is read from its own name.
|
|
29
|
+
* Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members
|
|
30
|
+
* store the same value, or when the block has no members. Shared by every family's enum factory.
|
|
31
|
+
*/
|
|
32
|
+
declare function readEnumBlockMembers(block: ParsedPslExtensionBlock<Readonly<Record<string, JsonValue | undefined>>>, codecId: string, codec: Codec, ctx: AuthoringEntityContext): readonly EnumBlockMember[] | undefined;
|
|
33
|
+
//#endregion
|
|
20
34
|
//#region src/shared/field-preset-resolution.d.ts
|
|
21
35
|
/**
|
|
22
36
|
* How each field preset registered under `namespace`, at any depth, is written, with the names of its arguments: `temporal.timestamp(onCreate, onUpdate)`.
|
|
@@ -43,5 +57,5 @@ declare function checkUncomposedNamespace(attributeName: string, composedExtensi
|
|
|
43
57
|
readonly authoringContributions?: AuthoringContributions | undefined;
|
|
44
58
|
}): string | undefined;
|
|
45
59
|
//#endregion
|
|
46
|
-
export {
|
|
47
|
-
//# sourceMappingURL=authoring-
|
|
60
|
+
export { fieldPresetSpellings as a, readEnumBlockMembers as c, checkUncomposedNamespace as i, AuthoringTypeConstructorOutput as n, findAuthoringTypeConstructorCall as o, EnumBlockMember as r, getAuthoringFieldPreset as s, AuthoringTypeConstructorCall as t };
|
|
61
|
+
//# sourceMappingURL=authoring-C9lq8UGN.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-C9lq8UGN.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/authoring.d.mts"],"mappings":";;;;;;;KAMK,iCAAiC,kBAAkB;;UAE9C;WACC;WACA;;;;;;;;iBAQM,iCAAiC,WAAW,wBAAwB,QAAQ,iCAAiC;;;UAGpH;WACC;WACA;;;;;;;iBAOM,qBAAqB,OAAO,wBAAwB,SAAS,eAAe,0BAA0B,iBAAiB,OAAO,OAAO,KAAK,kCAAkC;;;;;;iBAM5K,qBAAqB,eAAe,oCAAoC;;;;iBAIxE,wBAAwB,eAAe,oCAAoC,0BAA0B;;;;;;;;;;;;iBAYrG,yBAAyB,uBAAuB,oBAAoB,qBAAqB;WAC/F;WACA;WACA,yBAAyB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
-
import { n as isCodecTrait } from "./codec-types-
|
|
3
|
-
//#region ../../../1-framework/1-core/framework-components/dist/capabilities-
|
|
2
|
+
import { n as isCodecTrait } from "./codec-types-CMqWkP1t-CjK8Cwfr.mjs";
|
|
3
|
+
//#region ../../../1-framework/1-core/framework-components/dist/capabilities-M-lvaPSE.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Ownership key of an `(operation, input)` pair. Two descriptors sharing a key are two contributors claiming one overload, which is a composition error.
|
|
6
6
|
*/
|
|
@@ -117,4 +117,4 @@ function mergeCapabilityMatrices(base, contributors) {
|
|
|
117
117
|
//#endregion
|
|
118
118
|
export { mergeCapabilityMatrices as a, isNoInputAggregateDescriptor as i, isAggregateDescriptor as n, isAnyInputAggregateDescriptor as r, aggregateDescriptorKey as t };
|
|
119
119
|
|
|
120
|
-
//# sourceMappingURL=capabilities-
|
|
120
|
+
//# sourceMappingURL=capabilities-M-lvaPSE-BMffxZqu.mjs.map
|
package/dist/{capabilities-ByvrTdNS-BGxo8i2x.mjs.map → capabilities-M-lvaPSE-BMffxZqu.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities-
|
|
1
|
+
{"version":3,"file":"capabilities-M-lvaPSE-BMffxZqu.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/capabilities-M-lvaPSE.mjs"],"sourcesContent":["import { n as isCodecTrait } from \"./codec-types-CMqWkP1t.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/shared/aggregate-descriptor.ts\n/**\n* Ownership key of an `(operation, input)` pair. Two descriptors sharing a key are two contributors claiming one overload, which is a composition error.\n*/\nfunction aggregateDescriptorKey(descriptor) {\n\tswitch (descriptor.input.kind) {\n\t\tcase \"none\": return `${descriptor.operation}:none`;\n\t\tcase \"any\": return `${descriptor.operation}:any`;\n\t\tcase \"codec\": return `${descriptor.operation}:codec:${descriptor.input.codecId}`;\n\t\tcase \"trait\": return `${descriptor.operation}:trait:${descriptor.input.trait}`;\n\t}\n}\n/** Whether `descriptor` is the overload of an operation that consumes no value — the case whose result always names a codec outright. */\nfunction isNoInputAggregateDescriptor(descriptor) {\n\treturn descriptor.input.kind === \"none\";\n}\n/** Whether `descriptor` answers regardless of input — the fallback rung of resolution. */\nfunction isAnyInputAggregateDescriptor(descriptor) {\n\treturn descriptor.input.kind === \"any\";\n}\nfunction isObjectLike(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction isNonEmptyString(value) {\n\treturn typeof value === \"string\" && value.length > 0;\n}\nfunction isAggregateInputMatch(value) {\n\tif (!isObjectLike(value) || !(\"kind\" in value)) return false;\n\tswitch (value.kind) {\n\t\tcase \"none\":\n\t\tcase \"any\": return true;\n\t\tcase \"codec\": return \"codecId\" in value && isNonEmptyString(value.codecId);\n\t\tcase \"trait\": return \"trait\" in value && isCodecTrait(value.trait);\n\t\tdefault: return false;\n\t}\n}\nfunction isAggregateOutputCodec(value) {\n\tif (!isObjectLike(value) || !(\"kind\" in value)) return false;\n\tswitch (value.kind) {\n\t\tcase \"self\": return true;\n\t\tcase \"codec\": return \"codecId\" in value && isNonEmptyString(value.codecId) && (!(\"typeParams\" in value) || value.typeParams === void 0 || typeof value.typeParams === \"function\");\n\t\tdefault: return false;\n\t}\n}\n/**\n* Structural validation of a contributed descriptor. Components assembled from JavaScript reach the contribution slot unchecked, so composition validates the shape once and every later read is a plain lookup.\n*/\nfunction isAggregateDescriptor(value) {\n\tif (!isObjectLike(value)) return false;\n\tif (!(\"operation\" in value) || !isNonEmptyString(value.operation)) return false;\n\tif (!(\"nullable\" in value) || typeof value.nullable !== \"boolean\") return false;\n\tif (value.nullable === false && (!(\"emptyResultJson\" in value) || value.emptyResultJson === void 0)) return false;\n\tif (!(\"input\" in value) || !isAggregateInputMatch(value.input)) return false;\n\tif (!(\"output\" in value) || !isAggregateOutputCodec(value.output)) return false;\n\treturn value.input.kind === \"codec\" || value.input.kind === \"trait\" || value.output.kind === \"codec\";\n}\n//#endregion\n//#region src/shared/capabilities.ts\n/**\n* Capability matrix merge primitive shared by emit-time and runtime stack composition.\n*\n* The CLI's `enrichContract` and the SQL runtime's `createExecutionContext` both need\n* to fold a stack of component descriptors' `capabilities` declarations into a single\n* matrix keyed by namespace. Keeping the primitive here lets both call sites stay\n* byte-for-byte consistent without one depending on the other.\n*/\nfunction isPlainObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction sortDeep(value) {\n\tif (Array.isArray(value)) return value.map(sortDeep);\n\tif (!isPlainObject(value)) return value;\n\tconst entries = Object.entries(value).sort(([a], [b]) => a.localeCompare(b));\n\tconst next = {};\n\tfor (const [key, child] of entries) next[key] = sortDeep(child);\n\treturn next;\n}\nfunction extractCapabilityMatrix(value) {\n\tif (!isPlainObject(value)) return {};\n\tconst out = {};\n\tfor (const [namespace, maybeCaps] of Object.entries(value)) {\n\t\tif (!isPlainObject(maybeCaps)) continue;\n\t\tconst caps = {};\n\t\tfor (const [key, flag] of Object.entries(maybeCaps)) if (typeof flag === \"boolean\") caps[key] = flag;\n\t\tif (Object.keys(caps).length > 0) out[namespace] = caps;\n\t}\n\treturn out;\n}\n/**\n* Merge an ordered list of contributor capability declarations into a base matrix.\n*\n* Behaviour:\n* - `base` and each contributor's `capabilities` are filtered through the same\n* structural extraction: non-plain-object namespace blocks are dropped,\n* non-boolean leaves inside a namespace block are dropped, and a namespace\n* block that ends up with zero boolean leaves is omitted entirely (so a\n* later contributor with a malformed namespace cannot erase a namespace\n* already present in `base`).\n* - Non-plain-object `capabilities` on a contributor (including `undefined`,\n* `null`, arrays, primitives) are skipped silently — the contributor\n* contributes nothing.\n* - Later contributors win on `(namespace, key)` collisions.\n* - The returned object is fresh — neither `base` nor any contributor is mutated.\n* - Output keys are sorted lexicographically at every plain-object level.\n*/\nfunction mergeCapabilityMatrices(base, contributors) {\n\tconst merged = extractCapabilityMatrix(base);\n\tfor (const contributor of contributors) {\n\t\tconst extracted = extractCapabilityMatrix(contributor.capabilities);\n\t\tfor (const [namespace, capabilities] of Object.entries(extracted)) merged[namespace] = {\n\t\t\t...merged[namespace] ?? {},\n\t\t\t...capabilities\n\t\t};\n\t}\n\treturn blindCast(sortDeep(merged));\n}\n//#endregion\nexport { isNoInputAggregateDescriptor as a, isAnyInputAggregateDescriptor as i, aggregateDescriptorKey as n, isAggregateDescriptor as r, mergeCapabilityMatrices as t };\n\n//# sourceMappingURL=capabilities-M-lvaPSE.mjs.map"],"mappings":";;;;;;AAMA,SAAS,uBAAuB,YAAY;CAC3C,QAAQ,WAAW,MAAM,MAAzB;EACC,KAAK,QAAQ,OAAO,GAAG,WAAW,UAAU;EAC5C,KAAK,OAAO,OAAO,GAAG,WAAW,UAAU;EAC3C,KAAK,SAAS,OAAO,GAAG,WAAW,UAAU,SAAS,WAAW,MAAM;EACvE,KAAK,SAAS,OAAO,GAAG,WAAW,UAAU,SAAS,WAAW,MAAM;CACxE;AACD;;AAEA,SAAS,6BAA6B,YAAY;CACjD,OAAO,WAAW,MAAM,SAAS;AAClC;;AAEA,SAAS,8BAA8B,YAAY;CAClD,OAAO,WAAW,MAAM,SAAS;AAClC;AACA,SAAS,aAAa,OAAO;CAC5B,OAAO,OAAO,UAAU,YAAY,UAAU;AAC/C;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACpD;AACA,SAAS,sBAAsB,OAAO;CACrC,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE,UAAU,QAAQ,OAAO;CACvD,QAAQ,MAAM,MAAd;EACC,KAAK;EACL,KAAK,OAAO,OAAO;EACnB,KAAK,SAAS,OAAO,aAAa,SAAS,iBAAiB,MAAM,OAAO;EACzE,KAAK,SAAS,OAAO,WAAW,SAAS,aAAa,MAAM,KAAK;EACjE,SAAS,OAAO;CACjB;AACD;AACA,SAAS,uBAAuB,OAAO;CACtC,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE,UAAU,QAAQ,OAAO;CACvD,QAAQ,MAAM,MAAd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CAAC;CACb,KAAK,MAAM,CAAC,WAAW,cAAc,OAAO,QAAQ,KAAK,GAAG;EAC3D,IAAI,CAAC,cAAc,SAAS,GAAG;EAC/B,MAAM,OAAO,CAAC;EACd,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,QAAQ,SAAS,GAAG,IAAI,OAAO,SAAS,WAAW,KAAK,OAAO;EAChG,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,GAAG,IAAI,aAAa;CACpD;CACA,OAAO;AACR;;;;;;;;;;;;;;;;;;AAkBA,SAAS,wBAAwB,MAAM,cAAc;CACpD,MAAM,SAAS,wBAAwB,IAAI;CAC3C,KAAK,MAAM,eAAe,cAAc;EACvC,MAAM,YAAY,wBAAwB,YAAY,YAAY;EAClE,KAAK,MAAM,CAAC,WAAW,iBAAiB,OAAO,QAAQ,SAAS,GAAG,OAAO,aAAa;GACtF,GAAG,OAAO,cAAc,CAAC;GACzB,GAAG;EACJ;CACD;CACA,OAAO,UAAU,SAAS,MAAM,CAAC;AAClC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { V as JsonValue, nt as ValueSetRef } from "./domain-envelope-gHv58hD1-B8mta2A6.mjs";
|
|
2
|
-
import { c as CodecDescriptorTemplate, d as CodecInstanceContext, i as Codec,
|
|
2
|
+
import { c as CodecDescriptorTemplate, d as CodecInstanceContext, i as Codec, m as CodecRef, p as CodecLookupWithDescriptors, t as AnyCodecDescriptor } from "./codec-types-DrcxdLlC-CDdDe0_A.mjs";
|
|
3
3
|
//#region ../../../1-framework/1-core/framework-components/dist/codec.d.mts
|
|
4
4
|
//#region src/shared/column-spec.d.ts
|
|
5
5
|
/**
|
|
@@ -67,6 +67,42 @@ type ColumnHelperForStrict<D extends CodecDescriptorTemplate<any>> = (...args: a
|
|
|
67
67
|
*/
|
|
68
68
|
type ColumnHelperParams<D extends CodecDescriptorTemplate<any>> = Parameters<D['factory']>[0] extends Record<string, unknown> ? Parameters<D['factory']>[0] : undefined;
|
|
69
69
|
//#endregion
|
|
70
|
+
//#region src/shared/decode-json.d.ts
|
|
71
|
+
/**
|
|
72
|
+
* The refusal every `decodeJson` raises: `RUNTIME.DECODE_FAILED`, `<codecId> JSON value must be <expected>`, with `meta.codecId` and `meta.received`, the value it was given as JSON text, cut to 100 characters.
|
|
73
|
+
*/
|
|
74
|
+
declare function refuseJsonValue(codecId: string, expected: string, json: JsonValue): never;
|
|
75
|
+
declare function decodeJsonString(codecId: string, json: JsonValue): string;
|
|
76
|
+
/** Reads a JSON string that matches `pattern`; `form` names what the pattern accepts, for the refusal. */
|
|
77
|
+
declare function decodeJsonMatching(codecId: string, json: JsonValue, pattern: RegExp, form: string): string;
|
|
78
|
+
declare function decodeJsonBoolean(codecId: string, json: JsonValue): boolean;
|
|
79
|
+
interface IntegerRange {
|
|
80
|
+
readonly min: number;
|
|
81
|
+
readonly max: number;
|
|
82
|
+
}
|
|
83
|
+
/** Whether `value` is an integer within `range`, its ends included. */
|
|
84
|
+
declare function isIntegerIn(value: unknown, range: IntegerRange): value is number;
|
|
85
|
+
/** The integers a JavaScript `number` holds exactly. */
|
|
86
|
+
declare const SAFE_INTEGER_RANGE: IntegerRange;
|
|
87
|
+
/** The integers a signed 32-bit integer holds. */
|
|
88
|
+
declare const INT32_RANGE: IntegerRange;
|
|
89
|
+
declare function decodeJsonInteger(codecId: string, json: JsonValue, range: IntegerRange): number;
|
|
90
|
+
interface BigIntRange {
|
|
91
|
+
readonly min: bigint;
|
|
92
|
+
readonly max: bigint;
|
|
93
|
+
}
|
|
94
|
+
/** The integers a signed 64-bit integer holds. */
|
|
95
|
+
declare const INT64_RANGE: BigIntRange;
|
|
96
|
+
/** The integers a JavaScript `number` holds exactly, as a `bigint` range. */
|
|
97
|
+
declare const SAFE_INTEGER_BIGINT_RANGE: BigIntRange;
|
|
98
|
+
/** Reads an integer a codec writes as decimal text, because a JSON number cannot hold every value of its type. */
|
|
99
|
+
declare function decodeJsonIntegerText(codecId: string, json: JsonValue, range?: BigIntRange): bigint;
|
|
100
|
+
/** Whether `text` is `NaN`, `Infinity` or `-Infinity`, the text a float's JSON form writes for a value JSON has no number for. */
|
|
101
|
+
declare function isNonFiniteText(text: string): boolean;
|
|
102
|
+
/** JSON has no number for NaN or an infinity, so a float's JSON form writes them as the text `NaN`, `Infinity` and `-Infinity`. */
|
|
103
|
+
declare function encodeJsonFloat(value: number): JsonValue;
|
|
104
|
+
declare function decodeJsonFloat(codecId: string, json: JsonValue): number;
|
|
105
|
+
//#endregion
|
|
70
106
|
//#region src/shared/render-ts-literal.d.ts
|
|
71
107
|
/**
|
|
72
108
|
* Renders a codec-encoded value as a TypeScript literal (e.g. `"low"`, `1`, `true`), or `undefined`
|
|
@@ -106,6 +142,10 @@ declare function validateCodecTypeParams(descriptor: AnyCodecDescriptor, ref: Co
|
|
|
106
142
|
* their returned codec from the descriptor instance (e.g. `new XCodec(this)`).
|
|
107
143
|
*/
|
|
108
144
|
declare function materializeCodec(descriptor: AnyCodecDescriptor, ref: CodecRef, ctx: CodecInstanceContext): Codec;
|
|
145
|
+
/**
|
|
146
|
+
* Builds the codec a codec reference names with the reference's type parameters, so a parameterized codec checks values against them. `undefined` when no descriptor has the id.
|
|
147
|
+
*/
|
|
148
|
+
declare function codecForRef(lookup: Pick<CodecLookupWithDescriptors, 'descriptorFor'>, ref: CodecRef): Codec | undefined;
|
|
109
149
|
//#endregion
|
|
110
|
-
export {
|
|
111
|
-
//# sourceMappingURL=codec-
|
|
150
|
+
export { materializeCodec as C, validateCodecTypeParams as D, resolveCodecDescriptorOrThrow as E, isNonFiniteText as S, renderTsLiteral as T, decodeJsonIntegerText as _, ColumnSpec as a, encodeJsonFloat as b, INT64_RANGE as c, SAFE_INTEGER_RANGE as d, codecForRef as f, decodeJsonInteger as g, decodeJsonFloat as h, ColumnHelperForStrict as i, IntegerRange as l, decodeJsonBoolean as m, CONTRACT_CODEC_DESCRIPTOR_MISSING as n, ColumnTypeDescriptor as o, column as p, ColumnHelperFor as r, INT32_RANGE as s, BigIntRange as t, SAFE_INTEGER_BIGINT_RANGE as u, decodeJsonMatching as v, refuseJsonValue as w, isIntegerIn as x, decodeJsonString as y };
|
|
151
|
+
//# sourceMappingURL=codec-D67Y03B_.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-D67Y03B_.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.d.mts"],"mappings":";;;;;;;;;;;KAUK,qBAAqB;WACf,SAAS;WACT;WACA,aAAa;WACb;;;;;;;;;WASA,WAAW;WACX,YAAY;;;;;;;;;KASlB;WACM;WACA;WACA;;;;;;;UAOD,WAAW,GAAG,UAAU,6CAA6C;WACpE,eAAe,KAAK,yBAAyB;WAC7C,YAAY;;;;;;;iBAON,OAAO,GAAG,UAAU,qCAAqC,eAAe,KAAK,yBAAyB,GAAG,iBAAiB,YAAY,GAAG,qBAAqB,WAAW,GAAG;;;;;;KAMxL,gBAAgB,UAAU,oCAAoC,gBAAgB,oBAAoB,mBAAmB;;;;KAIrH,sBAAsB,UAAU,oCAAoC,gBAAgB,WAAW,WAAW,WAAW,gBAAgB,mBAAmB;;;;KAIxJ,mBAAmB,UAAU,gCAAgC,WAAW,yBAAyB,0BAA0B,WAAW;;;;;;iBAM1H,gBAAgB,iBAAiB,kBAAkB,MAAM;iBACzD,iBAAiB,iBAAiB,MAAM;;iBAExC,mBAAmB,iBAAiB,MAAM,WAAW,SAAS,QAAQ;iBACtE,kBAAkB,iBAAiB,MAAM;UAChD;WACC;WACA;;;iBAGM,YAAY,gBAAgB,OAAO,eAAe;;cAErD,oBAAoB;;cAEpB,aAAa;iBACV,kBAAkB,iBAAiB,MAAM,WAAW,OAAO;UAClE;WACC;WACA;;;cAGG,aAAa;;cAEb,2BAA2B;;iBAExB,sBAAsB,iBAAiB,MAAM,WAAW,QAAQ;;iBAEhE,gBAAgB;;iBAEhB,gBAAgB,gBAAgB;iBAChC,gBAAgB,iBAAiB,MAAM;;;;;;;;;;;;iBAYvC,gBAAgB,OAAO;;;cAG1B;;;;;;;iBAOG,8BAA8B,gBAAgB,oBAAoB,gCAAgC,KAAK,UAAU,iFAAiF;;;;;;;;;;;iBAWlM,wBAAwB,YAAY,oBAAoB,KAAK;;;;;;;iBAO7D,iBAAiB,YAAY,oBAAoB,KAAK,UAAU,KAAK,uBAAuB;;;;iBAI5F,YAAY,QAAQ,KAAK,8CAA8C,KAAK,WAAW"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { o as structuredError } from "./structured-error-BXbihKQ-.mjs";
|
|
2
|
+
import { i as tsStringLiteral } from "./dist-DUlexZHp.mjs";
|
|
3
|
+
//#region ../../../1-framework/1-core/framework-components/dist/codec.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Abstract base class for concrete codec implementations.
|
|
6
|
+
*
|
|
7
|
+
* Codec authors extend this class with their typed `Id`, `TTraits`, `TWire`, `TInput` and override all four abstract conversion methods: `encode`, `decode`, `encodeJson`, and `decodeJson`. The runtime instance carries only its `id` (proxied through the descriptor so alias subclasses inherit the descriptor's id automatically) and the conversion methods — static metadata lives on the {@link CodecDescriptor}.
|
|
8
|
+
*/
|
|
9
|
+
var CodecImpl = class {
|
|
10
|
+
descriptor;
|
|
11
|
+
/**
|
|
12
|
+
* Variance-erased descriptor reference. Concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.
|
|
13
|
+
*/
|
|
14
|
+
constructor(descriptor) {
|
|
15
|
+
this.descriptor = descriptor;
|
|
16
|
+
}
|
|
17
|
+
get id() {
|
|
18
|
+
return this.descriptor.codecId;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Abstract base class for concrete codec descriptors.
|
|
23
|
+
*
|
|
24
|
+
* Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `targetTypes`, `paramsSchema`, the curried `factory(params)`, and (optionally) `renderOutputType`.
|
|
25
|
+
*
|
|
26
|
+
* Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.
|
|
27
|
+
*/
|
|
28
|
+
var CodecDescriptorTemplateImpl = class {
|
|
29
|
+
get isParameterized() {
|
|
30
|
+
return this.paramsSchema !== void 0;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Abstract base for a concrete codec descriptor: a {@link CodecDescriptorTemplateImpl} that also
|
|
35
|
+
* names the data type its codec represents.
|
|
36
|
+
*
|
|
37
|
+
* A codec whose data type depends on the target that adopts it extends
|
|
38
|
+
* {@link CodecDescriptorTemplateImpl} instead, and the target names the type when it adapts the
|
|
39
|
+
* template.
|
|
40
|
+
*/
|
|
41
|
+
var CodecDescriptorImpl = class extends CodecDescriptorTemplateImpl {};
|
|
42
|
+
/**
|
|
43
|
+
* Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.
|
|
44
|
+
*
|
|
45
|
+
* `nativeType` is the column's database-native type spelling — the value the postgres adapter's migration planner, the SQL renderer's cast policy, and the emitted contract's column `nativeType` slot read. Per-codec helpers pass the literal native-type string for their codec (e.g. `'text'`, `'int4'`, `'character varying'`); for codecs whose native-type spelling depends on parameters (none today; reserved for future shapes), the helper computes the rendered string before calling `column`. The framework does not derive the value from `codecId` — that mapping is target-specific and lives at the helper.
|
|
46
|
+
*/
|
|
47
|
+
function column(codecFactory, codecId, typeParams, nativeType) {
|
|
48
|
+
return {
|
|
49
|
+
codecFactory,
|
|
50
|
+
codecId,
|
|
51
|
+
typeParams,
|
|
52
|
+
nativeType
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Readers for the JSON forms codecs share, each built as {@link Codec.decodeJson} requires: it returns the application value for a stored form of the codec's type and refuses anything else with {@link refuseJsonValue}.
|
|
57
|
+
*/
|
|
58
|
+
const RECEIVED_PREVIEW_LIMIT = 100;
|
|
59
|
+
/** The value a refusal names: its JSON text, or its digits for a number JSON cannot write, cut to 100 characters. */
|
|
60
|
+
function receivedPreview(json) {
|
|
61
|
+
return (typeof json === "number" ? String(json) : JSON.stringify(json)).slice(0, RECEIVED_PREVIEW_LIMIT);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The refusal every `decodeJson` raises: `RUNTIME.DECODE_FAILED`, `<codecId> JSON value must be <expected>`, with `meta.codecId` and `meta.received`, the value it was given as JSON text, cut to 100 characters.
|
|
65
|
+
*/
|
|
66
|
+
function refuseJsonValue(codecId, expected, json) {
|
|
67
|
+
throw structuredError("RUNTIME.DECODE_FAILED", `${codecId} JSON value must be ${expected}`, { meta: {
|
|
68
|
+
codecId,
|
|
69
|
+
received: receivedPreview(json)
|
|
70
|
+
} });
|
|
71
|
+
}
|
|
72
|
+
function decodeJsonString(codecId, json) {
|
|
73
|
+
if (typeof json !== "string") return refuseJsonValue(codecId, "a string", json);
|
|
74
|
+
return json;
|
|
75
|
+
}
|
|
76
|
+
/** Reads a JSON string that matches `pattern`; `form` names what the pattern accepts, for the refusal. */
|
|
77
|
+
function decodeJsonMatching(codecId, json, pattern, form) {
|
|
78
|
+
if (typeof json !== "string" || !pattern.test(json)) return refuseJsonValue(codecId, form, json);
|
|
79
|
+
return json;
|
|
80
|
+
}
|
|
81
|
+
function decodeJsonBoolean(codecId, json) {
|
|
82
|
+
if (typeof json !== "boolean") return refuseJsonValue(codecId, "a boolean", json);
|
|
83
|
+
return json;
|
|
84
|
+
}
|
|
85
|
+
/** Whether `value` is an integer within `range`, its ends included. */
|
|
86
|
+
function isIntegerIn(value, range) {
|
|
87
|
+
return typeof value === "number" && Number.isInteger(value) && value >= range.min && value <= range.max;
|
|
88
|
+
}
|
|
89
|
+
/** The integers a JavaScript `number` holds exactly. */
|
|
90
|
+
const SAFE_INTEGER_RANGE = {
|
|
91
|
+
min: Number.MIN_SAFE_INTEGER,
|
|
92
|
+
max: Number.MAX_SAFE_INTEGER
|
|
93
|
+
};
|
|
94
|
+
/** The integers a signed 32-bit integer holds. */
|
|
95
|
+
const INT32_RANGE = {
|
|
96
|
+
min: -(2 ** 31),
|
|
97
|
+
max: 2 ** 31 - 1
|
|
98
|
+
};
|
|
99
|
+
function decodeJsonInteger(codecId, json, range) {
|
|
100
|
+
if (!isIntegerIn(json, range)) return refuseJsonValue(codecId, `an integer from ${range.min} to ${range.max}`, json);
|
|
101
|
+
return json;
|
|
102
|
+
}
|
|
103
|
+
/** The integers a signed 64-bit integer holds. */
|
|
104
|
+
const INT64_RANGE = {
|
|
105
|
+
min: -(2n ** 63n),
|
|
106
|
+
max: 2n ** 63n - 1n
|
|
107
|
+
};
|
|
108
|
+
/** The integers a JavaScript `number` holds exactly, as a `bigint` range. */
|
|
109
|
+
const SAFE_INTEGER_BIGINT_RANGE = {
|
|
110
|
+
min: BigInt(Number.MIN_SAFE_INTEGER),
|
|
111
|
+
max: BigInt(Number.MAX_SAFE_INTEGER)
|
|
112
|
+
};
|
|
113
|
+
const DECIMAL_INTEGER_TEXT = /^-?\d+$/;
|
|
114
|
+
/** Reads an integer a codec writes as decimal text, because a JSON number cannot hold every value of its type. */
|
|
115
|
+
function decodeJsonIntegerText(codecId, json, range) {
|
|
116
|
+
const expected = range === void 0 ? "a decimal integer string" : `a decimal integer string from ${range.min} to ${range.max}`;
|
|
117
|
+
const value = BigInt(decodeJsonMatching(codecId, json, DECIMAL_INTEGER_TEXT, expected));
|
|
118
|
+
if (range !== void 0 && (value < range.min || value > range.max)) return refuseJsonValue(codecId, expected, json);
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
const NON_FINITE_TEXT = /* @__PURE__ */ new Set([
|
|
122
|
+
"NaN",
|
|
123
|
+
"Infinity",
|
|
124
|
+
"-Infinity"
|
|
125
|
+
]);
|
|
126
|
+
/** Whether `text` is `NaN`, `Infinity` or `-Infinity`, the text a float's JSON form writes for a value JSON has no number for. */
|
|
127
|
+
function isNonFiniteText(text) {
|
|
128
|
+
return NON_FINITE_TEXT.has(text);
|
|
129
|
+
}
|
|
130
|
+
/** JSON has no number for NaN or an infinity, so a float's JSON form writes them as the text `NaN`, `Infinity` and `-Infinity`. */
|
|
131
|
+
function encodeJsonFloat(value) {
|
|
132
|
+
return Number.isFinite(value) ? value : String(value);
|
|
133
|
+
}
|
|
134
|
+
function decodeJsonFloat(codecId, json) {
|
|
135
|
+
if (typeof json === "number" && Number.isFinite(json)) return json;
|
|
136
|
+
if (typeof json === "string" && isNonFiniteText(json)) return Number(json);
|
|
137
|
+
return refuseJsonValue(codecId, "a finite number or the text NaN, Infinity or -Infinity", json);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Renders a codec-encoded value as a TypeScript literal (e.g. `"low"`, `1`, `true`), or `undefined`
|
|
141
|
+
* when the value isn't literal-expressible (objects, arrays, null).
|
|
142
|
+
*
|
|
143
|
+
* Valid **only for identity codecs** whose `encodeJson` output equals their decoded output type
|
|
144
|
+
* (text, int, float, bool). A non-identity codec (e.g. one that encodes to an int but decodes to a
|
|
145
|
+
* string literal) must NOT use this: it has to `decodeJson` first, then render, in its own
|
|
146
|
+
* `renderValueLiteral`.
|
|
147
|
+
*/
|
|
148
|
+
function renderTsLiteral(value) {
|
|
149
|
+
if (typeof value === "string") return tsStringLiteral(value);
|
|
150
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { isNonFiniteText as _, INT64_RANGE as a, column as c, decodeJsonInteger as d, decodeJsonIntegerText as f, isIntegerIn as g, encodeJsonFloat as h, INT32_RANGE as i, decodeJsonBoolean as l, decodeJsonString as m, CodecDescriptorTemplateImpl as n, SAFE_INTEGER_BIGINT_RANGE as o, decodeJsonMatching as p, CodecImpl as r, SAFE_INTEGER_RANGE as s, CodecDescriptorImpl as t, decodeJsonFloat as u, refuseJsonValue as v, renderTsLiteral as y };
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=codec-DOPctnmd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-DOPctnmd.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.mjs"],"sourcesContent":["import { t as emptyCodecLookup } from \"./codec-types-CMqWkP1t.mjs\";\nimport { a as resolveCodecDescriptorOrThrow, c as dataType, i as materializeCodec, l as dataTypeId, o as validateCodecTypeParams, r as codecForRef, s as createDataTypeLookup, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-CxRICgbr.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { tsStringLiteral } from \"@internal/ts-render\";\n//#region src/shared/codec.ts\n/**\n* Abstract base class for concrete codec implementations.\n*\n* Codec authors extend this class with their typed `Id`, `TTraits`, `TWire`, `TInput` and override all four abstract conversion methods: `encode`, `decode`, `encodeJson`, and `decodeJson`. The runtime instance carries only its `id` (proxied through the descriptor so alias subclasses inherit the descriptor's id automatically) and the conversion methods — static metadata lives on the {@link CodecDescriptor}.\n*/\nvar CodecImpl = class {\n\tdescriptor;\n\t/**\n\t* Variance-erased descriptor reference. Concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.\n\t*/\n\tconstructor(descriptor) {\n\t\tthis.descriptor = descriptor;\n\t}\n\tget id() {\n\t\treturn this.descriptor.codecId;\n\t}\n};\n//#endregion\n//#region src/shared/codec-descriptor.ts\n/**\n* Abstract base class for concrete codec descriptors.\n*\n* Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `targetTypes`, `paramsSchema`, the curried `factory(params)`, and (optionally) `renderOutputType`.\n*\n* Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.\n*/\nvar CodecDescriptorTemplateImpl = class {\n\tget isParameterized() {\n\t\treturn this.paramsSchema !== void 0;\n\t}\n};\n/**\n* Abstract base for a concrete codec descriptor: a {@link CodecDescriptorTemplateImpl} that also\n* names the data type its codec represents.\n*\n* A codec whose data type depends on the target that adopts it extends\n* {@link CodecDescriptorTemplateImpl} instead, and the target names the type when it adapts the\n* template.\n*/\nvar CodecDescriptorImpl = class extends CodecDescriptorTemplateImpl {};\n//#endregion\n//#region src/shared/column-spec.ts\n/**\n* Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.\n*\n* `nativeType` is the column's database-native type spelling — the value the postgres adapter's migration planner, the SQL renderer's cast policy, and the emitted contract's column `nativeType` slot read. Per-codec helpers pass the literal native-type string for their codec (e.g. `'text'`, `'int4'`, `'character varying'`); for codecs whose native-type spelling depends on parameters (none today; reserved for future shapes), the helper computes the rendered string before calling `column`. The framework does not derive the value from `codecId` — that mapping is target-specific and lives at the helper.\n*/\nfunction column(codecFactory, codecId, typeParams, nativeType) {\n\treturn {\n\t\tcodecFactory,\n\t\tcodecId,\n\t\ttypeParams,\n\t\tnativeType\n\t};\n}\n//#endregion\n//#region src/shared/decode-json.ts\n/**\n* Readers for the JSON forms codecs share, each built as {@link Codec.decodeJson} requires: it returns the application value for a stored form of the codec's type and refuses anything else with {@link refuseJsonValue}.\n*/\nconst RECEIVED_PREVIEW_LIMIT = 100;\n/** The value a refusal names: its JSON text, or its digits for a number JSON cannot write, cut to 100 characters. */\nfunction receivedPreview(json) {\n\treturn (typeof json === \"number\" ? String(json) : JSON.stringify(json)).slice(0, RECEIVED_PREVIEW_LIMIT);\n}\n/**\n* The refusal every `decodeJson` raises: `RUNTIME.DECODE_FAILED`, `<codecId> JSON value must be <expected>`, with `meta.codecId` and `meta.received`, the value it was given as JSON text, cut to 100 characters.\n*/\nfunction refuseJsonValue(codecId, expected, json) {\n\tthrow structuredError(\"RUNTIME.DECODE_FAILED\", `${codecId} JSON value must be ${expected}`, { meta: {\n\t\tcodecId,\n\t\treceived: receivedPreview(json)\n\t} });\n}\nfunction decodeJsonString(codecId, json) {\n\tif (typeof json !== \"string\") return refuseJsonValue(codecId, \"a string\", json);\n\treturn json;\n}\n/** Reads a JSON string that matches `pattern`; `form` names what the pattern accepts, for the refusal. */\nfunction decodeJsonMatching(codecId, json, pattern, form) {\n\tif (typeof json !== \"string\" || !pattern.test(json)) return refuseJsonValue(codecId, form, json);\n\treturn json;\n}\nfunction decodeJsonBoolean(codecId, json) {\n\tif (typeof json !== \"boolean\") return refuseJsonValue(codecId, \"a boolean\", json);\n\treturn json;\n}\n/** Whether `value` is an integer within `range`, its ends included. */\nfunction isIntegerIn(value, range) {\n\treturn typeof value === \"number\" && Number.isInteger(value) && value >= range.min && value <= range.max;\n}\n/** The integers a JavaScript `number` holds exactly. */\nconst SAFE_INTEGER_RANGE = {\n\tmin: Number.MIN_SAFE_INTEGER,\n\tmax: Number.MAX_SAFE_INTEGER\n};\n/** The integers a signed 32-bit integer holds. */\nconst INT32_RANGE = {\n\tmin: -(2 ** 31),\n\tmax: 2 ** 31 - 1\n};\nfunction decodeJsonInteger(codecId, json, range) {\n\tif (!isIntegerIn(json, range)) return refuseJsonValue(codecId, `an integer from ${range.min} to ${range.max}`, json);\n\treturn json;\n}\n/** The integers a signed 64-bit integer holds. */\nconst INT64_RANGE = {\n\tmin: -(2n ** 63n),\n\tmax: 2n ** 63n - 1n\n};\n/** The integers a JavaScript `number` holds exactly, as a `bigint` range. */\nconst SAFE_INTEGER_BIGINT_RANGE = {\n\tmin: BigInt(Number.MIN_SAFE_INTEGER),\n\tmax: BigInt(Number.MAX_SAFE_INTEGER)\n};\nconst DECIMAL_INTEGER_TEXT = /^-?\\d+$/;\n/** Reads an integer a codec writes as decimal text, because a JSON number cannot hold every value of its type. */\nfunction decodeJsonIntegerText(codecId, json, range) {\n\tconst expected = range === void 0 ? \"a decimal integer string\" : `a decimal integer string from ${range.min} to ${range.max}`;\n\tconst value = BigInt(decodeJsonMatching(codecId, json, DECIMAL_INTEGER_TEXT, expected));\n\tif (range !== void 0 && (value < range.min || value > range.max)) return refuseJsonValue(codecId, expected, json);\n\treturn value;\n}\nconst NON_FINITE_TEXT = /* @__PURE__ */ new Set([\n\t\"NaN\",\n\t\"Infinity\",\n\t\"-Infinity\"\n]);\n/** Whether `text` is `NaN`, `Infinity` or `-Infinity`, the text a float's JSON form writes for a value JSON has no number for. */\nfunction isNonFiniteText(text) {\n\treturn NON_FINITE_TEXT.has(text);\n}\n/** JSON has no number for NaN or an infinity, so a float's JSON form writes them as the text `NaN`, `Infinity` and `-Infinity`. */\nfunction encodeJsonFloat(value) {\n\treturn Number.isFinite(value) ? value : String(value);\n}\nfunction decodeJsonFloat(codecId, json) {\n\tif (typeof json === \"number\" && Number.isFinite(json)) return json;\n\tif (typeof json === \"string\" && isNonFiniteText(json)) return Number(json);\n\treturn refuseJsonValue(codecId, \"a finite number or the text NaN, Infinity or -Infinity\", json);\n}\n//#endregion\n//#region src/shared/render-ts-literal.ts\n/**\n* Renders a codec-encoded value as a TypeScript literal (e.g. `\"low\"`, `1`, `true`), or `undefined`\n* when the value isn't literal-expressible (objects, arrays, null).\n*\n* Valid **only for identity codecs** whose `encodeJson` output equals their decoded output type\n* (text, int, float, bool). A non-identity codec (e.g. one that encodes to an int but decodes to a\n* string literal) must NOT use this: it has to `decodeJson` first, then render, in its own\n* `renderValueLiteral`.\n*/\nfunction renderTsLiteral(value) {\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n}\n//#endregion\nexport { CONTRACT_CODEC_DESCRIPTOR_MISSING, CodecDescriptorImpl, CodecDescriptorTemplateImpl, CodecImpl, INT32_RANGE, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, codecForRef, column, createDataTypeLookup, dataType, dataTypeId, decodeJsonBoolean, decodeJsonFloat, decodeJsonInteger, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, emptyCodecLookup, encodeJsonFloat, isIntegerIn, isNonFiniteText, materializeCodec, refuseJsonValue, renderTsLiteral, resolveCodecDescriptorOrThrow, validateCodecTypeParams };\n\n//# sourceMappingURL=codec.mjs.map"],"mappings":";;;;;;;;AAUA,IAAI,YAAY,MAAM;CACrB;;;;CAIA,YAAY,YAAY;EACvB,KAAK,aAAa;CACnB;CACA,IAAI,KAAK;EACR,OAAO,KAAK,WAAW;CACxB;AACD;;;;;;;;AAUA,IAAI,8BAA8B,MAAM;CACvC,IAAI,kBAAkB;EACrB,OAAO,KAAK,iBAAiB,KAAK;CACnC;AACD;;;;;;;;;AASA,IAAI,sBAAsB,cAAc,4BAA4B,CAAC;;;;;;AAQrE,SAAS,OAAO,cAAc,SAAS,YAAY,YAAY;CAC9D,OAAO;EACN;EACA;EACA;EACA;CACD;AACD;;;;AAMA,MAAM,yBAAyB;;AAE/B,SAAS,gBAAgB,MAAM;CAC9B,QAAQ,OAAO,SAAS,WAAW,OAAO,IAAI,IAAI,KAAK,UAAU,IAAI,EAAA,CAAG,MAAM,GAAG,sBAAsB;AACxG;;;;AAIA,SAAS,gBAAgB,SAAS,UAAU,MAAM;CACjD,MAAM,gBAAgB,yBAAyB,GAAG,QAAQ,sBAAsB,YAAY,EAAE,MAAM;EACnG;EACA,UAAU,gBAAgB,IAAI;CAC/B,EAAE,CAAC;AACJ;AACA,SAAS,iBAAiB,SAAS,MAAM;CACxC,IAAI,OAAO,SAAS,UAAU,OAAO,gBAAgB,SAAS,YAAY,IAAI;CAC9E,OAAO;AACR;;AAEA,SAAS,mBAAmB,SAAS,MAAM,SAAS,MAAM;CACzD,IAAI,OAAO,SAAS,YAAY,CAAC,QAAQ,KAAK,IAAI,GAAG,OAAO,gBAAgB,SAAS,MAAM,IAAI;CAC/F,OAAO;AACR;AACA,SAAS,kBAAkB,SAAS,MAAM;CACzC,IAAI,OAAO,SAAS,WAAW,OAAO,gBAAgB,SAAS,aAAa,IAAI;CAChF,OAAO;AACR;;AAEA,SAAS,YAAY,OAAO,OAAO;CAClC,OA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OAAO,IAAI;CACzE,OAAO,gBAAgB,SAAS,0DAA0D,IAAI;AAC/F;;;;;;;;;;AAYA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,OAAO,UAAU,UAAU,OAAO,gBAAgB,KAAK;CAC3D,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;AACjF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../../1-framework/1-core/framework-components/dist/codec-types-
|
|
1
|
+
//#region ../../../1-framework/1-core/framework-components/dist/codec-types-CMqWkP1t.mjs
|
|
2
2
|
/** Every semantic trait a codec may advertise. The runtime tuple backs validation of trait-keyed contributions arriving from JavaScript. */
|
|
3
3
|
const CODEC_TRAITS = [
|
|
4
4
|
"equality",
|
|
@@ -11,6 +11,7 @@ const CODEC_TRAITS = [
|
|
|
11
11
|
function isCodecTrait(value) {
|
|
12
12
|
return CODEC_TRAITS.some((trait) => trait === value);
|
|
13
13
|
}
|
|
14
|
+
/** A lookup with no codecs. It has no `descriptorFor`, so a stub that adds codecs to it through `get` cannot pass for a lookup of descriptors that answers nothing. */
|
|
14
15
|
const emptyCodecLookup = {
|
|
15
16
|
get: () => void 0,
|
|
16
17
|
targetTypesFor: () => void 0,
|
|
@@ -19,4 +20,4 @@ const emptyCodecLookup = {
|
|
|
19
20
|
//#endregion
|
|
20
21
|
export { isCodecTrait as n, emptyCodecLookup as t };
|
|
21
22
|
|
|
22
|
-
//# sourceMappingURL=codec-types-
|
|
23
|
+
//# sourceMappingURL=codec-types-CMqWkP1t-CjK8Cwfr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types-CMqWkP1t-CjK8Cwfr.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec-types-CMqWkP1t.mjs"],"sourcesContent":["//#region src/shared/codec-types.ts\n/** Every semantic trait a codec may advertise. The runtime tuple backs validation of trait-keyed contributions arriving from JavaScript. */\nconst CODEC_TRAITS = [\n\t\"equality\",\n\t\"order\",\n\t\"boolean\",\n\t\"numeric\",\n\t\"textual\"\n];\n/** Whether `value` names one of the {@link CODEC_TRAITS}. */\nfunction isCodecTrait(value) {\n\treturn CODEC_TRAITS.some((trait) => trait === value);\n}\n/** A lookup with no codecs. It has no `descriptorFor`, so a stub that adds codecs to it through `get` cannot pass for a lookup of descriptors that answers nothing. */\nconst emptyCodecLookup = {\n\tget: () => void 0,\n\ttargetTypesFor: () => void 0,\n\trenderOutputTypeFor: () => void 0\n};\n//#endregion\nexport { isCodecTrait as n, emptyCodecLookup as t };\n\n//# sourceMappingURL=codec-types-CMqWkP1t.mjs.map"],"mappings":";;AAEA,MAAM,eAAe;CACpB;CACA;CACA;CACA;CACA;AACD;;AAEA,SAAS,aAAa,OAAO;CAC5B,OAAO,aAAa,MAAM,UAAU,UAAU,KAAK;AACpD;;AAEA,MAAM,mBAAmB;CACxB,WAAW,KAAK;CAChB,sBAAsB,KAAK;CAC3B,2BAA2B,KAAK;AACjC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { V as JsonValue } from "./domain-envelope-gHv58hD1-B8mta2A6.mjs";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
|
-
//#region ../../../1-framework/1-core/framework-components/dist/codec-types-
|
|
3
|
+
//#region ../../../1-framework/1-core/framework-components/dist/codec-types-DrcxdLlC.d.mts
|
|
4
4
|
//#region src/shared/data-type.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* The identity of a data type: `owner/name`, with no version. A type's identity does not change;
|
|
@@ -189,7 +189,9 @@ interface Codec<Id extends string = string, TTraits extends readonly CodecTrait[
|
|
|
189
189
|
decode(wire: TWire, ctx: CodecCallContext): Promise<TInput>;
|
|
190
190
|
/** Converts a JS value to the target-defined JSON representation used for contract serialization. This must match the scalar shape produced by the target inside JSON values. Synchronous; called during contract emission. */
|
|
191
191
|
encodeJson(value: TInput): JsonValue;
|
|
192
|
-
/**
|
|
192
|
+
/**
|
|
193
|
+
* Reads a value in a stored JSON form of the codec's type and returns the application value. A stored form is what `encodeJson` writes and what the database writes for the type in JSON; the value comes from a contract's literal default, a member of a JSON document default, an enum member, or JSON the database returns. For any other JSON value — another kind, or one the type with the codec's type parameters does not hold — it throws: the built-in codecs raise `RUNTIME.DECODE_FAILED` through `refuseJsonValue`, with `meta.codecId` and `meta.received`. Callers use it as the check that a value is valid, so a `decodeJson` that returns every value turns that check off. SQL NULL never reaches it. Synchronous.
|
|
194
|
+
*/
|
|
193
195
|
decodeJson(json: JsonValue): TInput;
|
|
194
196
|
}
|
|
195
197
|
/**
|
|
@@ -207,6 +209,7 @@ declare abstract class CodecImpl<Id extends string = string, TTraits extends rea
|
|
|
207
209
|
abstract encode(value: TInput, ctx: CodecCallContext): Promise<TWire>;
|
|
208
210
|
abstract decode(wire: TWire, ctx: CodecCallContext): Promise<TInput>;
|
|
209
211
|
abstract encodeJson(value: TInput): JsonValue;
|
|
212
|
+
/** See {@link Codec.decodeJson}. */
|
|
210
213
|
abstract decodeJson(json: JsonValue): TInput;
|
|
211
214
|
}
|
|
212
215
|
//#endregion
|
|
@@ -247,7 +250,7 @@ interface CodecCallContext {
|
|
|
247
250
|
/**
|
|
248
251
|
* Codec-id-keyed read surface threaded into emit and authoring paths.
|
|
249
252
|
*
|
|
250
|
-
* - `get(id)` returns a representative {@link Codec} instance for the codec id (used by
|
|
253
|
+
* - `get(id)` returns a representative {@link Codec} instance for the codec id (used where a caller reads or encodes a value by codec id and the codec takes no type parameters). For parameterized codecs whose factory requires concrete params, this may return `undefined` — use `CodecRegistry.forCodecRef` instead.
|
|
251
254
|
* - `targetTypesFor(id)` exposes the codec-id-keyed `targetTypes` metadata the runtime instance no longer carries (TML-2357). Returns the same array `CodecDescriptor.targetTypes` would; for Mongo (whose registration doesn't yet resolve through the unified descriptor map — TML-2324) the family-side assembly populates this directly from the contributor's codec metadata.
|
|
252
255
|
* - `renderOutputTypeFor(id, params)` exposes the codec-id-keyed `renderOutputType` renderer the runtime instance no longer carries. Returns `undefined` when the codec doesn't render a custom type or when the codec id is unknown.
|
|
253
256
|
*/
|
|
@@ -259,16 +262,13 @@ interface CodecLookup {
|
|
|
259
262
|
renderInputTypeFor?(id: string, params: Record<string, unknown>): string | undefined;
|
|
260
263
|
/** Codec-id-keyed `renderValueLiteral` renderer for the emit path (`side`: `output` = read type, `input` = create/update type). Optional so existing lookups need not provide it; returns `undefined` when the codec's output isn't literal-expressible or the id is unknown. */
|
|
261
264
|
renderValueLiteralFor?(id: string, value: JsonValue, side: 'output' | 'input'): string | undefined;
|
|
265
|
+
}
|
|
266
|
+
/** A {@link CodecLookup} that resolves codec descriptors, which building a column's codec with its type parameters needs. */
|
|
267
|
+
interface CodecLookupWithDescriptors extends CodecLookup {
|
|
262
268
|
/**
|
|
263
|
-
*
|
|
264
|
-
* {@link AnyCodecDescriptor} for `id`, or `undefined` if no descriptor is
|
|
265
|
-
* registered. Optional so existing lookups need not provide it; a consumer
|
|
266
|
-
* that needs more than the derived per-id readers above — e.g. an
|
|
267
|
-
* authoring-time hook a target-specific descriptor exposes but this
|
|
268
|
-
* framework interface does not model generically — fetches the descriptor
|
|
269
|
-
* itself and narrows it with its own structural predicate.
|
|
269
|
+
* The registered {@link AnyCodecDescriptor} for `id`, or `undefined` if none is registered. A consumer that needs more than the per-id readers above, such as a column's codec built with its type parameters or an authoring hook a target's descriptor exposes, fetches the descriptor itself. It answers from the same registrations as `get`.
|
|
270
270
|
*/
|
|
271
|
-
descriptorFor
|
|
271
|
+
descriptorFor(id: string): AnyCodecDescriptor | undefined;
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
274
274
|
* Full codec registry — the read surface of {@link CodecLookup} plus codec resolution by ref or
|
|
@@ -283,10 +283,11 @@ interface CodecLookup {
|
|
|
283
283
|
* always returns `undefined` — the method exists so the object structurally satisfies the SQL
|
|
284
284
|
* `ContractCodecRegistry` interface.
|
|
285
285
|
*/
|
|
286
|
-
interface CodecRegistry extends
|
|
286
|
+
interface CodecRegistry extends CodecLookupWithDescriptors {
|
|
287
287
|
forCodecRef(ref: CodecRef): Codec;
|
|
288
288
|
forColumn(namespaceId: string, table: string, column: string): Codec | undefined;
|
|
289
289
|
}
|
|
290
|
+
/** A lookup with no codecs. It has no `descriptorFor`, so a stub that adds codecs to it through `get` cannot pass for a lookup of descriptors that answers nothing. */
|
|
290
291
|
declare const emptyCodecLookup: CodecLookup;
|
|
291
292
|
/**
|
|
292
293
|
* Family-agnostic per-instance context supplied by the framework when applying a higher-order codec factory. Allows stateful codecs (e.g. column-scoped encryption) to derive per-instance state from the materialization site.
|
|
@@ -299,5 +300,5 @@ interface CodecInstanceContext {
|
|
|
299
300
|
readonly name: string;
|
|
300
301
|
}
|
|
301
302
|
//#endregion
|
|
302
|
-
export {
|
|
303
|
-
//# sourceMappingURL=codec-types-
|
|
303
|
+
export { createDataTypeLookup as C, emptyCodecLookup as E, ToCanonicalForm as S, dataTypeId as T, DataType as _, CodecCallContext as a, DataTypeSpec as b, CodecDescriptorTemplate as c, CodecInstanceContext as d, CodecLookup as f, CodecTrait as g, CodecRegistry as h, Codec as i, CodecDescriptorTemplateImpl as l, CodecRef as m, AnyCodecDescriptorTemplate as n, CodecDescriptor as o, CodecLookupWithDescriptors as p, Cast as r, CodecDescriptorImpl as s, AnyCodecDescriptor as t, CodecImpl as u, DataTypeId as v, dataType as w, ListCast as x, DataTypeLookup as y };
|
|
304
|
+
//# sourceMappingURL=codec-types-DrcxdLlC-CDdDe0_A.d.mts.map
|
package/dist/{codec-types-DjklYAo0-DL7hUdjg.d.mts.map → codec-types-DrcxdLlC-CDdDe0_A.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-types-
|
|
1
|
+
{"version":3,"file":"codec-types-DrcxdLlC-CDdDe0_A.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec-types-DrcxdLlC.d.mts"],"mappings":";;;;;;;;;KAQK;WACM;;;;;;K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AO,SAAS;;;;EAI3B,WAAW,MAAM,YAAY;;;;;;;uBAOR,UAAU,4BAA4B,yBAAyB,wBAAwB,cAAc,iBAAiB,6BAA6B,MAAM,IAAI,SAAS,OAAO;WACzL,YAAY;;;;EAIrB,YAAY,YAAY;MACpB,MAAM;WACD,OAAO,OAAO,QAAQ,KAAK,mBAAmB,QAAQ;WACtD,OAAO,MAAM,OAAO,KAAK,mBAAmB,QAAQ;WACpD,WAAW,OAAO,SAAS;;WAE3B,WAAW,MAAM,YAAY;;;;;cAK1B;KACT,qBAAqB;;;;;;;;;;;;UAYhB;WACC;WACA,aAAa;WACb;;;;;;;;;;;;;UAaD;WACC,SAAS;;;;;;;;;UASV;EACR,IAAI,aAAa;EACjB,eAAe;EACf,oBAAoB,YAAY,QAAQ;;EAExC,oBAAoB,YAAY,QAAQ;;EAExC,uBAAuB,YAAY,OAAO,WAAW;;;UAG7C,mCAAmC;;;;EAI3C,cAAc,aAAa;;;;;;;;;;;;;;;UAenB,sBAAsB;EAC9B,YAAY,KAAK,WAAW;EAC5B,UAAU,qBAAqB,eAAe,iBAAiB;;;cAGnD,kBAAkB;;;;;;;;UAQtB;WACC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as aggregateDescriptorKey } from "./capabilities-
|
|
1
|
+
import { t as aggregateDescriptorKey } from "./capabilities-M-lvaPSE-BMffxZqu.mjs";
|
|
2
2
|
//#region ../../../1-framework/1-core/framework-components/dist/components.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Settle every contributed overload against `codecs`.
|
|
@@ -85,4 +85,4 @@ function settleAggregateOverloads(descriptors, codecs) {
|
|
|
85
85
|
//#endregion
|
|
86
86
|
export { settleAggregateOverloads as t };
|
|
87
87
|
|
|
88
|
-
//# sourceMappingURL=components-
|
|
88
|
+
//# sourceMappingURL=components-0Tccse_E.mjs.map
|