@prisma/orm-family-mongo 8.0.0-rc.2-dev.2 → 8.0.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/authoring-entity-types-UA5sY_Xm-DeYf_cYq.mjs +87 -0
- package/dist/authoring-entity-types-UA5sY_Xm-DeYf_cYq.mjs.map +1 -0
- package/dist/{canonicalization-hooks-DF3Z6sjO.mjs → canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs} +4 -3
- package/dist/canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs.map +1 -0
- package/dist/codec.d.mts +1 -1
- package/dist/codec.mjs +1 -1
- package/dist/{config-types-CFDf9ivE.mjs → config-types-DYTCUpAs.mjs} +5 -5
- package/dist/config-types-DYTCUpAs.mjs.map +1 -0
- package/dist/contract-builder-BHzQQk70.mjs +965 -0
- package/dist/contract-builder-BHzQQk70.mjs.map +1 -0
- package/dist/{contract-builder-DB8nguDE.d.mts → contract-builder-ClL-xMK2.d.mts} +271 -89
- package/dist/contract-builder-ClL-xMK2.d.mts.map +1 -0
- package/dist/contract-prisma6__provider.d.mts +35 -0
- package/dist/contract-prisma6__provider.d.mts.map +1 -0
- package/dist/contract-prisma6__provider.mjs +1202 -0
- package/dist/contract-prisma6__provider.mjs.map +1 -0
- package/dist/contract-psl.d.mts +152 -28
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +3 -2
- package/dist/contract-psl__provider.mjs +74 -44
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +2 -2
- package/dist/contract-ts.mjs +2 -2
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +2 -2
- package/dist/contract-ts__contract-builder.mjs +1 -1
- package/dist/contract.d.mts +3 -3
- package/dist/contract.mjs +3 -3
- package/dist/contract__canonicalization-hooks.mjs +1 -1
- package/dist/contract__data-type.d.mts +37 -0
- package/dist/contract__data-type.d.mts.map +1 -0
- package/dist/contract__data-type.mjs +2 -0
- package/dist/contract__entity-kinds.d.mts +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/{control-C7-kthr1.d.mts → control-4pC8N2Rb.d.mts} +32 -19
- package/dist/control-4pC8N2Rb.d.mts.map +1 -0
- package/dist/{control-CClR5JMr.mjs → control-BQMBG11d.mjs} +19 -2
- package/dist/control-BQMBG11d.mjs.map +1 -0
- package/dist/{control-BbZQqmxo.mjs → control-B_pPN58L.mjs} +195 -87
- package/dist/control-B_pPN58L.mjs.map +1 -0
- package/dist/{control-Cj81sPbj.d.mts → control-CvQSMuxa.d.mts} +29 -6
- package/dist/control-CvQSMuxa.d.mts.map +1 -0
- package/dist/{control-adapter-Db5pT77b.d.mts → control-adapter-Bh_ZraGM--5JDb99k.d.mts} +48 -4
- package/dist/control-adapter-Bh_ZraGM--5JDb99k.d.mts.map +1 -0
- package/dist/control-adapter-CndDiTXW.d.mts +1 -0
- package/dist/dist-B8f-pfcT.mjs +1031 -0
- package/dist/dist-B8f-pfcT.mjs.map +1 -0
- package/dist/dist-Bgk36iLI.mjs +53 -0
- package/dist/dist-Bgk36iLI.mjs.map +1 -0
- package/dist/{dist-C7Ykq48Q.mjs → dist-CO2arS1K.mjs} +3 -1
- package/dist/dist-CO2arS1K.mjs.map +1 -0
- package/dist/{dist-Dyp05u64.mjs → dist-gmGbjhmk.mjs} +56 -32
- package/dist/dist-gmGbjhmk.mjs.map +1 -0
- package/dist/dist-xk_0xOR-.mjs +28 -0
- package/dist/dist-xk_0xOR-.mjs.map +1 -0
- package/dist/emitter.d.mts +2 -4
- package/dist/emitter.d.mts.map +1 -1
- package/dist/emitter.mjs +1 -1
- package/dist/{entity-kinds-B4KNTF8z-DPIuUuuB.mjs → entity-kinds-BQBtfVet-B-Px7NHp.mjs} +35 -18
- package/dist/entity-kinds-BQBtfVet-B-Px7NHp.mjs.map +1 -0
- package/dist/{execution-D5XyZ5XS.mjs → execution-CgP1Sdbr.mjs} +6 -3
- package/dist/execution-CgP1Sdbr.mjs.map +1 -0
- package/dist/{execution-CKnUiOfm.d.mts → execution-tPmN5pge.d.mts} +6 -2
- package/dist/execution-tPmN5pge.d.mts.map +1 -0
- package/dist/{exports-Bx-hlnZ3.mjs → exports-BAimNKOs.mjs} +31 -21
- package/dist/exports-BAimNKOs.mjs.map +1 -0
- package/dist/exports-BHQVApAg.mjs +86 -0
- package/dist/exports-BHQVApAg.mjs.map +1 -0
- package/dist/family.d.mts +11 -10
- package/dist/family.mjs +10 -9
- package/dist/family__control-adapter.d.mts +3 -2
- package/dist/family__control.d.mts +2 -2
- package/dist/family__control.mjs +3 -3
- package/dist/family__ir.d.mts +2 -2
- package/dist/family__ir.mjs +3 -3
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__migration.mjs +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +4 -2
- package/dist/family__pack.mjs.map +1 -1
- package/dist/family__runtime.d.mts +3 -3
- package/dist/family__runtime.mjs +3 -2
- package/dist/family__schema-verify.d.mts +1 -1
- package/dist/family__schema-verify.mjs +1 -1
- package/dist/{field-accessor-0oUt6RZC-B_Z30uAA.mjs → field-accessor-0oUt6RZC-CrJVzQiS.mjs} +2 -2
- package/dist/{field-accessor-0oUt6RZC-B_Z30uAA.mjs.map → field-accessor-0oUt6RZC-CrJVzQiS.mjs.map} +1 -1
- package/dist/{field-accessor-DHsAPiW3-BdYCspQC.d.mts → field-accessor-CmxCw9xP-C6jMngbK.d.mts} +35 -24
- package/dist/field-accessor-CmxCw9xP-C6jMngbK.d.mts.map +1 -0
- package/dist/index-9DDQlC5U.d.mts +87 -0
- package/dist/index-9DDQlC5U.d.mts.map +1 -0
- package/dist/{index-BR0ue13b.d.mts → index-BdXzdXGE.d.mts} +14 -8
- package/dist/index-BdXzdXGE.d.mts.map +1 -0
- package/dist/index-BhIiYIXu.d.mts +845 -0
- package/dist/index-BhIiYIXu.d.mts.map +1 -0
- package/dist/index-CQG5l2o9.d.mts +67 -0
- package/dist/index-CQG5l2o9.d.mts.map +1 -0
- package/dist/{index-DAOkcTCK.d.mts → index-FeVOOdZ0.d.mts} +9 -8
- package/dist/index-FeVOOdZ0.d.mts.map +1 -0
- package/dist/index-YY1SU_7o.d.mts +366 -0
- package/dist/index-YY1SU_7o.d.mts.map +1 -0
- package/dist/{index-DxoO-ywI.d.mts → index-rANtsIZG.d.mts} +9 -5
- package/dist/{index-DxoO-ywI.d.mts.map → index-rANtsIZG.d.mts.map} +1 -1
- package/dist/interpreter-BfHdPd7T-DGqi2_Um.mjs +2186 -0
- package/dist/interpreter-BfHdPd7T-DGqi2_Um.mjs.map +1 -0
- package/dist/{ir-CQrenTYt.d.mts → ir-BLC0t6_x.d.mts} +5 -27
- package/dist/ir-BLC0t6_x.d.mts.map +1 -0
- package/dist/{ir-Ch2aPr7a.mjs → ir-DGm0HXbP.mjs} +3 -8
- package/dist/ir-DGm0HXbP.mjs.map +1 -0
- package/dist/lowering.d.mts +1 -1
- package/dist/{migration-dcM7u4HG.mjs → migration-DnQ7_A_B.mjs} +4 -4
- package/dist/migration-DnQ7_A_B.mjs.map +1 -0
- package/dist/{migration-CNDQv5yB.d.mts → migration-YQVmgFU8.d.mts} +7 -7
- package/dist/{migration-CNDQv5yB.d.mts.map → migration-YQVmgFU8.d.mts.map} +1 -1
- package/dist/{mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs → mongo-contract-serializer-Zx1rvil3-BywiKCpn.mjs} +27 -8
- package/dist/mongo-contract-serializer-Zx1rvil3-BywiKCpn.mjs.map +1 -0
- package/dist/{mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts → mongo-contract-view-AnejqfrQ-Wj_ulq2L.d.mts} +3 -3
- package/dist/{mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts.map → mongo-contract-view-AnejqfrQ-Wj_ulq2L.d.mts.map} +1 -1
- package/dist/{mongo-contract-view-rcWzby6f-wRBCUnBt.mjs → mongo-contract-view-D5yu2LrY-DCAZYJ4q.mjs} +4 -4
- package/dist/{mongo-contract-view-rcWzby6f-wRBCUnBt.mjs.map → mongo-contract-view-D5yu2LrY-DCAZYJ4q.mjs.map} +1 -1
- package/dist/mongo-data-type-DzyzU4LF-C1ydFXgE.mjs +53 -0
- package/dist/mongo-data-type-DzyzU4LF-C1ydFXgE.mjs.map +1 -0
- package/dist/{mongo-value-set-tNn9-pun-dJYx_rVD.d.mts → mongo-value-set-DEd7WLCT-B2Ar2GkJ.d.mts} +20 -4
- package/dist/mongo-value-set-DEd7WLCT-B2Ar2GkJ.d.mts.map +1 -0
- package/dist/orm.d.mts +154 -96
- package/dist/orm.d.mts.map +1 -1
- package/dist/orm.mjs +670 -148
- package/dist/orm.mjs.map +1 -1
- package/dist/pack-qw77Jt2G.d.mts +58 -0
- package/dist/pack-qw77Jt2G.d.mts.map +1 -0
- package/dist/query-ast.d.mts +5 -5
- package/dist/query-ast.mjs +3 -3
- package/dist/query-ast__control.d.mts +4 -4
- package/dist/query-ast__control.mjs +2 -2
- package/dist/query-ast__execution.d.mts +2 -2
- package/dist/query-ast__execution.mjs +1 -1
- package/dist/query-builder.d.mts +4 -836
- package/dist/query-builder.mjs +2 -2
- package/dist/query-builder__contract-free.d.mts +6 -6
- package/dist/query-builder__contract-free.mjs +3 -3
- package/dist/{query-plan-C0-Yu8hf-DdilEdW6.d.mts → query-plan-3fs1HokF-CrNsr-Wx.d.mts} +10 -4
- package/dist/{query-plan-C0-Yu8hf-DdilEdW6.d.mts.map → query-plan-3fs1HokF-CrNsr-Wx.d.mts.map} +1 -1
- package/dist/runtime-B5fNQHQZ.mjs +16 -0
- package/dist/runtime-B5fNQHQZ.mjs.map +1 -0
- package/dist/runtime-yZA30qM2.d.mts +11 -0
- package/dist/runtime-yZA30qM2.d.mts.map +1 -0
- package/dist/runtime.d.mts +74 -87
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +133 -67
- package/dist/runtime.mjs.map +1 -1
- package/dist/schema-ir.d.mts +2 -2
- package/dist/schema-ir.mjs +2 -2
- package/dist/{schema-verify-DJGr28XW.d.mts → schema-verify-CVOG6EZx.d.mts} +5 -5
- package/dist/{schema-verify-DJGr28XW.d.mts.map → schema-verify-CVOG6EZx.d.mts.map} +1 -1
- package/dist/value.d.mts +2 -2
- package/dist/value.mjs +1 -1
- package/dist/{verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs → verify-mongo-schema-CeQP5N4k-CNOctppM.mjs} +9 -26
- package/dist/verify-mongo-schema-CeQP5N4k-CNOctppM.mjs.map +1 -0
- package/dist/wire.d.mts +3 -3
- package/dist/wire.mjs +14 -2
- package/dist/wire.mjs.map +1 -1
- package/package.json +24 -21
- package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs +0 -176
- package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs.map +0 -1
- package/dist/canonicalization-hooks-DF3Z6sjO.mjs.map +0 -1
- package/dist/config-types-CFDf9ivE.mjs.map +0 -1
- package/dist/contract-builder-BFq0gOMV.mjs +0 -634
- package/dist/contract-builder-BFq0gOMV.mjs.map +0 -1
- package/dist/contract-builder-DB8nguDE.d.mts.map +0 -1
- package/dist/control-BbZQqmxo.mjs.map +0 -1
- package/dist/control-C7-kthr1.d.mts.map +0 -1
- package/dist/control-CClR5JMr.mjs.map +0 -1
- package/dist/control-Cj81sPbj.d.mts.map +0 -1
- package/dist/control-adapter-Db5pT77b.d.mts.map +0 -1
- package/dist/dist-C7Ykq48Q.mjs.map +0 -1
- package/dist/dist-Czwqx_i3.mjs +0 -58
- package/dist/dist-Czwqx_i3.mjs.map +0 -1
- package/dist/dist-DHrEJnhK.mjs +0 -236
- package/dist/dist-DHrEJnhK.mjs.map +0 -1
- package/dist/dist-Dyp05u64.mjs.map +0 -1
- package/dist/entity-kinds-B4KNTF8z-DPIuUuuB.mjs.map +0 -1
- package/dist/execution-CKnUiOfm.d.mts.map +0 -1
- package/dist/execution-D5XyZ5XS.mjs.map +0 -1
- package/dist/exports-Bx-hlnZ3.mjs.map +0 -1
- package/dist/exports-C4RGBGzZ.mjs +0 -156
- package/dist/exports-C4RGBGzZ.mjs.map +0 -1
- package/dist/field-accessor-DHsAPiW3-BdYCspQC.d.mts.map +0 -1
- package/dist/index-BR0ue13b.d.mts.map +0 -1
- package/dist/index-Cd2zLiU6.d.mts +0 -128
- package/dist/index-Cd2zLiU6.d.mts.map +0 -1
- package/dist/index-DAOkcTCK.d.mts.map +0 -1
- package/dist/index-Dv2PNMiG.d.mts +0 -53
- package/dist/index-Dv2PNMiG.d.mts.map +0 -1
- package/dist/index-wKMm41HC.d.mts +0 -30
- package/dist/index-wKMm41HC.d.mts.map +0 -1
- package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs +0 -1091
- package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs.map +0 -1
- package/dist/ir-CQrenTYt.d.mts.map +0 -1
- package/dist/ir-Ch2aPr7a.mjs.map +0 -1
- package/dist/migration-dcM7u4HG.mjs.map +0 -1
- package/dist/mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs.map +0 -1
- package/dist/mongo-value-set-tNn9-pun-dJYx_rVD.d.mts.map +0 -1
- package/dist/pack-D9aLY50F.d.mts +0 -44
- package/dist/pack-D9aLY50F.d.mts.map +0 -1
- package/dist/query-builder.d.mts.map +0 -1
- package/dist/runtime-DPkRW4iu.d.mts +0 -1
- package/dist/verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @prisma/orm-family-mongo
|
|
2
2
|
|
|
3
|
-
The MongoDB family domain of Prisma
|
|
3
|
+
The MongoDB family domain of Prisma 8: the Mongo contract surface, value and codec model, query AST and builders, wire transport, and the Mongo runtime.
|
|
4
4
|
|
|
5
5
|
Applications receive it as an exact-pinned dependency of the Mongo facade (`@prisma/orm-mongo`); app developers install the facade. Extension authors and decomposed installs building against the Mongo family import it directly.
|
|
6
6
|
|
|
@@ -21,7 +21,3 @@ Applications receive it as an exact-pinned dependency of the Mongo facade (`@pri
|
|
|
21
21
|
## Responsibilities
|
|
22
22
|
|
|
23
23
|
Everything Mongo-shaped that is independent of the concrete target wiring: contract semantics, query representation, and the family-level control/migration surface. The target descriptor, adapter, and driver live in `@prisma/orm-target-mongo`.
|
|
24
|
-
|
|
25
|
-
## Dependencies
|
|
26
|
-
|
|
27
|
-
`@prisma/orm-framework` and `@prisma/orm-toolchain` (exact lockstep pins), the `mongodb` driver library, and small third-party runtime libraries.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { enumRefusalOf } from "@prisma/orm-framework/components/codec";
|
|
2
|
+
import "@prisma/orm-framework/utils/casts";
|
|
3
|
+
import "@prisma/orm-framework/components/ir";
|
|
4
|
+
import "@prisma/orm-framework/contract/types";
|
|
5
|
+
import "@prisma/orm-framework/contract/hashing";
|
|
6
|
+
import { enumType } from "@prisma/orm-framework/contract-authoring";
|
|
7
|
+
import { readEnumBlockMembers, resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
|
|
8
|
+
import { blockAttribute, enumMemberValue, mapBlock, str } from "@prisma/orm-framework/psl-parser";
|
|
9
|
+
import "@prisma/orm-framework/utils/defined";
|
|
10
|
+
import "@prisma/orm-framework/components/components";
|
|
11
|
+
import "@prisma/orm-framework/components/control";
|
|
12
|
+
import "@prisma/orm-framework/utils/canonical-stringify";
|
|
13
|
+
//#region ../../../2-mongo-family/9-family/dist/authoring-entity-types-UA5sY_Xm.mjs
|
|
14
|
+
function mongoFamilyEnumSpec() {
|
|
15
|
+
return mapBlock({
|
|
16
|
+
value: {
|
|
17
|
+
type: enumMemberValue(),
|
|
18
|
+
documentation: "The member's value, written as a value of the enum's data type; a bare member stores its own name."
|
|
19
|
+
},
|
|
20
|
+
allowBare: true
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const mongoFamilyEntityTypes = { enum: {
|
|
24
|
+
kind: "entity",
|
|
25
|
+
discriminator: "enum",
|
|
26
|
+
output: { factory: (block, ctx) => {
|
|
27
|
+
const sourceId = ctx.sourceId ?? "unknown";
|
|
28
|
+
const diagnostics = ctx.diagnostics;
|
|
29
|
+
const resolved = resolveEnumCodecId(block, ctx);
|
|
30
|
+
if (resolved === void 0) return;
|
|
31
|
+
const { codecId, codecSpan } = resolved;
|
|
32
|
+
const descriptor = ctx.codecLookup.descriptorFor(codecId);
|
|
33
|
+
if (descriptor === void 0) {
|
|
34
|
+
diagnostics?.push({
|
|
35
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
36
|
+
message: `enum "${block.name}" @@type references unknown codec "${codecId}"`,
|
|
37
|
+
sourceId,
|
|
38
|
+
span: codecSpan
|
|
39
|
+
});
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const enumRefusal = enumRefusalOf(descriptor);
|
|
43
|
+
if (enumRefusal !== void 0) {
|
|
44
|
+
diagnostics?.push({
|
|
45
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
46
|
+
message: `enum "${block.name}" cannot use the codec "${codecId}". ${enumRefusal}`,
|
|
47
|
+
sourceId,
|
|
48
|
+
span: codecSpan
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const codec = ctx.codecLookup.get(codecId);
|
|
53
|
+
if (codec === void 0) {
|
|
54
|
+
diagnostics?.push({
|
|
55
|
+
code: "PSL_EXTENSION_INVALID_VALUE",
|
|
56
|
+
message: `enum "${block.name}" @@type codec "${codecId}" is registered but codecLookup.get has no codec for it`,
|
|
57
|
+
sourceId,
|
|
58
|
+
span: codecSpan
|
|
59
|
+
});
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const members = readEnumBlockMembers(block, codecId, codec, ctx);
|
|
63
|
+
if (members === void 0) return void 0;
|
|
64
|
+
return enumType(block.name, { codecId }, ...members);
|
|
65
|
+
} }
|
|
66
|
+
} };
|
|
67
|
+
const enumTypeBlockAttribute = blockAttribute("type", {
|
|
68
|
+
documentation: "Selects the storage codec for this enum.",
|
|
69
|
+
positional: [{
|
|
70
|
+
key: "codecId",
|
|
71
|
+
type: str(),
|
|
72
|
+
documentation: "The fully qualified codec identifier used to store enum values."
|
|
73
|
+
}]
|
|
74
|
+
});
|
|
75
|
+
const mongoFamilyPslBlockDescriptors = { enum: {
|
|
76
|
+
kind: "pslBlock",
|
|
77
|
+
keyword: "enum",
|
|
78
|
+
documentation: "Defines an enum with named values and an inferred or explicitly selected storage codec.",
|
|
79
|
+
discriminator: "enum",
|
|
80
|
+
name: { required: true },
|
|
81
|
+
spec: mongoFamilyEnumSpec,
|
|
82
|
+
attributes: { type: () => enumTypeBlockAttribute }
|
|
83
|
+
} };
|
|
84
|
+
//#endregion
|
|
85
|
+
export { mongoFamilyPslBlockDescriptors as n, mongoFamilyEntityTypes as t };
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=authoring-entity-types-UA5sY_Xm-DeYf_cYq.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-entity-types-UA5sY_Xm-DeYf_cYq.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/authoring-entity-types-UA5sY_Xm.mjs"],"sourcesContent":["import \"@internal/utils/defined\";\nimport { readEnumBlockMembers, resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { enumRefusalOf } from \"@internal/framework-components/codec\";\nimport \"@internal/contract/hashing\";\nimport \"@internal/contract/types\";\nimport { enumType } from \"@internal/contract-authoring\";\nimport \"@internal/framework-components/components\";\nimport \"@internal/framework-components/control\";\nimport \"@internal/framework-components/ir\";\nimport \"@internal/mongo-contract\";\nimport \"@internal/mongo-contract/data-type\";\nimport \"@internal/utils/canonical-stringify\";\nimport \"@internal/utils/casts\";\nimport { blockAttribute, enumMemberValue, mapBlock, str } from \"@internal/psl-parser\";\n//#region src/core/authoring-entity-types.ts\nfunction mongoFamilyEnumSpec() {\n\treturn mapBlock({\n\t\tvalue: {\n\t\t\ttype: enumMemberValue(),\n\t\t\tdocumentation: \"The member's value, written as a value of the enum's data type; a bare member stores its own name.\"\n\t\t},\n\t\tallowBare: true\n\t});\n}\nconst mongoFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst descriptor = ctx.codecLookup.descriptorFor(codecId);\n\t\tif (descriptor === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst enumRefusal = enumRefusalOf(descriptor);\n\t\tif (enumRefusal !== void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" cannot use the codec \"${codecId}\". ${enumRefusal}`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst codec = ctx.codecLookup.get(codecId);\n\t\tif (codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" is registered but codecLookup.get has no codec for it`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst members = readEnumBlockMembers(block, codecId, codec, ctx);\n\t\tif (members === void 0) return void 0;\n\t\treturn enumType(block.name, { codecId }, ...members);\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst mongoFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tspec: mongoFamilyEnumSpec,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\nexport { mongoFamilyPslBlockDescriptors as n, mongoFamilyEntityTypes as t };\n\n//# sourceMappingURL=authoring-entity-types-UA5sY_Xm.mjs.map"],"mappings":";;;;;;;;;;;;;AAeA,SAAS,sBAAsB;CAC9B,OAAO,SAAS;EACf,OAAO;GACN,MAAM,gBAAgB;GACtB,eAAe;EAChB;EACA,WAAW;CACZ,CAAC;AACF;AACA,MAAM,yBAAyB,EAAE,MAAM;CACtC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,aAAa,IAAI,YAAY,cAAc,OAAO;EACxD,IAAI,eAAe,KAAK,GAAG;GAC1B,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,cAAc,cAAc,UAAU;EAC5C,IAAI,gBAAgB,KAAK,GAAG;GAC3B,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,0BAA0B,QAAQ,KAAK;IACpE;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,QAAQ,IAAI,YAAY,IAAI,OAAO;EACzC,IAAI,UAAU,KAAK,GAAG;GACrB,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,kBAAkB,QAAQ;IACvD;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,UAAU,qBAAqB,OAAO,SAAS,OAAO,GAAG;EAC/D,IAAI,YAAY,KAAK,GAAG,OAAO,KAAK;EACpC,OAAO,SAAS,MAAM,MAAM,EAAE,QAAQ,GAAG,GAAG,OAAO;CACpD,EAAE;AACH,EAAE;AACF,MAAM,yBAAyB,eAAe,QAAQ;CACrD,eAAe;CACf,YAAY,CAAC;EACZ,KAAK;EACL,MAAM,IAAI;EACV,eAAe;CAChB,CAAC;AACF,CAAC;AACD,MAAM,iCAAiC,EAAE,MAAM;CAC9C,MAAM;CACN,SAAS;CACT,eAAe;CACf,eAAe;CACf,MAAM,EAAE,UAAU,KAAK;CACvB,MAAM;CACN,YAAY,EAAE,YAAY,uBAAuB;AAClD,EAAE"}
|
package/dist/{canonicalization-hooks-DF3Z6sjO.mjs → canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPreserveEmptyPredicate } from "@prisma/orm-framework/contract/hashing-utils";
|
|
2
|
-
//#region ../../../2-mongo-family/1-foundation/mongo-contract/dist/canonicalization-hooks.mjs
|
|
2
|
+
//#region ../../../2-mongo-family/1-foundation/mongo-contract/dist/canonicalization-hooks-CRVM-Kqh.mjs
|
|
3
3
|
const matchesPreserveEmptyPattern = createPreserveEmptyPredicate([[
|
|
4
4
|
"storage",
|
|
5
5
|
"namespaces",
|
|
@@ -14,9 +14,10 @@ const matchesPreserveEmptyPattern = createPreserveEmptyPredicate([[
|
|
|
14
14
|
"collection",
|
|
15
15
|
"*"
|
|
16
16
|
]]);
|
|
17
|
-
const
|
|
17
|
+
const isUnconstrainedFieldSchema = (path) => path.includes("jsonSchema") && (path[path.length - 2] === "properties" || path[path.length - 1] === "items");
|
|
18
|
+
const shouldPreserveEmpty = (path) => path[path.length - 1] === "additionalProperties" || isUnconstrainedFieldSchema(path) || matchesPreserveEmptyPattern(path);
|
|
18
19
|
const mongoContractCanonicalizationHooks = { shouldPreserveEmpty };
|
|
19
20
|
//#endregion
|
|
20
21
|
export { mongoContractCanonicalizationHooks as t };
|
|
21
22
|
|
|
22
|
-
//# sourceMappingURL=canonicalization-hooks-
|
|
23
|
+
//# sourceMappingURL=canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs","names":[],"sources":["../../../../2-mongo-family/1-foundation/mongo-contract/dist/canonicalization-hooks-CRVM-Kqh.mjs"],"sourcesContent":["import { createPreserveEmptyPredicate } from \"@internal/contract/hashing-utils\";\n//#region src/canonicalization-hooks.ts\nconst matchesPreserveEmptyPattern = createPreserveEmptyPredicate([[\n\t\"storage\",\n\t\"namespaces\",\n\t\"*\",\n\t\"entries\",\n\t\"collection\"\n], [\n\t\"storage\",\n\t\"namespaces\",\n\t\"*\",\n\t\"entries\",\n\t\"collection\",\n\t\"*\"\n]]);\nconst isUnconstrainedFieldSchema = (path) => path.includes(\"jsonSchema\") && (path[path.length - 2] === \"properties\" || path[path.length - 1] === \"items\");\nconst shouldPreserveEmpty = (path) => path[path.length - 1] === \"additionalProperties\" || isUnconstrainedFieldSchema(path) || matchesPreserveEmptyPattern(path);\nconst mongoContractCanonicalizationHooks = { shouldPreserveEmpty };\n//#endregion\nexport { mongoContractCanonicalizationHooks as t };\n\n//# sourceMappingURL=canonicalization-hooks-CRVM-Kqh.mjs.map"],"mappings":";;AAEA,MAAM,8BAA8B,6BAA6B,CAAC;CACjE;CACA;CACA;CACA;CACA;AACD,GAAG;CACF;CACA;CACA;CACA;CACA;CACA;AACD,CAAC,CAAC;AACF,MAAM,8BAA8B,SAAS,KAAK,SAAS,YAAY,MAAM,KAAK,KAAK,SAAS,OAAO,gBAAgB,KAAK,KAAK,SAAS,OAAO;AACjJ,MAAM,uBAAuB,SAAS,KAAK,KAAK,SAAS,OAAO,0BAA0B,2BAA2B,IAAI,KAAK,4BAA4B,IAAI;AAC9J,MAAM,qCAAqC,EAAE,oBAAoB"}
|
package/dist/codec.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as mongoCodec, i as MongoCodecTrait, n as MongoCodecInput, o as newMongoCodecRegistry, r as MongoCodecRegistry, t as MongoCodec } from "./index-
|
|
1
|
+
import { a as mongoCodec, i as MongoCodecTrait, n as MongoCodecInput, o as newMongoCodecRegistry, r as MongoCodecRegistry, t as MongoCodec } from "./index-CQG5l2o9.mjs";
|
|
2
2
|
export { type MongoCodec, type MongoCodecInput, type MongoCodecRegistry, type MongoCodecTrait, mongoCodec, newMongoCodecRegistry };
|
package/dist/codec.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as newMongoCodecRegistry, t as mongoCodec } from "./dist-
|
|
1
|
+
import { n as newMongoCodecRegistry, t as mongoCodec } from "./dist-Bgk36iLI.mjs";
|
|
2
2
|
export { mongoCodec, newMongoCodecRegistry };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as contractError } from "./contract-errors-BCN6RVI5-kMurtAbI.mjs";
|
|
2
|
-
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
3
|
-
import { ok } from "@prisma/orm-framework/utils/result";
|
|
4
2
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
5
|
-
import { pathToFileURL } from "node:url";
|
|
6
3
|
import { applySpecifierDefaultControlPolicy } from "@prisma/orm-framework/contract/apply-specifier-default-control-policy";
|
|
4
|
+
import { ok } from "@prisma/orm-framework/utils/result";
|
|
5
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
6
|
+
import { pathToFileURL } from "node:url";
|
|
7
7
|
//#region ../../../2-mongo-family/2-authoring/contract-ts/dist/config-types.mjs
|
|
8
8
|
function typescriptContract(contract, output, options) {
|
|
9
9
|
return {
|
|
@@ -21,7 +21,7 @@ function typescriptContractFromPath(contractPath, output, options) {
|
|
|
21
21
|
inputs: [contractPath],
|
|
22
22
|
load: async (context) => {
|
|
23
23
|
const [absolutePath] = context.resolvedInputs;
|
|
24
|
-
if (absolutePath === void 0) throw new InternalError("typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it
|
|
24
|
+
if (absolutePath === void 0) throw new InternalError("typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.");
|
|
25
25
|
const mod = await import(pathToFileURL(absolutePath).href);
|
|
26
26
|
const contract = mod.default ?? mod.contract;
|
|
27
27
|
if (contract === void 0) throw contractError("CONTRACT.MODULE_EXPORT_MISSING", `typescriptContractFromPath: module at "${absolutePath}" has no "default" or "contract" export.`, { meta: { path: absolutePath } });
|
|
@@ -34,4 +34,4 @@ function typescriptContractFromPath(contractPath, output, options) {
|
|
|
34
34
|
//#endregion
|
|
35
35
|
export { typescriptContractFromPath as n, typescriptContract as t };
|
|
36
36
|
|
|
37
|
-
//# sourceMappingURL=config-types-
|
|
37
|
+
//# sourceMappingURL=config-types-DYTCUpAs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-types-DYTCUpAs.mjs","names":[],"sources":["../../../../2-mongo-family/2-authoring/contract-ts/dist/config-types.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { pathToFileURL } from \"node:url\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/config-types.ts\nfunction typescriptContract(contract, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tload: async () => ok(applySpecifierDefaultControlPolicy(contract, options?.defaultControlPolicy))\n\t\t},\n\t\t...ifDefined(\"output\", output)\n\t};\n}\nfunction typescriptContractFromPath(contractPath, output, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"typescript\",\n\t\t\tinputs: [contractPath],\n\t\t\tload: async (context) => {\n\t\t\t\tconst [absolutePath] = context.resolvedInputs;\n\t\t\t\tif (absolutePath === void 0) throw new InternalError(\"typescriptContractFromPath: context.resolvedInputs is empty. The CLI config loader should populate it from source.inputs.\");\n\t\t\t\tconst mod = await import(pathToFileURL(absolutePath).href);\n\t\t\t\tconst contract = mod.default ?? mod.contract;\n\t\t\t\tif (contract === void 0) throw contractError(\"CONTRACT.MODULE_EXPORT_MISSING\", `typescriptContractFromPath: module at \"${absolutePath}\" has no \"default\" or \"contract\" export.`, { meta: { path: absolutePath } });\n\t\t\t\treturn ok(applySpecifierDefaultControlPolicy(contract, options?.defaultControlPolicy));\n\t\t\t}\n\t\t},\n\t\t...ifDefined(\"output\", output)\n\t};\n}\n//#endregion\nexport { typescriptContract, typescriptContractFromPath };\n\n//# sourceMappingURL=config-types.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,mBAAmB,UAAU,QAAQ,SAAS;CACtD,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,MAAM,YAAY,GAAG,mCAAmC,UAAU,SAAS,oBAAoB,CAAC;EACjG;EACA,GAAG,UAAU,UAAU,MAAM;CAC9B;AACD;AACA,SAAS,2BAA2B,cAAc,QAAQ,SAAS;CAClE,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,YAAY;GACrB,MAAM,OAAO,YAAY;IACxB,MAAM,CAAC,gBAAgB,QAAQ;IAC/B,IAAI,iBAAiB,KAAK,GAAG,MAAM,IAAI,cAAc,2HAA2H;IAChL,MAAM,MAAM,MAAM,OAAO,cAAc,YAAY,CAAC,CAAC;IACrD,MAAM,WAAW,IAAI,WAAW,IAAI;IACpC,IAAI,aAAa,KAAK,GAAG,MAAM,cAAc,kCAAkC,0CAA0C,aAAa,2CAA2C,EAAE,MAAM,EAAE,MAAM,aAAa,EAAE,CAAC;IACjN,OAAO,GAAG,mCAAmC,UAAU,SAAS,oBAAoB,CAAC;GACtF;EACD;EACA,GAAG,UAAU,UAAU,MAAM;CAC9B;AACD"}
|