@prisma/orm-family-mongo 8.0.0-rc.18-dev.11 → 8.0.0-rc.18-dev.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/{authoring-entity-types-8yNXQKSJ-COs9oUJY.mjs → authoring-entity-types-ooM-r2td-r5JwBDd-.mjs} +11 -43
  2. package/dist/authoring-entity-types-ooM-r2td-r5JwBDd-.mjs.map +1 -0
  3. package/dist/{contract-builder-DWne7sJK.mjs → contract-builder-C_-FfTnK.mjs} +3 -3
  4. package/dist/{contract-builder-DWne7sJK.mjs.map → contract-builder-C_-FfTnK.mjs.map} +1 -1
  5. package/dist/{contract-builder-CHodgHxn.d.mts → contract-builder-CyB-7-Eq.d.mts} +2 -2
  6. package/dist/{contract-builder-CHodgHxn.d.mts.map → contract-builder-CyB-7-Eq.d.mts.map} +1 -1
  7. package/dist/contract-prisma6__provider.mjs +2 -2
  8. package/dist/contract-psl.d.mts +2 -21
  9. package/dist/contract-psl.d.mts.map +1 -1
  10. package/dist/contract-psl.mjs +2 -2
  11. package/dist/contract-psl__provider.mjs +2 -2
  12. package/dist/contract-psl__provider.mjs.map +1 -1
  13. package/dist/contract-ts.d.mts +1 -1
  14. package/dist/contract-ts.mjs +1 -1
  15. package/dist/contract-ts__contract-builder.d.mts +1 -1
  16. package/dist/contract-ts__contract-builder.mjs +1 -1
  17. package/dist/contract.d.mts +2 -2
  18. package/dist/contract.mjs +2 -2
  19. package/dist/contract__data-type.d.mts +1 -1
  20. package/dist/contract__data-type.mjs +1 -1
  21. package/dist/{control-BYbEjuQ5.d.mts → control-4JTCKNgO.d.mts} +2 -2
  22. package/dist/{control-BYbEjuQ5.d.mts.map → control-4JTCKNgO.d.mts.map} +1 -1
  23. package/dist/{control-Df3-4ayL.d.mts → control-SoPc-6DA.d.mts} +4 -4
  24. package/dist/{control-Df3-4ayL.d.mts.map → control-SoPc-6DA.d.mts.map} +1 -1
  25. package/dist/{control-BYnFmj1v.mjs → control-Yu_IYcIP.mjs} +4 -4
  26. package/dist/{control-BYnFmj1v.mjs.map → control-Yu_IYcIP.mjs.map} +1 -1
  27. package/dist/{control-adapter-Bh_ZraGM-Djo--Ygg.d.mts → control-adapter-Bh_ZraGM-D3xSqwxa.d.mts} +4 -4
  28. package/dist/{control-adapter-Bh_ZraGM-Djo--Ygg.d.mts.map → control-adapter-Bh_ZraGM-D3xSqwxa.d.mts.map} +1 -1
  29. package/dist/control-adapter-DriGOlGH.d.mts +1 -0
  30. package/dist/dist-BbfUvuqQ.mjs +629 -0
  31. package/dist/dist-BbfUvuqQ.mjs.map +1 -0
  32. package/dist/dist-xk_0xOR-.mjs.map +1 -1
  33. package/dist/family.d.mts +9 -9
  34. package/dist/family.mjs +6 -6
  35. package/dist/family__control-adapter.d.mts +2 -2
  36. package/dist/family__control.d.mts +1 -1
  37. package/dist/family__control.mjs +1 -1
  38. package/dist/family__ir.d.mts +2 -2
  39. package/dist/family__ir.mjs +2 -2
  40. package/dist/family__migration.d.mts +1 -1
  41. package/dist/family__migration.mjs +1 -1
  42. package/dist/family__pack.mjs +2 -2
  43. package/dist/family__pack.mjs.map +1 -1
  44. package/dist/family__runtime.d.mts +2 -2
  45. package/dist/family__runtime.mjs +1 -1
  46. package/dist/family__schema-verify.d.mts +1 -1
  47. package/dist/{field-accessor-CE4JbDIa-CemAdCzH.d.mts → field-accessor-CE4JbDIa-DCI8nD_s.d.mts} +2 -2
  48. package/dist/{field-accessor-CE4JbDIa-CemAdCzH.d.mts.map → field-accessor-CE4JbDIa-DCI8nD_s.d.mts.map} +1 -1
  49. package/dist/{index-D8_oAhb-.d.mts → index-B8HcPJrE.d.mts} +3 -3
  50. package/dist/{index-D8_oAhb-.d.mts.map → index-B8HcPJrE.d.mts.map} +1 -1
  51. package/dist/{index-XFSLz1g-.d.mts → index-BFhyIsHU.d.mts} +2 -2
  52. package/dist/{index-XFSLz1g-.d.mts.map → index-BFhyIsHU.d.mts.map} +1 -1
  53. package/dist/{index-mWfX7vkw.d.mts → index-CMd3fTIb.d.mts} +2 -2
  54. package/dist/{index-mWfX7vkw.d.mts.map → index-CMd3fTIb.d.mts.map} +1 -1
  55. package/dist/{index-C9aUMsc0.d.mts → index-hQxjnY-x.d.mts} +3 -3
  56. package/dist/{index-C9aUMsc0.d.mts.map → index-hQxjnY-x.d.mts.map} +1 -1
  57. package/dist/{index-Dg5hCMsu.d.mts → index-p1mHGKB5.d.mts} +57 -4
  58. package/dist/index-p1mHGKB5.d.mts.map +1 -0
  59. package/dist/{interpreter-Bhe8FSI4-uGNm4vAs.mjs → interpreter-BKBSURkK-B9QVhiLs.mjs} +23 -144
  60. package/dist/interpreter-BKBSURkK-B9QVhiLs.mjs.map +1 -0
  61. package/dist/{ir-iCpQRIJM.d.mts → ir-Cs8SNS0n.d.mts} +3 -3
  62. package/dist/{ir-iCpQRIJM.d.mts.map → ir-Cs8SNS0n.d.mts.map} +1 -1
  63. package/dist/ir-vZWjElPY.mjs.map +1 -1
  64. package/dist/lowering.d.mts +1 -1
  65. package/dist/{migration-BT1gIMTZ.mjs → migration-Bd8GWTeP.mjs} +2 -2
  66. package/dist/{migration-BT1gIMTZ.mjs.map → migration-Bd8GWTeP.mjs.map} +1 -1
  67. package/dist/{migration-BDqwISt7.d.mts → migration-DMXCxDu-.d.mts} +4 -4
  68. package/dist/{migration-BDqwISt7.d.mts.map → migration-DMXCxDu-.d.mts.map} +1 -1
  69. package/dist/{mongo-contract-serializer-DC_DM9_Y-CVJfr1pm.mjs → mongo-contract-serializer-5OphMWx2-DkWnm3kW.mjs} +3 -3
  70. package/dist/{mongo-contract-serializer-DC_DM9_Y-CVJfr1pm.mjs.map → mongo-contract-serializer-5OphMWx2-DkWnm3kW.mjs.map} +1 -1
  71. package/dist/{mongo-contract-view-AnejqfrQ-DYyueW8J.d.mts → mongo-contract-view-AnejqfrQ-CXymmojn.d.mts} +2 -2
  72. package/dist/{mongo-contract-view-AnejqfrQ-DYyueW8J.d.mts.map → mongo-contract-view-AnejqfrQ-CXymmojn.d.mts.map} +1 -1
  73. package/dist/{mongo-contract-view-JZOa0Ry--BZ2GUZQB.mjs → mongo-contract-view-OSrxTeL0-IBirxnYy.mjs} +4 -4
  74. package/dist/{mongo-contract-view-JZOa0Ry--BZ2GUZQB.mjs.map → mongo-contract-view-OSrxTeL0-IBirxnYy.mjs.map} +1 -1
  75. package/dist/{data-type-DuiFEJxB.d.mts → mongo-data-type-BMIRhoZC-COGrnC0Z.d.mts} +2 -2
  76. package/dist/mongo-data-type-BMIRhoZC-COGrnC0Z.d.mts.map +1 -0
  77. package/dist/{data-type-Cl0vtmfh.mjs → mongo-data-type-DJ7W2ota-BnUN7ydW.mjs} +2 -2
  78. package/dist/mongo-data-type-DJ7W2ota-BnUN7ydW.mjs.map +1 -0
  79. package/dist/orm.d.mts +2 -2
  80. package/dist/query-ast.d.mts +1 -1
  81. package/dist/query-ast__control.d.mts +1 -1
  82. package/dist/query-builder.d.mts +2 -2
  83. package/dist/query-builder__contract-free.d.mts +2 -2
  84. package/dist/{runtime-BIOlGVaz.d.mts → runtime-CQUQkK0P.d.mts} +2 -2
  85. package/dist/runtime-CQUQkK0P.d.mts.map +1 -0
  86. package/dist/runtime.d.mts +2 -2
  87. package/dist/schema-ir.d.mts +1 -1
  88. package/dist/{schema-verify-BP6zabY1.d.mts → schema-verify-Bzmg6whi.d.mts} +3 -3
  89. package/dist/{schema-verify-BP6zabY1.d.mts.map → schema-verify-Bzmg6whi.d.mts.map} +1 -1
  90. package/dist/wire.d.mts +1 -1
  91. package/package.json +20 -20
  92. package/dist/authoring-entity-types-8yNXQKSJ-COs9oUJY.mjs.map +0 -1
  93. package/dist/control-adapter-8uWiylj9.d.mts +0 -1
  94. package/dist/data-type-Cl0vtmfh.mjs.map +0 -1
  95. package/dist/data-type-DuiFEJxB.d.mts.map +0 -1
  96. package/dist/dist-CYYrUE3W.mjs +0 -310
  97. package/dist/dist-CYYrUE3W.mjs.map +0 -1
  98. package/dist/index-Dg5hCMsu.d.mts.map +0 -1
  99. package/dist/interpreter-Bhe8FSI4-uGNm4vAs.mjs.map +0 -1
  100. package/dist/runtime-BIOlGVaz.d.mts.map +0 -1
