@prisma/orm-target-mongo 8.0.0-rc.12-dev.21 → 8.0.0-rc.12-dev.22
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 +2 -2
- package/dist/adapter.mjs.map +1 -1
- package/dist/adapter__control.d.mts +10 -6
- package/dist/adapter__control.d.mts.map +1 -1
- package/dist/adapter__control.mjs +12 -8
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{codec-ids-Ck-Z63jY.d.mts → codec-ids-B_1c7Ed6.d.mts} +3 -2
- package/dist/{codec-ids-Ck-Z63jY.d.mts.map → codec-ids-B_1c7Ed6.d.mts.map} +1 -1
- package/dist/{codec-ids-Bz230VLx-Dbi_KV7J.mjs → codec-ids-CuHXNFWL-BYExYC_z.mjs} +4 -3
- package/dist/codec-ids-CuHXNFWL-BYExYC_z.mjs.map +1 -0
- package/dist/{codec-types-KM2ikqd7.d.mts → codec-types-BqPLybhD.d.mts} +7 -2
- package/dist/codec-types-BqPLybhD.d.mts.map +1 -0
- package/dist/{codecs-0Qw_1Ruk-CM0MoKZi.mjs → codecs-B0Szbq1k-DGXwjn9l.mjs} +287 -9
- package/dist/codecs-B0Szbq1k-DGXwjn9l.mjs.map +1 -0
- package/dist/{codecs-DsyGq31F.d.mts → codecs-xffquj_O.d.mts} +6 -3
- package/dist/codecs-xffquj_O.d.mts.map +1 -0
- package/dist/{control-DxtRWuRc.mjs → control-BsJepSbb.mjs} +3 -3
- package/dist/{control-DxtRWuRc.mjs.map → control-BsJepSbb.mjs.map} +1 -1
- package/dist/{data-types-Kd9NIobH.d.mts → data-types-CX8zNsum.d.mts} +3 -2
- package/dist/{data-types-Kd9NIobH.d.mts.map → data-types-CX8zNsum.d.mts.map} +1 -1
- package/dist/{data-types-B2WnpO9e-D97kwz96.mjs → data-types-qKwvSozp-De9Y09D3.mjs} +6 -4
- package/dist/data-types-qKwvSozp-De9Y09D3.mjs.map +1 -0
- package/dist/{descriptor-meta-B-tRIu8E-BvE4Pj24.mjs → descriptor-meta-Bobm2m-Q-C9Bd4xUM.mjs} +4 -4
- package/dist/{descriptor-meta-B-tRIu8E-BvE4Pj24.mjs.map → descriptor-meta-Bobm2m-Q-C9Bd4xUM.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-CvU-3NMf-_eUH-uxH.mjs → descriptor-meta-runtime-C5SUv3LG-Dv9IWBR2.mjs} +4 -4
- package/dist/{descriptor-meta-runtime-CvU-3NMf-_eUH-uxH.mjs.map → descriptor-meta-runtime-C5SUv3LG-Dv9IWBR2.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-Dx9Gs2Lj-Cc9HC70S.mjs → mongo-adapter-Cm9V2ftE-B9vITX5a.mjs} +8 -5
- package/dist/mongo-adapter-Cm9V2ftE-B9vITX5a.mjs.map +1 -0
- package/dist/{mongo-driver-Cc3gFnzS-Dh9cgJDD.mjs → mongo-driver-C8_RniYK-DTC9ohg5.mjs} +3 -3
- package/dist/{mongo-driver-Cc3gFnzS-Dh9cgJDD.mjs.map → mongo-driver-C8_RniYK-DTC9ohg5.mjs.map} +1 -1
- package/dist/{pack-j8OK1H_b.d.mts → pack-8KElTm25.d.mts} +2 -2
- package/dist/{pack-j8OK1H_b.d.mts.map → pack-8KElTm25.d.mts.map} +1 -1
- package/dist/{prisma6-binding-Z18pd_YC.mjs → prisma6-binding-CbZetx23.mjs} +3 -3
- package/dist/{prisma6-binding-Z18pd_YC.mjs.map → prisma6-binding-CbZetx23.mjs.map} +1 -1
- package/dist/target.d.mts +6 -6
- package/dist/target.mjs +6 -6
- package/dist/target__codec-ids.d.mts +2 -2
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +2 -2
- 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/codec-ids-Bz230VLx-Dbi_KV7J.mjs.map +0 -1
- package/dist/codec-types-KM2ikqd7.d.mts.map +0 -1
- package/dist/codecs-0Qw_1Ruk-CM0MoKZi.mjs.map +0 -1
- package/dist/codecs-DsyGq31F.d.mts.map +0 -1
- package/dist/data-types-B2WnpO9e-D97kwz96.mjs.map +0 -1
- package/dist/mongo-adapter-Dx9Gs2Lj-Cc9HC70S.mjs.map +0 -1
|
@@ -1,15 +1,167 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as
|
|
1
|
+
import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_STRING_CODEC_ID, f as MONGO_VECTOR_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_JSON_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_OBJECTID_CODEC_ID } from "./codec-ids-CuHXNFWL-BYExYC_z.mjs";
|
|
2
|
+
import { a as mongoDate, c as mongoInt32, d as mongoObjectId, f as mongoString, l as mongoInt64, n as mongoBool, o as mongoDecimal128, p as mongoVector, r as mongoBson, s as mongoDouble, t as mongoBinary, u as mongoJson } from "./data-types-qKwvSozp-De9Y09D3.mjs";
|
|
3
3
|
import { renderTsLiteral } from "@prisma/orm-framework/components/codec";
|
|
4
4
|
import { mongoCodec, newMongoCodecRegistry } from "@prisma/orm-family-mongo/codec";
|
|
5
5
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
6
6
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
7
|
-
import { Binary, Decimal128, Long, ObjectId } from "bson";
|
|
7
|
+
import { Binary, Code, Decimal128, Double, EJSON, Long, MinKey, ObjectId } from "bson";
|
|
8
8
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
9
|
-
//#region ../../../3-mongo-target/1-mongo-target/dist/codecs-
|
|
9
|
+
//#region ../../../3-mongo-target/1-mongo-target/dist/codecs-B0Szbq1k.mjs
|
|
10
|
+
function where(path) {
|
|
11
|
+
return path === "" ? "the root" : path;
|
|
12
|
+
}
|
|
13
|
+
function child(path, key) {
|
|
14
|
+
return path === "" ? String(key) : `${path}.${key}`;
|
|
15
|
+
}
|
|
16
|
+
function isPlainObject(value) {
|
|
17
|
+
const prototype = Object.getPrototypeOf(value);
|
|
18
|
+
return prototype === Object.prototype || prototype === null;
|
|
19
|
+
}
|
|
20
|
+
function isPlainArray(value) {
|
|
21
|
+
return Array.isArray(value) && Object.getPrototypeOf(value) === Array.prototype;
|
|
22
|
+
}
|
|
23
|
+
function bsonTypeTag(value) {
|
|
24
|
+
const tag = Reflect.get(value, "_bsontype");
|
|
25
|
+
return typeof tag === "string" ? tag : void 0;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The `_bsontype` tag of a `bson` class instance. A stored subdocument is read as a plain object even when it has a `_bsontype` key, so a plain object has no tag.
|
|
29
|
+
*/
|
|
30
|
+
function bsonClassTag(value) {
|
|
31
|
+
return isPlainObject(value) ? void 0 : bsonTypeTag(value);
|
|
32
|
+
}
|
|
33
|
+
function constructorName(value) {
|
|
34
|
+
const name = Reflect.get(value, "constructor")?.name;
|
|
35
|
+
return typeof name === "string" && name !== "" ? name : "object";
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The `bson` library reads any subdocument with a string `$ref` and an `$id` as a `DBRef`. It was stored as a plain object; these are its entries in stored order, `$ref`, `$id`, `$db` when present, then the other fields.
|
|
39
|
+
*/
|
|
40
|
+
function dbRefEntries(value) {
|
|
41
|
+
const ref = blindCast(value);
|
|
42
|
+
const entries = [["$ref", ref.collection], ["$id", ref.oid]];
|
|
43
|
+
if (ref.db !== void 0) entries.push(["$db", ref.db]);
|
|
44
|
+
entries.push(...Object.entries(ref.fields));
|
|
45
|
+
return entries;
|
|
46
|
+
}
|
|
10
47
|
function mongoTargetError(code, message, options) {
|
|
11
48
|
return structuredError(code, message, options);
|
|
12
49
|
}
|
|
50
|
+
const BSON_VALUE_TAGS = /* @__PURE__ */ new Set([
|
|
51
|
+
"ObjectId",
|
|
52
|
+
"Long",
|
|
53
|
+
"Decimal128",
|
|
54
|
+
"Binary",
|
|
55
|
+
"BSONRegExp",
|
|
56
|
+
"Timestamp",
|
|
57
|
+
"Int32",
|
|
58
|
+
"Double",
|
|
59
|
+
"Code",
|
|
60
|
+
"MinKey",
|
|
61
|
+
"MaxKey",
|
|
62
|
+
"BSONSymbol"
|
|
63
|
+
]);
|
|
64
|
+
const BSON_VERSION = Symbol.for("@@mdb.bson.version");
|
|
65
|
+
const BSON_MAJOR = Reflect.get(new MinKey(), BSON_VERSION);
|
|
66
|
+
function encodeRefused$1(received, path) {
|
|
67
|
+
throw mongoTargetError("RUNTIME.ENCODE_FAILED", `${MONGO_BSON_CODEC_ID} value must be a BSON value; received ${received} at ${where(path)}`, { meta: {
|
|
68
|
+
codecId: MONGO_BSON_CODEC_ID,
|
|
69
|
+
received,
|
|
70
|
+
valuePath: path
|
|
71
|
+
} });
|
|
72
|
+
}
|
|
73
|
+
function assertBsonValue(value, path, ancestors) {
|
|
74
|
+
if (value === null || typeof value === "string" || typeof value === "boolean" || typeof value === "number") return;
|
|
75
|
+
if (typeof value !== "object") {
|
|
76
|
+
encodeRefused$1(typeof value, path);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const tag = bsonTypeTag(value);
|
|
80
|
+
if (tag !== void 0) {
|
|
81
|
+
if (!BSON_VALUE_TAGS.has(tag)) encodeRefused$1(tag, path);
|
|
82
|
+
if (Reflect.get(value, BSON_VERSION) !== BSON_MAJOR) encodeRefused$1(`${tag} not created by bson ${String(BSON_MAJOR)}`, path);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (value instanceof Date || value instanceof RegExp || value instanceof Uint8Array) return;
|
|
86
|
+
if (!isPlainArray(value) && !isPlainObject(value)) {
|
|
87
|
+
encodeRefused$1(constructorName(value), path);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (ancestors.has(value)) encodeRefused$1("circular reference", path);
|
|
91
|
+
ancestors.add(value);
|
|
92
|
+
if (Array.isArray(value)) for (let index = 0; index < value.length; index++) {
|
|
93
|
+
if (!(index in value)) encodeRefused$1("sparse array hole", child(path, index));
|
|
94
|
+
assertBsonValue(value[index], child(path, index), ancestors);
|
|
95
|
+
}
|
|
96
|
+
else for (const [key, entry] of Object.entries(value)) assertBsonValue(entry, child(path, key), ancestors);
|
|
97
|
+
ancestors.delete(value);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Returns `value` unchanged when it is a BSON value at every depth, and throws `RUNTIME.ENCODE_FAILED` naming the first value that is not, with its path.
|
|
101
|
+
*/
|
|
102
|
+
function encodeBsonValue(value) {
|
|
103
|
+
assertBsonValue(value, "", /* @__PURE__ */ new Set());
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A `Code` value with a scope, recognised by its tag: the driver reads with its own load of `bson`, so its `Code` is not an instance of the class imported here.
|
|
108
|
+
*/
|
|
109
|
+
function codeWithScope(value) {
|
|
110
|
+
if (bsonClassTag(value) !== "Code") return void 0;
|
|
111
|
+
const code = Reflect.get(value, "code");
|
|
112
|
+
const scope = Reflect.get(value, "scope");
|
|
113
|
+
return typeof code === "string" && typeof scope === "object" && scope !== null ? {
|
|
114
|
+
code,
|
|
115
|
+
scope
|
|
116
|
+
} : void 0;
|
|
117
|
+
}
|
|
118
|
+
function decodeEntries$1(entries) {
|
|
119
|
+
return Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue$1(entry)]));
|
|
120
|
+
}
|
|
121
|
+
function decodeValue$1(value) {
|
|
122
|
+
if (typeof value !== "object" || value === null) return value;
|
|
123
|
+
if (bsonClassTag(value) === "DBRef") return decodeEntries$1(dbRefEntries(value));
|
|
124
|
+
if (Array.isArray(value)) {
|
|
125
|
+
const decoded = value.map(decodeValue$1);
|
|
126
|
+
return decoded.some((entry, index) => entry !== value[index]) ? decoded : value;
|
|
127
|
+
}
|
|
128
|
+
const code = codeWithScope(value);
|
|
129
|
+
if (code !== void 0) {
|
|
130
|
+
const scope = decodeValue$1(code.scope);
|
|
131
|
+
return scope === code.scope ? value : new Code(code.code, blindCast(scope));
|
|
132
|
+
}
|
|
133
|
+
if (!isPlainObject(value)) return value;
|
|
134
|
+
const entries = Object.entries(value);
|
|
135
|
+
const decoded = decodeEntries$1(entries);
|
|
136
|
+
return entries.some(([key, entry]) => decoded[key] !== entry) ? decoded : value;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Returns the wire value as the driver produced it, except that a `DBRef` the `bson` library read from a `{ $ref, $id }` subdocument becomes that document again, `{ $ref, $id[, $db], ...fields }`, with its members' BSON types kept, at any depth and inside a `Code` scope. A value holding no `DBRef` is returned as the same object.
|
|
140
|
+
*/
|
|
141
|
+
function decodeBsonValue(wire) {
|
|
142
|
+
return blindCast(decodeValue$1(wire));
|
|
143
|
+
}
|
|
144
|
+
const INT32_MIN = -(2 ** 31);
|
|
145
|
+
const INT32_MAX = 2 ** 31 - 1;
|
|
146
|
+
function asDriverWrites(value) {
|
|
147
|
+
if (typeof value === "number") return Number.isInteger(value) && (value < INT32_MIN || value > INT32_MAX) ? new Double(value) : value;
|
|
148
|
+
if (typeof value !== "object" || value === null) return value;
|
|
149
|
+
if (value instanceof Uint8Array) return new Binary(value);
|
|
150
|
+
if (Array.isArray(value)) return value.map(asDriverWrites);
|
|
151
|
+
if (isPlainObject(value)) return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, asDriverWrites(entry)]));
|
|
152
|
+
const code = codeWithScope(value);
|
|
153
|
+
if (code !== void 0) return new Code(code.code, blindCast(asDriverWrites(code.scope)));
|
|
154
|
+
return value;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Canonical Extended JSON for a BSON value, recording each JavaScript number and `Uint8Array` as the BSON type the driver writes for it: an integer outside the int32 range as a `double`, and bytes as `binData`.
|
|
158
|
+
*/
|
|
159
|
+
function encodeBsonJson(value) {
|
|
160
|
+
return blindCast(EJSON.serialize(asDriverWrites(value), { relaxed: false }));
|
|
161
|
+
}
|
|
162
|
+
function decodeBsonJson(json) {
|
|
163
|
+
return EJSON.deserialize(blindCast(json), { relaxed: false });
|
|
164
|
+
}
|
|
13
165
|
const DECIMAL_INTEGER = /^-?\d+$/;
|
|
14
166
|
const CANONICAL_DECIMAL_TEXT = /^(?:-?\d+(?:\.\d+)?|NaN|-?Infinity)$/;
|
|
15
167
|
const DECIMAL128_TEXT = /^(-?)(\d+)(?:\.(\d+))?(?:E([+-]\d+))?$/;
|
|
@@ -158,6 +310,107 @@ function binaryDecodeJson(codecId, json) {
|
|
|
158
310
|
if (typeof json !== "string" || !BASE64_TEXT.test(json)) return decodeFailed(codecId, "JSON value must be base64 text", json);
|
|
159
311
|
return new Uint8Array(Buffer.from(json, "base64"));
|
|
160
312
|
}
|
|
313
|
+
function encodeRefused(received, path) {
|
|
314
|
+
throw mongoTargetError("RUNTIME.ENCODE_FAILED", `${MONGO_JSON_CODEC_ID} value must be a JSON value; received ${received} at ${where(path)}`, { meta: {
|
|
315
|
+
codecId: MONGO_JSON_CODEC_ID,
|
|
316
|
+
received,
|
|
317
|
+
valuePath: path
|
|
318
|
+
} });
|
|
319
|
+
}
|
|
320
|
+
function describeNonJson(value) {
|
|
321
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return void 0;
|
|
322
|
+
if (typeof value === "number") return Number.isFinite(value) ? void 0 : String(value);
|
|
323
|
+
if (typeof value !== "object") return typeof value;
|
|
324
|
+
const tag = bsonTypeTag(value);
|
|
325
|
+
if (tag !== void 0) return tag;
|
|
326
|
+
if (value instanceof Date) return "Date";
|
|
327
|
+
if (isPlainArray(value)) return void 0;
|
|
328
|
+
return isPlainObject(value) ? void 0 : constructorName(value);
|
|
329
|
+
}
|
|
330
|
+
function assertJsonValue(value, path, ancestors) {
|
|
331
|
+
const received = describeNonJson(value);
|
|
332
|
+
if (received !== void 0) encodeRefused(received, path);
|
|
333
|
+
if (typeof value !== "object" || value === null) return;
|
|
334
|
+
if (ancestors.has(value)) encodeRefused("circular reference", path);
|
|
335
|
+
ancestors.add(value);
|
|
336
|
+
if (Array.isArray(value)) for (let index = 0; index < value.length; index++) {
|
|
337
|
+
if (!(index in value)) encodeRefused("sparse array hole", child(path, index));
|
|
338
|
+
assertJsonValue(value[index], child(path, index), ancestors);
|
|
339
|
+
}
|
|
340
|
+
else for (const [key, entry] of Object.entries(value)) assertJsonValue(entry, child(path, key), ancestors);
|
|
341
|
+
ancestors.delete(value);
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Returns `value` unchanged when it is a plain JSON value at every depth, and throws `RUNTIME.ENCODE_FAILED` naming the first value that is not, with its path.
|
|
345
|
+
*/
|
|
346
|
+
function encodeJsonValue(value) {
|
|
347
|
+
assertJsonValue(value, "", /* @__PURE__ */ new Set());
|
|
348
|
+
return value;
|
|
349
|
+
}
|
|
350
|
+
const BSON_TYPE_BY_TAG = {
|
|
351
|
+
ObjectId: "objectId",
|
|
352
|
+
Decimal128: "decimal",
|
|
353
|
+
Binary: "binData",
|
|
354
|
+
BSONRegExp: "regex",
|
|
355
|
+
Timestamp: "timestamp",
|
|
356
|
+
BSONSymbol: "symbol",
|
|
357
|
+
Code: "javascript",
|
|
358
|
+
MinKey: "minKey",
|
|
359
|
+
MaxKey: "maxKey"
|
|
360
|
+
};
|
|
361
|
+
function decodeRefused(bsonType, path) {
|
|
362
|
+
throw mongoTargetError("RUNTIME.DECODE_FAILED", `${MONGO_JSON_CODEC_ID} wire value contains a non-JSON BSON ${bsonType} at ${where(path)}`, { meta: {
|
|
363
|
+
codecId: MONGO_JSON_CODEC_ID,
|
|
364
|
+
received: bsonType,
|
|
365
|
+
valuePath: path
|
|
366
|
+
} });
|
|
367
|
+
}
|
|
368
|
+
function safeLong(value, path) {
|
|
369
|
+
const number = Number(value);
|
|
370
|
+
return Number.isSafeInteger(number) && BigInt(number) === value ? number : decodeRefused("long", path);
|
|
371
|
+
}
|
|
372
|
+
function finiteDouble(value, path) {
|
|
373
|
+
return Number.isFinite(value) ? value : decodeRefused("double", path);
|
|
374
|
+
}
|
|
375
|
+
function decodeEntries(entries, path) {
|
|
376
|
+
return Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue(entry, child(path, key))]));
|
|
377
|
+
}
|
|
378
|
+
function decodeTagged(value, tag, path) {
|
|
379
|
+
switch (tag) {
|
|
380
|
+
case "DBRef": return decodeEntries(dbRefEntries(value), path);
|
|
381
|
+
case "Long": return safeLong(blindCast(value).toBigInt(), path);
|
|
382
|
+
case "Int32":
|
|
383
|
+
case "Double": return finiteDouble(Number(value.valueOf()), path);
|
|
384
|
+
}
|
|
385
|
+
return decodeRefused(BSON_TYPE_BY_TAG[tag] ?? tag, path);
|
|
386
|
+
}
|
|
387
|
+
function decodeValue(value, path) {
|
|
388
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return value;
|
|
389
|
+
if (typeof value === "number") return finiteDouble(value, path);
|
|
390
|
+
if (typeof value === "bigint") return safeLong(value, path);
|
|
391
|
+
if (typeof value === "undefined") return decodeRefused("undefined", path);
|
|
392
|
+
if (typeof value === "symbol") return decodeRefused("symbol", path);
|
|
393
|
+
if (typeof value === "function") return decodeRefused("javascript", path);
|
|
394
|
+
const tag = bsonClassTag(value);
|
|
395
|
+
if (tag !== void 0) return decodeTagged(value, tag, path);
|
|
396
|
+
if (value instanceof Date) return decodeRefused("date", path);
|
|
397
|
+
if (value instanceof RegExp) return decodeRefused("regex", path);
|
|
398
|
+
if (value instanceof Uint8Array) return decodeRefused("binData", path);
|
|
399
|
+
if (Array.isArray(value)) {
|
|
400
|
+
const decoded = value.map((entry, index) => decodeValue(entry, child(path, index)));
|
|
401
|
+
return decoded.some((entry, index) => entry !== value[index]) ? decoded : value;
|
|
402
|
+
}
|
|
403
|
+
if (!isPlainObject(value)) return decodeRefused(constructorName(value), path);
|
|
404
|
+
const entries = Object.entries(value);
|
|
405
|
+
const decoded = decodeEntries(entries, path);
|
|
406
|
+
return entries.some(([key, entry]) => decoded[key] !== entry) ? decoded : blindCast(value);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Decodes a wire value to the JSON value it holds: a `long` in the safe-integer range and the driver's `Int32` and `Double` wrappers become numbers. Only the objects and arrays around a converted value are copied; a wire value that is already JSON is returned as the same object. Throws `RUNTIME.DECODE_FAILED` naming the BSON type and path of the first value that is not JSON.
|
|
410
|
+
*/
|
|
411
|
+
function decodeJsonValue(wire) {
|
|
412
|
+
return decodeValue(wire, "");
|
|
413
|
+
}
|
|
161
414
|
const mongoObjectIdCodec = mongoCodec({
|
|
162
415
|
typeId: MONGO_OBJECTID_CODEC_ID,
|
|
163
416
|
decode: (wire) => wire.toHexString(),
|
|
@@ -232,12 +485,22 @@ const mongoBinaryCodec = mongoCodec({
|
|
|
232
485
|
decodeJson: (json) => binaryDecodeJson(MONGO_BINARY_CODEC_ID, json)
|
|
233
486
|
});
|
|
234
487
|
/**
|
|
235
|
-
*
|
|
488
|
+
* A JSON value, stored as the BSON object, array, string, number, boolean or null it maps to. Encode and decode refuse any other value at any depth, naming its path.
|
|
236
489
|
*/
|
|
237
490
|
const mongoJsonCodec = mongoCodec({
|
|
238
491
|
typeId: MONGO_JSON_CODEC_ID,
|
|
239
|
-
decode: (wire) => wire,
|
|
240
|
-
encode: (value) => value
|
|
492
|
+
decode: (wire) => decodeJsonValue(wire),
|
|
493
|
+
encode: (value) => encodeJsonValue(value)
|
|
494
|
+
});
|
|
495
|
+
/**
|
|
496
|
+
* Any BSON value, passed through unchanged except that decode turns a `DBRef` back into the `{ $ref, $id }` document it was stored as. Encode takes a `BsonInputValue` and decode returns a `BsonValue`. Its JSON form is canonical MongoDB Extended JSON v2, written with each number and `Uint8Array` as the BSON type the driver stores, so a round trip keeps the BSON bytes but may return wrapper classes such as `Int32` and `Double`.
|
|
497
|
+
*/
|
|
498
|
+
const mongoBsonCodec = mongoCodec({
|
|
499
|
+
typeId: MONGO_BSON_CODEC_ID,
|
|
500
|
+
decode: (wire) => decodeBsonValue(wire),
|
|
501
|
+
encode: (value) => encodeBsonValue(value),
|
|
502
|
+
encodeJson: encodeBsonJson,
|
|
503
|
+
decodeJson: decodeBsonJson
|
|
241
504
|
});
|
|
242
505
|
/**
|
|
243
506
|
* The canonical set of Mongo wire-type codecs.
|
|
@@ -255,7 +518,8 @@ const mongoStandardCodecs = [
|
|
|
255
518
|
mongoInt64Codec,
|
|
256
519
|
mongoDecimal128Codec,
|
|
257
520
|
mongoBinaryCodec,
|
|
258
|
-
mongoJsonCodec
|
|
521
|
+
mongoJsonCodec,
|
|
522
|
+
mongoBsonCodec
|
|
259
523
|
];
|
|
260
524
|
/**
|
|
261
525
|
* Build a {@link CodecDescriptor} for a Mongo wire-type codec.
|
|
@@ -369,6 +633,20 @@ const mongoCodecDescriptors = [
|
|
|
369
633
|
descriptorFor(mongoJsonCodec, {
|
|
370
634
|
dataType: mongoJson.id,
|
|
371
635
|
traits: [],
|
|
636
|
+
targetTypes: [
|
|
637
|
+
"object",
|
|
638
|
+
"array",
|
|
639
|
+
"string",
|
|
640
|
+
"double",
|
|
641
|
+
"int",
|
|
642
|
+
"long",
|
|
643
|
+
"bool",
|
|
644
|
+
"null"
|
|
645
|
+
]
|
|
646
|
+
}),
|
|
647
|
+
descriptorFor(mongoBsonCodec, {
|
|
648
|
+
dataType: mongoBson.id,
|
|
649
|
+
traits: [],
|
|
372
650
|
targetTypes: []
|
|
373
651
|
})
|
|
374
652
|
];
|
|
@@ -391,4 +669,4 @@ function buildStandardCodecRegistry() {
|
|
|
391
669
|
//#endregion
|
|
392
670
|
export { mongoTargetError as a, mongoStandardCodecs as i, mongoCodecDescriptors as n, mongoDescriptorById as r, buildStandardCodecRegistry as t };
|
|
393
671
|
|
|
394
|
-
//# sourceMappingURL=codecs-
|
|
672
|
+
//# sourceMappingURL=codecs-B0Szbq1k-DGXwjn9l.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-B0Szbq1k-DGXwjn9l.mjs","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/codecs-B0Szbq1k.mjs"],"sourcesContent":["import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_STRING_CODEC_ID, f as MONGO_VECTOR_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_JSON_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_OBJECTID_CODEC_ID } from \"./codec-ids-CuHXNFWL.mjs\";\nimport { a as mongoDate, c as mongoInt32, d as mongoObjectId, f as mongoString, l as mongoInt64, n as mongoBool, o as mongoDecimal128, p as mongoVector, r as mongoBson, s as mongoDouble, t as mongoBinary, u as mongoJson } from \"./data-types-qKwvSozp.mjs\";\nimport { renderTsLiteral } from \"@internal/framework-components/codec\";\nimport { mongoCodec, newMongoCodecRegistry } from \"@internal/mongo-codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { Binary, Code, Decimal128, Double, EJSON, Long, MinKey, ObjectId } from \"bson\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/bson-walk.ts\nfunction where(path) {\n\treturn path === \"\" ? \"the root\" : path;\n}\nfunction child(path, key) {\n\treturn path === \"\" ? String(key) : `${path}.${key}`;\n}\nfunction isPlainObject(value) {\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction isPlainArray(value) {\n\treturn Array.isArray(value) && Object.getPrototypeOf(value) === Array.prototype;\n}\nfunction bsonTypeTag(value) {\n\tconst tag = Reflect.get(value, \"_bsontype\");\n\treturn typeof tag === \"string\" ? tag : void 0;\n}\n/**\n* The `_bsontype` tag of a `bson` class instance. A stored subdocument is read as a plain object even when it has a `_bsontype` key, so a plain object has no tag.\n*/\nfunction bsonClassTag(value) {\n\treturn isPlainObject(value) ? void 0 : bsonTypeTag(value);\n}\nfunction constructorName(value) {\n\tconst name = Reflect.get(value, \"constructor\")?.name;\n\treturn typeof name === \"string\" && name !== \"\" ? name : \"object\";\n}\n/**\n* The `bson` library reads any subdocument with a string `$ref` and an `$id` as a `DBRef`. It was stored as a plain object; these are its entries in stored order, `$ref`, `$id`, `$db` when present, then the other fields.\n*/\nfunction dbRefEntries(value) {\n\tconst ref = blindCast(value);\n\tconst entries = [[\"$ref\", ref.collection], [\"$id\", ref.oid]];\n\tif (ref.db !== void 0) entries.push([\"$db\", ref.db]);\n\tentries.push(...Object.entries(ref.fields));\n\treturn entries;\n}\n//#endregion\n//#region src/core/mongo-target-errors.ts\nfunction mongoTargetError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/core/bson-codec-helpers.ts\nconst BSON_VALUE_TAGS = /* @__PURE__ */ new Set([\n\t\"ObjectId\",\n\t\"Long\",\n\t\"Decimal128\",\n\t\"Binary\",\n\t\"BSONRegExp\",\n\t\"Timestamp\",\n\t\"Int32\",\n\t\"Double\",\n\t\"Code\",\n\t\"MinKey\",\n\t\"MaxKey\",\n\t\"BSONSymbol\"\n]);\nconst BSON_VERSION = Symbol.for(\"@@mdb.bson.version\");\nconst BSON_MAJOR = Reflect.get(new MinKey(), BSON_VERSION);\nfunction encodeRefused$1(received, path) {\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${MONGO_BSON_CODEC_ID} value must be a BSON value; received ${received} at ${where(path)}`, { meta: {\n\t\tcodecId: MONGO_BSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction assertBsonValue(value, path, ancestors) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\" || typeof value === \"number\") return;\n\tif (typeof value !== \"object\") {\n\t\tencodeRefused$1(typeof value, path);\n\t\treturn;\n\t}\n\tconst tag = bsonTypeTag(value);\n\tif (tag !== void 0) {\n\t\tif (!BSON_VALUE_TAGS.has(tag)) encodeRefused$1(tag, path);\n\t\tif (Reflect.get(value, BSON_VERSION) !== BSON_MAJOR) encodeRefused$1(`${tag} not created by bson ${String(BSON_MAJOR)}`, path);\n\t\treturn;\n\t}\n\tif (value instanceof Date || value instanceof RegExp || value instanceof Uint8Array) return;\n\tif (!isPlainArray(value) && !isPlainObject(value)) {\n\t\tencodeRefused$1(constructorName(value), path);\n\t\treturn;\n\t}\n\tif (ancestors.has(value)) encodeRefused$1(\"circular reference\", path);\n\tancestors.add(value);\n\tif (Array.isArray(value)) for (let index = 0; index < value.length; index++) {\n\t\tif (!(index in value)) encodeRefused$1(\"sparse array hole\", child(path, index));\n\t\tassertBsonValue(value[index], child(path, index), ancestors);\n\t}\n\telse for (const [key, entry] of Object.entries(value)) assertBsonValue(entry, child(path, key), ancestors);\n\tancestors.delete(value);\n}\n/**\n* Returns `value` unchanged when it is a BSON value at every depth, and throws `RUNTIME.ENCODE_FAILED` naming the first value that is not, with its path.\n*/\nfunction encodeBsonValue(value) {\n\tassertBsonValue(value, \"\", /* @__PURE__ */ new Set());\n\treturn value;\n}\n/**\n* A `Code` value with a scope, recognised by its tag: the driver reads with its own load of `bson`, so its `Code` is not an instance of the class imported here.\n*/\nfunction codeWithScope(value) {\n\tif (bsonClassTag(value) !== \"Code\") return void 0;\n\tconst code = Reflect.get(value, \"code\");\n\tconst scope = Reflect.get(value, \"scope\");\n\treturn typeof code === \"string\" && typeof scope === \"object\" && scope !== null ? {\n\t\tcode,\n\t\tscope\n\t} : void 0;\n}\nfunction decodeEntries$1(entries) {\n\treturn Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue$1(entry)]));\n}\nfunction decodeValue$1(value) {\n\tif (typeof value !== \"object\" || value === null) return value;\n\tif (bsonClassTag(value) === \"DBRef\") return decodeEntries$1(dbRefEntries(value));\n\tif (Array.isArray(value)) {\n\t\tconst decoded = value.map(decodeValue$1);\n\t\treturn decoded.some((entry, index) => entry !== value[index]) ? decoded : value;\n\t}\n\tconst code = codeWithScope(value);\n\tif (code !== void 0) {\n\t\tconst scope = decodeValue$1(code.scope);\n\t\treturn scope === code.scope ? value : new Code(code.code, blindCast(scope));\n\t}\n\tif (!isPlainObject(value)) return value;\n\tconst entries = Object.entries(value);\n\tconst decoded = decodeEntries$1(entries);\n\treturn entries.some(([key, entry]) => decoded[key] !== entry) ? decoded : value;\n}\n/**\n* Returns the wire value as the driver produced it, except that a `DBRef` the `bson` library read from a `{ $ref, $id }` subdocument becomes that document again, `{ $ref, $id[, $db], ...fields }`, with its members' BSON types kept, at any depth and inside a `Code` scope. A value holding no `DBRef` is returned as the same object.\n*/\nfunction decodeBsonValue(wire) {\n\treturn blindCast(decodeValue$1(wire));\n}\nconst INT32_MIN = -(2 ** 31);\nconst INT32_MAX = 2 ** 31 - 1;\nfunction asDriverWrites(value) {\n\tif (typeof value === \"number\") return Number.isInteger(value) && (value < INT32_MIN || value > INT32_MAX) ? new Double(value) : value;\n\tif (typeof value !== \"object\" || value === null) return value;\n\tif (value instanceof Uint8Array) return new Binary(value);\n\tif (Array.isArray(value)) return value.map(asDriverWrites);\n\tif (isPlainObject(value)) return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, asDriverWrites(entry)]));\n\tconst code = codeWithScope(value);\n\tif (code !== void 0) return new Code(code.code, blindCast(asDriverWrites(code.scope)));\n\treturn value;\n}\n/**\n* Canonical Extended JSON for a BSON value, recording each JavaScript number and `Uint8Array` as the BSON type the driver writes for it: an integer outside the int32 range as a `double`, and bytes as `binData`.\n*/\nfunction encodeBsonJson(value) {\n\treturn blindCast(EJSON.serialize(asDriverWrites(value), { relaxed: false }));\n}\nfunction decodeBsonJson(json) {\n\treturn EJSON.deserialize(blindCast(json), { relaxed: false });\n}\n//#endregion\n//#region src/core/bson-scalar-helpers.ts\nconst DECIMAL_INTEGER = /^-?\\d+$/;\nconst CANONICAL_DECIMAL_TEXT = /^(?:-?\\d+(?:\\.\\d+)?|NaN|-?Infinity)$/;\nconst DECIMAL128_TEXT = /^(-?)(\\d+)(?:\\.(\\d+))?(?:E([+-]\\d+))?$/;\nconst BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\n/**\n* Checks the BSON type tag rather than `instanceof`: the driver deserialises with its own load of `bson` (CommonJS, where this module may be loaded as ESM), so a value read from the database need not be an instance of the class imported here.\n*/\nfunction hasBsonTypeTag(value, tag) {\n\treturn typeof value === \"object\" && value !== null && \"_bsontype\" in value && value._bsontype === tag;\n}\nfunction isLong(value) {\n\treturn hasBsonTypeTag(value, \"Long\");\n}\nfunction isDecimal128(value) {\n\treturn hasBsonTypeTag(value, \"Decimal128\");\n}\nfunction isBinary(value) {\n\treturn hasBsonTypeTag(value, \"Binary\");\n}\nfunction decodeFailed(codecId, message, received) {\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${codecId} ${message}`, { meta: {\n\t\tcodecId,\n\t\treceived: typeof received\n\t} });\n}\nconst RECEIVED_PREVIEW_LIMIT = 100;\nfunction encodeFailed(codecId, message, received) {\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${codecId} ${message}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(received).slice(0, RECEIVED_PREVIEW_LIMIT)\n\t} });\n}\nconst INT64_MIN = -(2n ** 63n);\nconst INT64_MAX = 2n ** 63n - 1n;\n/**\n* `Long.fromBigInt` keeps the low 64 bits of any bigint, so an out-of-range value would be stored as a different number without error.\n*/\nfunction isInt64(value) {\n\treturn value >= INT64_MIN && value <= INT64_MAX;\n}\nfunction requireInt64(codecId, value) {\n\tif (!isInt64(value)) encodeFailed(codecId, \"value is outside the signed 64-bit range\", value);\n\treturn value;\n}\nfunction int64Encode(codecId, value) {\n\tif (typeof value !== \"bigint\") encodeFailed(codecId, \"value must be a bigint\", value);\n\treturn Long.fromBigInt(requireInt64(codecId, value));\n}\n/**\n* The driver promotes a stored `long` that fits in 53 bits to a `number`, and hands larger ones over as `Long`, so both arrive here.\n*/\nfunction int64Decode(codecId, wire) {\n\tif (typeof wire === \"bigint\") return wire;\n\tif (isLong(wire)) return wire.toBigInt();\n\tif (typeof wire === \"number\" && Number.isSafeInteger(wire)) return BigInt(wire);\n\treturn decodeFailed(codecId, \"wire value must be a Long or a safe integer\", wire);\n}\n/**\n* A schema-written default arrives as a `number`; one that is a safe integer names its value exactly, so it is accepted like `pg/int8@1` accepts it.\n*/\nfunction int64EncodeJson(codecId, value) {\n\tif (typeof value === \"bigint\") return requireInt64(codecId, value).toString();\n\tif (typeof value === \"number\" && Number.isSafeInteger(value)) return BigInt(value).toString();\n\treturn encodeFailed(codecId, \"value must be a bigint or a safe integer\", value);\n}\nfunction int64DecodeJson(codecId, json) {\n\tif (typeof json !== \"string\" || !DECIMAL_INTEGER.test(json)) return decodeFailed(codecId, \"JSON value must be decimal integer text\", json);\n\tconst value = BigInt(json);\n\tif (!isInt64(value)) return decodeFailed(codecId, \"JSON value is outside the signed 64-bit range\", json);\n\treturn value;\n}\nfunction decimalTextBigintLiteral(value) {\n\treturn typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;\n}\n/**\n* `Decimal128.toString()` writes some values with an exponent (`1E+3`, `1.23E+40`). The application value is decimal text without one, as for Postgres `numeric`: the point moves to where the exponent puts it, trailing zeros stay, and the sign of zero goes.\n*/\nfunction canonicalDecimalText(text) {\n\tif (text === \"NaN\" || text === \"Infinity\" || text === \"-Infinity\") return text;\n\tconst match = DECIMAL128_TEXT.exec(text);\n\tif (match === null) return void 0;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\", exponent = \"0\"] = match;\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tlet integerPart;\n\tlet fractionPart;\n\tif (point <= 0) {\n\t\tintegerPart = \"0\";\n\t\tfractionPart = `${\"0\".repeat(-point)}${digits}`;\n\t} else if (point >= digits.length) {\n\t\tintegerPart = `${digits}${\"0\".repeat(point - digits.length)}`;\n\t\tfractionPart = \"\";\n\t} else {\n\t\tintegerPart = digits.slice(0, point);\n\t\tfractionPart = digits.slice(point);\n\t}\n\tconst trimmedInteger = integerPart.replace(/^0+(?=\\d)/, \"\");\n\tconst unsigned = fractionPart === \"\" ? trimmedInteger : `${trimmedInteger}.${fractionPart}`;\n\treturn /^[0.]+$/.test(unsigned) ? unsigned : `${sign}${unsigned}`;\n}\nfunction requireCanonicalDecimalText(codecId, value) {\n\tif (typeof value !== \"string\" || !CANONICAL_DECIMAL_TEXT.test(value)) encodeFailed(codecId, \"value must be decimal text without an exponent, or NaN, Infinity or -Infinity\", value);\n\treturn value;\n}\nfunction decimal128Encode(codecId, value) {\n\trequireCanonicalDecimalText(codecId, value);\n\ttry {\n\t\treturn Decimal128.fromString(value);\n\t} catch (error) {\n\t\treturn encodeFailed(codecId, `value cannot be stored as a Decimal128 exactly: ${error instanceof Error ? error.message : String(error)}`, value);\n\t}\n}\nfunction decimal128Decode(codecId, wire) {\n\tif (!isDecimal128(wire)) return decodeFailed(codecId, \"wire value must be a Decimal128\", wire);\n\tconst text = canonicalDecimalText(wire.toString());\n\tif (text === void 0) return decodeFailed(codecId, \"wire value is not decimal text\", wire);\n\treturn text;\n}\nfunction decimal128EncodeJson(codecId, value) {\n\treturn requireCanonicalDecimalText(codecId, value);\n}\n/**\n* The JSON form is what `encodeJson` writes, so it follows the encode rule: canonical decimal text (no exponent), or `NaN`, `Infinity` or `-Infinity`, that a Decimal128 holds exactly.\n*/\nfunction decimal128DecodeJson(codecId, json) {\n\tif (typeof json !== \"string\" || !CANONICAL_DECIMAL_TEXT.test(json)) return decodeFailed(codecId, \"JSON value must be decimal text without an exponent, or NaN, Infinity or -Infinity\", json);\n\ttry {\n\t\tDecimal128.fromString(json);\n\t} catch {\n\t\treturn decodeFailed(codecId, \"JSON value cannot be stored as a Decimal128 exactly\", json);\n\t}\n\treturn json;\n}\nfunction binaryEncode(codecId, value) {\n\tif (!(value instanceof Uint8Array)) encodeFailed(codecId, \"value must be a Uint8Array\", value);\n\treturn new Binary(value);\n}\nfunction binaryDecode(codecId, wire) {\n\tif (!isBinary(wire)) return decodeFailed(codecId, \"wire value must be a Binary\", wire);\n\treturn new Uint8Array(wire.value());\n}\nfunction binaryEncodeJson(value) {\n\treturn Buffer.from(value).toString(\"base64\");\n}\nfunction binaryDecodeJson(codecId, json) {\n\tif (typeof json !== \"string\" || !BASE64_TEXT.test(json)) return decodeFailed(codecId, \"JSON value must be base64 text\", json);\n\treturn new Uint8Array(Buffer.from(json, \"base64\"));\n}\n//#endregion\n//#region src/core/json-codec-helpers.ts\nfunction encodeRefused(received, path) {\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${MONGO_JSON_CODEC_ID} value must be a JSON value; received ${received} at ${where(path)}`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction describeNonJson(value) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return void 0;\n\tif (typeof value === \"number\") return Number.isFinite(value) ? void 0 : String(value);\n\tif (typeof value !== \"object\") return typeof value;\n\tconst tag = bsonTypeTag(value);\n\tif (tag !== void 0) return tag;\n\tif (value instanceof Date) return \"Date\";\n\tif (isPlainArray(value)) return void 0;\n\treturn isPlainObject(value) ? void 0 : constructorName(value);\n}\nfunction assertJsonValue(value, path, ancestors) {\n\tconst received = describeNonJson(value);\n\tif (received !== void 0) encodeRefused(received, path);\n\tif (typeof value !== \"object\" || value === null) return;\n\tif (ancestors.has(value)) encodeRefused(\"circular reference\", path);\n\tancestors.add(value);\n\tif (Array.isArray(value)) for (let index = 0; index < value.length; index++) {\n\t\tif (!(index in value)) encodeRefused(\"sparse array hole\", child(path, index));\n\t\tassertJsonValue(value[index], child(path, index), ancestors);\n\t}\n\telse for (const [key, entry] of Object.entries(value)) assertJsonValue(entry, child(path, key), ancestors);\n\tancestors.delete(value);\n}\n/**\n* Returns `value` unchanged when it is a plain JSON value at every depth, and throws `RUNTIME.ENCODE_FAILED` naming the first value that is not, with its path.\n*/\nfunction encodeJsonValue(value) {\n\tassertJsonValue(value, \"\", /* @__PURE__ */ new Set());\n\treturn value;\n}\nconst BSON_TYPE_BY_TAG = {\n\tObjectId: \"objectId\",\n\tDecimal128: \"decimal\",\n\tBinary: \"binData\",\n\tBSONRegExp: \"regex\",\n\tTimestamp: \"timestamp\",\n\tBSONSymbol: \"symbol\",\n\tCode: \"javascript\",\n\tMinKey: \"minKey\",\n\tMaxKey: \"maxKey\"\n};\nfunction decodeRefused(bsonType, path) {\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${MONGO_JSON_CODEC_ID} wire value contains a non-JSON BSON ${bsonType} at ${where(path)}`, { meta: {\n\t\tcodecId: MONGO_JSON_CODEC_ID,\n\t\treceived: bsonType,\n\t\tvaluePath: path\n\t} });\n}\nfunction safeLong(value, path) {\n\tconst number = Number(value);\n\treturn Number.isSafeInteger(number) && BigInt(number) === value ? number : decodeRefused(\"long\", path);\n}\nfunction finiteDouble(value, path) {\n\treturn Number.isFinite(value) ? value : decodeRefused(\"double\", path);\n}\nfunction decodeEntries(entries, path) {\n\treturn Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue(entry, child(path, key))]));\n}\nfunction decodeTagged(value, tag, path) {\n\tswitch (tag) {\n\t\tcase \"DBRef\": return decodeEntries(dbRefEntries(value), path);\n\t\tcase \"Long\": return safeLong(blindCast(value).toBigInt(), path);\n\t\tcase \"Int32\":\n\t\tcase \"Double\": return finiteDouble(Number(value.valueOf()), path);\n\t}\n\treturn decodeRefused(BSON_TYPE_BY_TAG[tag] ?? tag, path);\n}\nfunction decodeValue(value, path) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return value;\n\tif (typeof value === \"number\") return finiteDouble(value, path);\n\tif (typeof value === \"bigint\") return safeLong(value, path);\n\tif (typeof value === \"undefined\") return decodeRefused(\"undefined\", path);\n\tif (typeof value === \"symbol\") return decodeRefused(\"symbol\", path);\n\tif (typeof value === \"function\") return decodeRefused(\"javascript\", path);\n\tconst tag = bsonClassTag(value);\n\tif (tag !== void 0) return decodeTagged(value, tag, path);\n\tif (value instanceof Date) return decodeRefused(\"date\", path);\n\tif (value instanceof RegExp) return decodeRefused(\"regex\", path);\n\tif (value instanceof Uint8Array) return decodeRefused(\"binData\", path);\n\tif (Array.isArray(value)) {\n\t\tconst decoded = value.map((entry, index) => decodeValue(entry, child(path, index)));\n\t\treturn decoded.some((entry, index) => entry !== value[index]) ? decoded : value;\n\t}\n\tif (!isPlainObject(value)) return decodeRefused(constructorName(value), path);\n\tconst entries = Object.entries(value);\n\tconst decoded = decodeEntries(entries, path);\n\treturn entries.some(([key, entry]) => decoded[key] !== entry) ? decoded : blindCast(value);\n}\n/**\n* Decodes a wire value to the JSON value it holds: a `long` in the safe-integer range and the driver's `Int32` and `Double` wrappers become numbers. Only the objects and arrays around a converted value are copied; a wire value that is already JSON is returned as the same object. Throws `RUNTIME.DECODE_FAILED` naming the BSON type and path of the first value that is not JSON.\n*/\nfunction decodeJsonValue(wire) {\n\treturn decodeValue(wire, \"\");\n}\n//#endregion\n//#region src/core/codecs.ts\nconst mongoObjectIdCodec = mongoCodec({\n\ttypeId: MONGO_OBJECTID_CODEC_ID,\n\tdecode: (wire) => wire.toHexString(),\n\tencode: (value) => new ObjectId(value)\n});\nconst mongoStringCodec = mongoCodec({\n\ttypeId: MONGO_STRING_CODEC_ID,\n\tdecode: (wire) => wire,\n\tencode: (value) => value\n});\nconst mongoDoubleCodec = mongoCodec({\n\ttypeId: MONGO_DOUBLE_CODEC_ID,\n\tdecode: (wire) => wire,\n\tencode: (value) => value\n});\nconst mongoInt32Codec = mongoCodec({\n\ttypeId: MONGO_INT32_CODEC_ID,\n\tdecode: (wire) => wire,\n\tencode: (value) => value\n});\nconst mongoBooleanCodec = mongoCodec({\n\ttypeId: MONGO_BOOLEAN_CODEC_ID,\n\tdecode: (wire) => wire,\n\tencode: (value) => value\n});\nconst mongoDateCodec = mongoCodec({\n\ttypeId: MONGO_DATE_CODEC_ID,\n\tdecode: (wire) => wire,\n\tencode: (value) => value,\n\tencodeJson: (value) => value.toISOString(),\n\tdecodeJson: (json) => {\n\t\tif (typeof json !== \"string\") throw mongoTargetError(\"RUNTIME.DECODE_FAILED\", \"expected ISO date string\", { meta: {\n\t\t\tcodecId: MONGO_DATE_CODEC_ID,\n\t\t\treceived: typeof json\n\t\t} });\n\t\treturn new Date(json);\n\t}\n});\nconst mongoVectorCodec = mongoCodec({\n\ttypeId: MONGO_VECTOR_CODEC_ID,\n\tdecode: (wire) => wire,\n\tencode: (value) => value\n});\n/**\n* A BSON `long`. The application value is a `bigint`, because a `number` cannot hold the full 64-bit range; its JSON form is decimal text.\n*/\nconst mongoInt64Codec = mongoCodec({\n\ttypeId: MONGO_INT64_CODEC_ID,\n\tdecode: (wire) => int64Decode(MONGO_INT64_CODEC_ID, wire),\n\tencode: (value) => int64Encode(MONGO_INT64_CODEC_ID, value),\n\tencodeJson: (value) => int64EncodeJson(MONGO_INT64_CODEC_ID, value),\n\tdecodeJson: (json) => int64DecodeJson(MONGO_INT64_CODEC_ID, json)\n});\n/**\n* A BSON `decimal`. The application value and its JSON form are the same decimal text, written without an exponent.\n*/\nconst mongoDecimal128Codec = mongoCodec({\n\ttypeId: MONGO_DECIMAL128_CODEC_ID,\n\tdecode: (wire) => decimal128Decode(MONGO_DECIMAL128_CODEC_ID, wire),\n\tencode: (value) => decimal128Encode(MONGO_DECIMAL128_CODEC_ID, value),\n\tencodeJson: (value) => decimal128EncodeJson(MONGO_DECIMAL128_CODEC_ID, value),\n\tdecodeJson: (json) => decimal128DecodeJson(MONGO_DECIMAL128_CODEC_ID, json)\n});\n/**\n* BSON `binData`. The application value is a `Uint8Array`; its JSON form is unwrapped base64.\n*/\nconst mongoBinaryCodec = mongoCodec({\n\ttypeId: MONGO_BINARY_CODEC_ID,\n\tdecode: (wire) => binaryDecode(MONGO_BINARY_CODEC_ID, wire),\n\tencode: (value) => binaryEncode(MONGO_BINARY_CODEC_ID, value),\n\tencodeJson: binaryEncodeJson,\n\tdecodeJson: (json) => binaryDecodeJson(MONGO_BINARY_CODEC_ID, json)\n});\n/**\n* A JSON value, stored as the BSON object, array, string, number, boolean or null it maps to. Encode and decode refuse any other value at any depth, naming its path.\n*/\nconst mongoJsonCodec = mongoCodec({\n\ttypeId: MONGO_JSON_CODEC_ID,\n\tdecode: (wire) => decodeJsonValue(wire),\n\tencode: (value) => encodeJsonValue(value)\n});\n/**\n* Any BSON value, passed through unchanged except that decode turns a `DBRef` back into the `{ $ref, $id }` document it was stored as. Encode takes a `BsonInputValue` and decode returns a `BsonValue`. Its JSON form is canonical MongoDB Extended JSON v2, written with each number and `Uint8Array` as the BSON type the driver stores, so a round trip keeps the BSON bytes but may return wrapper classes such as `Int32` and `Double`.\n*/\nconst mongoBsonCodec = mongoCodec({\n\ttypeId: MONGO_BSON_CODEC_ID,\n\tdecode: (wire) => decodeBsonValue(wire),\n\tencode: (value) => encodeBsonValue(value),\n\tencodeJson: encodeBsonJson,\n\tdecodeJson: decodeBsonJson\n});\n/**\n* The canonical set of Mongo wire-type codecs.\n*\n* Single source of truth for both control- and runtime-plane adapter descriptors. Don't duplicate this list — import it.\n*/\nconst mongoStandardCodecs = [\n\tmongoObjectIdCodec,\n\tmongoStringCodec,\n\tmongoDoubleCodec,\n\tmongoInt32Codec,\n\tmongoBooleanCodec,\n\tmongoDateCodec,\n\tmongoVectorCodec,\n\tmongoInt64Codec,\n\tmongoDecimal128Codec,\n\tmongoBinaryCodec,\n\tmongoJsonCodec,\n\tmongoBsonCodec\n];\n/**\n* Build a {@link CodecDescriptor} for a Mongo wire-type codec.\n*\n* Wraps an existing {@link MongoCodec} instance into a descriptor whose factory hands out the same shared codec. Mongo's full migration to descriptor-first authoring is tracked under TML-2324; for now the descriptor view is composed from the existing `mongoCodec()` outputs.\n*/\nfunction descriptorFor(codec, metadata) {\n\tconst renderOutputType = blindCast(metadata.renderOutputType);\n\treturn {\n\t\tcodecId: codec.id,\n\t\tdataType: metadata.dataType,\n\t\ttraits: metadata.traits,\n\t\ttargetTypes: metadata.targetTypes,\n\t\tparamsSchema: blindCast(void 0),\n\t\tisParameterized: false,\n\t\tfactory: blindCast(() => () => codec),\n\t\t...ifDefined(\"renderOutputType\", renderOutputType),\n\t\t...ifDefined(\"renderValueLiteral\", metadata.renderValueLiteral)\n\t};\n}\nconst renderVectorOutputType = (typeParams) => {\n\tconst length = typeParams[\"length\"];\n\tif (length === void 0) return void 0;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length) || length <= 0) throw mongoTargetError(\"RUNTIME.TYPE_PARAMS_INVALID\", \"renderOutputType: expected positive integer \\\"length\\\" for Vector\", { meta: {\n\t\tnativeType: \"Vector\",\n\t\tparam: \"length\",\n\t\treceived: length\n\t} });\n\treturn `Vector<${length}>`;\n};\n/**\n* Mongo wire-type codec descriptors. Static metadata for `traits`, `targetTypes`, and `renderOutputType` lives here (the descriptor shape) — `MongoCodec` itself is narrow and only carries the four conversion methods (TML-2357).\n*/\nconst mongoCodecDescriptors = [\n\tdescriptorFor(mongoObjectIdCodec, {\n\t\tdataType: mongoObjectId.id,\n\t\ttraits: [\"equality\"],\n\t\ttargetTypes: [\"objectId\"]\n\t}),\n\tdescriptorFor(mongoStringCodec, {\n\t\tdataType: mongoString.id,\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"textual\"\n\t\t],\n\t\ttargetTypes: [\"string\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tdescriptorFor(mongoDoubleCodec, {\n\t\tdataType: mongoDouble.id,\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\ttargetTypes: [\"double\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tdescriptorFor(mongoInt32Codec, {\n\t\tdataType: mongoInt32.id,\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\ttargetTypes: [\"int\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tdescriptorFor(mongoBooleanCodec, {\n\t\tdataType: mongoBool.id,\n\t\ttraits: [\"equality\", \"boolean\"],\n\t\ttargetTypes: [\"bool\"],\n\t\trenderValueLiteral: renderTsLiteral\n\t}),\n\tdescriptorFor(mongoDateCodec, {\n\t\tdataType: mongoDate.id,\n\t\ttraits: [\"equality\", \"order\"],\n\t\ttargetTypes: [\"date\"]\n\t}),\n\tdescriptorFor(mongoVectorCodec, {\n\t\tdataType: mongoVector.id,\n\t\ttraits: [\"equality\"],\n\t\ttargetTypes: [\"vector\"],\n\t\trenderOutputType: renderVectorOutputType\n\t}),\n\tdescriptorFor(mongoInt64Codec, {\n\t\tdataType: mongoInt64.id,\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\ttargetTypes: [\"long\"],\n\t\trenderValueLiteral: decimalTextBigintLiteral\n\t}),\n\tdescriptorFor(mongoDecimal128Codec, {\n\t\tdataType: mongoDecimal128.id,\n\t\ttraits: [\n\t\t\t\"equality\",\n\t\t\t\"order\",\n\t\t\t\"numeric\"\n\t\t],\n\t\ttargetTypes: [\"decimal\"]\n\t}),\n\tdescriptorFor(mongoBinaryCodec, {\n\t\tdataType: mongoBinary.id,\n\t\ttraits: [\"equality\"],\n\t\ttargetTypes: [\"binData\"]\n\t}),\n\tdescriptorFor(mongoJsonCodec, {\n\t\tdataType: mongoJson.id,\n\t\ttraits: [],\n\t\ttargetTypes: [\n\t\t\t\"object\",\n\t\t\t\"array\",\n\t\t\t\"string\",\n\t\t\t\"double\",\n\t\t\t\"int\",\n\t\t\t\"long\",\n\t\t\t\"bool\",\n\t\t\t\"null\"\n\t\t]\n\t}),\n\tdescriptorFor(mongoBsonCodec, {\n\t\tdataType: mongoBson.id,\n\t\ttraits: [],\n\t\ttargetTypes: []\n\t})\n];\n/**\n* Lookup descriptor metadata by codec id — used by tests and for descriptor-side reads of static metadata.\n*/\nfunction mongoDescriptorById(codecId) {\n\treturn mongoCodecDescriptors.find((d) => d.codecId === codecId);\n}\n/**\n* Build a {@link MongoCodecRegistry} preloaded with the standard Mongo wire-type codecs.\n*\n* Single point of truth for adapter-side codec construction: used by the legacy synchronous `createMongoAdapter()` factory and by the runtime adapter descriptor's `codecs()` getter. Userland code obtains a registry via the framework's execution-stack composition (see `createMongoExecutionContext`) instead of calling this directly.\n*/\nfunction buildStandardCodecRegistry() {\n\tconst registry = newMongoCodecRegistry();\n\tfor (const codec of mongoStandardCodecs) registry.register(codec);\n\treturn registry;\n}\n//#endregion\nexport { mongoTargetError as a, mongoStandardCodecs as i, mongoCodecDescriptors as n, mongoDescriptorById as r, buildStandardCodecRegistry as t };\n\n//# sourceMappingURL=codecs-B0Szbq1k.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,MAAM,MAAM;CACpB,OAAO,SAAS,KAAK,aAAa;AACnC;AACA,SAAS,MAAM,MAAM,KAAK;CACzB,OAAO,SAAS,KAAK,OAAO,GAAG,IAAI,GAAG,KAAK,GAAG;AAC/C;AACA,SAAS,cAAc,OAAO;CAC7B,MAAM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AAK;CAChE,OAAO;AACR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CodecDescriptor } from "@prisma/orm-framework/components/codec";
|
|
2
2
|
import { MongoCodec, MongoCodecRegistry } from "@prisma/orm-family-mongo/codec";
|
|
3
3
|
import { Binary, Decimal128, Long, ObjectId } from "bson";
|
|
4
|
+
import { BsonInputValue, BsonValue } from "@prisma/orm-family-mongo/value";
|
|
4
5
|
import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
5
6
|
//#region ../../../3-mongo-target/1-mongo-target/dist/codecs.d.mts
|
|
6
7
|
//#region src/core/codecs.d.ts
|
|
@@ -9,11 +10,13 @@ import { JsonValue } from "@prisma/orm-framework/contract/types";
|
|
|
9
10
|
*
|
|
10
11
|
* Single source of truth for both control- and runtime-plane adapter descriptors. Don't duplicate this list — import it.
|
|
11
12
|
*/
|
|
12
|
-
declare const mongoStandardCodecs: readonly [MongoCodec<"mongo/objectId@1", readonly [], ObjectId, string>, MongoCodec<"mongo/string@1", readonly [], string, string>, MongoCodec<"mongo/double@1", readonly [], number, number>, MongoCodec<"mongo/int32@1", readonly [], number, number>, MongoCodec<"mongo/bool@1", readonly [], boolean, boolean>, MongoCodec<"mongo/date@1", readonly [], Date, Date>, MongoCodec<"mongo/vector@1", readonly [], readonly number[], readonly number[]>, MongoCodec<"mongo/int64@1", readonly [], number | bigint | Long, bigint>, MongoCodec<"mongo/decimal128@1", readonly [], Decimal128, string>, MongoCodec<"mongo/binary@1", readonly [], Binary, Uint8Array<ArrayBufferLike>>, MongoCodec<"mongo/json@1", readonly [], string | number | boolean | {
|
|
13
|
+
declare const mongoStandardCodecs: readonly [MongoCodec<"mongo/objectId@1", readonly [], ObjectId, string, string>, MongoCodec<"mongo/string@1", readonly [], string, string, string>, MongoCodec<"mongo/double@1", readonly [], number, number, number>, MongoCodec<"mongo/int32@1", readonly [], number, number, number>, MongoCodec<"mongo/bool@1", readonly [], boolean, boolean, boolean>, MongoCodec<"mongo/date@1", readonly [], Date, Date, Date>, MongoCodec<"mongo/vector@1", readonly [], readonly number[], readonly number[], readonly number[]>, MongoCodec<"mongo/int64@1", readonly [], number | bigint | Long, bigint, bigint>, MongoCodec<"mongo/decimal128@1", readonly [], Decimal128, string, string>, MongoCodec<"mongo/binary@1", readonly [], Binary, Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>, MongoCodec<"mongo/json@1", readonly [], string | number | boolean | {
|
|
13
14
|
readonly [key: string]: JsonValue;
|
|
14
15
|
} | readonly JsonValue[] | null, string | number | boolean | {
|
|
15
16
|
readonly [key: string]: JsonValue;
|
|
16
|
-
} | readonly JsonValue[] | null
|
|
17
|
+
} | readonly JsonValue[] | null, string | number | boolean | {
|
|
18
|
+
readonly [key: string]: JsonValue;
|
|
19
|
+
} | readonly JsonValue[] | null>, MongoCodec<"mongo/bson@1", readonly [], BsonInputValue, BsonInputValue, BsonValue>];
|
|
17
20
|
/**
|
|
18
21
|
* Mongo wire-type codec descriptors. Static metadata for `traits`, `targetTypes`, and `renderOutputType` lives here (the descriptor shape) — `MongoCodec` itself is narrow and only carries the four conversion methods (TML-2357).
|
|
19
22
|
*/
|
|
@@ -30,4 +33,4 @@ declare function mongoDescriptorById(codecId: string): CodecDescriptor | undefin
|
|
|
30
33
|
declare function buildStandardCodecRegistry(): MongoCodecRegistry;
|
|
31
34
|
//#endregion
|
|
32
35
|
export { mongoStandardCodecs as i, mongoCodecDescriptors as n, mongoDescriptorById as r, buildStandardCodecRegistry as t };
|
|
33
|
-
//# sourceMappingURL=codecs-
|
|
36
|
+
//# sourceMappingURL=codecs-xffquj_O.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-xffquj_O.d.mts","names":[],"sources":["../../../../3-mongo-target/1-mongo-target/dist/codecs.d.mts"],"mappings":";;;;;;;;;;;;cAWc,+BAA+B,4CAA4C,2BAA2B,mEAAmE,mEAAmE,kEAAkE,oEAAoE,wCAAwC,MAAM,MAAM,OAAO,oGAAoG,2DAA2D,uBAAuB,8CAA8C,6BAA6B,0CAA0C,QAAQ,WAAW,kBAAkB,WAAW,mBAAmB;YAC7xB,cAAc;aACb;YACD,cAAc;aACb;YACD,cAAc;aACb,qBAAqB,wCAAwC,gBAAgB,gBAAgB;;;;cAI5F,uBAAuB,cAAc;;;;iBAIlC,oBAAoB,kBAAkB;;;;;;iBAMtC,8BAA8B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as mongoTargetError } from "./codecs-
|
|
2
|
-
import { t as mongoTargetDescriptorMeta } from "./descriptor-meta-
|
|
1
|
+
import { a as mongoTargetError } from "./codecs-B0Szbq1k-DGXwjn9l.mjs";
|
|
2
|
+
import { t as mongoTargetDescriptorMeta } from "./descriptor-meta-Bobm2m-Q-C9Bd4xUM.mjs";
|
|
3
3
|
import { a as dropCollection, n as createCollection, o as dropIndex, r as createIndex, t as collMod } from "./migration-factories-D9gdxskt-B01b9zbg.mjs";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
5
5
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -1600,4 +1600,4 @@ const mongoTargetDescriptor = {
|
|
|
1600
1600
|
//#endregion
|
|
1601
1601
|
export { renderCallsToTypeScript as _, DropIndexCall as a, schemaIndexToCreateIndexOptions as b, MongoMigrationRunner as c, MongoTargetSchemaVerifier as d, MongoTargetUnboundDatabase as f, mongoTargetDescriptor as g, deserializeMongoOps as h, DropCollectionCall as i, MongoTargetContractSerializer as l, deserializeMongoOp as m, CreateCollectionCall as n, FilterEvaluator as o, PlannerProducedMongoMigration as p, CreateIndexCall as r, MongoMigrationPlanner as s, CollModCall as t, MongoTargetDatabase as u, renderOps as v, serializeMongoOps as x, schemaCollectionToCreateCollectionOptions as y };
|
|
1602
1602
|
|
|
1603
|
-
//# sourceMappingURL=control-
|
|
1603
|
+
//# sourceMappingURL=control-BsJepSbb.mjs.map
|