@prisma/orm-target-mongo 8.0.0-rc.19-dev.9 → 8.0.0-rc.19-dev.11

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 (109) hide show
  1. package/dist/adapter.d.mts +2 -2
  2. package/dist/adapter.d.mts.map +1 -1
  3. package/dist/adapter.mjs +3 -3
  4. package/dist/adapter.mjs.map +1 -1
  5. package/dist/adapter__control.d.mts +8 -8
  6. package/dist/adapter__control.d.mts.map +1 -1
  7. package/dist/adapter__control.mjs +28 -27
  8. package/dist/adapter__control.mjs.map +1 -1
  9. package/dist/adapter__runtime.d.mts +1 -1
  10. package/dist/adapter__runtime.d.mts.map +1 -1
  11. package/dist/adapter__runtime.mjs +3 -3
  12. package/dist/adapter__runtime.mjs.map +1 -1
  13. package/dist/{codec-ids-PSU05uwH.d.mts → codec-ids-BKQbXhZt.d.mts} +2 -2
  14. package/dist/codec-ids-BKQbXhZt.d.mts.map +1 -0
  15. package/dist/{codec-ids-WdrumsYA-BkQfspmL.mjs → codec-ids-WdrumsYA-CZVjuKW8.mjs} +2 -2
  16. package/dist/codec-ids-WdrumsYA-CZVjuKW8.mjs.map +1 -0
  17. package/dist/{codec-types-Daq7xQEA.d.mts → codec-types-oKxM85p-.d.mts} +2 -2
  18. package/dist/codec-types-oKxM85p-.d.mts.map +1 -0
  19. package/dist/{codecs-B1ab7vfj-DncFJY2Q.mjs → codecs-B1ab7vfj-QL33tkm2.mjs} +5 -5
  20. package/dist/codecs-B1ab7vfj-QL33tkm2.mjs.map +1 -0
  21. package/dist/{codecs-DBvHcdHp.d.mts → codecs-Y5GYsLPj.d.mts} +2 -2
  22. package/dist/codecs-Y5GYsLPj.d.mts.map +1 -0
  23. package/dist/{control-DRifdPhB.mjs → control-Cq6qWohQ.mjs} +5 -5
  24. package/dist/control-Cq6qWohQ.mjs.map +1 -0
  25. package/dist/{control-BjaiAXAN.d.mts → control-CrFS8bqh.d.mts} +3 -3
  26. package/dist/control-CrFS8bqh.d.mts.map +1 -0
  27. package/dist/{data-types-BUXk_WEa.d.mts → data-types-LShlnAUM.d.mts} +2 -2
  28. package/dist/data-types-LShlnAUM.d.mts.map +1 -0
  29. package/dist/{data-types-hoKLBrYZ-CkFtgHfm.mjs → data-types-hoKLBrYZ-h9cAgbOy.mjs} +4 -4
  30. package/dist/data-types-hoKLBrYZ-h9cAgbOy.mjs.map +1 -0
  31. package/dist/{descriptor-meta-DTj807jv-C0Hq7wyV.mjs → descriptor-meta-DTj807jv-CjvK2XDD.mjs} +5 -5
  32. package/dist/descriptor-meta-DTj807jv-CjvK2XDD.mjs.map +1 -0
  33. package/dist/{descriptor-meta-runtime-BaRbjvD7-MOhJcdky.mjs → descriptor-meta-runtime-BaRbjvD7-D0786_Lv.mjs} +4 -4
  34. package/dist/descriptor-meta-runtime-BaRbjvD7-D0786_Lv.mjs.map +1 -0
  35. package/dist/driver.d.mts +1 -1
  36. package/dist/driver.mjs +1 -1
  37. package/dist/driver__control.d.mts +2 -2
  38. package/dist/driver__control.d.mts.map +1 -1
  39. package/dist/driver__control.mjs +2 -2
  40. package/dist/driver__control.mjs.map +1 -1
  41. package/dist/{migration-DKoUk2CF.d.mts → migration-C4m4Uj8E.d.mts} +3 -3
  42. package/dist/migration-C4m4Uj8E.d.mts.map +1 -0
  43. package/dist/{migration-factories-BqROEHRs-C4K_DHy7.mjs → migration-factories-BqROEHRs-CfExMr9r.mjs} +3 -3
  44. package/dist/migration-factories-BqROEHRs-CfExMr9r.mjs.map +1 -0
  45. package/dist/{mongo-adapter-Bo6ciURK-CGfjLOPh.mjs → mongo-adapter-Bo6ciURK-DIMJdC7y.mjs} +3 -3
  46. package/dist/mongo-adapter-Bo6ciURK-DIMJdC7y.mjs.map +1 -0
  47. package/dist/{mongo-adapter-wvK2fQOZ-BXo5NxEB.d.mts → mongo-adapter-wvK2fQOZ-FswLS-PJ.d.mts} +2 -2
  48. package/dist/mongo-adapter-wvK2fQOZ-FswLS-PJ.d.mts.map +1 -0
  49. package/dist/{mongo-driver-CTyvKDUg-bwRH7EDL.d.mts → mongo-driver-CTyvKDUg-Bm9sBrfs.d.mts} +2 -2
  50. package/dist/mongo-driver-CTyvKDUg-Bm9sBrfs.d.mts.map +1 -0
  51. package/dist/{mongo-driver-q-IqfhuV-CouLzDHp.mjs → mongo-driver-DPg6DuIh-CWYHpD0t.mjs} +3 -3
  52. package/dist/mongo-driver-DPg6DuIh-CWYHpD0t.mjs.map +1 -0
  53. package/dist/{mongo-target-errors-Btf3ML1w-B5EMYbz1.mjs → mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs} +2 -2
  54. package/dist/mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs.map +1 -0
  55. package/dist/{op-factory-call-BoYr7vvM-PXfT4zvm.d.mts → op-factory-call-BoYr7vvM-CjA8nx36.d.mts} +2 -2
  56. package/dist/op-factory-call-BoYr7vvM-CjA8nx36.d.mts.map +1 -0
  57. package/dist/{pack-DYR2mrvW.d.mts → pack-CIfujQmd.d.mts} +3 -3
  58. package/dist/pack-CIfujQmd.d.mts.map +1 -0
  59. package/dist/{prisma6-binding-DRM8QnmA.d.mts → prisma6-binding-DhnqslLT.d.mts} +2 -2
  60. package/dist/prisma6-binding-DhnqslLT.d.mts.map +1 -0
  61. package/dist/{prisma6-binding-WOZ8vURx.mjs → prisma6-binding-vt4tbT-Z.mjs} +4 -4
  62. package/dist/prisma6-binding-vt4tbT-Z.mjs.map +1 -0
  63. package/dist/{runtime-B9_-kjBX.d.mts → runtime-DbFgyDql.d.mts} +2 -2
  64. package/dist/runtime-DbFgyDql.d.mts.map +1 -0
  65. package/dist/target.d.mts +10 -10
  66. package/dist/target.mjs +6 -6
  67. package/dist/target__codec-ids.d.mts +1 -1
  68. package/dist/target__codec-ids.mjs +1 -1
  69. package/dist/target__codec-types.d.mts +1 -1
  70. package/dist/target__codecs.d.mts +1 -1
  71. package/dist/target__codecs.mjs +1 -1
  72. package/dist/target__control.d.mts +2 -2
  73. package/dist/target__control.mjs +1 -1
  74. package/dist/target__data-types.d.mts +1 -1
  75. package/dist/target__data-types.mjs +1 -1
  76. package/dist/target__migration.d.mts +1 -1
  77. package/dist/target__migration.mjs +1 -1
  78. package/dist/target__pack.d.mts +2 -2
  79. package/dist/target__pack.mjs +2 -2
  80. package/dist/target__pack.mjs.map +1 -1
  81. package/dist/target__prisma6-binding.d.mts +1 -1
  82. package/dist/target__prisma6-binding.mjs +1 -1
  83. package/dist/target__runtime.d.mts +1 -1
  84. package/dist/target__runtime.mjs +2 -2
  85. package/dist/target__runtime.mjs.map +1 -1
  86. package/package.json +9 -9
  87. package/dist/codec-ids-PSU05uwH.d.mts.map +0 -1
  88. package/dist/codec-ids-WdrumsYA-BkQfspmL.mjs.map +0 -1
  89. package/dist/codec-types-Daq7xQEA.d.mts.map +0 -1
  90. package/dist/codecs-B1ab7vfj-DncFJY2Q.mjs.map +0 -1
  91. package/dist/codecs-DBvHcdHp.d.mts.map +0 -1
  92. package/dist/control-BjaiAXAN.d.mts.map +0 -1
  93. package/dist/control-DRifdPhB.mjs.map +0 -1
  94. package/dist/data-types-BUXk_WEa.d.mts.map +0 -1
  95. package/dist/data-types-hoKLBrYZ-CkFtgHfm.mjs.map +0 -1
  96. package/dist/descriptor-meta-DTj807jv-C0Hq7wyV.mjs.map +0 -1
  97. package/dist/descriptor-meta-runtime-BaRbjvD7-MOhJcdky.mjs.map +0 -1
  98. package/dist/migration-DKoUk2CF.d.mts.map +0 -1
  99. package/dist/migration-factories-BqROEHRs-C4K_DHy7.mjs.map +0 -1
  100. package/dist/mongo-adapter-Bo6ciURK-CGfjLOPh.mjs.map +0 -1
  101. package/dist/mongo-adapter-wvK2fQOZ-BXo5NxEB.d.mts.map +0 -1
  102. package/dist/mongo-driver-CTyvKDUg-bwRH7EDL.d.mts.map +0 -1
  103. package/dist/mongo-driver-q-IqfhuV-CouLzDHp.mjs.map +0 -1
  104. package/dist/mongo-target-errors-Btf3ML1w-B5EMYbz1.mjs.map +0 -1
  105. package/dist/op-factory-call-BoYr7vvM-PXfT4zvm.d.mts.map +0 -1
  106. package/dist/pack-DYR2mrvW.d.mts.map +0 -1
  107. package/dist/prisma6-binding-DRM8QnmA.d.mts.map +0 -1
  108. package/dist/prisma6-binding-WOZ8vURx.mjs.map +0 -1
  109. package/dist/runtime-B9_-kjBX.d.mts.map +0 -1
@@ -1,10 +1,10 @@
1
- import { t as createMongoAdapter } from "./mongo-adapter-wvK2fQOZ-BXo5NxEB.mjs";
1
+ import { t as createMongoAdapter } from "./mongo-adapter-wvK2fQOZ-FswLS-PJ.mjs";
2
2
  import { CodecCallContext } from "@prisma/orm-framework/components/codec";
3
3
  import { MongoCodecRegistry } from "@prisma/orm-family-mongo/codec";
4
4
  import { MongoAggExpr, MongoFilterExpr, MongoPipelineStage } from "@prisma/orm-family-mongo/query-ast/execution";
5
5
  import { Document } from "@prisma/orm-family-mongo/value";
6
6
  import { OperationDescriptor, OperationDescriptors } from "@prisma/orm-framework/operations";
7
- //#region ../../../3-mongo-target/2-mongo-adapter/dist/index.d.mts
7
+ //#region ../../../3-targets/mongo/2-adapter/dist/index.d.mts
8
8
  //#region src/core/operations.d.ts
9
9
  declare const mongoVectorNearOperation: OperationDescriptor;
