@prisma/orm-framework 8.0.0-rc.18-dev.16 → 8.0.0-rc.18-dev.17
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-CdcF6V47.mjs → authoring-CDlR13tn.mjs} +49 -42
- package/dist/authoring-CDlR13tn.mjs.map +1 -0
- package/dist/{authoring-CSsdXy1L.d.mts → authoring-joNigE7w.d.mts} +5 -5
- package/dist/{authoring-CSsdXy1L.d.mts.map → authoring-joNigE7w.d.mts.map} +1 -1
- package/dist/{binder-Eeh-nJsx-a-PG0VsN.d.mts → binder-BfzoRtNz-uIAexNtf.d.mts} +14 -13
- package/dist/{binder-Eeh-nJsx-a-PG0VsN.d.mts.map → binder-BfzoRtNz-uIAexNtf.d.mts.map} +1 -1
- package/dist/{capabilities-CnCdDH1J-Bq8Zf0nY.mjs → capabilities-Cn-Kepnv-B8FOAyUu.mjs} +3 -3
- package/dist/{capabilities-CnCdDH1J-Bq8Zf0nY.mjs.map → capabilities-Cn-Kepnv-B8FOAyUu.mjs.map} +1 -1
- package/dist/codec-BYGt3r-S.mjs +28 -0
- package/dist/codec-BYGt3r-S.mjs.map +1 -0
- package/dist/{codec-C50y5KJD.d.mts → codec-BxNHu928.d.mts} +21 -18
- package/dist/codec-BxNHu928.d.mts.map +1 -0
- package/dist/codec-descriptor-C_M6vCEV-CX-PKa8w.mjs +78 -0
- package/dist/codec-descriptor-C_M6vCEV-CX-PKa8w.mjs.map +1 -0
- package/dist/{codec-types-BsE6wCHK-Dpx-WFJ2.d.mts → codec-types-BNVa23xn-DLZmMFiC.d.mts} +75 -60
- package/dist/codec-types-BNVa23xn-DLZmMFiC.d.mts.map +1 -0
- package/dist/{components-VMbwq7D8.mjs → components-Bji-LsWb.mjs} +2 -2
- package/dist/{components-VMbwq7D8.mjs.map → components-Bji-LsWb.mjs.map} +1 -1
- package/dist/{components-DY1n6ZoG.d.mts → components-EV0zsCc7.d.mts} +4 -4
- package/dist/{components-DY1n6ZoG.d.mts.map → components-EV0zsCc7.d.mts.map} +1 -1
- package/dist/components.d.mts +17 -17
- package/dist/components.mjs +10 -10
- 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-ClR0TWDp.d.mts → config-types-Cz10_syo.d.mts} +7 -7
- package/dist/{config-types-ClR0TWDp.d.mts.map → config-types-Cz10_syo.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 +4 -4
- package/dist/contract-authoring.mjs +3 -3
- package/dist/{contract-validation-error-DEiWp_EI-CRwtUgRw.mjs → contract-validation-error-CAnTGhkt-DSnujRaK.mjs} +6 -3
- package/dist/contract-validation-error-CAnTGhkt-DSnujRaK.mjs.map +1 -0
- package/dist/{contract-validation-error-R7cMoK04.d.mts → contract-validation-error-D1QAeOh5.d.mts} +4 -2
- package/dist/contract-validation-error-D1QAeOh5.d.mts.map +1 -0
- package/dist/contract.d.mts +2 -2
- package/dist/contract.mjs +3 -3
- package/dist/contract__contract-validation-error.d.mts +1 -1
- package/dist/contract__contract-validation-error.mjs +1 -1
- package/dist/contract__enum-accessor.d.mts +1 -1
- package/dist/contract__enum-accessor.mjs +1 -1
- package/dist/contract__validate-domain.mjs +1 -1
- package/dist/{control-DnVTy0uQ.mjs → control-5ocRB46M.mjs} +8 -17
- package/dist/control-5ocRB46M.mjs.map +1 -0
- package/dist/control-B7cfY071.d.mts +1 -0
- package/dist/{control-DiIVftDP.d.mts → control-Bp6XS6M2.d.mts} +10 -10
- package/dist/{control-DiIVftDP.d.mts.map → control-Bp6XS6M2.d.mts.map} +1 -1
- package/dist/{control-CVGlbj6c-DGRy_Odg.mjs → control-Bv8UK63M-D34GaTSa.mjs} +28 -15
- package/dist/control-Bv8UK63M-D34GaTSa.mjs.map +1 -0
- package/dist/{control-C11hV6zc-Bu4HR5MZ.d.mts → control-C_zs63JQ-BHMRNt82.d.mts} +5 -3
- package/dist/control-C_zs63JQ-BHMRNt82.d.mts.map +1 -0
- package/dist/data-type-Yz-2OZh--ZEUqit-7.mjs +253 -0
- package/dist/data-type-Yz-2OZh--ZEUqit-7.mjs.map +1 -0
- package/dist/{declarations-DuSbyF44-Bee8mK-C.mjs → declarations-DuSbyF44-DHxqQ1-X.mjs} +2 -2
- package/dist/{declarations-DuSbyF44-Bee8mK-C.mjs.map → declarations-DuSbyF44-DHxqQ1-X.mjs.map} +1 -1
- package/dist/{dist-BHoPlvHD.mjs → dist-D1f6xr7F.mjs} +4 -4
- package/dist/{dist-BHoPlvHD.mjs.map → dist-D1f6xr7F.mjs.map} +1 -1
- package/dist/emission-Cr-H5ooL.d.mts +2 -0
- package/dist/{emission-types-6eDWkqG7-C0x_EHcS.d.mts → emission-types-4eOAB7Fb-B-L5H9gM.d.mts} +4 -4
- package/dist/{emission-types-6eDWkqG7-C0x_EHcS.d.mts.map → emission-types-4eOAB7Fb-B-L5H9gM.d.mts.map} +1 -1
- package/dist/{enum-accessor-BTMiHs-n.mjs → enum-accessor-CAlX-HOl.mjs} +3 -3
- package/dist/enum-accessor-CAlX-HOl.mjs.map +1 -0
- package/dist/{enum-accessor-COww36Lu.d.mts → enum-accessor-GZPV-WpP.d.mts} +8 -4
- package/dist/enum-accessor-GZPV-WpP.d.mts.map +1 -0
- package/dist/errors.d.mts +4 -4
- package/dist/errors.mjs +3 -3
- package/dist/errors__control.d.mts +2 -2
- 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 +1 -1
- package/dist/errors__migration.mjs +1 -1
- package/dist/{execution-BPjhu9gV.d.mts → execution-A4CaEPHk.d.mts} +3 -3
- package/dist/{execution-BPjhu9gV.d.mts.map → execution-A4CaEPHk.d.mts.map} +1 -1
- package/dist/{execution-BIqac9cC.mjs → execution-D_qcNa8s.mjs} +2 -2
- package/dist/{execution-BIqac9cC.mjs.map → execution-D_qcNa8s.mjs.map} +1 -1
- package/dist/{execution-5GwMfE3u.d.mts → execution-Db6roA4O.d.mts} +2 -2
- package/dist/{execution-5GwMfE3u.d.mts.map → execution-Db6roA4O.d.mts.map} +1 -1
- package/dist/{framework-authoring-D6Z2kyE8-B8GVWZ59.d.mts → framework-authoring-BYuHgXo6-BtKlRo4a.d.mts} +9 -24
- package/dist/{framework-authoring-D6Z2kyE8-B8GVWZ59.d.mts.map → framework-authoring-BYuHgXo6-BtKlRo4a.d.mts.map} +1 -1
- package/dist/{framework-components-DhrgvP2z-B_XzMVzi.d.mts → framework-components-D_QZgxzO-D4b6r8ne.d.mts} +5 -5
- package/dist/{framework-components-DhrgvP2z-B_XzMVzi.d.mts.map → framework-components-D_QZgxzO-D4b6r8ne.d.mts.map} +1 -1
- package/dist/ids.d.mts +1 -1
- package/dist/{index-wEX7G1Bv.d.mts → index-MU-ksXsh.d.mts} +4 -4
- package/dist/{index-wEX7G1Bv.d.mts.map → index-MU-ksXsh.d.mts.map} +1 -1
- package/dist/ir-uDGU9vaj.mjs.map +1 -1
- package/dist/{migration-BdFXgvxm.mjs → migration-BpjWKFc_.mjs} +2 -3
- package/dist/migration-BpjWKFc_.mjs.map +1 -0
- package/dist/{migration-IroycW9a.d.mts → migration-ClwEv4nY.d.mts} +2 -2
- package/dist/{migration-IroycW9a.d.mts.map → migration-ClwEv4nY.d.mts.map} +1 -1
- package/dist/{parse-BxcaGLV1-yhRJIgS-.mjs → parse-BxcaGLV1-CDTwA5qF.mjs} +2 -2
- package/dist/{parse-BxcaGLV1-yhRJIgS-.mjs.map → parse-BxcaGLV1-CDTwA5qF.mjs.map} +1 -1
- package/dist/{parse-CJtBvEYy-QAuABAmw.d.mts → parse-CJtBvEYy-b7iSU0ii.d.mts} +6 -6
- package/dist/{parse-CJtBvEYy-QAuABAmw.d.mts.map → parse-CJtBvEYy-b7iSU0ii.d.mts.map} +1 -1
- package/dist/{psl-ast-xH8q-IMy-BGt6Xtfb.d.mts → psl-ast-3tk7lIrz-u_05BsIo.d.mts} +3 -3
- package/dist/{psl-ast-xH8q-IMy-BGt6Xtfb.d.mts.map → psl-ast-3tk7lIrz-u_05BsIo.d.mts.map} +1 -1
- package/dist/psl-ast-DIzWPqtl.d.mts +2 -0
- package/dist/psl-parser.d.mts +12 -10
- package/dist/psl-parser.d.mts.map +1 -1
- package/dist/psl-parser.mjs +20 -12
- package/dist/psl-parser.mjs.map +1 -1
- package/dist/psl-parser__format.d.mts +1 -1
- package/dist/psl-parser__format.mjs +2 -2
- package/dist/psl-parser__interpret.d.mts +6 -6
- package/dist/psl-parser__interpret.mjs +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/{runtime-DXJoMikC.d.mts → runtime-_W8nv8Vz.d.mts} +2 -2
- package/dist/{runtime-DXJoMikC.d.mts.map → runtime-_W8nv8Vz.d.mts.map} +1 -1
- package/dist/{temporal-presets-DEyPX8qQ-Bz4DdZ8v.mjs → temporal-presets-CFRgwfiR-QTpEltz4.mjs} +5 -21
- package/dist/temporal-presets-CFRgwfiR-QTpEltz4.mjs.map +1 -0
- package/dist/ts-render.d.mts +1 -1
- package/dist/ts-render.mjs +1 -1
- package/dist/{types-import-spec-DkCibt5c-eWXsW3y_.d.mts → types-import-spec-BlKcW9tz-BxhTG7Oc.d.mts} +5 -5
- package/dist/types-import-spec-BlKcW9tz-BxhTG7Oc.d.mts.map +1 -0
- package/dist/{validate-domain-Yvt64F2p.mjs → validate-domain-CbXHDYpF.mjs} +2 -2
- package/dist/{validate-domain-Yvt64F2p.mjs.map → validate-domain-CbXHDYpF.mjs.map} +1 -1
- package/dist/{written-value-Cux5g-EZ-Bqapydv4.d.mts → written-value-Dio_n0HT-CgpcE2lf.d.mts} +23 -18
- package/dist/written-value-Dio_n0HT-CgpcE2lf.d.mts.map +1 -0
- package/package.json +15 -15
- package/dist/authoring-CdcF6V47.mjs.map +0 -1
- package/dist/codec-B6f31GrC.mjs +0 -135
- package/dist/codec-B6f31GrC.mjs.map +0 -1
- package/dist/codec-C50y5KJD.d.mts.map +0 -1
- package/dist/codec-descriptor-cZ8iVRuw-Cfsd42-8.mjs +0 -42
- package/dist/codec-descriptor-cZ8iVRuw-Cfsd42-8.mjs.map +0 -1
- package/dist/codec-types-BsE6wCHK-Dpx-WFJ2.d.mts.map +0 -1
- package/dist/contract-validation-error-DEiWp_EI-CRwtUgRw.mjs.map +0 -1
- package/dist/contract-validation-error-R7cMoK04.d.mts.map +0 -1
- package/dist/control-C11hV6zc-Bu4HR5MZ.d.mts.map +0 -1
- package/dist/control-CGf1ZZbx.d.mts +0 -1
- package/dist/control-CVGlbj6c-DGRy_Odg.mjs.map +0 -1
- package/dist/control-DnVTy0uQ.mjs.map +0 -1
- package/dist/data-type-PGFGVtmU-DeoZ2KIb.mjs +0 -106
- package/dist/data-type-PGFGVtmU-DeoZ2KIb.mjs.map +0 -1
- package/dist/emission-BSYl5A1j.d.mts +0 -2
- package/dist/enum-accessor-BTMiHs-n.mjs.map +0 -1
- package/dist/enum-accessor-COww36Lu.d.mts.map +0 -1
- package/dist/migration-BdFXgvxm.mjs.map +0 -1
- package/dist/psl-ast-nSJQBZ1d.d.mts +0 -2
- package/dist/temporal-presets-DEyPX8qQ-Bz4DdZ8v.mjs.map +0 -1
- package/dist/types-import-spec-DkCibt5c-eWXsW3y_.d.mts.map +0 -1
- package/dist/written-value-Cux5g-EZ-Bqapydv4.d.mts.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as canonicalStringify } from "./canonical-stringify-DY4NaAJi.mjs";
|
|
2
|
-
import { r as isInternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
2
|
+
import { r as isInternalError, t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
|
|
3
3
|
import { n as notOk, r as ok } from "./result-8OXF26MN.mjs";
|
|
4
|
-
import { a as dataTypeId } from "./data-type-PGFGVtmU-DeoZ2KIb.mjs";
|
|
5
|
-
import { C as isAuthoringTypeConstructorDescriptor, D as printTaggedLiteral, O as printedTaggedLiteralReadsBack, _ as instantiateAuthoringTypeConstructor, b as isAuthoringFieldPresetDescriptor, s as authoringEntryType, v as isAuthoringArgRef } from "./temporal-presets-DEyPX8qQ-Bz4DdZ8v.mjs";
|
|
6
|
-
import { i as enumRefusalOf } from "./codec-descriptor-cZ8iVRuw-Cfsd42-8.mjs";
|
|
7
4
|
import { t as canonicalizeJson } from "./canonicalize-json-ZPawceQR-Dua1VNEB.mjs";
|
|
5
|
+
import { l as dataTypeId } from "./data-type-Yz-2OZh--ZEUqit-7.mjs";
|
|
6
|
+
import { E as printedTaggedLiteralReadsBack, S as isAuthoringTypeConstructorDescriptor, T as printTaggedLiteral, _ as isAuthoringArgRef, g as instantiateAuthoringTypeConstructor, y as isAuthoringFieldPresetDescriptor } from "./temporal-presets-CFRgwfiR-QTpEltz4.mjs";
|
|
7
|
+
import { a as readContractValue, i as enumRefusalOf } from "./codec-descriptor-C_M6vCEV-CX-PKa8w.mjs";
|
|
8
8
|
//#region ../../../1-framework/1-core/framework-components/dist/authoring.mjs
|
|
9
9
|
/** Every type constructor of `namespace`, with its path, in namespace order. */
|
|
10
10
|
function* authoringTypeConstructors(namespace, path = []) {
|
|
@@ -117,7 +117,7 @@ function enumMemberProblemDiagnostic(problem, site) {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
|
-
* Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's
|
|
120
|
+
* Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's data type and then the codec read it, and only if they refuse it too is the reader's reason reported. Every other member is read the same way, as a value of the codec's data type converted by `fromDataTypeValue`, and a bare member is read from its own name.
|
|
121
121
|
* Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members
|
|
122
122
|
* store the same value, or when the block has no members. Shared by every family's enum factory.
|
|
123
123
|
*/
|
|
@@ -144,7 +144,7 @@ function readEnumBlockMembers(block, codecId, codec, ctx) {
|
|
|
144
144
|
const written = reading?.ok ? reading.value : memberValue === void 0 ? memberName : memberValue;
|
|
145
145
|
let read;
|
|
146
146
|
try {
|
|
147
|
-
read = codec
|
|
147
|
+
read = readContractValue(codec, written, void 0);
|
|
148
148
|
} catch (err) {
|
|
149
149
|
if (isInternalError(err)) throw err;
|
|
150
150
|
diagnostics?.push(reading !== void 0 && !reading.ok ? {
|
|
@@ -172,7 +172,7 @@ function readEnumBlockMembers(block, codecId, codec, ctx) {
|
|
|
172
172
|
});
|
|
173
173
|
storedMembers.push({
|
|
174
174
|
name: memberName,
|
|
175
|
-
stored: codec.
|
|
175
|
+
stored: codec.dataType.toContract(codec.toDataTypeValue(read))
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
for (const duplicate of duplicateStoredMembers(storedMembers)) {
|
|
@@ -212,10 +212,10 @@ function hasLiteralType(value) {
|
|
|
212
212
|
*/
|
|
213
213
|
function encodeEnumMember(member, codec) {
|
|
214
214
|
try {
|
|
215
|
-
const stored = codec.
|
|
215
|
+
const stored = codec.dataType.toContract(codec.toDataTypeValue(member.value));
|
|
216
216
|
return ok({
|
|
217
217
|
stored,
|
|
218
|
-
readBack: codec
|
|
218
|
+
readBack: readContractValue(codec, stored, void 0)
|
|
219
219
|
});
|
|
220
220
|
} catch (cause) {
|
|
221
221
|
if (isInternalError(cause)) throw cause;
|
|
@@ -313,7 +313,8 @@ function describeRefusal(refusal, support, guidance) {
|
|
|
313
313
|
code: "PSL_VALUE_TYPE_INCOMPATIBLE",
|
|
314
314
|
message: `${describeExpected(guidance.forms)}; this target has no data type for a ${refusal.syntax} value`
|
|
315
315
|
};
|
|
316
|
-
case "unreadable":
|
|
316
|
+
case "unreadable":
|
|
317
|
+
case "refused-by-type": return {
|
|
317
318
|
code: "PSL_INVALID_LITERAL",
|
|
318
319
|
message: refusal.message
|
|
319
320
|
};
|
|
@@ -340,9 +341,10 @@ function isSameForm(a, b) {
|
|
|
340
341
|
return a.kind === "tag" && b.kind === "tag" ? a.tag === b.tag : a.kind === b.kind;
|
|
341
342
|
}
|
|
342
343
|
/**
|
|
343
|
-
* The literal to write in place of a quoted string that `receivingType` refuses
|
|
344
|
+
* The literal to write in place of a quoted string that `receivingType` refuses under `receivingParams`: the string as a literal of the first tag the type admits. `undefined` when the value is not a quoted string, the type admits no tag, the literal would not read back as the same text, or the type would refuse the literal too.
|
|
344
345
|
*/
|
|
345
|
-
function exactRewrite(support,
|
|
346
|
+
function exactRewrite(support, receiving, written) {
|
|
347
|
+
const { receivingType, receivingParams } = receiving;
|
|
346
348
|
const [tag] = admittedTags(support, receivingType);
|
|
347
349
|
if (written.kind !== "string" || tag === void 0) return void 0;
|
|
348
350
|
if (!printedTaggedLiteralReadsBack(written.text)) return void 0;
|
|
@@ -351,7 +353,7 @@ function exactRewrite(support, receivingType, written) {
|
|
|
351
353
|
tag,
|
|
352
354
|
text: written.text
|
|
353
355
|
});
|
|
354
|
-
if (!read.ok || !castTypedValue(support, receivingType, read.value).ok) return
|
|
356
|
+
if (!read.ok || !castTypedValue(support, receivingType, receivingParams, read.value).ok) return;
|
|
355
357
|
return printTaggedLiteral(tag, written.text);
|
|
356
358
|
}
|
|
357
359
|
function findEntry(support, matches) {
|
|
@@ -378,7 +380,18 @@ function textOf(written) {
|
|
|
378
380
|
function messageOf(error) {
|
|
379
381
|
return error instanceof Error ? error.message : String(error);
|
|
380
382
|
}
|
|
381
|
-
/**
|
|
383
|
+
/** The value of `type` that `json` gives under `params`, constructed by that type; a refusal is worded for a diagnostic. */
|
|
384
|
+
function valueOfType(support, type, json, params, refuse) {
|
|
385
|
+
const declaration = support.lookup.get(type);
|
|
386
|
+
if (declaration === void 0) throw new InternalError(`A value of "${type}" was written, and this stack does not register it.`);
|
|
387
|
+
try {
|
|
388
|
+
return ok(declaration.valueFrom(json(), params));
|
|
389
|
+
} catch (error) {
|
|
390
|
+
if (isInternalError(error)) throw error;
|
|
391
|
+
return notOk(refuse(messageOf(error)));
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/** Read one written value through the authoring entry for its syntax, as a value its type constructs. */
|
|
382
395
|
function readWrittenValue(support, written) {
|
|
383
396
|
const found = written.kind === "tag" ? entryForTag(support, written.tag) : entryForPlain(support, written.kind);
|
|
384
397
|
if (found === void 0) return written.kind === "tag" ? notOk({
|
|
@@ -391,45 +404,38 @@ function readWrittenValue(support, written) {
|
|
|
391
404
|
});
|
|
392
405
|
const text = textOf(written);
|
|
393
406
|
const form = found.entry.written;
|
|
407
|
+
const unreadable = (message) => ({
|
|
408
|
+
kind: "unreadable",
|
|
409
|
+
message
|
|
410
|
+
});
|
|
394
411
|
if (form.kind === "plain" && form.syntax === "number") {
|
|
395
412
|
const classified = form.classify(text);
|
|
396
|
-
return classified === void 0 ? notOk({
|
|
397
|
-
kind: "unreadable",
|
|
398
|
-
message: `no data type of this target holds the number ${text}`
|
|
399
|
-
}) : ok(classified);
|
|
400
|
-
}
|
|
401
|
-
try {
|
|
402
|
-
return ok({
|
|
403
|
-
type: dataTypeId(authoringEntryType(found.key, found.entry)),
|
|
404
|
-
value: form.parse(text)
|
|
405
|
-
});
|
|
406
|
-
} catch (error) {
|
|
407
|
-
if (isInternalError(error)) throw error;
|
|
408
|
-
return notOk({
|
|
409
|
-
kind: "unreadable",
|
|
410
|
-
message: messageOf(error)
|
|
411
|
-
});
|
|
413
|
+
return classified === void 0 ? notOk(unreadable(`no data type of this target holds the number ${text}`)) : valueOfType(support, classified.type, () => classified.value, {}, unreadable);
|
|
412
414
|
}
|
|
415
|
+
return valueOfType(support, dataTypeId(found.key), () => form.parse(text), {}, unreadable);
|
|
413
416
|
}
|
|
414
|
-
/** Take a
|
|
415
|
-
function castTypedValue(support, receivingType,
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
/** Take a value into the receiving type, directly or through the cast that type declares; the receiving type constructs the result under `receivingParams`, the parameters of the position that receives it. */
|
|
418
|
+
function castTypedValue(support, receivingType, receivingParams, value) {
|
|
419
|
+
const refusedByType = (message) => ({
|
|
420
|
+
kind: "refused-by-type",
|
|
421
|
+
receivingType,
|
|
422
|
+
message
|
|
419
423
|
});
|
|
424
|
+
if (value.type === receivingType) return valueOfType(support, receivingType, () => value.value, receivingParams, refusedByType);
|
|
420
425
|
const declaration = support.lookup.get(receivingType);
|
|
421
|
-
const cast = declaration?.casts[
|
|
426
|
+
const cast = declaration?.casts[value.type];
|
|
422
427
|
if (cast === void 0) return notOk({
|
|
423
428
|
kind: "no-cast",
|
|
424
429
|
receivingType,
|
|
425
|
-
|
|
430
|
+
receivingParams,
|
|
431
|
+
valueType: value.type,
|
|
426
432
|
casts: Object.keys(declaration?.casts ?? {})
|
|
427
433
|
});
|
|
434
|
+
const source = support.lookup.get(value.type);
|
|
435
|
+
if (source === void 0) throw new InternalError(`A value of "${value.type}" was cast, and this stack does not register it.`);
|
|
436
|
+
let json;
|
|
428
437
|
try {
|
|
429
|
-
|
|
430
|
-
type: receivingType,
|
|
431
|
-
value: cast(typed.value)
|
|
432
|
-
});
|
|
438
|
+
json = cast(source.toContract(value));
|
|
433
439
|
} catch (error) {
|
|
434
440
|
if (isInternalError(error)) throw error;
|
|
435
441
|
return notOk({
|
|
@@ -437,6 +443,7 @@ function castTypedValue(support, receivingType, typed) {
|
|
|
437
443
|
message: messageOf(error)
|
|
438
444
|
});
|
|
439
445
|
}
|
|
446
|
+
return valueOfType(support, receivingType, () => json, receivingParams, refusedByType);
|
|
440
447
|
}
|
|
441
448
|
/** The type itself, then each type it casts from, in key order. */
|
|
442
449
|
function admittedTypes(support, dataType) {
|
|
@@ -496,4 +503,4 @@ function describeAdmittedForms(support, dataType) {
|
|
|
496
503
|
//#endregion
|
|
497
504
|
export { tagForm as S, findAuthoringTypeConstructorCall as _, castTypedValue as a, readEnumBlockMembers as b, describeRefusal as c, encodeEnumMembers as d, entryForPlain as f, fieldPresetSpellings as g, exactRewrite as h, authoringTypeConstructors as i, describeRefusedValueType as l, enumMemberProblemDiagnostic as m, admittedTags as n, describeAdmittedForms as o, entryForTag as p, authoringTypeConstructorArguments as r, describeExpected as s, admittedForms as t, duplicateStoredMembers as u, getAuthoringFieldPreset as v, readWrittenValue as x, knownTags as y };
|
|
498
505
|
|
|
499
|
-
//# sourceMappingURL=authoring-
|
|
506
|
+
//# sourceMappingURL=authoring-CDlR13tn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-CDlR13tn.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/authoring.mjs"],"sourcesContent":["import { t as canonicalizeJson } from \"./canonicalize-json-ZPawceQR.mjs\";\nimport { i as dataTypeId } from \"./data-type-Yz-2OZh-.mjs\";\nimport { a as readContractValue, r as enumRefusalOf } from \"./codec-descriptor-C_M6vCEV.mjs\";\nimport { A as isAuthoringPslBlockDescriptor, C as instantiateAuthoringEntityType, D as isAuthoringEntityTypeDescriptor, E as isAuthoringArgRef, F as resolveEnumCodecId, I as validateAuthoringHelperArguments, L as validateAuthoringTypeParams, N as mergeAuthoringNamespaces, O as isAuthoringFieldPresetDescriptor, P as resolveAuthoringTemplateValue, S as getAuthoringTypeConstructor, T as instantiateAuthoringTypeConstructor, _ as assertResolvableTypeConstructorTemplates, a as temporalCodecPreset, b as collectScalarTypeConstructors, d as printTaggedLiteral, f as printedTaggedLiteralReadsBack, g as assertNoCrossRegistryCollisions, h as tsTaggedTemplateSource, i as temporalAuthoringPresets, j as isAuthoringTypeConstructorDescriptor, k as isAuthoringModelAttributeDescriptor, l as canonicalizeTaggedLiteralBody, m as resolveTemplateTagEscapes, n as TEMPORAL_ON_UPDATE_ARG, o as temporalPhaseTemplate, r as TIMESTAMP_NOW_GENERATOR_ID, t as TEMPORAL_ON_CREATE_ARG, u as describeTaggedLiteralFailure, v as classifyEnumMemberType, w as instantiateAuthoringFieldPreset, x as flushAuthoringWarnings } from \"./temporal-presets-CFRgwfiR.mjs\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/shared/authoring-type-constructor-call.ts\n/** Every type constructor of `namespace`, with its path, in namespace order. */\nfunction* authoringTypeConstructors(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* authoringTypeConstructors(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 authoringTypeConstructorArguments(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 authoringTypeConstructors(namespace)) {\n\t\tconst args = authoringTypeConstructorArguments(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-stored-members.ts\n/**\n* Each enum member whose stored form equals an earlier member's, paired with the first such member. Stored forms are compared as `contract.json` holds them, so negative zero is zero, and by `canonicalStringify`, so two objects with the same entries in a different order are equal. Every enum authoring surface refuses the members this returns.\n*/\nfunction duplicateStoredMembers(members) {\n\tconst memberByStoredForm = /* @__PURE__ */ new Map();\n\tconst duplicates = [];\n\tfor (const { name, stored } of members) {\n\t\tconst key = canonicalStringify(JSON.parse(JSON.stringify(stored)));\n\t\tconst earlier = memberByStoredForm.get(key);\n\t\tif (earlier === void 0) memberByStoredForm.set(key, name);\n\t\telse duplicates.push({\n\t\t\tearlier,\n\t\t\tlater: name,\n\t\t\tstored\n\t\t});\n\t}\n\treturn duplicates;\n}\n//#endregion\n//#region src/shared/enum-block-members.ts\n/**\n* A problem with an enum's members as a diagnostic at the member, or at the block when the problem is the enum's codec.\n*/\nfunction enumMemberProblemDiagnostic(problem, site) {\n\tconst { enumName, codecId, sourceId } = site;\n\tconst at = (member) => ({\n\t\tsourceId,\n\t\tspan: site.memberSpans[member] ?? site.span\n\t});\n\tswitch (problem.kind) {\n\t\tcase \"codec-not-for-enums\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" cannot use the codec \"${codecId}\". ${problem.refusal}`,\n\t\t\tsourceId,\n\t\t\tspan: site.span\n\t\t};\n\t\tcase \"codec-missing\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" uses codec \"${codecId}\", which no pack in the contract provides`,\n\t\t\tsourceId,\n\t\t\tspan: site.span\n\t\t};\n\t\tcase \"codec-refused-member\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" member \"${problem.member}\" was rejected by codec \"${codecId}\": ${problem.reason}`,\n\t\t\t...at(problem.member)\n\t\t};\n\t\tcase \"member-not-stored-as-written\": return {\n\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\" member \"${problem.member}\" is written ${problem.written}, but its codec stores ${JSON.stringify(problem.stored)}. Write the member as ${problem.writeAs}.`,\n\t\t\t...at(problem.member)\n\t\t};\n\t\tcase \"duplicate-member-value\": return {\n\t\t\tcode: \"PSL_ENUM_DUPLICATE_MEMBER_VALUE\",\n\t\t\tmessage: `enum \"${enumName}\": members \"${problem.earlier}\" and \"${problem.later}\" both store ${JSON.stringify(problem.stored)}`,\n\t\t\t...at(problem.later)\n\t\t};\n\t}\n}\n/**\n* Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's data type and then the codec read it, and only if they refuse it too is the reader's reason reported. Every other member is read the same way, as a value of the codec's data type converted by `fromDataTypeValue`, and 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 site = {\n\t\tenumName: block.name,\n\t\tcodecId,\n\t\tsourceId,\n\t\tspan: block.span,\n\t\tmemberSpans: block.parameterSpans\n\t};\n\tconst members = [];\n\tconst storedMembers = [];\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 reading = typeof memberValue === \"number\" ? ctx.readWrittenNumber?.({\n\t\t\ttext: block.numberTexts?.[memberName] ?? String(memberValue),\n\t\t\tcodecId,\n\t\t\tsubject: `enum \"${block.name}\" member \"${memberName}\"`\n\t\t}) : void 0;\n\t\tconst written = reading?.ok ? reading.value : memberValue === void 0 ? memberName : memberValue;\n\t\tlet read;\n\t\ttry {\n\t\t\tread = readContractValue(codec, written, void 0);\n\t\t} catch (err) {\n\t\t\tif (isInternalError(err)) throw err;\n\t\t\tdiagnostics?.push(reading !== void 0 && !reading.ok ? {\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: reading.message,\n\t\t\t\tsourceId,\n\t\t\t\tspan\n\t\t\t} : 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\tmembers.push({\n\t\t\tname: memberName,\n\t\t\tvalue: read\n\t\t});\n\t\tstoredMembers.push({\n\t\t\tname: memberName,\n\t\t\tstored: codec.dataType.toContract(codec.toDataTypeValue(read))\n\t\t});\n\t}\n\tfor (const duplicate of duplicateStoredMembers(storedMembers)) {\n\t\tdiagnostics?.push(enumMemberProblemDiagnostic({\n\t\t\tkind: \"duplicate-member-value\",\n\t\t\t...duplicate\n\t\t}, site));\n\t\tmemberError = true;\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/enum-members.ts\n/** Whether TypeScript gives the value a literal type: a primitive, or an array or plain object of them. */\nfunction hasLiteralType(value) {\n\tif ([\n\t\t\"string\",\n\t\t\"number\",\n\t\t\"boolean\",\n\t\t\"bigint\"\n\t].includes(typeof value)) return true;\n\tif (Array.isArray(value)) return value.every(hasLiteralType);\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === Object.prototype || prototype === null) && Object.values(value).every(hasLiteralType);\n}\n/**\n* A member's value in the form its codec stores it, and that form read back by the codec. A codec that throws on either is a refusal naming the member; an internal error is not the member's fault and propagates.\n*/\nfunction encodeEnumMember(member, codec) {\n\ttry {\n\t\tconst stored = codec.dataType.toContract(codec.toDataTypeValue(member.value));\n\t\treturn ok({\n\t\t\tstored,\n\t\t\treadBack: readContractValue(codec, stored, void 0)\n\t\t});\n\t} catch (cause) {\n\t\tif (isInternalError(cause)) throw cause;\n\t\treturn notOk({\n\t\t\tkind: \"codec-refused-member\",\n\t\t\tmember: member.name,\n\t\t\treason: cause instanceof Error ? cause.message : String(cause),\n\t\t\tcause\n\t\t});\n\t}\n}\n/**\n* Refuses a member its codec reads back as a different value from the one written. A member with no literal type has nothing to compare.\n*/\nfunction notStoredAsWritten(member, stored, readBack) {\n\tif (!hasLiteralType(member.value)) return void 0;\n\tif (hasLiteralType(readBack) && canonicalStringify(readBack) === canonicalStringify(member.value)) return void 0;\n\treturn {\n\t\tkind: \"member-not-stored-as-written\",\n\t\tmember: member.name,\n\t\twritten: canonicalStringify(member.value),\n\t\tstored,\n\t\twriteAs: hasLiteralType(readBack) ? canonicalStringify(readBack) : JSON.stringify(stored)\n\t};\n}\n/**\n* Each member of an enum in the form its codec stores it. Refuses a codec an enum cannot use, a codec the lookup does not have, a member the codec refuses, a member the codec reads back as another value, and two members stored as the same value. Every family's contract build calls this, and reports the problems in its own terms.\n*/\nfunction encodeEnumMembers(decodedEnum, codecLookup) {\n\tconst descriptor = codecLookup.descriptorFor(decodedEnum.codecId);\n\tconst refusal = descriptor === void 0 ? void 0 : enumRefusalOf(descriptor);\n\tif (refusal !== void 0) return notOk([{\n\t\tkind: \"codec-not-for-enums\",\n\t\trefusal\n\t}]);\n\tconst codec = codecLookup.get(decodedEnum.codecId);\n\tif (codec === void 0) return notOk([{ kind: \"codec-missing\" }]);\n\tconst problems = [];\n\tconst members = [];\n\tfor (const member of decodedEnum.enumMembers) {\n\t\tconst encoded = encodeEnumMember(member, codec);\n\t\tif (!encoded.ok) {\n\t\t\tproblems.push(encoded.failure);\n\t\t\tcontinue;\n\t\t}\n\t\tconst { stored, readBack } = encoded.value;\n\t\tconst mismatch = notStoredAsWritten(member, stored, readBack);\n\t\tif (mismatch !== void 0) problems.push(mismatch);\n\t\tmembers.push({\n\t\t\tname: member.name,\n\t\t\tvalue: stored\n\t\t});\n\t}\n\tfor (const duplicate of duplicateStoredMembers(members.map(({ name, value }) => ({\n\t\tname,\n\t\tstored: value\n\t})))) problems.push({\n\t\tkind: \"duplicate-member-value\",\n\t\t...duplicate\n\t});\n\treturn problems.length > 0 ? notOk(problems) : ok(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//#endregion\n//#region src/shared/written-value.ts\n/**\n* Words a refusal of the cast rule. The message leads with what to write; the types are named only when the value has a form the position admits and its type is still refused, such as a number too large for the receiving type.\n*/\nfunction describeRefusal(refusal, support, guidance) {\n\tswitch (refusal.kind) {\n\t\tcase \"unknown-tag\": return {\n\t\t\tcode: \"PSL_UNKNOWN_LITERAL_TAG\",\n\t\t\tmessage: `Unknown literal tag \"${refusal.tag}\". Known tags: ${refusal.known.join(\", \")}.`\n\t\t};\n\t\tcase \"unwritable\": return {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: `${describeExpected(guidance.forms)}; this target has no data type for a ${refusal.syntax} value`\n\t\t};\n\t\tcase \"unreadable\":\n\t\tcase \"refused-by-type\": return {\n\t\t\tcode: \"PSL_INVALID_LITERAL\",\n\t\t\tmessage: refusal.message\n\t\t};\n\t\tcase \"no-cast\": return {\n\t\t\tcode: \"PSL_VALUE_TYPE_INCOMPATIBLE\",\n\t\t\tmessage: describeRefusedValueType(refusal, support, guidance)\n\t\t};\n\t}\n}\n/** `Expected <forms>`, the forms joined with `or`: the start of every refusal that says what to write. */\nfunction describeExpected(forms) {\n\treturn `Expected ${joinForms(forms)}`;\n}\n/**\n* Words a value of type `valueType` that `receivingType` refuses, where `guidance.forms` may be written. The types are named only when the value has one of those forms.\n*/\nfunction describeRefusedValueType(refused, support, guidance) {\n\tconst expected = describeExpected(guidance.forms);\n\tconst valueForm = writtenForm(support, refused.valueType);\n\tif (valueForm !== void 0 && guidance.forms.some((form) => isSameForm(form, valueForm))) return `${expected} that ${refused.receivingType} can hold; got ${refused.valueType}`;\n\treturn guidance.rewrite === void 0 ? expected : `${expected}; write ${guidance.rewrite}`;\n}\nfunction isSameForm(a, b) {\n\treturn a.kind === \"tag\" && b.kind === \"tag\" ? a.tag === b.tag : a.kind === b.kind;\n}\n/**\n* The literal to write in place of a quoted string that `receivingType` refuses under `receivingParams`: the string as a literal of the first tag the type admits. `undefined` when the value is not a quoted string, the type admits no tag, the literal would not read back as the same text, or the type would refuse the literal too.\n*/\nfunction exactRewrite(support, receiving, written) {\n\tconst { receivingType, receivingParams } = receiving;\n\tconst [tag] = admittedTags(support, receivingType);\n\tif (written.kind !== \"string\" || tag === void 0) return void 0;\n\tif (!printedTaggedLiteralReadsBack(written.text)) return void 0;\n\tconst read = readWrittenValue(support, {\n\t\tkind: \"tag\",\n\t\ttag,\n\t\ttext: written.text\n\t});\n\tif (!read.ok || !castTypedValue(support, receivingType, receivingParams, read.value).ok) return;\n\treturn printTaggedLiteral(tag, written.text);\n}\nfunction findEntry(support, matches) {\n\tfor (const [key, entry] of Object.entries(support.entries)) if (matches(entry)) return {\n\t\tkey,\n\t\tentry\n\t};\n}\n/** The entry a tag names, or `undefined` when no pack registered that tag. */\nfunction entryForTag(support, tag) {\n\treturn findEntry(support, ({ written }) => written.kind === \"tag\" && written.tag === tag);\n}\n/** The entry that reads a plain string, boolean or number, or `undefined` when none does. */\nfunction entryForPlain(support, syntax) {\n\treturn findEntry(support, ({ written }) => written.kind === \"plain\" && written.syntax === syntax);\n}\n/** Every tag a stack registers, in the order the entries were merged. */\nfunction knownTags(support) {\n\treturn Object.values(support.entries).flatMap((entry) => entry.written.kind === \"tag\" ? [entry.written.tag] : []);\n}\nfunction textOf(written) {\n\treturn written.kind === \"boolean\" ? String(written.value) : written.text;\n}\nfunction messageOf(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** The value of `type` that `json` gives under `params`, constructed by that type; a refusal is worded for a diagnostic. */\nfunction valueOfType(support, type, json, params, refuse) {\n\tconst declaration = support.lookup.get(type);\n\tif (declaration === void 0) throw new InternalError(`A value of \"${type}\" was written, and this stack does not register it.`);\n\ttry {\n\t\treturn ok(declaration.valueFrom(json(), params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn notOk(refuse(messageOf(error)));\n\t}\n}\n/** Read one written value through the authoring entry for its syntax, as a value its type constructs. */\nfunction readWrittenValue(support, written) {\n\tconst found = written.kind === \"tag\" ? entryForTag(support, written.tag) : entryForPlain(support, written.kind);\n\tif (found === void 0) return written.kind === \"tag\" ? notOk({\n\t\tkind: \"unknown-tag\",\n\t\ttag: written.tag,\n\t\tknown: knownTags(support)\n\t}) : notOk({\n\t\tkind: \"unwritable\",\n\t\tsyntax: written.kind\n\t});\n\tconst text = textOf(written);\n\tconst form = found.entry.written;\n\tconst unreadable = (message) => ({\n\t\tkind: \"unreadable\",\n\t\tmessage\n\t});\n\tif (form.kind === \"plain\" && form.syntax === \"number\") {\n\t\tconst classified = form.classify(text);\n\t\treturn classified === void 0 ? notOk(unreadable(`no data type of this target holds the number ${text}`)) : valueOfType(support, classified.type, () => classified.value, {}, unreadable);\n\t}\n\treturn valueOfType(support, dataTypeId(found.key), () => form.parse(text), {}, unreadable);\n}\n/** Take a value into the receiving type, directly or through the cast that type declares; the receiving type constructs the result under `receivingParams`, the parameters of the position that receives it. */\nfunction castTypedValue(support, receivingType, receivingParams, value) {\n\tconst refusedByType = (message) => ({\n\t\tkind: \"refused-by-type\",\n\t\treceivingType,\n\t\tmessage\n\t});\n\tif (value.type === receivingType) return valueOfType(support, receivingType, () => value.value, receivingParams, refusedByType);\n\tconst declaration = support.lookup.get(receivingType);\n\tconst cast = declaration?.casts[value.type];\n\tif (cast === void 0) return notOk({\n\t\tkind: \"no-cast\",\n\t\treceivingType,\n\t\treceivingParams,\n\t\tvalueType: value.type,\n\t\tcasts: Object.keys(declaration?.casts ?? {})\n\t});\n\tconst source = support.lookup.get(value.type);\n\tif (source === void 0) throw new InternalError(`A value of \"${value.type}\" was cast, and this stack does not register it.`);\n\tlet json;\n\ttry {\n\t\tjson = cast(source.toContract(value));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn notOk({\n\t\t\tkind: \"unreadable\",\n\t\t\tmessage: messageOf(error)\n\t\t});\n\t}\n\treturn valueOfType(support, receivingType, () => json, receivingParams, refusedByType);\n}\n/** The type itself, then each type it casts from, in key order. */\nfunction admittedTypes(support, dataType) {\n\treturn [dataType, ...Object.keys(support.lookup.get(dataType)?.casts ?? {})];\n}\n/** The tags a position of `dataType` admits: its own tag, then the tags of the types it casts from. */\nfunction admittedTags(support, dataType) {\n\tconst tags = admittedTypes(support, dataType).flatMap((type) => {\n\t\tconst written = support.entries[type]?.written;\n\t\treturn written?.kind === \"tag\" ? [written.tag] : [];\n\t});\n\treturn [...new Set(tags)];\n}\n/** The form a value of a tagged literal's type is written in. */\nfunction tagForm(tag) {\n\treturn {\n\t\tkind: \"tag\",\n\t\ttag,\n\t\tphrase: `${tag}\\`...\\``\n\t};\n}\nconst PLAIN_PHRASES = {\n\tstring: \"a quoted string\",\n\tboolean: \"true or false\",\n\tnumber: \"a number\"\n};\nfunction writtenForm(support, type) {\n\tconst written = support.entries[type]?.written;\n\tif (written?.kind === \"tag\") return tagForm(written.tag);\n\tif (written?.kind === \"plain\" && written.syntax !== \"number\") return {\n\t\tkind: written.syntax,\n\t\tphrase: PLAIN_PHRASES[written.syntax]\n\t};\n\treturn Object.entries(support.entries).some(([key, entry]) => entry.written.kind === \"plain\" && entry.written.syntax === \"number\" && (key === type || entry.written.types.some((listed) => listed === type))) ? {\n\t\tkind: \"number\",\n\t\tphrase: PLAIN_PHRASES.number\n\t} : void 0;\n}\n/** What {@link describeAdmittedForms} returns for a type that nothing writes. */\nconst NO_WRITTEN_FORM = \"no written form\";\n/** Each form a position receiving every one of `receivingTypes` admits, once, in order: ``sql`...` ``, `true or false`. */\nfunction admittedForms(support, receivingTypes) {\n\tconst forms = [];\n\tfor (const type of receivingTypes.flatMap((receiving) => admittedTypes(support, receiving))) {\n\t\tconst form = writtenForm(support, type);\n\t\tif (form !== void 0 && !forms.some((listed) => isSameForm(listed, form))) forms.push(form);\n\t}\n\treturn forms;\n}\nfunction joinForms(forms) {\n\treturn forms.length === 0 ? NO_WRITTEN_FORM : forms.map((form) => form.phrase).join(\" or \");\n}\n/** How a position of `dataType` can be written, for a diagnostic: ``sql`...` ``, `true or false`. */\nfunction describeAdmittedForms(support, dataType) {\n\treturn joinForms(admittedForms(support, [dataType]));\n}\n//#endregion\nexport { TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, admittedForms, admittedTags, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, authoringTypeConstructorArguments, authoringTypeConstructors, canonicalizeTaggedLiteralBody, castTypedValue, classifyEnumMemberType, collectScalarTypeConstructors, describeAdmittedForms, describeExpected, describeRefusal, describeRefusedValueType, describeTaggedLiteralFailure, duplicateStoredMembers, encodeEnumMembers, entryForPlain, entryForTag, enumMemberProblemDiagnostic, exactRewrite, fieldPresetSpellings, findAuthoringTypeConstructorCall, flushAuthoringWarnings, getAuthoringFieldPreset, getAuthoringTypeConstructor, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, knownTags, mergeAuthoringNamespaces, printTaggedLiteral, printedTaggedLiteralReadsBack, readEnumBlockMembers, readWrittenValue, resolveAuthoringTemplateValue, resolveEnumCodecId, resolveTemplateTagEscapes, tagForm, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, tsTaggedTemplateSource, validateAuthoringHelperArguments, validateAuthoringTypeParams };\n\n//# sourceMappingURL=authoring.mjs.map"],"mappings":";;;;;;;;;AASA,UAAU,0BAA0B,WAAW,OAAO,CAAC,GAAG;CACzD,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,0BAA0B,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC;AAC7D;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,kCAAkC,YAAY,QAAQ;CAC9D,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,gBAAg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AM,MAAM,WAAW,WAAW,IAAI,EAAE,IAAI;EAC/M,MAAM;EACN,QAAQ,cAAc;CACvB,IAAI,KAAK;AACV;;AAEA,MAAM,kBAAkB;;AAExB,SAAS,cAAc,SAAS,gBAAgB;CAC/C,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,QAAQ,eAAe,SAAS,cAAc,cAAc,SAAS,SAAS,CAAC,GAAG;EAC5F,MAAM,OAAO,YAAY,SAAS,IAAI;EACtC,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM,MAAM,WAAW,WAAW,QAAQ,IAAI,CAAC,GAAG,MAAM,KAAK,IAAI;CAC1F;CACA,OAAO;AACR;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,MAAM,WAAW,IAAI,kBAAkB,MAAM,KAAK,SAAS,KAAK,MAAM,CAAC,CAAC,KAAK,MAAM;AAC3F;;AAEA,SAAS,sBAAsB,SAAS,UAAU;CACjD,OAAO,UAAU,cAAc,SAAS,CAAC,QAAQ,CAAC,CAAC;AACpD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { B as JsonValue } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
|
|
2
|
-
import { i as Codec, p as CodecLookupWithDescriptors } from "./codec-types-
|
|
3
|
-
import { D as AuthoringTypeConstructorDescriptor, F as ParsedPslExtensionBlock, U as PslSpan, a as AuthoringContributions,
|
|
2
|
+
import { i as Codec, p as CodecLookupWithDescriptors } from "./codec-types-BNVa23xn-DLZmMFiC.mjs";
|
|
3
|
+
import { $ as instantiateAuthoringTypeConstructor, D as AuthoringTypeConstructorDescriptor, F as ParsedPslExtensionBlock, U as PslSpan, a as AuthoringContributions, k as AuthoringTypeNamespace, p as AuthoringFieldPresetDescriptor, s as AuthoringEntityContext } from "./framework-authoring-BYuHgXo6-BtKlRo4a.mjs";
|
|
4
4
|
import { r as Result } from "./result-BYCOANWy.mjs";
|
|
5
|
-
import "./written-value-
|
|
5
|
+
import "./written-value-Dio_n0HT-CgpcE2lf.mjs";
|
|
6
6
|
//#region ../../../1-framework/1-core/framework-components/dist/authoring.d.mts
|
|
7
7
|
//#region src/shared/authoring-type-constructor-call.d.ts
|
|
8
8
|
/** What a type constructor call produces for a column. */
|
|
@@ -112,7 +112,7 @@ interface EnumBlockSite {
|
|
|
112
112
|
*/
|
|
113
113
|
declare function enumMemberProblemDiagnostic(problem: EnumMemberProblem, site: EnumBlockSite): EnumBlockDiagnostic;
|
|
114
114
|
/**
|
|
115
|
-
* Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's
|
|
115
|
+
* Reads the members of an `enum` block through its codec. A member written as a number literal is read from its source text as a column default is read, when the family gives a reader for it (`ctx.readWrittenNumber`), so no digit is lost; when that reader refuses the number, the codec's data type and then the codec read it, and only if they refuse it too is the reader's reason reported. Every other member is read the same way, as a value of the codec's data type converted by `fromDataTypeValue`, and a bare member is read from its own name.
|
|
116
116
|
* Pushes a diagnostic and returns `undefined` when the codec refuses a member, when two members
|
|
117
117
|
* store the same value, or when the block has no members. Shared by every family's enum factory.
|
|
118
118
|
*/
|
|
@@ -129,4 +129,4 @@ declare function fieldPresetSpellings(contributions: AuthoringContributions | un
|
|
|
129
129
|
declare function getAuthoringFieldPreset(contributions: AuthoringContributions | undefined, path: readonly string[]): AuthoringFieldPresetDescriptor | undefined;
|
|
130
130
|
//#endregion
|
|
131
131
|
export { findAuthoringTypeConstructorCall as _, EncodedEnumMember as a, EnumBlockSite as c, authoringTypeConstructorArguments as d, authoringTypeConstructors as f, fieldPresetSpellings as g, enumMemberProblemDiagnostic as h, DuplicateStoredValue as i, EnumMemberProblem as l, encodeEnumMembers as m, AuthoringTypeConstructorOutput as n, EnumBlockDiagnostic as o, duplicateStoredMembers as p, DecodedEnum as r, EnumBlockMember as s, AuthoringTypeConstructorCall as t, StoredEnumMember as u, getAuthoringFieldPreset as v, readEnumBlockMembers as y };
|
|
132
|
-
//# sourceMappingURL=authoring-
|
|
132
|
+
//# sourceMappingURL=authoring-joNigE7w.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-
|
|
1
|
+
{"version":3,"file":"authoring-joNigE7w.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/authoring.d.mts"],"mappings":";;;;;;;;KAOK,iCAAiC,kBAAkB;;UAE9C;WACC;WACA;;;iBAGM,0BAA0B,WAAW,wBAAwB,2BAA2B;WAC9F;WACA,YAAY;;;;;;;iBAON,kCAAkC,YAAY,oCAAoC,QAAQ;;;;;;;iBAO1F,iCAAiC,WAAW,wBAAwB,QAAQ,iCAAiC;;;UAGpH;WACC;WACA,QAAQ;;UAET;WACC;WACA;WACA,QAAQ;;;;;iBAKF,uBAAuB,kBAAkB,8BAA8B;;;;UAI9E;WACC;WACA;aACE;aACA;;;;UAIH;WACC;WACA,OAAO;;UAER;WACC;WACA;WACA;WACA;;UAED;WACC;WACA;WACA;WACA,QAAQ;WACR;;KAEN;WACM;WACA;;WAEA;IACP,qBAAqB;WACd;IACP;;;;iBAIa,kBAAkB,aAAa,aAAa,aAAa,6BAA6B,gBAAgB,8BAA8B;;;UAG3I;WACC;WACA;;UAED;WACC;WACA;WACA;WACA,MAAM;;;;;UAKP;WACC;WACA;WACA;WACA,MAAM;WACN,aAAa,SAAS,eAAe;;;;;iBAK/B,4BAA4B,SAAS,mBAAmB,MAAM,gBAAgB;;;;;;iBAM9E,qBAAqB,OAAO,wBAAwB,SAAS,eAAe,0BAA0B,iBAAiB,OAAO,OAAO,KAAK,kCAAkC;;;;;;iBAM5K,qBAAqB,eAAe,oCAAoC;;;;iBAIxE,wBAAwB,eAAe,oCAAoC,0BAA0B"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { B as JsonValue } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { D as AuthoringTypeConstructorDescriptor, U as PslSpan, p as AuthoringFieldPresetDescriptor } from "./framework-authoring-
|
|
2
|
+
import { v as DataTypeId, w as DataTypeValue } from "./codec-types-BNVa23xn-DLZmMFiC.mjs";
|
|
3
|
+
import { D as AuthoringTypeConstructorDescriptor, U as PslSpan, p as AuthoringFieldPresetDescriptor } from "./framework-authoring-BYuHgXo6-BtKlRo4a.mjs";
|
|
4
4
|
import { r as ControlMutationDefaults } from "./mutation-default-types-DCgdIlXt-DSAdarYA.mjs";
|
|
5
5
|
import { r as Result } from "./result-BYCOANWy.mjs";
|
|
6
|
-
import { d as TaggedLiteralCanonicalization
|
|
7
|
-
import "./authoring-
|
|
8
|
-
import "./codec-
|
|
9
|
-
import "./control-
|
|
10
|
-
import "./psl-ast-
|
|
11
|
-
import { n as ContractSourceContext } from "./config-types-
|
|
12
|
-
import { $ as TypeAnnotationAst, A as NamespaceDeclarationAst, D as ModelAttributeAst, F as ParseDiagnostic, O as ModelDeclarationAst, T as MixinDeclarationAst, V as PslSources, Y as SyntaxNode, _ as GenericBlockDeclarationAst, f as DocumentAst, h as FieldDeclarationAst, k as NamedTypeDeclarationAst, l as CompositeTypeDeclarationAst, m as FieldAttributeAst, n as AstNode, p as ExpressionAst, w as KeyValuePairAst, z as PslDiagnostic } from "./parse-CJtBvEYy-
|
|
6
|
+
import { d as TaggedLiteralCanonicalization } from "./written-value-Dio_n0HT-CgpcE2lf.mjs";
|
|
7
|
+
import "./authoring-joNigE7w.mjs";
|
|
8
|
+
import "./codec-BxNHu928.mjs";
|
|
9
|
+
import "./control-Bp6XS6M2.mjs";
|
|
10
|
+
import "./psl-ast-DIzWPqtl.mjs";
|
|
11
|
+
import { n as ContractSourceContext } from "./config-types-Cz10_syo.mjs";
|
|
12
|
+
import { $ as TypeAnnotationAst, A as NamespaceDeclarationAst, D as ModelAttributeAst, F as ParseDiagnostic, O as ModelDeclarationAst, T as MixinDeclarationAst, V as PslSources, Y as SyntaxNode, _ as GenericBlockDeclarationAst, f as DocumentAst, h as FieldDeclarationAst, k as NamedTypeDeclarationAst, l as CompositeTypeDeclarationAst, m as FieldAttributeAst, n as AstNode, p as ExpressionAst, w as KeyValuePairAst, z as PslDiagnostic } from "./parse-CJtBvEYy-b7iSU0ii.mjs";
|
|
13
13
|
import { n as UnionToIntersection, t as Simplify } from "./types-DGxlljKG.mjs";
|
|
14
|
-
//#region ../../../1-framework/2-authoring/psl-parser/dist/binder-
|
|
14
|
+
//#region ../../../1-framework/2-authoring/psl-parser/dist/binder-BfzoRtNz.d.mts
|
|
15
15
|
//#region src/resolve.d.ts
|
|
16
16
|
interface ResolvedAttributeArg {
|
|
17
17
|
readonly kind: 'positional' | 'named';
|
|
@@ -302,8 +302,9 @@ interface TaggedLiteralArgType<Ctx extends AttributeCtx = AttributeCtx> extends
|
|
|
302
302
|
readonly tags: readonly string[];
|
|
303
303
|
readonly documentation: string;
|
|
304
304
|
}
|
|
305
|
-
/** A
|
|
306
|
-
interface ParsedTypedValue
|
|
305
|
+
/** A value of a data type parsed from an argument, with the argument's span. */
|
|
306
|
+
interface ParsedTypedValue {
|
|
307
|
+
readonly value: DataTypeValue;
|
|
307
308
|
readonly span: PslSpan;
|
|
308
309
|
}
|
|
309
310
|
interface DataTypeValueArgType<Ctx extends AttributeCtx = AttributeCtx> extends ArgTypeOutput<ParsedTypedValue, Ctx> {
|
|
@@ -509,4 +510,4 @@ declare function contributedTypeOf(resolution: Resolution | undefined, binder: B
|
|
|
509
510
|
declare function createBinder(input: CreateBinderInput): BinderResult;
|
|
510
511
|
//#endregion
|
|
511
512
|
export { ModelSymbol as $, DescribeUnresolvedType as A, SymbolTableResult as At, FixedStrArgType as B, createBinder as Bt, ContributedTypeNamespace as C, ResolvedAttributeArg as Ct, CtxOf as D, Scope as Dt, CreateBinderInput as E, ResolvedTypeConstructorCall as Et, FieldAttributeCtx as F, UnrestrictedNumArgType as Ft, InferAttr as G, memberEntries as Gt, FuncCallSig as H, isNamespaceLike as Ht, FieldRefArgType as I, UnrestrictedStrArgType as It, JsonArgType as J, readResolvedAttributes as Jt, InspectableArgType as K, nodePslSpan as Kt, FieldSymbol as L, UnsupportedAttribute as Lt, EntityDeclaration as M, TypedFuncCall as Mt, EntityRefArgType as N, UnresolvedTypeReference as Nt, DataTypeValueArgType as O, ScopeResolution as Ot, EntitySelector as P, UnrestrictedIdentifierArgType as Pt, ModelAttributeCtx as Q, FixedIdentifierArgType as R, buildSymbolTable as Rt, ContributedTypeDescriptor as S, ResolvedAttribute as St, ContributedTypeSymbol as T, ResolvedNamedTypeBinding as Tt, FunctionSymbol as U, keywordPslSpan as Ut, FuncCallArgType as V, entityReference as Vt, IdentifierArgType as W, matchesSelector as Wt, ListArgType as X, typeReferenceNode as Xt, JsonValueArgType as Y, readResolvedConstructorCall as Yt, MixinSymbol as Z, CompositeTypeSymbol as _, RecordArgType as _t, AttributeLevel as a, NumLiteralArgType as at, ContributedMember as b, RequiredContextFor as bt, AttributeSymbol as c, OutOf as ct, BinderResult as d, ParameterSymbol as dt, NamedOut as et, BlockAttributeCtx as f, ParsedTaggedLiteral as ft, BuildSymbolTableOptions as g, PslSymbol as gt, BoundSpec as h, PositionalParam as ht, AttributeCtx as i, NumLiteral as it, DescribeUnsupportedAttribute as j, TaggedLiteralArgType as jt, DeclarationFor as k, SymbolTable as kt, Binder as l, PSL_UNRESOLVED_REFERENCE as lt, BoolArgType as m, PosOut as mt, ArgType as n, NamespaceSymbol as nt, AttributeOut as o, OneOfArgType as ot, BlockSymbol as p, ParsedTypedValue as pt, IntArgType as q, readResolvedAttribute as qt, ArgTypeKind as r, NullArgType as rt, AttributeSpec as s, OptionalArgType as st, AnyArgType as t, NamedTypeSymbol as tt, BinderContext as u, Param as ut, ConstantSymbol as v, ReferencedFieldRefArgType as vt, ContributedTypeScope as w, ResolvedEntityReference as wt, ContributedNamespaceSymbol as x, Resolution as xt, ContextForRequirement as y, RejectingArgType as yt, FixedNumArgType as z, contributedTypeOf as zt };
|
|
512
|
-
//# sourceMappingURL=binder-
|
|
513
|
+
//# sourceMappingURL=binder-BfzoRtNz-uIAexNtf.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binder-
|
|
1
|
+
{"version":3,"file":"binder-BfzoRtNz-uIAexNtf.d.mts","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/binder-BfzoRtNz.d.mts"],"mappings":";;;;;;;;;;;;;;;UAUU;WACC;WACA;WACA;WACA,aAAa;WACb,MAAM;;UAEP,kBAAkB,cAAc,oBAAoB,oBAAoB,oBAAoB;WAC3F;WACA,eAAe;WACf,MAAM;WACN,MAAM;;UAEP;WACC;WACA,eAAe;WACf,MAAM;;iBAEA,sBAAsB,cAAc,oBAAoB,mBAAmB,WAAW,OAAO,SAAS,aAAa,kBAAkB;iBACrI,uBAAuB,cAAc,oBAAoB,mBAAmB,YAAY,SAAS,QAAQ,SAAS,sBAAsB,kBAAkB;iBAC1J,4BAA4B,YAAY,+BAA+B,SAAS,aAAa;iBAC7F,YAAY,MAAM,YAAY,SAAS,aAAa;;iBAEpD,eAAe,MAAM,YAAY,iBAAiB,SAAS,aAAa;;;UAG/E;WACC,kBAAkB;WAClB,YAAY,eAAe;WAC3B,YAAY,eAAe;;UAE5B;WACC,MAAM;WACN,MAAM;;UAEP;WACC;WACA;WACA;WACA,uBAAuB;WACvB,QAAQ,eAAe;WACvB,gBAAgB,eAAe;WAC/B,QAAQ,eAAe;WACvB,QAAQ,eAAe;;UAExB;WACC;WACA;WACA,MAAM;WACN,MAAM;EACf,QAAQ,eAAe;EACvB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA,MAAM;WACN,MAAM;EACf,QAAQ,eAAe;EACvB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA;WACA,MAAM;WACN,MAAM;EACf,kBAAkB;EAClB,qBAAqB,kBAAkB;;UAE/B;WACC;WACA;WACA;WACA,MAAM;WACN,MAAM;WACN,QAAQ,eAAe;WACvB,kBAAkB;WAClB,qBAAqB,kBAAkB;;UAExC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kBAAkB,cAAc,QAAQ;EACnF;;iBAEe,cAAc,WAAW,QAAQ;EAChD;KACG,2BAA2B;;;cAGlB;KACT,YAAY,qBAAqB,qBAAqB,qBAAqB,qBAAqB,qBAAqB;UAChH;WACC;WACA;WACA;WACA,MAAM;;UAEP;WACC;WACA;WACA,OAAO;;UAER;WACC;WACA;WACA,WAAW;;UAEZ;WACC;WACA;WACA;;KAEN,YAAY,cAAc,sBAAsB,kBAAkB,cAAc,kBAAkB,cAAc;KAChH,aAAa,cAAc,sBAAsB;KACjD,aAAa;WACP;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;WACA,QAAQ;;WAER;;WAEA;WACA;;UAED;EACR,eAAe,MAAM,aAAa;EAClC,cAAc,MAAM,aAAa;EACjC,QAAQ,MAAM,aAAa;;UAEnB;WACC,WAAW;WACX;WACA,OAAO;WACP,OAAO;;KAEb,gCAAgC,aAAa,yBAAyB;UACjE;WACC,OAAO;WACP,OAAO;WACP;;KAEN,0BAA0B,YAAY;UACjC,sBAAsB,KAAK;WAC1B,yBAAyB,KAAK;;UAE/B;WACC,SAAS;WACT,aAAa;WACb,SAAS;;UAEV;WACC,QAAQ;WACR,sBAAsB;;iBAEhB,kBAAkB,QAAQ,cAAc,kBAAkB;iBAC1D,kBAAkB,YAAY,wBAAwB,QAAQ,SAAS;iBACvE,aAAa,OAAO,oBAAoB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
2
|
import { n as isCodecTrait } from "./codec-types-BXLUbk-Y-DpGfKGK0.mjs";
|
|
3
|
-
//#region ../../../1-framework/1-core/framework-components/dist/capabilities-
|
|
3
|
+
//#region ../../../1-framework/1-core/framework-components/dist/capabilities-Cn-Kepnv.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
|
*/
|
|
@@ -51,7 +51,7 @@ function isAggregateDescriptor(value) {
|
|
|
51
51
|
if (!isObjectLike(value)) return false;
|
|
52
52
|
if (!("operation" in value) || !isNonEmptyString(value.operation)) return false;
|
|
53
53
|
if (!("nullable" in value) || typeof value.nullable !== "boolean") return false;
|
|
54
|
-
if (value.nullable === false && (!("
|
|
54
|
+
if (value.nullable === false && (!("emptyResultWire" in value) || value.emptyResultWire === void 0)) return false;
|
|
55
55
|
if (!("input" in value) || !isAggregateInputMatch(value.input)) return false;
|
|
56
56
|
if (!("output" in value) || !isAggregateOutputCodec(value.output)) return false;
|
|
57
57
|
return value.input.kind === "codec" || value.input.kind === "trait" || value.output.kind === "codec";
|
|
@@ -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-Cn-Kepnv-B8FOAyUu.mjs.map
|
package/dist/{capabilities-CnCdDH1J-Bq8Zf0nY.mjs.map → capabilities-Cn-Kepnv-B8FOAyUu.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities-
|
|
1
|
+
{"version":3,"file":"capabilities-Cn-Kepnv-B8FOAyUu.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/capabilities-Cn-Kepnv.mjs"],"sourcesContent":["import { n as isCodecTrait } from \"./codec-types-BXLUbk-Y.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 && (!(\"emptyResultWire\" in value) || value.emptyResultWire === 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-Cn-Kepnv.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,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CAAC,KAAK,UAAU,SAAS,KAAK,OAAO,SAAS,KAAK;CAC9D,OAAO;AACR;AACA,SAAS,wBAAwB,OAAO;CACvC,IAAI,CAAC,cAAc,KAAK,GAAG,OAAO,CAAC;CACnC,MAAM,MAAM,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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { s as tsStringLiteral } from "./dist-D1f6xr7F.mjs";
|
|
2
|
+
//#region ../../../1-framework/1-core/framework-components/dist/codec.mjs
|
|
3
|
+
/**
|
|
4
|
+
* 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`.
|
|
5
|
+
*/
|
|
6
|
+
function column(codecFactory, codecId, typeParams) {
|
|
7
|
+
return {
|
|
8
|
+
codecFactory,
|
|
9
|
+
codecId,
|
|
10
|
+
typeParams
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders a stored value as a TypeScript literal (e.g. `"low"`, `1`, `true`), or `undefined`
|
|
15
|
+
* when the value isn't literal-expressible (objects, arrays, null).
|
|
16
|
+
*
|
|
17
|
+
* Valid **only for codecs whose application value is the stored JSON** (text, int, float, bool). A
|
|
18
|
+
* codec whose application value differs from the stored JSON (e.g. digit text read as a `bigint`)
|
|
19
|
+
* must NOT use this: it renders the application value in its own `renderValueLiteral`.
|
|
20
|
+
*/
|
|
21
|
+
function renderTsLiteral(value) {
|
|
22
|
+
if (typeof value === "string") return tsStringLiteral(value);
|
|
23
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { renderTsLiteral as n, column as t };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=codec-BYGt3r-S.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-BYGt3r-S.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.mjs"],"sourcesContent":["import { C as readJsonMatching, E as DATA_TYPE_ID_PATTERN, S as readJsonIntegerText, T as refuseJsonValue, _ as isIntegerIn, a as dataTypeParams, b as readJsonFloat, c as requireValueOf, d as schemaKeysAllowing, f as INT32_RANGE, g as floatToJson, h as SAFE_INTEGER_RANGE, i as dataTypeId, l as requiredParamKeys, m as SAFE_INTEGER_BIGINT_RANGE, n as createDataTypeLookup, o as dataTypeValuesEqual, p as INT64_RANGE, r as dataType, s as objectSchemaKeys, t as assembleDataTypes, u as requiredSchemaKeys, v as isNonFiniteText, w as readJsonString, x as readJsonInteger, y as readJsonBoolean } from \"./data-type-Yz-2OZh-.mjs\";\nimport { a as readContractValue, i as CodecImpl, n as CodecDescriptorTemplateImpl, r as enumRefusalOf, t as CodecDescriptorImpl } from \"./codec-descriptor-C_M6vCEV.mjs\";\nimport { t as emptyCodecLookup } from \"./codec-types-BXLUbk-Y.mjs\";\nimport { a as resolveCodecDescriptorOrThrow, i as materializeCodec, o as validateCodecTypeParams, r as codecForRef, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-qqMjZrmn.mjs\";\nimport { tsStringLiteral } from \"@internal/ts-render\";\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*/\nfunction column(codecFactory, codecId, typeParams) {\n\treturn {\n\t\tcodecFactory,\n\t\tcodecId,\n\t\ttypeParams\n\t};\n}\n//#endregion\n//#region src/shared/render-ts-literal.ts\n/**\n* Renders a stored 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 codecs whose application value is the stored JSON** (text, int, float, bool). A\n* codec whose application value differs from the stored JSON (e.g. digit text read as a `bigint`)\n* must NOT use this: it renders the application value in its own `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, DATA_TYPE_ID_PATTERN, INT32_RANGE, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, assembleDataTypes, codecForRef, column, createDataTypeLookup, dataType, dataTypeId, dataTypeParams, dataTypeValuesEqual, emptyCodecLookup, enumRefusalOf, floatToJson, isIntegerIn, isNonFiniteText, materializeCodec, objectSchemaKeys, readContractValue, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, renderTsLiteral, requireValueOf, requiredParamKeys, requiredSchemaKeys, resolveCodecDescriptorOrThrow, schemaKeysAllowing, validateCodecTypeParams };\n\n//# sourceMappingURL=codec.mjs.map"],"mappings":";;;;;AASA,SAAS,OAAO,cAAc,SAAS,YAAY;CAClD,OAAO;EACN;EACA;EACA;CACD;AACD;;;;;;;;;AAWA,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,5 +1,5 @@
|
|
|
1
1
|
import { B as JsonValue, d as ContractField, tt as ValueSetRef } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
|
|
2
|
-
import { c as CodecDescriptorTemplate, d as CodecInstanceContext, i as Codec, m as CodecRef, p as CodecLookupWithDescriptors, t as AnyCodecDescriptor } from "./codec-types-
|
|
2
|
+
import { c as CodecDescriptorTemplate, d as CodecInstanceContext, i as Codec, m as CodecRef, p as CodecLookupWithDescriptors, t as AnyCodecDescriptor } from "./codec-types-BNVa23xn-DLZmMFiC.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
|
/**
|
|
@@ -80,15 +80,19 @@ type ColumnHelperForStrict<D extends CodecDescriptorTemplate<any>> = (...args: a
|
|
|
80
80
|
*/
|
|
81
81
|
type ColumnHelperParams<D extends CodecDescriptorTemplate<any>> = Parameters<D['factory']>[0] extends Record<string, unknown> ? Parameters<D['factory']>[0] : undefined;
|
|
82
82
|
//#endregion
|
|
83
|
-
//#region src/shared/
|
|
83
|
+
//#region src/shared/data-type-id-pattern.d.ts
|
|
84
|
+
/** The whole of what a data type id is: `owner/name` in lower case, with no version. */
|
|
85
|
+
declare const DATA_TYPE_ID_PATTERN: RegExp;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/shared/json-readers.d.ts
|
|
84
88
|
/**
|
|
85
|
-
* The refusal
|
|
89
|
+
* The refusal of a JSON value: `RUNTIME.DECODE_FAILED`, `<owner> JSON value must be <expected>`, with `meta.received`, the value it was given as JSON text, cut to 100 characters, and `meta.dataType` or `meta.codecId` naming the owner. A data type id carries no version and a codec id does, so the id says which it is.
|
|
86
90
|
*/
|
|
87
|
-
declare function refuseJsonValue(
|
|
88
|
-
declare function
|
|
91
|
+
declare function refuseJsonValue(owner: string, expected: string, json: JsonValue): never;
|
|
92
|
+
declare function readJsonString(owner: string, json: JsonValue): string;
|
|
89
93
|
/** Reads a JSON string that matches `pattern`; `form` names what the pattern accepts, for the refusal. */
|
|
90
|
-
declare function
|
|
91
|
-
declare function
|
|
94
|
+
declare function readJsonMatching(owner: string, json: JsonValue, pattern: RegExp, form: string): string;
|
|
95
|
+
declare function readJsonBoolean(owner: string, json: JsonValue): boolean;
|
|
92
96
|
interface IntegerRange {
|
|
93
97
|
readonly min: number;
|
|
94
98
|
readonly max: number;
|
|
@@ -99,7 +103,7 @@ declare function isIntegerIn(value: unknown, range: IntegerRange): value is numb
|
|
|
99
103
|
declare const SAFE_INTEGER_RANGE: IntegerRange;
|
|
100
104
|
/** The integers a signed 32-bit integer holds. */
|
|
101
105
|
declare const INT32_RANGE: IntegerRange;
|
|
102
|
-
declare function
|
|
106
|
+
declare function readJsonInteger(owner: string, json: JsonValue, range: IntegerRange): number;
|
|
103
107
|
interface BigIntRange {
|
|
104
108
|
readonly min: bigint;
|
|
105
109
|
readonly max: bigint;
|
|
@@ -111,22 +115,21 @@ declare const SAFE_INTEGER_BIGINT_RANGE: BigIntRange;
|
|
|
111
115
|
/**
|
|
112
116
|
* Reads an integer a codec writes as decimal text, because a JSON number cannot hold every value of its type. The text must be the integer's decimal text, with no leading zeros and no minus sign on zero; another spelling is refused with the text to write, as `"7"` for `"007"`.
|
|
113
117
|
*/
|
|
114
|
-
declare function
|
|
118
|
+
declare function readJsonIntegerText(owner: string, json: JsonValue, range?: BigIntRange): bigint;
|
|
115
119
|
/** Whether `text` is `NaN`, `Infinity` or `-Infinity`, the text a float's JSON form writes for a value JSON has no number for. */
|
|
116
120
|
declare function isNonFiniteText(text: string): boolean;
|
|
117
121
|
/** JSON has no number for NaN or an infinity, so a float's JSON form writes them as the text `NaN`, `Infinity` and `-Infinity`. */
|
|
118
|
-
declare function
|
|
119
|
-
declare function
|
|
122
|
+
declare function floatToJson(value: number): JsonValue;
|
|
123
|
+
declare function readJsonFloat(owner: string, json: JsonValue): number;
|
|
120
124
|
//#endregion
|
|
121
125
|
//#region src/shared/render-ts-literal.d.ts
|
|
122
126
|
/**
|
|
123
|
-
* Renders a
|
|
127
|
+
* Renders a stored value as a TypeScript literal (e.g. `"low"`, `1`, `true`), or `undefined`
|
|
124
128
|
* when the value isn't literal-expressible (objects, arrays, null).
|
|
125
129
|
*
|
|
126
|
-
* Valid **only for
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* `renderValueLiteral`.
|
|
130
|
+
* Valid **only for codecs whose application value is the stored JSON** (text, int, float, bool). A
|
|
131
|
+
* codec whose application value differs from the stored JSON (e.g. digit text read as a `bigint`)
|
|
132
|
+
* must NOT use this: it renders the application value in its own `renderValueLiteral`.
|
|
130
133
|
*/
|
|
131
134
|
declare function renderTsLiteral(value: JsonValue): string | undefined;
|
|
132
135
|
//#endregion
|
|
@@ -162,5 +165,5 @@ declare function materializeCodec(descriptor: AnyCodecDescriptor, ref: CodecRef,
|
|
|
162
165
|
*/
|
|
163
166
|
declare function codecForRef(lookup: Pick<CodecLookupWithDescriptors, 'descriptorFor'>, ref: CodecRef): Codec | undefined;
|
|
164
167
|
//#endregion
|
|
165
|
-
export {
|
|
166
|
-
//# sourceMappingURL=codec-
|
|
168
|
+
export { resolveCodecDescriptorOrThrow as A, readJsonFloat as C, readJsonString as D, readJsonMatching as E, refuseJsonValue as O, readJsonBoolean as S, readJsonIntegerText as T, column as _, ColumnHelperForStrict as a, isNonFiniteText as b, DATA_TYPE_ID_PATTERN as c, IntegerRange as d, SAFE_INTEGER_BIGINT_RANGE as f, codecForRef as g, ScalarFieldDeclarationBuilder as h, ColumnHelperFor as i, validateCodecTypeParams as j, renderTsLiteral as k, INT32_RANGE as l, ScalarFieldDeclaration as m, CONTRACT_CODEC_DESCRIPTOR_MISSING as n, ColumnSpec as o, SAFE_INTEGER_RANGE as p, CodecDescriptorRef as r, ColumnTypeDescriptor as s, BigIntRange as t, INT64_RANGE as u, floatToJson as v, readJsonInteger as w, materializeCodec as x, isIntegerIn as y };
|
|
169
|
+
//# sourceMappingURL=codec-BxNHu928.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-BxNHu928.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.d.mts"],"mappings":";;;;;;;;;;;KAUK,qBAAqB;WACf,SAAS;WACT,aAAa;WACb;;;;;;;;;WASA,WAAW;WACX,YAAY;;;UAGb,mBAAmB;WAClB,SAAS;;;;;UAKV,uBAAuB,mBAAmB,qBAAqB,oBAAoB;WAClF,aAAa;WACb,UAAU;WACV,OAAO;;;UAGR,8BAA8B,mBAAmB,qBAAqB,oBAAoB;EAClG,SAAS,uBAAuB,YAAY;;;;;;;;;KASzC;WACM;WACA;WACA;;;;;;;UAOD,WAAW,GAAG,UAAU,6CAA6C;WACpE,eAAe,KAAK,yBAAyB;WAC7C,YAAY;;;;;iBAKN,OAAO,GAAG,UAAU,qCAAqC,eAAe,KAAK,yBAAyB,GAAG,iBAAiB,YAAY,IAAI,WAAW,GAAG;;;;;;KAMpK,gBAAgB,UAAU,oCAAoC,gBAAgB,oBAAoB,mBAAmB;;;;KAIrH,sBAAsB,UAAU,oCAAoC,gBAAgB,WAAW,WAAW,WAAW,gBAAgB,mBAAmB;;;;KAIxJ,mBAAmB,UAAU,gCAAgC,WAAW,yBAAyB,0BAA0B,WAAW;;;;cAI7H,sBAAsB;;;;;;iBAMnB,gBAAgB,eAAe,kBAAkB,MAAM;iBACvD,eAAe,eAAe,MAAM;;iBAEpC,iBAAiB,eAAe,MAAM,WAAW,SAAS,QAAQ;iBAClE,gBAAgB,eAAe,MAAM;UAC5C;WACC;WACA;;;iBAGM,YAAY,gBAAgB,OAAO,eA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