@prisma/orm-target-mongo 8.0.0-rc.23-dev.9 → 8.0.0-rc.23-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__runtime.mjs +7 -2
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/codec-ids-B8WIyai-.d.mts +25 -0
- package/dist/{codec-ids-BKQbXhZt.d.mts.map → codec-ids-B8WIyai-.d.mts.map} +1 -1
- package/dist/codec-ids-DZQsuh80-ywDzfnAg.mjs +25 -0
- package/dist/codec-ids-DZQsuh80-ywDzfnAg.mjs.map +1 -0
- package/dist/{codec-types-oKxM85p-.d.mts → codec-types-C6UDhw7l.d.mts} +37 -1
- package/dist/codec-types-C6UDhw7l.d.mts.map +1 -0
- package/dist/codecs-BbX2VMzN-Dm9db3Jz.mjs +620 -0
- package/dist/codecs-BbX2VMzN-Dm9db3Jz.mjs.map +1 -0
- package/dist/{control-CdHPs2QG.mjs → control-B77seMDK.mjs} +7 -4
- package/dist/control-B77seMDK.mjs.map +1 -0
- package/dist/{control-DfDVW_9x.mjs → control-CHr0ZjKM.mjs} +2 -2
- package/dist/{control-DfDVW_9x.mjs.map → control-CHr0ZjKM.mjs.map} +1 -1
- package/dist/{data-types-hoKLBrYZ-h9cAgbOy.mjs → data-types-Cq1kg82y-Vk7z6rnW.mjs} +88 -5
- package/dist/data-types-Cq1kg82y-Vk7z6rnW.mjs.map +1 -0
- package/dist/data-types-ozSM4YdB.d.mts +39 -0
- package/dist/data-types-ozSM4YdB.d.mts.map +1 -0
- package/dist/date-time-now-generators-fWUk_--7-BnCnC0d8.mjs +66 -0
- package/dist/date-time-now-generators-fWUk_--7-BnCnC0d8.mjs.map +1 -0
- package/dist/{descriptor-meta-_vnrMWD4-CXzRuo6u.mjs → descriptor-meta-CFsOxO6g-Ca8valmZ.mjs} +204 -20
- package/dist/descriptor-meta-CFsOxO6g-Ca8valmZ.mjs.map +1 -0
- package/dist/{descriptor-meta-runtime-M_DCE9pk-BltR3MLY.mjs → descriptor-meta-runtime-CBJIjp5R-DMQ9-3Hd.mjs} +4 -4
- package/dist/{descriptor-meta-runtime-M_DCE9pk-BltR3MLY.mjs.map → descriptor-meta-runtime-CBJIjp5R-DMQ9-3Hd.mjs.map} +1 -1
- 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/{migration-factories-CUyEIo5p-CXTwpgxe.mjs → migration-factories-oLRWgLGz-B9fWm8Wc.mjs} +3 -3
- package/dist/{migration-factories-CUyEIo5p-CXTwpgxe.mjs.map → migration-factories-oLRWgLGz-B9fWm8Wc.mjs.map} +1 -1
- package/dist/{mongo-adapter-RJ_YOxiK-yG_qHDyR.mjs → mongo-adapter-RJ_YOxiK-jlyFS6Wr.mjs} +3 -3
- package/dist/{mongo-adapter-RJ_YOxiK-yG_qHDyR.mjs.map → mongo-adapter-RJ_YOxiK-jlyFS6Wr.mjs.map} +1 -1
- package/dist/{mongo-driver-DGpvEBcg-DD5q-5iT.mjs → mongo-driver-CSDRQwak-j3pdkDuW.mjs} +3 -3
- package/dist/mongo-driver-CSDRQwak-j3pdkDuW.mjs.map +1 -0
- package/dist/{pack-BJLQkv5o.d.mts → pack-FzGKNW0Q.d.mts} +358 -38
- package/dist/pack-FzGKNW0Q.d.mts.map +1 -0
- package/dist/{prisma6-binding-BuMRLaNZ.mjs → prisma6-binding-BjKPGVql.mjs} +3 -3
- package/dist/{prisma6-binding-BuMRLaNZ.mjs.map → prisma6-binding-BjKPGVql.mjs.map} +1 -1
- package/dist/runtime-C-5ghims.d.mts +42 -0
- package/dist/runtime-C-5ghims.d.mts.map +1 -0
- package/dist/{runtime-Jc2oA31j.mjs → runtime-DyWNR1FZ.mjs} +2 -2
- package/dist/runtime-DyWNR1FZ.mjs.map +1 -0
- package/dist/target.d.mts +6 -6
- package/dist/target.mjs +8 -7
- package/dist/target__codec-ids.d.mts +2 -2
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.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__migration.mjs +1 -1
- package/dist/target__pack.d.mts +2 -2
- 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.d.mts +2 -2
- package/dist/target__runtime.mjs +3 -2
- package/package.json +17 -12
- package/dist/codec-ids-BKQbXhZt.d.mts +0 -18
- package/dist/codec-ids-WdrumsYA-CZVjuKW8.mjs +0 -18
- package/dist/codec-ids-WdrumsYA-CZVjuKW8.mjs.map +0 -1
- package/dist/codec-types-oKxM85p-.d.mts.map +0 -1
- package/dist/codecs-_QYfn0YT-BWZI19N1.mjs +0 -342
- package/dist/codecs-_QYfn0YT-BWZI19N1.mjs.map +0 -1
- package/dist/control-CdHPs2QG.mjs.map +0 -1
- package/dist/data-types-LShlnAUM.d.mts +0 -25
- package/dist/data-types-LShlnAUM.d.mts.map +0 -1
- package/dist/data-types-hoKLBrYZ-h9cAgbOy.mjs.map +0 -1
- package/dist/descriptor-meta-_vnrMWD4-CXzRuo6u.mjs.map +0 -1
- package/dist/mongo-driver-DGpvEBcg-DD5q-5iT.mjs.map +0 -1
- package/dist/pack-BJLQkv5o.d.mts.map +0 -1
- package/dist/runtime-DeUjc8oy.d.mts +0 -11
- package/dist/runtime-DeUjc8oy.d.mts.map +0 -1
- package/dist/runtime-Jc2oA31j.mjs.map +0 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { r as MONGO_BSON_CODEC_ID } from "./codec-ids-
|
|
1
|
+
import { r as MONGO_BSON_CODEC_ID } from "./codec-ids-DZQsuh80-ywDzfnAg.mjs";
|
|
2
2
|
import { t as mongoTargetError } from "./mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs";
|
|
3
3
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
|
-
import { INT32_RANGE, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, asFloat, asNumeralText, castUnchanged, decimalTextEqualityKey, isIntegerIn, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from "@prisma/orm-framework/components/codec";
|
|
4
|
+
import { INT32_RANGE, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, asFloat, asNumeralText, castUnchanged, dateTimeStoredText, decimalTextEqualityKey, isIntegerIn, isoDateStringText, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { counted } from "@prisma/orm-framework/utils/text";
|
|
6
6
|
import { Binary, Code, Decimal128, Double, EJSON, Long, MinKey, ObjectId } from "bson";
|
|
7
7
|
import { mongoDataType } from "@prisma/orm-family-mongo/contract/data-type";
|
|
8
|
+
import { withThreeFractionDigits, withoutZerosBelowAMillisecond } from "@prisma/orm-framework/type-implementations/date";
|
|
9
|
+
import { ISO_DURATION_AS_WRITTEN } from "@prisma/orm-framework/type-implementations/duration";
|
|
10
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
8
11
|
import { type } from "arktype";
|
|
9
12
|
import { isDeepStrictEqual } from "node:util";
|
|
10
13
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
11
|
-
//#region ../../../3-targets/mongo/1-target/dist/data-types-
|
|
14
|
+
//#region ../../../3-targets/mongo/1-target/dist/data-types-Cq1kg82y.mjs
|
|
12
15
|
const STORED_DECIMAL_TEXT = /^(?:-?\d+(?:\.\d+)?|NaN|-?Infinity)$/;
|
|
13
16
|
const DECIMAL128_TEXT = /^(-?)(\d+)(?:\.(\d+))?(?:E([+-]\d+))?$/;
|
|
14
17
|
const BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
@@ -514,10 +517,63 @@ function vectorElements(elements) {
|
|
|
514
517
|
});
|
|
515
518
|
});
|
|
516
519
|
}
|
|
520
|
+
/** The calendar dates a JavaScript `Date`, and so a BSON date, holds at midnight UTC. */
|
|
521
|
+
const DATE_RANGE = {
|
|
522
|
+
earliest: "-271821-04-20",
|
|
523
|
+
latest: "+275760-09-13"
|
|
524
|
+
};
|
|
525
|
+
/** An instant as `mongo/date` stores it, in UTC with three fraction digits, from ISO 8601 text with a UTC offset in which zeros past the third fraction digit are dropped. Throws `CONTRACT.CAST_REFUSED` for text that names no instant a `Date` holds. */
|
|
526
|
+
function mongoInstantText(text) {
|
|
527
|
+
return isoDateStringText(withoutZerosBelowAMillisecond(text), "mongo/date");
|
|
528
|
+
}
|
|
529
|
+
/** A calendar date as ISO 8601 text, `2024-02-29`, in the years a BSON date holds at midnight UTC. Throws `CONTRACT.CAST_REFUSED` for text that names no such date. */
|
|
530
|
+
function mongoCalendarDateText(text) {
|
|
531
|
+
return dateTimeStoredText(text, {
|
|
532
|
+
shape: "date",
|
|
533
|
+
ownerId: "mongo/calendar-date",
|
|
534
|
+
range: DATE_RANGE
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
/** The value of `mongo/time`: a time of day with exactly three fraction digits, `09:30:00.000`, so the strings sort in the order of the times. Zeros past the third fraction digit are dropped; any other digit there is refused. Throws `CONTRACT.CAST_REFUSED` for text that names no such time. */
|
|
538
|
+
function mongoTimeText(text) {
|
|
539
|
+
return withThreeFractionDigits(dateTimeStoredText(withoutZerosBelowAMillisecond(text), {
|
|
540
|
+
shape: "time",
|
|
541
|
+
ownerId: "mongo/time",
|
|
542
|
+
maxFractionDigits: 3
|
|
543
|
+
}, text));
|
|
544
|
+
}
|
|
545
|
+
/** The value of `mongo/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */
|
|
546
|
+
function mongoDurationText(text) {
|
|
547
|
+
if (ISO_DURATION_AS_WRITTEN.test(text)) return text;
|
|
548
|
+
throw structuredError("CONTRACT.CAST_REFUSED", `mongo/duration cannot read "${text}". Write an ISO 8601 duration, as in "PT1H30M".`, {
|
|
549
|
+
why: "mongo/duration holds an ISO 8601 duration as Temporal.Duration writes it: an optional sign, P, then years, months, weeks and days, then T and hours, minutes and seconds. A sign on each component instead is read too.",
|
|
550
|
+
fix: "Write the duration in ISO 8601, as in \"P1Y2M3DT4H5M6.5S\"."
|
|
551
|
+
});
|
|
552
|
+
}
|
|
517
553
|
const mongoString = mongoDataType("mongo/string", {
|
|
518
554
|
read: (json) => readJsonString("mongo/string", json),
|
|
519
555
|
bsonTypes: ["string"]
|
|
520
556
|
});
|
|
557
|
+
/** What `stored` writes for `text`, or `undefined` when it refuses it. */
|
|
558
|
+
function storedOrUndefined(stored, text) {
|
|
559
|
+
try {
|
|
560
|
+
return stored(text);
|
|
561
|
+
} catch {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
/** A BSON string type in one form for each value when `respell`: it reads any text `stored` takes, and spells it in the form `stored` writes. It takes a `mongo/string` value that `stored` reads. */
|
|
566
|
+
function storedStringDataType(id, stored, expected, options) {
|
|
567
|
+
const fromString = (value) => typeof value === "string" ? stored(value) : refuseWrongShape(value, "text");
|
|
568
|
+
const read = (json) => typeof json === "string" && storedOrUndefined(stored, json) !== void 0 ? json : refuseJsonValue(id, expected, json);
|
|
569
|
+
const spell = (json) => typeof json === "string" ? storedOrUndefined(stored, json) ?? json : json;
|
|
570
|
+
return mongoDataType(id, {
|
|
571
|
+
read,
|
|
572
|
+
...ifDefined("spell", options.respell ? spell : void 0),
|
|
573
|
+
bsonTypes: ["string"],
|
|
574
|
+
casts: { [mongoString.id]: fromString }
|
|
575
|
+
});
|
|
576
|
+
}
|
|
521
577
|
const mongoInt32 = mongoDataType("mongo/int32", {
|
|
522
578
|
read: (json) => readInt32Json("mongo/int32", json),
|
|
523
579
|
bsonTypes: ["int"]
|
|
@@ -563,6 +619,30 @@ const mongoDate = mongoDataType("mongo/date", {
|
|
|
563
619
|
read: (json) => readDateJson("mongo/date", json),
|
|
564
620
|
bsonTypes: ["date"]
|
|
565
621
|
});
|
|
622
|
+
/** A time of day, stored as a BSON string with three fraction digits, `09:30:00.000`. */
|
|
623
|
+
const mongoTime = storedStringDataType("mongo/time", mongoTimeText, "ISO 8601 time of day text with at most three fraction digits, as in \"09:30:00\"", { respell: true });
|
|
624
|
+
/** A length of time, stored as the ISO 8601 duration it was written as, `PT1H30M`. Equal durations can be written differently, `P1D` and `PT24H`, so a duration keeps its spelling. */
|
|
625
|
+
const mongoDuration = storedStringDataType("mongo/duration", mongoDurationText, "an ISO 8601 duration, as in \"PT1H30M\"", { respell: false });
|
|
626
|
+
const MILLISECONDS_PER_DAY = 864e5;
|
|
627
|
+
/** A `mongo/date` value, an instant as `toISOString()` writes it, as the calendar date it names when it is at midnight UTC. */
|
|
628
|
+
const asCalendarDate = (value) => {
|
|
629
|
+
if (typeof value !== "string") return refuseWrongShape(value, "text");
|
|
630
|
+
if (new Date(value).getTime() % MILLISECONDS_PER_DAY === 0) return mongoCalendarDateText(value.slice(0, value.indexOf("T")));
|
|
631
|
+
throw structuredError("CONTRACT.CAST_REFUSED", `${value} is not a calendar date: a calendar date is stored as a BSON date at midnight UTC.`, {
|
|
632
|
+
why: "A calendar date holds no time of day.",
|
|
633
|
+
fix: "Write the date alone, as in \"2024-02-29\"."
|
|
634
|
+
});
|
|
635
|
+
};
|
|
636
|
+
/** A calendar date, stored as a BSON date at midnight UTC. Its value is the ISO 8601 date text, `2024-02-29`. */
|
|
637
|
+
const mongoCalendarDate = mongoDataType("mongo/calendar-date", {
|
|
638
|
+
read: (json) => typeof json === "string" && storedOrUndefined(mongoCalendarDateText, json) !== void 0 ? json : refuseJsonValue("mongo/calendar-date", "ISO 8601 date text, as in \"2024-02-29\"", json),
|
|
639
|
+
spell: (json) => typeof json === "string" ? storedOrUndefined(mongoCalendarDateText, json) ?? json : json,
|
|
640
|
+
bsonTypes: ["date"],
|
|
641
|
+
casts: {
|
|
642
|
+
[mongoString.id]: (value) => typeof value === "string" ? mongoCalendarDateText(value) : refuseWrongShape(value, "text"),
|
|
643
|
+
[mongoDate.id]: asCalendarDate
|
|
644
|
+
}
|
|
645
|
+
});
|
|
566
646
|
const mongoVector = mongoDataType("mongo/vector", {
|
|
567
647
|
read: (json, params) => readVectorJson("mongo/vector", json, typeof params["length"] === "number" ? params["length"] : void 0),
|
|
568
648
|
bsonTypes: ["array"],
|
|
@@ -609,6 +689,9 @@ const mongoDataTypes = [
|
|
|
609
689
|
mongoInt32,
|
|
610
690
|
mongoBool,
|
|
611
691
|
mongoDate,
|
|
692
|
+
mongoCalendarDate,
|
|
693
|
+
mongoTime,
|
|
694
|
+
mongoDuration,
|
|
612
695
|
mongoVector,
|
|
613
696
|
mongoInt64,
|
|
614
697
|
mongoDecimal128,
|
|
@@ -619,6 +702,6 @@ const mongoDataTypes = [
|
|
|
619
702
|
/** MongoDB's text data type: `string`. */
|
|
620
703
|
const mongoTextDataTypes = [mongoString.id];
|
|
621
704
|
//#endregion
|
|
622
|
-
export {
|
|
705
|
+
export { mongoVector as $, isBase64Text as A, mongoDecimal128 as B, int64Decode as C, int64NumberFromDigits as D, int64NumberEncode as E, mongoBson as F, mongoInt32 as G, mongoDuration as H, mongoCalendarDate as I, mongoObjectId as J, mongoInt64 as K, mongoCalendarDateText as L, isPlainObject as M, mongoBinary as N, int64NumberToJson as O, mongoBool as P, mongoTimeText as Q, mongoDataTypes as R, int32ToJson as S, int64NumberDecode as T, mongoDurationText as U, mongoDouble as V, mongoInstantText as W, mongoTextDataTypes as X, mongoString as Y, mongoTime as Z, decimal128ToJson as _, booleanEncode as a, vectorEncode as at, encodeBsonValue as b, bsonTypeTag as c, dateEncode as d, mongoVectorParams as et, dateToJson as f, decimal128HoldsExactly as g, decimal128Encode as h, binaryToBase64 as i, stringEncode as it, isPlainArray as j, int64ToJson as k, child as l, decimal128Decode as m, binaryEncode as n, objectIdToJson as nt, bsonClassTag as o, where as ot, dbRefEntries as p, mongoJson as q, binaryFromBase64 as r, readBsonJson as rt, bsonToJson as s, binaryDecode as t, objectIdEncode as tt, constructorName as u, decodeBsonValue as v, int64Encode as w, int32Encode as x, doubleEncode as y, mongoDate as z };
|
|
623
706
|
|
|
624
|
-
//# sourceMappingURL=data-types-
|
|
707
|
+
//# sourceMappingURL=data-types-Cq1kg82y-Vk7z6rnW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-Cq1kg82y-Vk7z6rnW.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/data-types-Cq1kg82y.mjs"],"sourcesContent":["import { r as MONGO_BSON_CODEC_ID } from \"./codec-ids-DZQsuh80.mjs\";\nimport { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { INT32_RANGE, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, asFloat, asNumeralText, castUnchanged, dateTimeStoredText, decimalTextEqualityKey, isIntegerIn, isoDateStringText, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { counted } from \"@internal/utils/text\";\nimport { Binary, Code, Decimal128, Double, EJSON, Long, MinKey, ObjectId } from \"bson\";\nimport { mongoDataType } from \"@internal/mongo-contract/data-type\";\nimport { withThreeFractionDigits, withoutZerosBelowAMillisecond } from \"@internal/type-implementations/date\";\nimport { ISO_DURATION_AS_WRITTEN } from \"@internal/type-implementations/duration\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/core/bson-scalar-helpers.ts\nconst STORED_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}\nfunction describeReceived(value) {\n\tif (typeof value === \"number\") return String(value);\n\tif (typeof value === \"bigint\") return `${value}n`;\n\tif (typeof value === \"string\") return `string ${JSON.stringify(value.slice(0, RECEIVED_PREVIEW_LIMIT))}`;\n\tif (value === null) return \"null\";\n\tif (value instanceof Date) return Number.isNaN(value.getTime()) ? \"an invalid Date\" : \"a Date\";\n\tif (Array.isArray(value)) return \"an array\";\n\treturn typeof value;\n}\nfunction refuseType(codecId, expected, value, received = describeReceived(value)) {\n\treturn encodeFailed(codecId, `value must be ${expected}; received ${received}`, value);\n}\nfunction stringEncode(codecId, value) {\n\tif (typeof value !== \"string\") refuseType(codecId, \"a string\", value);\n\treturn value;\n}\nfunction booleanEncode(codecId, value) {\n\tif (typeof value !== \"boolean\") refuseType(codecId, \"a boolean\", value);\n\treturn value;\n}\n/**\n* The driver writes an invalid `Date` as the epoch, so one is refused with any other non-`Date` value.\n*/\nfunction dateEncode(codecId, value) {\n\tif (!(value instanceof Date) || Number.isNaN(value.getTime())) refuseType(codecId, \"a valid Date\", value);\n\treturn value;\n}\nconst OBJECT_ID_TEXT = /^[0-9a-fA-F]{24}$/;\nfunction hexStringOf(value) {\n\tconst toHexString = Reflect.get(value, \"toHexString\");\n\tif (typeof toHexString !== \"function\") return void 0;\n\tconst hex = Reflect.apply(toHexString, value, []);\n\treturn typeof hex === \"string\" && OBJECT_ID_TEXT.test(hex) ? hex : void 0;\n}\n/**\n* `new ObjectId(...)` makes a fresh id from `null` or `undefined` and reads a number as a timestamp, so only a string, which the constructor accepts only as 24 hex digits, or an `ObjectId` is passed to it. An `ObjectId` is rebuilt from its hex string, so one from any major version of `bson` works.\n*/\nfunction objectIdEncode(codecId, value) {\n\tconst expected = \"a 24-digit hex string or an ObjectId\";\n\tif (typeof value === \"string\") try {\n\t\treturn new ObjectId(value);\n\t} catch {\n\t\treturn refuseType(codecId, expected, value);\n\t}\n\tif (typeof value !== \"object\" || value === null || !hasBsonTypeTag(value, \"ObjectId\")) return refuseType(codecId, expected, value);\n\tconst hex = hexStringOf(value);\n\tif (hex === void 0) return refuseType(codecId, expected, value, \"an object tagged ObjectId whose toHexString() does not return 24 hex digits\");\n\treturn new ObjectId(hex);\n}\nfunction vectorEncode(codecId, value) {\n\tif (!Array.isArray(value) || !value.every((element) => typeof element === \"number\")) refuseType(codecId, \"an array of numbers\", value);\n\treturn value;\n}\n/**\n* Wraps the number in the driver's `Double`, because the driver writes a whole JavaScript number in the int32 range as a BSON `int`, which a `double` validator refuses.\n*/\nfunction doubleEncode(codecId, value) {\n\tif (typeof value !== \"number\") encodeFailed(codecId, `value must be a number; received ${describeReceived(value)}`, value);\n\treturn new Double(value);\n}\nfunction int32Encode(codecId, value) {\n\tif (!isIntegerIn(value, INT32_RANGE)) encodeFailed(codecId, `value must be an integer from ${INT32_RANGE.min} to ${INT32_RANGE.max}; received ${describeReceived(value)}`, value);\n\treturn value;\n}\nfunction objectIdToJson(codecId, value) {\n\tif (typeof value !== \"string\" || !OBJECT_ID_TEXT.test(value)) encodeFailed(codecId, \"value must be 24 hexadecimal digits\", value);\n\treturn value;\n}\n/** Whether `text` is an ObjectId's 24 hexadecimal digits, in either case. */\nfunction isObjectIdText(text) {\n\treturn OBJECT_ID_TEXT.test(text);\n}\n/** Reads ObjectId hex in either case; {@link spellObjectIdJson} writes the lower case the type stores. */\nfunction readObjectIdJson(owner, json) {\n\treturn readJsonMatching(owner, json, OBJECT_ID_TEXT, \"24 hexadecimal digits\");\n}\n/** The ObjectId hex in lower case, as the driver's `toHexString` writes it. */\nfunction spellObjectIdJson(json) {\n\treturn typeof json === \"string\" ? json.toLowerCase() : json;\n}\nfunction int32ToJson(codecId, value) {\n\tif (!isIntegerIn(value, INT32_RANGE)) encodeFailed(codecId, `value must be an integer from ${INT32_RANGE.min} to ${INT32_RANGE.max}`, value);\n\treturn value;\n}\nfunction readInt32Json(owner, json) {\n\treturn readJsonInteger(owner, json, INT32_RANGE);\n}\nfunction dateToJson(codecId, value) {\n\tif (!(value instanceof Date) || Number.isNaN(value.getTime())) encodeFailed(codecId, \"value must be a valid Date\", value);\n\treturn value.toISOString();\n}\n/**\n* The JSON form is the text `Date.toISOString()` writes, so a string that does not read back to that same text is refused.\n*/\nfunction readDateJson(owner, json) {\n\tconst date = typeof json === \"string\" ? new Date(json) : void 0;\n\tif (date === void 0 || Number.isNaN(date.getTime()) || date.toISOString() !== json) return refuseJsonValue(owner, \"a date and time in UTC as Date.toISOString writes it\", json);\n\treturn json;\n}\n/** Reads an array of numbers, of exactly `length` numbers when the column sets one. */\nfunction readVectorJson(owner, json, length) {\n\tconst expected = length === void 0 ? \"an array of numbers\" : `an array of ${counted(length, \"number\")}`;\n\tif (!Array.isArray(json) || length !== void 0 && json.length !== length) return refuseJsonValue(owner, expected, json);\n\tconst numbers = [];\n\tfor (const element of json) {\n\t\tif (typeof element !== \"number\") return refuseJsonValue(owner, expected, element);\n\t\tif (!Number.isFinite(element)) return refuseJsonValue(owner, \"an array of finite numbers\", json);\n\t\tnumbers.push(element);\n\t}\n\treturn numbers;\n}\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_RANGE.min && value <= INT64_RANGE.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* A stored double with a fraction, which a 64-bit integer codec cannot read. Such values were written through a Prisma 6 `Int` while its contract used the 32-bit codec, which took any number.\n*/\nfunction refuseFractionalDouble(codecId, wire) {\n\treturn decodeFailed(codecId, `wire value is the fractional double ${wire}, and a 64-bit integer holds whole numbers only. Rewrite each such stored value as a long, rounded or cut off ({ $toLong: { $round: [<value>, 0] } }, or $trunc in place of $round), mapping over the list when the value sits in one. The upgrade guide step prisma6-int-written-as-long has the queries for a plain field, a list and a list of composite values.`, wire);\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\tif (typeof wire === \"number\" && Number.isFinite(wire) && !Number.isInteger(wire)) return refuseFractionalDouble(codecId, 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 int64ToJson(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 readInt64Json(owner, json) {\n\treadJsonIntegerText(owner, json, INT64_RANGE);\n\treturn json;\n}\nconst SAFE_INTEGERS = `from ${SAFE_INTEGER_RANGE.min} to ${SAFE_INTEGER_RANGE.max}`;\nfunction int64NumberEncode(codecId, value) {\n\tif (!isIntegerIn(value, SAFE_INTEGER_RANGE)) encodeFailed(codecId, `value must be an integer ${SAFE_INTEGERS}; received ${describeReceived(value)}`, value);\n\treturn Long.fromNumber(value);\n}\nfunction safeIntegerOf(codecId, value) {\n\tif (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) decodeFailed(codecId, `wire value must be a whole number ${SAFE_INTEGERS}; received ${value}`, value);\n\treturn Number(value);\n}\n/**\n* The driver hands a stored `long` over as a `number` when it fits in 53 bits (the default `promoteLongs`), as a `Long` otherwise or with `promoteLongs: false`, and as a `bigint` with `useBigInt64`.\n*/\nfunction int64NumberDecode(codecId, wire) {\n\tif (typeof wire === \"bigint\") return safeIntegerOf(codecId, wire);\n\tif (isLong(wire)) return safeIntegerOf(codecId, wire.toBigInt());\n\tif (isIntegerIn(wire, SAFE_INTEGER_RANGE)) return wire;\n\tif (typeof wire === \"number\" && Number.isFinite(wire) && !Number.isInteger(wire)) return refuseFractionalDouble(codecId, wire);\n\treturn decodeFailed(codecId, `wire value must be a whole number ${SAFE_INTEGERS}; received ${describeReceived(wire)}`, wire);\n}\nfunction int64NumberToJson(codecId, value) {\n\treturn int64NumberEncode(codecId, value).toString();\n}\n/** A `number` holds an integer exactly only within the safe integer range, so digit text past it is refused. */\nfunction int64NumberFromDigits(codecId, digits) {\n\treturn Number(readJsonIntegerText(codecId, digits, SAFE_INTEGER_BIGINT_RANGE));\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 decimalTextWithoutExponent(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 requireStoredDecimalText(codecId, value) {\n\tif (typeof value !== \"string\" || !STORED_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\trequireStoredDecimalText(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 = decimalTextWithoutExponent(wire.toString());\n\tif (text === void 0) return decodeFailed(codecId, \"wire value is not decimal text\", wire);\n\treturn text;\n}\nfunction decimal128ToJson(codecId, value) {\n\treturn requireStoredDecimalText(codecId, value);\n}\n/** Decimal text without its leading zeros, as MongoDB writes it; the sign of zero and trailing zeros stay. */\nfunction decimalTextWithoutLeadingZeros(text) {\n\treturn text.replace(/^(-?)0+(?=\\d)/, \"$1\");\n}\nfunction withoutSignOfZero(text) {\n\treturn /^-[0.]+$/.test(text) ? text.slice(1) : text;\n}\n/** Whether a Decimal128 holds the decimal text exactly: the text it writes back is the same number, digit for digit. */\nfunction decimal128HoldsExactly(text) {\n\tlet written;\n\ttry {\n\t\twritten = Decimal128.fromString(text).toString();\n\t} catch {\n\t\treturn false;\n\t}\n\treturn decimalTextWithoutExponent(written) === withoutSignOfZero(decimalTextWithoutLeadingZeros(text));\n}\n/**\n* The stored form is what the codec writes, so it follows the encode rule: decimal text without an exponent, or `NaN`, `Infinity` or `-Infinity`, that a Decimal128 holds exactly. A value a Decimal128 would round is refused.\n*/\nfunction readDecimal128Json(owner, json) {\n\tconst expected = \"decimal text without an exponent that a Decimal128 holds exactly, or NaN, Infinity or -Infinity\";\n\tconst text = readJsonMatching(owner, json, STORED_DECIMAL_TEXT, expected);\n\treturn decimal128HoldsExactly(text) ? text : refuseJsonValue(owner, expected, json);\n}\n/** The decimal text without leading zeros, as MongoDB writes it, keeping negative zero. */\nfunction spellDecimal128Json(json) {\n\treturn typeof json === \"string\" ? decimalTextWithoutLeadingZeros(json) : 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}\n/**\n* The driver reads binData as a `Binary`, or as a `Buffer` with `promoteBuffers: true`; either becomes a plain `Uint8Array` copy of the bytes.\n*/\nfunction binaryDecode(codecId, wire) {\n\tif (wire instanceof Uint8Array) return new Uint8Array(wire);\n\tif (!isBinary(wire)) return decodeFailed(codecId, \"wire value must be a Binary or a Uint8Array\", wire);\n\treturn new Uint8Array(wire.value());\n}\nfunction binaryToBase64(value) {\n\treturn Buffer.from(value).toString(\"base64\");\n}\n/** Whether `text` is base64, with or without padding bits set. */\nfunction isBase64Text(text) {\n\treturn BASE64_TEXT.test(text);\n}\n/** Reads base64 with or without padding bits set; {@link spellBase64Json} writes the base64 the type stores. */\nfunction readBinaryJson(owner, json) {\n\treturn readJsonMatching(owner, json, BASE64_TEXT, \"base64 text\");\n}\n/** The base64 of the same bytes with padding bits zero, as `Buffer` writes it. */\nfunction spellBase64Json(json) {\n\treturn typeof json === \"string\" ? Buffer.from(json, \"base64\").toString(\"base64\") : json;\n}\nfunction binaryFromBase64(base64) {\n\treturn new Uint8Array(Buffer.from(base64, \"base64\"));\n}\n//#endregion\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}\nconst BSON_VERSION = Symbol.for(\"@@mdb.bson.version\");\n/** The major version of the `bson` this package loads, which every `bson` class instance it can serialise carries. */\nconst BSON_MAJOR = Reflect.get(new MinKey(), BSON_VERSION);\n/** Whether a `bson` class instance comes from the same major version of `bson`, rather than being a look-alike or from another version. */\nfunction createdByBsonMajor(value) {\n\treturn Reflect.get(value, BSON_VERSION) === BSON_MAJOR;\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/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 ENCODE_FIX_BY_RECEIVED = { DBRef: \"Write it as a { $ref, $id } document instead.\" };\nfunction encodeRefused(received, path) {\n\tconst fix = ENCODE_FIX_BY_RECEIVED[received];\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${MONGO_BSON_CODEC_ID} value must be a BSON value; received ${received} at ${where(path)}${fix === void 0 ? \"\" : `. ${fix}`}`, { 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(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(tag, path);\n\t\tif (!createdByBsonMajor(value)) encodeRefused(`${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(constructorName(value), path);\n\t\treturn;\n\t}\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\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(entries) {\n\treturn Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue(entry)]));\n}\nfunction decodeValue(value) {\n\tif (typeof value !== \"object\" || value === null) return value;\n\tif (bsonClassTag(value) === \"DBRef\") return decodeEntries(dbRefEntries(value));\n\tif (Array.isArray(value)) {\n\t\tconst decoded = value.map(decodeValue);\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(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(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(wire));\n}\nfunction asDriverWrites(value) {\n\tif (typeof value === \"number\") return Number.isInteger(value) && (value < INT32_RANGE.min || value > INT32_RANGE.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 bsonToJson(value) {\n\treturn blindCast(EJSON.serialize(asDriverWrites(value), { relaxed: false }));\n}\n/**\n* Reads the canonical Extended JSON `bsonToJson` writes. The `bson` reader also takes forms that are not canonical, some of them silently wrong (`{ \"$numberInt\": \"abc\" }` reads as 0), so a value that does not write back to the same JSON is refused, naming `owner`.\n*/\nfunction readBsonJson(owner, json) {\n\tlet value;\n\ttry {\n\t\tvalue = EJSON.deserialize(blindCast(json), { relaxed: false });\n\t} catch {\n\t\treturn refuseJsonValue(owner, \"canonical Extended JSON\", json);\n\t}\n\tif (!isDeepStrictEqual(EJSON.serialize(value, { relaxed: false }), json)) return refuseJsonValue(owner, \"canonical Extended JSON\", json);\n\treturn value;\n}\n//#endregion\n//#region src/core/data-types.ts\n/** The vector's dimension: the TypeScript type `Vector<n>` and the type's reader read it. */\nconst mongoVectorParams = type({ \"length?\": \"number.integer >= 1\" });\n/** Text as the ObjectId it names; {@link spellObjectIdJson} gives it the lower case the type stores. */\nconst asObjectId = (value) => {\n\tif (typeof value !== \"string\") return refuseWrongShape(value, \"text\");\n\tif (isObjectIdText(value)) return value;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `\"${value}\" is not an ObjectId: write 24 hexadecimal digits.`, {\n\t\twhy: \"An ObjectId is 12 bytes, written as 24 hexadecimal digits.\",\n\t\tfix: \"Write the ObjectId as 24 hexadecimal digits, as in \\\"507f1f77bcf86cd799439011\\\".\"\n\t});\n};\n/** The numbers of a written list as a vector stores them, each finite. */\nfunction vectorElements(elements) {\n\treturn elements.map((element, index) => {\n\t\tconst number = Number(element);\n\t\tif (Number.isFinite(number)) return number;\n\t\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `a vector element is a finite number, and element ${index + 1} is ${String(element)}.`, {\n\t\t\twhy: \"A vector holds finite numbers, as a vector search index reads them.\",\n\t\t\tfix: \"Write each element as a finite number.\"\n\t\t});\n\t});\n}\n/** The calendar dates a JavaScript `Date`, and so a BSON date, holds at midnight UTC. */\nconst DATE_RANGE = {\n\tearliest: \"-271821-04-20\",\n\tlatest: \"+275760-09-13\"\n};\n/** An instant as `mongo/date` stores it, in UTC with three fraction digits, from ISO 8601 text with a UTC offset in which zeros past the third fraction digit are dropped. Throws `CONTRACT.CAST_REFUSED` for text that names no instant a `Date` holds. */\nfunction mongoInstantText(text) {\n\treturn isoDateStringText(withoutZerosBelowAMillisecond(text), \"mongo/date\");\n}\n/** A calendar date as ISO 8601 text, `2024-02-29`, in the years a BSON date holds at midnight UTC. Throws `CONTRACT.CAST_REFUSED` for text that names no such date. */\nfunction mongoCalendarDateText(text) {\n\treturn dateTimeStoredText(text, {\n\t\tshape: \"date\",\n\t\townerId: \"mongo/calendar-date\",\n\t\trange: DATE_RANGE\n\t});\n}\n/** The value of `mongo/time`: a time of day with exactly three fraction digits, `09:30:00.000`, so the strings sort in the order of the times. Zeros past the third fraction digit are dropped; any other digit there is refused. Throws `CONTRACT.CAST_REFUSED` for text that names no such time. */\nfunction mongoTimeText(text) {\n\treturn withThreeFractionDigits(dateTimeStoredText(withoutZerosBelowAMillisecond(text), {\n\t\tshape: \"time\",\n\t\townerId: \"mongo/time\",\n\t\tmaxFractionDigits: 3\n\t}, text));\n}\n/** The value of `mongo/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */\nfunction mongoDurationText(text) {\n\tif (ISO_DURATION_AS_WRITTEN.test(text)) return text;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `mongo/duration cannot read \"${text}\". Write an ISO 8601 duration, as in \"PT1H30M\".`, {\n\t\twhy: \"mongo/duration holds an ISO 8601 duration as Temporal.Duration writes it: an optional sign, P, then years, months, weeks and days, then T and hours, minutes and seconds. A sign on each component instead is read too.\",\n\t\tfix: \"Write the duration in ISO 8601, as in \\\"P1Y2M3DT4H5M6.5S\\\".\"\n\t});\n}\nconst mongoString = mongoDataType(\"mongo/string\", {\n\tread: (json) => readJsonString(\"mongo/string\", json),\n\tbsonTypes: [\"string\"]\n});\n/** What `stored` writes for `text`, or `undefined` when it refuses it. */\nfunction storedOrUndefined(stored, text) {\n\ttry {\n\t\treturn stored(text);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** A BSON string type in one form for each value when `respell`: it reads any text `stored` takes, and spells it in the form `stored` writes. It takes a `mongo/string` value that `stored` reads. */\nfunction storedStringDataType(id, stored, expected, options) {\n\tconst fromString = (value) => typeof value === \"string\" ? stored(value) : refuseWrongShape(value, \"text\");\n\tconst read = (json) => typeof json === \"string\" && storedOrUndefined(stored, json) !== void 0 ? json : refuseJsonValue(id, expected, json);\n\tconst spell = (json) => typeof json === \"string\" ? storedOrUndefined(stored, json) ?? json : json;\n\treturn mongoDataType(id, {\n\t\tread,\n\t\t...ifDefined(\"spell\", options.respell ? spell : void 0),\n\t\tbsonTypes: [\"string\"],\n\t\tcasts: { [mongoString.id]: fromString }\n\t});\n}\nconst mongoInt32 = mongoDataType(\"mongo/int32\", {\n\tread: (json) => readInt32Json(\"mongo/int32\", json),\n\tbsonTypes: [\"int\"]\n});\nconst mongoInt64 = mongoDataType(\"mongo/int64\", {\n\tread: (json) => readInt64Json(\"mongo/int64\", json),\n\tbsonTypes: [\"long\"],\n\tcasts: { [mongoInt32.id]: asNumeralText }\n});\nconst mongoDecimal128 = mongoDataType(\"mongo/decimal128\", {\n\tread: (json) => readDecimal128Json(\"mongo/decimal128\", json),\n\tspell: spellDecimal128Json,\n\tequalityKey: decimalTextEqualityKey,\n\tbsonTypes: [\"decimal\"],\n\tcasts: {\n\t\t[mongoInt32.id]: asNumeralText,\n\t\t[mongoInt64.id]: castUnchanged\n\t}\n});\nconst mongoDouble = mongoDataType(\"mongo/double\", {\n\tread: (json) => {\n\t\treadJsonFloat(\"mongo/double\", json);\n\t\treturn json;\n\t},\n\tbsonTypes: [\"double\"],\n\tcasts: {\n\t\t[mongoInt32.id]: asFloat,\n\t\t[mongoInt64.id]: asFloat,\n\t\t[mongoDecimal128.id]: asFloat\n\t}\n});\nconst mongoObjectId = mongoDataType(\"mongo/objectid\", {\n\tread: (json) => readObjectIdJson(\"mongo/objectid\", json),\n\tspell: spellObjectIdJson,\n\tbsonTypes: [\"objectId\"],\n\tcasts: { [mongoString.id]: asObjectId }\n});\nconst mongoBool = mongoDataType(\"mongo/bool\", {\n\tread: (json) => readJsonBoolean(\"mongo/bool\", json),\n\tbsonTypes: [\"bool\"]\n});\nconst mongoDate = mongoDataType(\"mongo/date\", {\n\tread: (json) => readDateJson(\"mongo/date\", json),\n\tbsonTypes: [\"date\"]\n});\n/** A time of day, stored as a BSON string with three fraction digits, `09:30:00.000`. */\nconst mongoTime = storedStringDataType(\"mongo/time\", mongoTimeText, \"ISO 8601 time of day text with at most three fraction digits, as in \\\"09:30:00\\\"\", { respell: true });\n/** A length of time, stored as the ISO 8601 duration it was written as, `PT1H30M`. Equal durations can be written differently, `P1D` and `PT24H`, so a duration keeps its spelling. */\nconst mongoDuration = storedStringDataType(\"mongo/duration\", mongoDurationText, \"an ISO 8601 duration, as in \\\"PT1H30M\\\"\", { respell: false });\nconst MILLISECONDS_PER_DAY = 864e5;\n/** A `mongo/date` value, an instant as `toISOString()` writes it, as the calendar date it names when it is at midnight UTC. */\nconst asCalendarDate = (value) => {\n\tif (typeof value !== \"string\") return refuseWrongShape(value, \"text\");\n\tif (new Date(value).getTime() % MILLISECONDS_PER_DAY === 0) return mongoCalendarDateText(value.slice(0, value.indexOf(\"T\")));\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `${value} is not a calendar date: a calendar date is stored as a BSON date at midnight UTC.`, {\n\t\twhy: \"A calendar date holds no time of day.\",\n\t\tfix: \"Write the date alone, as in \\\"2024-02-29\\\".\"\n\t});\n};\n/** A calendar date, stored as a BSON date at midnight UTC. Its value is the ISO 8601 date text, `2024-02-29`. */\nconst mongoCalendarDate = mongoDataType(\"mongo/calendar-date\", {\n\tread: (json) => typeof json === \"string\" && storedOrUndefined(mongoCalendarDateText, json) !== void 0 ? json : refuseJsonValue(\"mongo/calendar-date\", \"ISO 8601 date text, as in \\\"2024-02-29\\\"\", json),\n\tspell: (json) => typeof json === \"string\" ? storedOrUndefined(mongoCalendarDateText, json) ?? json : json,\n\tbsonTypes: [\"date\"],\n\tcasts: {\n\t\t[mongoString.id]: (value) => typeof value === \"string\" ? mongoCalendarDateText(value) : refuseWrongShape(value, \"text\"),\n\t\t[mongoDate.id]: asCalendarDate\n\t}\n});\nconst mongoVector = mongoDataType(\"mongo/vector\", {\n\tread: (json, params) => readVectorJson(\"mongo/vector\", json, typeof params[\"length\"] === \"number\" ? params[\"length\"] : void 0),\n\tbsonTypes: [\"array\"],\n\tparams: mongoVectorParams,\n\tlistCast: {\n\t\tof: [\n\t\t\tmongoInt32.id,\n\t\t\tmongoInt64.id,\n\t\t\tmongoDecimal128.id,\n\t\t\tmongoDouble.id\n\t\t],\n\t\tcast: vectorElements\n\t}\n});\nconst mongoBinary = mongoDataType(\"mongo/binary\", {\n\tread: (json) => readBinaryJson(\"mongo/binary\", json),\n\tspell: spellBase64Json,\n\tbsonTypes: [\"binData\"]\n});\nconst mongoJson = mongoDataType(\"mongo/json\", {\n\tread: (json) => json,\n\tbsonTypes: [\n\t\t\"object\",\n\t\t\"array\",\n\t\t\"string\",\n\t\t\"double\",\n\t\t\"int\",\n\t\t\"long\",\n\t\t\"bool\",\n\t\t\"null\"\n\t]\n});\nconst mongoBson = mongoDataType(\"mongo/bson\", {\n\tread: (json) => {\n\t\treadBsonJson(\"mongo/bson\", json);\n\t\treturn json;\n\t},\n\tbsonTypes: []\n});\nconst mongoDataTypes = [\n\tmongoObjectId,\n\tmongoString,\n\tmongoDouble,\n\tmongoInt32,\n\tmongoBool,\n\tmongoDate,\n\tmongoCalendarDate,\n\tmongoTime,\n\tmongoDuration,\n\tmongoVector,\n\tmongoInt64,\n\tmongoDecimal128,\n\tmongoBinary,\n\tmongoJson,\n\tmongoBson\n];\n/** MongoDB's text data type: `string`. */\nconst mongoTextDataTypes = [mongoString.id];\n//#endregion\nexport { int64NumberFromDigits as $, constructorName as A, dateEncode as B, bsonToJson as C, bsonClassTag as D, readBsonJson as E, binaryDecode as F, decimal128ToJson as G, decimal128Decode as H, binaryEncode as I, int32ToJson as J, doubleEncode as K, binaryFromBase64 as L, isPlainArray as M, isPlainObject as N, bsonTypeTag as O, where as P, int64NumberEncode as Q, binaryToBase64 as R, mongoVectorParams as S, encodeBsonValue as T, decimal128Encode as U, dateToJson as V, decimal128HoldsExactly as W, int64Encode as X, int64Decode as Y, int64NumberDecode as Z, mongoString as _, mongoCalendarDateText as a, stringEncode as at, mongoTimeText as b, mongoDecimal128 as c, mongoDurationText as d, int64NumberToJson as et, mongoInstantText as f, mongoObjectId as g, mongoJson as h, mongoCalendarDate as i, objectIdToJson as it, dbRefEntries as j, child as k, mongoDouble as l, mongoInt64 as m, mongoBool as n, isBase64Text as nt, mongoDataTypes as o, vectorEncode as ot, mongoInt32 as p, int32Encode as q, mongoBson as r, objectIdEncode as rt, mongoDate as s, mongoBinary as t, int64ToJson as tt, mongoDuration as u, mongoTextDataTypes as v, decodeBsonValue as w, mongoVector as x, mongoTime as y, booleanEncode as z };\n\n//# sourceMappingURL=data-types-Cq1kg82y.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,sBAAsB;AAC5B,MAAM,kBAAkB;AACxB,MAAM,cAAc;;;;AAIpB,SAAS,eAAe,OAAO,KAAK;CACnC,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,eAAe,SAAS,MAAM,cAAc;AACnG;AACA,SAAS,OAAO,OAAO;CACtB,OAAO,eAAe,OAAO,MAAM;AACpC;AACA,SAAS,aAAa,OAAO;CAC5B,OAAO,eAAe,OAAO,YAAY;AAC1C;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,eAAe,OAAO,QAAQ;AACtC;AACA,SAAS,aAAa,SAAS,SAAS,UAAU;CACjD,MAAM,iBAAiB,yBAAyB,GAAG,QAAQ,GAAG,WAAW,EAAE,MAAM;EAChF;EACA,UAAU,OAAO;CAClB,EAAE,CAAC;AACJ;AACA,MAAM,yBAAyB;AAC/B,SAAS,aAAa,SAAS,SAAS,UAAU;CACjD,MAAM,iBAAiB,yBAAyB,GAAG,QAAQ,GAAG,WAAW,EAAE,MAAM;EAChF;EACA,UAAU,OAAO,QAAQ,CAAC,CAAC,MAAM,GAAG,sBAAsB;CAC3D,EAAE,CAAC;AACJ;AACA,SAAS,iBAAiB,OAAO;CACh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ACD,MAAM,YAAY,cAAc,cAAc;CAC7C,OAAO,SAAS;EACf,aAAa,cAAc,IAAI;EAC/B,OAAO;CACR;CACA,WAAW,CAAC;AACb,CAAC;AACD,MAAM,iBAAiB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB,CAAC,YAAY,EAAE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DataType, DataTypeId } from "@prisma/orm-framework/components/codec";
|
|
2
|
+
//#region ../../../3-targets/mongo/1-target/dist/data-types.d.mts
|
|
3
|
+
//#region src/core/data-types.d.ts
|
|
4
|
+
/** The vector's dimension: the TypeScript type `Vector<n>` and the type's reader read it. */
|
|
5
|
+
declare const mongoVectorParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
6
|
+
length?: number;
|
|
7
|
+
}, {}>;
|
|
8
|
+
/** An instant as `mongo/date` stores it, in UTC with three fraction digits, from ISO 8601 text with a UTC offset in which zeros past the third fraction digit are dropped. Throws `CONTRACT.CAST_REFUSED` for text that names no instant a `Date` holds. */
|
|
9
|
+
declare function mongoInstantText(text: string): string;
|
|
10
|
+
/** A calendar date as ISO 8601 text, `2024-02-29`, in the years a BSON date holds at midnight UTC. Throws `CONTRACT.CAST_REFUSED` for text that names no such date. */
|
|
11
|
+
declare function mongoCalendarDateText(text: string): string;
|
|
12
|
+
/** The value of `mongo/time`: a time of day with exactly three fraction digits, `09:30:00.000`, so the strings sort in the order of the times. Zeros past the third fraction digit are dropped; any other digit there is refused. Throws `CONTRACT.CAST_REFUSED` for text that names no such time. */
|
|
13
|
+
declare function mongoTimeText(text: string): string;
|
|
14
|
+
/** The value of `mongo/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */
|
|
15
|
+
declare function mongoDurationText(text: string): string;
|
|
16
|
+
declare const mongoString: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
17
|
+
declare const mongoInt32: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
18
|
+
declare const mongoInt64: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
19
|
+
declare const mongoDecimal128: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
20
|
+
declare const mongoDouble: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
21
|
+
declare const mongoObjectId: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
22
|
+
declare const mongoBool: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
23
|
+
declare const mongoDate: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
24
|
+
/** A time of day, stored as a BSON string with three fraction digits, `09:30:00.000`. */
|
|
25
|
+
declare const mongoTime: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
26
|
+
/** A length of time, stored as the ISO 8601 duration it was written as, `PT1H30M`. Equal durations can be written differently, `P1D` and `PT24H`, so a duration keeps its spelling. */
|
|
27
|
+
declare const mongoDuration: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
28
|
+
/** A calendar date, stored as a BSON date at midnight UTC. Its value is the ISO 8601 date text, `2024-02-29`. */
|
|
29
|
+
declare const mongoCalendarDate: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
30
|
+
declare const mongoVector: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
31
|
+
declare const mongoBinary: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
32
|
+
declare const mongoJson: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
33
|
+
declare const mongoBson: import("@prisma/orm-family-mongo/contract/data-type").MongoDataType;
|
|
34
|
+
declare const mongoDataTypes: readonly DataType[];
|
|
35
|
+
/** MongoDB's text data type: `string`. */
|
|
36
|
+
declare const mongoTextDataTypes: readonly DataTypeId[];
|
|
37
|
+
//#endregion
|
|
38
|
+
export { mongoVectorParams as S, mongoString as _, mongoCalendarDateText as a, mongoTimeText as b, mongoDecimal128 as c, mongoDurationText as d, mongoInstantText as f, mongoObjectId as g, mongoJson as h, mongoCalendarDate as i, mongoDouble as l, mongoInt64 as m, mongoBool as n, mongoDataTypes as o, mongoInt32 as p, mongoBson as r, mongoDate as s, mongoBinary as t, mongoDuration as u, mongoTextDataTypes as v, mongoVector as x, mongoTime as y };
|
|
39
|
+
//# sourceMappingURL=data-types-ozSM4YdB.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-ozSM4YdB.d.mts","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/data-types.d.mts"],"mappings":";;;;cAGc,iEAAiE;EAC7E;;;iBAGe,iBAAiB;;iBAEjB,sBAAsB;;iBAEtB,cAAc;;iBAEd,kBAAkB;cACrB,0DAA0D;cAC1D,yDAAyD;cACzD,yDAAyD;cACzD,8DAA8D;cAC9D,0DAA0D;cAC1D,4DAA4D;cAC5D,wDAAwD;cACxD,wDAAwD;;cAExD,wDAAwD;;cAExD,4DAA4D;;cAE5D,gEAAgE;cAChE,0DAA0D;cAC1D,0DAA0D;cAC1D,wDAAwD;cACxD,wDAAwD;cACxD,yBAAyB;;cAEzB,6BAA6B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { a as MONGO_DATE_INSTANT_CODEC_ID, c as MONGO_DATE_TEMPORAL_CODEC_ID, i as MONGO_DATE_CODEC_ID, o as MONGO_DATE_INSTANT_STRING_CODEC_ID, s as MONGO_DATE_STRING_CODEC_ID, v as MONGO_TIME_STRING_CODEC_ID, y as MONGO_TIME_TEMPORAL_CODEC_ID } from "./codec-ids-DZQsuh80-ywDzfnAg.mjs";
|
|
2
|
+
import { r as requireTemporal } from "./codecs-BbX2VMzN-Dm9db3Jz.mjs";
|
|
3
|
+
import { TIMESTAMP_NOW_GENERATOR_ID } from "@prisma/orm-framework/components/authoring";
|
|
4
|
+
import * as nowValues from "@prisma/orm-framework/type-implementations/now";
|
|
5
|
+
import { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from "@prisma/orm-framework/type-implementations/now";
|
|
6
|
+
//#region ../../../3-targets/mongo/1-target/dist/date-time-now-generators-fWUk_--7.mjs
|
|
7
|
+
/** A BSON date holds milliseconds, and a time of day is stored with three fraction digits. */
|
|
8
|
+
const MILLISECOND_DIGITS = 3;
|
|
9
|
+
function instantNow() {
|
|
10
|
+
return nowValues.instantNow(requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);
|
|
11
|
+
}
|
|
12
|
+
function plainDateNow() {
|
|
13
|
+
return nowValues.plainDateNow(requireTemporal({ generatorId: PLAIN_DATE_NOW_GENERATOR_ID }));
|
|
14
|
+
}
|
|
15
|
+
function plainTimeNow() {
|
|
16
|
+
return nowValues.plainTimeNow(requireTemporal({ generatorId: PLAIN_TIME_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);
|
|
17
|
+
}
|
|
18
|
+
function instantStringNow() {
|
|
19
|
+
return nowValues.instantStringNow(MILLISECOND_DIGITS, "fixed");
|
|
20
|
+
}
|
|
21
|
+
function timeStringNow() {
|
|
22
|
+
return nowValues.timeStringNow(MILLISECOND_DIGITS, "fixed");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The MongoDB "now" generators, one per date and time codec except `mongo/date@1`, which uses the family's `timestampNow`. All read the clock through `Date.now()`, write UTC and keep milliseconds. The string generators write the text their type reads, with three fraction digits.
|
|
26
|
+
*/
|
|
27
|
+
const mongoNowGenerators = [
|
|
28
|
+
{
|
|
29
|
+
id: INSTANT_NOW_GENERATOR_ID,
|
|
30
|
+
generate: instantNow
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: PLAIN_DATE_NOW_GENERATOR_ID,
|
|
34
|
+
generate: plainDateNow
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: PLAIN_TIME_NOW_GENERATOR_ID,
|
|
38
|
+
generate: plainTimeNow
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: INSTANT_STRING_NOW_GENERATOR_ID,
|
|
42
|
+
generate: instantStringNow
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: DATE_STRING_NOW_GENERATOR_ID,
|
|
46
|
+
generate: nowValues.dateStringNow
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: TIME_STRING_NOW_GENERATOR_ID,
|
|
50
|
+
generate: timeStringNow
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
/** The "now" generator for each codec that has one. The `now` generator function binds it. */
|
|
54
|
+
const mongoNowGeneratorIds = {
|
|
55
|
+
[MONGO_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,
|
|
56
|
+
[MONGO_DATE_INSTANT_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,
|
|
57
|
+
[MONGO_DATE_INSTANT_STRING_CODEC_ID]: INSTANT_STRING_NOW_GENERATOR_ID,
|
|
58
|
+
[MONGO_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,
|
|
59
|
+
[MONGO_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,
|
|
60
|
+
[MONGO_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,
|
|
61
|
+
[MONGO_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { mongoNowGenerators as n, mongoNowGeneratorIds as t };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=date-time-now-generators-fWUk_--7-BnCnC0d8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-time-now-generators-fWUk_--7-BnCnC0d8.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/date-time-now-generators-fWUk_--7.mjs"],"sourcesContent":["import { a as MONGO_DATE_INSTANT_CODEC_ID, c as MONGO_DATE_TEMPORAL_CODEC_ID, i as MONGO_DATE_CODEC_ID, o as MONGO_DATE_INSTANT_STRING_CODEC_ID, s as MONGO_DATE_STRING_CODEC_ID, v as MONGO_TIME_STRING_CODEC_ID, y as MONGO_TIME_TEMPORAL_CODEC_ID } from \"./codec-ids-DZQsuh80.mjs\";\nimport { r as requireTemporal } from \"./codecs-BbX2VMzN.mjs\";\nimport { TIMESTAMP_NOW_GENERATOR_ID } from \"@internal/framework-components/authoring\";\nimport * as nowValues from \"@internal/type-implementations/now\";\nimport { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from \"@internal/type-implementations/now\";\n//#region src/core/date-time-now-generators.ts\n/** A BSON date holds milliseconds, and a time of day is stored with three fraction digits. */\nconst MILLISECOND_DIGITS = 3;\nfunction instantNow() {\n\treturn nowValues.instantNow(requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);\n}\nfunction plainDateNow() {\n\treturn nowValues.plainDateNow(requireTemporal({ generatorId: PLAIN_DATE_NOW_GENERATOR_ID }));\n}\nfunction plainTimeNow() {\n\treturn nowValues.plainTimeNow(requireTemporal({ generatorId: PLAIN_TIME_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);\n}\nfunction instantStringNow() {\n\treturn nowValues.instantStringNow(MILLISECOND_DIGITS, \"fixed\");\n}\nfunction timeStringNow() {\n\treturn nowValues.timeStringNow(MILLISECOND_DIGITS, \"fixed\");\n}\n/**\n* The MongoDB \"now\" generators, one per date and time codec except `mongo/date@1`, which uses the family's `timestampNow`. All read the clock through `Date.now()`, write UTC and keep milliseconds. The string generators write the text their type reads, with three fraction digits.\n*/\nconst mongoNowGenerators = [\n\t{\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tgenerate: instantNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateNow\n\t},\n\t{\n\t\tid: PLAIN_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainTimeNow\n\t},\n\t{\n\t\tid: INSTANT_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: instantStringNow\n\t},\n\t{\n\t\tid: DATE_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: nowValues.dateStringNow\n\t},\n\t{\n\t\tid: TIME_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timeStringNow\n\t}\n];\n/** The \"now\" generator for each codec that has one. The `now` generator function binds it. */\nconst mongoNowGeneratorIds = {\n\t[MONGO_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[MONGO_DATE_INSTANT_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[MONGO_DATE_INSTANT_STRING_CODEC_ID]: INSTANT_STRING_NOW_GENERATOR_ID,\n\t[MONGO_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,\n\t[MONGO_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,\n\t[MONGO_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,\n\t[MONGO_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID\n};\n//#endregion\nexport { mongoNowGenerators as n, mongoNowGeneratorIds as t };\n\n//# sourceMappingURL=date-time-now-generators-fWUk_--7.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,qBAAqB;AAC3B,SAAS,aAAa;CACrB,OAAO,UAAU,WAAW,gBAAgB,EAAE,aAAa,yBAAyB,CAAC,GAAG,kBAAkB;AAC3G;AACA,SAAS,eAAe;CACvB,OAAO,UAAU,aAAa,gBAAgB,EAAE,aAAa,4BAA4B,CAAC,CAAC;AAC5F;AACA,SAAS,eAAe;CACvB,OAAO,UAAU,aAAa,gBAAgB,EAAE,aAAa,4BAA4B,CAAC,GAAG,kBAAkB;AAChH;AACA,SAAS,mBAAmB;CAC3B,OAAO,UAAU,iBAAiB,oBAAoB,OAAO;AAC9D;AACA,SAAS,gBAAgB;CACxB,OAAO,UAAU,cAAc,oBAAoB,OAAO;AAC3D;;;;AAIA,MAAM,qBAAqB;CAC1B;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU,UAAU;CACrB;CACA;EACC,IAAI;EACJ,UAAU;CACX;AACD;;AAEA,MAAM,uBAAuB;EAC3B,sBAAsB;EACtB,8BAA8B;EAC9B,qCAAqC;EACrC,6BAA6B;EAC7B,+BAA+B;EAC/B,6BAA6B;EAC7B,+BAA+B;AACjC"}
|