@prisma/orm-family-mongo 0.16.0-dev.36

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 (166) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +27 -0
  3. package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs +176 -0
  4. package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs.map +1 -0
  5. package/dist/canonicalization-hooks-DF3Z6sjO.mjs +22 -0
  6. package/dist/canonicalization-hooks-DF3Z6sjO.mjs.map +1 -0
  7. package/dist/codec.d.mts +2 -0
  8. package/dist/codec.mjs +2 -0
  9. package/dist/config-types-CFDf9ivE.mjs +37 -0
  10. package/dist/config-types-CFDf9ivE.mjs.map +1 -0
  11. package/dist/config-types-CQOf5N7R.d.mts +12 -0
  12. package/dist/config-types-CQOf5N7R.d.mts.map +1 -0
  13. package/dist/contract-builder-BFq0gOMV.mjs +634 -0
  14. package/dist/contract-builder-BFq0gOMV.mjs.map +1 -0
  15. package/dist/contract-builder-DB8nguDE.d.mts +445 -0
  16. package/dist/contract-builder-DB8nguDE.d.mts.map +1 -0
  17. package/dist/contract-errors-BCN6RVI5-kMurtAbI.mjs +9 -0
  18. package/dist/contract-errors-BCN6RVI5-kMurtAbI.mjs.map +1 -0
  19. package/dist/contract-psl.d.mts +45 -0
  20. package/dist/contract-psl.d.mts.map +1 -0
  21. package/dist/contract-psl.mjs +2 -0
  22. package/dist/contract-psl__provider.d.mts +15 -0
  23. package/dist/contract-psl__provider.d.mts.map +1 -0
  24. package/dist/contract-psl__provider.mjs +82 -0
  25. package/dist/contract-psl__provider.mjs.map +1 -0
  26. package/dist/contract-ts.d.mts +3 -0
  27. package/dist/contract-ts.mjs +3 -0
  28. package/dist/contract-ts__config-types.d.mts +2 -0
  29. package/dist/contract-ts__config-types.mjs +2 -0
  30. package/dist/contract-ts__contract-builder.d.mts +2 -0
  31. package/dist/contract-ts__contract-builder.mjs +2 -0
  32. package/dist/contract.d.mts +3 -0
  33. package/dist/contract.mjs +3 -0
  34. package/dist/contract__canonicalization-hooks.d.mts +9 -0
  35. package/dist/contract__canonicalization-hooks.d.mts.map +1 -0
  36. package/dist/contract__canonicalization-hooks.mjs +2 -0
  37. package/dist/contract__entity-kinds.d.mts +17 -0
  38. package/dist/contract__entity-kinds.d.mts.map +1 -0
  39. package/dist/contract__entity-kinds.mjs +2 -0
  40. package/dist/control-C7-kthr1.d.mts +193 -0
  41. package/dist/control-C7-kthr1.d.mts.map +1 -0
  42. package/dist/control-CClR5JMr.mjs +127 -0
  43. package/dist/control-CClR5JMr.mjs.map +1 -0
  44. package/dist/control-CFr3tYsg.mjs +398 -0
  45. package/dist/control-CFr3tYsg.mjs.map +1 -0
  46. package/dist/control-Cj81sPbj.d.mts +101 -0
  47. package/dist/control-Cj81sPbj.d.mts.map +1 -0
  48. package/dist/control-adapter-Db5pT77b.d.mts +83 -0
  49. package/dist/control-adapter-Db5pT77b.d.mts.map +1 -0
  50. package/dist/dist-C7Ykq48Q.mjs +19 -0
  51. package/dist/dist-C7Ykq48Q.mjs.map +1 -0
  52. package/dist/dist-Czwqx_i3.mjs +58 -0
  53. package/dist/dist-Czwqx_i3.mjs.map +1 -0
  54. package/dist/dist-DHrEJnhK.mjs +236 -0
  55. package/dist/dist-DHrEJnhK.mjs.map +1 -0
  56. package/dist/dist-Dyp05u64.mjs +1546 -0
  57. package/dist/dist-Dyp05u64.mjs.map +1 -0
  58. package/dist/emitter.d.mts +22 -0
  59. package/dist/emitter.d.mts.map +1 -0
  60. package/dist/emitter.mjs +2 -0
  61. package/dist/entity-kinds-B4KNTF8z-DPIuUuuB.mjs +603 -0
  62. package/dist/entity-kinds-B4KNTF8z-DPIuUuuB.mjs.map +1 -0
  63. package/dist/execution-CKnUiOfm.d.mts +48 -0
  64. package/dist/execution-CKnUiOfm.d.mts.map +1 -0
  65. package/dist/execution-D5XyZ5XS.mjs +1269 -0
  66. package/dist/execution-D5XyZ5XS.mjs.map +1 -0
  67. package/dist/exports-Bx-hlnZ3.mjs +209 -0
  68. package/dist/exports-Bx-hlnZ3.mjs.map +1 -0
  69. package/dist/exports-CJMh0VTU.mjs +156 -0
  70. package/dist/exports-CJMh0VTU.mjs.map +1 -0
  71. package/dist/family.d.mts +10 -0
  72. package/dist/family.mjs +9 -0
  73. package/dist/family__control-adapter.d.mts +2 -0
  74. package/dist/family__control-adapter.mjs +1 -0
  75. package/dist/family__control.d.mts +2 -0
  76. package/dist/family__control.mjs +3 -0
  77. package/dist/family__ir.d.mts +3 -0
  78. package/dist/family__ir.mjs +4 -0
  79. package/dist/family__migration.d.mts +2 -0
  80. package/dist/family__migration.mjs +2 -0
  81. package/dist/family__pack.d.mts +2 -0
  82. package/dist/family__pack.mjs +16 -0
  83. package/dist/family__pack.mjs.map +1 -0
  84. package/dist/family__runtime.d.mts +3 -0
  85. package/dist/family__runtime.mjs +2 -0
  86. package/dist/family__schema-verify.d.mts +2 -0
  87. package/dist/family__schema-verify.mjs +2 -0
  88. package/dist/field-accessor-0oUt6RZC-B_Z30uAA.mjs +234 -0
  89. package/dist/field-accessor-0oUt6RZC-B_Z30uAA.mjs.map +1 -0
  90. package/dist/field-accessor-DHsAPiW3-BdYCspQC.d.mts +588 -0
  91. package/dist/field-accessor-DHsAPiW3-BdYCspQC.d.mts.map +1 -0
  92. package/dist/filter-expressions-Uo8ZdzwB-53qnqceS.mjs +181 -0
  93. package/dist/filter-expressions-Uo8ZdzwB-53qnqceS.mjs.map +1 -0
  94. package/dist/index-BR0ue13b.d.mts +136 -0
  95. package/dist/index-BR0ue13b.d.mts.map +1 -0
  96. package/dist/index-Cd2zLiU6.d.mts +128 -0
  97. package/dist/index-Cd2zLiU6.d.mts.map +1 -0
  98. package/dist/index-DAOkcTCK.d.mts +151 -0
  99. package/dist/index-DAOkcTCK.d.mts.map +1 -0
  100. package/dist/index-Dv2PNMiG.d.mts +53 -0
  101. package/dist/index-Dv2PNMiG.d.mts.map +1 -0
  102. package/dist/index-DxoO-ywI.d.mts +178 -0
  103. package/dist/index-DxoO-ywI.d.mts.map +1 -0
  104. package/dist/index-wKMm41HC.d.mts +30 -0
  105. package/dist/index-wKMm41HC.d.mts.map +1 -0
  106. package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs +1091 -0
  107. package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs.map +1 -0
  108. package/dist/ir-CQrenTYt.d.mts +147 -0
  109. package/dist/ir-CQrenTYt.d.mts.map +1 -0
  110. package/dist/ir-Ch2aPr7a.mjs +62 -0
  111. package/dist/ir-Ch2aPr7a.mjs.map +1 -0
  112. package/dist/lowering.d.mts +2 -0
  113. package/dist/lowering.mjs +1 -0
  114. package/dist/migration-CNDQv5yB.d.mts +50 -0
  115. package/dist/migration-CNDQv5yB.d.mts.map +1 -0
  116. package/dist/migration-dcM7u4HG.mjs +52 -0
  117. package/dist/migration-dcM7u4HG.mjs.map +1 -0
  118. package/dist/mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs +119 -0
  119. package/dist/mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs.map +1 -0
  120. package/dist/mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts +27 -0
  121. package/dist/mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts.map +1 -0
  122. package/dist/mongo-contract-view-rcWzby6f-wRBCUnBt.mjs +17 -0
  123. package/dist/mongo-contract-view-rcWzby6f-wRBCUnBt.mjs.map +1 -0
  124. package/dist/mongo-value-set-tNn9-pun-dJYx_rVD.d.mts +536 -0
  125. package/dist/mongo-value-set-tNn9-pun-dJYx_rVD.d.mts.map +1 -0
  126. package/dist/mongodb-types-B4HmhF1S.d.mts +2 -0
  127. package/dist/orm.d.mts +311 -0
  128. package/dist/orm.d.mts.map +1 -0
  129. package/dist/orm.mjs +664 -0
  130. package/dist/orm.mjs.map +1 -0
  131. package/dist/pack-D9aLY50F.d.mts +44 -0
  132. package/dist/pack-D9aLY50F.d.mts.map +1 -0
  133. package/dist/query-ast.d.mts +5 -0
  134. package/dist/query-ast.mjs +4 -0
  135. package/dist/query-ast__control.d.mts +4 -0
  136. package/dist/query-ast__control.mjs +3 -0
  137. package/dist/query-ast__execution.d.mts +3 -0
  138. package/dist/query-ast__execution.mjs +3 -0
  139. package/dist/query-builder.d.mts +836 -0
  140. package/dist/query-builder.d.mts.map +1 -0
  141. package/dist/query-builder.mjs +3 -0
  142. package/dist/query-builder__contract-free.d.mts +83 -0
  143. package/dist/query-builder__contract-free.d.mts.map +1 -0
  144. package/dist/query-builder__contract-free.mjs +107 -0
  145. package/dist/query-builder__contract-free.mjs.map +1 -0
  146. package/dist/query-plan-C0-Yu8hf-DdilEdW6.d.mts +822 -0
  147. package/dist/query-plan-C0-Yu8hf-DdilEdW6.d.mts.map +1 -0
  148. package/dist/runtime-DPkRW4iu.d.mts +1 -0
  149. package/dist/runtime.d.mts +286 -0
  150. package/dist/runtime.d.mts.map +1 -0
  151. package/dist/runtime.mjs +532 -0
  152. package/dist/runtime.mjs.map +1 -0
  153. package/dist/schema-ir.d.mts +2 -0
  154. package/dist/schema-ir.mjs +2 -0
  155. package/dist/schema-verify-DJGr28XW.d.mts +23 -0
  156. package/dist/schema-verify-DJGr28XW.d.mts.map +1 -0
  157. package/dist/value.d.mts +2 -0
  158. package/dist/value.mjs +2 -0
  159. package/dist/value__mongodb-types.d.mts +2 -0
  160. package/dist/value__mongodb-types.mjs +1 -0
  161. package/dist/verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs +447 -0
  162. package/dist/verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs.map +1 -0
  163. package/dist/wire.d.mts +3 -0
  164. package/dist/wire.mjs +190 -0
  165. package/dist/wire.mjs.map +1 -0
  166. package/package.json +89 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-serializer-Cx7Fae8e.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { MongoContractSchema, createMongoContractSchema, validateMongoStorage } from \"@internal/mongo-contract\";\nimport { mongoContractCanonicalizationHooks } from \"@internal/mongo-contract/canonicalization-hooks\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { composeMongoEntityKinds } from \"@internal/mongo-contract/entity-kinds\";\nimport { type } from \"arktype\";\n//#region src/core/ir/mongo-contract-serializer-base.ts\n/**\n* Mongo family `ContractSerializer` abstract base. Owns the family-shared\n* deserialization pipeline:\n*\n* 1. Structural validation against the Mongo contract arktype schema\n* (`MongoContractSchema`).\n* 2. Framework-shared domain validation (`validateContractDomain`).\n* 3. Family-shared storage validation (`validateMongoStorage`).\n*\n* The validated value is handed to the target via the\n* `constructTargetContract` hook, which wraps the plain-JSON shape in\n* the family-layer `MongoStorage` class instance (carrying the\n* target-supplied `namespaces` map). Targets that need to add\n* structural checks beyond the family default can override\n* `parseMongoContractStructure`.\n*\n* Default `serializeContract` is identity over the contract — Mongo\n* target classes carry JSON-clean fields by construction, so the value\n* can be `JSON.stringify`'d directly. Targets that need on-the-way-out\n* canonicalization override `serializeContract`.\n*/\nvar MongoContractSerializerBase = class {\n\tcontractSchema;\n\tentryKinds;\n\tconstructor(validatorFragments, packEntityKinds = []) {\n\t\tthis.entryKinds = composeMongoEntityKinds(packEntityKinds);\n\t\tthis.contractSchema = validatorFragments !== void 0 && validatorFragments.size > 0 ? createMongoContractSchema(validatorFragments) : void 0;\n\t}\n\tdeserializeContract(json) {\n\t\tconst validated = this.parseMongoContractStructure(json);\n\t\treturn this.constructTargetContract(validated);\n\t}\n\tserializeContract(contract) {\n\t\treturn contract;\n\t}\n\t/**\n\t* Preserve empty `collections` maps and per-collection payloads. Mongo\n\t* collections legitimately serialize empty (a declared collection with no\n\t* schema is valid); SQL tables never do — that asymmetry lives here rather\n\t* than in the family-agnostic canonicalizer.\n\t*/\n\tshouldPreserveEmpty = mongoContractCanonicalizationHooks.shouldPreserveEmpty;\n\t/**\n\t* Family-shared structural validation: parse against the Mongo\n\t* contract arktype schema, then run framework-shared domain + Mongo\n\t* family storage checks, then hydrate the validated tree into Mongo\n\t* Contract IR class instances. Targets can override to add\n\t* target-specific structural checks; most targets accept the family\n\t* default.\n\t*\n\t* The returned `MongoContract` carries class instances under\n\t* `storage.namespaces[namespaceId].entries.collection[collectionName]` (each value is a\n\t* `MongoCollection`, with nested `MongoIndex` / `MongoValidator` /\n\t* `MongoCollectionOptions` constructed by the `MongoCollection` constructor).\n\t* The rest of the contract envelope (models, valueObjects, capabilities, …)\n\t* remains in plain-JSON form; those IR layers are handled by sibling\n\t* subsystems and don't sit behind this SPI.\n\t*/\n\tparseMongoContractStructure(json) {\n\t\tconst parsed = (this.contractSchema ?? MongoContractSchema)(json);\n\t\tif (parsed instanceof type.errors) throw structuredError(\"CONTRACT.VALIDATION_FAILED\", `Contract structural validation failed: ${parsed.summary}`);\n\t\tconst validatedShape = parsed;\n\t\tconst hydratedContract = this.hydrateMongoContract(validatedShape);\n\t\tvalidateContractDomain(hydratedContract);\n\t\tvalidateMongoStorage(hydratedContract);\n\t\treturn hydratedContract;\n\t}\n\t/**\n\t* Walk a structurally-validated Mongo contract and hydrate each namespace's\n\t* entries via the registered entity-kind descriptors. Unknown kinds throw (fail-closed),\n\t* preserving the existing Mongo serializer semantics.\n\t*/\n\thydrateMongoContract(contract) {\n\t\tconst rawNamespaces = contract.storage.namespaces;\n\t\tconst hydratedNamespaces = Object.fromEntries(Object.entries(rawNamespaces).map(([nsId, nsEnvelope]) => {\n\t\t\tconst hydratedEntries = hydrateNamespaceEntities(blindCast(nsEnvelope.entries), this.entryKinds, \"fail\", nsId);\n\t\t\treturn [nsId, {\n\t\t\t\t...nsEnvelope,\n\t\t\t\tid: nsEnvelope.id,\n\t\t\t\tentries: blindCast(hydratedEntries)\n\t\t\t}];\n\t\t}));\n\t\treturn {\n\t\t\t...contract,\n\t\t\tstorage: {\n\t\t\t\t...contract.storage,\n\t\t\t\tnamespaces: hydratedNamespaces\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/core/ir/mongo-contract-serializer.ts\n/**\n* Default Mongo family `ContractSerializer` concretion. Inherits the\n* Mongo-shared deserialization pipeline (structural validation +\n* collection-level hydration) and falls through `constructTargetContract`\n* with the validated `MongoContract` shape. Family-level call sites\n* (family-instance methods, family-layer tests that don't reach into\n* a target descriptor) instantiate this directly; targets with their\n* own storage concretion (`target-mongo`'s `MongoTargetContractSerializer`)\n* override `constructTargetContract` to wrap the storage shape.\n*/\nvar MongoContractSerializer = class extends MongoContractSerializerBase {\n\tconstructTargetContract(validated) {\n\t\treturn validated;\n\t}\n};\n//#endregion\nexport { MongoContractSerializerBase as n, MongoContractSerializer as t };\n\n//# sourceMappingURL=mongo-contract-serializer-Cx7Fae8e.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAI,8BAA8B,MAAM;CACvC;CACA;CACA,YAAY,oBAAoB,kBAAkB,CAAC,GAAG;EACrD,KAAK,aAAa,wBAAwB,eAAe;EACzD,KAAK,iBAAiB,uBAAuB,KAAK,KAAK,mBAAmB,OAAO,IAAI,0BAA0B,kBAAkB,IAAI,KAAK;CAC3I;CACA,oBAAoB,MAAM;EACzB,MAAM,YAAY,KAAK,4BAA4B,IAAI;EACvD,OAAO,KAAK,wBAAwB,SAAS;CAC9C;CACA,kBAAkB,UAAU;EAC3B,OAAO;CACR;;;;;;;CAOA,sBAAsB,mCAAmC;;;;;;;;;;;;;;;;;CAiBzD,4BAA4B,MAAM;EACjC,MAAM,UAAU,KAAK,kBAAkB,oBAAA,CAAqB,IAAI;EAChE,IAAI,kBAAkB,KAAK,QAAQ,MAAM,gBAAgB,8BAA8B,0CAA0C,OAAO,SAAS;EACjJ,MAAM,iBAAiB;EACvB,MAAM,mBAAmB,KAAK,qBAAqB,cAAc;EACjE,uBAAuB,gBAAgB;EACvC,qBAAqB,gBAAgB;EACrC,OAAO;CACR;;;;;;CAMA,qBAAqB,UAAU;EAC9B,MAAM,gBAAgB,SAAS,QAAQ;EACvC,MAAM,qBAAqB,OAAO,YAAY,OAAO,QAAQ,aAAa,CAAC,CAAC,KAAK,CAAC,MAAM,gBAAgB;GACvG,MAAM,kBAAkB,yBAAyB,UAAU,WAAW,OAAO,GAAG,KAAK,YAAY,QAAQ,IAAI;GAC7G,OAAO,CAAC,MAAM;IACb,GAAG;IACH,IAAI,WAAW;IACf,SAAS,UAAU,eAAe;GACnC,CAAC;EACF,CAAC,CAAC;EACF,OAAO;GACN,GAAG;GACH,SAAS;IACR,GAAG,SAAS;IACZ,YAAY;GACb;EACD;CACD;AACD;;;;;;;;;;;AAaA,IAAI,0BAA0B,cAAc,4BAA4B;CACvE,wBAAwB,WAAW;EAClC,OAAO;CACR;AACD"}
