@prisma/orm-target-mongo 8.0.0-rc.22-dev.12 → 8.0.0-rc.22-dev.13

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 (31) hide show
  1. package/dist/adapter__control.mjs +2 -1
  2. package/dist/adapter__control.mjs.map +1 -1
  3. package/dist/{control-kV8BDwKp.d.mts → control-1-RnMe4V.d.mts} +2 -2
  4. package/dist/{control-kV8BDwKp.d.mts.map → control-1-RnMe4V.d.mts.map} +1 -1
  5. package/dist/{control-1k8tG3h1.mjs → control-BSgJpq4Q.mjs} +47 -15
  6. package/dist/control-BSgJpq4Q.mjs.map +1 -0
  7. package/dist/{control-D8Kgvgj-.mjs → control-BYwTiwZU.mjs} +2 -2
  8. package/dist/{control-D8Kgvgj-.mjs.map → control-BYwTiwZU.mjs.map} +1 -1
  9. package/dist/driver.mjs +1 -1
  10. package/dist/driver__control.mjs +1 -1
  11. package/dist/driver__runtime.mjs +1 -1
  12. package/dist/driver__runtime.mjs.map +1 -1
  13. package/dist/{migration-CoPXNa95.d.mts → migration-BMUh33vn.d.mts} +9 -3
  14. package/dist/migration-BMUh33vn.d.mts.map +1 -0
  15. package/dist/{migration-factories-DImj1ZN5-BtCob_1N.mjs → migration-factories-CUyEIo5p-CXTwpgxe.mjs} +45 -27
  16. package/dist/migration-factories-CUyEIo5p-CXTwpgxe.mjs.map +1 -0
  17. package/dist/{mongo-driver-BJvIDiR4-D_8csOWl.mjs → mongo-driver-CAx_Xcbh-D8PU1jaK.mjs} +3 -3
  18. package/dist/{mongo-driver-BJvIDiR4-D_8csOWl.mjs.map → mongo-driver-CAx_Xcbh-D8PU1jaK.mjs.map} +1 -1
  19. package/dist/{op-factory-call-BoYr7vvM-CEACROK1.d.mts → op-factory-call-DzQ_ZxeZ-CukKyuhZ.d.mts} +12 -7
  20. package/dist/op-factory-call-DzQ_ZxeZ-CukKyuhZ.d.mts.map +1 -0
  21. package/dist/target.d.mts +4 -4
  22. package/dist/target.mjs +2 -2
  23. package/dist/target__control.d.mts +3 -3
  24. package/dist/target__control.mjs +1 -1
  25. package/dist/target__migration.d.mts +1 -1
  26. package/dist/target__migration.mjs +1 -1
  27. package/package.json +9 -9
  28. package/dist/control-1k8tG3h1.mjs.map +0 -1
  29. package/dist/migration-CoPXNa95.d.mts.map +0 -1
  30. package/dist/migration-factories-DImj1ZN5-BtCob_1N.mjs.map +0 -1
  31. package/dist/op-factory-call-BoYr7vvM-CEACROK1.d.mts.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { t as mongoTargetError } from "./mongo-target-errors-Btf3ML1w-QOtEG7EX.mjs";
2
2
  import { blindCast } from "@prisma/orm-framework/utils/casts";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
- import { MONGO_INDEX_OPTION_KEYS } from "@prisma/orm-family-mongo/contract";
5
- import { CollModCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, RenameCollectionCommand, buildIndexOpId, defaultMongoIndexName, keysToKeySpec } from "@prisma/orm-family-mongo/query-ast/control";
4
+ import { MONGO_INDEX_OPTION_KEYS, defaultMongoIndexName } from "@prisma/orm-family-mongo/contract";
5
+ import { CollModCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, RenameCollectionCommand, buildIndexOpId, keysToKeySpec } from "@prisma/orm-family-mongo/query-ast/control";
6
6
  import { RawAggregateCommand, RawUpdateManyCommand } from "@prisma/orm-family-mongo/query-ast/execution";
7
7
  import { createFieldAccessor } from "@prisma/orm-family-mongo/query-builder";
8
8
  import { collection } from "@prisma/orm-family-mongo/query-builder/contract-free";
