@prisma/orm-target-mongo 8.0.0-rc.24-dev.28 → 8.0.0-rc.24-dev.29
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 +4 -3
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/{codecs-BxTQKKXN-p2W9ISNn.mjs → codecs-DKwnfU85-BAZ4CD7m.mjs} +6 -27
- package/dist/codecs-DKwnfU85-BAZ4CD7m.mjs.map +1 -0
- package/dist/{control-D2tbWwPF.mjs → control-D9f8mKHr.mjs} +16 -41
- package/dist/control-D9f8mKHr.mjs.map +1 -0
- package/dist/{control-ByHwQ1ve.d.mts → control-DBNn1M3A.d.mts} +4 -12
- package/dist/control-DBNn1M3A.d.mts.map +1 -0
- package/dist/{control-aaXa_r6J.mjs → control-Dn4c6fxh.mjs} +2 -2
- package/dist/{control-aaXa_r6J.mjs.map → control-Dn4c6fxh.mjs.map} +1 -1
- package/dist/{data-types-BR7vssy0-CuNYIJHI.mjs → data-types-DacjqiBe-D5ui4_5e.mjs} +11 -43
- package/dist/data-types-DacjqiBe-D5ui4_5e.mjs.map +1 -0
- package/dist/{date-time-now-generators-CGx9UUde-Bf7961yv.mjs → date-time-now-generators-ClztoylE-Bq7Fps2T.mjs} +3 -3
- package/dist/{date-time-now-generators-CGx9UUde-Bf7961yv.mjs.map → date-time-now-generators-ClztoylE-Bq7Fps2T.mjs.map} +1 -1
- package/dist/{descriptor-meta-BWjqdX8D-BAnaqzWL.mjs → descriptor-meta-BRjal4JG-G-1rNvuk.mjs} +5 -5
- package/dist/{descriptor-meta-BWjqdX8D-BAnaqzWL.mjs.map → descriptor-meta-BRjal4JG-G-1rNvuk.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-lnkLN7r9-Qb8szw6W.mjs → descriptor-meta-runtime-Bnv0sQnr-DVFwLDn7.mjs} +4 -4
- package/dist/{descriptor-meta-runtime-lnkLN7r9-Qb8szw6W.mjs.map → descriptor-meta-runtime-Bnv0sQnr-DVFwLDn7.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-ClNih50Z.mjs → mongo-adapter-DemWVyNv-ivErOBO6.mjs} +2 -2
- package/dist/{mongo-adapter-DemWVyNv-ClNih50Z.mjs.map → mongo-adapter-DemWVyNv-ivErOBO6.mjs.map} +1 -1
- package/dist/{mongo-driver-Cp7ApMWY-uuvB0cAv.mjs → mongo-driver-BDzR1BQa-DI2usg4u.mjs} +3 -3
- package/dist/{mongo-driver-Cp7ApMWY-uuvB0cAv.mjs.map → mongo-driver-BDzR1BQa-DI2usg4u.mjs.map} +1 -1
- package/dist/{prisma6-binding-DRtXGY85.mjs → prisma6-binding-D-mtJWjJ.mjs} +2 -2
- package/dist/{prisma6-binding-DRtXGY85.mjs.map → prisma6-binding-D-mtJWjJ.mjs.map} +1 -1
- package/dist/{runtime-BJGi8c9G.mjs → runtime-DDzO_Noh.mjs} +2 -2
- package/dist/{runtime-BJGi8c9G.mjs.map → runtime-DDzO_Noh.mjs.map} +1 -1
- package/dist/target.d.mts +1 -1
- package/dist/target.mjs +5 -5
- package/dist/target__codecs.mjs +1 -1
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +1 -1
- package/dist/target__data-types.mjs +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-BxTQKKXN-p2W9ISNn.mjs.map +0 -1
- package/dist/control-ByHwQ1ve.d.mts.map +0 -1
- package/dist/control-D2tbWwPF.mjs.map +0 -1
- package/dist/data-types-BR7vssy0-CuNYIJHI.mjs.map +0 -1
|
@@ -11,7 +11,6 @@ import { MongoContractSerializerBase, MongoSchemaVerifierBase } from "@prisma/or
|
|
|
11
11
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
12
12
|
import { MongoSchemaIR } from "@prisma/orm-family-mongo/schema-ir";
|
|
13
13
|
import { Migration, MigrationMeta } from "@prisma/orm-toolchain/migration-tools/migration";
|
|
14
|
-
import { ImportSpecifierResolver } from "@prisma/orm-framework/components/emission";
|
|
15
14
|
import { MongoRunnerDependencies } from "@prisma/orm-family-mongo/family/control-adapter";
|
|
16
15
|
import { AggregateMigrationEdgeRef } from "@prisma/orm-toolchain/migration-tools/aggregate";
|
|
17
16
|
import { JsonObject } from "@prisma/orm-framework/utils/json";
|
|
@@ -286,7 +285,7 @@ declare class PlannerProducedMongoMigration extends Migration<AnyMongoMigrationO
|
|
|
286
285
|
constructor(calls: readonly OpFactoryCall$1[], meta: MigrationMeta, snapshotsImportPath: string);
|
|
287
286
|
get operations(): readonly (AnyMongoMigrationOperation | Promise<AnyMongoMigrationOperation>)[];
|
|
288
287
|
describe(): MigrationMeta;
|
|
289
|
-
renderTypeScript(
|
|
288
|
+
renderTypeScript(migrationModule: string): string;
|
|
290
289
|
}
|
|
291
290
|
//#endregion
|
|
292
291
|
//#region src/core/migrations/render-ops.d.ts
|
|
@@ -298,21 +297,14 @@ interface RenderMigrationMeta {
|
|
|
298
297
|
readonly to: string;
|
|
299
298
|
/** POSIX-relative path from the migration package dir to `migrations/snapshots`, e.g. '../../snapshots'. */
|
|
300
299
|
readonly snapshotsImportPath: string;
|
|
301
|
-
|
|
302
|
-
* Rewrites the package names the scaffold imports from, for the import root
|
|
303
|
-
* the consuming application installed. Applied once to the assembled
|
|
304
|
-
* requirement list rather than at each `OpFactoryCall`, so a new operation
|
|
305
|
-
* cannot forget it. Defaults to leaving specifiers as authored.
|
|
306
|
-
*/
|
|
307
|
-
readonly resolveImportSpecifier?: ImportSpecifierResolver;
|
|
300
|
+
readonly migrationModule: string;
|
|
308
301
|
}
|
|
309
302
|
/**
|
|
310
303
|
* Render a list of Mongo `OpFactoryCall`s as a `migration.ts` source string.
|
|
311
304
|
* The result is shebanged, imports the contract JSON from the shared
|
|
312
305
|
* snapshot store (the destination contract, plus the source contract for a
|
|
313
306
|
* non-baseline migration), extends `Migration<Start, End>` (or
|
|
314
|
-
* `Migration<never, End>` for a baseline) from
|
|
315
|
-
* `@internal/target-mongo/migration`,
|
|
307
|
+
* `Migration<never, End>` for a baseline) from the config's migration module,
|
|
316
308
|
* assigns the JSON to `endContractJson` / `startContractJson`, and implements
|
|
317
309
|
* `operations`. The `Migration` base derives `describe()` from those fields.
|
|
318
310
|
*
|
|
@@ -393,4 +385,4 @@ declare class MongoTargetUnboundDatabase extends MongoTargetDatabase {
|
|
|
393
385
|
}
|
|
394
386
|
//#endregion
|
|
395
387
|
export { deserializeMongoOps as _, MongoMigrationRunnerExecuteOptions as a, renderOps as b, MongoTargetContract as c, MongoTargetSchemaVerifier as d, MongoTargetUnboundDatabase as f, deserializeMongoOp as g, RenderMigrationMeta as h, MongoMigrationRunnerErrorCode as i, MongoTargetContractSerializer as l, PlannerProducedMongoMigration as m, MongoMigrationPlanner as n, MongoMigrationRunnerFailure as o, PlanCallsResult as p, MongoMigrationRunner as r, MongoMigrationRunnerResult as s, FilterEvaluator as t, MongoTargetDatabase as u, mongoTargetDescriptor as v, serializeMongoOps as x, renderCallsToTypeScript as y };
|
|
396
|
-
//# sourceMappingURL=control-
|
|
388
|
+
//# sourceMappingURL=control-DBNn1M3A.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-DBNn1M3A.d.mts","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BK,sBAAsB,KAAK;WACrB,SAAS;;;;;;;;;;;;;;cAcN,uBAAuB,6BAA6B;;;cAGpD,2BAA2B;UAC/B;EACR,SAAS,QAAQ,iBAAiB,KAAK;EAC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I,kCAAkC,wBAAwB,qBAAqB;YACjF,gBAAgB;aACf,UAAU;aACV,QAAQ;aACR;aACA,WAAW;eACT;YACH,uBAAuB,UAAU,oBAAoB,qBAAqB,0BAA0B;;;;;;;;;;;;;;;;;;;cAmBlG,sCAAsC,UAAU,uCAAuC;mBAClF;mBACA;mBACA;WACR;EACT,YAAY,gBAAgB,mBAAiB,MAAM,eAAe;MAC9D,wBAAwB,6BAA6B,QAAQ;EACjE,YAAY;EACZ,iBAAiB;;;;iBAIF,UAAU,OAAO,cAAc,oBAAkB,6BAA6B,QAAQ;;;UAG7F;WACC;WACA;;WAEA;WACA;;;;;;;;;;;;;;;;;;iBAkBM,wBAAwB,OAAO,cAAc,kBAAgB,MAAM;;;cAGtE,sCAAsC,4BAA4B;YACpE,wBAAwB,WAAW,gBAAgB;EAC7D,kBAAkB,UAAU,sBAAsB;;;;UAI1C;WACC;WACA,UAAU,SAAS,eAAe,SAAS;aACzC,aAAa,SAAS,eAAe;aACrC,WAAW,SAAS,eAAe;;;;;;;;;;;;;;;;;cAiBlC,4BAA4B;WAC/B;WACA;WACA,SAAS;EAClB,YAAY,OAAO;MACf,cAAc,SAAS,eAAe;;;;;EAK1C;;;;;;;EAOA,kBAAkB;;;;;;;;;;;;;;;cAeN,mCAAmC;kBAC/B,UAAU;UAClB;EACR;EACA,kBAAkB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as MongoDriverImpl, r as mongoDriverDescriptorMeta, t as DRIVER_INFO } from "./mongo-driver-
|
|
1
|
+
import { n as MongoDriverImpl, r as mongoDriverDescriptorMeta, t as DRIVER_INFO } from "./mongo-driver-BDzR1BQa-DI2usg4u.mjs";
|
|
2
2
|
import { errorRuntime } from "@prisma/orm-framework/errors/execution";
|
|
3
3
|
import { MongoClient } from "mongodb";
|
|
4
4
|
import { redactDatabaseUrl } from "@prisma/orm-framework/utils/redact-db-url";
|
|
@@ -42,4 +42,4 @@ const mongoControlDriverDescriptor = {
|
|
|
42
42
|
//#endregion
|
|
43
43
|
export { mongoControlDriverDescriptor as n, MongoControlDriver as t };
|
|
44
44
|
|
|
45
|
-
//# sourceMappingURL=control-
|
|
45
|
+
//# sourceMappingURL=control-Dn4c6fxh.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-
|
|
1
|
+
{"version":3,"file":"control-Dn4c6fxh.mjs","names":[],"sources":["../../../../3-targets/mongo/3-driver/dist/control.mjs"],"sourcesContent":["import { n as mongoDriverDescriptorMeta, r as DRIVER_INFO, t as MongoDriverImpl } from \"./mongo-driver-BDzR1BQa.mjs\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\nimport { MongoClient } from \"mongodb\";\n//#region src/exports/control.ts\nvar MongoControlDriver = class extends MongoDriverImpl {\n\tfamilyId = \"mongo\";\n\ttargetId = \"mongo\";\n\tdb;\n\tconstructor(db, mongoClient) {\n\t\tsuper(db, mongoClient);\n\t\tthis.db = db;\n\t}\n\tasync databaseName() {\n\t\treturn this.db.databaseName;\n\t}\n};\nconst mongoControlDriverDescriptor = {\n\t...mongoDriverDescriptorMeta,\n\tasync create(url) {\n\t\tconst client = new MongoClient(url, {\n\t\t\tserverSelectionTimeoutMS: 5e3,\n\t\t\tconnectTimeoutMS: 5e3,\n\t\t\tdriverInfo: DRIVER_INFO\n\t\t});\n\t\ttry {\n\t\t\tawait client.connect();\n\t\t\treturn new MongoControlDriver(client.db(), client);\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tawait client.close();\n\t\t\t} catch {}\n\t\t\tthrow errorRuntime(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tfix: \"Verify the MongoDB URL, ensure the database is reachable, and confirm credentials/permissions\",\n\t\t\t\tmeta: { ...redactDatabaseUrl(url) },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { MongoControlDriver, mongoControlDriverDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;AAKA,IAAI,qBAAqB,cAAc,gBAAgB;CACtD,WAAW;CACX,WAAW;CACX;CACA,YAAY,IAAI,aAAa;EAC5B,MAAM,IAAI,WAAW;EACrB,KAAK,KAAK;CACX;CACA,MAAM,eAAe;EACpB,OAAO,KAAK,GAAG;CAChB;AACD;AACA,MAAM,+BAA+B;CACpC,GAAG;CACH,MAAM,OAAO,KAAK;EACjB,MAAM,SAAS,IAAI,YAAY,KAAK;GACnC,0BAA0B;GAC1B,kBAAkB;GAClB,YAAY;EACb,CAAC;EACD,IAAI;GACH,MAAM,OAAO,QAAQ;GACrB,OAAO,IAAI,mBAAmB,OAAO,GAAG,GAAG,MAAM;EAClD,SAAS,OAAO;GACf,IAAI;IACH,MAAM,OAAO,MAAM;GACpB,QAAQ,CAAC;GACT,MAAM,aAAa,4BAA4B,8BAA8B;IAC5E,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC1D,KAAK;IACL,MAAM,EAAE,GAAG,kBAAkB,GAAG,EAAE;IAClC,OAAO;GACR,CAAC;EACF;CACD;AACD"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
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, dateTimeStoredText, decimalTextEqualityKey, isIntegerIn, isoDateStringText, 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, isNonFiniteText, isoDateStringText, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { dateOfThisRealm, isDate, isValidDate, withThreeFractionDigits, withoutZerosBelowAMillisecond } from "@prisma/orm-framework/type-implementations/date";
|
|
6
|
+
import { decimalTextWithoutExponent, decimalTextWithoutLeadingZeros, isDecimalText, printedDecimalText } from "@prisma/orm-framework/type-implementations/decimal";
|
|
6
7
|
import { counted } from "@prisma/orm-framework/utils/text";
|
|
7
8
|
import { Binary, Code, Decimal128, Double, EJSON, Long, MinKey, ObjectId } from "bson";
|
|
8
9
|
import { mongoDataType } from "@prisma/orm-family-mongo/contract/data-type";
|
|
@@ -11,9 +12,7 @@ import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
|
11
12
|
import { type } from "arktype";
|
|
12
13
|
import { isDeepStrictEqual } from "node:util";
|
|
13
14
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
14
|
-
//#region ../../../3-targets/mongo/1-target/dist/data-types-
|
|
15
|
-
const STORED_DECIMAL_TEXT = /^(?:-?\d+(?:\.\d+)?|NaN|-?Infinity)$/;
|
|
16
|
-
const DECIMAL128_TEXT = /^(-?)(\d+)(?:\.(\d+))?(?:E([+-]\d+))?$/;
|
|
15
|
+
//#region ../../../3-targets/mongo/1-target/dist/data-types-DacjqiBe.mjs
|
|
17
16
|
const BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
18
17
|
/**
|
|
19
18
|
* 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.
|
|
@@ -222,34 +221,12 @@ function int64NumberToJson(codecId, value) {
|
|
|
222
221
|
function int64NumberFromDigits(codecId, digits) {
|
|
223
222
|
return Number(readJsonIntegerText(codecId, digits, SAFE_INTEGER_BIGINT_RANGE));
|
|
224
223
|
}
|
|
225
|
-
/**
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
function decimalTextWithoutExponent(text) {
|
|
229
|
-
if (text === "NaN" || text === "Infinity" || text === "-Infinity") return text;
|
|
230
|
-
const match = DECIMAL128_TEXT.exec(text);
|
|
231
|
-
if (match === null) return void 0;
|
|
232
|
-
const [, sign = "", whole = "", fraction = "", exponent = "0"] = match;
|
|
233
|
-
const digits = `${whole}${fraction}`;
|
|
234
|
-
const point = whole.length + Number(exponent);
|
|
235
|
-
let integerPart;
|
|
236
|
-
let fractionPart;
|
|
237
|
-
if (point <= 0) {
|
|
238
|
-
integerPart = "0";
|
|
239
|
-
fractionPart = `${"0".repeat(-point)}${digits}`;
|
|
240
|
-
} else if (point >= digits.length) {
|
|
241
|
-
integerPart = `${digits}${"0".repeat(point - digits.length)}`;
|
|
242
|
-
fractionPart = "";
|
|
243
|
-
} else {
|
|
244
|
-
integerPart = digits.slice(0, point);
|
|
245
|
-
fractionPart = digits.slice(point);
|
|
246
|
-
}
|
|
247
|
-
const trimmedInteger = integerPart.replace(/^0+(?=\d)/, "");
|
|
248
|
-
const unsigned = fractionPart === "" ? trimmedInteger : `${trimmedInteger}.${fractionPart}`;
|
|
249
|
-
return /^[0.]+$/.test(unsigned) ? unsigned : `${sign}${unsigned}`;
|
|
224
|
+
/** Decimal text without an exponent, or `NaN`, `Infinity` or `-Infinity`, which a Decimal128 also holds. */
|
|
225
|
+
function isStoredDecimalText(value) {
|
|
226
|
+
return typeof value === "string" && (isDecimalText(value) || isNonFiniteText(value));
|
|
250
227
|
}
|
|
251
228
|
function requireStoredDecimalText(codecId, value) {
|
|
252
|
-
if (
|
|
229
|
+
if (!isStoredDecimalText(value)) encodeFailed(codecId, "value must be decimal text without an exponent, or NaN, Infinity or -Infinity", value);
|
|
253
230
|
return value;
|
|
254
231
|
}
|
|
255
232
|
function decimal128Encode(codecId, value) {
|
|
@@ -269,13 +246,6 @@ function decimal128Decode(codecId, wire) {
|
|
|
269
246
|
function decimal128ToJson(codecId, value) {
|
|
270
247
|
return requireStoredDecimalText(codecId, value);
|
|
271
248
|
}
|
|
272
|
-
/** Decimal text without its leading zeros, as MongoDB writes it; the sign of zero and trailing zeros stay. */
|
|
273
|
-
function decimalTextWithoutLeadingZeros(text) {
|
|
274
|
-
return text.replace(/^(-?)0+(?=\d)/, "$1");
|
|
275
|
-
}
|
|
276
|
-
function withoutSignOfZero(text) {
|
|
277
|
-
return /^-[0.]+$/.test(text) ? text.slice(1) : text;
|
|
278
|
-
}
|
|
279
249
|
/** Whether a Decimal128 holds the decimal text exactly: the text it writes back is the same number, digit for digit. */
|
|
280
250
|
function decimal128HoldsExactly(text) {
|
|
281
251
|
let written;
|
|
@@ -284,15 +254,13 @@ function decimal128HoldsExactly(text) {
|
|
|
284
254
|
} catch {
|
|
285
255
|
return false;
|
|
286
256
|
}
|
|
287
|
-
return decimalTextWithoutExponent(written) ===
|
|
257
|
+
return decimalTextWithoutExponent(written) === printedDecimalText(text);
|
|
288
258
|
}
|
|
289
259
|
/**
|
|
290
260
|
* 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.
|
|
291
261
|
*/
|
|
292
262
|
function readDecimal128Json(owner, json) {
|
|
293
|
-
|
|
294
|
-
const text = readJsonMatching(owner, json, STORED_DECIMAL_TEXT, expected);
|
|
295
|
-
return decimal128HoldsExactly(text) ? text : refuseJsonValue(owner, expected, json);
|
|
263
|
+
return isStoredDecimalText(json) && decimal128HoldsExactly(json) ? json : refuseJsonValue(owner, "decimal text without an exponent that a Decimal128 holds exactly, or NaN, Infinity or -Infinity", json);
|
|
296
264
|
}
|
|
297
265
|
/** The decimal text without leading zeros, as MongoDB writes it, keeping negative zero. */
|
|
298
266
|
function spellDecimal128Json(json) {
|
|
@@ -726,6 +694,6 @@ const mongoDataTypes = [
|
|
|
726
694
|
/** MongoDB's text data type: `string`. */
|
|
727
695
|
const mongoTextDataTypes = [mongoString.id];
|
|
728
696
|
//#endregion
|
|
729
|
-
export {
|
|
697
|
+
export { mongoVectorParams as $, isBase64Text as A, mongoDouble as B, int64Decode as C, int64NumberFromDigits as D, int64NumberEncode as E, mongoCalendarDate as F, mongoInt64 as G, mongoDurationText as H, mongoCalendarDateText as I, mongoString as J, mongoJson as K, mongoDataTypes as L, mongoBinary as M, mongoBool as N, int64NumberToJson as O, mongoBson as P, mongoVector as Q, mongoDate as R, int32ToJson as S, int64NumberDecode as T, mongoInstantText as U, mongoDuration as V, mongoInt32 as W, mongoTime as X, mongoTextDataTypes as Y, mongoTimeText as Z, decimal128ToJson as _, booleanEncode as a, where as at, encodeBsonValue as b, bsonTypeTag as c, dateEncode as d, objectIdEncode as et, dateToJson as f, decimal128HoldsExactly as g, decimal128Encode as h, binaryToBase64 as i, vectorEncode as it, isPlainObject as j, int64ToJson as k, child as l, decimal128Decode as m, binaryEncode as n, readBsonJson as nt, bsonClassTag as o, dbRefEntries as p, mongoObjectId as q, binaryFromBase64 as r, stringEncode as rt, bsonToJson as s, binaryDecode as t, objectIdToJson as tt, constructorName as u, decodeBsonValue as v, int64Encode as w, int32Encode as x, doubleEncode as y, mongoDecimal128 as z };
|
|
730
698
|
|
|
731
|
-
//# sourceMappingURL=data-types-
|
|
699
|
+
//# sourceMappingURL=data-types-DacjqiBe-D5ui4_5e.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-DacjqiBe-D5ui4_5e.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/data-types-DacjqiBe.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, isNonFiniteText, isoDateStringText, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { dateOfThisRealm, isDate, isValidDate, withThreeFractionDigits, withoutZerosBelowAMillisecond } from \"@internal/type-implementations/date\";\nimport { decimalTextWithoutExponent, decimalTextWithoutLeadingZeros, isDecimalText, printedDecimalText } from \"@internal/type-implementations/decimal\";\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 { 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 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 (isDate(value)) return isValidDate(value) ? \"a Date\" : \"an invalid 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 (!isValidDate(value)) refuseType(codecId, \"a valid Date\", value);\n\treturn dateOfThisRealm(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 (!isValidDate(value)) 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/** Decimal text without an exponent, or `NaN`, `Infinity` or `-Infinity`, which a Decimal128 also holds. */\nfunction isStoredDecimalText(value) {\n\treturn typeof value === \"string\" && (isDecimalText(value) || isNonFiniteText(value));\n}\nfunction requireStoredDecimalText(codecId, value) {\n\tif (!isStoredDecimalText(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/** 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) === printedDecimalText(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\treturn isStoredDecimalText(json) && decimal128HoldsExactly(json) ? json : refuseJsonValue(owner, \"decimal text without an exponent that a Decimal128 holds exactly, or NaN, Infinity or -Infinity\", 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 (isDate(value) || 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\ttemporaryValue: {\n\t\texpression: { $literal: \"\" },\n\t\ttext: \"\\\"\\\"\"\n\t}\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\ttemporaryValue: {\n\t\texpression: 0,\n\t\ttext: \"0\"\n\t}\n});\nconst mongoInt64 = mongoDataType(\"mongo/int64\", {\n\tread: (json) => readInt64Json(\"mongo/int64\", json),\n\tbsonTypes: [\"long\"],\n\ttemporaryValue: {\n\t\texpression: { $toLong: 0 },\n\t\ttext: \"0\"\n\t},\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\ttemporaryValue: {\n\t\texpression: { $toDecimal: \"0\" },\n\t\ttext: \"0\"\n\t},\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\ttemporaryValue: {\n\t\texpression: { $toDouble: 0 },\n\t\ttext: \"0\"\n\t},\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\ttemporaryValue: {\n\t\texpression: false,\n\t\ttext: \"false\"\n\t}\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 { int64NumberToJson as $, constructorName as A, dateToJson as B, bsonToJson as C, bsonClassTag as D, readBsonJson as E, binaryEncode as F, doubleEncode as G, decimal128Encode as H, binaryFromBase64 as I, int64Decode as J, int32Encode as K, binaryToBase64 as L, isPlainObject as M, where as N, bsonTypeTag as O, binaryDecode as P, int64NumberFromDigits as Q, booleanEncode as R, mongoVectorParams as S, encodeBsonValue as T, decimal128HoldsExactly as U, decimal128Decode as V, decimal128ToJson as W, int64NumberDecode as X, int64Encode as Y, int64NumberEncode as Z, mongoString as _, mongoCalendarDateText as a, vectorEncode as at, mongoTimeText as b, mongoDecimal128 as c, mongoDurationText as d, int64ToJson as et, mongoInstantText as f, mongoObjectId as g, mongoJson as h, mongoCalendarDate as i, stringEncode as it, dbRefEntries as j, child as k, mongoDouble as l, mongoInt64 as m, mongoBool as n, objectIdEncode as nt, mongoDataTypes as o, mongoInt32 as p, int32ToJson as q, mongoBson as r, objectIdToJson as rt, mongoDate as s, mongoBinary as t, isBase64Text as tt, mongoDuration as u, mongoTextDataTypes as v, decodeBsonValue as w, mongoVector as x, mongoTime as y, dateEncode as z };\n\n//# sourceMappingURL=data-types-DacjqiBe.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,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;CAChC,IAAI,OAAO,UAAU,UAAU,OAAO,OAAO,KAAK;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO,GAAG,MAAM;CAC/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;CACjD,OAAO,MAAM,WAAW,eAAe,gBAAgB,MAAM,OAAO,OAAO,cAAc,WAAW,OAAO,YAAY,KAAK,CAAC;CAC7H,WAAW,CAAC,OAAO;CACnB,QAAQ;CACR,UAAU;EACT,IAAI;GACH,WAAW;GACX,WAAW;GACX,gBAAgB;GAChB,YAAY;EACb;EACA,MAAM;CACP;AACD,CAAC;AACD,MAAM,cAAc,cAAc,gBAAgB;CACjD,OAAO,SAAS,eAAe,gBAAgB,IAAI;CACnD,OAAO;CACP,WAAW,CAAC,SAAS;AACtB,CAAC;AACD,MAAM,YAAY,cAAc,cAAc;CAC7C,OAAO,SAAS;CAChB,WAAW;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD,CAAC;AACD,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"}
|
|
@@ -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-DKwnfU85-BAZ4CD7m.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-ClztoylE.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-ClztoylE-Bq7Fps2T.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-now-generators-
|
|
1
|
+
{"version":3,"file":"date-time-now-generators-ClztoylE-Bq7Fps2T.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/date-time-now-generators-ClztoylE.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-DKwnfU85.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-ClztoylE.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-BWjqdX8D-BAnaqzWL.mjs → descriptor-meta-BRjal4JG-G-1rNvuk.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
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
|
-
import { A as isBase64Text, B as
|
|
3
|
-
import { n as mongoNowGenerators, t as mongoNowGeneratorIds } from "./date-time-now-generators-
|
|
4
|
-
import { t as mongoTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-
|
|
2
|
+
import { A as isBase64Text, B as mongoDouble, G as mongoInt64, H as mongoDurationText, J as mongoString, K as mongoJson, M as mongoBinary, N as mongoBool, R as mongoDate, V as mongoDuration, W as mongoInt32, X as mongoTime, Y as mongoTextDataTypes, Z as mongoTimeText, g as decimal128HoldsExactly, z as mongoDecimal128 } from "./data-types-DacjqiBe-D5ui4_5e.mjs";
|
|
3
|
+
import { n as mongoNowGenerators, t as mongoNowGeneratorIds } from "./date-time-now-generators-ClztoylE-Bq7Fps2T.mjs";
|
|
4
|
+
import { t as mongoTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-Bnv0sQnr-DVFwLDn7.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-BRjal4JG.mjs
|
|
10
10
|
const int64BigInt = {
|
|
11
11
|
kind: "typeConstructor",
|
|
12
12
|
documentation: "A signed 64-bit integer read as a bigint, stored as BSON long.",
|
|
@@ -510,4 +510,4 @@ const mongoTargetDescriptorMeta = {
|
|
|
510
510
|
//#endregion
|
|
511
511
|
export { mongoTargetDescriptorMeta as t };
|
|
512
512
|
|
|
513
|
-
//# sourceMappingURL=descriptor-meta-
|
|
513
|
+
//# sourceMappingURL=descriptor-meta-BRjal4JG-G-1rNvuk.mjs.map
|
package/dist/{descriptor-meta-BWjqdX8D-BAnaqzWL.mjs.map → descriptor-meta-BRjal4JG-G-1rNvuk.mjs.map}
RENAMED
|
@@ -1 +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,EAAE,SAAS,0BAA0B;CAC9C;CACA,QAAQ;EACP,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,sBAAsB;CAC1C;CACA,WAAW;EACV,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,oBAAoB;CACxC;CACA,MAAM;EACL,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,oBAAoB;CACxC;CACA,QAAQ;EACP,MAAM;EACN,eAAe;EACf,MAAM,CAAC;GACN,MAAM;GACN,UAAU;GACV,MAAM;GACN,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY,EAAE,QAAQ;IACrB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD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AAM,UAAU,EAAE;GACtD;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,cAAc,KAAK;GACnB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,YAAY,KAAK;GACjB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,OAAO;GACP,eAAe;EAChB;CACD;AACD;AACA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,WAAW,qBAAqB;EAChC,eAAe;CAChB;CACA,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB,CAAC,EAAE,IAAI,2BAA2B,GAAG,GAAG,mBAAmB,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;CAC3G;CACA,oBAAoB,CAAC;EACpB,MAAM;EACN,WAAW,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
|
+
{"version":3,"file":"descriptor-meta-BRjal4JG-G-1rNvuk.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/descriptor-meta-BRjal4JG.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 { U 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, p as mongoInt32, s as mongoDate, t as mongoBinary, tt as isBase64Text, u as mongoDuration, v as mongoTextDataTypes, y as mongoTime } from \"./data-types-DacjqiBe.mjs\";\nimport { n as mongoNowGenerators, t as mongoNowGeneratorIds } from \"./date-time-now-generators-ClztoylE.mjs\";\nimport { t as mongoTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-Bnv0sQnr.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-BRjal4JG.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,EAAE,SAAS,0BAA0B;CAC9C;CACA,QAAQ;EACP,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,sBAAsB;CAC1C;CACA,WAAW;EACV,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,oBAAoB;CACxC;CACA,MAAM;EACL,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,oBAAoB;CACxC;CACA,QAAQ;EACP,MAAM;EACN,eAAe;EACf,MAAM,CAAC;GACN,MAAM;GACN,UAAU;GACV,MAAM;GACN,UAAU;EACX,CAAC;EACD,QAAQ;GACP,SAAS;GACT,YAAY,EAAE,QAAQ;IACrB,MAAM;IACN,OAAO;GACR,EAAE;EACH;CACD;AACD;;;;AAIA,MAAM,6BAA6B,EAAE,OAAO;CA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O,KAAK;GAC9B,eAAe;EAChB;GACC,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,cAAc,KAAK;GACnB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,YAAY,KAAK;GACjB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,UAAU,KAAK;GACf,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,OAAO;GACP,eAAe;EAChB;CACD;AACD;AACA,MAAM,4BAA4B;CACjC,GAAG;CACH,WAAW;EACV,MAAM;EACN,WAAW,qBAAqB;EAChC,eAAe;CAChB;CACA,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB,CAAC,EAAE,IAAI,2BAA2B,GAAG,GAAG,mBAAmB,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;CAC3G;CACA,oBAAoB,CAAC;EACpB,MAAM;EACN,WAAW,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
|
-
import {
|
|
2
|
-
import { t as mongoCodecDescriptors } from "./codecs-
|
|
1
|
+
import { L as mongoDataTypes } from "./data-types-DacjqiBe-D5ui4_5e.mjs";
|
|
2
|
+
import { t as mongoCodecDescriptors } from "./codecs-DKwnfU85-BAZ4CD7m.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-Bnv0sQnr.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-Bnv0sQnr-DVFwLDn7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-runtime-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-runtime-Bnv0sQnr-DVFwLDn7.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/descriptor-meta-runtime-Bnv0sQnr.mjs"],"sourcesContent":["import { o as mongoDataTypes } from \"./data-types-DacjqiBe.mjs\";\nimport { t as mongoCodecDescriptors } from \"./codecs-DKwnfU85.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-Bnv0sQnr.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-Dn4c6fxh.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-Dn4c6fxh.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-BDzR1BQa-DI2usg4u.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-BDzR1BQa.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-DDzO_Noh.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-ivErOBO6.mjs.map
|