10
10
  declare const mongoVectorOperationDescriptors: OperationDescriptors;
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.mts","names":[],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/index.d.mts"],"mappings":";;;;;;;;cAOc,0BAA0B;cAC1B,iCAAiC;;;iBAG9B,aAAa,MAAM;iBACnB,YAAY,QAAQ,iBAAiB,QAAQ,oBAAoB,KAAK,mBAAmB,QAAQ;iBACjG,WAAW,OAAO,oBAAoB,QAAQ,oBAAoB,KAAK,mBAAmB,QAAQ;iBAClG,cAAc,QAAQ,cAAc,qBAAqB,QAAQ,oBAAoB,KAAK,mBAAmB,QAAQ,MAAM"}
1
+ {"version":3,"file":"adapter.d.mts","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/index.d.mts"],"mappings":";;;;;;;;cAOc,0BAA0B;cAC1B,iCAAiC;;;iBAG9B,aAAa,MAAM;iBACnB,YAAY,QAAQ,iBAAiB,QAAQ,oBAAoB,KAAK,mBAAmB,QAAQ;iBACjG,WAAW,OAAO,oBAAoB,QAAQ,oBAAoB,KAAK,mBAAmB,QAAQ;iBAClG,cAAc,QAAQ,cAAc,qBAAqB,QAAQ,oBAAoB,KAAK,mBAAmB,QAAQ,MAAM"}
package/dist/adapter.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { p as MONGO_VECTOR_CODEC_ID } from "./codec-ids-WdrumsYA-BkQfspmL.mjs";
2
- import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from "./mongo-adapter-Bo6ciURK-CGfjLOPh.mjs";
3
- //#region ../../../3-mongo-target/2-mongo-adapter/dist/index.mjs
1
+ import { p as MONGO_VECTOR_CODEC_ID } from "./codec-ids-WdrumsYA-CZVjuKW8.mjs";
2
+ import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from "./mongo-adapter-Bo6ciURK-DIMJdC7y.mjs";
3
+ //#region ../../../3-targets/mongo/2-adapter/dist/index.mjs
4
4
  const mongoVectorNearOperation = Object.freeze({
5
5
  self: { codecId: MONGO_VECTOR_CODEC_ID },
6
6
  impl: () => void 0
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.mjs","names":[],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/index.mjs"],"sourcesContent":["import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from \"./mongo-adapter-Bo6ciURK.mjs\";\nimport { MONGO_VECTOR_CODEC_ID } from \"@internal/target-mongo/codec-ids\";\n//#region src/core/operations.ts\nconst mongoVectorNearOperation = Object.freeze({\n\tself: { codecId: MONGO_VECTOR_CODEC_ID },\n\timpl: () => void 0\n});\nconst mongoVectorOperationDescriptors = { near: mongoVectorNearOperation };\n//#endregion\nexport { createMongoAdapter, lowerAggExpr, lowerFilter, lowerPipeline, lowerStage, mongoVectorNearOperation, mongoVectorOperationDescriptors };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;AAGA,MAAM,2BAA2B,OAAO,OAAO;CAC9C,MAAM,EAAE,SAAS,sBAAsB;CACvC,YAAY,KAAK;AAClB,CAAC;AACD,MAAM,kCAAkC,EAAE,MAAM,yBAAyB"}
1
+ {"version":3,"file":"adapter.mjs","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/index.mjs"],"sourcesContent":["import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from \"./mongo-adapter-Bo6ciURK.mjs\";\nimport { MONGO_VECTOR_CODEC_ID } from \"@internal/target-mongo/codec-ids\";\n//#region src/core/operations.ts\nconst mongoVectorNearOperation = Object.freeze({\n\tself: { codecId: MONGO_VECTOR_CODEC_ID },\n\timpl: () => void 0\n});\nconst mongoVectorOperationDescriptors = { near: mongoVectorNearOperation };\n//#endregion\nexport { createMongoAdapter, lowerAggExpr, lowerFilter, lowerPipeline, lowerStage, mongoVectorNearOperation, mongoVectorOperationDescriptors };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;AAGA,MAAM,2BAA2B,OAAO,OAAO;CAC9C,MAAM,EAAE,SAAS,sBAAsB;CACvC,YAAY,KAAK;AAClB,CAAC;AACD,MAAM,kCAAkC,EAAE,MAAM,yBAAyB"}
@@ -1,4 +1,4 @@
1
- import { t as createMongoAdapter } from "./mongo-adapter-wvK2fQOZ-BXo5NxEB.mjs";
1
+ import { t as createMongoAdapter } from "./mongo-adapter-wvK2fQOZ-FswLS-PJ.mjs";
2
2
  import { MongoSchemaIR } from "@prisma/orm-family-mongo/schema-ir";
3
3
  import { AnyMongoDdlCommand, ListCollectionsCommand, ListIndexesCommand, MongoInspectionCommandVisitor } from "@prisma/orm-family-mongo/query-ast/control";
4
4
  import { ControlDriverInstance } from "@prisma/orm-framework/components/control";
@@ -6,8 +6,11 @@ import { ContractMarkerRecord, LedgerEntryRecord } from "@prisma/orm-framework/c
6
6
  import { Db, Document } from "mongodb";
7
7
  import { MongoControlDriverInstance, MongoControlDriverInstance as MongoControlDriverInstance$1, MongoDriver } from "@prisma/orm-family-mongo/lowering";
8
8
  import { MongoControlAdapter, MongoControlAdapterDescriptor, MongoRunnerDependencies } from "@prisma/orm-family-mongo/family/control-adapter";
9
- //#region ../../../3-mongo-target/2-mongo-adapter/dist/control.d.mts
10
- //#region src/core/inspection-executor.d.ts
9
+ //#region ../../../3-targets/mongo/2-adapter/dist/control.d.mts
10
+ //#region src/core/introspect-schema.d.ts
11
+ declare function introspectSchema(db: Db): Promise<MongoSchemaIR>;
12
+ //#endregion
13
+ //#region src/core/migrations/inspection-executor.d.ts
11
14
  /**
12
15
  * Executes the read-only catalog inspections (`listCollections` / `listIndexes`)
13
16
  * that migration prechecks/postchecks and operation preview evaluate, directly
@@ -21,10 +24,7 @@ declare class MongoInspectionExecutor implements MongoInspectionCommandVisitor<P
21
24
  listCollections(_cmd: ListCollectionsCommand): Promise<Document[]>;
22
25
  }
23
26
  //#endregion
24
- //#region src/core/introspect-schema.d.ts
25
- declare function introspectSchema(db: Db): Promise<MongoSchemaIR>;
26
- //#endregion
27
- //#region src/core/mongo-control-adapter.d.ts
27
+ //#region src/core/migrations/mongo-control-adapter.d.ts
28
28
  /**
29
29
  * Mongo control adapter for control-plane operations like introspection
30
30
  * and marker-ledger CAS. Implements the family-level `MongoControlAdapter`
@@ -64,7 +64,7 @@ declare class MongoControlAdapterImpl implements MongoControlAdapter<'mongo'> {
64
64
  createRunnerDependencies(driver: ControlDriverInstance<'mongo', 'mongo'>): MongoRunnerDependencies;
65
65
  }
66
66
  //#endregion
67
- //#region src/core/mongo-control-driver.d.ts
67
+ //#region src/core/migrations/mongo-control-driver.d.ts
68
68
  declare function isMongoControlDriver(driver: ControlDriverInstance<'mongo', string>): driver is MongoControlDriverInstance$1;
69
69
  declare function extractDb(driver: ControlDriverInstance<'mongo', 'mongo'>): Db;
70
70
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__control.d.mts","names":[],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;cAec,mCAAmC,8BAA8B,QAAQ;mBACpE;EACjB,YAAY,IAAI;EAChB,YAAY,KAAK,qBAAqB,QAAQ;EAC9C,gBAAgB,MAAM,yBAAyB,QAAQ;;;;iBAIxC,iBAAiB,IAAI,KAAK,QAAQ;;;;;;;;;;;;cAYrC,mCAAmC;;WAEtC;WACA;EACT,WAAW,QAAQ,aAAa,SAAS,qBAAqB;EAC9D,WAAW,QAAQ,yCAAyC,gBAAgB,QAAQ;EACpF,eAAe,QAAQ,0CAA0C,QAAQ,oBAAoB;EAC7F,WAAW,QAAQ,yCAAyC,eAAe;aAChE;aACA;aACA;MACP;EACJ,aAAa,QAAQ,yCAAyC,eAAe,sBAAsB;aACxF;aACA;aACA;MACP;EACJ,iBAAiB,QAAQ,yCAAyC,eAAe;aACtE;aACA;aACA;aACA;aACA;aACA;MACP;EACJ,WAAW,QAAQ,yCAAyC,iBAAiB,iBAAiB;EAC9F,iBAAiB,QAAQ,0CAA0C,QAAQ;EAC3E,yBAAyB,QAAQ,0CAA0C;;;;iBAI5D,qBAAqB,QAAQ,yCAAyC,UAAU;iBAChF,UAAU,QAAQ,0CAA0C;;;;;;cAM/D;WACH;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;aAEF;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;aAEF;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;aAEF;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;aAEF;eACE;;;;cAID,wBAAwB"}
1
+ {"version":3,"file":"adapter__control.d.mts","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/control.d.mts"],"mappings":";;;;;;;;;;iBASiB,iBAAiB,IAAI,KAAK,QAAQ;;;;;;;;;cASrC,mCAAmC,8BAA8B,QAAQ;mBACpE;EACjB,YAAY,IAAI;EAChB,YAAY,KAAK,qBAAqB,QAAQ;EAC9C,gBAAgB,MAAM,yBAAyB,QAAQ;;;;;;;;;;;;;cAa3C,mCAAmC;;WAEtC;WACA;EACT,WAAW,QAAQ,aAAa,SAAS,qBAAqB;EAC9D,WAAW,QAAQ,yCAAyC,gBAAgB,QAAQ;EACpF,eAAe,QAAQ,0CAA0C,QAAQ,oBAAoB;EAC7F,WAAW,QAAQ,yCAAyC,eAAe;aAChE;aACA;aACA;MACP;EACJ,aAAa,QAAQ,yCAAyC,eAAe,sBAAsB;aACxF;aACA;aACA;MACP;EACJ,iBAAiB,QAAQ,yCAAyC,eAAe;aACtE;aACA;aACA;aACA;aACA;aACA;MACP;EACJ,WAAW,QAAQ,yCAAyC,iBAAiB,iBAAiB;EAC9F,iBAAiB,QAAQ,0CAA0C,QAAQ;EAC3E,yBAAyB,QAAQ,0CAA0C;;;;iBAI5D,qBAAqB,QAAQ,yCAAyC,UAAU;iBAChF,UAAU,QAAQ,0CAA0C;;;;;;cAM/D;WACH;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;aAEF;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;aAEF;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;aAEF;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;aAEF;eACE;;;;cAID,wBAAwB"}
@@ -1,5 +1,5 @@
1
- import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_OBJECTID_CODEC_ID, f as MONGO_STRING_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DOUBLE_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_INT32_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_JSON_CODEC_ID } from "./codec-ids-WdrumsYA-BkQfspmL.mjs";
2
- import { t as createMongoAdapter } from "./mongo-adapter-Bo6ciURK-CGfjLOPh.mjs";
1
+ import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_OBJECTID_CODEC_ID, f as MONGO_STRING_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DOUBLE_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_INT32_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_JSON_CODEC_ID } from "./codec-ids-WdrumsYA-CZVjuKW8.mjs";
2
+ import { t as createMongoAdapter } from "./mongo-adapter-Bo6ciURK-DIMJdC7y.mjs";
3
3
  import { structuredError } from "@prisma/orm-framework/utils/structured-error";
4
4
  import { type } from "arktype";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
@@ -7,33 +7,11 @@ import { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, Mon
7
7
  import { MongoAggFieldRef, MongoAggLiteral, MongoAggOperator } from "@prisma/orm-family-mongo/query-ast/execution";
8
8
  import { expr, fn } from "@prisma/orm-family-mongo/query-builder";
9
9
  import { collection } from "@prisma/orm-family-mongo/query-builder/contract-free";
10
+ import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
10
11
  import { MongoServerError } from "mongodb";
11
12
  import { parseMarkerRowSafely, withMarkerReadErrorHandling } from "@prisma/orm-framework/errors/execution";
12
13
  import { ledgerOriginFromStored } from "@prisma/orm-toolchain/migration-tools/ledger-origin";
13
- //#region ../../../3-mongo-target/2-mongo-adapter/dist/control.mjs
14
- /**
15
- * Executes the read-only catalog inspections (`listCollections` / `listIndexes`)
16
- * that migration prechecks/postchecks and operation preview evaluate, directly
17
- * against `db`. Routing these checks through the adapter's lowering seam is
18
- * deferred to the `typed-migration-verification-queries` slice.
19
- */
20
- var MongoInspectionExecutor = class {
21
- db;
22
- constructor(db) {
23
- this.db = db;
24
- }
25
- async listIndexes(cmd) {
26
- try {
27
- return await this.db.collection(cmd.collection).listIndexes().toArray();
28
- } catch (error) {
29
- if (error instanceof MongoServerError && error.code === 26) return [];
30
- throw error;
31
- }
32
- }
33
- async listCollections(_cmd) {
34
- return this.db.listCollections().toArray();
35
- }
36
- };
14
+ //#region ../../../3-targets/mongo/2-adapter/dist/control.mjs
37
15
  const PRISMA_MIGRATIONS_COLLECTION = "_prisma_migrations";
38
16
  function parseIndexKeys(keySpec) {
39
17
  const keys = [];
@@ -123,6 +101,29 @@ async function introspectSchema(db) {
123
101
  }
124
102
  return new MongoSchemaIR(collections);
125
103
  }
104
+ /**
105
+ * Executes the read-only catalog inspections (`listCollections` / `listIndexes`)
106
+ * that migration prechecks/postchecks and operation preview evaluate, directly
107
+ * against `db`. Routing these checks through the adapter's lowering seam is
108
+ * deferred to the `typed-migration-verification-queries` slice.
109
+ */
110
+ var MongoInspectionExecutor = class {
111
+ db;
112
+ constructor(db) {
113
+ this.db = db;
114
+ }
115
+ async listIndexes(cmd) {
116
+ try {
117
+ return await this.db.collection(cmd.collection).listIndexes().toArray();
118
+ } catch (error) {
119
+ if (error instanceof MongoServerError && error.code === 26) return [];
120
+ throw error;
121
+ }
122
+ }
123
+ async listCollections(_cmd) {
124
+ return this.db.listCollections().toArray();
125
+ }
126
+ };
126
127
  function mongoAdapterError(code, message, options) {
127
128
  return structuredError(code, message, options);
128
129
  }
@@ -254,7 +255,7 @@ var MongoControlAdapterImpl = class {
254
255
  }
255
256
  async readAllMarkers(driver) {
256
257
  const docs = await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.type("string")).match((f) => f.space.type("string")).match((f) => expr(fn.eq(f._id, f.space))).build()), {
257
- space: "app",
258
+ space: APP_SPACE_ID,
258
259
  markerLocation: MONGO_MARKER_COLLECTION
259
260
  });