@@ -1,310 +0,0 @@
1
- import { t as mongoContractCanonicalizationHooks } from "./canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs";
2
- import { n as MongoCollationOptions, o as MongoIndex, p as composeMongoEntityKinds } from "./entity-kinds-RooUvcN8-B1AF_ppw.mjs";
3
- import { structuredError } from "@prisma/orm-framework/utils/structured-error";
4
- import { IRNodeBase, NamespaceBase, UNBOUND_NAMESPACE_ID, buildNamespacedEntities, buildSingleNamespaceView, freezeNode, hydrateNamespaceEntities } from "@prisma/orm-framework/components/ir";
5
- import { RelationKeys } from "@prisma/orm-framework/components/runtime";
6
- import { computeStorageHash } from "@prisma/orm-framework/contract/hashing";
7
- import { blindCast } from "@prisma/orm-framework/utils/casts";
8
- import { UNBOUND_DOMAIN_NAMESPACE_ID } from "@prisma/orm-framework/contract/default-namespace";
9
- //#region ../../../2-mongo-family/1-foundation/mongo-contract/dist/index.mjs
10
- var MongoUnboundNamespace = class MongoUnboundNamespace extends NamespaceBase {
11
- static instance = new MongoUnboundNamespace();
12
- id = UNBOUND_NAMESPACE_ID;
13
- entries = Object.freeze({ collection: Object.freeze({}) });
14
- constructor() {
15
- super();
16
- Object.defineProperty(this, "kind", {
17
- value: "mongo-namespace",
18
- writable: false,
19
- enumerable: false,
20
- configurable: true
21
- });
22
- freezeNode(this);
23
- }
24
- };
25
- const MONGO_NAMESPACE_KIND = "mongo-namespace";
26
- var MongoBoundNamespace = class MongoBoundNamespace extends NamespaceBase {
27
- id;
28
- entries;
29
- static fromCollectionsInput(input) {
30
- const collectionMap = input.entries["collection"];
31
- const collectionCount = collectionMap !== void 0 ? Object.keys(collectionMap).length : 0;
32
- const hasUnknownKinds = Object.keys(input.entries).some((kind) => kind !== "collection");
33
- if (input.id === UNBOUND_NAMESPACE_ID && collectionCount === 0 && !hasUnknownKinds) return MongoUnboundNamespace.instance;
34
- return new MongoBoundNamespace(input);
35
- }
36
- constructor(input) {
37
- super();
38
- this.id = input.id;
39
- const rawEntries = {
40
- collection: {},
41
- ...input.entries
42
- };
43
- this.entries = Object.freeze(blindCast(hydrateNamespaceEntities(rawEntries, composeMongoEntityKinds(), "carry")));
44
- Object.defineProperty(this, "kind", {
45
- value: MONGO_NAMESPACE_KIND,
46
- writable: false,
47
- enumerable: false,
48
- configurable: true
49
- });
50
- freezeNode(this);
51
- }
52
- get collection() {
53
- return this.entries.collection ?? Object.freeze({});
54
- }
55
- };
56
- function buildMongoNamespace(input) {
57
- return MongoBoundNamespace.fromCollectionsInput(input);
58
- }
59
- var MongoStorage = class extends IRNodeBase {
60
- storageHash;
61
- namespaces;
62
- constructor(input) {
63
- super();
64
- Object.defineProperty(this, "kind", {
65
- value: "mongo-storage",
66
- writable: false,
67
- enumerable: false,
68
- configurable: true
69
- });
70
- this.storageHash = input.storageHash;
71
- this.namespaces = Object.freeze(input.namespaces);
72
- freezeNode(this);
73
- }
74
- };
75
- /**
76
- * Builds a Mongo contract's storage: the unbound namespace holding the collections and value sets, and the storage hash that `db sign` and `db verify` compare. Every Mongo contract source calls this, so they hash storage the same way.
77
- */
78
- function buildMongoStorage(input) {
79
- const hasValueSets = Object.keys(input.valueSets).length > 0;
80
- const namespace = buildMongoNamespace({
81
- id: UNBOUND_NAMESPACE_ID,
82
- entries: {
83
- collection: input.collections,
84
- ...hasValueSets ? { valueSet: input.valueSets } : {}
85
- }
86
- });
87
- return new MongoStorage({
88
- storageHash: computeStorageHash({
89
- target: "mongo",
90
- targetFamily: "mongo",
91
- storage: { namespaces: { [UNBOUND_NAMESPACE_ID]: {
92
- id: UNBOUND_NAMESPACE_ID,
93
- entries: {
94
- collection: namespace.entries.collection,
95
- ...namespace.entries.valueSet !== void 0 ? { valueSet: namespace.entries.valueSet } : {}
96
- }
97
- } } },
98
- ...mongoContractCanonicalizationHooks
99
- }),
100
- namespaces: { [UNBOUND_NAMESPACE_ID]: namespace }
101
- });
102
- }
103
- const MONGO_BUILTIN_KINDS = ["collection"];
104
- /**
105
- * Builds the Mongo view: unwraps the sole namespace's built-in `collection` kind
106
- * to the root, attaches the namespace-keyed `namespace` map, and layers both
107
- * over the deserialized contract so the result is a structural superset of the
108
- * contract.
109
- */
110
- function buildMongoContractView(contract) {
111
- const rootAccessors = buildSingleNamespaceView(contract.storage, MONGO_BUILTIN_KINDS);
112
- const namespace = buildNamespacedEntities(contract.storage, MONGO_BUILTIN_KINDS);
113
- return {
114
- ...contract,
115
- ...rootAccessors,
116
- namespace
117
- };
118
- }
119
- /** Default storage namespace for Mongo-family contracts at runtime. */
120
- const defaultMongoStorageNamespaceId = UNBOUND_NAMESPACE_ID;
121
- /** Default domain namespace for Mongo-family contracts at runtime. */
122
- const defaultMongoDomainNamespaceId = UNBOUND_DOMAIN_NAMESPACE_ID;
123
- /**
124
- * Clustered-collection options (the `clusteredIndex` collection-creation
125
- * field). Lifted from a `type =` data shape to an AST class extending
126
- * `IRNodeBase` per FR18.
127
- *
128
- * MongoDB requires `key` and `unique` for any clustered collection; the
129
- * constructor enforces presence by type signature.
130
- */
131
- var MongoClusteredCollectionOptions = class extends IRNodeBase {
132
- kind = "mongo-clustered-collection-options";
133
- key;
134
- unique;
135
- constructor(options) {
136
- super();
137
- if (options.name !== void 0) this.name = options.name;
138
- this.key = options.key;
139
- this.unique = options.unique;
140
- freezeNode(this);
141
- }
142
- };
143
- /**
144
- * Mongo Contract IR node for the per-index option vocabulary (the second
145
- * argument to `db.collection.createIndex(keys, options)` minus the keys
146
- * themselves). Lifted from a `type =` data shape to an AST class
147
- * extending `IRNodeBase` per FR18.
148
- *
149
- * Nested `collation` is itself an IR class (`MongoCollationOptions`); the
150
- * constructor accepts either a class instance or a data literal and
151
- * normalises to the class form so downstream walks see a uniform IR tree.
152
- */
153
- var MongoIndexOptions = class extends IRNodeBase {
154
- kind = "mongo-index-options";
155
- constructor(options = {}) {
156
- super();
157
- if (options.unique !== void 0) this.unique = options.unique;
158
- if (options.name !== void 0) this.name = options.name;
159
- if (options.partialFilterExpression !== void 0) this.partialFilterExpression = options.partialFilterExpression;
160
- if (options.sparse !== void 0) this.sparse = options.sparse;
161
- if (options.expireAfterSeconds !== void 0) this.expireAfterSeconds = options.expireAfterSeconds;
162
- if (options.weights !== void 0) this.weights = options.weights;
163
- if (options.default_language !== void 0) this.default_language = options.default_language;
164
- if (options.language_override !== void 0) this.language_override = options.language_override;
165
- if (options.textIndexVersion !== void 0) this.textIndexVersion = options.textIndexVersion;
166
- if (options["2dsphereIndexVersion"] !== void 0) this["2dsphereIndexVersion"] = options["2dsphereIndexVersion"];
167
- if (options.bits !== void 0) this.bits = options.bits;
168
- if (options.min !== void 0) this.min = options.min;
169
- if (options.max !== void 0) this.max = options.max;
170
- if (options.bucketSize !== void 0) this.bucketSize = options.bucketSize;
171
- if (options.hidden !== void 0) this.hidden = options.hidden;
172
- if (options.collation !== void 0) this.collation = options.collation instanceof MongoCollationOptions ? options.collation : new MongoCollationOptions(options.collation);
173
- if (options.wildcardProjection !== void 0) this.wildcardProjection = options.wildcardProjection;
174
- freezeNode(this);
175
- }
176
- };
177
- /**
178
- * The storage value set of each enum: its members as the contract holds them, in the form their codec stores.
179
- */
180
- function mongoValueSetsOf(enums) {
181
- const valueSets = {};
182
- for (const [enumName, { members }] of Object.entries(enums)) valueSets[enumName] = {
183
- kind: "valueSet",
184
- values: members.map((member) => member.value)
185
- };
186
- return valueSets;
187
- }
188
- function isScalarDiscriminatorValue(value) {
189
- const t = typeof value;
190
- return t === "string" || t === "number" || t === "boolean";
191
- }
192
- function formatValue(value) {
193
- if (typeof value === "string") return JSON.stringify(value);
194
- if (value === null) return "null";
195
- if (Array.isArray(value)) return JSON.stringify(value);
196
- if (typeof value === "object") return JSON.stringify(value);
197
- return String(value);
198
- }
199
- function applyPolymorphicScopeToMongoIndex(index, scope) {
200
- if (!isScalarDiscriminatorValue(scope.discriminatorValue)) return {
201
- kind: "conflict",
202
- reason: `Variant-scoped indexes require a scalar (string, number, or boolean) discriminator value for field "${scope.discriminatorField}", but received ${formatValue(scope.discriminatorValue)}.`
203
- };
204
- const existing = index.partialFilterExpression;
205
- if (existing && Object.hasOwn(existing, scope.discriminatorField)) {
206
- const existingValue = existing[scope.discriminatorField];
207
- if (existingValue === scope.discriminatorValue) return {
208
- kind: "ok",
209
- index
210
- };
211
- return {
212
- kind: "conflict",
213
- reason: `Index partialFilterExpression sets "${scope.discriminatorField}" to ${formatValue(existingValue)}, which conflicts with the variant's discriminator value ${formatValue(scope.discriminatorValue)}.`
214
- };
215
- }
216
- const merged = {
217
- ...existing ?? {},
218
- [scope.discriminatorField]: scope.discriminatorValue
219
- };
220
- return {
221
- kind: "ok",
222
- index: new MongoIndex({
223
- keys: index.keys,
224
- ...index.unique !== void 0 && { unique: index.unique },
225
- ...index.sparse !== void 0 && { sparse: index.sparse },
226
- ...index.expireAfterSeconds !== void 0 && { expireAfterSeconds: index.expireAfterSeconds },
227
- partialFilterExpression: merged,
228
- ...index.wildcardProjection !== void 0 && { wildcardProjection: index.wildcardProjection },
229
- ...index.collation !== void 0 && { collation: index.collation },
230
- ...index.weights !== void 0 && { weights: index.weights },
231
- ...index.default_language !== void 0 && { default_language: index.default_language },
232
- ...index.language_override !== void 0 && { language_override: index.language_override }
233
- })
234
- };
235
- }
236
- const DOCUMENT_ID_FIELD = "_id";
237
- /**
238
- * The model facts behind a same-space to-one relation's nullability: which side owns the
239
- * foreign key, and whether each local field is nullable.
240
- */
241
- function resolveMongoToOneRelationFields(model, relation) {
242
- const fields = relation.on.localFields.map((name) => ({
243
- name,
244
- nullable: model.fields[name]?.nullable ?? true
245
- }));
246
- return {
247
- ownsForeignKey: !(relation.cardinality === "1:1" && fields.every((field) => field.name === DOCUMENT_ID_FIELD)),
248
- fields
249
- };
250
- }
251
- function formatCrossRef(crossRef) {
252
- return `${crossRef.namespace}.${crossRef.model}`;
253
- }
254
- function storageDeclaresCollection(storage, collectionName) {
255
- for (const ns of Object.values(storage.namespaces)) if (Object.hasOwn(ns.entries["collection"] ?? {}, collectionName)) return true;
256
- return false;
257
- }
258
- function validateMongoStorage(contract) {
259
- const errors = [];
260
- for (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) {
261
- const models = namespace.models;
262
- for (const [modelName, model] of Object.entries(models)) {
263
- const qualifiedName = `${namespaceId}:${modelName}`;
264
- if (model.storage.collection && !storageDeclaresCollection(contract.storage, model.storage.collection)) errors.push(`Model "${qualifiedName}" references collection "${model.storage.collection}" which is not declared under any namespace's collections map`);
265
- if (model.base) {
266
- const baseModel = models[model.base.model];
267
- if (baseModel) {
268
- const variantCollection = model.storage.collection;
269
- const baseCollection = baseModel.storage.collection;
270
- if (variantCollection !== baseCollection) errors.push(`Mongo does not support multi-table inheritance; variant "${qualifiedName}" must share its base's collection ("${baseCollection ?? "(none)"}"), but has "${variantCollection ?? "(none)"}"`);
271
- }
272
- }
273
- for (const [relName, relation] of Object.entries(model.relations ?? {})) {
274
- const targetModel = models[relation.to.model];
275
- const targetLabel = formatCrossRef(relation.to);
276
- if (targetModel?.owner) {
277
- if (targetModel.owner !== modelName) errors.push(`Embed relation "${relName}" targets "${targetLabel}" which is owned by "${targetModel.owner}", not "${qualifiedName}"`);
278
- if (targetModel.storage.collection) errors.push(`Embed relation "${relName}" targets "${targetLabel}" which must not have a collection`);
279
- } else if ("on" in relation && relation.on) {
280
- for (const localField of relation.on.localFields) if (!(localField in model.fields)) errors.push(`Reference relation "${relName}": localField "${localField}" is not a field on model "${qualifiedName}"`);
281
- if (targetModel) {
282
- for (const targetField of relation.on.targetFields) if (!(targetField in targetModel.fields)) errors.push(`Reference relation "${relName}": targetField "${targetField}" is not a field on model "${targetLabel}"`);
283
- }
284
- const nullabilityError = toOneRelationNullabilityError(qualifiedName, relName, relation, model);
285
- if (nullabilityError !== void 0) errors.push(nullabilityError);
286
- }
287
- }
288
- }
289
- }
290
- if (errors.length > 0) throw structuredError("CONTRACT.VALIDATION_FAILED", `Contract storage validation failed:\n- ${errors.join("\n- ")}`);
291
- }
292
- /**
293
- * A same-space to-one relation that states `nullable` must agree with its local fields: nullable
294
- * exactly when one of them is nullable (a field that is not declared counts as nullable). A
295
- * relation without the flag is left to hydration, which derives it the same way.
296
- */
297
- function toOneRelationNullabilityError(qualifiedName, relationName, relation, model) {
298
- if (!("on" in relation && (relation.cardinality === "1:1" || relation.cardinality === "N:1") && relation.to.space === void 0) || relation.nullable === void 0) return void 0;
299
- const location = `Relation "${relationName}" on model "${qualifiedName}"`;
300
- const { ownsForeignKey, fields } = resolveMongoToOneRelationFields(model, relation);
301
- if (!ownsForeignKey) return relation.nullable ? void 0 : `${location} is required but does not own the foreign key, so nothing in storage guarantees the related document exists`;
302
- const anyNullable = fields.some((field) => field.nullable);
303
- if (relation.nullable === anyNullable) return void 0;
304
- const fieldList = fields.filter((field) => field.nullable !== relation.nullable).map((field) => `"${field.name}"`).join(", ");
305
- return relation.nullable ? `${location} is nullable but every local field is required (fields ${fieldList})` : `${location} is required but a local field is nullable (fields ${fieldList})`;
306
- }
307
- //#endregion
308
- export { RelationKeys as a, buildMongoNamespace as c, defaultMongoStorageNamespaceId as d, mongoValueSetsOf as f, MongoUnboundNamespace as i, buildMongoStorage as l, validateMongoStorage as m, MongoIndexOptions as n, applyPolymorphicScopeToMongoIndex as o, resolveMongoToOneRelationFields as p, MongoStorage as r, buildMongoContractView as s, MongoClusteredCollectionOptions as t, defaultMongoDomainNamespaceId as u };
309
-
310
- //# sourceMappingURL=dist-CYYrUE3W.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dist-CYYrUE3W.mjs","names":[],"sources":["../../../../2-mongo-family/1-foundation/mongo-contract/dist/index.mjs"],"sourcesContent":["import { t as mongoContractCanonicalizationHooks } from \"./canonicalization-hooks-CRVM-Kqh.mjs\";\nimport { a as MongoCollection, c as MongoCollectionOptions, d as MongoCollationOptions, f as MongoChangeStreamPreAndPostImagesOptions, g as createMongoNamespaceEnvelopeSchema, h as createMongoContractSchema, i as MongoValueSet, l as MongoTimeSeriesCollectionOptions, m as StorageValueSetSchema, n as composeMongoEntityKinds, o as MongoValidator, p as MongoContractSchema, s as MongoIndex, u as MongoIndexOptionDefaults } from \"./entity-kinds-RooUvcN8.mjs\";\nimport { RelationKeys } from \"@internal/framework-components/runtime\";\nimport { computeStorageHash } from \"@internal/contract/hashing\";\nimport { IRNodeBase, NamespaceBase, UNBOUND_NAMESPACE_ID, buildNamespacedEntities, buildSingleNamespaceView, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { UNBOUND_DOMAIN_NAMESPACE_ID } from \"@internal/contract/default-namespace\";\n//#region src/ir/mongo-unbound-namespace.ts\nvar MongoUnboundNamespace = class MongoUnboundNamespace extends NamespaceBase {\n\tstatic instance = new MongoUnboundNamespace();\n\tid = UNBOUND_NAMESPACE_ID;\n\tentries = Object.freeze({ collection: Object.freeze({}) });\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"mongo-namespace\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/build-mongo-namespace.ts\nconst MONGO_NAMESPACE_KIND = \"mongo-namespace\";\nvar MongoBoundNamespace = class MongoBoundNamespace extends NamespaceBase {\n\tid;\n\tentries;\n\tstatic fromCollectionsInput(input) {\n\t\tconst collectionMap = input.entries[\"collection\"];\n\t\tconst collectionCount = collectionMap !== void 0 ? Object.keys(collectionMap).length : 0;\n\t\tconst hasUnknownKinds = Object.keys(input.entries).some((kind) => kind !== \"collection\");\n\t\tif (input.id === UNBOUND_NAMESPACE_ID && collectionCount === 0 && !hasUnknownKinds) return MongoUnboundNamespace.instance;\n\t\treturn new MongoBoundNamespace(input);\n\t}\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst rawEntries = {\n\t\t\tcollection: {},\n\t\t\t...input.entries\n\t\t};\n\t\tthis.entries = Object.freeze(blindCast(hydrateNamespaceEntities(rawEntries, composeMongoEntityKinds(), \"carry\")));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: MONGO_NAMESPACE_KIND,\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget collection() {\n\t\treturn this.entries.collection ?? Object.freeze({});\n\t}\n};\nfunction buildMongoNamespace(input) {\n\treturn MongoBoundNamespace.fromCollectionsInput(input);\n}\n//#endregion\n//#region src/ir/mongo-storage.ts\nvar MongoStorage = class extends IRNodeBase {\n\tstorageHash;\n\tnamespaces;\n\tconstructor(input) {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"mongo-storage\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tthis.storageHash = input.storageHash;\n\t\tthis.namespaces = Object.freeze(input.namespaces);\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/build-mongo-storage.ts\n/**\n* Builds a Mongo contract's storage: the unbound namespace holding the collections and value sets, and the storage hash that `db sign` and `db verify` compare. Every Mongo contract source calls this, so they hash storage the same way.\n*/\nfunction buildMongoStorage(input) {\n\tconst hasValueSets = Object.keys(input.valueSets).length > 0;\n\tconst namespace = buildMongoNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: {\n\t\t\tcollection: input.collections,\n\t\t\t...hasValueSets ? { valueSet: input.valueSets } : {}\n\t\t}\n\t});\n\treturn new MongoStorage({\n\t\tstorageHash: computeStorageHash({\n\t\t\ttarget: \"mongo\",\n\t\t\ttargetFamily: \"mongo\",\n\t\t\tstorage: { namespaces: { [UNBOUND_NAMESPACE_ID]: {\n\t\t\t\tid: UNBOUND_NAMESPACE_ID,\n\t\t\t\tentries: {\n\t\t\t\t\tcollection: namespace.entries.collection,\n\t\t\t\t\t...namespace.entries.valueSet !== void 0 ? { valueSet: namespace.entries.valueSet } : {}\n\t\t\t\t}\n\t\t\t} } },\n\t\t\t...mongoContractCanonicalizationHooks\n\t\t}),\n\t\tnamespaces: { [UNBOUND_NAMESPACE_ID]: namespace }\n\t});\n}\n//#endregion\n//#region src/contract-view.ts\nconst MONGO_BUILTIN_KINDS = [\"collection\"];\n/**\n* Builds the Mongo view: unwraps the sole namespace's built-in `collection` kind\n* to the root, attaches the namespace-keyed `namespace` map, and layers both\n* over the deserialized contract so the result is a structural superset of the\n* contract.\n*/\nfunction buildMongoContractView(contract) {\n\tconst rootAccessors = buildSingleNamespaceView(contract.storage, MONGO_BUILTIN_KINDS);\n\tconst namespace = buildNamespacedEntities(contract.storage, MONGO_BUILTIN_KINDS);\n\treturn {\n\t\t...contract,\n\t\t...rootAccessors,\n\t\tnamespace\n\t};\n}\n//#endregion\n//#region src/default-namespace.ts\n/** Default storage namespace for Mongo-family contracts at runtime. */\nconst defaultMongoStorageNamespaceId = UNBOUND_NAMESPACE_ID;\n/** Default domain namespace for Mongo-family contracts at runtime. */\nconst defaultMongoDomainNamespaceId = UNBOUND_DOMAIN_NAMESPACE_ID;\n//#endregion\n//#region src/ir/mongo-clustered-collection-options.ts\n/**\n* Clustered-collection options (the `clusteredIndex` collection-creation\n* field). Lifted from a `type =` data shape to an AST class extending\n* `IRNodeBase` per FR18.\n*\n* MongoDB requires `key` and `unique` for any clustered collection; the\n* constructor enforces presence by type signature.\n*/\nvar MongoClusteredCollectionOptions = class extends IRNodeBase {\n\tkind = \"mongo-clustered-collection-options\";\n\tkey;\n\tunique;\n\tconstructor(options) {\n\t\tsuper();\n\t\tif (options.name !== void 0) this.name = options.name;\n\t\tthis.key = options.key;\n\t\tthis.unique = options.unique;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/ir/mongo-index-options.ts\n/**\n* Mongo Contract IR node for the per-index option vocabulary (the second\n* argument to `db.collection.createIndex(keys, options)` minus the keys\n* themselves). Lifted from a `type =` data shape to an AST class\n* extending `IRNodeBase` per FR18.\n*\n* Nested `collation` is itself an IR class (`MongoCollationOptions`); the\n* constructor accepts either a class instance or a data literal and\n* normalises to the class form so downstream walks see a uniform IR tree.\n*/\nvar MongoIndexOptions = class extends IRNodeBase {\n\tkind = \"mongo-index-options\";\n\tconstructor(options = {}) {\n\t\tsuper();\n\t\tif (options.unique !== void 0) this.unique = options.unique;\n\t\tif (options.name !== void 0) this.name = options.name;\n\t\tif (options.partialFilterExpression !== void 0) this.partialFilterExpression = options.partialFilterExpression;\n\t\tif (options.sparse !== void 0) this.sparse = options.sparse;\n\t\tif (options.expireAfterSeconds !== void 0) this.expireAfterSeconds = options.expireAfterSeconds;\n\t\tif (options.weights !== void 0) this.weights = options.weights;\n\t\tif (options.default_language !== void 0) this.default_language = options.default_language;\n\t\tif (options.language_override !== void 0) this.language_override = options.language_override;\n\t\tif (options.textIndexVersion !== void 0) this.textIndexVersion = options.textIndexVersion;\n\t\tif (options[\"2dsphereIndexVersion\"] !== void 0) this[\"2dsphereIndexVersion\"] = options[\"2dsphereIndexVersion\"];\n\t\tif (options.bits !== void 0) this.bits = options.bits;\n\t\tif (options.min !== void 0) this.min = options.min;\n\t\tif (options.max !== void 0) this.max = options.max;\n\t\tif (options.bucketSize !== void 0) this.bucketSize = options.bucketSize;\n\t\tif (options.hidden !== void 0) this.hidden = options.hidden;\n\t\tif (options.collation !== void 0) this.collation = options.collation instanceof MongoCollationOptions ? options.collation : new MongoCollationOptions(options.collation);\n\t\tif (options.wildcardProjection !== void 0) this.wildcardProjection = options.wildcardProjection;\n\t\tfreezeNode(this);\n\t}\n};\n//#endregion\n//#region src/mongo-enum.ts\n/**\n* The storage value set of each enum: its members as the contract holds them, in the form their codec stores.\n*/\nfunction mongoValueSetsOf(enums) {\n\tconst valueSets = {};\n\tfor (const [enumName, { members }] of Object.entries(enums)) valueSets[enumName] = {\n\t\tkind: \"valueSet\",\n\t\tvalues: members.map((member) => member.value)\n\t};\n\treturn valueSets;\n}\n//#endregion\n//#region src/polymorphic-index-scope.ts\nfunction isScalarDiscriminatorValue(value) {\n\tconst t = typeof value;\n\treturn t === \"string\" || t === \"number\" || t === \"boolean\";\n}\nfunction formatValue(value) {\n\tif (typeof value === \"string\") return JSON.stringify(value);\n\tif (value === null) return \"null\";\n\tif (Array.isArray(value)) return JSON.stringify(value);\n\tif (typeof value === \"object\") return JSON.stringify(value);\n\treturn String(value);\n}\nfunction applyPolymorphicScopeToMongoIndex(index, scope) {\n\tif (!isScalarDiscriminatorValue(scope.discriminatorValue)) return {\n\t\tkind: \"conflict\",\n\t\treason: `Variant-scoped indexes require a scalar (string, number, or boolean) discriminator value for field \"${scope.discriminatorField}\", but received ${formatValue(scope.discriminatorValue)}.`\n\t};\n\tconst existing = index.partialFilterExpression;\n\tif (existing && Object.hasOwn(existing, scope.discriminatorField)) {\n\t\tconst existingValue = existing[scope.discriminatorField];\n\t\tif (existingValue === scope.discriminatorValue) return {\n\t\t\tkind: \"ok\",\n\t\t\tindex\n\t\t};\n\t\treturn {\n\t\t\tkind: \"conflict\",\n\t\t\treason: `Index partialFilterExpression sets \"${scope.discriminatorField}\" to ${formatValue(existingValue)}, which conflicts with the variant's discriminator value ${formatValue(scope.discriminatorValue)}.`\n\t\t};\n\t}\n\tconst merged = {\n\t\t...existing ?? {},\n\t\t[scope.discriminatorField]: scope.discriminatorValue\n\t};\n\treturn {\n\t\tkind: \"ok\",\n\t\tindex: new MongoIndex({\n\t\t\tkeys: index.keys,\n\t\t\t...index.unique !== void 0 && { unique: index.unique },\n\t\t\t...index.sparse !== void 0 && { sparse: index.sparse },\n\t\t\t...index.expireAfterSeconds !== void 0 && { expireAfterSeconds: index.expireAfterSeconds },\n\t\t\tpartialFilterExpression: merged,\n\t\t\t...index.wildcardProjection !== void 0 && { wildcardProjection: index.wildcardProjection },\n\t\t\t...index.collation !== void 0 && { collation: index.collation },\n\t\t\t...index.weights !== void 0 && { weights: index.weights },\n\t\t\t...index.default_language !== void 0 && { default_language: index.default_language },\n\t\t\t...index.language_override !== void 0 && { language_override: index.language_override }\n\t\t})\n\t};\n}\n//#endregion\n//#region src/relation-fields.ts\nconst DOCUMENT_ID_FIELD = \"_id\";\n/**\n* The model facts behind a same-space to-one relation's nullability: which side owns the\n* foreign key, and whether each local field is nullable.\n*/\nfunction resolveMongoToOneRelationFields(model, relation) {\n\tconst fields = relation.on.localFields.map((name) => ({\n\t\tname,\n\t\tnullable: model.fields[name]?.nullable ?? true\n\t}));\n\treturn {\n\t\townsForeignKey: !(relation.cardinality === \"1:1\" && fields.every((field) => field.name === DOCUMENT_ID_FIELD)),\n\t\tfields\n\t};\n}\n//#endregion\n//#region src/validate-storage.ts\nfunction formatCrossRef(crossRef) {\n\treturn `${crossRef.namespace}.${crossRef.model}`;\n}\nfunction storageDeclaresCollection(storage, collectionName) {\n\tfor (const ns of Object.values(storage.namespaces)) if (Object.hasOwn(ns.entries[\"collection\"] ?? {}, collectionName)) return true;\n\treturn false;\n}\nfunction validateMongoStorage(contract) {\n\tconst errors = [];\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst models = namespace.models;\n\t\tfor (const [modelName, model] of Object.entries(models)) {\n\t\t\tconst qualifiedName = `${namespaceId}:${modelName}`;\n\t\t\tif (model.storage.collection && !storageDeclaresCollection(contract.storage, model.storage.collection)) errors.push(`Model \"${qualifiedName}\" references collection \"${model.storage.collection}\" which is not declared under any namespace's collections map`);\n\t\t\tif (model.base) {\n\t\t\t\tconst baseModel = models[model.base.model];\n\t\t\t\tif (baseModel) {\n\t\t\t\t\tconst variantCollection = model.storage.collection;\n\t\t\t\t\tconst baseCollection = baseModel.storage.collection;\n\t\t\t\t\tif (variantCollection !== baseCollection) errors.push(`Mongo does not support multi-table inheritance; variant \"${qualifiedName}\" must share its base's collection (\"${baseCollection ?? \"(none)\"}\"), but has \"${variantCollection ?? \"(none)\"}\"`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\t\t\tconst targetModel = models[relation.to.model];\n\t\t\t\tconst targetLabel = formatCrossRef(relation.to);\n\t\t\t\tif (targetModel?.owner) {\n\t\t\t\t\tif (targetModel.owner !== modelName) errors.push(`Embed relation \"${relName}\" targets \"${targetLabel}\" which is owned by \"${targetModel.owner}\", not \"${qualifiedName}\"`);\n\t\t\t\t\tif (targetModel.storage.collection) errors.push(`Embed relation \"${relName}\" targets \"${targetLabel}\" which must not have a collection`);\n\t\t\t\t} else if (\"on\" in relation && relation.on) {\n\t\t\t\t\tfor (const localField of relation.on.localFields) if (!(localField in model.fields)) errors.push(`Reference relation \"${relName}\": localField \"${localField}\" is not a field on model \"${qualifiedName}\"`);\n\t\t\t\t\tif (targetModel) {\n\t\t\t\t\t\tfor (const targetField of relation.on.targetFields) if (!(targetField in targetModel.fields)) errors.push(`Reference relation \"${relName}\": targetField \"${targetField}\" is not a field on model \"${targetLabel}\"`);\n\t\t\t\t\t}\n\t\t\t\t\tconst nullabilityError = toOneRelationNullabilityError(qualifiedName, relName, relation, model);\n\t\t\t\t\tif (nullabilityError !== void 0) errors.push(nullabilityError);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (errors.length > 0) throw structuredError(\"CONTRACT.VALIDATION_FAILED\", `Contract storage validation failed:\\n- ${errors.join(\"\\n- \")}`);\n}\n/**\n* A same-space to-one relation that states `nullable` must agree with its local fields: nullable\n* exactly when one of them is nullable (a field that is not declared counts as nullable). A\n* relation without the flag is left to hydration, which derives it the same way.\n*/\nfunction toOneRelationNullabilityError(qualifiedName, relationName, relation, model) {\n\tif (!(\"on\" in relation && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\") && relation.to.space === void 0) || relation.nullable === void 0) return void 0;\n\tconst location = `Relation \"${relationName}\" on model \"${qualifiedName}\"`;\n\tconst { ownsForeignKey, fields } = resolveMongoToOneRelationFields(model, relation);\n\tif (!ownsForeignKey) return relation.nullable ? void 0 : `${location} is required but does not own the foreign key, so nothing in storage guarantees the related document exists`;\n\tconst anyNullable = fields.some((field) => field.nullable);\n\tif (relation.nullable === anyNullable) return void 0;\n\tconst fieldList = fields.filter((field) => field.nullable !== relation.nullable).map((field) => `\"${field.name}\"`).join(\", \");\n\treturn relation.nullable ? `${location} is nullable but every local field is required (fields ${fieldList})` : `${location} is required but a local field is nullable (fields ${fieldList})`;\n}\n//#endregion\nexport { MongoChangeStreamPreAndPostImagesOptions, MongoClusteredCollectionOptions, MongoCollationOptions, MongoCollection, MongoCollectionOptions, MongoContractSchema, MongoIndex, MongoIndexOptionDefaults, MongoIndexOptions, MongoStorage, MongoTimeSeriesCollectionOptions, MongoUnboundNamespace, MongoValidator, MongoValueSet, RelationKeys, StorageValueSetSchema, applyPolymorphicScopeToMongoIndex, buildMongoContractView, buildMongoNamespace, buildMongoStorage, createMongoContractSchema, createMongoNamespaceEnvelopeSchema, defaultMongoDomainNamespaceId, defaultMongoStorageNamespaceId, mongoValueSetsOf, resolveMongoToOneRelationFields, validateMongoStorage };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;AASA,IAAI,wBAAwB,MAAM,8BAA8B,cAAc;CAC7E,OAAO,WAAW,IAAI,sBAAsB;CAC5C,KAAK;CACL,UAAU,OAAO,OAAO,EAAE,YAAY,OAAO,OAAO,CAAC,CAAC,EAAE,CAAC;CACzD,cAAc;EACb,MAAM;EACN,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EACf,CAAC;EACD,WAAW,IAAI;CAChB;AACD;AAGA,MAAM,uBAAuB;AAC7B,IAAI,sBAAsB,MAAM,4BAA4B,cAAc;CACzE;CACA;CACA,OAAO,qBAAqB,OAAO;EAClC,MAAM,gBAAgB,MAAM,QAAQ;EACpC,M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