@prisma/orm-target-mongo 8.0.0-rc.2-dev.2 → 8.0.0-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +1 -5
  2. package/dist/adapter.d.mts +2 -2
  3. package/dist/adapter.d.mts.map +1 -1
  4. package/dist/adapter.mjs +3 -3
  5. package/dist/adapter.mjs.map +1 -1
  6. package/dist/adapter__control.d.mts +204 -3
  7. package/dist/adapter__control.d.mts.map +1 -0
  8. package/dist/adapter__control.mjs +481 -3
  9. package/dist/adapter__control.mjs.map +1 -0
  10. package/dist/adapter__runtime.d.mts +3 -1
  11. package/dist/adapter__runtime.d.mts.map +1 -1
  12. package/dist/adapter__runtime.mjs +5 -3
  13. package/dist/adapter__runtime.mjs.map +1 -1
  14. package/dist/codec-ids-BKQbXhZt.d.mts +18 -0
  15. package/dist/codec-ids-BKQbXhZt.d.mts.map +1 -0
  16. package/dist/codec-ids-WdrumsYA-CZVjuKW8.mjs +18 -0
  17. package/dist/codec-ids-WdrumsYA-CZVjuKW8.mjs.map +1 -0
  18. package/dist/codec-types-oKxM85p-.d.mts +89 -0
  19. package/dist/codec-types-oKxM85p-.d.mts.map +1 -0
  20. package/dist/codecs-B1ab7vfj-QL33tkm2.mjs +392 -0
  21. package/dist/codecs-B1ab7vfj-QL33tkm2.mjs.map +1 -0
  22. package/dist/codecs-Y5GYsLPj.d.mts +36 -0
  23. package/dist/codecs-Y5GYsLPj.d.mts.map +1 -0
  24. package/dist/control-Cq6qWohQ.mjs +2421 -0
  25. package/dist/control-Cq6qWohQ.mjs.map +1 -0
  26. package/dist/{control-CxXmTy_h.d.mts → control-CrFS8bqh.d.mts} +133 -95
  27. package/dist/control-CrFS8bqh.d.mts.map +1 -0
  28. package/dist/data-types-LShlnAUM.d.mts +25 -0
  29. package/dist/data-types-LShlnAUM.d.mts.map +1 -0
  30. package/dist/data-types-hoKLBrYZ-h9cAgbOy.mjs +624 -0
  31. package/dist/data-types-hoKLBrYZ-h9cAgbOy.mjs.map +1 -0
  32. package/dist/descriptor-meta-DTj807jv-CjvK2XDD.mjs +146 -0
  33. package/dist/descriptor-meta-DTj807jv-CjvK2XDD.mjs.map +1 -0
  34. package/dist/descriptor-meta-runtime-BaRbjvD7-D0786_Lv.mjs +20 -0
  35. package/dist/descriptor-meta-runtime-BaRbjvD7-D0786_Lv.mjs.map +1 -0
  36. package/dist/driver.d.mts +1 -1
  37. package/dist/driver.mjs +1 -1
  38. package/dist/driver__control.d.mts +4 -3
  39. package/dist/driver__control.d.mts.map +1 -1
  40. package/dist/driver__control.mjs +5 -2
  41. package/dist/driver__control.mjs.map +1 -1
  42. package/dist/{migration-BkqcE2Uv.d.mts → migration-C4m4Uj8E.d.mts} +15 -7
  43. package/dist/migration-C4m4Uj8E.d.mts.map +1 -0
  44. package/dist/migration-factories-BqROEHRs-CfExMr9r.mjs +406 -0
  45. package/dist/migration-factories-BqROEHRs-CfExMr9r.mjs.map +1 -0
  46. package/dist/{mongo-adapter-B2HEyX0b-CQt2HH_o.mjs → mongo-adapter-Bo6ciURK-DIMJdC7y.mjs} +37 -18
  47. package/dist/mongo-adapter-Bo6ciURK-DIMJdC7y.mjs.map +1 -0
  48. package/dist/{mongo-adapter-CjJU3S9o-BIJruFYW.d.mts → mongo-adapter-wvK2fQOZ-FswLS-PJ.d.mts} +2 -2
  49. package/dist/mongo-adapter-wvK2fQOZ-FswLS-PJ.d.mts.map +1 -0
  50. package/dist/{mongo-driver-D1lEf5Kl-KPfGUVXK.d.mts → mongo-driver-CTyvKDUg-Bm9sBrfs.d.mts} +9 -4
  51. package/dist/mongo-driver-CTyvKDUg-Bm9sBrfs.d.mts.map +1 -0
  52. package/dist/{mongo-driver-CMzJAzeQ-B3Q4RoHN.mjs → mongo-driver-Cu6FP6OU-DhOzFM2D.mjs} +34 -8
  53. package/dist/mongo-driver-Cu6FP6OU-DhOzFM2D.mjs.map +1 -0
  54. package/dist/mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs +9 -0
  55. package/dist/mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs.map +1 -0
  56. package/dist/{op-factory-call-B7EKa4Ri-B2Lb6W68.d.mts → op-factory-call-BoYr7vvM-CjA8nx36.d.mts} +43 -9
  57. package/dist/op-factory-call-BoYr7vvM-CjA8nx36.d.mts.map +1 -0
  58. package/dist/pack-CIfujQmd.d.mts +266 -0
  59. package/dist/pack-CIfujQmd.d.mts.map +1 -0
  60. package/dist/prisma6-binding-DhnqslLT.d.mts +54 -0
  61. package/dist/prisma6-binding-DhnqslLT.d.mts.map +1 -0
  62. package/dist/prisma6-binding-vt4tbT-Z.mjs +45 -0
  63. package/dist/prisma6-binding-vt4tbT-Z.mjs.map +1 -0
  64. package/dist/{runtime-B9_-kjBX.d.mts → runtime-DbFgyDql.d.mts} +2 -2
  65. package/dist/runtime-DbFgyDql.d.mts.map +1 -0
  66. package/dist/target.d.mts +11 -8
  67. package/dist/target.mjs +7 -3
  68. package/dist/target__codec-ids.d.mts +2 -0
  69. package/dist/target__codec-ids.mjs +2 -0
  70. package/dist/target__codec-types.d.mts +2 -2
  71. package/dist/target__codecs.d.mts +2 -0
  72. package/dist/target__codecs.mjs +2 -0
  73. package/dist/target__control.d.mts +3 -4
  74. package/dist/target__control.mjs +2 -2
  75. package/dist/target__data-types.d.mts +2 -0
  76. package/dist/target__data-types.mjs +2 -0
  77. package/dist/target__migration.d.mts +2 -2
  78. package/dist/target__migration.mjs +2 -2
  79. package/dist/target__pack.d.mts +3 -2
  80. package/dist/target__pack.mjs +2 -2
  81. package/dist/target__pack.mjs.map +1 -1
  82. package/dist/target__prisma6-binding.d.mts +2 -0
  83. package/dist/target__prisma6-binding.mjs +2 -0
  84. package/dist/target__runtime.d.mts +1 -1
  85. package/dist/target__runtime.mjs +3 -3
  86. package/dist/target__runtime.mjs.map +1 -1
  87. package/package.json +16 -15
  88. package/dist/adapter__codec-ids.d.mts +0 -12
  89. package/dist/adapter__codec-ids.d.mts.map +0 -1
  90. package/dist/adapter__codec-ids.mjs +0 -2
  91. package/dist/adapter__codec-types.d.mts +0 -38
  92. package/dist/adapter__codec-types.d.mts.map +0 -1
  93. package/dist/adapter__codec-types.mjs +0 -1
  94. package/dist/adapter__codecs.d.mts +0 -14
  95. package/dist/adapter__codecs.d.mts.map +0 -1
  96. package/dist/adapter__codecs.mjs +0 -2
  97. package/dist/codec-ids-BennPcpQ-Btzz3ILV.mjs +0 -12
  98. package/dist/codec-ids-BennPcpQ-Btzz3ILV.mjs.map +0 -1
  99. package/dist/codec-types-Bx2fHyq_.d.mts +0 -35
  100. package/dist/codec-types-Bx2fHyq_.d.mts.map +0 -1
  101. package/dist/codecs-DLWO-Cjc-CWfQj0bY.mjs +0 -170
  102. package/dist/codecs-DLWO-Cjc-CWfQj0bY.mjs.map +0 -1
  103. package/dist/control-CxXmTy_h.d.mts.map +0 -1
  104. package/dist/control-DQD76x-1.mjs +0 -437
  105. package/dist/control-DQD76x-1.mjs.map +0 -1
  106. package/dist/control-Dfe3dqw9.mjs +0 -1563
  107. package/dist/control-Dfe3dqw9.mjs.map +0 -1
  108. package/dist/control-rPM2HNxW.d.mts +0 -170
  109. package/dist/control-rPM2HNxW.d.mts.map +0 -1
  110. package/dist/descriptor-meta-CBiaTwe5-HX742pZh.mjs +0 -17
  111. package/dist/descriptor-meta-CBiaTwe5-HX742pZh.mjs.map +0 -1
  112. package/dist/migration-BkqcE2Uv.d.mts.map +0 -1
  113. package/dist/migration-factories-CCJFG_3e-75oJ8xn2.mjs +0 -201
  114. package/dist/migration-factories-CCJFG_3e-75oJ8xn2.mjs.map +0 -1
  115. package/dist/mongo-adapter-B2HEyX0b-CQt2HH_o.mjs.map +0 -1
  116. package/dist/mongo-adapter-CjJU3S9o-BIJruFYW.d.mts.map +0 -1
  117. package/dist/mongo-driver-CMzJAzeQ-B3Q4RoHN.mjs.map +0 -1
  118. package/dist/mongo-driver-D1lEf5Kl-KPfGUVXK.d.mts.map +0 -1
  119. package/dist/op-factory-call-B7EKa4Ri-B2Lb6W68.d.mts.map +0 -1
  120. package/dist/pack-MK8ZQfrL.d.mts +0 -22
  121. package/dist/pack-MK8ZQfrL.d.mts.map +0 -1
  122. package/dist/runtime-B9_-kjBX.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-types-hoKLBrYZ-h9cAgbOy.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/data-types-hoKLBrYZ.mjs"],"sourcesContent":["import { r as MONGO_BSON_CODEC_ID } from \"./codec-ids-WdrumsYA.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, decimalTextEqualityKey, isIntegerIn, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { counted } from \"@internal/utils/text\";\nimport { Binary, Code, Decimal128, Double, EJSON, Long, MinKey, ObjectId } from \"bson\";\nimport { mongoDataType } from \"@internal/mongo-contract/data-type\";\nimport { type } from \"arktype\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/core/bson-scalar-helpers.ts\nconst STORED_DECIMAL_TEXT = /^(?:-?\\d+(?:\\.\\d+)?|NaN|-?Infinity)$/;\nconst DECIMAL128_TEXT = /^(-?)(\\d+)(?:\\.(\\d+))?(?:E([+-]\\d+))?$/;\nconst BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\n/**\n* Checks the BSON type tag rather than `instanceof`: the driver deserialises with its own load of `bson` (CommonJS, where this module may be loaded as ESM), so a value read from the database need not be an instance of the class imported here.\n*/\nfunction hasBsonTypeTag(value, tag) {\n\treturn typeof value === \"object\" && value !== null && \"_bsontype\" in value && value._bsontype === tag;\n}\nfunction isLong(value) {\n\treturn hasBsonTypeTag(value, \"Long\");\n}\nfunction isDecimal128(value) {\n\treturn hasBsonTypeTag(value, \"Decimal128\");\n}\nfunction isBinary(value) {\n\treturn hasBsonTypeTag(value, \"Binary\");\n}\nfunction decodeFailed(codecId, message, received) {\n\tthrow mongoTargetError(\"RUNTIME.DECODE_FAILED\", `${codecId} ${message}`, { meta: {\n\t\tcodecId,\n\t\treceived: typeof received\n\t} });\n}\nconst RECEIVED_PREVIEW_LIMIT = 100;\nfunction encodeFailed(codecId, message, received) {\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${codecId} ${message}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(received).slice(0, RECEIVED_PREVIEW_LIMIT)\n\t} });\n}\nfunction describeReceived(value) {\n\tif (typeof value === \"number\") return String(value);\n\tif (typeof value === \"bigint\") return `${value}n`;\n\tif (typeof value === \"string\") return `string ${JSON.stringify(value.slice(0, RECEIVED_PREVIEW_LIMIT))}`;\n\tif (value === null) return \"null\";\n\tif (value instanceof Date) return Number.isNaN(value.getTime()) ? \"an invalid Date\" : \"a Date\";\n\tif (Array.isArray(value)) return \"an array\";\n\treturn typeof value;\n}\nfunction refuseType(codecId, expected, value, received = describeReceived(value)) {\n\treturn encodeFailed(codecId, `value must be ${expected}; received ${received}`, value);\n}\nfunction stringEncode(codecId, value) {\n\tif (typeof value !== \"string\") refuseType(codecId, \"a string\", value);\n\treturn value;\n}\nfunction booleanEncode(codecId, value) {\n\tif (typeof value !== \"boolean\") refuseType(codecId, \"a boolean\", value);\n\treturn value;\n}\n/**\n* The driver writes an invalid `Date` as the epoch, so one is refused with any other non-`Date` value.\n*/\nfunction dateEncode(codecId, value) {\n\tif (!(value instanceof Date) || Number.isNaN(value.getTime())) refuseType(codecId, \"a valid Date\", value);\n\treturn value;\n}\nconst OBJECT_ID_TEXT = /^[0-9a-fA-F]{24}$/;\nfunction hexStringOf(value) {\n\tconst toHexString = Reflect.get(value, \"toHexString\");\n\tif (typeof toHexString !== \"function\") return void 0;\n\tconst hex = Reflect.apply(toHexString, value, []);\n\treturn typeof hex === \"string\" && OBJECT_ID_TEXT.test(hex) ? hex : void 0;\n}\n/**\n* `new ObjectId(...)` makes a fresh id from `null` or `undefined` and reads a number as a timestamp, so only a string, which the constructor accepts only as 24 hex digits, or an `ObjectId` is passed to it. An `ObjectId` is rebuilt from its hex string, so one from any major version of `bson` works.\n*/\nfunction objectIdEncode(codecId, value) {\n\tconst expected = \"a 24-digit hex string or an ObjectId\";\n\tif (typeof value === \"string\") try {\n\t\treturn new ObjectId(value);\n\t} catch {\n\t\treturn refuseType(codecId, expected, value);\n\t}\n\tif (typeof value !== \"object\" || value === null || !hasBsonTypeTag(value, \"ObjectId\")) return refuseType(codecId, expected, value);\n\tconst hex = hexStringOf(value);\n\tif (hex === void 0) return refuseType(codecId, expected, value, \"an object tagged ObjectId whose toHexString() does not return 24 hex digits\");\n\treturn new ObjectId(hex);\n}\nfunction vectorEncode(codecId, value) {\n\tif (!Array.isArray(value) || !value.every((element) => typeof element === \"number\")) refuseType(codecId, \"an array of numbers\", value);\n\treturn value;\n}\n/**\n* Wraps the number in the driver's `Double`, because the driver writes a whole JavaScript number in the int32 range as a BSON `int`, which a `double` validator refuses.\n*/\nfunction doubleEncode(codecId, value) {\n\tif (typeof value !== \"number\") encodeFailed(codecId, `value must be a number; received ${describeReceived(value)}`, value);\n\treturn new Double(value);\n}\nfunction int32Encode(codecId, value) {\n\tif (!isIntegerIn(value, INT32_RANGE)) encodeFailed(codecId, `value must be an integer from ${INT32_RANGE.min} to ${INT32_RANGE.max}; received ${describeReceived(value)}`, value);\n\treturn value;\n}\nfunction objectIdToJson(codecId, value) {\n\tif (typeof value !== \"string\" || !OBJECT_ID_TEXT.test(value)) encodeFailed(codecId, \"value must be 24 hexadecimal digits\", value);\n\treturn value;\n}\n/** Whether `text` is an ObjectId's 24 hexadecimal digits, in either case. */\nfunction isObjectIdText(text) {\n\treturn OBJECT_ID_TEXT.test(text);\n}\n/** Reads ObjectId hex in either case; {@link spellObjectIdJson} writes the lower case the type stores. */\nfunction readObjectIdJson(owner, json) {\n\treturn readJsonMatching(owner, json, OBJECT_ID_TEXT, \"24 hexadecimal digits\");\n}\n/** The ObjectId hex in lower case, as the driver's `toHexString` writes it. */\nfunction spellObjectIdJson(json) {\n\treturn typeof json === \"string\" ? json.toLowerCase() : json;\n}\nfunction int32ToJson(codecId, value) {\n\tif (!isIntegerIn(value, INT32_RANGE)) encodeFailed(codecId, `value must be an integer from ${INT32_RANGE.min} to ${INT32_RANGE.max}`, value);\n\treturn value;\n}\nfunction readInt32Json(owner, json) {\n\treturn readJsonInteger(owner, json, INT32_RANGE);\n}\nfunction dateToJson(codecId, value) {\n\tif (!(value instanceof Date) || Number.isNaN(value.getTime())) encodeFailed(codecId, \"value must be a valid Date\", value);\n\treturn value.toISOString();\n}\n/**\n* The JSON form is the text `Date.toISOString()` writes, so a string that does not read back to that same text is refused.\n*/\nfunction readDateJson(owner, json) {\n\tconst date = typeof json === \"string\" ? new Date(json) : void 0;\n\tif (date === void 0 || Number.isNaN(date.getTime()) || date.toISOString() !== json) return refuseJsonValue(owner, \"a date and time in UTC as Date.toISOString writes it\", json);\n\treturn json;\n}\n/** Reads an array of numbers, of exactly `length` numbers when the column sets one. */\nfunction readVectorJson(owner, json, length) {\n\tconst expected = length === void 0 ? \"an array of numbers\" : `an array of ${counted(length, \"number\")}`;\n\tif (!Array.isArray(json) || length !== void 0 && json.length !== length) return refuseJsonValue(owner, expected, json);\n\tconst numbers = [];\n\tfor (const element of json) {\n\t\tif (typeof element !== \"number\") return refuseJsonValue(owner, expected, element);\n\t\tif (!Number.isFinite(element)) return refuseJsonValue(owner, \"an array of finite numbers\", json);\n\t\tnumbers.push(element);\n\t}\n\treturn numbers;\n}\n/**\n* `Long.fromBigInt` keeps the low 64 bits of any bigint, so an out-of-range value would be stored as a different number without error.\n*/\nfunction isInt64(value) {\n\treturn value >= INT64_RANGE.min && value <= INT64_RANGE.max;\n}\nfunction requireInt64(codecId, value) {\n\tif (!isInt64(value)) encodeFailed(codecId, \"value is outside the signed 64-bit range\", value);\n\treturn value;\n}\nfunction int64Encode(codecId, value) {\n\tif (typeof value !== \"bigint\") encodeFailed(codecId, \"value must be a bigint\", value);\n\treturn Long.fromBigInt(requireInt64(codecId, value));\n}\n/**\n* A stored double with a fraction, which a 64-bit integer codec cannot read. Such values were written through a Prisma 6 `Int` while its contract used the 32-bit codec, which took any number.\n*/\nfunction refuseFractionalDouble(codecId, wire) {\n\treturn decodeFailed(codecId, `wire value is the fractional double ${wire}, and a 64-bit integer holds whole numbers only. Rewrite each such stored value as a long, rounded or cut off ({ $toLong: { $round: [<value>, 0] } }, or $trunc in place of $round), mapping over the list when the value sits in one. The upgrade guide step prisma6-int-written-as-long has the queries for a plain field, a list and a list of composite values.`, wire);\n}\n/**\n* The driver promotes a stored `long` that fits in 53 bits to a `number`, and hands larger ones over as `Long`, so both arrive here.\n*/\nfunction int64Decode(codecId, wire) {\n\tif (typeof wire === \"bigint\") return wire;\n\tif (isLong(wire)) return wire.toBigInt();\n\tif (typeof wire === \"number\" && Number.isSafeInteger(wire)) return BigInt(wire);\n\tif (typeof wire === \"number\" && Number.isFinite(wire) && !Number.isInteger(wire)) return refuseFractionalDouble(codecId, wire);\n\treturn decodeFailed(codecId, \"wire value must be a Long or a safe integer\", wire);\n}\n/**\n* A schema-written default arrives as a `number`; one that is a safe integer names its value exactly, so it is accepted like `pg/int8@1` accepts it.\n*/\nfunction int64ToJson(codecId, value) {\n\tif (typeof value === \"bigint\") return requireInt64(codecId, value).toString();\n\tif (typeof value === \"number\" && Number.isSafeInteger(value)) return BigInt(value).toString();\n\treturn encodeFailed(codecId, \"value must be a bigint or a safe integer\", value);\n}\nfunction readInt64Json(owner, json) {\n\treadJsonIntegerText(owner, json, INT64_RANGE);\n\treturn json;\n}\nconst SAFE_INTEGERS = `from ${SAFE_INTEGER_RANGE.min} to ${SAFE_INTEGER_RANGE.max}`;\nfunction int64NumberEncode(codecId, value) {\n\tif (!isIntegerIn(value, SAFE_INTEGER_RANGE)) encodeFailed(codecId, `value must be an integer ${SAFE_INTEGERS}; received ${describeReceived(value)}`, value);\n\treturn Long.fromNumber(value);\n}\nfunction safeIntegerOf(codecId, value) {\n\tif (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) decodeFailed(codecId, `wire value must be a whole number ${SAFE_INTEGERS}; received ${value}`, value);\n\treturn Number(value);\n}\n/**\n* The driver hands a stored `long` over as a `number` when it fits in 53 bits (the default `promoteLongs`), as a `Long` otherwise or with `promoteLongs: false`, and as a `bigint` with `useBigInt64`.\n*/\nfunction int64NumberDecode(codecId, wire) {\n\tif (typeof wire === \"bigint\") return safeIntegerOf(codecId, wire);\n\tif (isLong(wire)) return safeIntegerOf(codecId, wire.toBigInt());\n\tif (isIntegerIn(wire, SAFE_INTEGER_RANGE)) return wire;\n\tif (typeof wire === \"number\" && Number.isFinite(wire) && !Number.isInteger(wire)) return refuseFractionalDouble(codecId, wire);\n\treturn decodeFailed(codecId, `wire value must be a whole number ${SAFE_INTEGERS}; received ${describeReceived(wire)}`, wire);\n}\nfunction int64NumberToJson(codecId, value) {\n\treturn int64NumberEncode(codecId, value).toString();\n}\n/** A `number` holds an integer exactly only within the safe integer range, so digit text past it is refused. */\nfunction int64NumberFromDigits(codecId, digits) {\n\treturn Number(readJsonIntegerText(codecId, digits, SAFE_INTEGER_BIGINT_RANGE));\n}\n/**\n* `Decimal128.toString()` writes some values with an exponent (`1E+3`, `1.23E+40`). The application value is decimal text without one, as for Postgres `numeric`: the point moves to where the exponent puts it, trailing zeros stay, and the sign of zero goes.\n*/\nfunction decimalTextWithoutExponent(text) {\n\tif (text === \"NaN\" || text === \"Infinity\" || text === \"-Infinity\") return text;\n\tconst match = DECIMAL128_TEXT.exec(text);\n\tif (match === null) return void 0;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\", exponent = \"0\"] = match;\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tlet integerPart;\n\tlet fractionPart;\n\tif (point <= 0) {\n\t\tintegerPart = \"0\";\n\t\tfractionPart = `${\"0\".repeat(-point)}${digits}`;\n\t} else if (point >= digits.length) {\n\t\tintegerPart = `${digits}${\"0\".repeat(point - digits.length)}`;\n\t\tfractionPart = \"\";\n\t} else {\n\t\tintegerPart = digits.slice(0, point);\n\t\tfractionPart = digits.slice(point);\n\t}\n\tconst trimmedInteger = integerPart.replace(/^0+(?=\\d)/, \"\");\n\tconst unsigned = fractionPart === \"\" ? trimmedInteger : `${trimmedInteger}.${fractionPart}`;\n\treturn /^[0.]+$/.test(unsigned) ? unsigned : `${sign}${unsigned}`;\n}\nfunction requireStoredDecimalText(codecId, value) {\n\tif (typeof value !== \"string\" || !STORED_DECIMAL_TEXT.test(value)) encodeFailed(codecId, \"value must be decimal text without an exponent, or NaN, Infinity or -Infinity\", value);\n\treturn value;\n}\nfunction decimal128Encode(codecId, value) {\n\trequireStoredDecimalText(codecId, value);\n\ttry {\n\t\treturn Decimal128.fromString(value);\n\t} catch (error) {\n\t\treturn encodeFailed(codecId, `value cannot be stored as a Decimal128 exactly: ${error instanceof Error ? error.message : String(error)}`, value);\n\t}\n}\nfunction decimal128Decode(codecId, wire) {\n\tif (!isDecimal128(wire)) return decodeFailed(codecId, \"wire value must be a Decimal128\", wire);\n\tconst text = decimalTextWithoutExponent(wire.toString());\n\tif (text === void 0) return decodeFailed(codecId, \"wire value is not decimal text\", wire);\n\treturn text;\n}\nfunction decimal128ToJson(codecId, value) {\n\treturn requireStoredDecimalText(codecId, value);\n}\n/** Decimal text without its leading zeros, as MongoDB writes it; the sign of zero and trailing zeros stay. */\nfunction decimalTextWithoutLeadingZeros(text) {\n\treturn text.replace(/^(-?)0+(?=\\d)/, \"$1\");\n}\nfunction withoutSignOfZero(text) {\n\treturn /^-[0.]+$/.test(text) ? text.slice(1) : text;\n}\n/** Whether a Decimal128 holds the decimal text exactly: the text it writes back is the same number, digit for digit. */\nfunction decimal128HoldsExactly(text) {\n\tlet written;\n\ttry {\n\t\twritten = Decimal128.fromString(text).toString();\n\t} catch {\n\t\treturn false;\n\t}\n\treturn decimalTextWithoutExponent(written) === withoutSignOfZero(decimalTextWithoutLeadingZeros(text));\n}\n/**\n* The stored form is what the codec writes, so it follows the encode rule: decimal text without an exponent, or `NaN`, `Infinity` or `-Infinity`, that a Decimal128 holds exactly. A value a Decimal128 would round is refused.\n*/\nfunction readDecimal128Json(owner, json) {\n\tconst expected = \"decimal text without an exponent that a Decimal128 holds exactly, or NaN, Infinity or -Infinity\";\n\tconst text = readJsonMatching(owner, json, STORED_DECIMAL_TEXT, expected);\n\treturn decimal128HoldsExactly(text) ? text : refuseJsonValue(owner, expected, json);\n}\n/** The decimal text without leading zeros, as MongoDB writes it, keeping negative zero. */\nfunction spellDecimal128Json(json) {\n\treturn typeof json === \"string\" ? decimalTextWithoutLeadingZeros(json) : json;\n}\nfunction binaryEncode(codecId, value) {\n\tif (!(value instanceof Uint8Array)) encodeFailed(codecId, \"value must be a Uint8Array\", value);\n\treturn new Binary(value);\n}\n/**\n* The driver reads binData as a `Binary`, or as a `Buffer` with `promoteBuffers: true`; either becomes a plain `Uint8Array` copy of the bytes.\n*/\nfunction binaryDecode(codecId, wire) {\n\tif (wire instanceof Uint8Array) return new Uint8Array(wire);\n\tif (!isBinary(wire)) return decodeFailed(codecId, \"wire value must be a Binary or a Uint8Array\", wire);\n\treturn new Uint8Array(wire.value());\n}\nfunction binaryToBase64(value) {\n\treturn Buffer.from(value).toString(\"base64\");\n}\n/** Whether `text` is base64, with or without padding bits set. */\nfunction isBase64Text(text) {\n\treturn BASE64_TEXT.test(text);\n}\n/** Reads base64 with or without padding bits set; {@link spellBase64Json} writes the base64 the type stores. */\nfunction readBinaryJson(owner, json) {\n\treturn readJsonMatching(owner, json, BASE64_TEXT, \"base64 text\");\n}\n/** The base64 of the same bytes with padding bits zero, as `Buffer` writes it. */\nfunction spellBase64Json(json) {\n\treturn typeof json === \"string\" ? Buffer.from(json, \"base64\").toString(\"base64\") : json;\n}\nfunction binaryFromBase64(base64) {\n\treturn new Uint8Array(Buffer.from(base64, \"base64\"));\n}\n//#endregion\n//#region src/core/bson-walk.ts\nfunction where(path) {\n\treturn path === \"\" ? \"the root\" : path;\n}\nfunction child(path, key) {\n\treturn path === \"\" ? String(key) : `${path}.${key}`;\n}\nfunction isPlainObject(value) {\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction isPlainArray(value) {\n\treturn Array.isArray(value) && Object.getPrototypeOf(value) === Array.prototype;\n}\nconst BSON_VERSION = Symbol.for(\"@@mdb.bson.version\");\n/** The major version of the `bson` this package loads, which every `bson` class instance it can serialise carries. */\nconst BSON_MAJOR = Reflect.get(new MinKey(), BSON_VERSION);\n/** Whether a `bson` class instance comes from the same major version of `bson`, rather than being a look-alike or from another version. */\nfunction createdByBsonMajor(value) {\n\treturn Reflect.get(value, BSON_VERSION) === BSON_MAJOR;\n}\nfunction bsonTypeTag(value) {\n\tconst tag = Reflect.get(value, \"_bsontype\");\n\treturn typeof tag === \"string\" ? tag : void 0;\n}\n/**\n* The `_bsontype` tag of a `bson` class instance. A stored subdocument is read as a plain object even when it has a `_bsontype` key, so a plain object has no tag.\n*/\nfunction bsonClassTag(value) {\n\treturn isPlainObject(value) ? void 0 : bsonTypeTag(value);\n}\nfunction constructorName(value) {\n\tconst name = Reflect.get(value, \"constructor\")?.name;\n\treturn typeof name === \"string\" && name !== \"\" ? name : \"object\";\n}\n/**\n* The `bson` library reads any subdocument with a string `$ref` and an `$id` as a `DBRef`. It was stored as a plain object; these are its entries in stored order, `$ref`, `$id`, `$db` when present, then the other fields.\n*/\nfunction dbRefEntries(value) {\n\tconst ref = blindCast(value);\n\tconst entries = [[\"$ref\", ref.collection], [\"$id\", ref.oid]];\n\tif (ref.db !== void 0) entries.push([\"$db\", ref.db]);\n\tentries.push(...Object.entries(ref.fields));\n\treturn entries;\n}\n//#endregion\n//#region src/core/bson-codec-helpers.ts\nconst BSON_VALUE_TAGS = /* @__PURE__ */ new Set([\n\t\"ObjectId\",\n\t\"Long\",\n\t\"Decimal128\",\n\t\"Binary\",\n\t\"BSONRegExp\",\n\t\"Timestamp\",\n\t\"Int32\",\n\t\"Double\",\n\t\"Code\",\n\t\"MinKey\",\n\t\"MaxKey\",\n\t\"BSONSymbol\"\n]);\nconst ENCODE_FIX_BY_RECEIVED = { DBRef: \"Write it as a { $ref, $id } document instead.\" };\nfunction encodeRefused(received, path) {\n\tconst fix = ENCODE_FIX_BY_RECEIVED[received];\n\tthrow mongoTargetError(\"RUNTIME.ENCODE_FAILED\", `${MONGO_BSON_CODEC_ID} value must be a BSON value; received ${received} at ${where(path)}${fix === void 0 ? \"\" : `. ${fix}`}`, { meta: {\n\t\tcodecId: MONGO_BSON_CODEC_ID,\n\t\treceived,\n\t\tvaluePath: path\n\t} });\n}\nfunction assertBsonValue(value, path, ancestors) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\" || typeof value === \"number\") return;\n\tif (typeof value !== \"object\") {\n\t\tencodeRefused(typeof value, path);\n\t\treturn;\n\t}\n\tconst tag = bsonTypeTag(value);\n\tif (tag !== void 0) {\n\t\tif (!BSON_VALUE_TAGS.has(tag)) encodeRefused(tag, path);\n\t\tif (!createdByBsonMajor(value)) encodeRefused(`${tag} not created by bson ${String(BSON_MAJOR)}`, path);\n\t\treturn;\n\t}\n\tif (value instanceof Date || value instanceof RegExp || value instanceof Uint8Array) return;\n\tif (!isPlainArray(value) && !isPlainObject(value)) {\n\t\tencodeRefused(constructorName(value), path);\n\t\treturn;\n\t}\n\tif (ancestors.has(value)) encodeRefused(\"circular reference\", path);\n\tancestors.add(value);\n\tif (Array.isArray(value)) for (let index = 0; index < value.length; index++) {\n\t\tif (!(index in value)) encodeRefused(\"sparse array hole\", child(path, index));\n\t\tassertBsonValue(value[index], child(path, index), ancestors);\n\t}\n\telse for (const [key, entry] of Object.entries(value)) assertBsonValue(entry, child(path, key), ancestors);\n\tancestors.delete(value);\n}\n/**\n* Returns `value` unchanged when it is a BSON value at every depth, and throws `RUNTIME.ENCODE_FAILED` naming the first value that is not, with its path.\n*/\nfunction encodeBsonValue(value) {\n\tassertBsonValue(value, \"\", /* @__PURE__ */ new Set());\n\treturn value;\n}\n/**\n* A `Code` value with a scope, recognised by its tag: the driver reads with its own load of `bson`, so its `Code` is not an instance of the class imported here.\n*/\nfunction codeWithScope(value) {\n\tif (bsonClassTag(value) !== \"Code\") return void 0;\n\tconst code = Reflect.get(value, \"code\");\n\tconst scope = Reflect.get(value, \"scope\");\n\treturn typeof code === \"string\" && typeof scope === \"object\" && scope !== null ? {\n\t\tcode,\n\t\tscope\n\t} : void 0;\n}\nfunction decodeEntries(entries) {\n\treturn Object.fromEntries(entries.map(([key, entry]) => [key, decodeValue(entry)]));\n}\nfunction decodeValue(value) {\n\tif (typeof value !== \"object\" || value === null) return value;\n\tif (bsonClassTag(value) === \"DBRef\") return decodeEntries(dbRefEntries(value));\n\tif (Array.isArray(value)) {\n\t\tconst decoded = value.map(decodeValue);\n\t\treturn decoded.some((entry, index) => entry !== value[index]) ? decoded : value;\n\t}\n\tconst code = codeWithScope(value);\n\tif (code !== void 0) {\n\t\tconst scope = decodeValue(code.scope);\n\t\treturn scope === code.scope ? value : new Code(code.code, blindCast(scope));\n\t}\n\tif (!isPlainObject(value)) return value;\n\tconst entries = Object.entries(value);\n\tconst decoded = decodeEntries(entries);\n\treturn entries.some(([key, entry]) => decoded[key] !== entry) ? decoded : value;\n}\n/**\n* Returns the wire value as the driver produced it, except that a `DBRef` the `bson` library read from a `{ $ref, $id }` subdocument becomes that document again, `{ $ref, $id[, $db], ...fields }`, with its members' BSON types kept, at any depth and inside a `Code` scope. A value holding no `DBRef` is returned as the same object.\n*/\nfunction decodeBsonValue(wire) {\n\treturn blindCast(decodeValue(wire));\n}\nfunction asDriverWrites(value) {\n\tif (typeof value === \"number\") return Number.isInteger(value) && (value < INT32_RANGE.min || value > INT32_RANGE.max) ? new Double(value) : value;\n\tif (typeof value !== \"object\" || value === null) return value;\n\tif (value instanceof Uint8Array) return new Binary(value);\n\tif (Array.isArray(value)) return value.map(asDriverWrites);\n\tif (isPlainObject(value)) return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, asDriverWrites(entry)]));\n\tconst code = codeWithScope(value);\n\tif (code !== void 0) return new Code(code.code, blindCast(asDriverWrites(code.scope)));\n\treturn value;\n}\n/**\n* Canonical Extended JSON for a BSON value, recording each JavaScript number and `Uint8Array` as the BSON type the driver writes for it: an integer outside the int32 range as a `double`, and bytes as `binData`.\n*/\nfunction bsonToJson(value) {\n\treturn blindCast(EJSON.serialize(asDriverWrites(value), { relaxed: false }));\n}\n/**\n* Reads the canonical Extended JSON `bsonToJson` writes. The `bson` reader also takes forms that are not canonical, some of them silently wrong (`{ \"$numberInt\": \"abc\" }` reads as 0), so a value that does not write back to the same JSON is refused, naming `owner`.\n*/\nfunction readBsonJson(owner, json) {\n\tlet value;\n\ttry {\n\t\tvalue = EJSON.deserialize(blindCast(json), { relaxed: false });\n\t} catch {\n\t\treturn refuseJsonValue(owner, \"canonical Extended JSON\", json);\n\t}\n\tif (!isDeepStrictEqual(EJSON.serialize(value, { relaxed: false }), json)) return refuseJsonValue(owner, \"canonical Extended JSON\", json);\n\treturn value;\n}\n//#endregion\n//#region src/core/data-types.ts\n/** The vector's dimension: the TypeScript type `Vector<n>` and the type's reader read it. */\nconst mongoVectorParams = type({ \"length?\": \"number.integer >= 1\" });\n/** Text as the ObjectId it names; {@link spellObjectIdJson} gives it the lower case the type stores. */\nconst asObjectId = (value) => {\n\tif (typeof value !== \"string\") return refuseWrongShape(value, \"text\");\n\tif (isObjectIdText(value)) return value;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `\"${value}\" is not an ObjectId: write 24 hexadecimal digits.`, {\n\t\twhy: \"An ObjectId is 12 bytes, written as 24 hexadecimal digits.\",\n\t\tfix: \"Write the ObjectId as 24 hexadecimal digits, as in \\\"507f1f77bcf86cd799439011\\\".\"\n\t});\n};\n/** The numbers of a written list as a vector stores them, each finite. */\nfunction vectorElements(elements) {\n\treturn elements.map((element, index) => {\n\t\tconst number = Number(element);\n\t\tif (Number.isFinite(number)) return number;\n\t\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `a vector element is a finite number, and element ${index + 1} is ${String(element)}.`, {\n\t\t\twhy: \"A vector holds finite numbers, as a vector search index reads them.\",\n\t\t\tfix: \"Write each element as a finite number.\"\n\t\t});\n\t});\n}\nconst mongoString = mongoDataType(\"mongo/string\", {\n\tread: (json) => readJsonString(\"mongo/string\", json),\n\tbsonTypes: [\"string\"]\n});\nconst mongoInt32 = mongoDataType(\"mongo/int32\", {\n\tread: (json) => readInt32Json(\"mongo/int32\", json),\n\tbsonTypes: [\"int\"]\n});\nconst mongoInt64 = mongoDataType(\"mongo/int64\", {\n\tread: (json) => readInt64Json(\"mongo/int64\", json),\n\tbsonTypes: [\"long\"],\n\tcasts: { [mongoInt32.id]: asNumeralText }\n});\nconst mongoDecimal128 = mongoDataType(\"mongo/decimal128\", {\n\tread: (json) => readDecimal128Json(\"mongo/decimal128\", json),\n\tspell: spellDecimal128Json,\n\tequalityKey: decimalTextEqualityKey,\n\tbsonTypes: [\"decimal\"],\n\tcasts: {\n\t\t[mongoInt32.id]: asNumeralText,\n\t\t[mongoInt64.id]: castUnchanged\n\t}\n});\nconst mongoDouble = mongoDataType(\"mongo/double\", {\n\tread: (json) => {\n\t\treadJsonFloat(\"mongo/double\", json);\n\t\treturn json;\n\t},\n\tbsonTypes: [\"double\"],\n\tcasts: {\n\t\t[mongoInt32.id]: asFloat,\n\t\t[mongoInt64.id]: asFloat,\n\t\t[mongoDecimal128.id]: asFloat\n\t}\n});\nconst mongoObjectId = mongoDataType(\"mongo/objectid\", {\n\tread: (json) => readObjectIdJson(\"mongo/objectid\", json),\n\tspell: spellObjectIdJson,\n\tbsonTypes: [\"objectId\"],\n\tcasts: { [mongoString.id]: asObjectId }\n});\nconst mongoBool = mongoDataType(\"mongo/bool\", {\n\tread: (json) => readJsonBoolean(\"mongo/bool\", json),\n\tbsonTypes: [\"bool\"]\n});\nconst mongoDate = mongoDataType(\"mongo/date\", {\n\tread: (json) => readDateJson(\"mongo/date\", json),\n\tbsonTypes: [\"date\"]\n});\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\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 { vectorEncode as $, binaryFromBase64 as A, int32Encode as B, constructorName as C, where as D, isPlainObject as E, decimal128Decode as F, int64NumberEncode as G, int64Decode as H, decimal128Encode as I, int64ToJson as J, int64NumberFromDigits as K, decimal128HoldsExactly as L, booleanEncode as M, dateEncode as N, binaryDecode as O, dateToJson as P, stringEncode as Q, decimal128ToJson as R, child as S, isPlainArray as T, int64Encode as U, int32ToJson as V, int64NumberDecode as W, objectIdEncode as X, isBase64Text as Y, objectIdToJson as Z, decodeBsonValue as _, mongoDate as a, bsonClassTag as b, mongoInt32 as c, mongoObjectId as d, mongoString as f, bsonToJson as g, mongoVectorParams as h, mongoDataTypes as i, binaryToBase64 as j, binaryEncode as k, mongoInt64 as l, mongoVector as m, mongoBool as n, mongoDecimal128 as o, mongoTextDataTypes as p, int64NumberToJson as q, mongoBson as r, mongoDouble as s, mongoBinary as t, mongoJson as u, encodeBsonValue as v, dbRefEntries as w, bsonTypeTag as x, readBsonJson as y, doubleEncode as z };\n\n//# sourceMappingURL=data-types-hoKLBrYZ.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,sBAAsB;AAC5B,MAAM,kBAAkB;AACxB,MAAM,cAAc;;;;AAIpB,SAAS,eAAe,OAAO,KAAK;CACnC,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,eAAe,SAAS,MAAM,cAAc;AACnG;AACA,SAAS,OAAO,OAAO;CACtB,OAAO,eAAe,OAAO,MAAM;AACpC;AACA,SAAS,aAAa,OAAO;CAC5B,OAAO,eAAe,OAAO,YAAY;AAC1C;AACA,SAAS,SAAS,OAAO;CACxB,OAAO,eAAe,OAAO,QAAQ;AACtC;AACA,SAAS,aAAa,SAAS,SAAS,UAAU;CACjD,MAAM,iBAAiB,yBAAyB,GAAG,QAAQ,GAAG,WAAW,EAAE,MAAM;EAChF;EACA,UAAU,OAAO;CAClB,EAAE,CAAC;AACJ;AACA,MAAM,yBAAyB;AAC/B,SA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M,YAAY,cAAc,cAAc;CAC7C,OAAO,SAAS,gBAAgB,cAAc,IAAI;CAClD,WAAW,CAAC,MAAM;AACnB,CAAC;AACD,MAAM,YAAY,cAAc,cAAc;CAC7C,OAAO,SAAS,aAAa,cAAc,IAAI;CAC/C,WAAW,CAAC,MAAM;AACnB,CAAC;AACD,MAAM,cAAc,cAAc,gBAAgB;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;AACD;;AAEA,MAAM,qBAAqB,CAAC,YAAY,EAAE"}