@@ -0,0 +1,27 @@
1
+ import { C as MongoContract } from "./mongo-value-set-tNn9-pun-dJYx_rVD.mjs";
2
+ import { i as MongoContractView } from "./index-Cd2zLiU6.mjs";
3
+ //#region ../../../2-mongo-family/9-family/dist/mongo-contract-view-AnejqfrQ.d.mts
4
+ //#region src/core/ir/mongo-contract-view.d.ts
5
+ /**
6
+ * A Mongo contract view: the deserialized contract intersected with by-name
7
+ * accessors. It is substitutable for `Contract` (carries `storage`, `domain`,
8
+ * …) and also exposes the single default namespace unwrapped with the built-in
9
+ * `collection` kind promoted:
10
+ *
11
+ * ```ts
12
+ * const view = MongoContractView.fromJson<Contract>(contractJson);
13
+ * view.collection.carts.validator // typed MongoCollection
14
+ * view.entries.policy.X // pack-contributed kind (singular key)
15
+ * view.storage // the full contract is still present
16
+ * ```
17
+ */
18
+ type MongoContractView$1<TContract extends MongoContract = MongoContract> = MongoContractView<TContract>;
19
+ declare const MongoContractView$1: {
20
+ /** Wrap an already-deserialized Mongo contract in a view. */
21
+ from<TContract extends MongoContract>(contract: TContract): MongoContractView$1<TContract>;
22
+ /** Deserialize a Mongo contract JSON envelope and wrap it in a view. */
23
+ fromJson<TContract extends MongoContract = MongoContract>(json: unknown): MongoContractView$1<TContract>;
24
+ };
25
+ //#endregion
26
+ export { MongoContractView$1 as t };
27
+ //# sourceMappingURL=mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-view-AnejqfrQ.d.mts"],"mappings":";;;;;;;;;;;;;;;;;KAeK,oBAAoB,kBAAkB,gBAAgB,iBAAiB,kBAAkB;cAChF;;EAEZ,KAAK,kBAAkB,eAAe,UAAU,YAAY,oBAAoB;;EAEhF,SAAS,kBAAkB,gBAAgB,eAAe,gBAAgB,oBAAoB"}
@@ -0,0 +1,17 @@
1
+ import { o as buildMongoContractView } from "./dist-DHrEJnhK.mjs";
2
+ import { t as MongoContractSerializer } from "./mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs";
3
+ //#region ../../../2-mongo-family/9-family/dist/mongo-contract-view-rcWzby6f.mjs
4
+ const MongoContractView$1 = {
5
+ /** Wrap an already-deserialized Mongo contract in a view. */
6
+ from(contract) {
7
+ return buildMongoContractView(contract);
8
+ },
9
+ /** Deserialize a Mongo contract JSON envelope and wrap it in a view. */
10
+ fromJson(json) {
11
+ return buildMongoContractView(new MongoContractSerializer().deserializeContract(json));
12
+ }
13
+ };
14
+ //#endregion
15
+ export { MongoContractView$1 as t };
16
+
17
+ //# sourceMappingURL=mongo-contract-view-rcWzby6f-wRBCUnBt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo-contract-view-rcWzby6f-wRBCUnBt.mjs","names":[],"sources":["../../../../2-mongo-family/9-family/dist/mongo-contract-view-rcWzby6f.mjs"],"sourcesContent":["import { t as MongoContractSerializer } from \"./mongo-contract-serializer-Cx7Fae8e.mjs\";\nimport { buildMongoContractView } from \"@internal/mongo-contract\";\n//#region src/core/ir/mongo-contract-view.ts\nconst MongoContractView$1 = {\n\t/** Wrap an already-deserialized Mongo contract in a view. */\n\tfrom(contract) {\n\t\treturn buildMongoContractView(contract);\n\t},\n\t/** Deserialize a Mongo contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildMongoContractView(new MongoContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { MongoContractView$1 as t };\n\n//# sourceMappingURL=mongo-contract-view-rcWzby6f.mjs.map"],"mappings":";;;AAGA,MAAM,sBAAsB;;CAE3B,KAAK,UAAU;EACd,OAAO,uBAAuB,QAAQ;CACvC;;CAEA,SAAS,MAAM;EACd,OAAO,uBAAuB,IAAI,wBAAwB,CAAC,CAAC,oBAAoB,IAAI,CAAC;CACtF;AACD"}
@@ -0,0 +1,536 @@
1
+ import { t as CollationOptions } from "./mongodb-types-B4HmhF1S.mjs";
2
+ import { Contract, ContractModel, ControlPolicy, JsonValue, StorageBase } from "@prisma/orm-framework/contract/types";
3
+ import { IRNodeBase, Namespace, UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
4
+ //#region ../../../2-mongo-family/1-foundation/mongo-contract/dist/mongo-value-set-tNn9-pun.d.mts
5
+ //#region src/ir/mongo-collation-options.d.ts
6
+ type MongoCollationCaseFirst = 'off' | 'upper' | 'lower';
7
+ type MongoCollationStrength = 1 | 2 | 3 | 4 | 5;
8
+ type MongoCollationAlternate = 'non-ignorable' | 'shifted';
9
+ type MongoCollationMaxVariable = 'punct' | 'space';
10
+ /**
11
+ * Authoring / hydration input shape for {@link MongoCollationOptions}. Carries
12
+ * the canonical data without the IR-class `kind` discriminator; the class
13
+ * fabricates `kind` so the authoring DSL and the SPI hydration walker can
14
+ * pass plain data literals through the constructor without forcing every
15
+ * call site to spell out `kind: 'mongo-collation-options'`.
16
+ */
17
+ interface MongoCollationOptionsInput {
18
+ readonly locale: string;
19
+ readonly caseLevel?: boolean;
20
+ readonly caseFirst?: MongoCollationCaseFirst;
21
+ readonly strength?: MongoCollationStrength;
22
+ readonly numericOrdering?: boolean;
23
+ readonly alternate?: MongoCollationAlternate;
24
+ readonly maxVariable?: MongoCollationMaxVariable;
25
+ readonly backwards?: boolean;
26
+ readonly normalization?: boolean;
27
+ }
28
+ /**
29
+ * Mongo Contract IR leaf for collection / index collation options.
30
+ *
31
+ * Lifted from a `type =` data shape to an AST class extending
32
+ * `IRNodeBase` per FR18 ("Mongo's Contract IR is fully unified under
33
+ * the AST-class pattern, layered family / target"). Single concrete class
34
+ * (no target subclass): collation options carry no target-specific
35
+ * variation at this layer — both Atlas and self-hosted Mongo consume the
36
+ * same option vocabulary.
37
+ *
38
+ * Undefined optional fields are not assigned, so `JSON.stringify` omits
39
+ * them from the canonical JSON output (matches the pre-lift data shape's
40
+ * round-trip behaviour, modulo the new `kind` discriminator).
41
+ */
42
+ declare class MongoCollationOptions extends IRNodeBase {
43
+ readonly kind: "mongo-collation-options";
44
+ readonly locale: string;
45
+ readonly caseLevel?: boolean;
46
+ readonly caseFirst?: MongoCollationCaseFirst;
47
+ readonly strength?: MongoCollationStrength;
48
+ readonly numericOrdering?: boolean;
49
+ readonly alternate?: MongoCollationAlternate;
50
+ readonly maxVariable?: MongoCollationMaxVariable;
51
+ readonly backwards?: boolean;
52
+ readonly normalization?: boolean;
53
+ constructor(options: MongoCollationOptionsInput);
54
+ }
55
+ //#endregion
56
+ //#region src/ir/mongo-index-options.d.ts
57
+ /**
58
+ * Authoring / hydration input shape for {@link MongoIndexOptions}. Carries
59
+ * the index option vocabulary as plain data without the IR-class `kind`
60
+ * discriminator. `collation` accepts either a class instance or its own
61
+ * input shape — the constructor normalises to the class form internally.
62
+ */
63
+ interface MongoIndexOptionsInput {
64
+ readonly unique?: boolean;
65
+ readonly name?: string;
66
+ readonly partialFilterExpression?: MongoJsonObject;
67
+ readonly sparse?: boolean;
68
+ readonly expireAfterSeconds?: number;
69
+ readonly weights?: Readonly<Record<string, number>>;
70
+ readonly default_language?: string;
71
+ readonly language_override?: string;
72
+ readonly textIndexVersion?: number;
73
+ readonly '2dsphereIndexVersion'?: number;
74
+ readonly bits?: number;
75
+ readonly min?: number;
76
+ readonly max?: number;
77
+ readonly bucketSize?: number;
78
+ readonly hidden?: boolean;
79
+ readonly collation?: MongoCollationOptions | MongoCollationOptionsInput;
80
+ readonly wildcardProjection?: MongoWildcardProjection;
81
+ }
82
+ /**
83
+ * Mongo Contract IR node for the per-index option vocabulary (the second
84
+ * argument to `db.collection.createIndex(keys, options)` minus the keys
85
+ * themselves). Lifted from a `type =` data shape to an AST class
86
+ * extending `IRNodeBase` per FR18.
87
+ *
88
+ * Nested `collation` is itself an IR class (`MongoCollationOptions`); the
89
+ * constructor accepts either a class instance or a data literal and
90
+ * normalises to the class form so downstream walks see a uniform IR tree.
91
+ */
92
+ declare class MongoIndexOptions extends IRNodeBase {
93
+ readonly kind: "mongo-index-options";
94
+ readonly unique?: boolean;
95
+ readonly name?: string;
96
+ readonly partialFilterExpression?: MongoJsonObject;
97
+ readonly sparse?: boolean;
98
+ readonly expireAfterSeconds?: number;
99
+ readonly weights?: Readonly<Record<string, number>>;
100
+ readonly default_language?: string;
101
+ readonly language_override?: string;
102
+ readonly textIndexVersion?: number;
103
+ readonly '2dsphereIndexVersion'?: number;
104
+ readonly bits?: number;
105
+ readonly min?: number;
106
+ readonly max?: number;
107
+ readonly bucketSize?: number;
108
+ readonly hidden?: boolean;
109
+ readonly collation?: MongoCollationOptions;
110
+ readonly wildcardProjection?: MongoWildcardProjection;
111
+ constructor(options?: MongoIndexOptionsInput);
112
+ }
113
+ //#endregion
114
+ //#region src/contract-types.d.ts
115
+ type MongoIndexFieldValue = 1 | -1 | 'text' | '2dsphere' | '2d' | 'hashed';
116
+ type MongoIndexFields = Record<string, MongoIndexFieldValue>;
117
+ type MongoJsonPrimitive = string | number | boolean | null;
118
+ type MongoJsonValue = MongoJsonPrimitive | readonly MongoJsonValue[] | MongoJsonObject;
119
+ type MongoJsonObject = {
120
+ readonly [key: string]: MongoJsonValue;
121
+ };
122
+ type MongoWildcardProjection = Readonly<Record<string, 0 | 1>>;
123
+ /**
124
+ * Authoring-DSL shape for a single index entry on a model — the
125
+ * `indexes` array element accepted by the contract-ts builder. The
126
+ * builder translates these (with model context) into {@link MongoIndex}
127
+ * IR-class instances on `MongoCollection.indexes`.
128
+ */
129
+ type MongoIndexAuthoringInput = {
130
+ readonly fields: MongoIndexFields;
131
+ readonly options?: MongoIndexOptionsInput;
132
+ };
133
+ type MongoIndexKeyDirection = 1 | -1 | 'text' | '2dsphere' | '2d' | 'hashed';
134
+ interface MongoIndexKey {
135
+ readonly field: string;
136
+ readonly direction: MongoIndexKeyDirection;
137
+ }
138
+ type MongoModelStorage = {
139
+ readonly collection?: string;
140
+ readonly relations?: Record<string, {
141
+ readonly field: string;
142
+ }>;
143
+ };
144
+ type MongoModelDefinition = ContractModel<MongoModelStorage>;
145
+ type MongoNamespaceEntries = Readonly<Record<string, Readonly<Record<string, unknown>>>> & {
146
+ readonly collection?: Readonly<Record<string, MongoCollection>>;
147
+ };
148
+ type MongoStorageShape<THash extends string = string> = StorageBase<THash> & {
149
+ readonly namespaces: Record<string, Namespace & {
150
+ readonly entries: MongoNamespaceEntries;
151
+ }>;
152
+ };
153
+ type MongoContract<S extends MongoStorageShape = MongoStorageShape> = Contract<S>;
154
+ /**
155
+ * Model map for the contract's sole (unbound) domain namespace. Mongo is
156
+ * structurally single-namespace, so its models live under
157
+ * {@link UNBOUND_NAMESPACE_ID} rather than in a flat cross-namespace union.
158
+ * Every Mongo type that needs the model map reads it through here, so none
159
+ * indexes the contract's namespaces directly.
160
+ */
161
+ type MongoModelsMap<TContract extends MongoContract> = TContract['domain']['namespaces'][typeof UNBOUND_NAMESPACE_ID]['models'];
162
+ type RootModelName<TContract extends MongoContract, RootName extends keyof TContract['roots'] & string> = TContract['roots'][RootName] extends {
163
+ readonly model: infer M extends string;
164
+ } ? M & keyof MongoModelsMap<TContract> : never;
165
+ type MongoTypeMaps<TCodecTypes extends Record<string, {
166
+ output: unknown;
167
+ }>, TFieldOutputTypes extends Record<string, Record<string, unknown>>, TFieldInputTypes extends Record<string, Record<string, unknown>>> = {
168
+ readonly codecTypes: TCodecTypes;
169
+ readonly fieldOutputTypes: TFieldOutputTypes;
170
+ readonly fieldInputTypes: TFieldInputTypes;
171
+ };
172
+ type AnyMongoTypeMaps = MongoTypeMaps<Record<string, {
173
+ output: unknown;
174
+ }>, Record<string, Record<string, unknown>>, Record<string, Record<string, unknown>>>;
175
+ type MongoTypeMapsPhantomKey = '__@internal/mongo-core/typeMaps@__';
176
+ type MongoContractWithTypeMaps<TContract, TTypeMaps> = TContract & { readonly [K in MongoTypeMapsPhantomKey]?: TTypeMaps; };
177
+ type ExtractMongoTypeMaps<T> = MongoTypeMapsPhantomKey extends keyof T ? NonNullable<T[MongoTypeMapsPhantomKey & keyof T]> : never;
178
+ type ExtractMongoCodecTypes<T> = ExtractMongoTypeMaps<T> extends {
179
+ codecTypes: infer C;
180
+ } ? C extends Record<string, {
181
+ output: unknown;
182
+ }> ? C : Record<string, never> : Record<string, never>;
183
+ type ExtractMongoFieldOutputTypes<T> = ExtractMongoTypeMaps<T> extends {
184
+ fieldOutputTypes: infer F;
185
+ } ? F extends Record<string, Record<string, unknown>> ? F : Record<string, never> : Record<string, never>;
186
+ type ExtractMongoFieldInputTypes<T> = ExtractMongoTypeMaps<T> extends {
187
+ fieldInputTypes: infer F;
188
+ } ? F extends Record<string, Record<string, unknown>> ? F : Record<string, never> : Record<string, never>;
189
+ /**
190
+ * The per-model field-output map at the contract's unbound namespace. The
191
+ * framework emitter nests `FieldOutputTypes` by namespace id
192
+ * (`{ [ns]: { [model]: { [field]: <refined> } } }`); Mongo is structurally
193
+ * single-namespace, so its refined rows resolve the per-model map under
194
+ * {@link UNBOUND_NAMESPACE_ID}. A map without that coordinate (e.g. a contract
195
+ * carrying no type maps) resolves to `never`, which the row resolvers read as
196
+ * "no refined map" and fall back to codec-based inference.
197
+ */
198
+ type MongoUnboundFieldOutputTypes<T> = ExtractMongoFieldOutputTypes<T> extends Record<typeof UNBOUND_NAMESPACE_ID, infer Inner> ? Inner : never;
199
+ /** Input-side counterpart of {@link MongoUnboundFieldOutputTypes}. */
200
+ type MongoUnboundFieldInputTypes<T> = ExtractMongoFieldInputTypes<T> extends Record<typeof UNBOUND_NAMESPACE_ID, infer Inner> ? Inner : never;
201
+ type InferModelRow<TContract extends MongoContractWithTypeMaps<MongoContract, MongoTypeMaps<Record<string, {
202
+ output: unknown;
203
+ }>, Record<string, Record<string, unknown>>, Record<string, Record<string, unknown>>>>, ModelName extends string & keyof MongoModelsMap<TContract>> = ModelName extends keyof MongoUnboundFieldOutputTypes<TContract> ? MongoUnboundFieldOutputTypes<TContract>[ModelName] : { readonly [K in keyof MongoModelsMap<TContract>[ModelName]['fields']]: unknown; };
204
+ //#endregion
205
+ //#region src/ir/mongo-change-stream-pre-and-post-images-options.d.ts
206
+ interface MongoChangeStreamPreAndPostImagesOptionsInput {
207
+ readonly enabled: boolean;
208
+ }
209
+ /**
210
+ * Change-stream pre-and-post-images collection option. Lifted from a
211
+ * `type =` data shape to an AST class extending `IRNodeBase` per
212
+ * FR18. Single-field shape; the class exists for AST-pattern
213
+ * consistency (every nested data shape inside `MongoCollectionOptions`
214
+ * is an AST node so the verifier can walk uniformly).
215
+ */
216
+ declare class MongoChangeStreamPreAndPostImagesOptions extends IRNodeBase {
217
+ readonly kind: "mongo-change-stream-pre-and-post-images-options";
218
+ readonly enabled: boolean;
219
+ constructor(options: MongoChangeStreamPreAndPostImagesOptionsInput);
220
+ }
221
+ //#endregion
222
+ //#region src/ir/mongo-clustered-collection-options.d.ts
223
+ type MongoClusteredCollectionKey = Readonly<Record<string, 1>>;
224
+ interface MongoClusteredCollectionOptionsInput {
225
+ readonly name?: string;
226
+ readonly key: MongoClusteredCollectionKey;
227
+ readonly unique: boolean;
228
+ }
229
+ /**
230
+ * Clustered-collection options (the `clusteredIndex` collection-creation
231
+ * field). Lifted from a `type =` data shape to an AST class extending
232
+ * `IRNodeBase` per FR18.
233
+ *
234
+ * MongoDB requires `key` and `unique` for any clustered collection; the
235
+ * constructor enforces presence by type signature.
236
+ */
237
+ declare class MongoClusteredCollectionOptions extends IRNodeBase {
238
+ readonly kind: "mongo-clustered-collection-options";
239
+ readonly name?: string;
240
+ readonly key: MongoClusteredCollectionKey;
241
+ readonly unique: boolean;
242
+ constructor(options: MongoClusteredCollectionOptionsInput);
243
+ }
244
+ //#endregion
245
+ //#region src/ir/mongo-index-option-defaults.d.ts
246
+ interface MongoIndexOptionDefaultsInput {
247
+ readonly storageEngine?: MongoJsonObject;
248
+ }
249
+ /**
250
+ * Collection-level default index options (the `indexOptionDefaults`
251
+ * collection-creation field on Mongo's `createCollection`). Lifted from
252
+ * a `type =` data shape to an AST class extending `IRNodeBase` per
253
+ * FR18 (Mongo Contract IR fully unified under the AST-class pattern).
254
+ *
255
+ * Carries `storageEngine` only — the underlying MongoDB option set is
256
+ * intentionally narrow at this layer; per-engine richer option vocabularies
257
+ * are out of scope for this project.
258
+ */
259
+ declare class MongoIndexOptionDefaults extends IRNodeBase {
260
+ readonly kind: "mongo-index-option-defaults";
261
+ readonly storageEngine?: MongoJsonObject;
262
+ constructor(options?: MongoIndexOptionDefaultsInput);
263
+ }
264
+ //#endregion
265
+ //#region src/ir/mongo-time-series-collection-options.d.ts
266
+ type MongoTimeSeriesGranularity = 'seconds' | 'minutes' | 'hours';
267
+ interface MongoTimeSeriesCollectionOptionsInput {
268
+ readonly timeField: string;
269
+ readonly metaField?: string;
270
+ readonly granularity?: MongoTimeSeriesGranularity;
271
+ readonly bucketMaxSpanSeconds?: number;
272
+ readonly bucketRoundingSeconds?: number;
273
+ }
274
+ /**
275
+ * Time-series collection options. Lifted from a `type =` data shape to
276
+ * an AST class extending `IRNodeBase` per FR18.
277
+ *
278
+ * MongoDB requires `timeField` for any time-series collection; the
279
+ * constructor enforces presence by type signature (`timeField: string`
280
+ * is required on the input).
281
+ */
282
+ declare class MongoTimeSeriesCollectionOptions extends IRNodeBase {
283
+ readonly kind: "mongo-time-series-collection-options";
284
+ readonly timeField: string;
285
+ readonly metaField?: string;
286
+ readonly granularity?: MongoTimeSeriesGranularity;
287
+ readonly bucketMaxSpanSeconds?: number;
288
+ readonly bucketRoundingSeconds?: number;
289
+ constructor(options: MongoTimeSeriesCollectionOptionsInput);
290
+ }
291
+ //#endregion
292
+ //#region src/ir/mongo-collection-options.d.ts
293
+ /**
294
+ * Storage-shape sub-shape: only `name` is persisted on the storage
295
+ * `clusteredIndex` field. The richer authoring vocabulary
296
+ * (`MongoClusteredCollectionOptions.key`, `…unique`) is intentionally
297
+ * not round-tripped through the on-disk JSON envelope — those fields
298
+ * are application-side configuration that informs collection creation
299
+ * but does not survive into the persisted collection options.
300
+ */
301
+ interface MongoStorageClusteredIndexShape {
302
+ readonly name?: string;
303
+ }
304
+ /**
305
+ * Storage-shape sub-shape: `capped` collections persist `size` (required)
306
+ * and optionally `max` document count. The authoring DSL surface uses a
307
+ * flat `capped: boolean` + separate `size` / `max` fields; builders
308
+ * translate that authoring vocabulary into this nested storage form
309
+ * before constructing {@link MongoCollectionOptions}.
310
+ */
311
+ interface MongoStorageCappedShape {
312
+ readonly size: number;
313
+ readonly max?: number;
314
+ }
315
+ /**
316
+ * Hydration / construction input shape for {@link MongoCollectionOptions}.
317
+ * Mirrors the on-disk storage JSON envelope exactly (nested `capped`,
318
+ * `clusteredIndex`, …) so the family-base serializer's hydration walker
319
+ * can hand an arktype-validated object literal straight to `new`.
320
+ * Nested IR-class fields may be supplied as either plain data literals
321
+ * (typical for JSON-derived input) or already-constructed class
322
+ * instances (typical when re-wrapping during a partial walk).
323
+ */
324
+ interface MongoCollectionOptionsInput {
325
+ readonly capped?: MongoStorageCappedShape;
326
+ readonly storageEngine?: MongoJsonObject;
327
+ readonly indexOptionDefaults?: MongoIndexOptionDefaults | MongoIndexOptionDefaultsInput;
328
+ readonly collation?: MongoCollationOptions | MongoCollationOptionsInput;
329
+ readonly timeseries?: MongoTimeSeriesCollectionOptions | MongoTimeSeriesCollectionOptionsInput;
330
+ readonly clusteredIndex?: MongoStorageClusteredIndexShape;
331
+ readonly expireAfterSeconds?: number;
332
+ readonly changeStreamPreAndPostImages?: MongoChangeStreamPreAndPostImagesOptions | MongoChangeStreamPreAndPostImagesOptionsInput;
333
+ }
334
+ /**
335
+ * Authoring-side flat vocabulary accepted by the contract-ts builder
336
+ * DSL (e.g. `capped: boolean` + separate `size` / `max` scalars). The
337
+ * builder translates this surface into a {@link MongoCollectionOptionsInput}
338
+ * before constructing {@link MongoCollectionOptions}. Kept as a
339
+ * standalone type so authoring DSL ergonomics do not leak into the
340
+ * storage IR construction contract.
341
+ */
342
+ interface MongoCollectionOptionsAuthoringInput {
343
+ readonly capped?: boolean;
344
+ readonly size?: number;
345
+ readonly max?: number;
346
+ readonly storageEngine?: MongoJsonObject;
347
+ readonly indexOptionDefaults?: MongoIndexOptionDefaults | MongoIndexOptionDefaultsInput;
348
+ readonly collation?: MongoCollationOptions | MongoCollationOptionsInput;
349
+ readonly timeseries?: MongoTimeSeriesCollectionOptions | MongoTimeSeriesCollectionOptionsInput;
350
+ readonly clusteredIndex?: MongoClusteredCollectionOptions | MongoClusteredCollectionOptionsInput;
351
+ readonly expireAfterSeconds?: number;
352
+ readonly changeStreamPreAndPostImages?: MongoChangeStreamPreAndPostImagesOptions | MongoChangeStreamPreAndPostImagesOptionsInput;
353
+ }
354
+ /**
355
+ * Mongo Contract IR node for collection-level creation options (the
356
+ * second argument to `db.createCollection(name, options)`). Lifted from
357
+ * the pre-M2R2 `MongoStorageCollectionOptions` storage interface to a
358
+ * class extending `IRNodeBase` per FR18.
359
+ *
360
+ * Single concrete family-layer class (no target subclass). The
361
+ * constructor accepts the storage JSON envelope shape ({@link
362
+ * MongoCollectionOptionsInput}) so the family-base hydration walker
363
+ * can pass arktype-validated objects directly to `new`. Authoring
364
+ * vocabulary is translated to this shape upstream in the contract-ts
365
+ * builder.
366
+ *
367
+ * Nested IR sub-shapes (collation, timeseries, …) are normalised to
368
+ * their respective IR class instances inside the constructor so
369
+ * downstream walks see a uniform AST regardless of whether the input
370
+ * was a JSON literal or an already-constructed class.
371
+ */
372
+ declare class MongoCollectionOptions extends IRNodeBase {
373
+ readonly kind: "mongo-collection-options";
374
+ readonly capped?: MongoStorageCappedShape;
375
+ readonly storageEngine?: MongoJsonObject;
376
+ readonly indexOptionDefaults?: MongoIndexOptionDefaults;
377
+ readonly collation?: MongoCollationOptions;
378
+ readonly timeseries?: MongoTimeSeriesCollectionOptions;
379
+ readonly clusteredIndex?: MongoStorageClusteredIndexShape;
380
+ readonly expireAfterSeconds?: number;
381
+ readonly changeStreamPreAndPostImages?: MongoChangeStreamPreAndPostImagesOptions;
382
+ constructor(input?: MongoCollectionOptionsInput);
383
+ }
384
+ //#endregion
385
+ //#region src/ir/mongo-index.d.ts
386
+ /**
387
+ * Hydration / construction input shape for {@link MongoIndex}. Mirrors
388
+ * the on-disk storage JSON envelope exactly so the family-base
389
+ * serializer's hydration walker can hand an arktype-validated literal
390
+ * straight to `new`.
391
+ */
392
+ interface MongoIndexInput {
393
+ readonly keys: ReadonlyArray<MongoIndexKey>;
394
+ readonly unique?: boolean;
395
+ readonly sparse?: boolean;
396
+ readonly expireAfterSeconds?: number;
397
+ readonly partialFilterExpression?: Record<string, unknown>;
398
+ readonly wildcardProjection?: Record<string, 0 | 1>;
399
+ readonly collation?: CollationOptions;
400
+ readonly weights?: Record<string, number>;
401
+ readonly default_language?: string;
402
+ readonly language_override?: string;
403
+ }
404
+ /**
405
+ * Mongo Contract IR node for a single collection index entry (one
406
+ * element of `MongoCollection.indexes`). Lifted from the
407
+ * pre-M2R2 `MongoStorageIndex` storage interface to a class extending
408
+ * `IRNodeBase` per FR18.
409
+ *
410
+ * Single concrete family-layer class (no target subclass). The spec's
411
+ * `MongoTargetIndex extends MongoIndex` pattern remains additive — a
412
+ * future Mongo target with target-specific index extensions is free to
413
+ * subclass; for the single Mongo target shipped today a concrete
414
+ * family-layer class is enough and avoids a target-import layering
415
+ * violation from the contract-ts builder.
416
+ */
417
+ declare class MongoIndex extends IRNodeBase {
418
+ readonly kind: "mongo-index";
419
+ readonly keys: ReadonlyArray<MongoIndexKey>;
420
+ readonly unique?: boolean;
421
+ readonly sparse?: boolean;
422
+ readonly expireAfterSeconds?: number;
423
+ readonly partialFilterExpression?: Record<string, unknown>;
424
+ readonly wildcardProjection?: Record<string, 0 | 1>;
425
+ readonly collation?: CollationOptions;
426
+ readonly weights?: Record<string, number>;
427
+ readonly default_language?: string;
428
+ readonly language_override?: string;
429
+ constructor(input: MongoIndexInput);
430
+ }
431
+ //#endregion
432
+ //#region src/ir/mongo-validator.d.ts
433
+ type MongoValidatorValidationLevel = 'strict' | 'moderate';
434
+ type MongoValidatorValidationAction = 'error' | 'warn';
435
+ interface MongoValidatorInput {
436
+ readonly jsonSchema: Record<string, unknown>;
437
+ readonly validationLevel: MongoValidatorValidationLevel;
438
+ readonly validationAction: MongoValidatorValidationAction;
439
+ }
440
+ /**
441
+ * Mongo Contract IR node for collection-level document validators (the
442
+ * `validator` field on Mongo's `createCollection`). Lifted from the
443
+ * pre-M2R2 `MongoStorageValidator` storage interface to a class extending
444
+ * `IRNodeBase` per FR18.
445
+ *
446
+ * Concrete at the family layer (no target subclass). The spec's
447
+ * abstract-family + target-concrete pattern (`MongoTargetValidator
448
+ * extends MongoValidator`) becomes meaningful when a second Mongo target
449
+ * introduces target-specific validator extensions (Atlas search rules,
450
+ * DocumentDB-specific levels, …); for the single Mongo target shipped
451
+ * today, a concrete family-layer class lets the PSL JSON-Schema deriver
452
+ * and the contract-ts builder construct instances directly without a
453
+ * target-import layering violation. Target subclassing remains additive
454
+ * — a future `MongoTargetValidator extends MongoValidator` is an
455
+ * additive change, not a breaking one.
456
+ */
457
+ declare class MongoValidator extends IRNodeBase {
458
+ readonly kind: "mongo-validator";
459
+ readonly jsonSchema: Record<string, unknown>;
460
+ readonly validationLevel: MongoValidatorValidationLevel;
461
+ readonly validationAction: MongoValidatorValidationAction;
462
+ constructor(input: MongoValidatorInput);
463
+ }
464
+ //#endregion
465
+ //#region src/ir/mongo-collection.d.ts
466
+ /**
467
+ * Hydration / construction input shape for {@link MongoCollection}.
468
+ * Mirrors the on-disk storage JSON envelope exactly (the value held at
469
+ * `contract.storage.namespaces[<namespaceId>].entries.collection[<name>]`) so the family-base
470
+ * serializer's hydration walker can hand an arktype-validated literal
471
+ * straight to `new`. Nested IR-class fields may be supplied as either
472
+ * plain data literals (typical for JSON-derived input) or
473
+ * already-constructed class instances.
474
+ */
475
+ interface MongoCollectionInput {
476
+ readonly indexes?: ReadonlyArray<MongoIndex | MongoIndexInput>;
477
+ readonly validator?: MongoValidator | MongoValidatorInput;
478
+ readonly options?: MongoCollectionOptions | MongoCollectionOptionsInput;
479
+ readonly control?: ControlPolicy;
480
+ }
481
+ /**
482
+ * Mongo Contract IR node for a single collection entry in a namespace's
483
+ * `collections` map. Lifted from the pre-M2R2
484
+ * `MongoStorageCollection` storage interface to a class extending
485
+ * `IRNodeBase` per FR18.
486
+ *
487
+ * Concrete at the family layer (no target subclass). The spec's
488
+ * `MongoTargetCollection extends MongoCollection` pattern remains
489
+ * additive: a future Mongo target with target-specific extensions is
490
+ * free to subclass without breaking the family-layer construction
491
+ * sites.
492
+ *
493
+ * The unprefixed name `MongoCollection` is now the contract IR class.
494
+ * Note that `@internal/mongo-orm` also exports a (different)
495
+ * `MongoCollection<TContract, ModelName>` generic for the user-facing
496
+ * ORM query builder; the two live in separate packages and are
497
+ * resolved by import path. A source file that needs both should alias
498
+ * one (e.g. `import { MongoCollection as MongoContractCollection }
499
+ * from '@internal/mongo-contract'`).
500
+ */
501
+ declare class MongoCollection extends IRNodeBase {
502
+ readonly kind: "mongo-collection";
503
+ readonly indexes?: ReadonlyArray<MongoIndex>;
504
+ readonly validator?: MongoValidator;
505
+ readonly options?: MongoCollectionOptions;
506
+ readonly control?: ControlPolicy;
507
+ constructor(input?: MongoCollectionInput);
508
+ }
509
+ //#endregion
510
+ //#region src/ir/mongo-value-set.d.ts
511
+ /**
512
+ * Hydration / construction input shape for {@link MongoValueSet}. Mirrors the on-disk storage JSON
513
+ * envelope (the value held at `contract.storage.namespaces[<ns>].entries.valueSet[<Name>]`) so the
514
+ * serializer hydration walker can hand a validated literal straight to `new`.
515
+ */
516
+ interface MongoValueSetInput {
517
+ readonly kind: 'valueSet';
518
+ /** Ordered permitted values, codec-encoded. Declaration order is preserved. */
519
+ readonly values: readonly JsonValue[];
520
+ }
521
+ /**
522
+ * Mongo Contract IR node for a value-set entry in a namespace's `valueSet` map
523
+ * (`entries.valueSet`). Same shape as SQL's `StorageValueSet`: the ordered set of permitted
524
+ * codec-encoded values for a field restriction, with no `codecId` (the field that references it
525
+ * holds the codec). The `kind` is enumerable so the JSON envelope carries the discriminator and the
526
+ * hydration walker can dispatch on it. Value-sets are keyed by name in the parent namespace's
527
+ * `valueSet: Record<string, MongoValueSet>` map, so the entry name is not on the class.
528
+ */
529
+ declare class MongoValueSet extends IRNodeBase {
530
+ readonly kind: "valueSet";
531
+ readonly values: readonly JsonValue[];
532
+ constructor(input: MongoValueSetInput);
533
+ }
534
+ //#endregion
535
+ export { MongoValidatorInput as $, MongoIndexKey as A, MongoModelStorage as B, MongoContract as C, MongoIndexFieldValue as D, MongoIndexAuthoringInput as E, MongoIndexOptionsInput as F, MongoTimeSeriesCollectionOptions as G, MongoStorageCappedShape as H, MongoJsonObject as I, MongoTypeMaps as J, MongoTimeSeriesCollectionOptionsInput as K, MongoJsonPrimitive as L, MongoIndexOptionDefaults as M, MongoIndexOptionDefaultsInput as N, MongoIndexFields as O, MongoIndexOptions as P, MongoValidator as Q, MongoJsonValue as R, MongoCollectionOptionsInput as S, MongoIndex as T, MongoStorageClusteredIndexShape as U, MongoModelsMap as V, MongoStorageShape as W, MongoUnboundFieldInputTypes as X, MongoTypeMapsPhantomKey as Y, MongoUnboundFieldOutputTypes as Z, MongoCollationStrength as _, ExtractMongoTypeMaps as a, RootModelName as at, MongoCollectionOptions as b, MongoChangeStreamPreAndPostImagesOptionsInput as c, MongoClusteredCollectionOptionsInput as d, MongoValidatorValidationAction as et, MongoCollationAlternate as f, MongoCollationOptionsInput as g, MongoCollationOptions as h, ExtractMongoFieldOutputTypes as i, MongoWildcardProjection as it, MongoIndexKeyDirection as j, MongoIndexInput as k, MongoClusteredCollectionKey as l, MongoCollationMaxVariable as m, ExtractMongoCodecTypes as n, MongoValueSet as nt, InferModelRow as o, MongoCollationCaseFirst as p, MongoTimeSeriesGranularity as q, ExtractMongoFieldInputTypes as r, MongoValueSetInput as rt, MongoChangeStreamPreAndPostImagesOptions as s, AnyMongoTypeMaps as t, MongoValidatorValidationLevel as tt, MongoClusteredCollectionOptions as u, MongoCollection as v, MongoContractWithTypeMaps as w, MongoCollectionOptionsAuthoringInput as x, MongoCollectionInput as y, MongoModelDefinition as z };
536
+ //# sourceMappingURL=mongo-value-set-tNn9-pun-dJYx_rVD.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo-value-set-tNn9-pun-dJYx_rVD.d.mts","names":[],"sources":["../../../../2-mongo-family/1-foundation/mongo-contract/dist/mongo-value-set-tNn9-pun.d.mts"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import { CollationOptions, CreateCollectionOptions, CreateIndexesOptions, IndexSpecification } from "mongodb";
2
+ export { IndexSpecification as i, CreateCollectionOptions as n, CreateIndexesOptions as r, CollationOptions as t };