@prisma/orm-target-mongo 8.0.0-rc.24-dev.18 → 8.0.0-rc.24-dev.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter.mjs +1 -1
- package/dist/adapter__control.mjs +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/{codecs-DB6ji3ee-BzMiSM6G.mjs → codecs-BxTQKKXN-p2W9ISNn.mjs} +8 -8
- package/dist/codecs-BxTQKKXN-p2W9ISNn.mjs.map +1 -0
- package/dist/{control-juKLj1hH.mjs → control-CYfF9fQc.mjs} +2 -2
- package/dist/{control-juKLj1hH.mjs.map → control-CYfF9fQc.mjs.map} +1 -1
- package/dist/{control-ADZk3Q1S.mjs → control-HkDN7RLR.mjs} +2 -2
- package/dist/{control-ADZk3Q1S.mjs.map → control-HkDN7RLR.mjs.map} +1 -1
- package/dist/{date-time-now-generators-CMBWOjGk-Dux-x9uO.mjs → date-time-now-generators-CGx9UUde-Bf7961yv.mjs} +3 -3
- package/dist/{date-time-now-generators-CMBWOjGk-Dux-x9uO.mjs.map → date-time-now-generators-CGx9UUde-Bf7961yv.mjs.map} +1 -1
- package/dist/{descriptor-meta-QyKsSxUQ-Cl1ZCbq3.mjs → descriptor-meta-BWjqdX8D-BAnaqzWL.mjs} +132 -46
- package/dist/descriptor-meta-BWjqdX8D-BAnaqzWL.mjs.map +1 -0
- package/dist/{descriptor-meta-runtime-D1jWMDgB-Cazw1WYy.mjs → descriptor-meta-runtime-lnkLN7r9-Qb8szw6W.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-D1jWMDgB-Cazw1WYy.mjs.map → descriptor-meta-runtime-lnkLN7r9-Qb8szw6W.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/{mongo-adapter-DemWVyNv-B3xRFRas.mjs → mongo-adapter-DemWVyNv-ClNih50Z.mjs} +2 -2
- package/dist/{mongo-adapter-DemWVyNv-B3xRFRas.mjs.map → mongo-adapter-DemWVyNv-ClNih50Z.mjs.map} +1 -1
- package/dist/{mongo-driver-BTKdtz-k-B4Aa5Y9T.mjs → mongo-driver-DbWoYldD-BYnyhcHI.mjs} +3 -3
- package/dist/{mongo-driver-BTKdtz-k-B4Aa5Y9T.mjs.map → mongo-driver-DbWoYldD-BYnyhcHI.mjs.map} +1 -1
- package/dist/{pack-FzGKNW0Q.d.mts → pack-DkfgvLLC.d.mts} +323 -65
- package/dist/pack-DkfgvLLC.d.mts.map +1 -0
- package/dist/{prisma6-binding-BwMMxDjX.mjs → prisma6-binding-DRtXGY85.mjs} +2 -2
- package/dist/{prisma6-binding-BwMMxDjX.mjs.map → prisma6-binding-DRtXGY85.mjs.map} +1 -1
- package/dist/{runtime-CK8zbCMW.mjs → runtime-BJGi8c9G.mjs} +2 -2
- package/dist/{runtime-CK8zbCMW.mjs.map → runtime-BJGi8c9G.mjs.map} +1 -1
- package/dist/target.d.mts +1 -1
- package/dist/target.mjs +4 -4
- package/dist/target__codecs.mjs +1 -1
- package/dist/target__control.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__pack.mjs.map +1 -1
- package/dist/target__prisma6-binding.mjs +1 -1
- package/dist/target__runtime.mjs +2 -2
- package/package.json +10 -10
- package/dist/codecs-DB6ji3ee-BzMiSM6G.mjs.map +0 -1
- package/dist/descriptor-meta-QyKsSxUQ-Cl1ZCbq3.mjs.map +0 -1
- package/dist/pack-FzGKNW0Q.d.mts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
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-
|
|
2
|
+
import { r as requireTemporal } from "./codecs-BxTQKKXN-p2W9ISNn.mjs";
|
|
3
3
|
import { TIMESTAMP_NOW_GENERATOR_ID } from "@prisma/orm-framework/components/authoring";
|
|
4
4
|
import * as nowValues from "@prisma/orm-framework/type-implementations/now";
|
|
5
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-
|
|
6
|
+
//#region ../../../3-targets/mongo/1-target/dist/date-time-now-generators-CGx9UUde.mjs
|
|
7
7
|
/** A BSON date holds milliseconds, and a time of day is stored with three fraction digits. */
|
|
8
8
|
const MILLISECOND_DIGITS = 3;
|
|
9
9
|
function instantNow() {
|
|
@@ -63,4 +63,4 @@ const mongoNowGeneratorIds = {
|
|
|
63
63
|
//#endregion
|
|
64
64
|
export { mongoNowGenerators as n, mongoNowGeneratorIds as t };
|
|
65
65
|
|
|
66
|
-
//# sourceMappingURL=date-time-now-generators-
|
|
66
|
+
//# sourceMappingURL=date-time-now-generators-CGx9UUde-Bf7961yv.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-now-generators-
|
|
1
|
+
{"version":3,"file":"date-time-now-generators-CGx9UUde-Bf7961yv.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/date-time-now-generators-CGx9UUde.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-BxTQKKXN.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-CGx9UUde.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"}
|
package/dist/{descriptor-meta-QyKsSxUQ-Cl1ZCbq3.mjs → descriptor-meta-BWjqdX8D-BAnaqzWL.mjs}
RENAMED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { _ as MONGO_STRING_CODEC_ID, a as MONGO_DATE_INSTANT_CODEC_ID, b as MONGO_VECTOR_CODEC_ID, c as MONGO_DATE_TEMPORAL_CODEC_ID, d as MONGO_DURATION_STRING_CODEC_ID, f as MONGO_INT32_CODEC_ID, g as MONGO_OBJECTID_CODEC_ID, h as MONGO_JSON_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_DECIMAL128_CODEC_ID, m as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DATE_INSTANT_STRING_CODEC_ID, p as MONGO_INT64_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_DATE_STRING_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_DOUBLE_CODEC_ID, v as MONGO_TIME_STRING_CODEC_ID, y as MONGO_TIME_TEMPORAL_CODEC_ID } from "./codec-ids-DZQsuh80-ywDzfnAg.mjs";
|
|
2
2
|
import { A as isBase64Text, B as mongoDecimal128, G as mongoInt32, H as mongoDuration, K as mongoInt64, N as mongoBinary, P as mongoBool, Q as mongoTimeText, U as mongoDurationText, V as mongoDouble, X as mongoTextDataTypes, Y as mongoString, Z as mongoTime, g as decimal128HoldsExactly, q as mongoJson, z as mongoDate } from "./data-types-BR7vssy0-CuNYIJHI.mjs";
|
|
3
|
-
import { n as mongoNowGenerators, t as mongoNowGeneratorIds } from "./date-time-now-generators-
|
|
4
|
-
import { t as mongoTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-
|
|
3
|
+
import { n as mongoNowGenerators, t as mongoNowGeneratorIds } from "./date-time-now-generators-CGx9UUde-Bf7961yv.mjs";
|
|
4
|
+
import { t as mongoTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-lnkLN7r9-Qb8szw6W.mjs";
|
|
5
5
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
6
6
|
import { createNumberClassifier, isoDateStringText, numeralText, parseJsonText, printJsonText, signedRange } from "@prisma/orm-framework/components/codec";
|
|
7
7
|
import { TIMESTAMP_NOW_GENERATOR_ID, temporalTypeAliases } from "@prisma/orm-framework/components/authoring";
|
|
8
8
|
import { singleGeneratorBinding } from "@prisma/orm-framework/components/components";
|
|
9
|
-
//#region ../../../3-targets/mongo/1-target/dist/descriptor-meta-
|
|
9
|
+
//#region ../../../3-targets/mongo/1-target/dist/descriptor-meta-BWjqdX8D.mjs
|
|
10
|
+
const int64BigInt = {
|
|
11
|
+
kind: "typeConstructor",
|
|
12
|
+
documentation: "A signed 64-bit integer read as a bigint, stored as BSON long.",
|
|
13
|
+
output: { codecId: MONGO_INT64_CODEC_ID }
|
|
14
|
+
};
|
|
10
15
|
/**
|
|
11
|
-
* The MongoDB scalar types
|
|
16
|
+
* The explicit MongoDB scalar types, each named after the BSON type that stores it, which PSL writes as field types and the TypeScript builder calls as `type.X()`. Each names a codec; the collection validator reads the BSON types from the data type the codec represents, not from the constructor.
|
|
12
17
|
*/
|
|
13
|
-
const
|
|
14
|
-
|
|
18
|
+
const mongoExplicitScalarTypes = {
|
|
19
|
+
BsonString: {
|
|
15
20
|
kind: "typeConstructor",
|
|
16
21
|
documentation: "Text, stored as BSON string.",
|
|
17
22
|
output: { codecId: MONGO_STRING_CODEC_ID }
|
|
@@ -36,11 +41,7 @@ const mongoScalarAuthoringTypes = {
|
|
|
36
41
|
documentation: "A double-precision floating-point number, stored as BSON double.",
|
|
37
42
|
output: { codecId: MONGO_DOUBLE_CODEC_ID }
|
|
38
43
|
},
|
|
39
|
-
|
|
40
|
-
kind: "typeConstructor",
|
|
41
|
-
documentation: "A signed 64-bit integer read as a bigint, stored as BSON long.",
|
|
42
|
-
output: { codecId: MONGO_INT64_CODEC_ID }
|
|
43
|
-
},
|
|
44
|
+
Int64BigInt: int64BigInt,
|
|
44
45
|
Int64Number: {
|
|
45
46
|
kind: "typeConstructor",
|
|
46
47
|
documentation: "A signed 64-bit integer read as a JavaScript number within its safe integer range, stored as BSON long.",
|
|
@@ -56,7 +57,7 @@ const mongoScalarAuthoringTypes = {
|
|
|
56
57
|
documentation: "Bytes read as a Uint8Array, stored as BSON binData.",
|
|
57
58
|
output: { codecId: MONGO_BINARY_CODEC_ID }
|
|
58
59
|
},
|
|
59
|
-
|
|
60
|
+
PlainJson: {
|
|
60
61
|
kind: "typeConstructor",
|
|
61
62
|
documentation: "A JSON value, stored as BSON object, array, string, double, int, long, bool or null; the collection validator admits only those types at the top level, and the codec refuses anything else at any depth.",
|
|
62
63
|
output: { codecId: MONGO_JSON_CODEC_ID }
|
|
@@ -82,30 +83,129 @@ const mongoScalarAuthoringTypes = {
|
|
|
82
83
|
index: 0
|
|
83
84
|
} }
|
|
84
85
|
}
|
|
85
|
-
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* The explicit types' former names, kept for one release line as deprecated aliases. Each gives the same codec as its replacement, and the PSL interpreter warns where one is written. A deprecated name has no `type.*` helper. ADR 257.
|
|
90
|
+
*/
|
|
91
|
+
const mongoDeprecatedScalarTypes = { Int64: {
|
|
92
|
+
...int64BigInt,
|
|
93
|
+
documentation: `Deprecated: use Int64BigInt. ${int64BigInt.documentation}`,
|
|
94
|
+
deprecated: { replacement: "Int64BigInt" }
|
|
95
|
+
} };
|
|
96
|
+
function storageOption(storage) {
|
|
97
|
+
return {
|
|
98
|
+
kind: "option",
|
|
99
|
+
name: "storage",
|
|
100
|
+
values: [storage],
|
|
101
|
+
default: storage,
|
|
102
|
+
optional: true
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The convenience types of MongoDB's scalars. Each is a type choice: `storage` names the BSON type that stores the value and, for `BigInt`, `as` chooses the application value. ADR 279.
|
|
107
|
+
*/
|
|
108
|
+
const mongoConvenienceScalarTypes = {
|
|
86
109
|
Int: {
|
|
87
|
-
kind: "
|
|
88
|
-
documentation: "
|
|
89
|
-
|
|
90
|
-
|
|
110
|
+
kind: "typeChoice",
|
|
111
|
+
documentation: "An integer read as a JavaScript number, stored as BSON int, a 32-bit integer.",
|
|
112
|
+
args: [storageOption("int")],
|
|
113
|
+
choices: [{
|
|
114
|
+
when: { storage: "int" },
|
|
115
|
+
type: "Int32"
|
|
116
|
+
}]
|
|
117
|
+
},
|
|
118
|
+
BigInt: {
|
|
119
|
+
kind: "typeChoice",
|
|
120
|
+
documentation: "An integer that may exceed 32 bits, stored as BSON long, a 64-bit integer. `as` is what the application reads: bigint, or number within the safe integer range.",
|
|
121
|
+
args: [{
|
|
122
|
+
kind: "option",
|
|
123
|
+
name: "as",
|
|
124
|
+
values: ["bigint", "number"],
|
|
125
|
+
default: "bigint",
|
|
126
|
+
optional: true
|
|
127
|
+
}, storageOption("long")],
|
|
128
|
+
choices: [{
|
|
129
|
+
when: {
|
|
130
|
+
as: "bigint",
|
|
131
|
+
storage: "long"
|
|
132
|
+
},
|
|
133
|
+
type: "Int64BigInt"
|
|
134
|
+
}, {
|
|
135
|
+
when: {
|
|
136
|
+
as: "number",
|
|
137
|
+
storage: "long"
|
|
138
|
+
},
|
|
139
|
+
type: "Int64Number"
|
|
140
|
+
}]
|
|
91
141
|
},
|
|
92
142
|
Float: {
|
|
93
|
-
kind: "
|
|
94
|
-
documentation: "
|
|
95
|
-
|
|
96
|
-
|
|
143
|
+
kind: "typeChoice",
|
|
144
|
+
documentation: "A floating-point number, stored as BSON double.",
|
|
145
|
+
args: [storageOption("double")],
|
|
146
|
+
choices: [{
|
|
147
|
+
when: { storage: "double" },
|
|
148
|
+
type: "Double"
|
|
149
|
+
}]
|
|
150
|
+
},
|
|
151
|
+
Decimal: {
|
|
152
|
+
kind: "typeChoice",
|
|
153
|
+
documentation: "An exact decimal number, read as decimal text such as \"12.50\", stored as BSON decimal.",
|
|
154
|
+
args: [storageOption("decimal")],
|
|
155
|
+
choices: [{
|
|
156
|
+
when: { storage: "decimal" },
|
|
157
|
+
type: "Decimal128"
|
|
158
|
+
}]
|
|
97
159
|
},
|
|
98
160
|
Boolean: {
|
|
99
|
-
kind: "
|
|
100
|
-
documentation: "
|
|
101
|
-
|
|
102
|
-
|
|
161
|
+
kind: "typeChoice",
|
|
162
|
+
documentation: "A true or false value, stored as BSON bool.",
|
|
163
|
+
args: [storageOption("bool")],
|
|
164
|
+
choices: [{
|
|
165
|
+
when: { storage: "bool" },
|
|
166
|
+
type: "Bool"
|
|
167
|
+
}]
|
|
168
|
+
},
|
|
169
|
+
Bytes: {
|
|
170
|
+
kind: "typeChoice",
|
|
171
|
+
documentation: "Binary data, read as a Uint8Array, stored as BSON binData.",
|
|
172
|
+
args: [storageOption("binData")],
|
|
173
|
+
choices: [{
|
|
174
|
+
when: { storage: "binData" },
|
|
175
|
+
type: "Binary"
|
|
176
|
+
}]
|
|
177
|
+
},
|
|
178
|
+
String: {
|
|
179
|
+
kind: "typeChoice",
|
|
180
|
+
documentation: "Text, stored as BSON string.",
|
|
181
|
+
args: [storageOption("string")],
|
|
182
|
+
choices: [{
|
|
183
|
+
when: { storage: "string" },
|
|
184
|
+
type: "BsonString"
|
|
185
|
+
}]
|
|
186
|
+
},
|
|
187
|
+
Json: {
|
|
188
|
+
kind: "typeChoice",
|
|
189
|
+
documentation: "A JSON value. `storage` is bson: the value is stored as whichever BSON value fits it, an object, array, string, number, bool or null. It is not the Bson type, which takes any BSON value.",
|
|
190
|
+
args: [storageOption("bson")],
|
|
191
|
+
choices: [{
|
|
192
|
+
when: { storage: "bson" },
|
|
193
|
+
type: "PlainJson"
|
|
194
|
+
}]
|
|
103
195
|
}
|
|
104
196
|
};
|
|
105
197
|
/**
|
|
198
|
+
* MongoDB's scalar types other than the date and time types: the explicit types, the convenience types and the deprecated aliases. `mongoScalarTypeConstructors` adds the date and time types.
|
|
199
|
+
*/
|
|
200
|
+
const mongoScalarAuthoringTypes = {
|
|
201
|
+
...mongoExplicitScalarTypes,
|
|
202
|
+
...mongoConvenienceScalarTypes,
|
|
203
|
+
...mongoDeprecatedScalarTypes
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
106
206
|
* The explicit date and time types. Each name says what the field stores and what the application reads. ADR 315.
|
|
107
207
|
*/
|
|
108
|
-
const
|
|
208
|
+
const mongoExplicitDateTimeTypes = {
|
|
109
209
|
DateJsDate: {
|
|
110
210
|
kind: "typeConstructor",
|
|
111
211
|
documentation: "An instant with millisecond precision, stored as BSON date and represented as a JavaScript Date.",
|
|
@@ -147,20 +247,6 @@ const mongoDateTimeTypeConstructors = {
|
|
|
147
247
|
output: { codecId: MONGO_DURATION_STRING_CODEC_ID }
|
|
148
248
|
}
|
|
149
249
|
};
|
|
150
|
-
const dateStorage = {
|
|
151
|
-
kind: "option",
|
|
152
|
-
name: "storage",
|
|
153
|
-
values: ["date"],
|
|
154
|
-
default: "date",
|
|
155
|
-
optional: true
|
|
156
|
-
};
|
|
157
|
-
const stringStorage = {
|
|
158
|
-
kind: "option",
|
|
159
|
-
name: "storage",
|
|
160
|
-
values: ["string"],
|
|
161
|
-
default: "string",
|
|
162
|
-
optional: true
|
|
163
|
-
};
|
|
164
250
|
/**
|
|
165
251
|
* The convenience date and time types. Each is a type choice: its `as` argument chooses the explicit type it becomes. ADR 279, ADR 315.
|
|
166
252
|
*/
|
|
@@ -178,7 +264,7 @@ const mongoConvenienceDateTimeTypes = {
|
|
|
178
264
|
],
|
|
179
265
|
default: "jsDate",
|
|
180
266
|
optional: true
|
|
181
|
-
},
|
|
267
|
+
}, storageOption("date")],
|
|
182
268
|
choices: [
|
|
183
269
|
{
|
|
184
270
|
when: {
|
|
@@ -212,7 +298,7 @@ const mongoConvenienceDateTimeTypes = {
|
|
|
212
298
|
values: ["string", "temporal"],
|
|
213
299
|
default: "string",
|
|
214
300
|
optional: true
|
|
215
|
-
},
|
|
301
|
+
}, storageOption("date")],
|
|
216
302
|
choices: [{
|
|
217
303
|
when: {
|
|
218
304
|
as: "string",
|
|
@@ -236,7 +322,7 @@ const mongoConvenienceDateTimeTypes = {
|
|
|
236
322
|
values: ["string", "temporal"],
|
|
237
323
|
default: "string",
|
|
238
324
|
optional: true
|
|
239
|
-
},
|
|
325
|
+
}, storageOption("string")],
|
|
240
326
|
choices: [{
|
|
241
327
|
when: {
|
|
242
328
|
as: "string",
|
|
@@ -260,7 +346,7 @@ const mongoConvenienceDateTimeTypes = {
|
|
|
260
346
|
values: ["string"],
|
|
261
347
|
default: "string",
|
|
262
348
|
optional: true
|
|
263
|
-
},
|
|
349
|
+
}, storageOption("string")],
|
|
264
350
|
choices: [{
|
|
265
351
|
when: {
|
|
266
352
|
as: "string",
|
|
@@ -272,7 +358,7 @@ const mongoConvenienceDateTimeTypes = {
|
|
|
272
358
|
};
|
|
273
359
|
const mongoAuthoringTypes = {
|
|
274
360
|
...mongoScalarAuthoringTypes,
|
|
275
|
-
...
|
|
361
|
+
...mongoExplicitDateTimeTypes,
|
|
276
362
|
...mongoConvenienceDateTimeTypes,
|
|
277
363
|
temporal: temporalTypeAliases({ codecId: MONGO_DATE_CODEC_ID }, "a JavaScript Date")
|
|
278
364
|
};
|
|
@@ -424,4 +510,4 @@ const mongoTargetDescriptorMeta = {
|
|
|
424
510
|
//#endregion
|
|
425
511
|
export { mongoTargetDescriptorMeta as t };
|
|
426
512
|
|
|
427
|
-
//# sourceMappingURL=descriptor-meta-
|
|
513
|
+
//# sourceMappingURL=descriptor-meta-BWjqdX8D-BAnaqzWL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-BWjqdX8D-BAnaqzWL.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/descriptor-meta-BWjqdX8D.mjs"],"sourcesContent":["import { _ as MONGO_STRING_CODEC_ID, a as MONGO_DATE_INSTANT_CODEC_ID, b as MONGO_VECTOR_CODEC_ID, c as MONGO_DATE_TEMPORAL_CODEC_ID, d as MONGO_DURATION_STRING_CODEC_ID, f as MONGO_INT32_CODEC_ID, g as MONGO_OBJECTID_CODEC_ID, h as MONGO_JSON_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_DECIMAL128_CODEC_ID, m as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DATE_INSTANT_STRING_CODEC_ID, p as MONGO_INT64_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_DATE_STRING_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_DOUBLE_CODEC_ID, v as MONGO_TIME_STRING_CODEC_ID, y as MONGO_TIME_TEMPORAL_CODEC_ID } from \"./codec-ids-DZQsuh80.mjs\";\nimport { W as decimal128HoldsExactly, _ as mongoString, b as mongoTimeText, c as mongoDecimal128, d as mongoDurationText, h as mongoJson, l as mongoDouble, m as mongoInt64, n as mongoBool, nt as isBase64Text, p as mongoInt32, s as mongoDate, t as mongoBinary, u as mongoDuration, v as mongoTextDataTypes, y as mongoTime } from \"./data-types-BR7vssy0.mjs\";\nimport { n as mongoNowGenerators, t as mongoNowGeneratorIds } from \"./date-time-now-generators-CGx9UUde.mjs\";\nimport { t as mongoTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-lnkLN7r9.mjs\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalTypeAliases } from \"@internal/framework-components/authoring\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { createNumberClassifier, isoDateStringText, numeralText, parseJsonText, printJsonText, signedRange } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/authoring.ts\nconst int64BigInt = {\n\tkind: \"typeConstructor\",\n\tdocumentation: \"A signed 64-bit integer read as a bigint, stored as BSON long.\",\n\toutput: { codecId: MONGO_INT64_CODEC_ID }\n};\n/**\n* The explicit MongoDB scalar types, each named after the BSON type that stores it, which PSL writes as field types and the TypeScript builder calls as `type.X()`. Each names a codec; the collection validator reads the BSON types from the data type the codec represents, not from the constructor.\n*/\nconst mongoExplicitScalarTypes = {\n\tBsonString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Text, stored as BSON string.\",\n\t\toutput: { codecId: MONGO_STRING_CODEC_ID }\n\t},\n\tInt32: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 32-bit integer, stored as BSON int.\",\n\t\toutput: { codecId: MONGO_INT32_CODEC_ID }\n\t},\n\tBool: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A true or false value, stored as BSON bool.\",\n\t\toutput: { codecId: MONGO_BOOLEAN_CODEC_ID }\n\t},\n\tObjectId: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A 12-byte MongoDB identifier, stored as BSON objectId.\",\n\t\toutput: { codecId: MONGO_OBJECTID_CODEC_ID }\n\t},\n\tDouble: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A double-precision floating-point number, stored as BSON double.\",\n\t\toutput: { codecId: MONGO_DOUBLE_CODEC_ID }\n\t},\n\tInt64BigInt: int64BigInt,\n\tInt64Number: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A signed 64-bit integer read as a JavaScript number within its safe integer range, stored as BSON long.\",\n\t\toutput: { codecId: MONGO_INT64_NUMBER_CODEC_ID }\n\t},\n\tDecimal128: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A 128-bit decimal read as decimal text without an exponent, stored as BSON decimal.\",\n\t\toutput: { codecId: MONGO_DECIMAL128_CODEC_ID }\n\t},\n\tBinary: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Bytes read as a Uint8Array, stored as BSON binData.\",\n\t\toutput: { codecId: MONGO_BINARY_CODEC_ID }\n\t},\n\tPlainJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value, stored as BSON object, array, string, double, int, long, bool or null; the collection validator admits only those types at the top level, and the codec refuses anything else at any depth.\",\n\t\toutput: { codecId: MONGO_JSON_CODEC_ID }\n\t},\n\tBson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Any BSON value, read as BsonValue; the collection validator does not constrain it.\",\n\t\toutput: { codecId: MONGO_BSON_CODEC_ID }\n\t},\n\tVector: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A list of finite numbers, stored as BSON array, as a vector search index reads it. With a length, it is read as Vector<length>.\",\n\t\targs: [{\n\t\t\tkind: \"value\",\n\t\t\tdataType: \"mongo/int32\",\n\t\t\tname: \"length\",\n\t\t\toptional: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: MONGO_VECTOR_CODEC_ID,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t}\n};\n/**\n* The explicit types' former names, kept for one release line as deprecated aliases. Each gives the same codec as its replacement, and the PSL interpreter warns where one is written. A deprecated name has no `type.*` helper. ADR 257.\n*/\nconst mongoDeprecatedScalarTypes = { Int64: {\n\t...int64BigInt,\n\tdocumentation: `Deprecated: use Int64BigInt. ${int64BigInt.documentation}`,\n\tdeprecated: { replacement: \"Int64BigInt\" }\n} };\nfunction storageOption(storage) {\n\treturn {\n\t\tkind: \"option\",\n\t\tname: \"storage\",\n\t\tvalues: [storage],\n\t\tdefault: storage,\n\t\toptional: true\n\t};\n}\n/**\n* The convenience types of MongoDB's scalars. Each is a type choice: `storage` names the BSON type that stores the value and, for `BigInt`, `as` chooses the application value. ADR 279.\n*/\nconst mongoConvenienceScalarTypes = {\n\tInt: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"An integer read as a JavaScript number, stored as BSON int, a 32-bit integer.\",\n\t\targs: [storageOption(\"int\")],\n\t\tchoices: [{\n\t\t\twhen: { storage: \"int\" },\n\t\t\ttype: \"Int32\"\n\t\t}]\n\t},\n\tBigInt: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"An integer that may exceed 32 bits, stored as BSON long, a 64-bit integer. `as` is what the application reads: bigint, or number within the safe integer range.\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"bigint\", \"number\"],\n\t\t\tdefault: \"bigint\",\n\t\t\toptional: true\n\t\t}, storageOption(\"long\")],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"bigint\",\n\t\t\t\tstorage: \"long\"\n\t\t\t},\n\t\t\ttype: \"Int64BigInt\"\n\t\t}, {\n\t\t\twhen: {\n\t\t\t\tas: \"number\",\n\t\t\t\tstorage: \"long\"\n\t\t\t},\n\t\t\ttype: \"Int64Number\"\n\t\t}]\n\t},\n\tFloat: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A floating-point number, stored as BSON double.\",\n\t\targs: [storageOption(\"double\")],\n\t\tchoices: [{\n\t\t\twhen: { storage: \"double\" },\n\t\t\ttype: \"Double\"\n\t\t}]\n\t},\n\tDecimal: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"An exact decimal number, read as decimal text such as \\\"12.50\\\", stored as BSON decimal.\",\n\t\targs: [storageOption(\"decimal\")],\n\t\tchoices: [{\n\t\t\twhen: { storage: \"decimal\" },\n\t\t\ttype: \"Decimal128\"\n\t\t}]\n\t},\n\tBoolean: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A true or false value, stored as BSON bool.\",\n\t\targs: [storageOption(\"bool\")],\n\t\tchoices: [{\n\t\t\twhen: { storage: \"bool\" },\n\t\t\ttype: \"Bool\"\n\t\t}]\n\t},\n\tBytes: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"Binary data, read as a Uint8Array, stored as BSON binData.\",\n\t\targs: [storageOption(\"binData\")],\n\t\tchoices: [{\n\t\t\twhen: { storage: \"binData\" },\n\t\t\ttype: \"Binary\"\n\t\t}]\n\t},\n\tString: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"Text, stored as BSON string.\",\n\t\targs: [storageOption(\"string\")],\n\t\tchoices: [{\n\t\t\twhen: { storage: \"string\" },\n\t\t\ttype: \"BsonString\"\n\t\t}]\n\t},\n\tJson: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A JSON value. `storage` is bson: the value is stored as whichever BSON value fits it, an object, array, string, number, bool or null. It is not the Bson type, which takes any BSON value.\",\n\t\targs: [storageOption(\"bson\")],\n\t\tchoices: [{\n\t\t\twhen: { storage: \"bson\" },\n\t\t\ttype: \"PlainJson\"\n\t\t}]\n\t}\n};\n/**\n* MongoDB's scalar types other than the date and time types: the explicit types, the convenience types and the deprecated aliases. `mongoScalarTypeConstructors` adds the date and time types.\n*/\nconst mongoScalarAuthoringTypes = {\n\t...mongoExplicitScalarTypes,\n\t...mongoConvenienceScalarTypes,\n\t...mongoDeprecatedScalarTypes\n};\n/**\n* The explicit date and time types. Each name says what the field stores and what the application reads. ADR 315.\n*/\nconst mongoExplicitDateTimeTypes = {\n\tDateJsDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant with millisecond precision, stored as BSON date and represented as a JavaScript Date.\",\n\t\toutput: { codecId: MONGO_DATE_CODEC_ID }\n\t},\n\tDateInstant: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant with millisecond precision, stored as BSON date and represented as Temporal.Instant.\",\n\t\toutput: { codecId: MONGO_DATE_INSTANT_CODEC_ID }\n\t},\n\tDateInstantString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant with millisecond precision, stored as BSON date and represented as ISO 8601 text in UTC with three fraction digits, 2024-01-01T00:00:00.000Z.\",\n\t\toutput: { codecId: MONGO_DATE_INSTANT_STRING_CODEC_ID }\n\t},\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date, stored as BSON date at midnight UTC and represented as ISO 8601 text, 2024-02-29.\",\n\t\toutput: { codecId: MONGO_DATE_STRING_CODEC_ID }\n\t},\n\tDateTemporal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date, stored as BSON date at midnight UTC and represented as Temporal.PlainDate.\",\n\t\toutput: { codecId: MONGO_DATE_TEMPORAL_CODEC_ID }\n\t},\n\tTimeString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day, stored as BSON string and represented as that string, 09:30:00.000, always with three fraction digits.\",\n\t\toutput: { codecId: MONGO_TIME_STRING_CODEC_ID }\n\t},\n\tTimeTemporal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day, stored as BSON string, 09:30:00.000, and represented as Temporal.PlainTime.\",\n\t\toutput: { codecId: MONGO_TIME_TEMPORAL_CODEC_ID }\n\t},\n\tDurationString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A length of time, stored as BSON string and represented as the ISO 8601 duration it was written as, such as PT1H30M.\",\n\t\toutput: { codecId: MONGO_DURATION_STRING_CODEC_ID }\n\t}\n};\n/**\n* The convenience date and time types. Each is a type choice: its `as` argument chooses the explicit type it becomes. ADR 279, ADR 315.\n*/\nconst mongoConvenienceDateTimeTypes = {\n\tDateTime: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A moment in time, stored as BSON date. `as` is what the application reads: jsDate (a JavaScript Date), temporal (Temporal.Instant) or string, such as \\\"2024-01-01T00:00:00.000Z\\\".\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\n\t\t\t\t\"jsDate\",\n\t\t\t\t\"temporal\",\n\t\t\t\t\"string\"\n\t\t\t],\n\t\t\tdefault: \"jsDate\",\n\t\t\toptional: true\n\t\t}, storageOption(\"date\")],\n\t\tchoices: [\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"jsDate\",\n\t\t\t\t\tstorage: \"date\"\n\t\t\t\t},\n\t\t\t\ttype: \"DateJsDate\"\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"temporal\",\n\t\t\t\t\tstorage: \"date\"\n\t\t\t\t},\n\t\t\t\ttype: \"DateInstant\"\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"string\",\n\t\t\t\t\tstorage: \"date\"\n\t\t\t\t},\n\t\t\t\ttype: \"DateInstantString\"\n\t\t\t}\n\t\t]\n\t},\n\tDate: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A calendar date, stored as BSON date at midnight UTC. `as` is what the application reads: string, such as \\\"2024-02-29\\\", or temporal (Temporal.PlainDate).\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"string\", \"temporal\"],\n\t\t\tdefault: \"string\",\n\t\t\toptional: true\n\t\t}, storageOption(\"date\")],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"date\"\n\t\t\t},\n\t\t\ttype: \"DateString\"\n\t\t}, {\n\t\t\twhen: {\n\t\t\t\tas: \"temporal\",\n\t\t\t\tstorage: \"date\"\n\t\t\t},\n\t\t\ttype: \"DateTemporal\"\n\t\t}]\n\t},\n\tTime: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A time of day, stored as BSON string. `as` is what the application reads: string, such as \\\"09:30:00.000\\\", or temporal (Temporal.PlainTime).\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"string\", \"temporal\"],\n\t\t\tdefault: \"string\",\n\t\t\toptional: true\n\t\t}, storageOption(\"string\")],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"string\"\n\t\t\t},\n\t\t\ttype: \"TimeString\"\n\t\t}, {\n\t\t\twhen: {\n\t\t\t\tas: \"temporal\",\n\t\t\t\tstorage: \"string\"\n\t\t\t},\n\t\t\ttype: \"TimeTemporal\"\n\t\t}]\n\t},\n\tDuration: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A length of time, stored as BSON string. `as` is what the application reads: string, an ISO 8601 duration such as \\\"PT1H30M\\\".\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"string\"],\n\t\t\tdefault: \"string\",\n\t\t\toptional: true\n\t\t}, storageOption(\"string\")],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"string\"\n\t\t\t},\n\t\t\ttype: \"DurationString\"\n\t\t}]\n\t}\n};\nconst mongoAuthoringTypes = {\n\t...mongoScalarAuthoringTypes,\n\t...mongoExplicitDateTimeTypes,\n\t...mongoConvenienceDateTimeTypes,\n\ttemporal: temporalTypeAliases({ codecId: MONGO_DATE_CODEC_ID }, \"a JavaScript Date\")\n};\n//#endregion\n//#region src/core/data-type-entries.ts\nconst classifyAsDecimal = createNumberClassifier({\n\tintegers: [{\n\t\ttype: mongoInt32.id,\n\t\tform: \"number\",\n\t\t...signedRange(32)\n\t}, {\n\t\ttype: mongoInt64.id,\n\t\tform: \"text\",\n\t\t...signedRange(64)\n\t}],\n\tlargerWhole: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t},\n\tfraction: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t},\n\twords: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t}\n});\n/** The type of a written number: a `decimal` only when a Decimal128 holds it exactly, else the `double` nearest it. */\nfunction classifyMongoNumber(text) {\n\tconst classified = classifyAsDecimal(text);\n\tif (classified?.type !== mongoDecimal128.id || decimal128HoldsExactly(String(classified.value))) return classified;\n\tconst double = Number(text);\n\treturn Number.isFinite(double) ? {\n\t\ttype: mongoDouble.id,\n\t\tvalue: double\n\t} : void 0;\n}\nfunction printNumber(value) {\n\treturn typeof value === \"number\" ? numeralText(value) : String(value);\n}\nfunction base64Text(text) {\n\tif (isBase64Text(text)) return text;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `\"${text}\" is not base64 text: write the bytes in base64, as in binary\\`aGVsbG8=\\`.`, {\n\t\twhy: \"The binary tag reads bytes as base64, as MongoDB prints them.\",\n\t\tfix: \"Write the bytes in base64, as in binary`aGVsbG8=`.\"\n\t});\n}\nfunction mongoDataTypeEntries() {\n\treturn {\n\t\t[mongoString.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"string\",\n\t\t\t\tparse: (text) => text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Text.\"\n\t\t},\n\t\t[mongoBool.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"boolean\",\n\t\t\t\tparse: (text) => text === \"true\"\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A boolean, written true or false.\"\n\t\t},\n\t\t[mongoDouble.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"number\",\n\t\t\t\ttypes: [\n\t\t\t\t\tmongoInt32.id,\n\t\t\t\t\tmongoInt64.id,\n\t\t\t\t\tmongoDecimal128.id,\n\t\t\t\t\tmongoDouble.id\n\t\t\t\t],\n\t\t\t\tclassify: classifyMongoNumber\n\t\t\t},\n\t\t\tprint: printNumber,\n\t\t\tdocumentation: \"A number: an int in 32 bits, a long in 64, a decimal when a Decimal128 holds it exactly, NaN and the infinities included, and a double otherwise.\"\n\t\t},\n\t\t[mongoDate.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"date\",\n\t\t\t\tparse: (text) => isoDateStringText(text, mongoDate.id)\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"An instant, as in date`2024-01-01T00:00:00Z`. Reads ISO 8601 with a UTC offset and stores the instant in UTC with three fraction digits, as Date.toISOString() writes it.\"\n\t\t},\n\t\t[mongoTime.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"time\",\n\t\t\t\tparse: mongoTimeText\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A time of day without a UTC offset, as in time`09:30:00`. Stores it with three fraction digits, as in 09:30:00.000.\"\n\t\t},\n\t\t[mongoDuration.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"duration\",\n\t\t\t\tparse: mongoDurationText\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A length of time, as in duration`PT1H30M`. Reads an ISO 8601 duration and stores it as written.\"\n\t\t},\n\t\t[mongoBinary.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"binary\",\n\t\t\t\tparse: base64Text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Bytes, written in base64 as MongoDB prints them, as in binary`aGVsbG8=`.\"\n\t\t},\n\t\t[mongoJson.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"json\",\n\t\t\t\tparse: parseJsonText\n\t\t\t},\n\t\t\tprint: printJsonText,\n\t\t\tdocumentation: \"Reads the text as a JSON document and stores it as the value.\"\n\t\t}\n\t};\n}\nconst mongoTargetDescriptorMeta = {\n\t...mongoTargetDescriptorMetaRuntime,\n\tauthoring: {\n\t\ttype: mongoAuthoringTypes,\n\t\tdataTypes: mongoDataTypeEntries(),\n\t\ttextDataTypes: mongoTextDataTypes\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: [{ id: TIMESTAMP_NOW_GENERATOR_ID }, ...mongoNowGenerators.map(({ id }) => ({ id }))]\n\t},\n\tgeneratorFunctions: [{\n\t\tname: \"now\",\n\t\tsignature: { documentation: \"Writes the current time.\" },\n\t\tbindings: Object.entries(mongoNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({\n\t\t\tcodecIds: [codecId],\n\t\t\tgeneratorId\n\t\t}))\n\t}]\n};\n//#endregion\nexport { mongoTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BWjqdX8D.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,cAAc;CACnB,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,SAAS,qBAAqB;AACzC;;;;AAIA,MAAM,2BAA2B;CAChC,YAAY;EACX,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,sBAAsB;CAC1C;CACA,OAAO;EACN,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,qBAAqB;CACzC;CACA,MAAM;EACL,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,uBAAuB;CAC3C;CACA,UAAU;EACT,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,wBAAwB;CAC5C;CACA,QAAQ;EACP,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,sBAAsB;CAC1C;CACA,aAAa;CACb,aAAa;EACZ,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,4BAA4B;CAChD;CACA,YAAY;EACX,MAAM;EACN,eAAe;EACf,QAAQ,EA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AAW,EAAE,eAAe,2BAA2B;EACvD,UAAU,OAAO,QAAQ,oBAAoB,CAAC,CAAC,KAAK,CAAC,SAAS,iBAAiB,uBAAuB;GACrG,UAAU,CAAC,OAAO;GAClB;EACD,CAAC,CAAC;CACH,CAAC;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { R as mongoDataTypes } from "./data-types-BR7vssy0-CuNYIJHI.mjs";
|
|
2
|
-
import { t as mongoCodecDescriptors } from "./codecs-
|
|
2
|
+
import { t as mongoCodecDescriptors } from "./codecs-BxTQKKXN-p2W9ISNn.mjs";
|
|
3
3
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
4
|
-
//#region ../../../3-targets/mongo/1-target/dist/descriptor-meta-runtime-
|
|
4
|
+
//#region ../../../3-targets/mongo/1-target/dist/descriptor-meta-runtime-lnkLN7r9.mjs
|
|
5
5
|
const mongoTargetDescriptorMetaRuntime = {
|
|
6
6
|
kind: "target",
|
|
7
7
|
familyId: "mongo",
|
|
@@ -17,4 +17,4 @@ const mongoTargetDescriptorMetaRuntime = {
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { mongoTargetDescriptorMetaRuntime as t };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=descriptor-meta-runtime-
|
|
20
|
+
//# sourceMappingURL=descriptor-meta-runtime-lnkLN7r9-Qb8szw6W.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-runtime-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-runtime-lnkLN7r9-Qb8szw6W.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/descriptor-meta-runtime-lnkLN7r9.mjs"],"sourcesContent":["import { o as mongoDataTypes } from \"./data-types-BR7vssy0.mjs\";\nimport { t as mongoCodecDescriptors } from \"./codecs-BxTQKKXN.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nconst mongoTargetDescriptorMetaRuntime = {\n\tkind: \"target\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID,\n\tsupportsNamespaces: true,\n\tdataTypes: mongoDataTypes,\n\ttypes: { codecTypes: { codecDescriptors: mongoCodecDescriptors } }\n};\n//#endregion\nexport { mongoTargetDescriptorMetaRuntime as t };\n\n//# sourceMappingURL=descriptor-meta-runtime-lnkLN7r9.mjs.map"],"mappings":";;;;AAGA,MAAM,mCAAmC;CACxC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,oBAAoB;CACpB,oBAAoB;CACpB,WAAW;CACX,OAAO,EAAE,YAAY,EAAE,kBAAkB,sBAAsB,EAAE;AAClE"}
|
package/dist/driver.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as MongoControlDriver } from "./control-
|
|
1
|
+
import { t as MongoControlDriver } from "./control-CYfF9fQc.mjs";
|
|
2
2
|
export { MongoControlDriver };
|
package/dist/driver__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as mongoControlDriverDescriptor, t as MongoControlDriver } from "./control-
|
|
1
|
+
import { n as mongoControlDriverDescriptor, t as MongoControlDriver } from "./control-CYfF9fQc.mjs";
|
|
2
2
|
export { MongoControlDriver, mongoControlDriverDescriptor as default };
|
package/dist/driver__runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MongoDriverImpl, r as mongoDriverDescriptorMeta } from "./mongo-driver-
|
|
1
|
+
import { n as MongoDriverImpl, r as mongoDriverDescriptorMeta } from "./mongo-driver-DbWoYldD-BYnyhcHI.mjs";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
//#region ../../../3-targets/mongo/3-driver/dist/runtime.mjs
|
|
4
4
|
const notConnectedMessages = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver__runtime.mjs","names":["#disconnectedState","#delegate","#notConnectedError","#connecting","#requireDelegate"],"sources":["../../../../3-targets/mongo/3-driver/dist/runtime.mjs"],"sourcesContent":["import { n as mongoDriverDescriptorMeta, t as MongoDriverImpl } from \"./mongo-driver-
|
|
1
|
+
{"version":3,"file":"driver__runtime.mjs","names":["#disconnectedState","#delegate","#notConnectedError","#connecting","#requireDelegate"],"sources":["../../../../3-targets/mongo/3-driver/dist/runtime.mjs"],"sourcesContent":["import { n as mongoDriverDescriptorMeta, t as MongoDriverImpl } from \"./mongo-driver-DbWoYldD.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/runtime/mongo-runtime-driver.ts\nconst notConnectedMessages = {\n\tunbound: \"Mongo driver not connected. Call connect(binding) before execute or run.\",\n\tclosed: \"Mongo driver is closed. Call connect(binding) to reconnect.\"\n};\nconst ALREADY_CONNECTED_MESSAGE = \"Mongo driver already connected. Call close() before reconnecting with a new binding.\";\nasync function connectedDriver(binding) {\n\tif (binding.kind === \"mongoClient\") return MongoDriverImpl.fromDb(binding.client.db(binding.dbName));\n\treturn MongoDriverImpl.fromConnection(binding.url, binding.dbName);\n}\nvar MongoUnboundDriverImpl = class {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\t#delegate = null;\n\t#connecting = null;\n\t#disconnectedState = \"unbound\";\n\t#notConnectedError() {\n\t\treturn structuredError(\"DRIVER.NOT_CONNECTED\", notConnectedMessages[this.#disconnectedState]);\n\t}\n\t#requireDelegate() {\n\t\tif (this.#delegate === null) throw this.#notConnectedError();\n\t\treturn this.#delegate;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#delegate !== null || this.#connecting !== null) throw structuredError(\"DRIVER.ALREADY_CONNECTED\", ALREADY_CONNECTED_MESSAGE, { meta: { bindingKind: binding.kind } });\n\t\tconst connecting = connectedDriver(binding);\n\t\tthis.#connecting = connecting;\n\t\ttry {\n\t\t\tconst delegate = await connecting;\n\t\t\tif (this.#connecting !== connecting) throw this.#notConnectedError();\n\t\t\tthis.#delegate = delegate;\n\t\t\tthis.#disconnectedState = \"unbound\";\n\t\t} finally {\n\t\t\tif (this.#connecting === connecting) this.#connecting = null;\n\t\t}\n\t}\n\tasync *execute(wireCommand) {\n\t\tyield* this.#requireDelegate().execute(wireCommand);\n\t}\n\tasync run(wireCommand) {\n\t\treturn this.#requireDelegate().run(wireCommand);\n\t}\n\tasync close() {\n\t\tconst delegate = this.#delegate;\n\t\tconst connecting = this.#connecting;\n\t\tthis.#delegate = null;\n\t\tthis.#connecting = null;\n\t\tthis.#disconnectedState = \"closed\";\n\t\tconst connected = await connecting?.catch(() => null);\n\t\tawait Promise.all([delegate?.close(), connected?.close()]);\n\t}\n};\nfunction createMongoRuntimeDriver() {\n\treturn new MongoUnboundDriverImpl();\n}\n//#endregion\n//#region src/exports/runtime.ts\nconst mongoRuntimeDriverDescriptor = {\n\t...mongoDriverDescriptorMeta,\n\tcreate: createMongoRuntimeDriver\n};\n//#endregion\nexport { mongoRuntimeDriverDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;AAGA,MAAM,uBAAuB;CAC5B,SAAS;CACT,QAAQ;AACT;AACA,MAAM,4BAA4B;AAClC,eAAe,gBAAgB,SAAS;CACvC,IAAI,QAAQ,SAAS,eAAe,OAAO,gBAAgB,OAAO,QAAQ,OAAO,GAAG,QAAQ,MAAM,CAAC;CACnG,OAAO,gBAAgB,eAAe,QAAQ,KAAK,QAAQ,MAAM;AAClE;AACA,IAAI,yBAAyB,MAAM;CAClC,WAAW;CACX,WAAW;CACX,YAAY;CACZ,cAAc;CACd,qBAAqB;CACrB,qBAAqB;EACpB,OAAO,gBAAgB,wBAAwB,qBAAqB,KAAKA,mBAAmB;CAC7F;CACA,mBAAmB;EAClB,IAAI,KAAKC,cAAc,MAAM,MAAM,KAAKC,mBAAmB;EAC3D,OAAO,KAAKD;CACb;CACA,MAAM,QAAQ,SAAS;EACtB,IAAI,KAAKA,cAAc,QAAQ,KAAKE,gBAAgB,MAAM,MAAM,gBAAgB,4BAA4B,2BAA2B,EAAE,MAAM,EAAE,aAAa,QAAQ,KAAK,EAAE,CAAC;EAC9K,MAAM,aAAa,gBAAgB,OAAO;EAC1C,KAAKA,cAAc;EACnB,IAAI;GACH,MAAM,WAAW,MAAM;GACvB,IAAI,KAAKA,gBAAgB,YAAY,MAAM,KAAKD,mBAAmB;GACnE,KAAKD,YAAY;GACjB,KAAKD,qBAAqB;EAC3B,UAAU;GACT,IAAI,KAAKG,gBAAgB,YAAY,KAAKA,cAAc;EACzD;CACD;CACA,OAAO,QAAQ,aAAa;EAC3B,OAAO,KAAKC,iBAAiB,CAAC,CAAC,QAAQ,WAAW;CACnD;CACA,MAAM,IAAI,aAAa;EACtB,OAAO,KAAKA,iBAAiB,CAAC,CAAC,IAAI,WAAW;CAC/C;CACA,MAAM,QAAQ;EACb,MAAM,WAAW,KAAKH;EACtB,MAAM,aAAa,KAAKE;EACxB,KAAKF,YAAY;EACjB,KAAKE,cAAc;EACnB,KAAKH,qBAAqB;EAC1B,MAAM,YAAY,MAAM,YAAY,YAAY,IAAI;EACpD,MAAM,QAAQ,IAAI,CAAC,UAAU,MAAM,GAAG,WAAW,MAAM,CAAC,CAAC;CAC1D;AACD;AACA,SAAS,2BAA2B;CACnC,OAAO,IAAI,uBAAuB;AACnC;AAGA,MAAM,+BAA+B;CACpC,GAAG;CACH,QAAQ;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as mongoRuntimeTargetDescriptor } from "./runtime-
|
|
1
|
+
import { t as mongoRuntimeTargetDescriptor } from "./runtime-BJGi8c9G.mjs";
|
|
2
2
|
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { dateOfThisRealm, isDate } from "@prisma/orm-framework/type-implementations/date";
|
|
4
4
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -830,4 +830,4 @@ function createMongoAdapter(codecs = assembleMongoCodecRegistry([mongoRuntimeTar
|
|
|
830
830
|
//#endregion
|
|
831
831
|
export { lowerStage as a, lowerPipeline as i, lowerAggExpr as n, lowerFilter as r, createMongoAdapter as t };
|
|
832
832
|
|
|
833
|
-
//# sourceMappingURL=mongo-adapter-DemWVyNv-
|
|
833
|
+
//# sourceMappingURL=mongo-adapter-DemWVyNv-ClNih50Z.mjs.map
|