@@ -0,0 +1,146 @@
1
+ import { i as MONGO_DATE_CODEC_ID } from "./codec-ids-WdrumsYA-CZVjuKW8.mjs";
2
+ import { A as isBase64Text, B as mongoInt32, G as mongoTextDataTypes, H as mongoJson, L as mongoDate, N as mongoBinary, P as mongoBool, R as mongoDecimal128, V as mongoInt64, W as mongoString, g as decimal128HoldsExactly, z as mongoDouble } from "./data-types-hoKLBrYZ-h9cAgbOy.mjs";
3
+ import { t as mongoTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-BaRbjvD7-D0786_Lv.mjs";
4
+ import { structuredError } from "@prisma/orm-framework/utils/structured-error";
5
+ import { createNumberClassifier, isoDateStringText, numeralText, parseJsonText, printJsonText, signedRange } from "@prisma/orm-framework/components/codec";
6
+ import { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalCodecPreset, temporalTypeAliases } from "@prisma/orm-framework/components/authoring";
7
+ import { singleGeneratorBinding } from "@prisma/orm-framework/components/components";
8
+ //#region ../../../3-targets/mongo/1-target/dist/descriptor-meta-DTj807jv.mjs
9
+ const mongoDateStorage = { codecId: MONGO_DATE_CODEC_ID };
10
+ const mongoAuthoringFieldPresets = { temporal: {
11
+ ...temporalAuthoringPresets(mongoDateStorage),
12
+ timestamp: temporalCodecPreset(mongoDateStorage)
13
+ } };
14
+ const mongoAuthoringTypes = { temporal: temporalTypeAliases(mongoDateStorage, "a JavaScript Date") };
15
+ const classifyAsDecimal = createNumberClassifier({
16
+ integers: [{
17
+ type: mongoInt32.id,
18
+ form: "number",
19
+ ...signedRange(32)
20
+ }, {
21
+ type: mongoInt64.id,
22
+ form: "text",
23
+ ...signedRange(64)
24
+ }],
25
+ largerWhole: {
26
+ type: mongoDecimal128.id,
27
+ form: "text"
28
+ },
29
+ fraction: {
30
+ type: mongoDecimal128.id,
31
+ form: "text"
32
+ },
33
+ words: {
34
+ type: mongoDecimal128.id,
35
+ form: "text"
36
+ }
37
+ });
38
+ /** The type of a written number: a `decimal` only when a Decimal128 holds it exactly, else the `double` nearest it. */
39
+ function classifyMongoNumber(text) {
40
+ const classified = classifyAsDecimal(text);
41
+ if (classified?.type !== mongoDecimal128.id || decimal128HoldsExactly(String(classified.value))) return classified;
42
+ const double = Number(text);
43
+ return Number.isFinite(double) ? {
44
+ type: mongoDouble.id,
45
+ value: double
46
+ } : void 0;
47
+ }
48
+ function printNumber(value) {
49
+ return typeof value === "number" ? numeralText(value) : String(value);
50
+ }
51
+ function base64Text(text) {
52
+ if (isBase64Text(text)) return text;
53
+ throw structuredError("CONTRACT.CAST_REFUSED", `"${text}" is not base64 text: write the bytes in base64, as in binary\`aGVsbG8=\`.`, {
54
+ why: "The binary tag reads bytes as base64, as MongoDB prints them.",
55
+ fix: "Write the bytes in base64, as in binary`aGVsbG8=`."
56
+ });
57
+ }
58
+ function mongoDataTypeEntries() {
59
+ return {
60
+ [mongoString.id]: {
61
+ written: {
62
+ kind: "plain",
63
+ syntax: "string",
64
+ parse: (text) => text
65
+ },
66
+ print: (value) => String(value),
67
+ documentation: "Text."
68
+ },
69
+ [mongoBool.id]: {
70
+ written: {
71
+ kind: "plain",
72
+ syntax: "boolean",
73
+ parse: (text) => text === "true"
74
+ },
75
+ print: (value) => String(value),
76
+ documentation: "A boolean, written true or false."
77
+ },
78
+ [mongoDouble.id]: {
79
+ written: {
80
+ kind: "plain",
81
+ syntax: "number",
82
+ types: [
83
+ mongoInt32.id,
84
+ mongoInt64.id,
85
+ mongoDecimal128.id,
86
+ mongoDouble.id
87
+ ],
88
+ classify: classifyMongoNumber
89
+ },
90
+ print: printNumber,
91
+ documentation: "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."
92
+ },
93
+ [mongoDate.id]: {
94
+ written: {
95
+ kind: "tag",
96
+ tag: "date",
97
+ parse: (text) => isoDateStringText(text, mongoDate.id)
98
+ },
99
+ print: (value) => String(value),
100
+ documentation: "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."
101
+ },
102
+ [mongoBinary.id]: {
103
+ written: {
104
+ kind: "tag",
105
+ tag: "binary",
106
+ parse: base64Text
107
+ },
108
+ print: (value) => String(value),
109
+ documentation: "Bytes, written in base64 as MongoDB prints them, as in binary`aGVsbG8=`."
110
+ },
111
+ [mongoJson.id]: {
112
+ written: {
113
+ kind: "tag",
114
+ tag: "json",
115
+ parse: parseJsonText
116
+ },
117
+ print: printJsonText,
118
+ documentation: "Reads the text as a JSON document and stores it as the value."
119
+ }
120
+ };
121
+ }
122
+ const mongoTargetDescriptorMeta = {
123
+ ...mongoTargetDescriptorMetaRuntime,
124
+ authoring: {
125
+ type: mongoAuthoringTypes,
126
+ field: mongoAuthoringFieldPresets,
127
+ dataTypes: mongoDataTypeEntries(),
128
+ textDataTypes: mongoTextDataTypes
129
+ },
130
+ controlMutationDefaults: {
131
+ defaultFunctionRegistry: /* @__PURE__ */ new Map(),
132
+ generatorDescriptors: [{ id: TIMESTAMP_NOW_GENERATOR_ID }]
133
+ },
134
+ generatorFunctions: [{
135
+ name: "now",
136
+ signature: { documentation: "Writes the current time." },
137
+ bindings: [singleGeneratorBinding({
138
+ codecIds: [MONGO_DATE_CODEC_ID],
139
+ generatorId: TIMESTAMP_NOW_GENERATOR_ID
140
+ })]
141
+ }]
142
+ };
143
+ //#endregion
144
+ export { mongoTargetDescriptorMeta as t };
145
+
146
+ //# sourceMappingURL=descriptor-meta-DTj807jv-CjvK2XDD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor-meta-DTj807jv-CjvK2XDD.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/descriptor-meta-DTj807jv.mjs"],"sourcesContent":["import { i as MONGO_DATE_CODEC_ID } from \"./codec-ids-WdrumsYA.mjs\";\nimport { L as decimal128HoldsExactly, Y as isBase64Text, a as mongoDate, c as mongoInt32, f as mongoString, l as mongoInt64, n as mongoBool, o as mongoDecimal128, p as mongoTextDataTypes, s as mongoDouble, t as mongoBinary, u as mongoJson } from \"./data-types-hoKLBrYZ.mjs\";\nimport { t as mongoTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-BaRbjvD7.mjs\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalCodecPreset, 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 mongoDateStorage = { codecId: MONGO_DATE_CODEC_ID };\nconst mongoAuthoringFieldPresets = { temporal: {\n\t...temporalAuthoringPresets(mongoDateStorage),\n\ttimestamp: temporalCodecPreset(mongoDateStorage)\n} };\nconst mongoAuthoringTypes = { temporal: temporalTypeAliases(mongoDateStorage, \"a JavaScript Date\") };\n//#endregion\n//#region src/core/data-type-entries.ts\nconst classifyAsDecimal = createNumberClassifier({\n\tintegers: [{\n\t\ttype: mongoInt32.id,\n\t\tform: \"number\",\n\t\t...signedRange(32)\n\t}, {\n\t\ttype: mongoInt64.id,\n\t\tform: \"text\",\n\t\t...signedRange(64)\n\t}],\n\tlargerWhole: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t},\n\tfraction: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t},\n\twords: {\n\t\ttype: mongoDecimal128.id,\n\t\tform: \"text\"\n\t}\n});\n/** The type of a written number: a `decimal` only when a Decimal128 holds it exactly, else the `double` nearest it. */\nfunction classifyMongoNumber(text) {\n\tconst classified = classifyAsDecimal(text);\n\tif (classified?.type !== mongoDecimal128.id || decimal128HoldsExactly(String(classified.value))) return classified;\n\tconst double = Number(text);\n\treturn Number.isFinite(double) ? {\n\t\ttype: mongoDouble.id,\n\t\tvalue: double\n\t} : void 0;\n}\nfunction printNumber(value) {\n\treturn typeof value === \"number\" ? numeralText(value) : String(value);\n}\nfunction base64Text(text) {\n\tif (isBase64Text(text)) return text;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `\"${text}\" is not base64 text: write the bytes in base64, as in binary\\`aGVsbG8=\\`.`, {\n\t\twhy: \"The binary tag reads bytes as base64, as MongoDB prints them.\",\n\t\tfix: \"Write the bytes in base64, as in binary`aGVsbG8=`.\"\n\t});\n}\nfunction mongoDataTypeEntries() {\n\treturn {\n\t\t[mongoString.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"string\",\n\t\t\t\tparse: (text) => text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Text.\"\n\t\t},\n\t\t[mongoBool.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"boolean\",\n\t\t\t\tparse: (text) => text === \"true\"\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A boolean, written true or false.\"\n\t\t},\n\t\t[mongoDouble.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"number\",\n\t\t\t\ttypes: [\n\t\t\t\t\tmongoInt32.id,\n\t\t\t\t\tmongoInt64.id,\n\t\t\t\t\tmongoDecimal128.id,\n\t\t\t\t\tmongoDouble.id\n\t\t\t\t],\n\t\t\t\tclassify: classifyMongoNumber\n\t\t\t},\n\t\t\tprint: printNumber,\n\t\t\tdocumentation: \"A number: an int in 32 bits, a long in 64, a decimal when a Decimal128 holds it exactly, NaN and the infinities included, and a double otherwise.\"\n\t\t},\n\t\t[mongoDate.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"date\",\n\t\t\t\tparse: (text) => isoDateStringText(text, mongoDate.id)\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"An instant, as in date`2024-01-01T00:00:00Z`. Reads ISO 8601 with a UTC offset and stores the instant in UTC with three fraction digits, as Date.toISOString() writes it.\"\n\t\t},\n\t\t[mongoBinary.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"binary\",\n\t\t\t\tparse: base64Text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Bytes, written in base64 as MongoDB prints them, as in binary`aGVsbG8=`.\"\n\t\t},\n\t\t[mongoJson.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"json\",\n\t\t\t\tparse: parseJsonText\n\t\t\t},\n\t\t\tprint: printJsonText,\n\t\t\tdocumentation: \"Reads the text as a JSON document and stores it as the value.\"\n\t\t}\n\t};\n}\nconst mongoTargetDescriptorMeta = {\n\t...mongoTargetDescriptorMetaRuntime,\n\tauthoring: {\n\t\ttype: mongoAuthoringTypes,\n\t\tfield: mongoAuthoringFieldPresets,\n\t\tdataTypes: mongoDataTypeEntries(),\n\t\ttextDataTypes: mongoTextDataTypes\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: [{ id: TIMESTAMP_NOW_GENERATOR_ID }]\n\t},\n\tgeneratorFunctions: [{\n\t\tname: \"now\",\n\t\tsignature: { documentation: \"Writes the current time.\" },\n\t\tbindings: [singleGeneratorBinding({\n\t\t\tcodecIds: [MONGO_DATE_CODEC_ID],\n\t\t\tgeneratorId: TIMESTAMP_NOW_GENERATOR_ID\n\t\t})]\n\t}]\n};\n//#endregion\nexport { mongoTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-DTj807jv.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,mBAAmB,EAAE,SAAS,oBAAoB;AACxD,MAAM,6BAA6B,EAAE,UAAU;CAC9C,GAAG,yBAAyB,gBAAgB;CAC5C,WAAW,oBAAoB,gBAAgB;AAChD,EAAE;AACF,MAAM,sBAAsB,EAAE,UAAU,oBAAoB,kBAAkB,mBAAmB,EAAE;AAGnG,MAAM,oBAAoB,uBAAuB;CAChD,UAAU,CAAC;EACV,MAAM,WAAW;EACjB,MAAM;EACN,GAAG,YAAY,EAAE;CAClB,GAAG;EACF,MAAM,WAAW;EACjB,MAAM;EACN,GAAG,YAAY,EAAE;CAClB,CAAC;CACD,aAAa;EACZ,MAAM,gBAAgB;EACtB,MAAM;CACP;CACA,UAAU;EACT,MAAM,gBA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AO;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,OAAO;EACP,WAAW,qBAAqB;EAChC,eAAe;CAChB;CACA,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB,CAAC,EAAE,IAAI,2BAA2B,CAAC;CAC1D;CACA,oBAAoB,CAAC;EACpB,MAAM;EACN,WAAW,EAAE,eAAe,2BAA2B;EACvD,UAAU,CAAC,uBAAuB;GACjC,UAAU,CAAC,mBAAmB;GAC9B,aAAa;EACd,CAAC,CAAC;CACH,CAAC;AACF"}
@@ -0,0 +1,20 @@
1
+ import { I as mongoDataTypes } from "./data-types-hoKLBrYZ-h9cAgbOy.mjs";
2
+ import { n as mongoCodecDescriptors } from "./codecs-B1ab7vfj-QL33tkm2.mjs";
3
+ import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
4
+ //#region ../../../3-targets/mongo/1-target/dist/descriptor-meta-runtime-BaRbjvD7.mjs
5
+ const mongoTargetDescriptorMetaRuntime = {
6
+ kind: "target",
7
+ familyId: "mongo",
8
+ targetId: "mongo",
9
+ id: "mongo",
10
+ version: "0.0.1",
11
+ capabilities: {},
12
+ defaultNamespaceId: UNBOUND_NAMESPACE_ID,
13
+ supportsNamespaces: true,
14
+ dataTypes: mongoDataTypes,
15
+ types: { codecTypes: { codecDescriptors: mongoCodecDescriptors } }
16
+ };
17
+ //#endregion
18
+ export { mongoTargetDescriptorMetaRuntime as t };
19
+
20
+ //# sourceMappingURL=descriptor-meta-runtime-BaRbjvD7-D0786_Lv.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor-meta-runtime-BaRbjvD7-D0786_Lv.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/descriptor-meta-runtime-BaRbjvD7.mjs"],"sourcesContent":["import { i as mongoDataTypes } from \"./data-types-hoKLBrYZ.mjs\";\nimport { n as mongoCodecDescriptors } from \"./codecs-B1ab7vfj.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-BaRbjvD7.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.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as createMongoDriver, t as MongoDriverImpl } from "./mongo-driver-D1lEf5Kl-KPfGUVXK.mjs";
1
+ import { n as createMongoDriver, t as MongoDriverImpl } from "./mongo-driver-CTyvKDUg-Bm9sBrfs.mjs";
2
2
  export { MongoDriverImpl, createMongoDriver };
package/dist/driver.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as MongoDriverImpl, r as createMongoDriver } from "./mongo-driver-CMzJAzeQ-B3Q4RoHN.mjs";
1
+ import { n as MongoDriverImpl, r as createMongoDriver } from "./mongo-driver-Cu6FP6OU-DhOzFM2D.mjs";
2
2
  export { MongoDriverImpl, createMongoDriver };
