@prisma/orm-target-mongo 8.0.0-rc.14-dev.29 → 8.0.0-rc.14-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter.mjs +1 -1
- package/dist/adapter__control.d.mts +1 -17
- package/dist/adapter__control.d.mts.map +1 -1
- package/dist/adapter__control.mjs +19 -67
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/{codecs-DHo_Ei21-DHvEom71.mjs → codecs-Cerz_j1e-DXkrV2OC.mjs} +26 -49
- package/dist/{codecs-DHo_Ei21-DHvEom71.mjs.map → codecs-Cerz_j1e-DXkrV2OC.mjs.map} +1 -1
- package/dist/{codecs-CwHW-tx-.d.mts → codecs-ZeuEqozq.d.mts} +2 -2
- package/dist/{codecs-CwHW-tx-.d.mts.map → codecs-ZeuEqozq.d.mts.map} +1 -1
- package/dist/{control-CxB8dW_m.mjs → control-D7f8sjEI.mjs} +4 -4
- package/dist/{control-CxB8dW_m.mjs.map → control-D7f8sjEI.mjs.map} +1 -1
- package/dist/data-types-CcyIYfyC.d.mts +23 -0
- package/dist/data-types-CcyIYfyC.d.mts.map +1 -0
- package/dist/data-types-D7u1m_Jl-C5XUZspA.mjs +47 -0
- package/dist/data-types-D7u1m_Jl-C5XUZspA.mjs.map +1 -0
- package/dist/{descriptor-meta-DqlqWWFC-ei2sStOs.mjs → descriptor-meta-BvJe0wgx-DG_DuBRV.mjs} +4 -7
- package/dist/descriptor-meta-BvJe0wgx-DG_DuBRV.mjs.map +1 -0
- package/dist/{descriptor-meta-runtime-DAabvKNm-CXYTUnQP.mjs → descriptor-meta-runtime-BaUg63-r-DLJMtO0p.mjs} +4 -4
- package/dist/{descriptor-meta-runtime-DAabvKNm-CXYTUnQP.mjs.map → descriptor-meta-runtime-BaUg63-r-DLJMtO0p.mjs.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__control.mjs.map +1 -1
- package/dist/{mongo-adapter-BW-kRaXm-C3Sw9U9G.mjs → mongo-adapter-BW-kRaXm-DW9VUNEe.mjs} +2 -2
- package/dist/{mongo-adapter-BW-kRaXm-C3Sw9U9G.mjs.map → mongo-adapter-BW-kRaXm-DW9VUNEe.mjs.map} +1 -1
- package/dist/{mongo-driver-DjKJfdSD-BxW_sFJP.mjs → mongo-driver-BqjavuGo-3eG7H_9a.mjs} +3 -3
- package/dist/{mongo-driver-DjKJfdSD-BxW_sFJP.mjs.map → mongo-driver-BqjavuGo-3eG7H_9a.mjs.map} +1 -1
- package/dist/{pack-C5evxnAs.d.mts → pack-4m3yVTQB.d.mts} +1 -4
- package/dist/pack-4m3yVTQB.d.mts.map +1 -0
- package/dist/{prisma6-binding-CzV_iWP8.mjs → prisma6-binding-DxomEFzp.mjs} +2 -2
- package/dist/{prisma6-binding-CzV_iWP8.mjs.map → prisma6-binding-DxomEFzp.mjs.map} +1 -1
- package/dist/target.d.mts +4 -4
- package/dist/target.mjs +5 -5
- package/dist/target__codecs.d.mts +1 -1
- package/dist/target__codecs.mjs +1 -1
- package/dist/target__control.mjs +1 -1
- package/dist/target__data-types.d.mts +2 -2
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__pack.mjs.map +1 -1
- package/dist/target__prisma6-binding.mjs +1 -1
- package/dist/target__runtime.mjs +1 -1
- package/dist/target__runtime.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/data-types-CX8zNsum.d.mts +0 -19
- package/dist/data-types-CX8zNsum.d.mts.map +0 -1
- package/dist/data-types-qKwvSozp-De9Y09D3.mjs +0 -37
- package/dist/data-types-qKwvSozp-De9Y09D3.mjs.map +0 -1
- package/dist/descriptor-meta-DqlqWWFC-ei2sStOs.mjs.map +0 -1
- package/dist/pack-C5evxnAs.d.mts.map +0 -1
package/dist/adapter.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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-BW-kRaXm-
|
|
2
|
+
import { a as lowerStage, i as lowerPipeline, n as lowerAggExpr, r as lowerFilter, t as createMongoAdapter } from "./mongo-adapter-BW-kRaXm-DW9VUNEe.mjs";
|
|
3
3
|
//#region ../../../3-mongo-target/2-mongo-adapter/dist/index.mjs
|
|
4
4
|
const mongoVectorNearOperation = Object.freeze({
|
|
5
5
|
self: { codecId: MONGO_VECTOR_CODEC_ID },
|
|
@@ -70,7 +70,7 @@ declare function extractDb(driver: ControlDriverInstance<'mongo', 'mongo'>): Db;
|
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region src/exports/control.d.ts
|
|
72
72
|
/**
|
|
73
|
-
* The base PSL scalars as zero-arg type constructors in the unified authoring channel.
|
|
73
|
+
* 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.
|
|
74
74
|
*/
|
|
75
75
|
declare const mongoScalarAuthoringTypes: {
|
|
76
76
|
readonly String: {
|
|
@@ -78,7 +78,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
78
78
|
readonly documentation: "Text, stored as BSON string.";
|
|
79
79
|
readonly output: {
|
|
80
80
|
readonly codecId: "mongo/string@1";
|
|
81
|
-
readonly nativeType: "string";
|
|
82
81
|
};
|
|
83
82
|
};
|
|
84
83
|
readonly Int32: {
|
|
@@ -86,7 +85,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
86
85
|
readonly documentation: "A signed 32-bit integer, stored as BSON int.";
|
|
87
86
|
readonly output: {
|
|
88
87
|
readonly codecId: "mongo/int32@1";
|
|
89
|
-
readonly nativeType: "int";
|
|
90
88
|
};
|
|
91
89
|
};
|
|
92
90
|
readonly Bool: {
|
|
@@ -94,7 +92,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
94
92
|
readonly documentation: "A true or false value, stored as BSON bool.";
|
|
95
93
|
readonly output: {
|
|
96
94
|
readonly codecId: "mongo/bool@1";
|
|
97
|
-
readonly nativeType: "bool";
|
|
98
95
|
};
|
|
99
96
|
};
|
|
100
97
|
readonly Date: {
|
|
@@ -102,7 +99,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
102
99
|
readonly documentation: "A date and time with millisecond precision, stored as BSON date.";
|
|
103
100
|
readonly output: {
|
|
104
101
|
readonly codecId: "mongo/date@1";
|
|
105
|
-
readonly nativeType: "date";
|
|
106
102
|
};
|
|
107
103
|
};
|
|
108
104
|
readonly ObjectId: {
|
|
@@ -110,7 +106,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
110
106
|
readonly documentation: "A 12-byte MongoDB identifier, stored as BSON objectId.";
|
|
111
107
|
readonly output: {
|
|
112
108
|
readonly codecId: "mongo/objectId@1";
|
|
113
|
-
readonly nativeType: "objectId";
|
|
114
109
|
};
|
|
115
110
|
};
|
|
116
111
|
readonly Double: {
|
|
@@ -118,7 +113,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
118
113
|
readonly documentation: "A double-precision floating-point number, stored as BSON double.";
|
|
119
114
|
readonly output: {
|
|
120
115
|
readonly codecId: "mongo/double@1";
|
|
121
|
-
readonly nativeType: "double";
|
|
122
116
|
};
|
|
123
117
|
};
|
|
124
118
|
readonly Int64: {
|
|
@@ -126,7 +120,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
126
120
|
readonly documentation: "A signed 64-bit integer read as a bigint, stored as BSON long.";
|
|
127
121
|
readonly output: {
|
|
128
122
|
readonly codecId: "mongo/int64@1";
|
|
129
|
-
readonly nativeType: "long";
|
|
130
123
|
};
|
|
131
124
|
};
|
|
132
125
|
readonly Int64Number: {
|
|
@@ -134,7 +127,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
134
127
|
readonly documentation: "A signed 64-bit integer read as a JavaScript number within its safe integer range, stored as BSON long.";
|
|
135
128
|
readonly output: {
|
|
136
129
|
readonly codecId: "mongo/int64Number@1";
|
|
137
|
-
readonly nativeType: "long";
|
|
138
130
|
};
|
|
139
131
|
};
|
|
140
132
|
readonly Decimal128: {
|
|
@@ -142,7 +134,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
142
134
|
readonly documentation: "A 128-bit decimal read as decimal text without an exponent, stored as BSON decimal.";
|
|
143
135
|
readonly output: {
|
|
144
136
|
readonly codecId: "mongo/decimal128@1";
|
|
145
|
-
readonly nativeType: "decimal";
|
|
146
137
|
};
|
|
147
138
|
};
|
|
148
139
|
readonly Binary: {
|
|
@@ -150,7 +141,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
150
141
|
readonly documentation: "Bytes read as a Uint8Array, stored as BSON binData.";
|
|
151
142
|
readonly output: {
|
|
152
143
|
readonly codecId: "mongo/binary@1";
|
|
153
|
-
readonly nativeType: "binData";
|
|
154
144
|
};
|
|
155
145
|
};
|
|
156
146
|
readonly Json: {
|
|
@@ -158,7 +148,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
158
148
|
readonly documentation: "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.";
|
|
159
149
|
readonly output: {
|
|
160
150
|
readonly codecId: "mongo/json@1";
|
|
161
|
-
readonly nativeType: "json";
|
|
162
151
|
};
|
|
163
152
|
};
|
|
164
153
|
readonly Bson: {
|
|
@@ -166,7 +155,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
166
155
|
readonly documentation: "Any BSON value, read as BsonValue; the collection validator does not constrain it.";
|
|
167
156
|
readonly output: {
|
|
168
157
|
readonly codecId: "mongo/bson@1";
|
|
169
|
-
readonly nativeType: "bson";
|
|
170
158
|
};
|
|
171
159
|
};
|
|
172
160
|
readonly Int: {
|
|
@@ -174,7 +162,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
174
162
|
readonly documentation: "Deprecated: use Int32. A signed 32-bit integer, stored as BSON int.";
|
|
175
163
|
readonly output: {
|
|
176
164
|
readonly codecId: "mongo/int32@1";
|
|
177
|
-
readonly nativeType: "int";
|
|
178
165
|
};
|
|
179
166
|
readonly deprecated: {
|
|
180
167
|
readonly replacement: "Int32";
|
|
@@ -185,7 +172,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
185
172
|
readonly documentation: "Deprecated: use Double. A double-precision floating-point number, stored as BSON double.";
|
|
186
173
|
readonly output: {
|
|
187
174
|
readonly codecId: "mongo/double@1";
|
|
188
|
-
readonly nativeType: "double";
|
|
189
175
|
};
|
|
190
176
|
readonly deprecated: {
|
|
191
177
|
readonly replacement: "Double";
|
|
@@ -196,7 +182,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
196
182
|
readonly documentation: "Deprecated: use Bool. A true or false value, stored as BSON bool.";
|
|
197
183
|
readonly output: {
|
|
198
184
|
readonly codecId: "mongo/bool@1";
|
|
199
|
-
readonly nativeType: "bool";
|
|
200
185
|
};
|
|
201
186
|
readonly deprecated: {
|
|
202
187
|
readonly replacement: "Bool";
|
|
@@ -207,7 +192,6 @@ declare const mongoScalarAuthoringTypes: {
|
|
|
207
192
|
readonly documentation: "Deprecated: use Date. A date and time with millisecond precision, stored as BSON date.";
|
|
208
193
|
readonly output: {
|
|
209
194
|
readonly codecId: "mongo/date@1";
|
|
210
|
-
readonly nativeType: "date";
|
|
211
195
|
};
|
|
212
196
|
readonly deprecated: {
|
|
213
197
|
readonly replacement: "Date";
|
|
@@ -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;;;;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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,6 @@
|
|
|
1
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-BW-kRaXm-
|
|
2
|
+
import { t as createMongoAdapter } from "./mongo-adapter-BW-kRaXm-DW9VUNEe.mjs";
|
|
3
|
+
import { type } from "arktype";
|
|
3
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
5
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
6
|
import { expr, fn } from "@prisma/orm-family-mongo/query-builder";
|
|
@@ -7,7 +8,6 @@ import { collection } from "@prisma/orm-family-mongo/query-builder/contract-free
|
|
|
7
8
|
import { MongoSchemaCollection, MongoSchemaCollectionOptions, MongoSchemaIR, MongoSchemaIndex, MongoSchemaValidator } from "@prisma/orm-family-mongo/schema-ir";
|
|
8
9
|
import { parseMarkerRowSafely, withMarkerReadErrorHandling } from "@prisma/orm-framework/errors/execution";
|
|
9
10
|
import { MongoAggFieldRef, MongoAggLiteral, MongoAggOperator } from "@prisma/orm-family-mongo/query-ast/execution";
|
|
10
|
-
import { type } from "arktype";
|
|
11
11
|
import { MongoServerError } from "mongodb";
|
|
12
12
|
import { ledgerOriginFromStored } from "@prisma/orm-toolchain/migration-tools/ledger-origin";
|
|
13
13
|
//#region ../../../3-mongo-target/2-mongo-adapter/dist/control.mjs
|
|
@@ -363,139 +363,91 @@ var MongoControlAdapterImpl = class {
|
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
365
|
/**
|
|
366
|
-
* The base PSL scalars as zero-arg type constructors in the unified authoring channel.
|
|
366
|
+
* 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.
|
|
367
367
|
*/
|
|
368
368
|
const mongoScalarAuthoringTypes = {
|
|
369
369
|
String: {
|
|
370
370
|
kind: "typeConstructor",
|
|
371
371
|
documentation: "Text, stored as BSON string.",
|
|
372
|
-
output: {
|
|
373
|
-
codecId: MONGO_STRING_CODEC_ID,
|
|
374
|
-
nativeType: "string"
|
|
375
|
-
}
|
|
372
|
+
output: { codecId: MONGO_STRING_CODEC_ID }
|
|
376
373
|
},
|
|
377
374
|
Int32: {
|
|
378
375
|
kind: "typeConstructor",
|
|
379
376
|
documentation: "A signed 32-bit integer, stored as BSON int.",
|
|
380
|
-
output: {
|
|
381
|
-
codecId: MONGO_INT32_CODEC_ID,
|
|
382
|
-
nativeType: "int"
|
|
383
|
-
}
|
|
377
|
+
output: { codecId: MONGO_INT32_CODEC_ID }
|
|
384
378
|
},
|
|
385
379
|
Bool: {
|
|
386
380
|
kind: "typeConstructor",
|
|
387
381
|
documentation: "A true or false value, stored as BSON bool.",
|
|
388
|
-
output: {
|
|
389
|
-
codecId: MONGO_BOOLEAN_CODEC_ID,
|
|
390
|
-
nativeType: "bool"
|
|
391
|
-
}
|
|
382
|
+
output: { codecId: MONGO_BOOLEAN_CODEC_ID }
|
|
392
383
|
},
|
|
393
384
|
Date: {
|
|
394
385
|
kind: "typeConstructor",
|
|
395
386
|
documentation: "A date and time with millisecond precision, stored as BSON date.",
|
|
396
|
-
output: {
|
|
397
|
-
codecId: MONGO_DATE_CODEC_ID,
|
|
398
|
-
nativeType: "date"
|
|
399
|
-
}
|
|
387
|
+
output: { codecId: MONGO_DATE_CODEC_ID }
|
|
400
388
|
},
|
|
401
389
|
ObjectId: {
|
|
402
390
|
kind: "typeConstructor",
|
|
403
391
|
documentation: "A 12-byte MongoDB identifier, stored as BSON objectId.",
|
|
404
|
-
output: {
|
|
405
|
-
codecId: MONGO_OBJECTID_CODEC_ID,
|
|
406
|
-
nativeType: "objectId"
|
|
407
|
-
}
|
|
392
|
+
output: { codecId: MONGO_OBJECTID_CODEC_ID }
|
|
408
393
|
},
|
|
409
394
|
Double: {
|
|
410
395
|
kind: "typeConstructor",
|
|
411
396
|
documentation: "A double-precision floating-point number, stored as BSON double.",
|
|
412
|
-
output: {
|
|
413
|
-
codecId: MONGO_DOUBLE_CODEC_ID,
|
|
414
|
-
nativeType: "double"
|
|
415
|
-
}
|
|
397
|
+
output: { codecId: MONGO_DOUBLE_CODEC_ID }
|
|
416
398
|
},
|
|
417
399
|
Int64: {
|
|
418
400
|
kind: "typeConstructor",
|
|
419
401
|
documentation: "A signed 64-bit integer read as a bigint, stored as BSON long.",
|
|
420
|
-
output: {
|
|
421
|
-
codecId: MONGO_INT64_CODEC_ID,
|
|
422
|
-
nativeType: "long"
|
|
423
|
-
}
|
|
402
|
+
output: { codecId: MONGO_INT64_CODEC_ID }
|
|
424
403
|
},
|
|
425
404
|
Int64Number: {
|
|
426
405
|
kind: "typeConstructor",
|
|
427
406
|
documentation: "A signed 64-bit integer read as a JavaScript number within its safe integer range, stored as BSON long.",
|
|
428
|
-
output: {
|
|
429
|
-
codecId: MONGO_INT64_NUMBER_CODEC_ID,
|
|
430
|
-
nativeType: "long"
|
|
431
|
-
}
|
|
407
|
+
output: { codecId: MONGO_INT64_NUMBER_CODEC_ID }
|
|
432
408
|
},
|
|
433
409
|
Decimal128: {
|
|
434
410
|
kind: "typeConstructor",
|
|
435
411
|
documentation: "A 128-bit decimal read as decimal text without an exponent, stored as BSON decimal.",
|
|
436
|
-
output: {
|
|
437
|
-
codecId: MONGO_DECIMAL128_CODEC_ID,
|
|
438
|
-
nativeType: "decimal"
|
|
439
|
-
}
|
|
412
|
+
output: { codecId: MONGO_DECIMAL128_CODEC_ID }
|
|
440
413
|
},
|
|
441
414
|
Binary: {
|
|
442
415
|
kind: "typeConstructor",
|
|
443
416
|
documentation: "Bytes read as a Uint8Array, stored as BSON binData.",
|
|
444
|
-
output: {
|
|
445
|
-
codecId: MONGO_BINARY_CODEC_ID,
|
|
446
|
-
nativeType: "binData"
|
|
447
|
-
}
|
|
417
|
+
output: { codecId: MONGO_BINARY_CODEC_ID }
|
|
448
418
|
},
|
|
449
419
|
Json: {
|
|
450
420
|
kind: "typeConstructor",
|
|
451
421
|
documentation: "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.",
|
|
452
|
-
output: {
|
|
453
|
-
codecId: MONGO_JSON_CODEC_ID,
|
|
454
|
-
nativeType: "json"
|
|
455
|
-
}
|
|
422
|
+
output: { codecId: MONGO_JSON_CODEC_ID }
|
|
456
423
|
},
|
|
457
424
|
Bson: {
|
|
458
425
|
kind: "typeConstructor",
|
|
459
426
|
documentation: "Any BSON value, read as BsonValue; the collection validator does not constrain it.",
|
|
460
|
-
output: {
|
|
461
|
-
codecId: MONGO_BSON_CODEC_ID,
|
|
462
|
-
nativeType: "bson"
|
|
463
|
-
}
|
|
427
|
+
output: { codecId: MONGO_BSON_CODEC_ID }
|
|
464
428
|
},
|
|
465
429
|
Int: {
|
|
466
430
|
kind: "typeConstructor",
|
|
467
431
|
documentation: "Deprecated: use Int32. A signed 32-bit integer, stored as BSON int.",
|
|
468
|
-
output: {
|
|
469
|
-
codecId: MONGO_INT32_CODEC_ID,
|
|
470
|
-
nativeType: "int"
|
|
471
|
-
},
|
|
432
|
+
output: { codecId: MONGO_INT32_CODEC_ID },
|
|
472
433
|
deprecated: { replacement: "Int32" }
|
|
473
434
|
},
|
|
474
435
|
Float: {
|
|
475
436
|
kind: "typeConstructor",
|
|
476
437
|
documentation: "Deprecated: use Double. A double-precision floating-point number, stored as BSON double.",
|
|
477
|
-
output: {
|
|
478
|
-
codecId: MONGO_DOUBLE_CODEC_ID,
|
|
479
|
-
nativeType: "double"
|
|
480
|
-
},
|
|
438
|
+
output: { codecId: MONGO_DOUBLE_CODEC_ID },
|
|
481
439
|
deprecated: { replacement: "Double" }
|
|
482
440
|
},
|
|
483
441
|
Boolean: {
|
|
484
442
|
kind: "typeConstructor",
|
|
485
443
|
documentation: "Deprecated: use Bool. A true or false value, stored as BSON bool.",
|
|
486
|
-
output: {
|
|
487
|
-
codecId: MONGO_BOOLEAN_CODEC_ID,
|
|
488
|
-
nativeType: "bool"
|
|
489
|
-
},
|
|
444
|
+
output: { codecId: MONGO_BOOLEAN_CODEC_ID },
|
|
490
445
|
deprecated: { replacement: "Bool" }
|
|
491
446
|
},
|
|
492
447
|
DateTime: {
|
|
493
448
|
kind: "typeConstructor",
|
|
494
449
|
documentation: "Deprecated: use Date. A date and time with millisecond precision, stored as BSON date.",
|
|
495
|
-
output: {
|
|
496
|
-
codecId: MONGO_DATE_CODEC_ID,
|
|
497
|
-
nativeType: "date"
|
|
498
|
-
},
|
|
450
|
+
output: { codecId: MONGO_DATE_CODEC_ID },
|
|
499
451
|
deprecated: { replacement: "Date" }
|
|
500
452
|
}
|
|
501
453
|
};
|
|
@@ -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-BW-kRaXm.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. For a codec with one BSON type, `nativeType` is that type (`codecLookup.targetTypesFor(codecId)[0]`). `Json` (several BSON types) and `Bson` (none) have a `nativeType` that names the codec instead; the validator reads the codec's `targetTypes` list, not this value.\n*/\nconst mongoScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Text, stored as BSON string.\",\n\t\toutput: {\n\t\t\tcodecId: MONGO_STRING_CODEC_ID,\n\t\t\tnativeType: \"string\"\n\t\t}\n\t},\n\tInt32: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 32-bit integer, stored as BSON int.\",\n\t\toutput: {\n\t\t\tcodecId: MONGO_INT32_CODEC_ID,\n\t\t\tnativeType: \"int\"\n\t\t}\n\t},\n\tBool: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A true or false value, stored as BSON bool.\",\n\t\toutput: {\n\t\t\tcodecId: MONGO_BOOLEAN_CODEC_ID,\n\t\t\tnativeType: \"bool\"\n\t\t}\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: {\n\t\t\tcodecId: MONGO_DATE_CODEC_ID,\n\t\t\tnativeType: \"date\"\n\t\t}\n\t},\n\tObjectId: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A 12-byte MongoDB identifier, stored as BSON objectId.\",\n\t\toutput: {\n\t\t\tcodecId: MONGO_OBJECTID_CODEC_ID,\n\t\t\tnativeType: \"objectId\"\n\t\t}\n\t},\n\tDouble: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A double-precision floating-point number, stored as BSON double.\",\n\t\toutput: {\n\t\t\tcodecId: MONGO_DOUBLE_CODEC_ID,\n\t\t\tnativeType: \"double\"\n\t\t}\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: {\n\t\t\tcodecId: MONGO_INT64_CODEC_ID,\n\t\t\tnativeType: \"long\"\n\t\t}\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: {\n\t\t\tcodecId: MONGO_INT64_NUMBER_CODEC_ID,\n\t\t\tnativeType: \"long\"\n\t\t}\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: {\n\t\t\tcodecId: MONGO_DECIMAL128_CODEC_ID,\n\t\t\tnativeType: \"decimal\"\n\t\t}\n\t},\n\tBinary: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Bytes read as a Uint8Array, stored as BSON binData.\",\n\t\toutput: {\n\t\t\tcodecId: MONGO_BINARY_CODEC_ID,\n\t\t\tnativeType: \"binData\"\n\t\t}\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: {\n\t\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\t\tnativeType: \"json\"\n\t\t}\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: {\n\t\t\tcodecId: MONGO_BSON_CODEC_ID,\n\t\t\tnativeType: \"bson\"\n\t\t}\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: {\n\t\t\tcodecId: MONGO_INT32_CODEC_ID,\n\t\t\tnativeType: \"int\"\n\t\t},\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: {\n\t\t\tcodecId: MONGO_DOUBLE_CODEC_ID,\n\t\t\tnativeType: \"double\"\n\t\t},\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: {\n\t\t\tcodecId: MONGO_BOOLEAN_CODEC_ID,\n\t\t\tnativeType: \"bool\"\n\t\t},\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: {\n\t\t\tcodecId: MONGO_DATE_CODEC_ID,\n\t\t\tnativeType: \"date\"\n\t\t},\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\ttypeImports: [{\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"Vector\",\n\t\t\talias: \"Vector\"\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;CAC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;EACJ,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;EACA,YAAY,EAAE,aAAa,QAAQ;CACpC;CACA,OAAO;EACN,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;EACA,YAAY,EAAE,aAAa,SAAS;CACrC;CACA,SAAS;EACR,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;EACA,YAAY,EAAE,aAAa,OAAO;CACnC;CACA,UAAU;EACT,MAAM;EACN,eAAe;EACf,QAAQ;GACP,SAAS;GACT,YAAY;EACb;EACA,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,aAAa,CAAC;GACb,SAAS;GACT,OAAO;GACP,OAAO;EACR,CAAC;CACF,EAAE;CACF,OAAO,QAAQ;EACd,OAAO,IAAI,wBAAwB;CACpC;AACD"}
|
|
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-BW-kRaXm.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\ttypeImports: [{\n\t\t\tpackage: \"@internal/target-mongo/codec-types\",\n\t\t\tnamed: \"Vector\",\n\t\t\talias: \"Vector\"\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;CACl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AAO;CACnC;CACA,UAAU;EACT,MAAM;EACN,eAAe;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,aAAa,CAAC;GACb,SAAS;GACT,OAAO;GACP,OAAO;EACR,CAAC;CACF,EAAE;CACF,OAAO,QAAQ;EACd,OAAO,IAAI,wBAAwB;CACpC;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as buildStandardCodecRegistry } from "./codecs-
|
|
2
|
-
import { t as createMongoAdapter } from "./mongo-adapter-BW-kRaXm-
|
|
1
|
+
import { t as buildStandardCodecRegistry } from "./codecs-Cerz_j1e-DXkrV2OC.mjs";
|
|
2
|
+
import { t as createMongoAdapter } from "./mongo-adapter-BW-kRaXm-DW9VUNEe.mjs";
|
|
3
3
|
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-mongo/family/runtime";
|
|
4
4
|
//#region ../../../3-mongo-target/2-mongo-adapter/dist/runtime.mjs
|
|
5
5
|
const mongoRuntimeAdapterDescriptor = {
|