260
261
  const out = /* @__PURE__ */ new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__control.mjs","names":["#execute","#adapter","#markerLedgerCollection","#invariantMergeExpr"],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/control.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-Bo6ciURK.mjs\";\nimport { MONGO_BINARY_CODEC_ID, MONGO_BOOLEAN_CODEC_ID, MONGO_BSON_CODEC_ID, MONGO_DATE_CODEC_ID, MONGO_DECIMAL128_CODEC_ID, MONGO_DOUBLE_CODEC_ID, MONGO_INT32_CODEC_ID, MONGO_INT64_CODEC_ID, MONGO_INT64_NUMBER_CODEC_ID, MONGO_JSON_CODEC_ID, MONGO_OBJECTID_CODEC_ID, MONGO_STRING_CODEC_ID } from \"@internal/target-mongo/codec-ids\";\nimport { MongoAggFieldRef, MongoAggLiteral, MongoAggOperator } from \"@internal/mongo-query-ast/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { MongoServerError } from \"mongodb\";\nimport { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, MongoSchemaIndex, MongoSchemaValidator } from \"@internal/mongo-schema-ir\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { ledgerOriginFromStored } from \"@internal/migration-tools/ledger-origin\";\nimport { expr, fn } from \"@internal/mongo-query-builder\";\nimport { collection } from \"@internal/mongo-query-builder/contract-free\";\nimport { type } from \"arktype\";\n//#region src/core/inspection-executor.ts\n/**\n* Executes the read-only catalog inspections (`listCollections` / `listIndexes`)\n* that migration prechecks/postchecks and operation preview evaluate, directly\n* against `db`. Routing these checks through the adapter's lowering seam is\n* deferred to the `typed-migration-verification-queries` slice.\n*/\nvar MongoInspectionExecutor = class {\n\tdb;\n\tconstructor(db) {\n\t\tthis.db = db;\n\t}\n\tasync listIndexes(cmd) {\n\t\ttry {\n\t\t\treturn await this.db.collection(cmd.collection).listIndexes().toArray();\n\t\t} catch (error) {\n\t\t\tif (error instanceof MongoServerError && error.code === 26) return [];\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync listCollections(_cmd) {\n\t\treturn this.db.listCollections().toArray();\n\t}\n};\n//#endregion\n//#region src/core/introspect-schema.ts\nconst PRISMA_MIGRATIONS_COLLECTION = \"_prisma_migrations\";\nfunction parseIndexKeys(keySpec) {\n\tconst keys = [];\n\tfor (const [field, direction] of Object.entries(keySpec)) keys.push({\n\t\tfield,\n\t\tdirection\n\t});\n\treturn keys;\n}\n/**\n* Exported for unit tests to exercise the defensive `!key` guard; not part of\n* the public API. Callers in this package use it via the `introspectSchema`\n* pipeline only.\n*/\nfunction isDefaultIdIndex(doc) {\n\tconst key = doc[\"key\"];\n\tif (!key) return false;\n\tconst entries = Object.entries(key);\n\treturn entries.length === 1 && entries[0]?.[0] === \"_id\" && entries[0]?.[1] === 1;\n}\nfunction parseIndex(doc) {\n\tconst keySpec = doc[\"key\"];\n\treturn new MongoSchemaIndex({\n\t\tkeys: parseIndexKeys(keySpec),\n\t\tunique: doc[\"unique\"],\n\t\tsparse: doc[\"sparse\"],\n\t\texpireAfterSeconds: doc[\"expireAfterSeconds\"],\n\t\tpartialFilterExpression: doc[\"partialFilterExpression\"],\n\t\twildcardProjection: doc[\"wildcardProjection\"],\n\t\tcollation: doc[\"collation\"] ? blindCast(doc[\"collation\"]) : void 0,\n\t\tweights: doc[\"weights\"],\n\t\tdefault_language: doc[\"default_language\"],\n\t\tlanguage_override: doc[\"language_override\"]\n\t});\n}\nfunction parseValidator(options) {\n\tconst validator = options[\"validator\"];\n\tif (!validator) return void 0;\n\tconst jsonSchema = validator[\"$jsonSchema\"];\n\tif (!jsonSchema) return void 0;\n\treturn new MongoSchemaValidator({\n\t\tjsonSchema,\n\t\tvalidationLevel: options[\"validationLevel\"] ?? \"strict\",\n\t\tvalidationAction: options[\"validationAction\"] ?? \"error\"\n\t});\n}\nfunction parseCollectionOptions(info) {\n\tconst options = info[\"options\"];\n\tif (!options) return void 0;\n\tconst capped = options[\"capped\"];\n\tconst size = options[\"size\"];\n\tconst max = options[\"max\"];\n\tconst timeseries = options[\"timeseries\"];\n\tconst collation = options[\"collation\"] ? blindCast(options[\"collation\"]) : void 0;\n\tconst changeStreamPreAndPostImages = options[\"changeStreamPreAndPostImages\"];\n\tconst clusteredIndex = options[\"clusteredIndex\"];\n\tif (!(capped || timeseries || collation || changeStreamPreAndPostImages || clusteredIndex)) return void 0;\n\treturn new MongoSchemaCollectionOptions({\n\t\t...capped ? { capped: {\n\t\t\tsize: size ?? 0,\n\t\t\t...max != null ? { max } : {}\n\t\t} } : {},\n\t\t...timeseries ? { timeseries } : {},\n\t\t...collation ? { collation } : {},\n\t\t...changeStreamPreAndPostImages ? { changeStreamPreAndPostImages } : {},\n\t\t...clusteredIndex ? { clusteredIndex } : {}\n\t});\n}\nasync function introspectSchema(db) {\n\tconst collectionInfos = await db.listCollections().toArray();\n\tconst collections = [];\n\tfor (const info of collectionInfos) {\n\t\tconst name = info[\"name\"];\n\t\tconst type = info[\"type\"];\n\t\tif (name === PRISMA_MIGRATIONS_COLLECTION) continue;\n\t\tif (name.startsWith(\"system.\")) continue;\n\t\tif (type === \"view\") continue;\n\t\tconst indexes = (await db.collection(name).listIndexes().toArray()).filter((doc) => !isDefaultIdIndex(doc)).map(parseIndex);\n\t\tconst validator = parseValidator(\"options\" in info ? info[\"options\"] : {});\n\t\tconst options = parseCollectionOptions(info);\n\t\tcollections.push(new MongoSchemaCollection({\n\t\t\tname,\n\t\t\tindexes,\n\t\t\t...validator ? { validator } : {},\n\t\t\t...options ? { options } : {}\n\t\t}));\n\t}\n\treturn new MongoSchemaIR(collections);\n}\n//#endregion\n//#region src/core/errors.ts\nfunction mongoAdapterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\nfunction describeReceivedValue(value) {\n\tif (value === null) return \"null\";\n\tif (typeof value !== \"object\") return typeof value;\n\treturn `object with keys [${Object.keys(value).join(\", \")}]`;\n}\n//#endregion\n//#region src/core/marker-ledger.ts\nconst COLLECTION = \"_prisma_migrations\";\nconst MONGO_MARKER_COLLECTION = `_prisma_migrations marker documents in ${COLLECTION}`;\nconst MONGO_LEDGER_COLLECTION = `_prisma_migrations ledger documents in ${COLLECTION}`;\nconst MongoMarkerDocSchema = type({\n\tspace: \"string\",\n\tstorageHash: \"string\",\n\tprofileHash: \"string\",\n\t\"contractJson?\": \"unknown | null\",\n\t\"canonicalVersion?\": \"number | null\",\n\t\"updatedAt?\": \"Date\",\n\t\"appTag?\": \"string | null\",\n\t\"meta?\": type({ \"[string]\": \"unknown\" }).or(\"null\"),\n\t\"invariants?\": type(\"string\").array(),\n\t\"+\": \"delete\"\n});\nfunction parseMongoMarkerDoc(doc) {\n\tconst result = MongoMarkerDocSchema(doc);\n\tif (result instanceof type.errors) throw mongoAdapterError(\"CONTRACT.MARKER_ROW_CORRUPT\", `Invalid marker doc on ${COLLECTION}: ${result.summary}`, { meta: {\n\t\tcollection: COLLECTION,\n\t\tdetail: result.summary\n\t} });\n\treturn {\n\t\tstorageHash: result.storageHash,\n\t\tprofileHash: result.profileHash,\n\t\tcontractJson: result.contractJson ?? null,\n\t\tcanonicalVersion: result.canonicalVersion ?? null,\n\t\tupdatedAt: result.updatedAt ?? /* @__PURE__ */ new Date(),\n\t\tappTag: result.appTag ?? null,\n\t\tmeta: result.meta ?? {},\n\t\tinvariants: result.invariants ?? []\n\t};\n}\nfunction parseMongoMarkerDocSafely(doc, space) {\n\treturn parseMarkerRowSafely(doc, parseMongoMarkerDoc, {\n\t\tspace,\n\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t});\n}\n//#endregion\n//#region src/core/marker-ledger-collection.ts\nconst MARKER_LEDGER_COLLECTION = \"_prisma_migrations\";\n//#endregion\n//#region src/core/mongo-control-driver.ts\nfunction isMongoControlDriver(driver) {\n\treturn driver.familyId === \"mongo\" && driver.targetId === \"mongo\" && \"execute\" in driver && typeof driver.execute === \"function\";\n}\nfunction requireMongoControlDriver(driver) {\n\tif (!isMongoControlDriver(driver)) throw mongoAdapterError(\"CONFIG.VALIDATION_FAILED\", \"Expected a Mongo control driver created by mongoControlDriver.create() from `@internal/driver-mongo/control`.\", { meta: { received: describeReceivedValue(driver) } });\n\treturn driver;\n}\nfunction extractDb(driver) {\n\treturn requireMongoControlDriver(driver).db;\n}\n//#endregion\n//#region src/core/mongo-control-adapter.ts\n/**\n* Mongo control adapter for control-plane operations like introspection\n* and marker-ledger CAS. Implements the family-level `MongoControlAdapter`\n* SPI. Every marker/ledger operation builds a canonical command inline via\n* the contract-free fluent builder and dispatches it through the family\n* adapter's lowering path (`createMongoAdapter().lower(plan, {})`) onto the\n* Mongo wire transport (`driver.execute(wireCommand)`) — the same route SQL\n* marker/ledger ops take through `adapter.lower()` → `driver.query()`.\n*/\nvar MongoControlAdapterImpl = class {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\t#adapter = createMongoAdapter();\n\t#markerLedgerCollection = collection(MARKER_LEDGER_COLLECTION);\n\tasync #execute(driver, command) {\n\t\tconst plan = {\n\t\t\tcollection: MARKER_LEDGER_COLLECTION,\n\t\t\tcommand,\n\t\t\tmeta: {\n\t\t\t\ttarget: \"mongo\",\n\t\t\t\ttargetFamily: \"mongo\",\n\t\t\t\tstorageHash: \"\",\n\t\t\t\tlane: \"control\"\n\t\t\t}\n\t\t};\n\t\tconst wireCommand = await this.#adapter.lower(plan, {});\n\t\tif (!isMongoControlDriver(driver)) throw mongoAdapterError(\"CONFIG.VALIDATION_FAILED\", \"Mongo control adapter requires a Mongo control driver with an execute() transport. Provide a MongoControlDriver from `@internal/driver-mongo/control`.\", { meta: { received: describeReceivedValue(driver) } });\n\t\tconst rows = [];\n\t\tfor await (const row of driver.execute(wireCommand)) rows.push(row);\n\t\treturn rows;\n\t}\n\tasync executeDdl(driver, command) {\n\t\tconst wire = await this.#adapter.lower({ command }, {});\n\t\tawait driver.run(wire);\n\t}\n\t/**\n\t* Server-side invariant-merge aggregation expression:\n\t* `$sortArray({ input: $setUnion([$ifNull('$invariants', []), incoming]), sortBy: 1 })`.\n\t*\n\t* Built through the typed agg-expr layer — `fn.setUnion` plus the generic\n\t* `MongoAggOperator` for `$ifNull` / `$sortArray` (neither has a named `fn`\n\t* helper). Returns a `MongoAggOperator` that is passed directly to\n\t* `f.stage.set({ invariants: ... })` in the update pipeline.\n\t*/\n\t#invariantMergeExpr(incoming) {\n\t\tconst existingOrEmpty = MongoAggOperator.of(\"$ifNull\", [MongoAggFieldRef.of(\"invariants\"), MongoAggLiteral.of([])]);\n\t\tconst merged = fn.setUnion({\n\t\t\t_field: {\n\t\t\t\tcodecId: \"mongo/array@1\",\n\t\t\t\tnullable: false\n\t\t\t},\n\t\t\tnode: existingOrEmpty\n\t\t}, {\n\t\t\t_field: {\n\t\t\t\tcodecId: \"mongo/array@1\",\n\t\t\t\tnullable: false\n\t\t\t},\n\t\t\tnode: MongoAggLiteral.of([...incoming])\n\t\t});\n\t\treturn MongoAggOperator.of(\"$sortArray\", {\n\t\t\tinput: merged.node,\n\t\t\tsortBy: MongoAggLiteral.of(1)\n\t\t});\n\t}\n\tasync readMarker(driver, space) {\n\t\tconst doc = (await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.eq(space)).match((f) => f.space.eq(space)).limit(1).build()), {\n\t\t\tspace,\n\t\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t\t}))[0];\n\t\tif (!doc) return null;\n\t\treturn parseMongoMarkerDocSafely(doc, space);\n\t}\n\tasync readAllMarkers(driver) {\n\t\tconst docs = await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.type(\"string\")).match((f) => f.space.type(\"string\")).match((f) => expr(fn.eq(f._id, f.space))).build()), {\n\t\t\tspace: \"app\",\n\t\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t\t});\n\t\tconst out = /* @__PURE__ */ new Map();\n\t\tfor (const doc of docs) {\n\t\t\tconst space = doc[\"space\"];\n\t\t\t/* v8 ignore next -- @preserve type-narrowing guard: the $match stage above filters on `space: { $type: 'string' }`, so this branch is unreachable at runtime. The check exists so the `out.set(space, ...)` call below can accept `string`. */\n\t\t\tif (typeof space !== \"string\") continue;\n\t\t\tout.set(space, parseMongoMarkerDocSafely(doc, space));\n\t\t}\n\t\treturn out;\n\t}\n\tasync initMarker(driver, space, destination) {\n\t\tconst document = {\n\t\t\t_id: space,\n\t\t\tspace,\n\t\t\tstorageHash: destination.storageHash,\n\t\t\tprofileHash: destination.profileHash,\n\t\t\tcontractJson: null,\n\t\t\tcanonicalVersion: null,\n\t\t\tupdatedAt: /* @__PURE__ */ new Date(),\n\t\t\tappTag: null,\n\t\t\tmeta: {},\n\t\t\tinvariants: [...destination.invariants ?? []]\n\t\t};\n\t\tawait this.#execute(driver, this.#markerLedgerCollection.insertOne(document));\n\t}\n\tasync updateMarker(driver, space, expectedFrom, destination) {\n\t\tconst { invariants } = destination;\n\t\treturn (await this.#execute(driver, this.#markerLedgerCollection.match((f) => f._id.eq(space)).match((f) => f.space.eq(space)).match((f) => f.storageHash.eq(expectedFrom)).findOneAndUpdate((f) => [f.stage.set(invariants === void 0 ? {\n\t\t\tstorageHash: MongoAggLiteral.of(destination.storageHash),\n\t\t\tprofileHash: MongoAggLiteral.of(destination.profileHash),\n\t\t\tupdatedAt: MongoAggLiteral.of(/* @__PURE__ */ new Date())\n\t\t} : {\n\t\t\tstorageHash: MongoAggLiteral.of(destination.storageHash),\n\t\t\tprofileHash: MongoAggLiteral.of(destination.profileHash),\n\t\t\tupdatedAt: MongoAggLiteral.of(/* @__PURE__ */ new Date()),\n\t\t\tinvariants: this.#invariantMergeExpr(invariants)\n\t\t})], { upsert: false }))).length > 0;\n\t}\n\tasync writeLedgerEntry(driver, space, entry) {\n\t\tconst document = {\n\t\t\ttype: \"ledger\",\n\t\t\tspace,\n\t\t\tedgeId: entry.edgeId,\n\t\t\tfrom: entry.from,\n\t\t\tto: entry.to,\n\t\t\tmigrationName: entry.migrationName,\n\t\t\tmigrationHash: entry.migrationHash,\n\t\t\toperations: blindCast(entry.operations),\n\t\t\tappliedAt: /* @__PURE__ */ new Date()\n\t\t};\n\t\tawait this.#execute(driver, this.#markerLedgerCollection.insertOne(document));\n\t}\n\tasync readLedger(driver, space) {\n\t\tconst ledgerContext = {\n\t\t\tspace: space ?? \"*\",\n\t\t\tmarkerLocation: MONGO_LEDGER_COLLECTION\n\t\t};\n\t\tconst chain = this.#markerLedgerCollection.aggregate().match((f) => f.type.eq(\"ledger\"));\n\t\tconst command = space === void 0 ? chain.sort({ _id: 1 }).build() : chain.match((f) => f.space.eq(space)).sort({ _id: 1 }).build();\n\t\tconst docs = await withMarkerReadErrorHandling(() => this.#execute(driver, command), ledgerContext);\n\t\tconst entries = [];\n\t\tfor (const doc of docs) {\n\t\t\tconst migrationName = doc[\"migrationName\"];\n\t\t\tconst migrationHash = doc[\"migrationHash\"];\n\t\t\tconst from = doc[\"from\"];\n\t\t\tconst to = doc[\"to\"];\n\t\t\tconst docSpace = doc[\"space\"];\n\t\t\tif (typeof migrationName !== \"string\" || typeof migrationHash !== \"string\") continue;\n\t\t\tif (typeof from !== \"string\" || typeof to !== \"string\") continue;\n\t\t\tif (typeof docSpace !== \"string\") continue;\n\t\t\tconst appliedAt = doc[\"appliedAt\"];\n\t\t\tconst appliedAtDate = appliedAt instanceof Date ? appliedAt : appliedAt !== void 0 ? new Date(String(appliedAt)) : /* @__PURE__ */ new Date();\n\t\t\tconst operations = doc[\"operations\"];\n\t\t\tconst opList = Array.isArray(operations) ? operations : [];\n\t\t\tentries.push({\n\t\t\t\tspace: docSpace,\n\t\t\t\tmigrationName,\n\t\t\t\tmigrationHash,\n\t\t\t\tfrom: ledgerOriginFromStored(from),\n\t\t\t\tto,\n\t\t\t\tappliedAt: appliedAtDate,\n\t\t\t\toperationCount: opList.length\n\t\t\t});\n\t\t}\n\t\treturn entries;\n\t}\n\tasync introspectSchema(driver) {\n\t\treturn introspectSchema(extractDb(driver));\n\t}\n\tcreateRunnerDependencies(driver) {\n\t\tconst controlDriver = requireMongoControlDriver(driver);\n\t\treturn {\n\t\t\tinspectionExecutor: new MongoInspectionExecutor(controlDriver.db),\n\t\t\tadapter: this.#adapter,\n\t\t\tdriver: controlDriver,\n\t\t\texecuteDdl: (command) => this.executeDdl(controlDriver, command),\n\t\t\tmarkerOps: {\n\t\t\t\treadMarker: (space) => this.readMarker(controlDriver, space),\n\t\t\t\tinitMarker: (space, destination) => this.initMarker(controlDriver, space, destination),\n\t\t\t\tupdateMarker: (space, expectedFrom, destination) => this.updateMarker(controlDriver, space, expectedFrom, destination),\n\t\t\t\twriteLedgerEntry: (space, entry) => this.writeLedgerEntry(controlDriver, space, entry)\n\t\t\t},\n\t\t\tintrospectSchema: () => this.introspectSchema(controlDriver)\n\t\t};\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring channel. Each names a codec; the collection validator reads the BSON types from the data type the codec represents, not from the constructor.\n*/\nconst mongoScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Text, stored as BSON string.\",\n\t\toutput: { codecId: MONGO_STRING_CODEC_ID }\n\t},\n\tInt32: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 32-bit integer, stored as BSON int.\",\n\t\toutput: { codecId: MONGO_INT32_CODEC_ID }\n\t},\n\tBool: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A true or false value, stored as BSON bool.\",\n\t\toutput: { codecId: MONGO_BOOLEAN_CODEC_ID }\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A date and time with millisecond precision, stored as BSON date.\",\n\t\toutput: { codecId: MONGO_DATE_CODEC_ID }\n\t},\n\tObjectId: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A 12-byte MongoDB identifier, stored as BSON objectId.\",\n\t\toutput: { codecId: MONGO_OBJECTID_CODEC_ID }\n\t},\n\tDouble: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A double-precision floating-point number, stored as BSON double.\",\n\t\toutput: { codecId: MONGO_DOUBLE_CODEC_ID }\n\t},\n\tInt64: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 64-bit integer read as a bigint, stored as BSON long.\",\n\t\toutput: { codecId: MONGO_INT64_CODEC_ID }\n\t},\n\tInt64Number: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 64-bit integer read as a JavaScript number within its safe integer range, stored as BSON long.\",\n\t\toutput: { codecId: MONGO_INT64_NUMBER_CODEC_ID }\n\t},\n\tDecimal128: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A 128-bit decimal read as decimal text without an exponent, stored as BSON decimal.\",\n\t\toutput: { codecId: MONGO_DECIMAL128_CODEC_ID }\n\t},\n\tBinary: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Bytes read as a Uint8Array, stored as BSON binData.\",\n\t\toutput: { codecId: MONGO_BINARY_CODEC_ID }\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value, stored as BSON object, array, string, double, int, long, bool or null; the collection validator admits only those types at the top level, and the codec refuses anything else at any depth.\",\n\t\toutput: { codecId: MONGO_JSON_CODEC_ID }\n\t},\n\tBson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Any BSON value, read as BsonValue; the collection validator does not constrain it.\",\n\t\toutput: { codecId: MONGO_BSON_CODEC_ID }\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Deprecated: use Int32. A signed 32-bit integer, stored as BSON int.\",\n\t\toutput: { codecId: MONGO_INT32_CODEC_ID },\n\t\tdeprecated: { replacement: \"Int32\" }\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Deprecated: use Double. A double-precision floating-point number, stored as BSON double.\",\n\t\toutput: { codecId: MONGO_DOUBLE_CODEC_ID },\n\t\tdeprecated: { replacement: \"Double\" }\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Deprecated: use Bool. A true or false value, stored as BSON bool.\",\n\t\toutput: { codecId: MONGO_BOOLEAN_CODEC_ID },\n\t\tdeprecated: { replacement: \"Bool\" }\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Deprecated: use Date. A date and time with millisecond precision, stored as BSON date.\",\n\t\toutput: { codecId: MONGO_DATE_CODEC_ID },\n\t\tdeprecated: { replacement: \"Date\" }\n\t}\n};\nconst mongoAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\tauthoring: { type: mongoScalarAuthoringTypes },\n\ttypes: { codecTypes: {\n\t\timport: {\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"CodecTypes\",\n\t\t\talias: \"MongoCodecTypes\"\n\t\t},\n\t\tparameterizedOutputTypes: {\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"ParameterizedOutputTypesForTypeParams\",\n\t\t\talias: \"MongoParameterizedOutputTypes\"\n\t\t}\n\t} },\n\tcreate(_stack) {\n\t\treturn new MongoControlAdapterImpl();\n\t}\n};\n//#endregion\nexport { MongoControlAdapterImpl, MongoInspectionExecutor, createMongoAdapter, mongoAdapterDescriptor as default, mongoAdapterDescriptor, extractDb, introspectSchema, isMongoControlDriver, mongoScalarAuthoringTypes };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,IAAI,0BAA0B,MAAM;CACnC;CACA,YAAY,IAAI;EACf,KAAK,KAAK;CACX;CACA,MAAM,YAAY,KAAK;EACtB,IAAI;GACH,OAAO,MAAM,KAAK,GAAG,WAAW,IAAI,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ;EACvE,SAAS,OAAO;GACf,IAAI,iBAAiB,oBAAoB,MAAM,SAAS,IAAI,OAAO,CAAC;GACpE,MAAM;EACP;CACD;CACA,MAAM,gBAAgB,MAAM;EAC3B,OAAO,KAAK,GAAG,gBAAgB,CAAC,CAAC,QAAQ;CAC1C;AACD;AAGA,MAAM,+BAA+B;AACrC,SAAS,eAAe,SAAS;CAChC,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,OAAO,cAAc,OAAO,QAAQ,OAAO,GAAG,KAAK,KAAK;EACnE;EACA;CACD,CAAC;CACD,OAAO;AACR;;;;;;AAMA,SAAS,iBAAiB,KAAK;CAC9B,MAAM,MAAM,IAAI;CAChB,IAAI,CAAC,KAAK,OAAO;CACjB,MAAM,UAAU,OAAO,QAAQ,GAAG;CAClC,OAAO,QAAQ,WAAW,KAAK,QAAQ,EAA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AAe;EACf,QAAQ,EAAE,SAAS,oBAAoB;EACvC,YAAY,EAAE,aAAa,OAAO;CACnC;AACD;AACA,MAAM,yBAAyB;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,WAAW,EAAE,MAAM,0BAA0B;CAC7C,OAAO,EAAE,YAAY;EACpB,QAAQ;GACP,SAAS;GACT,OAAO;GACP,OAAO;EACR;EACA,0BAA0B;GACzB,SAAS;GACT,OAAO;GACP,OAAO;EACR;CACD,EAAE;CACF,OAAO,QAAQ;EACd,OAAO,IAAI,wBAAwB;CACpC;AACD"}