@@ -1,14 +1,15 @@
1
- import { t as MongoDriverImpl } from "./mongo-driver-D1lEf5Kl-KPfGUVXK.mjs";
2
- import { Db, MongoClient } from "mongodb";
1
+ import { t as MongoDriverImpl } from "./mongo-driver-CTyvKDUg-Bm9sBrfs.mjs";
3
2
  import { ControlDriverDescriptor } from "@prisma/orm-framework/components/control";
3
+ import { Db, MongoClient } from "mongodb";
4
4
  import { MongoControlDriverInstance } from "@prisma/orm-family-mongo/lowering";
5
- //#region ../../../3-mongo-target/3-mongo-driver/dist/control.d.mts
5
+ //#region ../../../3-targets/mongo/3-driver/dist/control.d.mts
6
6
  //#region src/exports/control.d.ts
7
7
  declare class MongoControlDriver extends MongoDriverImpl implements MongoControlDriverInstance {
8
8
  readonly familyId: "mongo";
9
9
  readonly targetId: "mongo";
10
10
  readonly db: Db;
11
11
  constructor(db: Db, mongoClient: MongoClient);
12
+ databaseName(): Promise<string>;
12
13
  }
13
14
  declare const mongoControlDriverDescriptor: ControlDriverDescriptor<'mongo', 'mongo', MongoControlDriver>;
