@prisma/orm-target-mongo 8.0.0-rc.23 → 8.0.0-rc.23-dev.2
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__control.d.mts +1 -130
- package/dist/adapter__control.d.mts.map +1 -1
- package/dist/adapter__control.mjs +1 -92
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/{control-BSgJpq4Q.mjs → control-CdHPs2QG.mjs} +2 -2
- package/dist/{control-BSgJpq4Q.mjs.map → control-CdHPs2QG.mjs.map} +1 -1
- package/dist/{control-BYZ-UDsA.mjs → control-Dw8fP7bw.mjs} +2 -2
- package/dist/{control-BYZ-UDsA.mjs.map → control-Dw8fP7bw.mjs.map} +1 -1
- package/dist/{descriptor-meta-DdTdXKXe-BTdDXEpH.mjs → descriptor-meta-_vnrMWD4-CXzRuo6u.mjs} +107 -4
- package/dist/descriptor-meta-_vnrMWD4-CXzRuo6u.mjs.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.mjs +1 -1
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/{mongo-driver-D3EjMgVu-lQJcIey3.mjs → mongo-driver-8Nv9x9Th-C0WRFFRY.mjs} +3 -3
- package/dist/mongo-driver-8Nv9x9Th-C0WRFFRY.mjs.map +1 -0
- package/dist/pack-BJLQkv5o.d.mts +433 -0
- package/dist/pack-BJLQkv5o.d.mts.map +1 -0
- package/dist/target.d.mts +1 -1
- package/dist/target.mjs +1 -1
- package/dist/target__control.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__pack.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/descriptor-meta-DdTdXKXe-BTdDXEpH.mjs.map +0 -1
- package/dist/mongo-driver-D3EjMgVu-lQJcIey3.mjs.map +0 -1
- package/dist/pack-xD2XwjJr.d.mts +0 -140
- package/dist/pack-xD2XwjJr.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MongoDriverImpl, r as mongoDriverDescriptorMeta, t as DRIVER_INFO } from "./mongo-driver-
|
|
1
|
+
import { n as MongoDriverImpl, r as mongoDriverDescriptorMeta, t as DRIVER_INFO } from "./mongo-driver-8Nv9x9Th-C0WRFFRY.mjs";
|
|
2
2
|
import { MongoClient } from "mongodb";
|
|
3
3
|
import { errorRuntime } from "@prisma/orm-framework/errors/execution";
|
|
4
4
|
import { redactDatabaseUrl } from "@prisma/orm-framework/utils/redact-db-url";
|
|
@@ -42,4 +42,4 @@ const mongoControlDriverDescriptor = {
|
|
|
42
42
|
//#endregion
|
|
43
43
|
export { mongoControlDriverDescriptor as n, MongoControlDriver as t };
|
|
44
44
|
|
|
45
|
-
//# sourceMappingURL=control-
|
|
45
|
+
//# sourceMappingURL=control-Dw8fP7bw.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-
|
|
1
|
+
{"version":3,"file":"control-Dw8fP7bw.mjs","names":[],"sources":["../../../../3-targets/mongo/3-driver/dist/control.mjs"],"sourcesContent":["import { n as mongoDriverDescriptorMeta, r as DRIVER_INFO, t as MongoDriverImpl } from \"./mongo-driver-8Nv9x9Th.mjs\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\nimport { MongoClient } from \"mongodb\";\n//#region src/exports/control.ts\nvar MongoControlDriver = class extends MongoDriverImpl {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\tdb;\n\tconstructor(db, mongoClient) {\n\t\tsuper(db, mongoClient);\n\t\tthis.db = db;\n\t}\n\tasync databaseName() {\n\t\treturn this.db.databaseName;\n\t}\n};\nconst mongoControlDriverDescriptor = {\n\t...mongoDriverDescriptorMeta,\n\tasync create(url) {\n\t\tconst client = new MongoClient(url, {\n\t\t\tserverSelectionTimeoutMS: 5e3,\n\t\t\tconnectTimeoutMS: 5e3,\n\t\t\tdriverInfo: DRIVER_INFO\n\t\t});\n\t\ttry {\n\t\t\tawait client.connect();\n\t\t\treturn new MongoControlDriver(client.db(), client);\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait client.close();\n\t\t\t} catch {}\n\t\t\tthrow errorRuntime(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tfix: \"Verify the MongoDB URL, ensure the database is reachable, and confirm credentials/permissions\",\n\t\t\t\tmeta: { ...redactDatabaseUrl(url) },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { MongoControlDriver, mongoControlDriverDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;AAKA,IAAI,qBAAqB,cAAc,gBAAgB;CACtD,WAAW;CACX,WAAW;CACX;CACA,YAAY,IAAI,aAAa;EAC5B,MAAM,IAAI,WAAW;EACrB,KAAK,KAAK;CACX;CACA,MAAM,eAAe;EACpB,OAAO,KAAK,GAAG;CAChB;AACD;AACA,MAAM,+BAA+B;CACpC,GAAG;CACH,MAAM,OAAO,KAAK;EACjB,MAAM,SAAS,IAAI,YAAY,KAAK;GACnC,0BAA0B;GAC1B,kBAAkB;GAClB,YAAY;EACb,CAAC;EACD,IAAI;GACH,MAAM,OAAO,QAAQ;GACrB,OAAO,IAAI,mBAAmB,OAAO,GAAG,GAAG,MAAM;EAClD,SAAS,OAAO;GACf,IAAI;IACH,MAAM,OAAO,MAAM;GACpB,QAAQ,CAAC;GACT,MAAM,aAAa,4BAA4B,8BAA8B;IAC5E,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC1D,KAAK;IACL,MAAM,EAAE,GAAG,kBAAkB,GAAG,EAAE;IAClC,OAAO;GACR,CAAC;EACF;CACD;AACD"}
|
package/dist/{descriptor-meta-DdTdXKXe-BTdDXEpH.mjs → descriptor-meta-_vnrMWD4-CXzRuo6u.mjs}
RENAMED
|
@@ -1,12 +1,115 @@
|
|
|
1
|
-
import { i as MONGO_DATE_CODEC_ID } from "./codec-ids-WdrumsYA-CZVjuKW8.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
2
|
import { A as isBase64Text, B as mongoInt32, G as mongoTextDataTypes, H as mongoJson, L as mongoDate, N as mongoBinary, P as mongoBool, R as mongoDecimal128, V as mongoInt64, W as mongoString, g as decimal128HoldsExactly, z as mongoDouble } from "./data-types-hoKLBrYZ-h9cAgbOy.mjs";
|
|
3
3
|
import { t as mongoTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-M_DCE9pk-BltR3MLY.mjs";
|
|
4
4
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
5
|
import { createNumberClassifier, isoDateStringText, numeralText, parseJsonText, printJsonText, signedRange } from "@prisma/orm-framework/components/codec";
|
|
6
6
|
import { TIMESTAMP_NOW_GENERATOR_ID, temporalTypeAliases } from "@prisma/orm-framework/components/authoring";
|
|
7
7
|
import { singleGeneratorBinding } from "@prisma/orm-framework/components/components";
|
|
8
|
-
//#region ../../../3-targets/mongo/1-target/dist/descriptor-meta-
|
|
9
|
-
const mongoAuthoringTypes = {
|
|
8
|
+
//#region ../../../3-targets/mongo/1-target/dist/descriptor-meta-_vnrMWD4.mjs
|
|
9
|
+
const mongoAuthoringTypes = {
|
|
10
|
+
String: {
|
|
11
|
+
kind: "typeConstructor",
|
|
12
|
+
documentation: "Text, stored as BSON string.",
|
|
13
|
+
output: { codecId: MONGO_STRING_CODEC_ID }
|
|
14
|
+
},
|
|
15
|
+
Int32: {
|
|
16
|
+
kind: "typeConstructor",
|
|
17
|
+
documentation: "A signed 32-bit integer, stored as BSON int.",
|
|
18
|
+
output: { codecId: MONGO_INT32_CODEC_ID }
|
|
19
|
+
},
|
|
20
|
+
Bool: {
|
|
21
|
+
kind: "typeConstructor",
|
|
22
|
+
documentation: "A true or false value, stored as BSON bool.",
|
|
23
|
+
output: { codecId: MONGO_BOOLEAN_CODEC_ID }
|
|
24
|
+
},
|
|
25
|
+
Date: {
|
|
26
|
+
kind: "typeConstructor",
|
|
27
|
+
documentation: "A date and time with millisecond precision, stored as BSON date.",
|
|
28
|
+
output: { codecId: MONGO_DATE_CODEC_ID }
|
|
29
|
+
},
|
|
30
|
+
ObjectId: {
|
|
31
|
+
kind: "typeConstructor",
|
|
32
|
+
documentation: "A 12-byte MongoDB identifier, stored as BSON objectId.",
|
|
33
|
+
output: { codecId: MONGO_OBJECTID_CODEC_ID }
|
|
34
|
+
},
|
|
35
|
+
Double: {
|
|
36
|
+
kind: "typeConstructor",
|
|
37
|
+
documentation: "A double-precision floating-point number, stored as BSON double.",
|
|
38
|
+
output: { codecId: MONGO_DOUBLE_CODEC_ID }
|
|
39
|
+
},
|
|
40
|
+
Int64: {
|
|
41
|
+
kind: "typeConstructor",
|
|
42
|
+
documentation: "A signed 64-bit integer read as a bigint, stored as BSON long.",
|
|
43
|
+
output: { codecId: MONGO_INT64_CODEC_ID }
|
|
44
|
+
},
|
|
45
|
+
Int64Number: {
|
|
46
|
+
kind: "typeConstructor",
|
|
47
|
+
documentation: "A signed 64-bit integer read as a JavaScript number within its safe integer range, stored as BSON long.",
|
|
48
|
+
output: { codecId: MONGO_INT64_NUMBER_CODEC_ID }
|
|
49
|
+
},
|
|
50
|
+
Decimal128: {
|
|
51
|
+
kind: "typeConstructor",
|
|
52
|
+
documentation: "A 128-bit decimal read as decimal text without an exponent, stored as BSON decimal.",
|
|
53
|
+
output: { codecId: MONGO_DECIMAL128_CODEC_ID }
|
|
54
|
+
},
|
|
55
|
+
Binary: {
|
|
56
|
+
kind: "typeConstructor",
|
|
57
|
+
documentation: "Bytes read as a Uint8Array, stored as BSON binData.",
|
|
58
|
+
output: { codecId: MONGO_BINARY_CODEC_ID }
|
|
59
|
+
},
|
|
60
|
+
Json: {
|
|
61
|
+
kind: "typeConstructor",
|
|
62
|
+
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.",
|
|
63
|
+
output: { codecId: MONGO_JSON_CODEC_ID }
|
|
64
|
+
},
|
|
65
|
+
Bson: {
|
|
66
|
+
kind: "typeConstructor",
|
|
67
|
+
documentation: "Any BSON value, read as BsonValue; the collection validator does not constrain it.",
|
|
68
|
+
output: { codecId: MONGO_BSON_CODEC_ID }
|
|
69
|
+
},
|
|
70
|
+
Vector: {
|
|
71
|
+
kind: "typeConstructor",
|
|
72
|
+
documentation: "A list of finite numbers, stored as BSON array, as a vector search index reads it. With a length, it is read as Vector<length>.",
|
|
73
|
+
args: [{
|
|
74
|
+
kind: "value",
|
|
75
|
+
dataType: "mongo/int32",
|
|
76
|
+
name: "length",
|
|
77
|
+
optional: true
|
|
78
|
+
}],
|
|
79
|
+
output: {
|
|
80
|
+
codecId: MONGO_VECTOR_CODEC_ID,
|
|
81
|
+
typeParams: { length: {
|
|
82
|
+
kind: "arg",
|
|
83
|
+
index: 0
|
|
84
|
+
} }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
Int: {
|
|
88
|
+
kind: "typeConstructor",
|
|
89
|
+
documentation: "Deprecated: use Int32. A signed 32-bit integer, stored as BSON int.",
|
|
90
|
+
output: { codecId: MONGO_INT32_CODEC_ID },
|
|
91
|
+
deprecated: { replacement: "Int32" }
|
|
92
|
+
},
|
|
93
|
+
Float: {
|
|
94
|
+
kind: "typeConstructor",
|
|
95
|
+
documentation: "Deprecated: use Double. A double-precision floating-point number, stored as BSON double.",
|
|
96
|
+
output: { codecId: MONGO_DOUBLE_CODEC_ID },
|
|
97
|
+
deprecated: { replacement: "Double" }
|
|
98
|
+
},
|
|
99
|
+
Boolean: {
|
|
100
|
+
kind: "typeConstructor",
|
|
101
|
+
documentation: "Deprecated: use Bool. A true or false value, stored as BSON bool.",
|
|
102
|
+
output: { codecId: MONGO_BOOLEAN_CODEC_ID },
|
|
103
|
+
deprecated: { replacement: "Bool" }
|
|
104
|
+
},
|
|
105
|
+
DateTime: {
|
|
106
|
+
kind: "typeConstructor",
|
|
107
|
+
documentation: "Deprecated: use Date. A date and time with millisecond precision, stored as BSON date.",
|
|
108
|
+
output: { codecId: MONGO_DATE_CODEC_ID },
|
|
109
|
+
deprecated: { replacement: "Date" }
|
|
110
|
+
},
|
|
111
|
+
temporal: temporalTypeAliases({ codecId: MONGO_DATE_CODEC_ID }, "a JavaScript Date")
|
|
112
|
+
};
|
|
10
113
|
const classifyAsDecimal = createNumberClassifier({
|
|
11
114
|
integers: [{
|
|
12
115
|
type: mongoInt32.id,
|
|
@@ -137,4 +240,4 @@ const mongoTargetDescriptorMeta = {
|
|
|
137
240
|
//#endregion
|
|
138
241
|
export { mongoTargetDescriptorMeta as t };
|
|
139
242
|
|
|
140
|
-
//# sourceMappingURL=descriptor-meta-
|
|
243
|
+
//# sourceMappingURL=descriptor-meta-_vnrMWD4-CXzRuo6u.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-_vnrMWD4-CXzRuo6u.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/descriptor-meta-_vnrMWD4.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 { L as decimal128HoldsExactly, Y as isBase64Text, a as mongoDate, c as mongoInt32, f as mongoString, l as mongoInt64, n as mongoBool, o as mongoDecimal128, p as mongoTextDataTypes, s as mongoDouble, t as mongoBinary, u as mongoJson } from \"./data-types-hoKLBrYZ.mjs\";\nimport { t as mongoTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-M_DCE9pk.mjs\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalTypeAliases } from \"@internal/framework-components/authoring\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { createNumberClassifier, isoDateStringText, numeralText, parseJsonText, printJsonText, signedRange } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nconst mongoAuthoringTypes = {\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\tVector: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A list of finite numbers, stored as BSON array, as a vector search index reads it. With a length, it is read as Vector<length>.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: \"mongo/int32\",\n\t\t\tname: \"length\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: MONGO_VECTOR_CODEC_ID,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\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: { 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\ttemporal: temporalTypeAliases({ codecId: MONGO_DATE_CODEC_ID }, \"a JavaScript Date\")\n};\n//#endregion\n//#region src/core/data-type-entries.ts\nconst classifyAsDecimal = createNumberClassifier({\n\tintegers: [{\n\t\ttype: mongoInt32.id,\n\t\tform: \"number\",\n\t\t...signedRange(32)\n\t}, {\n\t\ttype: mongoInt64.id,\n\t\tform: \"text\",\n\t\t...signedRange(64)\n\t}],\n\tlargerWhole: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t},\n\tfraction: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t},\n\twords: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t}\n});\n/** The type of a written number: a `decimal` only when a Decimal128 holds it exactly, else the `double` nearest it. */\nfunction classifyMongoNumber(text) {\n\tconst classified = classifyAsDecimal(text);\n\tif (classified?.type !== mongoDecimal128.id || decimal128HoldsExactly(String(classified.value))) return classified;\n\tconst double = Number(text);\n\treturn Number.isFinite(double) ? {\n\t\ttype: mongoDouble.id,\n\t\tvalue: double\n\t} : void 0;\n}\nfunction printNumber(value) {\n\treturn typeof value === \"number\" ? numeralText(value) : String(value);\n}\nfunction base64Text(text) {\n\tif (isBase64Text(text)) return text;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `\"${text}\" is not base64 text: write the bytes in base64, as in binary\\`aGVsbG8=\\`.`, {\n\t\twhy: \"The binary tag reads bytes as base64, as MongoDB prints them.\",\n\t\tfix: \"Write the bytes in base64, as in binary`aGVsbG8=`.\"\n\t});\n}\nfunction mongoDataTypeEntries() {\n\treturn {\n\t\t[mongoString.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"string\",\n\t\t\t\tparse: (text) => text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Text.\"\n\t\t},\n\t\t[mongoBool.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"boolean\",\n\t\t\t\tparse: (text) => text === \"true\"\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A boolean, written true or false.\"\n\t\t},\n\t\t[mongoDouble.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"number\",\n\t\t\t\ttypes: [\n\t\t\t\t\tmongoInt32.id,\n\t\t\t\t\tmongoInt64.id,\n\t\t\t\t\tmongoDecimal128.id,\n\t\t\t\t\tmongoDouble.id\n\t\t\t\t],\n\t\t\t\tclassify: classifyMongoNumber\n\t\t\t},\n\t\t\tprint: printNumber,\n\t\t\tdocumentation: \"A number: an int in 32 bits, a long in 64, a decimal when a Decimal128 holds it exactly, NaN and the infinities included, and a double otherwise.\"\n\t\t},\n\t\t[mongoDate.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"date\",\n\t\t\t\tparse: (text) => isoDateStringText(text, mongoDate.id)\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"An instant, as in date`2024-01-01T00:00:00Z`. Reads ISO 8601 with a UTC offset and stores the instant in UTC with three fraction digits, as Date.toISOString() writes it.\"\n\t\t},\n\t\t[mongoBinary.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"binary\",\n\t\t\t\tparse: base64Text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Bytes, written in base64 as MongoDB prints them, as in binary`aGVsbG8=`.\"\n\t\t},\n\t\t[mongoJson.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"json\",\n\t\t\t\tparse: parseJsonText\n\t\t\t},\n\t\t\tprint: printJsonText,\n\t\t\tdocumentation: \"Reads the text as a JSON document and stores it as the value.\"\n\t\t}\n\t};\n}\nconst mongoTargetDescriptorMeta = {\n\t...mongoTargetDescriptorMetaRuntime,\n\tauthoring: {\n\t\ttype: mongoAuthoringTypes,\n\t\tdataTypes: mongoDataTypeEntries(),\n\t\ttextDataTypes: mongoTextDataTypes\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: [{ id: TIMESTAMP_NOW_GENERATOR_ID }]\n\t},\n\tgeneratorFunctions: [{\n\t\tname: \"now\",\n\t\tsignature: { documentation: \"Writes the current time.\" },\n\t\tbindings: [singleGeneratorBinding({\n\t\t\tcodecIds: [MONGO_DATE_CODEC_ID],\n\t\t\tgeneratorId: TIMESTAMP_NOW_GENERATOR_ID\n\t\t})]\n\t}]\n};\n//#endregion\nexport { mongoTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-_vnr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AS;IACR,MAAM;IACN,QAAQ;IACR,QAAQ,SAAS;GAClB;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,QAAQ;IACR,QAAQ,SAAS,SAAS;GAC3B;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,YAAY,KAAK;GACjB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,OAAO;KACN,WAAW;KACX,WAAW;KACX,gBAAgB;KAChB,YAAY;IACb;IACA,UAAU;GACX;GACA,OAAO;GACP,eAAe;EAChB;GACC,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,KAAK;IACL,QAAQ,SAAS,kBAAkB,MAAM,UAAU,EAAE;GACtD;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,YAAY,KAAK;GACjB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,OAAO;GACP,eAAe;EAChB;CACD;AACD;AACA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,WAAW,qBAAqB;EAChC,eAAe;CAChB;CACA,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB,CAAC,EAAE,IAAI,2BAA2B,CAAC;CAC1D;CACA,oBAAoB,CAAC;EACpB,MAAM;EACN,WAAW,EAAE,eAAe,2BAA2B;EACvD,UAAU,CAAC,uBAAuB;GACjC,UAAU,CAAC,mBAAmB;GAC9B,aAAa;EACd,CAAC,CAAC;CACH,CAAC;AACF"}
|
package/dist/driver.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MongoControlDriver } from "./control-
|
|
1
|
+
import { t as MongoControlDriver } from "./control-Dw8fP7bw.mjs";
|
|
2
2
|
export { MongoControlDriver };
|
package/dist/driver__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mongoControlDriverDescriptor, t as MongoControlDriver } from "./control-
|
|
1
|
+
import { n as mongoControlDriverDescriptor, t as MongoControlDriver } from "./control-Dw8fP7bw.mjs";
|
|
2
2
|
export { MongoControlDriver, mongoControlDriverDescriptor as default };
|
package/dist/driver__runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MongoDriverImpl, r as mongoDriverDescriptorMeta } from "./mongo-driver-
|
|
1
|
+
import { n as MongoDriverImpl, r as mongoDriverDescriptorMeta } from "./mongo-driver-8Nv9x9Th-C0WRFFRY.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
//#region ../../../3-targets/mongo/3-driver/dist/runtime.mjs
|
|
4
4
|
const notConnectedMessages = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver__runtime.mjs","names":["#disconnectedState","#delegate","#notConnectedError","#connecting","#requireDelegate"],"sources":["../../../../3-targets/mongo/3-driver/dist/runtime.mjs"],"sourcesContent":["import { n as mongoDriverDescriptorMeta, t as MongoDriverImpl } from \"./mongo-driver-
|
|
1
|
+
{"version":3,"file":"driver__runtime.mjs","names":["#disconnectedState","#delegate","#notConnectedError","#connecting","#requireDelegate"],"sources":["../../../../3-targets/mongo/3-driver/dist/runtime.mjs"],"sourcesContent":["import { n as mongoDriverDescriptorMeta, t as MongoDriverImpl } from \"./mongo-driver-8Nv9x9Th.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/runtime/mongo-runtime-driver.ts\nconst notConnectedMessages = {\n\tunbound: \"Mongo driver not connected. Call connect(binding) before execute or run.\",\n\tclosed: \"Mongo driver is closed. Call connect(binding) to reconnect.\"\n};\nconst ALREADY_CONNECTED_MESSAGE = \"Mongo driver already connected. Call close() before reconnecting with a new binding.\";\nasync function connectedDriver(binding) {\n\tif (binding.kind === \"mongoClient\") return MongoDriverImpl.fromDb(binding.client.db(binding.dbName));\n\treturn MongoDriverImpl.fromConnection(binding.url, binding.dbName);\n}\nvar MongoUnboundDriverImpl = class {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\t#delegate = null;\n\t#connecting = null;\n\t#disconnectedState = \"unbound\";\n\t#notConnectedError() {\n\t\treturn structuredError(\"DRIVER.NOT_CONNECTED\", notConnectedMessages[this.#disconnectedState]);\n\t}\n\t#requireDelegate() {\n\t\tif (this.#delegate === null) throw this.#notConnectedError();\n\t\treturn this.#delegate;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#delegate !== null || this.#connecting !== null) throw structuredError(\"DRIVER.ALREADY_CONNECTED\", ALREADY_CONNECTED_MESSAGE, { meta: { bindingKind: binding.kind } });\n\t\tconst connecting = connectedDriver(binding);\n\t\tthis.#connecting = connecting;\n\t\ttry {\n\t\t\tconst delegate = await connecting;\n\t\t\tif (this.#connecting !== connecting) throw this.#notConnectedError();\n\t\t\tthis.#delegate = delegate;\n\t\t\tthis.#disconnectedState = \"unbound\";\n\t\t} finally {\n\t\t\tif (this.#connecting === connecting) this.#connecting = null;\n\t\t}\n\t}\n\tasync *execute(wireCommand) {\n\t\tyield* this.#requireDelegate().execute(wireCommand);\n\t}\n\tasync run(wireCommand) {\n\t\treturn this.#requireDelegate().run(wireCommand);\n\t}\n\tasync close() {\n\t\tconst delegate = this.#delegate;\n\t\tconst connecting = this.#connecting;\n\t\tthis.#delegate = null;\n\t\tthis.#connecting = null;\n\t\tthis.#disconnectedState = \"closed\";\n\t\tconst connected = await connecting?.catch(() => null);\n\t\tawait Promise.all([delegate?.close(), connected?.close()]);\n\t}\n};\nfunction createMongoRuntimeDriver() {\n\treturn new MongoUnboundDriverImpl();\n}\n//#endregion\n//#region src/exports/runtime.ts\nconst mongoRuntimeDriverDescriptor = {\n\t...mongoDriverDescriptorMeta,\n\tcreate: createMongoRuntime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B,KAAKF,YAAY;EACjB,KAAKE,cAAc;EACnB,KAAKH,qBAAqB;EAC1B,MAAM,YAAY,MAAM,YAAY,YAAY,IAAI;EACpD,MAAM,QAAQ,IAAI,CAAC,UAAU,MAAM,GAAG,WAAW,MAAM,CAAC,CAAC;CAC1D;AACD;AACA,SAAS,2BAA2B;CACnC,OAAO,IAAI,uBAAuB;AACnC;AAGA,MAAM,+BAA+B;CACpC,GAAG;CACH,QAAQ;AACT"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
2
2
|
import { BSON, MongoClient } from "mongodb";
|
|
3
|
-
//#region ../../../3-targets/mongo/3-driver/dist/mongo-driver-
|
|
3
|
+
//#region ../../../3-targets/mongo/3-driver/dist/mongo-driver-8Nv9x9Th.mjs
|
|
4
4
|
const DRIVER_INFO = {
|
|
5
5
|
name: "Prisma",
|
|
6
|
-
version: "8.0.0-rc.23"
|
|
6
|
+
version: "8.0.0-rc.23-dev.2"
|
|
7
7
|
};
|
|
8
8
|
const mongoDriverDescriptorMeta = {
|
|
9
9
|
kind: "driver",
|
|
@@ -194,4 +194,4 @@ var MongoDriverImpl = class MongoDriverImpl {
|
|
|
194
194
|
//#endregion
|
|
195
195
|
export { MongoDriverImpl as n, mongoDriverDescriptorMeta as r, DRIVER_INFO as t };
|
|
196
196
|
|
|
197
|
-
//# sourceMappingURL=mongo-driver-
|
|
197
|
+
//# sourceMappingURL=mongo-driver-8Nv9x9Th-C0WRFFRY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo-driver-8Nv9x9Th-C0WRFFRY.mjs","names":[],"sources":["../../../../3-targets/mongo/3-driver/dist/mongo-driver-8Nv9x9Th.mjs"],"sourcesContent":["import { BSON, MongoClient } from \"mongodb\";\nimport { assertNever } from \"@internal/utils/internal-error\";\n//#endregion\n//#region src/core/driver-info.ts\nconst DRIVER_INFO = {\n\tname: \"Prisma\",\n\tversion: \"8.0.0-rc.23-dev.2\"\n};\n//#endregion\n//#region src/core/descriptor-meta.ts\nconst mongoDriverDescriptorMeta = {\n\tkind: \"driver\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: DRIVER_INFO.version,\n\tcapabilities: {}\n};\n//#endregion\n//#region src/mongo-driver.ts\n/* v8 ignore start */\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/* v8 ignore stop */\nvar MongoDriverImpl = class MongoDriverImpl {\n\tdb;\n\tclient;\n\tconstructor(db, client) {\n\t\tthis.db = db;\n\t\tthis.client = client;\n\t}\n\tstatic async fromConnection(uri, dbName) {\n\t\tconst client = new MongoClient(uri, { driverInfo: DRIVER_INFO });\n\t\ttry {\n\t\t\tawait client.connect();\n\t\t} catch (error) {\n\t\t\tawait client.close();\n\t\t\tthrow error;\n\t\t}\n\t\treturn new MongoDriverImpl(client.db(dbName), client);\n\t}\n\tstatic fromDb(db) {\n\t\treturn new MongoDriverImpl(db, void 0);\n\t}\n\texecute(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"insertOne\": return this.executeInsertOneCommand(wireCommand);\n\t\t\tcase \"updateOne\": return this.executeUpdateOneCommand(wireCommand);\n\t\t\tcase \"insertMany\": return this.executeInsertManyCommand(wireCommand);\n\t\t\tcase \"updateMany\": return this.executeUpdateManyCommand(wireCommand);\n\t\t\tcase \"deleteOne\": return this.executeDeleteOneCommand(wireCommand);\n\t\t\tcase \"deleteMany\": return this.executeDeleteManyCommand(wireCommand);\n\t\t\tcase \"findOneAndUpdate\": return this.executeFindOneAndUpdateCommand(wireCommand);\n\t\t\tcase \"findOneAndDelete\": return this.executeFindOneAndDeleteCommand(wireCommand);\n\t\t\tcase \"aggregate\": return this.executeAggregateCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync run(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"createCollection\": return this.executeCreateCollectionCommand(wireCommand);\n\t\t\tcase \"createIndex\": return this.executeCreateIndexCommand(wireCommand);\n\t\t\tcase \"dropCollection\": return this.executeDropCollectionCommand(wireCommand);\n\t\t\tcase \"renameCollection\": return this.executeRenameCollectionCommand(wireCommand);\n\t\t\tcase \"dropIndex\": return this.executeDropIndexCommand(wireCommand);\n\t\t\tcase \"collMod\": return this.executeCollModCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown DDL wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync close() {\n\t\tawait this.client?.close();\n\t}\n\tasync *executeInsertOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertOne(cmd.document);\n\t\tyield {\n\t\t\tinsertedId: result.insertedId,\n\t\t\tdocument: this.asRead({\n\t\t\t\t_id: result.insertedId,\n\t\t\t\t...cmd.document\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* The server stores an inserted document as the driver wrote it, apart from moving `_id` first, so writing it to BSON and reading it back with the client's options gives what a read returns, without a query.\n\t*/\n\tasRead(document) {\n\t\tconst { raw: _raw, ...options } = this.db.bsonOptions;\n\t\treturn BSON.deserialize(BSON.serialize(document, options), options);\n\t}\n\tasync *executeUpdateOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateOne(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeInsertManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertMany(cmd.documents);\n\t\tconst insertedIds = Object.values(result.insertedIds);\n\t\tyield {\n\t\t\tinsertedIds,\n\t\t\tinsertedCount: result.insertedCount,\n\t\t\tdocuments: cmd.documents.map((document, index) => this.asRead({\n\t\t\t\t_id: insertedIds[index],\n\t\t\t\t...document\n\t\t\t}))\n\t\t};\n\t}\n\tasync *executeUpdateManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateMany(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.bypassDocumentValidation ? { bypassDocumentValidation: true } : {}\n\t\t});\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeDeleteOneCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteOne(cmd.filter)).deletedCount };\n\t}\n\tasync *executeDeleteManyCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteMany(cmd.filter)).deletedCount };\n\t}\n\tasync *executeFindOneAndUpdateCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndUpdate(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.returnDocument != null ? { returnDocument: cmd.returnDocument } : {},\n\t\t\t...cmd.sort != null ? { sort: cmd.sort } : {}\n\t\t});\n\t\tif (result) yield result;\n\t}\n\tasync *executeFindOneAndDeleteCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndDelete(cmd.filter, { ...cmd.sort != null ? { sort: cmd.sort } : {} });\n\t\tif (result) yield result;\n\t}\n\tasync *executeAggregateCommand(cmd) {\n\t\tyield* this.db.collection(cmd.collection).aggregate(cmd.pipeline);\n\t}\n\tasync executeCreateCollectionCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, capped, size, max, timeseries, collation, changeStreamPreAndPostImages, clusteredIndex } = cmd;\n\t\tawait this.db.createCollection(cmd.collection, {\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...capped !== void 0 ? { capped } : {},\n\t\t\t...size !== void 0 ? { size } : {},\n\t\t\t...max !== void 0 ? { max } : {},\n\t\t\t...timeseries !== void 0 ? { timeseries } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {},\n\t\t\t...clusteredIndex !== void 0 ? { clusteredIndex } : {}\n\t\t});\n\t}\n\tasync executeCreateIndexCommand(cmd) {\n\t\tconst { unique, sparse, expireAfterSeconds, partialFilterExpression, name, wildcardProjection, collation, weights, default_language, language_override } = cmd;\n\t\tawait this.db.collection(cmd.collection).createIndex(cmd.key, {\n\t\t\t...unique !== void 0 ? { unique } : {},\n\t\t\t...sparse !== void 0 ? { sparse } : {},\n\t\t\t...expireAfterSeconds !== void 0 ? { expireAfterSeconds } : {},\n\t\t\t...partialFilterExpression !== void 0 ? { partialFilterExpression } : {},\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\t...wildcardProjection !== void 0 ? { wildcardProjection } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...weights !== void 0 ? { weights } : {},\n\t\t\t...default_language !== void 0 ? { default_language } : {},\n\t\t\t...language_override !== void 0 ? { language_override } : {}\n\t\t});\n\t}\n\tasync executeDropCollectionCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).drop();\n\t}\n\tasync executeRenameCollectionCommand(cmd) {\n\t\tawait this.db.renameCollection(cmd.collection, cmd.to);\n\t}\n\tasync executeDropIndexCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).dropIndex(cmd.name);\n\t}\n\tasync executeCollModCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, changeStreamPreAndPostImages } = cmd;\n\t\tawait this.db.command({\n\t\t\tcollMod: cmd.collection,\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {}\n\t\t});\n\t}\n};\n//#endregion\nexport { mongoDriverDescriptorMeta as n, DRIVER_INFO as r, MongoDriverImpl as t };\n\n//# sourceMappingURL=mongo-driver-8Nv9x9Th.mjs.map"],"mappings":";;;AAIA,MAAM,cAAc;CACnB,MAAM;CACN,SAAS;AACV;AAGA,MAAM,4BAA4B;CACjC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS,YAAY;CACrB,cAAc,CAAC;AAChB;;AAIA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,YAAY;CAClB,IAAI,OAAO,cAAc,YAAY,cAAc,QAAQ,UAAU,aAAa,OAAO,UAAU,SAAS,UAAU,OAAO,UAAU;CACvI,OAAO;AACR;;AAEA,IAAI,kBAAkB,MAAM,gBAAgB;CAC3C;CACA;CACA,YAAY,IAAI,QAAQ;EACvB,KAAK,KAAK;EACV,KAAK,SAAS;CACf;CACA,aAAa,eAAe,KAAK,QAAQ;EACxC,MAAM,SAAS,IAAI,YAAY,KAAK,EAAE,YAAY,YAAY,CAAC;EAC/D,IAAI;GACH,MAAM,OAAO,QAAQ;EACtB,SAAS,OAAO;GACf,MAAM,OAAO,MAAM;GACnB,MAAM;EACP;EACA,OAAO,IAAI,gBAAgB,OAAO,GAAG,MAAM,GAAG,MAAM;CACrD;CACA,OAAO,OAAO,IAAI;EACjB,OAAO,IAAI,gBAAgB,IAAI,KAAK,CAAC;CACtC;CACA,QAAQ,aAAa;EACpB,QAAQ,YAAY,MAApB;GACC,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACj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