1
+ {"version":3,"file":"adapter__control.mjs","names":["#execute","#adapter","#markerLedgerCollection","#invariantMergeExpr"],"sources":["../../../../3-targets/mongo/2-adapter/dist/control.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-Bo6ciURK.mjs\";\nimport { MONGO_BINARY_CODEC_ID, MONGO_BOOLEAN_CODEC_ID, MONGO_BSON_CODEC_ID, MONGO_DATE_CODEC_ID, MONGO_DECIMAL128_CODEC_ID, MONGO_DOUBLE_CODEC_ID, MONGO_INT32_CODEC_ID, MONGO_INT64_CODEC_ID, MONGO_INT64_NUMBER_CODEC_ID, MONGO_JSON_CODEC_ID, MONGO_OBJECTID_CODEC_ID, MONGO_STRING_CODEC_ID } from \"@internal/target-mongo/codec-ids\";\nimport { MongoAggFieldRef, MongoAggLiteral, MongoAggOperator } from \"@internal/mongo-query-ast/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, MongoSchemaIndex, MongoSchemaValidator } from \"@internal/mongo-schema-ir\";\nimport { MongoServerError } from \"mongodb\";\nimport { parseMarkerRowSafely, withMarkerReadErrorHandling } from \"@internal/errors/execution\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { ledgerOriginFromStored } from \"@internal/migration-tools/ledger-origin\";\nimport { expr, fn } from \"@internal/mongo-query-builder\";\nimport { collection } from \"@internal/mongo-query-builder/contract-free\";\nimport { type } from \"arktype\";\n//#region src/core/introspect-schema.ts\nconst PRISMA_MIGRATIONS_COLLECTION = \"_prisma_migrations\";\nfunction parseIndexKeys(keySpec) {\n\tconst keys = [];\n\tfor (const [field, direction] of Object.entries(keySpec)) keys.push({\n\t\tfield,\n\t\tdirection\n\t});\n\treturn keys;\n}\n/**\n* Exported for unit tests to exercise the defensive `!key` guard; not part of\n* the public API. Callers in this package use it via the `introspectSchema`\n* pipeline only.\n*/\nfunction isDefaultIdIndex(doc) {\n\tconst key = doc[\"key\"];\n\tif (!key) return false;\n\tconst entries = Object.entries(key);\n\treturn entries.length === 1 && entries[0]?.[0] === \"_id\" && entries[0]?.[1] === 1;\n}\nfunction parseIndex(doc) {\n\tconst keySpec = doc[\"key\"];\n\treturn new MongoSchemaIndex({\n\t\tkeys: parseIndexKeys(keySpec),\n\t\tunique: doc[\"unique\"],\n\t\tsparse: doc[\"sparse\"],\n\t\texpireAfterSeconds: doc[\"expireAfterSeconds\"],\n\t\tpartialFilterExpression: doc[\"partialFilterExpression\"],\n\t\twildcardProjection: doc[\"wildcardProjection\"],\n\t\tcollation: doc[\"collation\"] ? blindCast(doc[\"collation\"]) : void 0,\n\t\tweights: doc[\"weights\"],\n\t\tdefault_language: doc[\"default_language\"],\n\t\tlanguage_override: doc[\"language_override\"]\n\t});\n}\nfunction parseValidator(options) {\n\tconst validator = options[\"validator\"];\n\tif (!validator) return void 0;\n\tconst jsonSchema = validator[\"$jsonSchema\"];\n\tif (!jsonSchema) return void 0;\n\treturn new MongoSchemaValidator({\n\t\tjsonSchema,\n\t\tvalidationLevel: options[\"validationLevel\"] ?? \"strict\",\n\t\tvalidationAction: options[\"validationAction\"] ?? \"error\"\n\t});\n}\nfunction parseCollectionOptions(info) {\n\tconst options = info[\"options\"];\n\tif (!options) return void 0;\n\tconst capped = options[\"capped\"];\n\tconst size = options[\"size\"];\n\tconst max = options[\"max\"];\n\tconst timeseries = options[\"timeseries\"];\n\tconst collation = options[\"collation\"] ? blindCast(options[\"collation\"]) : void 0;\n\tconst changeStreamPreAndPostImages = options[\"changeStreamPreAndPostImages\"];\n\tconst clusteredIndex = options[\"clusteredIndex\"];\n\tif (!(capped || timeseries || collation || changeStreamPreAndPostImages || clusteredIndex)) return void 0;\n\treturn new MongoSchemaCollectionOptions({\n\t\t...capped ? { capped: {\n\t\t\tsize: size ?? 0,\n\t\t\t...max != null ? { max } : {}\n\t\t} } : {},\n\t\t...timeseries ? { timeseries } : {},\n\t\t...collation ? { collation } : {},\n\t\t...changeStreamPreAndPostImages ? { changeStreamPreAndPostImages } : {},\n\t\t...clusteredIndex ? { clusteredIndex } : {}\n\t});\n}\nasync function introspectSchema(db) {\n\tconst collectionInfos = await db.listCollections().toArray();\n\tconst collections = [];\n\tfor (const info of collectionInfos) {\n\t\tconst name = info[\"name\"];\n\t\tconst type = info[\"type\"];\n\t\tif (name === PRISMA_MIGRATIONS_COLLECTION) continue;\n\t\tif (name.startsWith(\"system.\")) continue;\n\t\tif (type === \"view\") continue;\n\t\tconst indexes = (await db.collection(name).listIndexes().toArray()).filter((doc) => !isDefaultIdIndex(doc)).map(parseIndex);\n\t\tconst validator = parseValidator(\"options\" in info ? info[\"options\"] : {});\n\t\tconst options = parseCollectionOptions(info);\n\t\tcollections.push(new MongoSchemaCollection({\n\t\t\tname,\n\t\t\tindexes,\n\t\t\t...validator ? { validator } : {},\n\t\t\t...options ? { options } : {}\n\t\t}));\n\t}\n\treturn new MongoSchemaIR(collections);\n}\n//#endregion\n//#region src/core/migrations/inspection-executor.ts\n/**\n* Executes the read-only catalog inspections (`listCollections` / `listIndexes`)\n* that migration prechecks/postchecks and operation preview evaluate, directly\n* against `db`. Routing these checks through the adapter's lowering seam is\n* deferred to the `typed-migration-verification-queries` slice.\n*/\nvar MongoInspectionExecutor = class {\n\tdb;\n\tconstructor(db) {\n\t\tthis.db = db;\n\t}\n\tasync listIndexes(cmd) {\n\t\ttry {\n\t\t\treturn await this.db.collection(cmd.collection).listIndexes().toArray();\n\t\t} catch (error) {\n\t\t\tif (error instanceof MongoServerError && error.code === 26) return [];\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync listCollections(_cmd) {\n\t\treturn this.db.listCollections().toArray();\n\t}\n};\n//#endregion\n//#region src/core/errors.ts\nfunction mongoAdapterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\nfunction describeReceivedValue(value) {\n\tif (value === null) return \"null\";\n\tif (typeof value !== \"object\") return typeof value;\n\treturn `object with keys [${Object.keys(value).join(\", \")}]`;\n}\n//#endregion\n//#region src/core/marker-ledger.ts\nconst COLLECTION = \"_prisma_migrations\";\nconst MONGO_MARKER_COLLECTION = `_prisma_migrations marker documents in ${COLLECTION}`;\nconst MONGO_LEDGER_COLLECTION = `_prisma_migrations ledger documents in ${COLLECTION}`;\nconst MongoMarkerDocSchema = type({\n\tspace: \"string\",\n\tstorageHash: \"string\",\n\tprofileHash: \"string\",\n\t\"contractJson?\": \"unknown | null\",\n\t\"canonicalVersion?\": \"number | null\",\n\t\"updatedAt?\": \"Date\",\n\t\"appTag?\": \"string | null\",\n\t\"meta?\": type({ \"[string]\": \"unknown\" }).or(\"null\"),\n\t\"invariants?\": type(\"string\").array(),\n\t\"+\": \"delete\"\n});\nfunction parseMongoMarkerDoc(doc) {\n\tconst result = MongoMarkerDocSchema(doc);\n\tif (result instanceof type.errors) throw mongoAdapterError(\"CONTRACT.MARKER_ROW_CORRUPT\", `Invalid marker doc on ${COLLECTION}: ${result.summary}`, { meta: {\n\t\tcollection: COLLECTION,\n\t\tdetail: result.summary\n\t} });\n\treturn {\n\t\tstorageHash: result.storageHash,\n\t\tprofileHash: result.profileHash,\n\t\tcontractJson: result.contractJson ?? null,\n\t\tcanonicalVersion: result.canonicalVersion ?? null,\n\t\tupdatedAt: result.updatedAt ?? /* @__PURE__ */ new Date(),\n\t\tappTag: result.appTag ?? null,\n\t\tmeta: result.meta ?? {},\n\t\tinvariants: result.invariants ?? []\n\t};\n}\nfunction parseMongoMarkerDocSafely(doc, space) {\n\treturn parseMarkerRowSafely(doc, parseMongoMarkerDoc, {\n\t\tspace,\n\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t});\n}\n//#endregion\n//#region src/core/marker-ledger-collection.ts\nconst MARKER_LEDGER_COLLECTION = \"_prisma_migrations\";\n//#endregion\n//#region src/core/migrations/mongo-control-driver.ts\nfunction isMongoControlDriver(driver) {\n\treturn driver.familyId === \"mongo\" && driver.targetId === \"mongo\" && \"execute\" in driver && typeof driver.execute === \"function\";\n}\nfunction requireMongoControlDriver(driver) {\n\tif (!isMongoControlDriver(driver)) throw mongoAdapterError(\"CONFIG.VALIDATION_FAILED\", \"Expected a Mongo control driver created by mongoControlDriver.create() from `@internal/driver-mongo/control`.\", { meta: { received: describeReceivedValue(driver) } });\n\treturn driver;\n}\nfunction extractDb(driver) {\n\treturn requireMongoControlDriver(driver).db;\n}\n//#endregion\n//#region src/core/migrations/mongo-control-adapter.ts\n/**\n* Mongo control adapter for control-plane operations like introspection\n* and marker-ledger CAS. Implements the family-level `MongoControlAdapter`\n* SPI. Every marker/ledger operation builds a canonical command inline via\n* the contract-free fluent builder and dispatches it through the family\n* adapter's lowering path (`createMongoAdapter().lower(plan, {})`) onto the\n* Mongo wire transport (`driver.execute(wireCommand)`) — the same route SQL\n* marker/ledger ops take through `adapter.lower()` → `driver.query()`.\n*/\nvar MongoControlAdapterImpl = class {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\t#adapter = createMongoAdapter();\n\t#markerLedgerCollection = collection(MARKER_LEDGER_COLLECTION);\n\tasync #execute(driver, command) {\n\t\tconst plan = {\n\t\t\tcollection: MARKER_LEDGER_COLLECTION,\n\t\t\tcommand,\n\t\t\tmeta: {\n\t\t\t\ttarget: \"mongo\",\n\t\t\t\ttargetFamily: \"mongo\",\n\t\t\t\tstorageHash: \"\",\n\t\t\t\tlane: \"control\"\n\t\t\t}\n\t\t};\n\t\tconst wireCommand = await this.#adapter.lower(plan, {});\n\t\tif (!isMongoControlDriver(driver)) throw mongoAdapterError(\"CONFIG.VALIDATION_FAILED\", \"Mongo control adapter requires a Mongo control driver with an execute() transport. Provide a MongoControlDriver from `@internal/driver-mongo/control`.\", { meta: { received: describeReceivedValue(driver) } });\n\t\tconst rows = [];\n\t\tfor await (const row of driver.execute(wireCommand)) rows.push(row);\n\t\treturn rows;\n\t}\n\tasync executeDdl(driver, command) {\n\t\tconst wire = await this.#adapter.lower({ command }, {});\n\t\tawait driver.run(wire);\n\t}\n\t/**\n\t* Server-side invariant-merge aggregation expression:\n\t* `$sortArray({ input: $setUnion([$ifNull('$invariants', []), incoming]), sortBy: 1 })`.\n\t*\n\t* Built through the typed agg-expr layer — `fn.setUnion` plus the generic\n\t* `MongoAggOperator` for `$ifNull` / `$sortArray` (neither has a named `fn`\n\t* helper). Returns a `MongoAggOperator` that is passed directly to\n\t* `f.stage.set({ invariants: ... })` in the update pipeline.\n\t*/\n\t#invariantMergeExpr(incoming) {\n\t\tconst existingOrEmpty = MongoAggOperator.of(\"$ifNull\", [MongoAggFieldRef.of(\"invariants\"), MongoAggLiteral.of([])]);\n\t\tconst merged = fn.setUnion({\n\t\t\t_field: {\n\t\t\t\tcodecId: \"mongo/array@1\",\n\t\t\t\tnullable: false\n\t\t\t},\n\t\t\tnode: existingOrEmpty\n\t\t}, {\n\t\t\t_field: {\n\t\t\t\tcodecId: \"mongo/array@1\",\n\t\t\t\tnullable: false\n\t\t\t},\n\t\t\tnode: MongoAggLiteral.of([...incoming])\n\t\t});\n\t\treturn MongoAggOperator.of(\"$sortArray\", {\n\t\t\tinput: merged.node,\n\t\t\tsortBy: MongoAggLiteral.of(1)\n\t\t});\n\t}\n\tasync readMarker(driver, space) {\n\t\tconst doc = (await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.eq(space)).match((f) => f.space.eq(space)).limit(1).build()), {\n\t\t\tspace,\n\t\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t\t}))[0];\n\t\tif (!doc) return null;\n\t\treturn parseMongoMarkerDocSafely(doc, space);\n\t}\n\tasync readAllMarkers(driver) {\n\t\tconst docs = await withMarkerReadErrorHandling(() => this.#execute(driver, this.#markerLedgerCollection.aggregate().match((f) => f._id.type(\"string\")).match((f) => f.space.type(\"string\")).match((f) => expr(fn.eq(f._id, f.space))).build()), {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmarkerLocation: MONGO_MARKER_COLLECTION\n\t\t});\n\t\tconst out = /* @__PURE__ */ new Map();\n\t\tfor (const doc of docs) {\n\t\t\tconst space = doc[\"space\"];\n\t\t\t/* v8 ignore next -- @preserve type-narrowing guard: the $match stage above filters on `space: { $type: 'string' }`, so this branch is unreachable at runtime. The check exists so the `out.set(space, ...)` call below can accept `string`. */\n\t\t\tif (typeof space !== \"string\") continue;\n\t\t\tout.set(space, parseMongoMarkerDocSafely(doc, space));\n\t\t}\n\t\treturn out;\n\t}\n\tasync initMarker(driver, space, destination) {\n\t\tconst document = {\n\t\t\t_id: space,\n\t\t\tspace,\n\t\t\tstorageHash: destination.storageHash,\n\t\t\tprofileHash: destination.profileHash,\n\t\t\tcontractJson: null,\n\t\t\tcanonicalVersion: null,\n\t\t\tupdatedAt: /* @__PURE__ */ new Date(),\n\t\t\tappTag: null,\n\t\t\tmeta: {},\n\t\t\tinvariants: [...destination.invariants ?? []]\n\t\t};\n\t\tawait this.#execute(driver, this.#markerLedgerCollection.insertOne(document));\n\t}\n\tasync updateMarker(driver, space, expectedFrom, destination) {\n\t\tconst { invariants } = destination;\n\t\treturn (await this.#execute(driver, this.#markerLedgerCollection.match((f) => f._id.eq(space)).match((f) => f.space.eq(space)).match((f) => f.storageHash.eq(expectedFrom)).findOneAndUpdate((f) => [f.stage.set(invariants === void 0 ? {\n\t\t\tstorageHash: MongoAggLiteral.of(destination.storageHash),\n\t\t\tprofileHash: MongoAggLiteral.of(destination.profileHash),\n\t\t\tupdatedAt: MongoAggLiteral.of(/* @__PURE__ */ new Date())\n\t\t} : {\n\t\t\tstorageHash: MongoAggLiteral.of(destination.storageHash),\n\t\t\tprofileHash: MongoAggLiteral.of(destination.profileHash),\n\t\t\tupdatedAt: MongoAggLiteral.of(/* @__PURE__ */ new Date()),\n\t\t\tinvariants: this.#invariantMergeExpr(invariants)\n\t\t})], { upsert: false }))).length > 0;\n\t}\n\tasync writeLedgerEntry(driver, space, entry) {\n\t\tconst document = {\n\t\t\ttype: \"ledger\",\n\t\t\tspace,\n\t\t\tedgeId: entry.edgeId,\n\t\t\tfrom: entry.from,\n\t\t\tto: entry.to,\n\t\t\tmigrationName: entry.migrationName,\n\t\t\tmigrationHash: entry.migrationHash,\n\t\t\toperations: blindCast(entry.operations),\n\t\t\tappliedAt: /* @__PURE__ */ new Date()\n\t\t};\n\t\tawait this.#execute(driver, this.#markerLedgerCollection.insertOne(document));\n\t}\n\tasync readLedger(driver, space) {\n\t\tconst ledgerContext = {\n\t\t\tspace: space ?? \"*\",\n\t\t\tmarkerLocation: MONGO_LEDGER_COLLECTION\n\t\t};\n\t\tconst chain = this.#markerLedgerCollection.aggregate().match((f) => f.type.eq(\"ledger\"));\n\t\tconst command = space === void 0 ? chain.sort({ _id: 1 }).build() : chain.match((f) => f.space.eq(space)).sort({ _id: 1 }).build();\n\t\tconst docs = await withMarkerReadErrorHandling(() => this.#execute(driver, command), ledgerContext);\n\t\tconst entries = [];\n\t\tfor (const doc of docs) {\n\t\t\tconst migrationName = doc[\"migrationName\"];\n\t\t\tconst migrationHash = doc[\"migrationHash\"];\n\t\t\tconst from = doc[\"from\"];\n\t\t\tconst to = doc[\"to\"];\n\t\t\tconst docSpace = doc[\"space\"];\n\t\t\tif (typeof migrationName !== \"string\" || typeof migrationHash !== \"string\") continue;\n\t\t\tif (typeof from !== \"string\" || typeof to !== \"string\") continue;\n\t\t\tif (typeof docSpace !== \"string\") continue;\n\t\t\tconst appliedAt = doc[\"appliedAt\"];\n\t\t\tconst appliedAtDate = appliedAt instanceof Date ? appliedAt : appliedAt !== void 0 ? new Date(String(appliedAt)) : /* @__PURE__ */ new Date();\n\t\t\tconst operations = doc[\"operations\"];\n\t\t\tconst opList = Array.isArray(operations) ? operations : [];\n\t\t\tentries.push({\n\t\t\t\tspace: docSpace,\n\t\t\t\tmigrationName,\n\t\t\t\tmigrationHash,\n\t\t\t\tfrom: ledgerOriginFromStored(from),\n\t\t\t\tto,\n\t\t\t\tappliedAt: appliedAtDate,\n\t\t\t\toperationCount: opList.length\n\t\t\t});\n\t\t}\n\t\treturn entries;\n\t}\n\tasync introspectSchema(driver) {\n\t\treturn introspectSchema(extractDb(driver));\n\t}\n\tcreateRunnerDependencies(driver) {\n\t\tconst controlDriver = requireMongoControlDriver(driver);\n\t\treturn {\n\t\t\tinspectionExecutor: new MongoInspectionExecutor(controlDriver.db),\n\t\t\tadapter: this.#adapter,\n\t\t\tdriver: controlDriver,\n\t\t\texecuteDdl: (command) => this.executeDdl(controlDriver, command),\n\t\t\tmarkerOps: {\n\t\t\t\treadMarker: (space) => this.readMarker(controlDriver, space),\n\t\t\t\tinitMarker: (space, destination) => this.initMarker(controlDriver, space, destination),\n\t\t\t\tupdateMarker: (space, expectedFrom, destination) => this.updateMarker(controlDriver, space, expectedFrom, destination),\n\t\t\t\twriteLedgerEntry: (space, entry) => this.writeLedgerEntry(controlDriver, space, entry)\n\t\t\t},\n\t\t\tintrospectSchema: () => this.introspectSchema(controlDriver)\n\t\t};\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring channel. Each names a codec; the collection validator reads the BSON types from the data type the codec represents, not from the constructor.\n*/\nconst mongoScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Text, stored as BSON string.\",\n\t\toutput: { codecId: MONGO_STRING_CODEC_ID }\n\t},\n\tInt32: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 32-bit integer, stored as BSON int.\",\n\t\toutput: { codecId: MONGO_INT32_CODEC_ID }\n\t},\n\tBool: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A true or false value, stored as BSON bool.\",\n\t\toutput: { codecId: MONGO_BOOLEAN_CODEC_ID }\n\t},\n\tDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A date and time with millisecond precision, stored as BSON date.\",\n\t\toutput: { codecId: MONGO_DATE_CODEC_ID }\n\t},\n\tObjectId: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A 12-byte MongoDB identifier, stored as BSON objectId.\",\n\t\toutput: { codecId: MONGO_OBJECTID_CODEC_ID }\n\t},\n\tDouble: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A double-precision floating-point number, stored as BSON double.\",\n\t\toutput: { codecId: MONGO_DOUBLE_CODEC_ID }\n\t},\n\tInt64: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 64-bit integer read as a bigint, stored as BSON long.\",\n\t\toutput: { codecId: MONGO_INT64_CODEC_ID }\n\t},\n\tInt64Number: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 64-bit integer read as a JavaScript number within its safe integer range, stored as BSON long.\",\n\t\toutput: { codecId: MONGO_INT64_NUMBER_CODEC_ID }\n\t},\n\tDecimal128: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A 128-bit decimal read as decimal text without an exponent, stored as BSON decimal.\",\n\t\toutput: { codecId: MONGO_DECIMAL128_CODEC_ID }\n\t},\n\tBinary: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Bytes read as a Uint8Array, stored as BSON binData.\",\n\t\toutput: { codecId: MONGO_BINARY_CODEC_ID }\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value, stored as BSON object, array, string, double, int, long, bool or null; the collection validator admits only those types at the top level, and the codec refuses anything else at any depth.\",\n\t\toutput: { codecId: MONGO_JSON_CODEC_ID }\n\t},\n\tBson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Any BSON value, read as BsonValue; the collection validator does not constrain it.\",\n\t\toutput: { codecId: MONGO_BSON_CODEC_ID }\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Deprecated: use Int32. A signed 32-bit integer, stored as BSON int.\",\n\t\toutput: { codecId: MONGO_INT32_CODEC_ID },\n\t\tdeprecated: { replacement: \"Int32\" }\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Deprecated: use Double. A double-precision floating-point number, stored as BSON double.\",\n\t\toutput: { codecId: MONGO_DOUBLE_CODEC_ID },\n\t\tdeprecated: { replacement: \"Double\" }\n\t},\n\tBoolean: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Deprecated: use Bool. A true or false value, stored as BSON bool.\",\n\t\toutput: { codecId: MONGO_BOOLEAN_CODEC_ID },\n\t\tdeprecated: { replacement: \"Bool\" }\n\t},\n\tDateTime: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Deprecated: use Date. A date and time with millisecond precision, stored as BSON date.\",\n\t\toutput: { codecId: MONGO_DATE_CODEC_ID },\n\t\tdeprecated: { replacement: \"Date\" }\n\t}\n};\nconst mongoAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\tauthoring: { type: mongoScalarAuthoringTypes },\n\ttypes: { codecTypes: {\n\t\timport: {\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"CodecTypes\",\n\t\t\talias: \"MongoCodecTypes\"\n\t\t},\n\t\tparameterizedOutputTypes: {\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"ParameterizedOutputTypesForTypeParams\",\n\t\t\talias: \"MongoParameterizedOutputTypes\"\n\t\t}\n\t} },\n\tcreate(_stack) {\n\t\treturn new MongoControlAdapterImpl();\n\t}\n};\n//#endregion\nexport { MongoControlAdapterImpl, MongoInspectionExecutor, createMongoAdapter, mongoAdapterDescriptor as default, mongoAdapterDescriptor, extractDb, introspectSchema, isMongoControlDriver, mongoScalarAuthoringTypes };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,+BAA+B;AACrC,SAAS,eAAe,SAAS;CAChC,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,CAAC,OAAO,cAAc,OAAO,QAAQ,OAAO,GAAG,KAAK,KAAK;EACnE;EACA;CACD,CAAC;CACD,OAAO;AACR;;;;;;AAMA,SAAS,iBAAiB,KAAK;CAC9B,MAAM,MAAM,IAAI;CAChB,IAAI,CAAC,KAAK,OAAO;CACjB,MAAM,UAAU,OAAO,QAAQ,GAAG;CAClC,OAAO,QAAQ,WAAW,KAAK,QAAQ,EAAE,GAAG,OAAO,SAAS,QAAQ,EAAE,GAAG,OAAO;AACjF;AACA,SAAS,WAAW,KAAK;CACxB,MAAM,UAAU,IAAI;CACpB,OAAO,IAAI,iBAAiB;EAC3B,MAAM,eAAe,OAAO;EAC5B,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,oBAAoB,IAAI;EACxB,yBAAyB,IAAI;EAC7B,oBAAoB,IAAI;EACxB,WAAW,IAAI,eAAe,UAAU,IAAI,YAAY,IAAI,KAAK;EACjE,SAAS,IAAI;EACb,kBAAkB,IAAI;EACtB,mBAAmB,IAAI;CACxB,CAAC;AACF;AACA,SAAS,eAAe,SAAS;CAChC,MAAM,YAAY,QAAQ;CAC1B,IAAI,CAAC,WAAW,OAAO,KAAK;CAC5B,MAAM,aAAa,UAAU;CAC7B,IAAI,CAAC,YAAY,OAAO,KAAK;CAC7B,OAAO,IAAI,qBAAqB;EAC/B;EACA,iBAAiB,QAAQ,sBAAsB;EAC/C,kBAAkB,QAAQ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SAAS;GACT,OAAO;GACP,OAAO;EACR;EACA,0BAA0B;GACzB,SAAS;GACT,OAAO;GACP,OAAO;EACR;CACD,EAAE;CACF,OAAO,QAAQ;EACd,OAAO,IAAI,wBAAwB;CACpC;AACD"}
@@ -2,7 +2,7 @@ import { MongoCodecRegistry } from "@prisma/orm-family-mongo/codec";
2
2
  import { RuntimeMutationDefaultGenerator } from "@prisma/orm-framework/components/runtime";
3
3
  import { MongoAdapter } from "@prisma/orm-family-mongo/lowering";
4
4
  import { RuntimeAdapterDescriptor, RuntimeAdapterInstance } from "@prisma/orm-framework/components/execution";
5
- //#region ../../../3-mongo-target/2-mongo-adapter/dist/runtime.d.mts
5
+ //#region ../../../3-targets/mongo/2-adapter/dist/runtime.d.mts
6
6
  //#region src/exports/runtime.d.ts
7
7
  /**
8
8
  * adapter-mongo deliberately does NOT import the `MongoRuntimeAdapterDescriptor` type alias from `@internal/mongo-runtime`. The adapter package is downstream of the Mongo runtime package only conceptually; introducing a hard import would create a workspace dependency cycle (`mongo-runtime` consumes the runtime descriptor's `create(stack)` factory; `adapter-mongo` would then need `mongo-runtime` to type the
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__runtime.d.mts","names":[],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/runtime.d.mts"],"mappings":";;;;;;;;;;UASU,oCAAoC,0CAA0C;cAC1E,+BAA+B,2CAA2C;WAC7E,cAAc;WACd,iCAAiC,cAAc"}
1
+ {"version":3,"file":"adapter__runtime.d.mts","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/runtime.d.mts"],"mappings":";;;;;;;;;;UASU,oCAAoC,0CAA0C;cAC1E,+BAA+B,2CAA2C;WAC7E,cAAc;WACd,iCAAiC,cAAc"}
@@ -1,7 +1,7 @@
1
- import { t as buildStandardCodecRegistry } from "./codecs-B1ab7vfj-DncFJY2Q.mjs";
2
- import { t as createMongoAdapter } from "./mongo-adapter-Bo6ciURK-CGfjLOPh.mjs";
1
+ import { t as buildStandardCodecRegistry } from "./codecs-B1ab7vfj-QL33tkm2.mjs";
2
+ import { t as createMongoAdapter } from "./mongo-adapter-Bo6ciURK-DIMJdC7y.mjs";
3
3
  import { timestampNowRuntimeGenerator } from "@prisma/orm-family-mongo/family/runtime";
4
- //#region ../../../3-mongo-target/2-mongo-adapter/dist/runtime.mjs
4
+ //#region ../../../3-targets/mongo/2-adapter/dist/runtime.mjs
5
5
  const mongoRuntimeAdapterDescriptor = {
6
6
  kind: "adapter",
7
7
  id: "mongo",
@@ -1 +1 @@
1
- {"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-mongo-target/2-mongo-adapter/dist/runtime.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-Bo6ciURK.mjs\";\nimport { buildStandardCodecRegistry } from \"@internal/target-mongo/codecs\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-mongo/runtime\";\n//#region src/exports/runtime.ts\nconst mongoRuntimeAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\tcodecs: buildStandardCodecRegistry,\n\tmutationDefaultGenerators: () => [timestampNowRuntimeGenerator()],\n\tcreate(_stack) {\n\t\tconst adapter = createMongoAdapter();\n\t\treturn {\n\t\t\tfamilyId: \"mongo\",\n\t\t\ttargetId: \"mongo\",\n\t\t\tlower: adapter.lower.bind(adapter),\n\t\t\tstructuralLower: adapter.structuralLower.bind(adapter),\n\t\t\tresolveParams: adapter.resolveParams.bind(adapter)\n\t\t};\n\t}\n};\n//#endregion\nexport { mongoRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;AAIA,MAAM,gCAAgC;CACrC,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,QAAQ;CACR,iCAAiC,CAAC,6BAA6B,CAAC;CAChE,OAAO,QAAQ;EACd,MAAM,UAAU,mBAAmB;EACnC,OAAO;GACN,UAAU;GACV,UAAU;GACV,OAAO,QAAQ,MAAM,KAAK,OAAO;GACjC,iBAAiB,QAAQ,gBAAgB,KAAK,OAAO;GACrD,eAAe,QAAQ,cAAc,KAAK,OAAO;EAClD;CACD;AACD"}
1
+ {"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/mongo/2-adapter/dist/runtime.mjs"],"sourcesContent":["import { t as createMongoAdapter } from \"./mongo-adapter-Bo6ciURK.mjs\";\nimport { buildStandardCodecRegistry } from \"@internal/target-mongo/codecs\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-mongo/runtime\";\n//#region src/exports/runtime.ts\nconst mongoRuntimeAdapterDescriptor = {\n\tkind: \"adapter\",\n\tid: \"mongo\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tversion: \"0.0.1\",\n\tcodecs: buildStandardCodecRegistry,\n\tmutationDefaultGenerators: () => [timestampNowRuntimeGenerator()],\n\tcreate(_stack) {\n\t\tconst adapter = createMongoAdapter();\n\t\treturn {\n\t\t\tfamilyId: \"mongo\",\n\t\t\ttargetId: \"mongo\",\n\t\t\tlower: adapter.lower.bind(adapter),\n\t\t\tstructuralLower: adapter.structuralLower.bind(adapter),\n\t\t\tresolveParams: adapter.resolveParams.bind(adapter)\n\t\t};\n\t}\n};\n//#endregion\nexport { mongoRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;AAIA,MAAM,gCAAgC;CACrC,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,QAAQ;CACR,iCAAiC,CAAC,6BAA6B,CAAC;CAChE,OAAO,QAAQ;EACd,MAAM,UAAU,mBAAmB;EACnC,OAAO;GACN,UAAU;GACV,UAAU;GACV,OAAO,QAAQ,MAAM,KAAK,OAAO;GACjC,iBAAiB,QAAQ,gBAAgB,KAAK,OAAO;GACrD,eAAe,QAAQ,cAAc,KAAK,OAAO;EAClD;CACD;AACD"}
@@ -1,4 +1,4 @@
1
- //#region ../../../3-mongo-target/1-mongo-target/dist/codec-ids.d.mts
1
+ //#region ../../../3-targets/mongo/1-target/dist/codec-ids.d.mts
2
2
  //#region src/core/codec-ids.d.ts
3
3
  declare const MONGO_OBJECTID_CODEC_ID: "mongo/objectId@1";
4
4
  declare const MONGO_STRING_CODEC_ID: "mongo/string@1";
@@ -15,4 +15,4 @@ declare const MONGO_JSON_CODEC_ID: "mongo/json@1";
15
15
  declare const MONGO_BSON_CODEC_ID: "mongo/bson@1";
16
16
  //#endregion
17
17
  export { MONGO_DECIMAL128_CODEC_ID as a, MONGO_INT64_CODEC_ID as c, MONGO_OBJECTID_CODEC_ID as d, MONGO_STRING_CODEC_ID as f, MONGO_DATE_CODEC_ID as i, MONGO_INT64_NUMBER_CODEC_ID as l, MONGO_BOOLEAN_CODEC_ID as n, MONGO_DOUBLE_CODEC_ID as o, MONGO_VECTOR_CODEC_ID as p, MONGO_BSON_CODEC_ID as r, MONGO_INT32_CODEC_ID as s, MONGO_BINARY_CODEC_ID as t, MONGO_JSON_CODEC_ID as u };
18
- //# sourceMappingURL=codec-ids-PSU05uwH.d.mts.map
18
+ //# sourceMappingURL=codec-ids-BKQbXhZt.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-ids-BKQbXhZt.d.mts","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/codec-ids.d.mts"],"mappings":";;cACc;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA"}
@@ -1,4 +1,4 @@
1
- //#region ../../../3-mongo-target/1-mongo-target/dist/codec-ids-WdrumsYA.mjs
1
+ //#region ../../../3-targets/mongo/1-target/dist/codec-ids-WdrumsYA.mjs
2
2
  const MONGO_OBJECTID_CODEC_ID = "mongo/objectId@1";
3
3
  const MONGO_STRING_CODEC_ID = "mongo/string@1";
4
4
  const MONGO_DOUBLE_CODEC_ID = "mongo/double@1";
@@ -15,4 +15,4 @@ const MONGO_BSON_CODEC_ID = "mongo/bson@1";
15
15
  //#endregion
16
16
  export { MONGO_DECIMAL128_CODEC_ID as a, MONGO_INT64_CODEC_ID as c, MONGO_OBJECTID_CODEC_ID as d, MONGO_STRING_CODEC_ID as f, MONGO_DATE_CODEC_ID as i, MONGO_INT64_NUMBER_CODEC_ID as l, MONGO_BOOLEAN_CODEC_ID as n, MONGO_DOUBLE_CODEC_ID as o, MONGO_VECTOR_CODEC_ID as p, MONGO_BSON_CODEC_ID as r, MONGO_INT32_CODEC_ID as s, MONGO_BINARY_CODEC_ID as t, MONGO_JSON_CODEC_ID as u };
17
17
 
18
- //# sourceMappingURL=codec-ids-WdrumsYA-BkQfspmL.mjs.map
18
+ //# sourceMappingURL=codec-ids-WdrumsYA-CZVjuKW8.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-ids-WdrumsYA-CZVjuKW8.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/codec-ids-WdrumsYA.mjs"],"sourcesContent":["//#region src/core/codec-ids.ts\nconst MONGO_OBJECTID_CODEC_ID = \"mongo/objectId@1\";\nconst MONGO_STRING_CODEC_ID = \"mongo/string@1\";\nconst MONGO_DOUBLE_CODEC_ID = \"mongo/double@1\";\nconst MONGO_INT32_CODEC_ID = \"mongo/int32@1\";\nconst MONGO_BOOLEAN_CODEC_ID = \"mongo/bool@1\";\nconst MONGO_DATE_CODEC_ID = \"mongo/date@1\";\nconst MONGO_VECTOR_CODEC_ID = \"mongo/vector@1\";\nconst MONGO_INT64_CODEC_ID = \"mongo/int64@1\";\nconst MONGO_INT64_NUMBER_CODEC_ID = \"mongo/int64Number@1\";\nconst MONGO_DECIMAL128_CODEC_ID = \"mongo/decimal128@1\";\nconst MONGO_BINARY_CODEC_ID = \"mongo/binary@1\";\nconst MONGO_JSON_CODEC_ID = \"mongo/json@1\";\nconst MONGO_BSON_CODEC_ID = \"mongo/bson@1\";\n//#endregion\nexport { MONGO_DECIMAL128_CODEC_ID as a, MONGO_INT64_CODEC_ID as c, MONGO_OBJECTID_CODEC_ID as d, MONGO_STRING_CODEC_ID as f, MONGO_DATE_CODEC_ID as i, MONGO_INT64_NUMBER_CODEC_ID as l, MONGO_BOOLEAN_CODEC_ID as n, MONGO_DOUBLE_CODEC_ID as o, MONGO_VECTOR_CODEC_ID as p, MONGO_BSON_CODEC_ID as r, MONGO_INT32_CODEC_ID as s, MONGO_BINARY_CODEC_ID as t, MONGO_JSON_CODEC_ID as u };\n\n//# sourceMappingURL=codec-ids-WdrumsYA.mjs.map"],"mappings":";AACA,MAAM,0BAA0B;AAChC,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;AAC9B,MAAM,uBAAuB;AAC7B,MAAM,yBAAyB;AAC/B,MAAM,sBAAsB;AAC5B,MAAM,wBAAwB;AAC9B,MAAM,uBAAuB;AAC7B,MAAM,8BAA8B;AACpC,MAAM,4BAA4B;AAClC,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;AAC5B,MAAM,sBAAsB"}
@@ -1,6 +1,6 @@
1
1
  import { JsonValue, ParameterizedOutputTypesFunction } from "@prisma/orm-framework/contract/types";
2
2
  import { BsonInputValue, BsonInputValue as BsonInputValue$1, BsonScalar, BsonValue, BsonValue as BsonValue$1 } from "@prisma/orm-family-mongo/value";
3
- //#region ../../../3-mongo-target/1-mongo-target/dist/codec-types.d.mts
3
+ //#region ../../../3-targets/mongo/1-target/dist/codec-types.d.mts
4
4
  //#region src/exports/codec-types.d.ts
5
5
  type Vector<N extends number = number> = readonly number[] & {
6
6
  readonly __vectorLength?: N;
@@ -86,4 +86,4 @@ interface ParameterizedOutputTypesForTypeParams extends ParameterizedOutputTypes
86
86
  }
87
87
  //#endregion
88
88
  export { ParameterizedOutputTypesForTypeParams as a, CodecTypes as i, BsonScalar as n, Vector as o, BsonValue$1 as r, BsonInputValue$1 as t };
89
- //# sourceMappingURL=codec-types-Daq7xQEA.d.mts.map
89
+ //# sourceMappingURL=codec-types-oKxM85p-.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-types-oKxM85p-.d.mts","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/codec-types.d.mts"],"mappings":";;;;KAGK,OAAO;WACD,iBAAiB;;KAEvB;WACM;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE,OAAO;aACP,QAAQ;aACR;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;aACA;;WAEF;aACE,OAAO;aACP,QAAQ;aACR;;WAEF;aACE,OAAO;aACP,QAAQ;aACR;;WAEF;aACE,OAAO;aACP,QAAQ;aACR;;;KAGR,cAAc;WACR,kBAAkB;aAChB,cAAc;MACrB,OAAO;;;;;UAKH,8CAA8C;WAC7C,aAAa"}
@@ -1,11 +1,11 @@
1
- import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_OBJECTID_CODEC_ID, f as MONGO_STRING_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DOUBLE_CODEC_ID, p as MONGO_VECTOR_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_INT32_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_JSON_CODEC_ID } from "./codec-ids-WdrumsYA-BkQfspmL.mjs";
2
- import { t as mongoTargetError } from "./mongo-target-errors-Btf3ML1w-B5EMYbz1.mjs";
3
- import { $ as where, B as mongoInt32, C as int64Decode, D as int64NumberFromDigits, E as int64NumberEncode, F as mongoBson, H as mongoJson, J as objectIdEncode, K as mongoVector, L as mongoDate, M as isPlainObject, N as mongoBinary, O as int64NumberToJson, P as mongoBool, Q as vectorEncode, R as mongoDecimal128, S as int32ToJson, T as int64NumberDecode, U as mongoObjectId, V as mongoInt64, W as mongoString, X as readBsonJson, Y as objectIdToJson, Z as stringEncode, _ as decimal128ToJson, a as booleanEncode, b as encodeBsonValue, c as bsonTypeTag, d as dateEncode, f as dateToJson, h as decimal128Encode, i as binaryToBase64, j as isPlainArray, k as int64ToJson, l as child, m as decimal128Decode, n as binaryEncode, o as bsonClassTag, p as dbRefEntries, r as binaryFromBase64, s as bsonToJson, t as binaryDecode, u as constructorName, v as decodeBsonValue, w as int64Encode, x as int32Encode, y as doubleEncode, z as mongoDouble } from "./data-types-hoKLBrYZ-CkFtgHfm.mjs";
1
+ import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_OBJECTID_CODEC_ID, f as MONGO_STRING_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DOUBLE_CODEC_ID, p as MONGO_VECTOR_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_INT32_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_JSON_CODEC_ID } from "./codec-ids-WdrumsYA-CZVjuKW8.mjs";
2
+ import { t as mongoTargetError } from "./mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs";
3
+ import { $ as where, B as mongoInt32, C as int64Decode, D as int64NumberFromDigits, E as int64NumberEncode, F as mongoBson, H as mongoJson, J as objectIdEncode, K as mongoVector, L as mongoDate, M as isPlainObject, N as mongoBinary, O as int64NumberToJson, P as mongoBool, Q as vectorEncode, R as mongoDecimal128, S as int32ToJson, T as int64NumberDecode, U as mongoObjectId, V as mongoInt64, W as mongoString, X as readBsonJson, Y as objectIdToJson, Z as stringEncode, _ as decimal128ToJson, a as booleanEncode, b as encodeBsonValue, c as bsonTypeTag, d as dateEncode, f as dateToJson, h as decimal128Encode, i as binaryToBase64, j as isPlainArray, k as int64ToJson, l as child, m as decimal128Decode, n as binaryEncode, o as bsonClassTag, p as dbRefEntries, r as binaryFromBase64, s as bsonToJson, t as binaryDecode, u as constructorName, v as decodeBsonValue, w as int64Encode, x as int32Encode, y as doubleEncode, z as mongoDouble } from "./data-types-hoKLBrYZ-h9cAgbOy.mjs";
4
4
  import { decimalTextBigintLiteral, decimalTextNumberLiteral, floatNumberLiteral, floatToJson, readJsonFloat, renderTsLiteral } from "@prisma/orm-framework/components/codec";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
6
6
  import { mongoCodec, newMongoCodecRegistry } from "@prisma/orm-family-mongo/codec";
7
7
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
8
- //#region ../../../3-mongo-target/1-mongo-target/dist/codecs-B1ab7vfj.mjs
8
+ //#region ../../../3-targets/mongo/1-target/dist/codecs-B1ab7vfj.mjs
9
9
  const BSON_TYPE_BY_TAG = {
10
10
  ObjectId: "objectId",
11
11
  Decimal128: "decimal",
@@ -389,4 +389,4 @@ function buildStandardCodecRegistry() {
389
389
  //#endregion
390
390
  export { mongoStandardCodecs as i, mongoCodecDescriptors as n, mongoDescriptorById as r, buildStandardCodecRegistry as t };
391
391
 
392
- //# sourceMappingURL=codecs-B1ab7vfj-DncFJY2Q.mjs.map
392
+ //# sourceMappingURL=codecs-B1ab7vfj-QL33tkm2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs-B1ab7vfj-QL33tkm2.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/codecs-B1ab7vfj.mjs"],"sourcesContent":["import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_OBJECTID_CODEC_ID, f as MONGO_STRING_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DOUBLE_CODEC_ID, p as MONGO_VECTOR_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_INT32_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_JSON_CODEC_ID } from \"./codec-ids-WdrumsYA.mjs\";\nimport { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { $ as vectorEncode, A as binaryFromBase64, B as int32Encode, C as constructorName, D as where, E as isPlainObject, F as decimal128Decode, G as int64NumberEncode, H as int64Decode, I as decimal128Encode, J as int64ToJson, K as int64NumberFromDigits, M as booleanEncode, N as dateEncode, O as binaryDecode, P as dateToJson, Q as stringEncode, R as decimal128ToJson, S as child, T as isPlainArray, U as int64Encode, V as int32ToJson, W as int64NumberDecode, X as objectIdEncode, Z as objectIdToJson, _ as decodeBsonValue, a as mongoDate, b as bsonClassTag, c as mongoInt32, d as mongoObjectId, f as mongoString, g as bsonToJson, j as binaryToBase64, k as binaryEncode, l as mongoInt64, m as mongoVector, n as mongoBool, o as mongoDecimal128, q as int64NumberToJson, r as mongoBson, s as mongoDouble, t as mongoBinary, u as mongoJson, v as encodeBsonValue, w as dbRefEntries, x as bsonTypeTag, y as readBsonJson, z as doubleEncode } from \"./data-types-hoKLBrYZ.mjs\";\nimport { decimalTextBigintLiteral, decimalTextNumberLiteral, floatNumberLiteral, floatToJson, readJsonFloat, renderTsLiteral } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { mongoCodec, newMongoCodecRegistry } from \"@internal/mongo-codec\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/json-codec-helpers.ts\nconst BSON_TYPE_BY_TAG = {\n\tObjectId: \"objectId\",\n\tDecimal128: \"decimal\",\n\tBinary: \"binData\",\n\tBSONRegExp: \"regex\",\n\tTimestamp: \"timestamp\",\n\tBSONSymbol: \"symbol\",\n\tCode: \"javascript\",\n\tMinKey: \"minKey\",\n\tMaxKey: \"maxKey\"\n};\nconst NOT_FINITE_FIX = \"JSON has no NaN or Infinity; store null or a string, or declare the field Bson.\";\nconst BSON_FIX = \"Declare the field Bson to store BSON values.\";\nconst PLAIN_VALUE_FIX = \"Convert it to a plain object or array.\";\nconst ENCODE_FIX_BY_RECEIVED = {\n\tDate: \"Store the date as an ISO 8601 string, or declare the field Bson.\",\n\tbigint: \"Store it as a number in the safe-integer range or as decimal text, or declare the field Int64 or Bson.\",\n\tNaN: NOT_FINITE_FIX,\n\tInfinity: NOT_FINITE_FIX,\n\t\"-Infinity\": NOT_FINITE_FIX,\n\tundefined: \"Leave the key out, or store null.\",\n\tUint8Array: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tBuffer: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tBinary: \"Store the bytes as a base64 string, or declare the field Binary or Bson.\",\n\tObjectId: \"Store its hex string, or declare the field ObjectId or Bson.\",\n\tLong: \"Store a number in the safe-integer range or decimal text, or declare the field Int64 or Bson.\",\n\tDecimal128: \"Store the decimal text, or declare the field Decimal128 or Bson.\",\n\tInt32: \"Pass a plain number.\",\n\tDouble: \"Pass a plain number.\",\n\tRegExp: \"Store the pattern as a string, or declare the field Bson.\",\n\tBSONRegExp: \"Store the pattern as a string, or declare the field Bson.\",\n\tsymbol: \"Store a string instead.\",\n\tfunction: \"Store data, not a function.\",\n\t\"circular reference\": \"Remove the cycle; a JSON value is a tree.\",\n\t\"sparse array hole\": \"Fill the hole with null.\",\n\tDBRef: \"Write it as a { $ref, $id } document instead.\"\n};\nfunction encodeFix(received) {\n\treturn ENCODE_FIX_BY_RECEIVED[received] ?? (Object.hasOwn(BSON_TYPE_BY_TAG, received) ? BSON_FIX : PLAIN_VALUE_FIX);\n}\nfunction encodeRefused(received, path) {\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${MONGO_JSON_CODEC_ID} value must be a JSON value; received ${received} at ${where(path)}. ${encodeFix(received)}`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction describeNonJson(value) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return void 0;\n\tif (typeof value === \"number\") return Number.isFinite(value) ? void 0 : String(value);\n\tif (typeof value !== \"object\") return typeof value;\n\tconst tag = bsonTypeTag(value);\n\tif (tag !== void 0) return tag;\n\tif (value instanceof Date) return \"Date\";\n\tif (isPlainArray(value)) return void 0;\n\treturn isPlainObject(value) ? void 0 : constructorName(value);\n}\nfunction assertJsonValue(value, path, ancestors) {\n\tconst received = describeNonJson(value);\n\tif (received !== void 0) encodeRefused(received, path);\n\tif (typeof value !== \"object\" || value === null) return;\n\tif (ancestors.has(value)) encodeRefused(\"circular reference\", path);\n\tancestors.add(value);\n\tif (Array.isArray(value)) for (let index = 0; index < value.length; index++) {\n\t\tif (!(index in value)) encodeRefused(\"sparse array hole\", child(path, index));\n\t\tassertJsonValue(value[index], child(path, index), ancestors);\n\t}\n\telse for (const [key, entry] of Object.entries(value)) assertJsonValue(entry, child(path, key), ancestors);\n\tancestors.delete(value);\n}\n/**\n* Returns `value` unchanged when it is a plain JSON value at every depth, and throws `RUNTIME.ENCODE_FAILED` naming the first value that is not, with its path.\n*/\nfunction encodeJsonValue(value) {\n\tassertJsonValue(value, \"\", /* @__PURE__ */ new Set());\n\treturn value;\n}\nfunction decodeRefused(bsonType, path) {\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${MONGO_JSON_CODEC_ID} wire value contains a non-JSON BSON ${bsonType} at ${where(path)}`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived: bsonType,\n\t\tvaluePath: path\n\t} });\n}\nfunction safeLong(value, path) {\n\tconst number = Number(value);\n\treturn Number.isSafeInteger(number) && BigInt(number) === value ? number : decodeRefused(\"long\", path);\n}\nfunction finiteDouble(value, path) {\n\tif (Number.isFinite(value)) return value;\n\tconst received = String(value);\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${MONGO_JSON_CODEC_ID} wire value contains ${received} at ${where(path)}; a JSON number cannot be NaN or Infinity`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction decodeEntries(entries, path) {\n\treturn Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue(entry, child(path, key))]));\n}\nfunction decodeTagged(value, tag, path) {\n\tswitch (tag) {\n\t\tcase \"DBRef\": return decodeEntries(dbRefEntries(value), path);\n\t\tcase \"Long\": return safeLong(blindCast(value).toBigInt(), path);\n\t\tcase \"Int32\":\n\t\tcase \"Double\": return finiteDouble(Number(value.valueOf()), path);\n\t}\n\treturn decodeRefused(BSON_TYPE_BY_TAG[tag] ?? tag, path);\n}\nfunction decodeValue(value, path) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return value;\n\tif (typeof value === \"number\") return finiteDouble(value, path);\n\tif (typeof value === \"bigint\") return safeLong(value, path);\n\tif (typeof value === \"undefined\") return decodeRefused(\"undefined\", path);\n\tif (typeof value === \"symbol\") return decodeRefused(\"symbol\", path);\n\tif (typeof value === \"function\") return decodeRefused(\"javascript\", path);\n\tconst tag = bsonClassTag(value);\n\tif (tag !== void 0) return decodeTagged(value, tag, path);\n\tif (value instanceof Date) return decodeRefused(\"date\", path);\n\tif (value instanceof RegExp) return decodeRefused(\"regex\", path);\n\tif (value instanceof Uint8Array) return decodeRefused(\"binData\", path);\n\tif (Array.isArray(value)) {\n\t\tconst decoded = value.map((entry, index) => decodeValue(entry, child(path, index)));\n\t\treturn decoded.some((entry, index) => entry !== value[index]) ? decoded : value;\n\t}\n\tif (!isPlainObject(value)) return decodeRefused(constructorName(value), path);\n\tconst entries = Object.entries(value);\n\tconst decoded = decodeEntries(entries, path);\n\treturn entries.some(([key, entry]) => decoded[key] !== entry) ? decoded : blindCast(value);\n}\n/**\n* Decodes a wire value to the JSON value it holds: a `long` in the safe-integer range and the driver's `Int32` and `Double` wrappers become numbers. Only the objects and arrays around a converted value are copied; a wire value that is already JSON is returned as the same object. Throws `RUNTIME.DECODE_FAILED` naming the BSON type and path of the first value that is not JSON.\n*/\nfunction decodeJsonValue(wire) {\n\treturn decodeValue(wire, \"\");\n}\n//#endregion\n//#region src/core/codecs.ts\nconst mongoObjectIdCodec = mongoCodec({\n\ttypeId: MONGO_OBJECTID_CODEC_ID,\n\tdataType: mongoObjectId,\n\tfromWire: (wire) => wire.toHexString(),\n\ttoWire: (value) => objectIdEncode(MONGO_OBJECTID_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoObjectId.valueFrom(objectIdToJson(MONGO_OBJECTID_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoStringCodec = mongoCodec({\n\ttypeId: MONGO_STRING_CODEC_ID,\n\tdataType: mongoString,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => stringEncode(MONGO_STRING_CODEC_ID, value),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoDoubleCodec = mongoCodec({\n\ttypeId: MONGO_DOUBLE_CODEC_ID,\n\tdataType: mongoDouble,\n\tfromWire: (wire) => Number(wire),\n\ttoWire: (value) => doubleEncode(MONGO_DOUBLE_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDouble.valueFrom(floatToJson(value), {}),\n\tfromDataTypeValue: (value) => readJsonFloat(MONGO_DOUBLE_CODEC_ID, value.value)\n});\nconst mongoInt32Codec = mongoCodec({\n\ttypeId: MONGO_INT32_CODEC_ID,\n\tdataType: mongoInt32,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => int32Encode(MONGO_INT32_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt32.valueFrom(int32ToJson(MONGO_INT32_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoBooleanCodec = mongoCodec({\n\ttypeId: MONGO_BOOLEAN_CODEC_ID,\n\tdataType: mongoBool,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => booleanEncode(MONGO_BOOLEAN_CODEC_ID, value),\n\tfromDataTypeValue: (value) => value.value\n});\nconst mongoDateCodec = mongoCodec({\n\ttypeId: MONGO_DATE_CODEC_ID,\n\tdataType: mongoDate,\n\tfromWire: (wire) => wire,\n\ttoWire: (value) => dateEncode(MONGO_DATE_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDate.valueFrom(dateToJson(MONGO_DATE_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => new Date(value.value)\n});\n/** The vector codec for a column of `mongo/vector` with `params`. The dimension reaches only the TypeScript type `Vector<n>`. */\nfunction vectorCodec(params) {\n\treturn mongoCodec({\n\t\ttypeId: MONGO_VECTOR_CODEC_ID,\n\t\tdataType: mongoVector,\n\t\t...ifDefined(\"params\", params),\n\t\tfromWire: (wire) => wire,\n\t\ttoWire: (value) => vectorEncode(MONGO_VECTOR_CODEC_ID, value),\n\t\tfromDataTypeValue: (value) => value.value\n\t});\n}\nconst mongoVectorCodec = vectorCodec();\n/**\n* A BSON `long`. The application value is a `bigint`, because a `number` cannot hold the full 64-bit range; its stored form is decimal text.\n*/\nconst mongoInt64Codec = mongoCodec({\n\ttypeId: MONGO_INT64_CODEC_ID,\n\tdataType: mongoInt64,\n\tfromWire: (wire) => int64Decode(MONGO_INT64_CODEC_ID, wire),\n\ttoWire: (value) => int64Encode(MONGO_INT64_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt64.valueFrom(int64ToJson(MONGO_INT64_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => BigInt(value.value)\n});\n/**\n* A BSON `long` read and written as a `number` from -(2^53 - 1) to 2^53 - 1, the value a Prisma 6 `Int` presents. A value outside that range, or with a fraction, is refused rather than rounded.\n*/\nconst mongoInt64NumberCodec = mongoCodec({\n\ttypeId: MONGO_INT64_NUMBER_CODEC_ID,\n\tdataType: mongoInt64,\n\tfromWire: (wire) => int64NumberDecode(MONGO_INT64_NUMBER_CODEC_ID, wire),\n\ttoWire: (value) => int64NumberEncode(MONGO_INT64_NUMBER_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoInt64.valueFrom(int64NumberToJson(MONGO_INT64_NUMBER_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => int64NumberFromDigits(MONGO_INT64_NUMBER_CODEC_ID, value.value)\n});\n/**\n* A BSON `decimal`. The application value and its stored form are the same decimal text, written without an exponent.\n*/\nconst mongoDecimal128Codec = mongoCodec({\n\ttypeId: MONGO_DECIMAL128_CODEC_ID,\n\tdataType: mongoDecimal128,\n\tfromWire: (wire) => decimal128Decode(MONGO_DECIMAL128_CODEC_ID, wire),\n\ttoWire: (value) => decimal128Encode(MONGO_DECIMAL128_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoDecimal128.valueFrom(decimal128ToJson(MONGO_DECIMAL128_CODEC_ID, value), {}),\n\tfromDataTypeValue: (value) => value.value\n});\n/**\n* BSON `binData`. The application value is a `Uint8Array`; its stored form is unwrapped base64.\n*/\nconst mongoBinaryCodec = mongoCodec({\n\ttypeId: MONGO_BINARY_CODEC_ID,\n\tdataType: mongoBinary,\n\tfromWire: (wire) => binaryDecode(MONGO_BINARY_CODEC_ID, wire),\n\ttoWire: (value) => binaryEncode(MONGO_BINARY_CODEC_ID, value),\n\ttoDataTypeValue: (value) => mongoBinary.valueFrom(binaryToBase64(value), {}),\n\tfromDataTypeValue: (value) => binaryFromBase64(value.value)\n});\n/**\n* A JSON value, stored as the BSON object, array, string, number, boolean or null it maps to. Encode and decode refuse any other value at any depth, naming its path.\n*/\nconst mongoJsonCodec = mongoCodec({\n\ttypeId: MONGO_JSON_CODEC_ID,\n\tdataType: mongoJson,\n\tfromWire: (wire) => decodeJsonValue(wire),\n\ttoWire: (value) => encodeJsonValue(value)\n});\n/**\n* Any BSON value, passed through unchanged except that decode turns a `DBRef` back into the `{ $ref, $id }` document it was stored as. Encode takes a `BsonInputValue` and decode returns a `BsonValue`. Its stored form is canonical MongoDB Extended JSON v2, written with each number and `Uint8Array` as the BSON type the driver stores, so a round trip keeps the BSON bytes but may return wrapper classes such as `Int32` and `Double`.\n*/\nconst mongoBsonCodec = mongoCodec({\n\ttypeId: MONGO_BSON_CODEC_ID,\n\tdataType: mongoBson,\n\tfromWire: (wire) => decodeBsonValue(wire),\n\ttoWire: (value) => encodeBsonValue(value),\n\ttoDataTypeValue: (value) => mongoBson.valueFrom(bsonToJson(value), {}),\n\tfromDataTypeValue: (value) => readBsonJson(MONGO_BSON_CODEC_ID, value.value)\n});\n/**\n* The canonical set of Mongo wire-type codecs.\n*\n* Single source of truth for both control- and runtime-plane adapter descriptors. Don't duplicate this list — import it.\n*/\nconst mongoStandardCodecs = [\n\tmongoObjectIdCodec,\n\tmongoStringCodec,\n\tmongoDoubleCodec,\n\tmongoInt32Codec,\n\tmongoBooleanCodec,\n\tmongoDateCodec,\n\tmongoVectorCodec,\n\tmongoInt64Codec,\n\tmongoInt64NumberCodec,\n\tmongoDecimal128Codec,\n\tmongoBinaryCodec,\n\tmongoJsonCodec,\n\tmongoBsonCodec\n];\n/**\n* Build a {@link CodecDescriptor} for a Mongo wire-type codec.\n*\n* Wraps an existing {@link MongoCodec} instance into a descriptor whose factory hands out the same shared codec, or, for a codec whose data type has parameters, one built for the column's parameters. Mongo's full migration to descriptor-first authoring is tracked under TML-2324; for now the descriptor view is composed from the existing `mongoCodec()` outputs.\n*/\nfunction descriptorFor(codec, metadata) {\n\treturn {\n\t\tcodecId: codec.id,\n\t\tdataType: codec.dataType.id,\n\t\ttraits: metadata.traits,\n\t\tparamsSchema: blindCast(codec.dataType.params),\n\t\tisParameterized: codec.dataType.params !== void 0,\n\t\tfactory: blindCast((params) => {\n\t\t\tconst built = metadata.withParams === void 0 || params === void 0 ? codec : metadata.withParams(params);\n\t\t\treturn () => built;\n\t\t}),\n\t\t...ifDefined(\"renderValueLiteral\", metadata.renderValueLiteral),\n\t\t...ifDefined(\"keepsWrittenForm\", metadata.keepsWrittenForm)\n\t};\n}\n/**\n* Mongo wire-type codec descriptors. Static metadata such as `traits` lives here (the descriptor shape) — `MongoCodec` itself carries its data type and the four conversion methods (TML-2357).\n*/\nconst mongoCodecDescriptors = [\n\tdescriptorFor(mongoObjectIdCodec, { traits: [\"equality\"] }),\n\tdescriptorFor(mongoStringCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"textual\"\n\t\t],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tdescriptorFor(mongoDoubleCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: floatNumberLiteral\n\t}),\n\tdescriptorFor(mongoInt32Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tdescriptorFor(mongoBooleanCodec, {\n\t\ttraits: [\"equality\", \"boolean\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tdescriptorFor(mongoDateCodec, { traits: [\"equality\", \"order\"] }),\n\tdescriptorFor(mongoVectorCodec, {\n\t\ttraits: [\"equality\"],\n\t\twithParams: vectorCodec\n\t}),\n\tdescriptorFor(mongoInt64Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: decimalTextBigintLiteral\n\t}),\n\tdescriptorFor(mongoInt64NumberCodec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\trenderValueLiteral: decimalTextNumberLiteral\n\t}),\n\tdescriptorFor(mongoDecimal128Codec, {\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\tkeepsWrittenForm: true\n\t}),\n\tdescriptorFor(mongoBinaryCodec, { traits: [\"equality\"] }),\n\tdescriptorFor(mongoJsonCodec, { traits: [] }),\n\tdescriptorFor(mongoBsonCodec, { traits: [] })\n];\n/**\n* Lookup descriptor metadata by codec id — used by tests and for descriptor-side reads of static metadata.\n*/\nfunction mongoDescriptorById(codecId) {\n\treturn mongoCodecDescriptors.find((d) => d.codecId === codecId);\n}\n/**\n* Build a {@link MongoCodecRegistry} preloaded with the standard Mongo wire-type codecs.\n*\n* Single point of truth for adapter-side codec construction: used by the legacy synchronous `createMongoAdapter()` factory and by the runtime adapter descriptor's `codecs()` getter. Userland code obtains a registry via the framework's execution-stack composition (see `createMongoExecutionContext`) instead of calling this directly.\n*/\nfunction buildStandardCodecRegistry() {\n\tconst registry = newMongoCodecRegistry();\n\tfor (const codec of mongoStandardCodecs) registry.register(codec);\n\treturn registry;\n}\n//#endregion\nexport { mongoStandardCodecs as i, mongoCodecDescriptors as n, mongoDescriptorById as r, buildStandardCodecRegistry as t };\n\n//# sourceMappingURL=codecs-B1ab7vfj.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,mBAAmB;CACxB,UAAU;CACV,YAAY;CACZ,QAAQ;CACR,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,MAAM;CACN,QAAQ;CACR,QAAQ;AACT;AACA,MAAM,iBAAiB;AACvB,MAAM,WAAW;AACjB,MAAM,kBAAkB;AACxB,MAAM,yBAAyB;CAC9B,MAAM;CACN,QAAQ;CACR,KAAK;CACL,UAAU;CACV,aAAa;CACb,WAAW;CACX,YAAY;CACZ,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,MAAM;CACN,YAAY;CACZ,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,sBAAsB;CACtB,qBAAqB;CACrB,OAAO;AACR;AACA,SAAS,UAAU,UAAU;CAC5B,OAAO,uBAAuB,cAAc,OAAO,OAAO,kBAAkB,QAAQ,IAAI,WAAW;AACpG;AACA,SAAS,cAAc,UAAU,MAAM;CACtC,MAAM,iBAAiB,yBAAyB,GAAG,oBAAoB,wCAAwC,SAAS,MAAM,MAAM,IAAI,EAAE,IAAI,UAAU,QAAQ,KAAK,EAAE,MAAM;EAC5K,SAAS;EACT;EACA,WAAW;CACZ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QAAQ;GACP;GACA;GACA;EACD;EACA,kBAAkB;CACnB,CAAC;CACD,cAAc,kBAAkB,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;CACxD,cAAc,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAC;CAC5C,cAAc,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAC;AAC7C;;;;AAIA,SAAS,oBAAoB,SAAS;CACrC,OAAO,sBAAsB,MAAM,MAAM,EAAE,YAAY,OAAO;AAC/D;;;;;;AAMA,SAAS,6BAA6B;CACrC,MAAM,WAAW,sBAAsB;CACvC,KAAK,MAAM,SAAS,qBAAqB,SAAS,SAAS,KAAK;CAChE,OAAO;AACR"}
@@ -3,7 +3,7 @@ import { Binary, Decimal128, Double, Long, ObjectId } from "bson";
3
3
  import { MongoCodec, MongoCodecRegistry } from "@prisma/orm-family-mongo/codec";
4
4
  import { JsonValue } from "@prisma/orm-framework/contract/types";
5
5
  import { BsonInputValue, BsonValue } from "@prisma/orm-family-mongo/value";
6
- //#region ../../../3-mongo-target/1-mongo-target/dist/codecs.d.mts
6
+ //#region ../../../3-targets/mongo/1-target/dist/codecs.d.mts
7
7
  //#region src/core/codecs.d.ts
8
8
  /**
9
9
  * The canonical set of Mongo wire-type codecs.
@@ -33,4 +33,4 @@ declare function mongoDescriptorById(codecId: string): CodecDescriptor | undefin
33
33
  declare function buildStandardCodecRegistry(): MongoCodecRegistry;
34
34
  //#endregion
35
35
  export { mongoStandardCodecs as i, mongoCodecDescriptors as n, mongoDescriptorById as r, buildStandardCodecRegistry as t };
36
- //# sourceMappingURL=codecs-DBvHcdHp.d.mts.map
36
+ //# sourceMappingURL=codecs-Y5GYsLPj.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs-Y5GYsLPj.d.mts","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/codecs.d.mts"],"mappings":";;;;;;;;;;;;cAWc,+BAA+B,4CAA4C,2BAA2B,mEAAmE,mDAAmD,yBAAyB,kEAAkE,oEAAoE,wCAAwC,MAAM,MAAM,OAAO,oGAAoG,2DAA2D,uBAAuB,iEAAiE,uBAAuB,8CAA8C,6BAA6B,0CAA0C,SAAS,WAAW,kBAAkB,WAAW,kBAAkB,WAAW,mBAAmB;YAC55B,cAAc;aACb;YACD,cAAc;aACb;YACD,cAAc;aACb,qBAAqB,wCAAwC,gBAAgB,gBAAgB;;;;cAI5F,uBAAuB,cAAc;;;;iBAIlC,oBAAoB,kBAAkB;;;;;;iBAMtC,8BAA8B"}
@@ -1,6 +1,6 @@
1
- import { t as mongoTargetError } from "./mongo-target-errors-Btf3ML1w-B5EMYbz1.mjs";
2
- import { t as mongoTargetDescriptorMeta } from "./descriptor-meta-DTj807jv-C0Hq7wyV.mjs";
3
- import { a as dropCollection, c as renameField, d as unsetField, n as createCollection, o as dropIndex, r as createIndex, s as renameCollection, t as collMod, u as unrewritableFieldNameReason } from "./migration-factories-BqROEHRs-C4K_DHy7.mjs";
1
+ import { t as mongoTargetError } from "./mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs";
2
+ import { t as mongoTargetDescriptorMeta } from "./descriptor-meta-DTj807jv-CjvK2XDD.mjs";
3
+ import { a as dropCollection, c as renameField, d as unsetField, n as createCollection, o as dropIndex, r as createIndex, s as renameCollection, t as collMod, u as unrewritableFieldNameReason } from "./migration-factories-BqROEHRs-CfExMr9r.mjs";
4
4
  import { type } from "arktype";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
6
6
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
@@ -21,7 +21,7 @@ import { Migration } from "@prisma/orm-toolchain/migration-tools/migration";
21
21
  import { resolveRequirementSpecifiers } from "@prisma/orm-framework/components/emission";
22
22
  import { detectScaffoldRuntime, shebangLineFor } from "@prisma/orm-toolchain/migration-tools/migration-ts";
23
23
  import { verifyMongoSchema } from "@prisma/orm-family-mongo/family/schema-verify";
24
- //#region ../../../3-mongo-target/1-mongo-target/dist/control.mjs
24
+ //#region ../../../3-targets/mongo/1-target/dist/control.mjs
25
25
  /**
26
26
  * Mongo target `Namespace` concretion. In Mongo the "namespace" concept
27
27
  * binds to the connection's `db` field — a `MongoTargetDatabase` instance
@@ -2418,4 +2418,4 @@ const mongoTargetDescriptor = {
2418
2418
  //#endregion
2419
2419
  export { schemaIndexToCreateIndexOptions as C, schemaCollectionToCreateCollectionOptions as S, deserializeMongoOp as _, DropIndexCall as a, renderCallsToTypeScript as b, MongoMigrationRunner as c, MongoTargetSchemaVerifier as d, MongoTargetUnboundDatabase as f, UnsetFieldCall as g, RenameFieldCall as h, DropCollectionCall as i, MongoTargetContractSerializer as l, RenameCollectionCall as m, CreateCollectionCall as n, FilterEvaluator as o, PlannerProducedMongoMigration as p, CreateIndexCall as r, MongoMigrationPlanner as s, CollModCall as t, MongoTargetDatabase as u, deserializeMongoOps as v, serializeMongoOps as w, renderOps as x, mongoTargetDescriptor as y };
2420
2420
 
2421
- //# sourceMappingURL=control-DRifdPhB.mjs.map
2421
+ //# sourceMappingURL=control-Cq6qWohQ.mjs.map