14
15
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"driver__control.d.mts","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/control.d.mts"],"mappings":";;;;;;cAKc,2BAA2B,2BAA2B;WACzD;WACA;WACA,IAAI;EACb,YAAY,IAAI,IAAI,aAAa;;cAErB,8BAA8B,0CAA0C"}
1
+ {"version":3,"file":"driver__control.d.mts","names":[],"sources":["../../../../3-targets/mongo/3-driver/dist/control.d.mts"],"mappings":";;;;;;cAKc,2BAA2B,2BAA2B;WACzD;WACA;WACA,IAAI;EACb,YAAY,IAAI,IAAI,aAAa;EACjC,gBAAgB;;cAEJ,8BAA8B,0CAA0C"}
@@ -1,8 +1,8 @@
1
- import { n as MongoDriverImpl, t as DRIVER_INFO } from "./mongo-driver-CMzJAzeQ-B3Q4RoHN.mjs";
1
+ import { n as MongoDriverImpl, t as DRIVER_INFO } from "./mongo-driver-Cu6FP6OU-DhOzFM2D.mjs";
2
2
  import { MongoClient } from "mongodb";
3
3
  import { errorRuntime } from "@prisma/orm-framework/errors/execution";
4
4
  import { redactDatabaseUrl } from "@prisma/orm-framework/utils/redact-db-url";