9
- //#region ../../../3-targets/mongo/1-target/dist/migration-factories-DImj1ZN5.mjs
9
+ //#region ../../../3-targets/mongo/1-target/dist/migration-factories-CUyEIo5p.mjs
10
10
  function isBuildable(value) {
11
11
  if (typeof value !== "object" || value === null || !("build" in value)) return false;
12
12
  return typeof Reflect.get(value, "build") === "function";
@@ -164,11 +164,17 @@ function unsetField(collectionName, field, options) {
164
164
  function formatKeys(keys) {
165
165
  return keys.map((k) => `${k.field}:${k.direction}`).join(", ");
166
166
  }
167
- /** What an index check matches, which is the index's keys and collection, not its name. */
167
+ /** What an index content check matches: the index's keys and options in its collection, whatever its name. */
168
168
  function indexObject(collectionName, keys) {
169
169
  if (isTextIndex(keys)) return `a text index in "${collectionName}"`;
170
170
  return `an index on { ${keys.map((key) => `${key.field}: ${JSON.stringify(key.direction)}`).join(", ")} } in "${collectionName}"`;
171
171
  }
172
+ function namedIndexObject(collectionName, name) {
173
+ return `an index named "${name}" in "${collectionName}"`;
174
+ }
175
+ function nameFilter(name) {
176
+ return MongoFieldFilter.eq("name", name);
177
+ }
172
178
  function isTextIndex(keys) {
173
179
  return keys.some((k) => k.direction === "text");
174
180
  }
@@ -226,59 +232,71 @@ function indexDefinitionFilter(keys, options) {
226
232
  }
227
233
  const TEXT_INDEX_DEFAULT_LANGUAGE = "english";
228
234
  const TEXT_INDEX_DEFAULT_LANGUAGE_OVERRIDE = "language";
235
+ /**
236
+ * Creates an index under `options.name`, or under the name MongoDB would give it when the call gives none. The precheck requires that the collection holds no index with that name and none with the same keys and options; the postcheck requires an index with that name, keys and options.
237
+ */
229
238
  function createIndex(collectionName, keys, options) {
230
- const name = defaultMongoIndexName(keys);
231
- const filter = keyFilter(keys);
239
+ const name = options?.name ?? defaultMongoIndexName(keys);
240
+ const definition = indexDefinitionFilter(keys, options);
232
241
  return {
233
- id: buildIndexOpId("create", collectionName, keys),
234
- label: `Create index on ${collectionName} (${formatKeys(keys)})`,
242
+ id: buildIndexOpId("create", collectionName, name),
243
+ label: `Create index ${name} on ${collectionName} (${formatKeys(keys)})`,
235
244
  operationClass: "additive",
236
245
  precheck: [{
237
- description: `index does not already exist on ${collectionName}`,
246
+ description: `no index named ${name} exists on ${collectionName}`,
238
247
  source: new ListIndexesCommand(collectionName),
239
- filter,
248
+ filter: nameFilter(name),
249
+ expect: "notExists",
250
+ object: namedIndexObject(collectionName, name)
251
+ }, {
252
+ description: `no index with the same keys and options exists on ${collectionName}`,
253
+ source: new ListIndexesCommand(collectionName),
254
+ filter: definition,
240
255
  expect: "notExists",
241
256
  object: indexObject(collectionName, keys)
242
257
  }],
243
258
  execute: [{
244
- description: `create index on ${collectionName}`,
259
+ description: `create index ${name} on ${collectionName}`,
245
260
  command: collection(collectionName).createIndex(keys, {
246
261
  ...options,
247
262
  name
248
263
  })
249
264
  }],
250
265
  postcheck: [{
251
- description: `index exists on ${collectionName}`,
266
+ description: `index ${name} exists on ${collectionName}`,
252
267
  source: new ListIndexesCommand(collectionName),
253
- filter: indexDefinitionFilter(keys, options),
268
+ filter: MongoAndExpr.of([nameFilter(name), definition]),
254
269
  expect: "exists"
255
270
  }]
256
271
  };
257
272
  }
258
- function dropIndex(collectionName, keys) {
259
- const indexName = defaultMongoIndexName(keys);
260
- const filter = keyFilter(keys);
273
+ /**
274
+ * Drops the index named `options.name`, or the name MongoDB would give the keys when the call gives none. `options` lists every option the index has, as `migration plan` writes them: the precheck requires an index with that name, those keys and exactly those options, so an option left out must be absent from the index. A call without options checks the keys only. The postcheck requires that no index with that name is left.
275
+ */
276
+ function dropIndex(collectionName, keys, options) {
277
+ const name = options?.name ?? defaultMongoIndexName(keys);
278
+ const content = options === void 0 ? keyFilter(keys) : indexDefinitionFilter(keys, options);
261
279
  return {
262
- id: buildIndexOpId("drop", collectionName, keys),
263
- label: `Drop index on ${collectionName} (${formatKeys(keys)})`,
280
+ id: buildIndexOpId("drop", collectionName, name),
281
+ label: `Drop index ${name} on ${collectionName} (${formatKeys(keys)})`,
264
282
  operationClass: "widening",
265
283
  precheck: [{
266
- description: `index exists on ${collectionName}`,
284
+ description: `index ${name} exists on ${collectionName} with the expected keys and options`,
267
285
  source: new ListIndexesCommand(collectionName),
268
- filter,
286
+ filter: MongoAndExpr.of([nameFilter(name), content]),
269
287
  expect: "exists",
270
- object: indexObject(collectionName, keys)
288
+ object: namedIndexObject(collectionName, name)
271
289
  }],
272
290
  execute: [{
273
- description: `drop index on ${collectionName}`,
274
- command: new DropIndexCommand(collectionName, indexName)
291
+ description: `drop index ${name} on ${collectionName}`,
292
+ command: new DropIndexCommand(collectionName, name)
275
293
  }],
276
294
  postcheck: [{
277
- description: `index no longer exists on ${collectionName}`,
295
+ description: `index ${name} no longer exists on ${collectionName}`,
278
296
  source: new ListIndexesCommand(collectionName),
279
- filter,
297
+ filter: nameFilter(name),
280
298
  expect: "notExists",
281
- object: indexObject(collectionName, keys)
299
+ object: namedIndexObject(collectionName, name)
282
300
  }]
283
301
  };
284
302
  }
@@ -403,4 +421,4 @@ function validatedCollection(name, schema, indexes) {
403
421
  //#endregion
404
422
  export { dropCollection as a, renameField as c, unsetField as d, validatedCollection as f, dataTransform as i, setValidation as l, createCollection as n, dropIndex as o, createIndex as r, renameCollection as s, collMod as t, unrewritableFieldNameReason as u };
405
423
 
406
- //# sourceMappingURL=migration-factories-DImj1ZN5-BtCob_1N.mjs.map
424
+ //# sourceMappingURL=migration-factories-CUyEIo5p-CXTwpgxe.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-factories-CUyEIo5p-CXTwpgxe.mjs","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/migration-factories-CUyEIo5p.mjs"],"sourcesContent":["import { t as mongoTargetError } from \"./mongo-target-errors-Btf3ML1w.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { MONGO_INDEX_OPTION_KEYS, defaultMongoIndexName } from \"@internal/mongo-contract\";\nimport { CollModCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoFieldFilter, MongoNotExpr, RenameCollectionCommand, buildIndexOpId, keysToKeySpec } from \"@internal/mongo-query-ast/control\";\nimport { RawAggregateCommand, RawUpdateManyCommand } from \"@internal/mongo-query-ast/execution\";\nimport { createFieldAccessor } from \"@internal/mongo-query-builder\";\nimport { collection } from \"@internal/mongo-query-builder/contract-free\";\n//#region src/core/migrations/migration-factories.ts\nfunction isBuildable(value) {\n\tif (typeof value !== \"object\" || value === null || !(\"build\" in value)) return false;\n\treturn typeof Reflect.get(value, \"build\") === \"function\";\n}\nfunction resolveQuery(value) {\n\treturn isBuildable(value) ? value.build() : value;\n}\nconst MATCH_ALL_FILTER = MongoExistsExpr.exists(\"_id\");\nfunction dataTransform(name, options) {\n\tlet precheck = [];\n\tlet postcheck = [];\n\tif (options.check) {\n\t\tconst source = resolveQuery(options.check.source());\n\t\tconst filter = options.check.filter ?? MATCH_ALL_FILTER;\n\t\tconst description = options.check.description ?? `Check for data transform: ${name}`;\n\t\tconst precheckExpect = options.check.expect ?? \"exists\";\n\t\tconst postcheckExpect = precheckExpect === \"exists\" ? \"notExists\" : \"exists\";\n\t\tprecheck = [{\n\t\t\tdescription,\n\t\t\tsource,\n\t\t\tfilter,\n\t\t\texpect: precheckExpect\n\t\t}];\n\t\tpostcheck = [{\n\t\t\tdescription,\n\t\t\tsource,\n\t\t\tfilter,\n\t\t\texpect: postcheckExpect\n\t\t}];\n\t}\n\tconst run = [resolveQuery(options.run())];\n\treturn {\n\t\tid: `data_transform.${name}`,\n\t\tlabel: `Data transform: ${name}`,\n\t\toperationClass: \"data\",\n\t\tname,\n\t\t...ifDefined(\"invariantId\", options.invariantId),\n\t\tprecheck,\n\t\trun,\n\t\tpostcheck\n\t};\n}\nconst REWRITE_PLAN_META = {\n\ttarget: \"mongo\",\n\tstorageHash: \"\",\n\tlane: \"mongo-raw\"\n};\nfunction documentsHolding(fields, filter) {\n\tconst conditions = [...filter === void 0 ? [] : [filter], ...fields.map((field) => ({ [field]: { $exists: true } }))];\n\tconst [only] = conditions;\n\treturn conditions.length === 1 && only !== void 0 ? only : { $and: conditions };\n}\nconst UNREWRITABLE_FIELD_NAMES = [\n\t{\n\t\tmatches: (field) => field === \"\",\n\t\treason: \"it is empty\"\n\t},\n\t{\n\t\tmatches: (field) => field === \"_id\",\n\t\treason: \"MongoDB does not let a document change its _id\"\n\t},\n\t{\n\t\tmatches: (field) => field.includes(\".\"),\n\t\treason: \"MongoDB reads a name containing \\\".\\\" as a path into embedded documents\"\n\t},\n\t{\n\t\tmatches: (field) => field.startsWith(\"$\"),\n\t\treason: \"MongoDB reads a name starting with \\\"$\\\" as an operator\"\n\t}\n];\n/** Why `renameField` and `unsetField` cannot rewrite a field of this name, if they cannot. */\nfunction unrewritableFieldNameReason(field) {\n\treturn UNREWRITABLE_FIELD_NAMES.find((rule) => rule.matches(field))?.reason;\n}\nfunction assertRewritableField(collectionName, field) {\n\tconst reason = unrewritableFieldNameReason(field);\n\tif (reason === void 0) return;\n\tthrow mongoTargetError(\"MIGRATION.FIELD_NAME_UNSUPPORTED\", `Field \"${field}\" in collection ${collectionName} cannot be rewritten: ${reason}.`, { meta: {\n\t\tcollection: collectionName,\n\t\tfield,\n\t\treason\n\t} });\n}\nfunction rewritePlan(collectionName, command) {\n\treturn {\n\t\tcollection: collectionName,\n\t\tcommand,\n\t\tmeta: { ...REWRITE_PLAN_META }\n\t};\n}\nfunction noDocumentHolds(collectionName, fields, filter) {\n\treturn {\n\t\tdescription: `no document in ${collectionName} holds ${fields.length === 1 ? fields[0] : `both ${fields.join(\" and \")}`}`,\n\t\tsource: rewritePlan(collectionName, new RawAggregateCommand(collectionName, [{ $match: documentsHolding(fields, filter) }, { $limit: 1 }])),\n\t\tfilter: MATCH_ALL_FILTER,\n\t\texpect: \"notExists\"\n\t};\n}\nfunction rewriteUpdate(collectionName, field, filter, update) {\n\treturn rewritePlan(collectionName, new RawUpdateManyCommand(collectionName, documentsHolding([field], filter), update, { bypassDocumentValidation: true }));\n}\nfunction idSuffix(filter) {\n\treturn filter === void 0 ? \"\" : `.where(${JSON.stringify(filter)})`;\n}\nfunction valueList(values) {\n\treturn values.map((value) => JSON.stringify(value)).join(\", \");\n}\n/** A field condition in words: `type is \"bug\"`, `type is not \"bug\"`, `type is none of \"bug\", \"task\"`. */\nfunction conditionInWords(field, condition) {\n\tconst excluded = typeof condition === \"object\" && condition !== null && !Array.isArray(condition) ? Reflect.get(condition, \"$nin\") : void 0;\n\tif (Array.isArray(excluded)) return excluded.length === 1 ? `${field} is not ${valueList(excluded)}` : `${field} is none of ${valueList(excluded)}`;\n\treturn typeof condition === \"object\" && condition !== null ? void 0 : `${field} is ${JSON.stringify(condition)}`;\n}\n/** The documents a filter selects, in words where the planner wrote it, for an operation's label. */\nfunction labelSuffix(filter) {\n\tif (filter === void 0) return \"\";\n\tconst words = Object.entries(filter).map(([field, condition]) => conditionInWords(field, condition));\n\treturn words.every((word) => word !== void 0) && words.length > 0 ? ` in documents whose ${words.join(\" and \")}` : ` in documents matching ${JSON.stringify(filter)}`;\n}\nfunction renameField(collectionName, from, to, options) {\n\tassertRewritableField(collectionName, from);\n\tassertRewritableField(collectionName, to);\n\tif (from === to) throw mongoTargetError(\"MIGRATION.INVALID_OPERATION_ENTRY\", `renameField renames field \"${from}\" in collection ${collectionName} to its own name.`, { meta: {\n\t\tcontext: \"renameField\",\n\t\tcollection: collectionName,\n\t\tfield: from,\n\t\treason: \"the new name is the old name\"\n\t} });\n\tconst filter = options?.filter;\n\tconst id = `field.${collectionName}.${from}.rename(${to})${idSuffix(filter)}`;\n\treturn {\n\t\tid,\n\t\tlabel: `Rename field ${from} to ${to} in collection ${collectionName}${labelSuffix(filter)}`,\n\t\toperationClass: \"widening\",\n\t\tname: id,\n\t\tprecheck: [noDocumentHolds(collectionName, [from, to], filter)],\n\t\trun: [rewriteUpdate(collectionName, from, filter, { $rename: { [from]: to } })],\n\t\tpostcheck: [noDocumentHolds(collectionName, [from], filter)]\n\t};\n}\nfunction unsetField(collectionName, field, options) {\n\tassertRewritableField(collectionName, field);\n\tconst filter = options?.filter;\n\tconst id = `field.${collectionName}.${field}.unset${idSuffix(filter)}`;\n\treturn {\n\t\tid,\n\t\tlabel: `Remove field ${field} from collection ${collectionName}${labelSuffix(filter)}`,\n\t\toperationClass: \"destructive\",\n\t\tname: id,\n\t\tprecheck: [],\n\t\trun: [rewriteUpdate(collectionName, field, filter, { $unset: { [field]: \"\" } })],\n\t\tpostcheck: [noDocumentHolds(collectionName, [field], filter)]\n\t};\n}\nfunction formatKeys(keys) {\n\treturn keys.map((k) => `${k.field}:${k.direction}`).join(\", \");\n}\n/** What an index content check matches: the index's keys and options in its collection, whatever its name. */\nfunction indexObject(collectionName, keys) {\n\tif (isTextIndex(keys)) return `a text index in \"${collectionName}\"`;\n\treturn `an index on { ${keys.map((key) => `${key.field}: ${JSON.stringify(key.direction)}`).join(\", \")} } in \"${collectionName}\"`;\n}\nfunction namedIndexObject(collectionName, name) {\n\treturn `an index named \"${name}\" in \"${collectionName}\"`;\n}\nfunction nameFilter(name) {\n\treturn MongoFieldFilter.eq(\"name\", name);\n}\nfunction isTextIndex(keys) {\n\treturn keys.some((k) => k.direction === \"text\");\n}\nfunction keyFilter(keys) {\n\tconst f = createFieldAccessor();\n\treturn isTextIndex(keys) ? f.rawPath(\"key._fts\").eq(\"text\") : f.key.eq(blindCast(keysToKeySpec(keys)));\n}\nfunction documentValue(document) {\n\treturn blindCast(document);\n}\n/** MongoDB stores a text index's text fields as `_fts` and `_ftsx` in the place of the first one. */\nfunction textIndexKeySpec(keys) {\n\tconst spec = {};\n\tfor (const key of keys) if (key.direction !== \"text\") spec[key.field] = key.direction;\n\telse if (!Object.hasOwn(spec, \"_fts\")) Object.assign(spec, {\n\t\t_fts: \"text\",\n\t\t_ftsx: 1\n\t});\n\treturn spec;\n}\n/** MongoDB lists every text field's weight, 1 when none is given, ordered by field name. */\nfunction textIndexWeights(keys, weights) {\n\tconst fields = keys.filter((key) => key.direction === \"text\").map((key) => key.field);\n\treturn Object.fromEntries(fields.sort().map((field) => [field, weights?.[field] ?? 1]));\n}\nfunction flagFilter(field, on) {\n\tconst set = MongoFieldFilter.eq(field, true);\n\treturn on ? set : new MongoNotExpr(set);\n}\nfunction optionFilter(field, value) {\n\treturn value === void 0 ? MongoExistsExpr.notExists(field) : MongoFieldFilter.eq(field, value);\n}\n/**\n* MongoDB completes a collation with its defaults, so only the fields the call gives are compared, as\n* the verifier does. An index with no collation must have none.\n*/\nfunction collationFilters(collation) {\n\tif (collation === void 0) return [MongoExistsExpr.notExists(\"collation\")];\n\treturn Object.entries(collation).map(([option, value]) => MongoFieldFilter.eq(`collation.${option}`, blindCast(value)));\n}\nconst textIndexOnly = (filter) => (options, keys) => isTextIndex(keys) ? filter(options, keys) : [];\nconst INDEX_OPTION_FILTERS = {\n\tunique: (options) => [flagFilter(\"unique\", options?.unique)],\n\tsparse: (options) => [flagFilter(\"sparse\", options?.sparse)],\n\texpireAfterSeconds: (options) => [optionFilter(\"expireAfterSeconds\", options?.expireAfterSeconds)],\n\tpartialFilterExpression: (options) => [optionFilter(\"partialFilterExpression\", options?.partialFilterExpression && documentValue(options.partialFilterExpression))],\n\twildcardProjection: (options) => [optionFilter(\"wildcardProjection\", options?.wildcardProjection && documentValue(options.wildcardProjection))],\n\tcollation: (options) => collationFilters(options?.collation),\n\tweights: textIndexOnly((options, keys) => [MongoFieldFilter.eq(\"weights\", documentValue(textIndexWeights(keys, options?.weights)))]),\n\tdefault_language: textIndexOnly((options) => [MongoFieldFilter.eq(\"default_language\", options?.default_language ?? TEXT_INDEX_DEFAULT_LANGUAGE)]),\n\tlanguage_override: textIndexOnly((options) => [MongoFieldFilter.eq(\"language_override\", options?.language_override ?? TEXT_INDEX_DEFAULT_LANGUAGE_OVERRIDE)])\n};\nfunction indexDefinitionFilter(keys, options) {\n\treturn MongoAndExpr.of([isTextIndex(keys) ? MongoFieldFilter.eq(\"key\", documentValue(textIndexKeySpec(keys))) : keyFilter(keys), ...MONGO_INDEX_OPTION_KEYS.flatMap((option) => INDEX_OPTION_FILTERS[option](options, keys))]);\n}\nconst TEXT_INDEX_DEFAULT_LANGUAGE = \"english\";\nconst TEXT_INDEX_DEFAULT_LANGUAGE_OVERRIDE = \"language\";\n/**\n* Creates an index under `options.name`, or under the name MongoDB would give it when the call gives none. The precheck requires that the collection holds no index with that name and none with the same keys and options; the postcheck requires an index with that name, keys and options.\n*/\nfunction createIndex(collectionName, keys, options) {\n\tconst name = options?.name ?? defaultMongoIndexName(keys);\n\tconst definition = indexDefinitionFilter(keys, options);\n\treturn {\n\t\tid: buildIndexOpId(\"create\", collectionName, name),\n\t\tlabel: `Create index ${name} on ${collectionName} (${formatKeys(keys)})`,\n\t\toperationClass: \"additive\",\n\t\tprecheck: [{\n\t\t\tdescription: `no index named ${name} exists on ${collectionName}`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter: nameFilter(name),\n\t\t\texpect: \"notExists\",\n\t\t\tobject: namedIndexObject(collectionName, name)\n\t\t}, {\n\t\t\tdescription: `no index with the same keys and options exists on ${collectionName}`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter: definition,\n\t\t\texpect: \"notExists\",\n\t\t\tobject: indexObject(collectionName, keys)\n\t\t}],\n\t\texecute: [{\n\t\t\tdescription: `create index ${name} on ${collectionName}`,\n\t\t\tcommand: collection(collectionName).createIndex(keys, {\n\t\t\t\t...options,\n\t\t\t\tname\n\t\t\t})\n\t\t}],\n\t\tpostcheck: [{\n\t\t\tdescription: `index ${name} exists on ${collectionName}`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter: MongoAndExpr.of([nameFilter(name), definition]),\n\t\t\texpect: \"exists\"\n\t\t}]\n\t};\n}\n/**\n* Drops the index named `options.name`, or the name MongoDB would give the keys when the call gives none. `options` lists every option the index has, as `migration plan` writes them: the precheck requires an index with that name, those keys and exactly those options, so an option left out must be absent from the index. A call without options checks the keys only. The postcheck requires that no index with that name is left.\n*/\nfunction dropIndex(collectionName, keys, options) {\n\tconst name = options?.name ?? defaultMongoIndexName(keys);\n\tconst content = options === void 0 ? keyFilter(keys) : indexDefinitionFilter(keys, options);\n\treturn {\n\t\tid: buildIndexOpId(\"drop\", collectionName, name),\n\t\tlabel: `Drop index ${name} on ${collectionName} (${formatKeys(keys)})`,\n\t\toperationClass: \"widening\",\n\t\tprecheck: [{\n\t\t\tdescription: `index ${name} exists on ${collectionName} with the expected keys and options`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter: MongoAndExpr.of([nameFilter(name), content]),\n\t\t\texpect: \"exists\",\n\t\t\tobject: namedIndexObject(collectionName, name)\n\t\t}],\n\t\texecute: [{\n\t\t\tdescription: `drop index ${name} on ${collectionName}`,\n\t\t\tcommand: new DropIndexCommand(collectionName, name)\n\t\t}],\n\t\tpostcheck: [{\n\t\t\tdescription: `index ${name} no longer exists on ${collectionName}`,\n\t\t\tsource: new ListIndexesCommand(collectionName),\n\t\t\tfilter: nameFilter(name),\n\t\t\texpect: \"notExists\",\n\t\t\tobject: namedIndexObject(collectionName, name)\n\t\t}]\n\t};\n}\nfunction createCollection(collectionName, options) {\n\tconst f = createFieldAccessor();\n\treturn {\n\t\tid: `collection.${collectionName}.create`,\n\t\tlabel: `Create collection ${collectionName}`,\n\t\toperationClass: \"additive\",\n\t\tprecheck: [{\n\t\t\tdescription: `collection ${collectionName} does not exist`,\n\t\t\tsource: new ListCollectionsCommand(),\n\t\t\tfilter: f.name.eq(collectionName),\n\t\t\texpect: \"notExists\",\n\t\t\tobject: `collection \"${collectionName}\"`\n\t\t}],\n\t\texecute: [{\n\t\t\tdescription: `create collection ${collectionName}`,\n\t\t\tcommand: collection(collectionName).createCollection(options)\n\t\t}],\n\t\tpostcheck: []\n\t};\n}\nfunction dropCollection(collectionName) {\n\treturn {\n\t\tid: `collection.${collectionName}.drop`,\n\t\tlabel: `Drop collection ${collectionName}`,\n\t\toperationClass: \"destructive\",\n\t\tprecheck: [],\n\t\texecute: [{\n\t\t\tdescription: `drop collection ${collectionName}`,\n\t\t\tcommand: new DropCollectionCommand(collectionName)\n\t\t}],\n\t\tpostcheck: []\n\t};\n}\nfunction collectionCheck(name, expect) {\n\treturn {\n\t\tdescription: expect === \"exists\" ? `collection ${name} exists` : `collection ${name} does not exist`,\n\t\tsource: new ListCollectionsCommand(),\n\t\tfilter: MongoFieldFilter.eq(\"name\", name),\n\t\texpect,\n\t\tobject: `collection \"${name}\"`\n\t};\n}\nfunction renameCollection(from, to) {\n\treturn {\n\t\tid: `collection.${from}.rename(${to})`,\n\t\tlabel: `Rename collection ${from} to ${to}`,\n\t\toperationClass: \"widening\",\n\t\tprecheck: [collectionCheck(from, \"exists\"), collectionCheck(to, \"notExists\")],\n\t\texecute: [{\n\t\t\tdescription: `rename collection ${from} to ${to}`,\n\t\t\tcommand: new RenameCollectionCommand(from, to)\n\t\t}],\n\t\tpostcheck: [collectionCheck(to, \"exists\"), collectionCheck(from, \"notExists\")]\n\t};\n}\nfunction setValidation(collectionName, schema, options) {\n\treturn {\n\t\tid: `collection.${collectionName}.setValidation`,\n\t\tlabel: `Set validation on ${collectionName}`,\n\t\toperationClass: \"widening\",\n\t\tprecheck: [],\n\t\texecute: [{\n\t\t\tdescription: `set validation on ${collectionName}`,\n\t\t\tcommand: new CollModCommand(collectionName, {\n\t\t\t\tvalidator: { $jsonSchema: schema },\n\t\t\t\t...ifDefined(\"validationLevel\", options?.validationLevel),\n\t\t\t\t...ifDefined(\"validationAction\", options?.validationAction)\n\t\t\t})\n\t\t}],\n\t\tpostcheck: []\n\t};\n}\n/**\n* Matches the collection's validator body. MongoDB returns the validator through `listCollections`\n* with its keys in the order given, so the order-sensitive comparison holds once the collMod ran; a\n* validator written by hand with another key order only makes the collMod run again.\n*/\nfunction validatorBodyFilter(validator) {\n\tconst { $jsonSchema, ...rest } = validator;\n\treturn $jsonSchema !== void 0 && Object.keys(rest).length === 0 ? MongoFieldFilter.eq(\"options.validator.$jsonSchema\", blindCast($jsonSchema)) : MongoFieldFilter.eq(\"options.validator\", documentValue(validator));\n}\nfunction collMod(collectionName, options, meta) {\n\tconst hasValidator = options.validator != null && Object.keys(options.validator).length > 0;\n\treturn {\n\t\tid: meta?.id ?? `collection.${collectionName}.collMod`,\n\t\tlabel: meta?.label ?? `Modify collection ${collectionName}`,\n\t\toperationClass: meta?.operationClass ?? \"widening\",\n\t\tprecheck: options.validator != null ? [{\n\t\t\tdescription: `collection ${collectionName} exists`,\n\t\t\tsource: new ListCollectionsCommand(),\n\t\t\tfilter: MongoFieldFilter.eq(\"name\", collectionName),\n\t\t\texpect: \"exists\",\n\t\t\tobject: `collection \"${collectionName}\"`\n\t\t}] : [],\n\t\texecute: [{\n\t\t\tdescription: `modify ${collectionName}`,\n\t\t\tcommand: new CollModCommand(collectionName, options)\n\t\t}],\n\t\tpostcheck: hasValidator ? [{\n\t\t\tdescription: `validator applied on ${collectionName}`,\n\t\t\tsource: new ListCollectionsCommand(),\n\t\t\tfilter: MongoAndExpr.of([\n\t\t\t\tMongoFieldFilter.eq(\"name\", collectionName),\n\t\t\t\t...options.validationLevel ? [MongoFieldFilter.eq(\"options.validationLevel\", options.validationLevel)] : [],\n\t\t\t\t...options.validationAction ? [MongoFieldFilter.eq(\"options.validationAction\", options.validationAction)] : [],\n\t\t\t\tvalidatorBodyFilter(options.validator ?? {})\n\t\t\t]),\n\t\t\texpect: \"exists\"\n\t\t}] : []\n\t};\n}\nfunction validatedCollection(name, schema, indexes) {\n\treturn [createCollection(name, {\n\t\tvalidator: { $jsonSchema: schema },\n\t\tvalidationLevel: \"strict\",\n\t\tvalidationAction: \"error\"\n\t}), ...indexes.map((idx) => createIndex(name, idx.keys, idx.unique !== void 0 ? { unique: idx.unique } : void 0))];\n}\n//#endregion\nexport { dropCollection as a, renameField as c, unsetField as d, validatedCollection as f, dataTransform as i, setValidation as l, createCollection as n, dropIndex as o, createIndex as r, renameCollection as s, collMod as t, unrewritableFieldNameReason as u };\n\n//# sourceMappingURL=migration-factories-CUyEIo5p.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,YAAY,OAAO;CAC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B,GAAG,QAAQ,cAAc;GAClD,QAAQ;GACR,QAAQ,eAAe,eAAe;EACvC,CAAC,IAAI,CAAC;EACN,SAAS,CAAC;GACT,aAAa,UAAU;GACvB,SAAS,IAAI,eAAe,gBAAgB,OAAO;EACpD,CAAC;EACD,WAAW,eAAe,CAAC;GAC1B,aAAa,wBAAwB;GACrC,QAAQ,IAAI,uBAAuB;GACnC,QAAQ,aAAa,GAAG;IACvB,iBAAiB,GAAG,QAAQ,cAAc;IAC1C,GAAG,QAAQ,kBAAkB,CAAC,iBAAiB,GAAG,2BAA2B,QAAQ,eAAe,CAAC,IAAI,CAAC;IAC1G,GAAG,QAAQ,mBAAmB,CAAC,iBAAiB,GAAG,4BAA4B,QAAQ,gBAAgB,CAAC,IAAI,CAAC;IAC7G,oBAAoB,QAAQ,aAAa,CAAC,CAAC;GAC5C,CAAC;GACD,QAAQ;EACT,CAAC,IAAI,CAAC;CACP;AACD;AACA,SAAS,oBAAoB,MAAM,QAAQ,SAAS;CACnD,OAAO,CAAC,iBAAiB,MAAM;EAC9B,WAAW,EAAE,aAAa,OAAO;EACjC,iBAAiB;EACjB,kBAAkB;CACnB,CAAC,GAAG,GAAG,QAAQ,KAAK,QAAQ,YAAY,MAAM,IAAI,MAAM,IAAI,WAAW,KAAK,IAAI,EAAE,QAAQ,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC;AAClH"}
@@ -1,9 +1,9 @@
1
1
  import { assertNever } from "@prisma/orm-framework/utils/internal-error";
2
2
  import { BSON, MongoClient } from "mongodb";
3
- //#region ../../../3-targets/mongo/3-driver/dist/mongo-driver-BJvIDiR4.mjs
3
+ //#region ../../../3-targets/mongo/3-driver/dist/mongo-driver-CAx_Xcbh.mjs
4
4
  const DRIVER_INFO = {
5
5
  name: "Prisma",
6
- version: "8.0.0-rc.22-dev.12"
6
+ version: "8.0.0-rc.22-dev.13"
7
7
  };
8
8
  const mongoDriverDescriptorMeta = {
9
9
  kind: "driver",
@@ -194,4 +194,4 @@ var MongoDriverImpl = class MongoDriverImpl {
194
194
  //#endregion
195
195
  export { MongoDriverImpl as n, mongoDriverDescriptorMeta as r, DRIVER_INFO as t };
196
196
 
197
- //# sourceMappingURL=mongo-driver-BJvIDiR4-D_8csOWl.mjs.map
197
+ //# sourceMappingURL=mongo-driver-CAx_Xcbh-D8PU1jaK.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongo-driver-BJvIDiR4-D_8csOWl.mjs","names":[],"sources":["../../../../3-targets/mongo/3-driver/dist/mongo-driver-BJvIDiR4.mjs"],"sourcesContent":["import { BSON, MongoClient } from \"mongodb\";\nimport { assertNever } from \"@internal/utils/internal-error\";\n//#endregion\n//#region src/core/driver-info.ts\nconst DRIVER_INFO = {\n\tname: \"Prisma\",\n\tversion: \"8.0.0-rc.22-dev.12\"\n};\n//#endregion\n//#region src/core/descriptor-meta.ts\nconst mongoDriverDescriptorMeta = {\n\tkind: \"driver\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: DRIVER_INFO.version,\n\tcapabilities: {}\n};\n//#endregion\n//#region src/mongo-driver.ts\n/* v8 ignore start */\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/* v8 ignore stop */\nvar MongoDriverImpl = class MongoDriverImpl {\n\tdb;\n\tclient;\n\tconstructor(db, client) {\n\t\tthis.db = db;\n\t\tthis.client = client;\n\t}\n\tstatic async fromConnection(uri, dbName) {\n\t\tconst client = new MongoClient(uri, { driverInfo: DRIVER_INFO });\n\t\ttry {\n\t\t\tawait client.connect();\n\t\t} catch (error) {\n\t\t\tawait client.close();\n\t\t\tthrow error;\n\t\t}\n\t\treturn new MongoDriverImpl(client.db(dbName), client);\n\t}\n\tstatic fromDb(db) {\n\t\treturn new MongoDriverImpl(db, void 0);\n\t}\n\texecute(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"insertOne\": return this.executeInsertOneCommand(wireCommand);\n\t\t\tcase \"updateOne\": return this.executeUpdateOneCommand(wireCommand);\n\t\t\tcase \"insertMany\": return this.executeInsertManyCommand(wireCommand);\n\t\t\tcase \"updateMany\": return this.executeUpdateManyCommand(wireCommand);\n\t\t\tcase \"deleteOne\": return this.executeDeleteOneCommand(wireCommand);\n\t\t\tcase \"deleteMany\": return this.executeDeleteManyCommand(wireCommand);\n\t\t\tcase \"findOneAndUpdate\": return this.executeFindOneAndUpdateCommand(wireCommand);\n\t\t\tcase \"findOneAndDelete\": return this.executeFindOneAndDeleteCommand(wireCommand);\n\t\t\tcase \"aggregate\": return this.executeAggregateCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync run(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"createCollection\": return this.executeCreateCollectionCommand(wireCommand);\n\t\t\tcase \"createIndex\": return this.executeCreateIndexCommand(wireCommand);\n\t\t\tcase \"dropCollection\": return this.executeDropCollectionCommand(wireCommand);\n\t\t\tcase \"renameCollection\": return this.executeRenameCollectionCommand(wireCommand);\n\t\t\tcase \"dropIndex\": return this.executeDropIndexCommand(wireCommand);\n\t\t\tcase \"collMod\": return this.executeCollModCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown DDL wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync close() {\n\t\tawait this.client?.close();\n\t}\n\tasync *executeInsertOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertOne(cmd.document);\n\t\tyield {\n\t\t\tinsertedId: result.insertedId,\n\t\t\tdocument: this.asRead({\n\t\t\t\t_id: result.insertedId,\n\t\t\t\t...cmd.document\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* The server stores an inserted document as the driver wrote it, apart from moving `_id` first, so writing it to BSON and reading it back with the client's options gives what a read returns, without a query.\n\t*/\n\tasRead(document) {\n\t\tconst { raw: _raw, ...options } = this.db.bsonOptions;\n\t\treturn BSON.deserialize(BSON.serialize(document, options), options);\n\t}\n\tasync *executeUpdateOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateOne(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeInsertManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertMany(cmd.documents);\n\t\tconst insertedIds = Object.values(result.insertedIds);\n\t\tyield {\n\t\t\tinsertedIds,\n\t\t\tinsertedCount: result.insertedCount,\n\t\t\tdocuments: cmd.documents.map((document, index) => this.asRead({\n\t\t\t\t_id: insertedIds[index],\n\t\t\t\t...document\n\t\t\t}))\n\t\t};\n\t}\n\tasync *executeUpdateManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateMany(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.bypassDocumentValidation ? { bypassDocumentValidation: true } : {}\n\t\t});\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeDeleteOneCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteOne(cmd.filter)).deletedCount };\n\t}\n\tasync *executeDeleteManyCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteMany(cmd.filter)).deletedCount };\n\t}\n\tasync *executeFindOneAndUpdateCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndUpdate(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.returnDocument != null ? { returnDocument: cmd.returnDocument } : {},\n\t\t\t...cmd.sort != null ? { sort: cmd.sort } : {}\n\t\t});\n\t\tif (result) yield result;\n\t}\n\tasync *executeFindOneAndDeleteCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndDelete(cmd.filter, { ...cmd.sort != null ? { sort: cmd.sort } : {} });\n\t\tif (result) yield result;\n\t}\n\tasync *executeAggregateCommand(cmd) {\n\t\tyield* this.db.collection(cmd.collection).aggregate(cmd.pipeline);\n\t}\n\tasync executeCreateCollectionCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, capped, size, max, timeseries, collation, changeStreamPreAndPostImages, clusteredIndex } = cmd;\n\t\tawait this.db.createCollection(cmd.collection, {\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...capped !== void 0 ? { capped } : {},\n\t\t\t...size !== void 0 ? { size } : {},\n\t\t\t...max !== void 0 ? { max } : {},\n\t\t\t...timeseries !== void 0 ? { timeseries } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {},\n\t\t\t...clusteredIndex !== void 0 ? { clusteredIndex } : {}\n\t\t});\n\t}\n\tasync executeCreateIndexCommand(cmd) {\n\t\tconst { unique, sparse, expireAfterSeconds, partialFilterExpression, name, wildcardProjection, collation, weights, default_language, language_override } = cmd;\n\t\tawait this.db.collection(cmd.collection).createIndex(cmd.key, {\n\t\t\t...unique !== void 0 ? { unique } : {},\n\t\t\t...sparse !== void 0 ? { sparse } : {},\n\t\t\t...expireAfterSeconds !== void 0 ? { expireAfterSeconds } : {},\n\t\t\t...partialFilterExpression !== void 0 ? { partialFilterExpression } : {},\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\t...wildcardProjection !== void 0 ? { wildcardProjection } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...weights !== void 0 ? { weights } : {},\n\t\t\t...default_language !== void 0 ? { default_language } : {},\n\t\t\t...language_override !== void 0 ? { language_override } : {}\n\t\t});\n\t}\n\tasync executeDropCollectionCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).drop();\n\t}\n\tasync executeRenameCollectionCommand(cmd) {\n\t\tawait this.db.renameCollection(cmd.collection, cmd.to);\n\t}\n\tasync executeDropIndexCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).dropIndex(cmd.name);\n\t}\n\tasync executeCollModCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, changeStreamPreAndPostImages } = cmd;\n\t\tawait this.db.command({\n\t\t\tcollMod: cmd.collection,\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {}\n\t\t});\n\t}\n};\n//#endregion\nexport { mongoDriverDescriptorMeta as n, DRIVER_INFO as r, MongoDriverImpl as t };\n\n//# sourceMappingURL=mongo-driver-BJvIDiR4.mjs.map"],"mappings":";;;AAIA,MAAM,cAAc;CACnB,MAAM;CACN,SAAS;AACV;AAGA,MAAM,4BAA4B;CACjC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS,YAAY;CACrB,cAAc,CAAC;AAChB;;AAIA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,YAAY;CAClB,IAAI,OAAO,cAAc,YAAY,cAAc,QAAQ,UAAU,aAAa,OAAO,UAAU,SAAS,UAAU,OAAO,UAAU;CACvI,OAAO;AACR;;AAEA,IAAI,kBAAkB,MAAM,gBAAgB;CAC3C;CACA;CACA,YAAY,IAAI,QAAQ;EACvB,KAAK,KA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,iBAAiB,IAAI,CAAC;GACzD,GAAG,sBAAsB,KAAK,IAAI,EAAE,kBAAkB,IAAI,CAAC;EAC5D,CAAC;CACF;CACA,MAAM,6BAA6B,KAAK;EACvC,MAAM,KAAK,GAAG,WAAW,IAAI,UAAU,CAAC,CAAC,KAAK;CAC/C;CACA,MAAM,+BAA+B,KAAK;EACzC,MAAM,KAAK,GAAG,iBAAiB,IAAI,YAAY,IAAI,EAAE;CACtD;CACA,MAAM,wBAAwB,KAAK;EAClC,MAAM,KAAK,GAAG,WAAW,IAAI,UAAU,CAAC,CAAC,UAAU,IAAI,IAAI;CAC5D;CACA,MAAM,sBAAsB,KAAK;EAChC,MAAM,EAAE,WAAW,iBAAiB,kBAAkB,iCAAiC;EACvF,MAAM,KAAK,GAAG,QAAQ;GACrB,SAAS,IAAI;GACb,GAAG,cAAc,KAAK,IAAI,EAAE,UAAU,IAAI,CAAC;GAC3C,GAAG,oBAAoB,KAAK,IAAI,EAAE,gBAAgB,IAAI,CAAC;GACvD,GAAG,qBAAqB,KAAK,IAAI,EAAE,iBAAiB,IAAI,CAAC;GACzD,GAAG,iCAAiC,KAAK,IAAI,EAAE,6BAA6B,IAAI,CAAC;EAClF,CAAC;CACF;AACD"}
1
+ {"version":3,"file":"mongo-driver-CAx_Xcbh-D8PU1jaK.mjs","names":[],"sources":["../../../../3-targets/mongo/3-driver/dist/mongo-driver-CAx_Xcbh.mjs"],"sourcesContent":["import { BSON, MongoClient } from \"mongodb\";\nimport { assertNever } from \"@internal/utils/internal-error\";\n//#endregion\n//#region src/core/driver-info.ts\nconst DRIVER_INFO = {\n\tname: \"Prisma\",\n\tversion: \"8.0.0-rc.22-dev.13\"\n};\n//#endregion\n//#region src/core/descriptor-meta.ts\nconst mongoDriverDescriptorMeta = {\n\tkind: \"driver\",\n\tfamilyId: \"mongo\",\n\ttargetId: \"mongo\",\n\tid: \"mongo\",\n\tversion: DRIVER_INFO.version,\n\tcapabilities: {}\n};\n//#endregion\n//#region src/mongo-driver.ts\n/* v8 ignore start */\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/* v8 ignore stop */\nvar MongoDriverImpl = class MongoDriverImpl {\n\tdb;\n\tclient;\n\tconstructor(db, client) {\n\t\tthis.db = db;\n\t\tthis.client = client;\n\t}\n\tstatic async fromConnection(uri, dbName) {\n\t\tconst client = new MongoClient(uri, { driverInfo: DRIVER_INFO });\n\t\ttry {\n\t\t\tawait client.connect();\n\t\t} catch (error) {\n\t\t\tawait client.close();\n\t\t\tthrow error;\n\t\t}\n\t\treturn new MongoDriverImpl(client.db(dbName), client);\n\t}\n\tstatic fromDb(db) {\n\t\treturn new MongoDriverImpl(db, void 0);\n\t}\n\texecute(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"insertOne\": return this.executeInsertOneCommand(wireCommand);\n\t\t\tcase \"updateOne\": return this.executeUpdateOneCommand(wireCommand);\n\t\t\tcase \"insertMany\": return this.executeInsertManyCommand(wireCommand);\n\t\t\tcase \"updateMany\": return this.executeUpdateManyCommand(wireCommand);\n\t\t\tcase \"deleteOne\": return this.executeDeleteOneCommand(wireCommand);\n\t\t\tcase \"deleteMany\": return this.executeDeleteManyCommand(wireCommand);\n\t\t\tcase \"findOneAndUpdate\": return this.executeFindOneAndUpdateCommand(wireCommand);\n\t\t\tcase \"findOneAndDelete\": return this.executeFindOneAndDeleteCommand(wireCommand);\n\t\t\tcase \"aggregate\": return this.executeAggregateCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync run(wireCommand) {\n\t\tswitch (wireCommand.kind) {\n\t\t\tcase \"createCollection\": return this.executeCreateCollectionCommand(wireCommand);\n\t\t\tcase \"createIndex\": return this.executeCreateIndexCommand(wireCommand);\n\t\t\tcase \"dropCollection\": return this.executeDropCollectionCommand(wireCommand);\n\t\t\tcase \"renameCollection\": return this.executeRenameCollectionCommand(wireCommand);\n\t\t\tcase \"dropIndex\": return this.executeDropIndexCommand(wireCommand);\n\t\t\tcase \"collMod\": return this.executeCollModCommand(wireCommand);\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: return assertNever(wireCommand, `Unknown DDL wire command kind: ${unreachableKind(wireCommand)}`);\n\t\t}\n\t}\n\tasync close() {\n\t\tawait this.client?.close();\n\t}\n\tasync *executeInsertOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertOne(cmd.document);\n\t\tyield {\n\t\t\tinsertedId: result.insertedId,\n\t\t\tdocument: this.asRead({\n\t\t\t\t_id: result.insertedId,\n\t\t\t\t...cmd.document\n\t\t\t})\n\t\t};\n\t}\n\t/**\n\t* The server stores an inserted document as the driver wrote it, apart from moving `_id` first, so writing it to BSON and reading it back with the client's options gives what a read returns, without a query.\n\t*/\n\tasRead(document) {\n\t\tconst { raw: _raw, ...options } = this.db.bsonOptions;\n\t\treturn BSON.deserialize(BSON.serialize(document, options), options);\n\t}\n\tasync *executeUpdateOneCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateOne(cmd.filter, cmd.update, { upsert: cmd.upsert });\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeInsertManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).insertMany(cmd.documents);\n\t\tconst insertedIds = Object.values(result.insertedIds);\n\t\tyield {\n\t\t\tinsertedIds,\n\t\t\tinsertedCount: result.insertedCount,\n\t\t\tdocuments: cmd.documents.map((document, index) => this.asRead({\n\t\t\t\t_id: insertedIds[index],\n\t\t\t\t...document\n\t\t\t}))\n\t\t};\n\t}\n\tasync *executeUpdateManyCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).updateMany(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.bypassDocumentValidation ? { bypassDocumentValidation: true } : {}\n\t\t});\n\t\tyield {\n\t\t\tmatchedCount: result.matchedCount,\n\t\t\tmodifiedCount: result.modifiedCount,\n\t\t\tupsertedCount: result.upsertedCount,\n\t\t\tupsertedId: result.upsertedId ?? void 0\n\t\t};\n\t}\n\tasync *executeDeleteOneCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteOne(cmd.filter)).deletedCount };\n\t}\n\tasync *executeDeleteManyCommand(cmd) {\n\t\tyield { deletedCount: (await this.db.collection(cmd.collection).deleteMany(cmd.filter)).deletedCount };\n\t}\n\tasync *executeFindOneAndUpdateCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndUpdate(cmd.filter, cmd.update, {\n\t\t\tupsert: cmd.upsert,\n\t\t\t...cmd.returnDocument != null ? { returnDocument: cmd.returnDocument } : {},\n\t\t\t...cmd.sort != null ? { sort: cmd.sort } : {}\n\t\t});\n\t\tif (result) yield result;\n\t}\n\tasync *executeFindOneAndDeleteCommand(cmd) {\n\t\tconst result = await this.db.collection(cmd.collection).findOneAndDelete(cmd.filter, { ...cmd.sort != null ? { sort: cmd.sort } : {} });\n\t\tif (result) yield result;\n\t}\n\tasync *executeAggregateCommand(cmd) {\n\t\tyield* this.db.collection(cmd.collection).aggregate(cmd.pipeline);\n\t}\n\tasync executeCreateCollectionCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, capped, size, max, timeseries, collation, changeStreamPreAndPostImages, clusteredIndex } = cmd;\n\t\tawait this.db.createCollection(cmd.collection, {\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...capped !== void 0 ? { capped } : {},\n\t\t\t...size !== void 0 ? { size } : {},\n\t\t\t...max !== void 0 ? { max } : {},\n\t\t\t...timeseries !== void 0 ? { timeseries } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {},\n\t\t\t...clusteredIndex !== void 0 ? { clusteredIndex } : {}\n\t\t});\n\t}\n\tasync executeCreateIndexCommand(cmd) {\n\t\tconst { unique, sparse, expireAfterSeconds, partialFilterExpression, name, wildcardProjection, collation, weights, default_language, language_override } = cmd;\n\t\tawait this.db.collection(cmd.collection).createIndex(cmd.key, {\n\t\t\t...unique !== void 0 ? { unique } : {},\n\t\t\t...sparse !== void 0 ? { sparse } : {},\n\t\t\t...expireAfterSeconds !== void 0 ? { expireAfterSeconds } : {},\n\t\t\t...partialFilterExpression !== void 0 ? { partialFilterExpression } : {},\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\t...wildcardProjection !== void 0 ? { wildcardProjection } : {},\n\t\t\t...collation !== void 0 ? { collation } : {},\n\t\t\t...weights !== void 0 ? { weights } : {},\n\t\t\t...default_language !== void 0 ? { default_language } : {},\n\t\t\t...language_override !== void 0 ? { language_override } : {}\n\t\t});\n\t}\n\tasync executeDropCollectionCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).drop();\n\t}\n\tasync executeRenameCollectionCommand(cmd) {\n\t\tawait this.db.renameCollection(cmd.collection, cmd.to);\n\t}\n\tasync executeDropIndexCommand(cmd) {\n\t\tawait this.db.collection(cmd.collection).dropIndex(cmd.name);\n\t}\n\tasync executeCollModCommand(cmd) {\n\t\tconst { validator, validationLevel, validationAction, changeStreamPreAndPostImages } = cmd;\n\t\tawait this.db.command({\n\t\t\tcollMod: cmd.collection,\n\t\t\t...validator !== void 0 ? { validator } : {},\n\t\t\t...validationLevel !== void 0 ? { validationLevel } : {},\n\t\t\t...validationAction !== void 0 ? { validationAction } : {},\n\t\t\t...changeStreamPreAndPostImages !== void 0 ? { changeStreamPreAndPostImages } : {}\n\t\t});\n\t}\n};\n//#endregion\nexport { mongoDriverDescriptorMeta as n, DRIVER_INFO as r, MongoDriverImpl as t };\n\n//# sourceMappingURL=mongo-driver-CAx_Xcbh.mjs.map"],"mappings":";;;AAIA,MAAM,cAAc;CACnB,MAAM;CACN,SAAS;AACV;AAGA,MAAM,4BAA4B;CACjC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS,YAAY;CACrB,cAAc,CAAC;AAChB;;AAIA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,YAAY;CAClB,IAAI,OAAO,cAAc,YAAY,cAAc,QAAQ,UAAU,aAAa,OAAO,UAAU,SAAS,UAAU,OAAO,UAAU;CACvI,OAAO;AACR;;AAEA,IAAI,kBAAkB,MAAM,gBAAgB;CAC3C;CACA;CACA,YAAY,IAAI,QAAQ;EACvB,KAAK,KAAK;EACV,KAAK,SAAS;CACf;CACA,aAAa,eAAe,KAAK,QAAQ;EACxC,MAAM,SAAS,IAAI,YAAY,KAAK,EAAE,YAAY,YAAY,CAAC;EAC/D,IAAI;GACH,MAAM,OAAO,QAAQ;EACtB,SAAS,OAAO;GACf,MAAM,OAAO,MAAM;GACnB,MAAM;EACP;EACA,OAAO,IAAI,gBAAgB,OAAO,GAAG,MAAM,GAAG,MAAM;CACrD;CACA,OAAO,OAAO,IAAI;EACjB,OAAO,IAAI,gBAAgB,IAAI,KAAK,CAAC;CACtC;CACA,QAAQ,aAAa;EACpB,QAAQ,YAAY,MAApB;GACC,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KAAK,cAAc,OAAO,KAAK,yBAAyB,WAAW;GACnE,KAAK,cAAc,OAAO,KAAK,yBAAyB,WAAW;GACnE,KAAK,aAAa,OAAO,KAAK,wBAAwB,WAAW;GACjE,KAAK,cAAc,OAAO,KAAK,yBAAyB,WAAW;GACnE,KAAK,oBAAoB,OAAO,KAAK,+BAA+B,WAA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,KAAK,IAAI,EAAE,6BAA6B,IAAI,CAAC;EAClF,CAAC;CACF;AACD"}
@@ -3,7 +3,7 @@ import { MigrationOperationClass, OpFactoryCall } from "@prisma/orm-framework/co
3
3
  import { MongoSchemaCollection, MongoSchemaIndex } from "@prisma/orm-family-mongo/schema-ir";
4
4
  import { ImportRequirement, TsExpression } from "@prisma/orm-framework/ts-render";
5
5
  import { Document } from "@prisma/orm-family-mongo/value";
6
- //#region ../../../3-targets/mongo/1-target/dist/op-factory-call-BoYr7vvM.d.mts
6
+ //#region ../../../3-targets/mongo/1-target/dist/op-factory-call-DzQ_ZxeZ.d.mts
7
7
  //#region src/core/migrations/op-factory-call.d.ts
8
8
  interface CollModMeta {
9
9
  readonly id?: string;
@@ -18,14 +18,18 @@ declare abstract class OpFactoryCallNode extends TsExpression implements OpFacto
18
18
  importRequirements(): readonly ImportRequirement[];
19
19
  protected freeze(): void;
20
20
  }
21
+ /** The index a call creates or drops: its name and options as `createIndex` takes them. */
22
+ type IndexCallOptions = CreateIndexOptions & {
23
+ readonly name: string;
24
+ };
21
25
  declare class CreateIndexCall extends OpFactoryCallNode {
22
26
  readonly factoryName: "createIndex";
23
27
  readonly operationClass: "additive";
24
28
  readonly collection: string;
25
29
  readonly keys: ReadonlyArray<MongoIndexKey>;
26
- readonly options: CreateIndexOptions | undefined;
30
+ readonly options: IndexCallOptions;
27
31
  readonly label: string;
28
- constructor(collection: string, keys: ReadonlyArray<MongoIndexKey>, options?: CreateIndexOptions);
32
+ constructor(collection: string, keys: ReadonlyArray<MongoIndexKey>, options: IndexCallOptions);
29
33
  toOp(): MongoMigrationPlanOperation;
30
34
  renderTypeScript(): string;
31
35
  }
@@ -34,8 +38,9 @@ declare class DropIndexCall extends OpFactoryCallNode {
34
38
  readonly operationClass: "widening";
35
39
  readonly collection: string;
36
40
  readonly keys: ReadonlyArray<MongoIndexKey>;
41
+ readonly options: IndexCallOptions;
37
42
  readonly label: string;
38
- constructor(collection: string, keys: ReadonlyArray<MongoIndexKey>);
43
+ constructor(collection: string, keys: ReadonlyArray<MongoIndexKey>, options: IndexCallOptions);
39
44
  toOp(): MongoMigrationPlanOperation;
40
45
  renderTypeScript(): string;
41
46
  }
@@ -103,8 +108,8 @@ declare class CollModCall extends OpFactoryCallNode {
103
108
  renderTypeScript(): string;
104
109
  }
105
110
  type OpFactoryCall$1 = CreateIndexCall | DropIndexCall | CreateCollectionCall | DropCollectionCall | RenameCollectionCall | RenameFieldCall | UnsetFieldCall | CollModCall;
106
- declare function schemaIndexToCreateIndexOptions(index: MongoSchemaIndex): CreateIndexOptions;
111
+ declare function schemaIndexToCreateIndexOptions(index: MongoSchemaIndex): IndexCallOptions;
107
112
  declare function schemaCollectionToCreateCollectionOptions(coll: MongoSchemaCollection): CreateCollectionOptions | undefined;
108
113
  //#endregion
109
- export { DropCollectionCall as a, RenameCollectionCall as c, schemaCollectionToCreateCollectionOptions as d, schemaIndexToCreateIndexOptions as f, CreateIndexCall as i, RenameFieldCall as l, CollModMeta as n, DropIndexCall as o, CreateCollectionCall as r, OpFactoryCall$1 as s, CollModCall as t, UnsetFieldCall as u };
110
- //# sourceMappingURL=op-factory-call-BoYr7vvM-CEACROK1.d.mts.map
114
+ export { DropCollectionCall as a, OpFactoryCall$1 as c, UnsetFieldCall as d, schemaCollectionToCreateCollectionOptions as f, CreateIndexCall as i, RenameCollectionCall as l, CollModMeta as n, DropIndexCall as o, schemaIndexToCreateIndexOptions as p, CreateCollectionCall as r, IndexCallOptions as s, CollModCall as t, RenameFieldCall as u };
115
+ //# sourceMappingURL=op-factory-call-DzQ_ZxeZ-CukKyuhZ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"op-factory-call-DzQ_ZxeZ-CukKyuhZ.d.mts","names":[],"sources":["../../../../3-targets/mongo/1-target/dist/op-factory-call-DzQ_ZxeZ.d.mts"],"mappings":";;;;;;;UAMU;WACC;WACA;WACA,iBAAiB;;uBAEL,0BAA0B,wBAAwB;oBACrD;oBACA,gBAAgB;oBAChB;WACT,QAAQ;EACjB,+BAA+B;YACrB;;;KAGP,mBAAmB;WACb;;cAEG,wBAAwB;WAC3B;WACA;WACA;WACA,MAAM,cAAc;WACpB,SAAS;WACT;EACT,YAAY,oBAAoB,MAAM,cAAc,gBAAgB,SAAS;EAC7E,QAAQ;EACR;;cAEY,sBAAsB;WACzB;WACA;WACA;WACA,MAAM,cAAc;WACpB,SAAS;WACT;EACT,YAAY,oBAAoB,MAAM,cAAc,gBAAgB,SAAS;EAC7E,QAAQ;EACR;;cAEY,6BAA6B;WAChC;WACA;WACA;WACA,SAAS;WACT;EACT,YAAY,oBAAoB,UAAU;EAC1C,QAAQ;EACR;;cAEY,2BAA2B;WAC9B;WACA;WACA;WACA;EACT,YAAY;EACZ,QAAQ;EACR;;cAEY,6BAA6B;WAChC;WACA;WACA;WACA;WACA;EACT,YAAY,cAAc;EAC1B,QAAQ;EACR;;cAEY,wBAAwB;WAC3B;WACA;WACA;WACA;WACA;WACA,QAAQ;WACR;EACT,YAAY,oBAAoB,cAAc,YAAY,SAAS;EACnE,QAAQ;EACR;;cAEY,uBAAuB;WAC1B;WACA;WACA;WACA;WACA,QAAQ;WACR;EACT,YAAY,oBAAoB,eAAe,SAAS;EACxD,QAAQ;EACR;;cAEY,oBAAoB;WACvB;WACA;WACA,SAAS;WACT,MAAM;WACN,gBAAgB;WAChB;EACT,YAAY,oBAAoB,SAAS,gBAAgB,OAAO;EAChE,QAAQ;EACR;;KAEG,kBAAkB,kBAAkB,gBAAgB,uBAAuB,qBAAqB,uBAAuB,kBAAkB,iBAAiB;iBAC9I,gCAAgC,OAAO,mBAAmB;iBAC1D,0CAA0C,MAAM,wBAAwB"}
package/dist/target.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_OBJECTID_CODEC_ID, f as MONGO_STRING_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DOUBLE_CODEC_ID, p as MONGO_VECTOR_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_INT32_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_JSON_CODEC_ID } from "./codec-ids-BKQbXhZt.mjs";
2
2
  import { a as ParameterizedOutputTypesForTypeParams, i as CodecTypes, n as BsonScalar, o as Vector, r as BsonValue, t as BsonInputValue } from "./codec-types-oKxM85p-.mjs";
3
3
  import { n as mongoDescriptorById, t as mongoCodecDescriptors } from "./codecs-Bkkn7nm4.mjs";
4
- import { a as DropCollectionCall, c as RenameCollectionCall, d as schemaCollectionToCreateCollectionOptions, f as schemaIndexToCreateIndexOptions, i as CreateIndexCall, l as RenameFieldCall, n as CollModMeta, o as DropIndexCall, r as CreateCollectionCall, s as OpFactoryCall$1, t as CollModCall, u as UnsetFieldCall } from "./op-factory-call-BoYr7vvM-CEACROK1.mjs";
5
- import { _ as deserializeMongoOps, a as MongoMigrationRunnerExecuteOptions, b as renderOps, c as MongoTargetContract, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as deserializeMongoOp, h as RenderMigrationMeta, i as MongoMigrationRunnerErrorCode, l as MongoTargetContractSerializer, m as PlannerProducedMongoMigration, n as MongoMigrationPlanner, o as MongoMigrationRunnerFailure, p as PlanCallsResult, r as MongoMigrationRunner, s as MongoMigrationRunnerResult, t as FilterEvaluator, u as MongoTargetDatabase, v as mongoTargetDescriptor, x as serializeMongoOps, y as renderCallsToTypeScript } from "./control-kV8BDwKp.mjs";
4
+ import { a as DropCollectionCall, c as OpFactoryCall$1, d as UnsetFieldCall, f as schemaCollectionToCreateCollectionOptions, i as CreateIndexCall, l as RenameCollectionCall, n as CollModMeta, o as DropIndexCall, p as schemaIndexToCreateIndexOptions, r as CreateCollectionCall, s as IndexCallOptions, t as CollModCall, u as RenameFieldCall } from "./op-factory-call-DzQ_ZxeZ-CukKyuhZ.mjs";
5
+ import { _ as deserializeMongoOps, a as MongoMigrationRunnerExecuteOptions, b as renderOps, c as MongoTargetContract, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as deserializeMongoOp, h as RenderMigrationMeta, i as MongoMigrationRunnerErrorCode, l as MongoTargetContractSerializer, m as PlannerProducedMongoMigration, n as MongoMigrationPlanner, o as MongoMigrationRunnerFailure, p as PlanCallsResult, r as MongoMigrationRunner, s as MongoMigrationRunnerResult, t as FilterEvaluator, u as MongoTargetDatabase, v as mongoTargetDescriptor, x as serializeMongoOps, y as renderCallsToTypeScript } from "./control-1-RnMe4V.mjs";
6
6
  import { a as mongoDate, c as mongoInt32, d as mongoObjectId, f as mongoString, h as mongoVectorParams, i as mongoDataTypes, l as mongoInt64, m as mongoVector, n as mongoBool, o as mongoDecimal128, p as mongoTextDataTypes, r as mongoBson, s as mongoDouble, t as mongoBinary, u as mongoJson } from "./data-types-LShlnAUM.mjs";
7
- import { a as createIndex, c as dropIndex, d as renameField, f as setValidation, i as createCollection, l as placeholder, m as validatedCollection, n as MigrationCLI, o as dataTransform, p as unsetField, r as collMod, s as dropCollection, t as Migration, u as renameCollection } from "./migration-CoPXNa95.mjs";
7
+ import { a as createIndex, c as dropIndex, d as renameField, f as setValidation, i as createCollection, l as placeholder, m as validatedCollection, n as MigrationCLI, o as dataTransform, p as unsetField, r as collMod, s as dropCollection, t as Migration, u as renameCollection } from "./migration-BMUh33vn.mjs";
8
8
  import "./pack-xD2XwjJr.mjs";
9
9
  import { t as prisma6MongoBinding } from "./prisma6-binding-DhnqslLT.mjs";
10
10
  import { t as MongoRuntimeTargetInstance } from "./runtime-DeUjc8oy.mjs";
11
- export { type BsonInputValue, type BsonScalar, type BsonValue, CodecTypes, CollModCall, type CollModMeta, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MONGO_BINARY_CODEC_ID, MONGO_BOOLEAN_CODEC_ID, MONGO_BSON_CODEC_ID, MONGO_DATE_CODEC_ID, MONGO_DECIMAL128_CODEC_ID, MONGO_DOUBLE_CODEC_ID, MONGO_INT32_CODEC_ID, MONGO_INT64_CODEC_ID, MONGO_INT64_NUMBER_CODEC_ID, MONGO_JSON_CODEC_ID, MONGO_OBJECTID_CODEC_ID, MONGO_STRING_CODEC_ID, MONGO_VECTOR_CODEC_ID, Migration, MigrationCLI, MongoMigrationPlanner, MongoMigrationRunner, type MongoMigrationRunnerErrorCode, type MongoMigrationRunnerExecuteOptions, type MongoMigrationRunnerFailure, type MongoMigrationRunnerResult, MongoRuntimeTargetInstance, type MongoTargetContract, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, type OpFactoryCall$1 as OpFactoryCall, ParameterizedOutputTypesForTypeParams, type PlanCallsResult, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, type RenderMigrationMeta, UnsetFieldCall, Vector, collMod, createCollection, createIndex, dataTransform, deserializeMongoOp, deserializeMongoOps, dropCollection, dropIndex, mongoBinary, mongoBool, mongoBson, mongoCodecDescriptors, mongoDataTypes, mongoDate, mongoDecimal128, mongoDescriptorById, mongoDouble, mongoInt32, mongoInt64, mongoJson, mongoObjectId, mongoString, mongoTargetDescriptor, mongoTextDataTypes, mongoVector, mongoVectorParams, placeholder, prisma6MongoBinding, renameCollection, renameField, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps, setValidation, unsetField, validatedCollection };
11
+ export { type BsonInputValue, type BsonScalar, type BsonValue, CodecTypes, CollModCall, type CollModMeta, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, type IndexCallOptions, MONGO_BINARY_CODEC_ID, MONGO_BOOLEAN_CODEC_ID, MONGO_BSON_CODEC_ID, MONGO_DATE_CODEC_ID, MONGO_DECIMAL128_CODEC_ID, MONGO_DOUBLE_CODEC_ID, MONGO_INT32_CODEC_ID, MONGO_INT64_CODEC_ID, MONGO_INT64_NUMBER_CODEC_ID, MONGO_JSON_CODEC_ID, MONGO_OBJECTID_CODEC_ID, MONGO_STRING_CODEC_ID, MONGO_VECTOR_CODEC_ID, Migration, MigrationCLI, MongoMigrationPlanner, MongoMigrationRunner, type MongoMigrationRunnerErrorCode, type MongoMigrationRunnerExecuteOptions, type MongoMigrationRunnerFailure, type MongoMigrationRunnerResult, MongoRuntimeTargetInstance, type MongoTargetContract, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, type OpFactoryCall$1 as OpFactoryCall, ParameterizedOutputTypesForTypeParams, type PlanCallsResult, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, type RenderMigrationMeta, UnsetFieldCall, Vector, collMod, createCollection, createIndex, dataTransform, deserializeMongoOp, deserializeMongoOps, dropCollection, dropIndex, mongoBinary, mongoBool, mongoBson, mongoCodecDescriptors, mongoDataTypes, mongoDate, mongoDecimal128, mongoDescriptorById, mongoDouble, mongoInt32, mongoInt64, mongoJson, mongoObjectId, mongoString, mongoTargetDescriptor, mongoTextDataTypes, mongoVector, mongoVectorParams, placeholder, prisma6MongoBinding, renameCollection, renameField, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps, setValidation, unsetField, validatedCollection };
package/dist/target.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { a as MONGO_DECIMAL128_CODEC_ID, c as MONGO_INT64_CODEC_ID, d as MONGO_OBJECTID_CODEC_ID, f as MONGO_STRING_CODEC_ID, i as MONGO_DATE_CODEC_ID, l as MONGO_INT64_NUMBER_CODEC_ID, n as MONGO_BOOLEAN_CODEC_ID, o as MONGO_DOUBLE_CODEC_ID, p as MONGO_VECTOR_CODEC_ID, r as MONGO_BSON_CODEC_ID, s as MONGO_INT32_CODEC_ID, t as MONGO_BINARY_CODEC_ID, u as MONGO_JSON_CODEC_ID } from "./codec-ids-WdrumsYA-CZVjuKW8.mjs";
2
2
  import { B as mongoInt32, F as mongoBson, G as mongoTextDataTypes, H as mongoJson, I as mongoDataTypes, K as mongoVector, L as mongoDate, N as mongoBinary, P as mongoBool, R as mongoDecimal128, U as mongoObjectId, V as mongoInt64, W as mongoString, q as mongoVectorParams, z as mongoDouble } from "./data-types-hoKLBrYZ-h9cAgbOy.mjs";
3
3
  import { n as mongoDescriptorById, t as mongoCodecDescriptors } from "./codecs-_QYfn0YT-BWZI19N1.mjs";
4
- import { a as dropCollection, c as renameField, d as unsetField, f as validatedCollection, i as dataTransform, l as setValidation, n as createCollection, o as dropIndex, r as createIndex, s as renameCollection, t as collMod } from "./migration-factories-DImj1ZN5-BtCob_1N.mjs";
5
- import { C as schemaIndexToCreateIndexOptions, S as schemaCollectionToCreateCollectionOptions, _ as deserializeMongoOp, a as DropIndexCall, b as renderCallsToTypeScript, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as UnsetFieldCall, h as RenameFieldCall, i as DropCollectionCall, l as MongoTargetContractSerializer, m as RenameCollectionCall, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as deserializeMongoOps, w as serializeMongoOps, x as renderOps, y as mongoTargetDescriptor } from "./control-1k8tG3h1.mjs";
4
+ import { a as dropCollection, c as renameField, d as unsetField, f as validatedCollection, i as dataTransform, l as setValidation, n as createCollection, o as dropIndex, r as createIndex, s as renameCollection, t as collMod } from "./migration-factories-CUyEIo5p-CXTwpgxe.mjs";
5
+ import { C as schemaIndexToCreateIndexOptions, S as schemaCollectionToCreateCollectionOptions, _ as deserializeMongoOp, a as DropIndexCall, b as renderCallsToTypeScript, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as UnsetFieldCall, h as RenameFieldCall, i as DropCollectionCall, l as MongoTargetContractSerializer, m as RenameCollectionCall, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as deserializeMongoOps, w as serializeMongoOps, x as renderOps, y as mongoTargetDescriptor } from "./control-BSgJpq4Q.mjs";
6
6
  import { n as MigrationCLI, r as placeholder, t as Migration } from "./migration-C-jfTsGU.mjs";
7
7
  import { t as prisma6MongoBinding } from "./prisma6-binding-BuMRLaNZ.mjs";
8
8
  export { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MONGO_BINARY_CODEC_ID, MONGO_BOOLEAN_CODEC_ID, MONGO_BSON_CODEC_ID, MONGO_DATE_CODEC_ID, MONGO_DECIMAL128_CODEC_ID, MONGO_DOUBLE_CODEC_ID, MONGO_INT32_CODEC_ID, MONGO_INT64_CODEC_ID, MONGO_INT64_NUMBER_CODEC_ID, MONGO_JSON_CODEC_ID, MONGO_OBJECTID_CODEC_ID, MONGO_STRING_CODEC_ID, MONGO_VECTOR_CODEC_ID, Migration, MigrationCLI, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, UnsetFieldCall, collMod, createCollection, createIndex, dataTransform, deserializeMongoOp, deserializeMongoOps, dropCollection, dropIndex, mongoBinary, mongoBool, mongoBson, mongoCodecDescriptors, mongoDataTypes, mongoDate, mongoDecimal128, mongoDescriptorById, mongoDouble, mongoInt32, mongoInt64, mongoJson, mongoObjectId, mongoString, mongoTargetDescriptor, mongoTextDataTypes, mongoVector, mongoVectorParams, placeholder, prisma6MongoBinding, renameCollection, renameField, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps, setValidation, unsetField, validatedCollection };
@@ -1,3 +1,3 @@
1
- import { a as DropCollectionCall, c as RenameCollectionCall, d as schemaCollectionToCreateCollectionOptions, f as schemaIndexToCreateIndexOptions, i as CreateIndexCall, l as RenameFieldCall, n as CollModMeta, o as DropIndexCall, r as CreateCollectionCall, s as OpFactoryCall$1, t as CollModCall, u as UnsetFieldCall } from "./op-factory-call-BoYr7vvM-CEACROK1.mjs";
2
- import { _ as deserializeMongoOps, a as MongoMigrationRunnerExecuteOptions, b as renderOps, c as MongoTargetContract, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as deserializeMongoOp, h as RenderMigrationMeta, i as MongoMigrationRunnerErrorCode, l as MongoTargetContractSerializer, m as PlannerProducedMongoMigration, n as MongoMigrationPlanner, o as MongoMigrationRunnerFailure, p as PlanCallsResult, r as MongoMigrationRunner, s as MongoMigrationRunnerResult, t as FilterEvaluator, u as MongoTargetDatabase, v as mongoTargetDescriptor, x as serializeMongoOps, y as renderCallsToTypeScript } from "./control-kV8BDwKp.mjs";
3
- export { CollModCall, type CollModMeta, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, type MongoMigrationRunnerErrorCode, type MongoMigrationRunnerExecuteOptions, type MongoMigrationRunnerFailure, type MongoMigrationRunnerResult, type MongoTargetContract, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, type OpFactoryCall$1 as OpFactoryCall, type PlanCallsResult, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, type RenderMigrationMeta, UnsetFieldCall, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };
1
+ import { a as DropCollectionCall, c as OpFactoryCall$1, d as UnsetFieldCall, f as schemaCollectionToCreateCollectionOptions, i as CreateIndexCall, l as RenameCollectionCall, n as CollModMeta, o as DropIndexCall, p as schemaIndexToCreateIndexOptions, r as CreateCollectionCall, s as IndexCallOptions, t as CollModCall, u as RenameFieldCall } from "./op-factory-call-DzQ_ZxeZ-CukKyuhZ.mjs";
2
+ import { _ as deserializeMongoOps, a as MongoMigrationRunnerExecuteOptions, b as renderOps, c as MongoTargetContract, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as deserializeMongoOp, h as RenderMigrationMeta, i as MongoMigrationRunnerErrorCode, l as MongoTargetContractSerializer, m as PlannerProducedMongoMigration, n as MongoMigrationPlanner, o as MongoMigrationRunnerFailure, p as PlanCallsResult, r as MongoMigrationRunner, s as MongoMigrationRunnerResult, t as FilterEvaluator, u as MongoTargetDatabase, v as mongoTargetDescriptor, x as serializeMongoOps, y as renderCallsToTypeScript } from "./control-1-RnMe4V.mjs";
3
+ export { CollModCall, type CollModMeta, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, type IndexCallOptions, MongoMigrationPlanner, MongoMigrationRunner, type MongoMigrationRunnerErrorCode, type MongoMigrationRunnerExecuteOptions, type MongoMigrationRunnerFailure, type MongoMigrationRunnerResult, type MongoTargetContract, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, type OpFactoryCall$1 as OpFactoryCall, type PlanCallsResult, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, type RenderMigrationMeta, UnsetFieldCall, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };
@@ -1,2 +1,2 @@
1
- import { C as schemaIndexToCreateIndexOptions, S as schemaCollectionToCreateCollectionOptions, _ as deserializeMongoOp, a as DropIndexCall, b as renderCallsToTypeScript, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as UnsetFieldCall, h as RenameFieldCall, i as DropCollectionCall, l as MongoTargetContractSerializer, m as RenameCollectionCall, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as deserializeMongoOps, w as serializeMongoOps, x as renderOps, y as mongoTargetDescriptor } from "./control-1k8tG3h1.mjs";
1
+ import { C as schemaIndexToCreateIndexOptions, S as schemaCollectionToCreateCollectionOptions, _ as deserializeMongoOp, a as DropIndexCall, b as renderCallsToTypeScript, c as MongoMigrationRunner, d as MongoTargetSchemaVerifier, f as MongoTargetUnboundDatabase, g as UnsetFieldCall, h as RenameFieldCall, i as DropCollectionCall, l as MongoTargetContractSerializer, m as RenameCollectionCall, n as CreateCollectionCall, o as FilterEvaluator, p as PlannerProducedMongoMigration, r as CreateIndexCall, s as MongoMigrationPlanner, t as CollModCall, u as MongoTargetDatabase, v as deserializeMongoOps, w as serializeMongoOps, x as renderOps, y as mongoTargetDescriptor } from "./control-BSgJpq4Q.mjs";
2
2
  export { CollModCall, CreateCollectionCall, CreateIndexCall, DropCollectionCall, DropIndexCall, FilterEvaluator, MongoMigrationPlanner, MongoMigrationRunner, MongoTargetContractSerializer, MongoTargetDatabase, MongoTargetSchemaVerifier, MongoTargetUnboundDatabase, PlannerProducedMongoMigration, RenameCollectionCall, RenameFieldCall, UnsetFieldCall, deserializeMongoOp, deserializeMongoOps, mongoTargetDescriptor, renderCallsToTypeScript, renderOps, schemaCollectionToCreateCollectionOptions, schemaIndexToCreateIndexOptions, serializeMongoOps };
@@ -1,2 +1,2 @@
1
- import { a as createIndex, c as dropIndex, d as renameField, f as setValidation, i as createCollection, l as placeholder, m as validatedCollection, n as MigrationCLI, o as dataTransform, p as unsetField, r as collMod, s as dropCollection, t as Migration, u as renameCollection } from "./migration-CoPXNa95.mjs";
1
+ import { a as createIndex, c as dropIndex, d as renameField, f as setValidation, i as createCollection, l as placeholder, m as validatedCollection, n as MigrationCLI, o as dataTransform, p as unsetField, r as collMod, s as dropCollection, t as Migration, u as renameCollection } from "./migration-BMUh33vn.mjs";
2
2
  export { Migration, MigrationCLI, collMod, createCollection, createIndex, dataTransform, dropCollection, dropIndex, placeholder, renameCollection, renameField, setValidation, unsetField, validatedCollection };
@@ -1,3 +1,3 @@
1
- import { a as dropCollection, c as renameField, d as unsetField, f as validatedCollection, i as dataTransform, l as setValidation, n as createCollection, o as dropIndex, r as createIndex, s as renameCollection, t as collMod } from "./migration-factories-DImj1ZN5-BtCob_1N.mjs";
1
+ import { a as dropCollection, c as renameField, d as unsetField, f as validatedCollection, i as dataTransform, l as setValidation, n as createCollection, o as dropIndex, r as createIndex, s as renameCollection, t as collMod } from "./migration-factories-CUyEIo5p-CXTwpgxe.mjs";
2
2
  import { n as MigrationCLI, r as placeholder, t as Migration } from "./migration-C-jfTsGU.mjs";
3
3
  export { Migration, MigrationCLI, collMod, createCollection, createIndex, dataTransform, dropCollection, dropIndex, placeholder, renameCollection, renameField, setValidation, unsetField, validatedCollection };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-target-mongo",
3
- "version": "8.0.0-rc.22-dev.12",
3
+ "version": "8.0.0-rc.22-dev.13",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -9,18 +9,18 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@prisma/orm-family-mongo": "8.0.0-rc.22-dev.12",
13
- "@prisma/orm-framework": "8.0.0-rc.22-dev.12",
14
- "@prisma/orm-toolchain": "8.0.0-rc.22-dev.12",
12
+ "@prisma/orm-family-mongo": "8.0.0-rc.22-dev.13",
13
+ "@prisma/orm-framework": "8.0.0-rc.22-dev.13",
14
+ "@prisma/orm-toolchain": "8.0.0-rc.22-dev.13",
15
15
  "arktype": "^2.2.2",
16
16
  "bson": "^7.2.0"
17
17
  },
18
18
  "devDependencies": {
19
- "@internal/adapter-mongo": "8.0.0-rc.22-dev.12",
20
- "@internal/driver-mongo": "8.0.0-rc.22-dev.12",
21
- "@internal/target-mongo": "8.0.0-rc.22-dev.12",
22
- "@repo/tsconfig": "8.0.0-rc.22-dev.12",
23
- "@repo/tsdown": "8.0.0-rc.22-dev.12",
19
+ "@internal/adapter-mongo": "8.0.0-rc.22-dev.13",
20
+ "@internal/driver-mongo": "8.0.0-rc.22-dev.13",
21
+ "@internal/target-mongo": "8.0.0-rc.22-dev.13",
22
+ "@repo/tsconfig": "8.0.0-rc.22-dev.13",
23
+ "@repo/tsdown": "8.0.0-rc.22-dev.13",
24
24
  "tsdown": "0.22.14",
25
25
  "typescript": "5.9.3"
26
26
  },