5
- //#region ../../../3-mongo-target/3-mongo-driver/dist/control.mjs
5
+ //#region ../../../3-targets/mongo/3-driver/dist/control.mjs
6
6
  var MongoControlDriver = class extends MongoDriverImpl {
7
7
  familyId = "mongo";
8
8
  targetId = "mongo";
@@ -11,6 +11,9 @@ var MongoControlDriver = class extends MongoDriverImpl {
11
11
  super(db, mongoClient);
12
12
  this.db = db;
13
13
  }
14
+ async databaseName() {
15
+ return this.db.databaseName;
16
+ }
14
17
  };
15
18
  const mongoControlDriverDescriptor = {
16
19
  kind: "driver",
@@ -1 +1 @@
1
- {"version":3,"file":"driver__control.mjs","names":[],"sources":["../../../../3-mongo-target/3-mongo-driver/dist/control.mjs"],"sourcesContent":["import { r as DRIVER_INFO, t as MongoDriverImpl } from \"./mongo-driver-CMzJAzeQ.mjs\";\nimport { MongoClient } from \"mongodb\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\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};\nconst mongoControlDriverDescriptor = {\n\tkind: \"driver\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: DRIVER_INFO.version,\n\tcapabilities: {},\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;AACD;AACA,MAAM,+BAA+B;CACpC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS,YAAY;CACrB,cAAc,CAAC;CACf,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
+ {"version":3,"file":"driver__control.mjs","names":[],"sources":["../../../../3-targets/mongo/3-driver/dist/control.mjs"],"sourcesContent":["import { r as DRIVER_INFO, t as MongoDriverImpl } from \"./mongo-driver-Cu6FP6OU.mjs\";\nimport { MongoClient } from \"mongodb\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\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\tkind: \"driver\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: DRIVER_INFO.version,\n\tcapabilities: {},\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,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS,YAAY;CACrB,cAAc,CAAC;CACf,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,11 +1,13 @@
1
- import { n as CollModMeta } from "./op-factory-call-B7EKa4Ri-B2Lb6W68.mjs";
2
- import { CollModOptions, CreateCollectionOptions, CreateIndexOptions, MongoDataTransformOperation, MongoFilterExpr, MongoIndexKey, MongoMigrationPlanOperation } from "@prisma/orm-family-mongo/query-ast/control";
1
+ import { n as CollModMeta } from "./op-factory-call-BoYr7vvM-CjA8nx36.mjs";
2
+ import "@prisma/orm-family-mongo/schema-ir";
3
+ import { CollModOptions, CreateCollectionOptions, CreateIndexOptions, MongoDmlOperation, MongoFilterExpr, MongoIndexKey, MongoMigrationPlanOperation } from "@prisma/orm-family-mongo/query-ast/control";
3
4
  import { MongoQueryPlan } from "@prisma/orm-family-mongo/query-ast/execution";
4
5
  import { MigrationCLI } from "@prisma/orm-toolchain/cli/migration-cli";
5
6
  import { placeholder } from "@prisma/orm-framework/errors/migration";
6
7
  import { Migration } from "@prisma/orm-family-mongo/family/migration";
7
- //#region ../../../3-mongo-target/1-mongo-target/dist/migration.d.mts
8
- //#region src/core/migration-factories.d.ts
8
+ import { Document } from "@prisma/orm-family-mongo/value";
9
+ //#region ../../../3-targets/mongo/1-target/dist/migration.d.mts
10
+ //#region src/core/migrations/migration-factories.d.ts
9
11
  interface Buildable {
10
12
  build(): MongoQueryPlan;
11
13
  }
@@ -23,11 +25,17 @@ declare function dataTransform(name: string, options: {
23
25
  description?: string;
24
26
  };
25
27
  run: () => MongoQueryPlan | Buildable;
26
- }): MongoDataTransformOperation;
28
+ }): MongoDmlOperation;
29
+ interface FieldRewriteOptions {
30
+ readonly filter?: Document;
31
+ }
32
+ declare function renameField(collectionName: string, from: string, to: string, options?: FieldRewriteOptions): MongoDmlOperation;
33
+ declare function unsetField(collectionName: string, field: string, options?: FieldRewriteOptions): MongoDmlOperation;
27
34
  declare function createIndex(collectionName: string, keys: ReadonlyArray<MongoIndexKey>, options?: CreateIndexOptions): MongoMigrationPlanOperation;
28
35
  declare function dropIndex(collectionName: string, keys: ReadonlyArray<MongoIndexKey>): MongoMigrationPlanOperation;
29
36
  declare function createCollection(collectionName: string, options?: CreateCollectionOptions): MongoMigrationPlanOperation;
30
37
  declare function dropCollection(collectionName: string): MongoMigrationPlanOperation;
38
+ declare function renameCollection(from: string, to: string): MongoMigrationPlanOperation;
31
39
  declare function setValidation(collectionName: string, schema: Record<string, unknown>, options?: {
32
40
  validationLevel?: 'strict' | 'moderate';
33
41
  validationAction?: 'error' | 'warn';
@@ -38,5 +46,5 @@ declare function validatedCollection(name: string, schema: Record<string, unknow
38
46
  unique?: boolean;
39
47
  }>): MongoMigrationPlanOperation[];
40
48
  //#endregion
41
- export { createIndex as a, dropIndex as c, validatedCollection as d, createCollection as i, placeholder as l, MigrationCLI as n, dataTransform as o, collMod as r, dropCollection as s, Migration as t, setValidation as u };
42
- //# sourceMappingURL=migration-BkqcE2Uv.d.mts.map
49
+ export { createIndex as a, dropIndex as c, renameField as d, setValidation as f, createCollection as i, placeholder as l, validatedCollection as m, MigrationCLI as n, dataTransform as o, unsetField as p, collMod as r, dropCollection as s, Migration as t, renameCollection as u };
50
+ //# sourceMappingURL=migration-C4m4Uj8E.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-C4m4Uj8E.d.mts","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/migration.d.mts"],"mappings":";;;;;;;;;;UASU;EACR,SAAS;;iBAEM,cAAc,cAAc;;;;;;EAM3C;EACA;IACE,cAAc,iBAAiB;IAC/B,SAAS;IACT;IACA;;EAEF,WAAW,iBAAiB;IAC1B;UACM;WACC,SAAS;;iBAEH,YAAY,wBAAwB,cAAc,YAAY,UAAU,sBAAsB;iBAC9F,WAAW,wBAAwB,eAAe,UAAU,sBAAsB;iBAClF,YAAY,wBAAwB,MAAM,cAAc,gBAAgB,UAAU,qBAAqB;iBACvG,UAAU,wBAAwB,MAAM,cAAc,iBAAiB;iBACvE,iBAAiB,wBAAwB,UAAU,0BAA0B;iBAC7E,eAAe,yBAAyB;iBACxC,iBAAiB,cAAc,aAAa;iBAC5C,cAAc,wBAAwB,QAAQ,yBAAyB;EACtF;EACA;IACE;iBACa,QAAQ,wBAAwB,SAAS,gBAAgB,OAAO,cAAc;iBAC9E,oBAAoB,cAAc,QAAQ,yBAAyB,SAAS;EAC3F,MAAM;EACN;KACG"}