@prisma/orm-family-mongo 8.0.0-rc.12-dev.21 → 8.0.0-rc.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 (82) hide show
  1. package/dist/{authoring-entity-types-DkFfee0x-DzGu9hUw.mjs → authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs} +19 -6
  2. package/dist/authoring-entity-types-CZX-S_hY-w2tu7EVk.mjs.map +1 -0
  3. package/dist/codec.d.mts +1 -1
  4. package/dist/codec.mjs +1 -1
  5. package/dist/{contract-builder-DUX8KLUR.d.mts → contract-builder-CCmw_x_e.d.mts} +10 -1
  6. package/dist/contract-builder-CCmw_x_e.d.mts.map +1 -0
  7. package/dist/{contract-builder-ckSdJi66.mjs → contract-builder-DpMMVErz.mjs} +4 -1
  8. package/dist/contract-builder-DpMMVErz.mjs.map +1 -0
  9. package/dist/contract-prisma6__provider.mjs +1 -1
  10. package/dist/contract-psl.mjs +1 -1
  11. package/dist/contract-psl__provider.mjs +1 -1
  12. package/dist/contract-psl__provider.mjs.map +1 -1
  13. package/dist/contract-ts.d.mts +1 -1
  14. package/dist/contract-ts.mjs +1 -1
  15. package/dist/contract-ts__contract-builder.d.mts +1 -1
  16. package/dist/contract-ts__contract-builder.mjs +1 -1
  17. package/dist/{control-DNe7Gps7.d.mts → control-BKLGhv19.d.mts} +2 -2
  18. package/dist/{control-DNe7Gps7.d.mts.map → control-BKLGhv19.d.mts.map} +1 -1
  19. package/dist/{control-1yLRoWrD.mjs → control-DRB8P8fy.mjs} +3 -3
  20. package/dist/{control-1yLRoWrD.mjs.map → control-DRB8P8fy.mjs.map} +1 -1
  21. package/dist/{control-BqovaVpo.d.mts → control-DVqprwua.d.mts} +2 -2
  22. package/dist/{control-BqovaVpo.d.mts.map → control-DVqprwua.d.mts.map} +1 -1
  23. package/dist/{control-adapter-Bh_ZraGM-0OJf8f1R.d.mts → control-adapter-Bh_ZraGM-wsAkUbsg.d.mts} +3 -3
  24. package/dist/{control-adapter-Bh_ZraGM-0OJf8f1R.d.mts.map → control-adapter-Bh_ZraGM-wsAkUbsg.d.mts.map} +1 -1
  25. package/dist/control-adapter-DnXw3tmo.d.mts +1 -0
  26. package/dist/{dist-C7Ykq48Q.mjs → dist-CO2arS1K.mjs} +3 -1
  27. package/dist/dist-CO2arS1K.mjs.map +1 -0
  28. package/dist/{dist-Czwqx_i3.mjs → dist-CqUoKyeL.mjs} +1 -10
  29. package/dist/dist-CqUoKyeL.mjs.map +1 -0
  30. package/dist/{execution-CKnUiOfm.d.mts → execution-BRC7ECq8.d.mts} +2 -2
  31. package/dist/{execution-CKnUiOfm.d.mts.map → execution-BRC7ECq8.d.mts.map} +1 -1
  32. package/dist/family.d.mts +4 -4
  33. package/dist/family.mjs +2 -2
  34. package/dist/family__control-adapter.d.mts +2 -2
  35. package/dist/family__control.d.mts +1 -1
  36. package/dist/family__control.mjs +1 -1
  37. package/dist/family__migration.d.mts +1 -1
  38. package/dist/family__pack.mjs +2 -2
  39. package/dist/family__pack.mjs.map +1 -1
  40. package/dist/{field-accessor-DHsAPiW3-DpQqiFg4.d.mts → field-accessor-DHsAPiW3-mPtxx6Gz.d.mts} +4 -4
  41. package/dist/{field-accessor-DHsAPiW3-DpQqiFg4.d.mts.map → field-accessor-DHsAPiW3-mPtxx6Gz.d.mts.map} +1 -1
  42. package/dist/{index-Dv2PNMiG.d.mts → index--ynTw_5M.d.mts} +15 -5
  43. package/dist/index--ynTw_5M.d.mts.map +1 -0
  44. package/dist/index-9DDQlC5U.d.mts +87 -0
  45. package/dist/index-9DDQlC5U.d.mts.map +1 -0
  46. package/dist/{index-BOnCg-qJ.d.mts → index-BfTXOq5S.d.mts} +4 -4
  47. package/dist/{index-BOnCg-qJ.d.mts.map → index-BfTXOq5S.d.mts.map} +1 -1
  48. package/dist/{index-CrO8iljZ.d.mts → index-RT8HbGQG.d.mts} +5 -5
  49. package/dist/{index-CrO8iljZ.d.mts.map → index-RT8HbGQG.d.mts.map} +1 -1
  50. package/dist/{interpreter-lsgY0F-Q-BNJcdxhl.mjs → interpreter-EqDVFiIr-C-rDel_u.mjs} +20 -14
  51. package/dist/interpreter-EqDVFiIr-C-rDel_u.mjs.map +1 -0
  52. package/dist/lowering.d.mts +1 -1
  53. package/dist/{migration-CR6iaRZH.d.mts → migration-DAPtRIp2.d.mts} +2 -2
  54. package/dist/{migration-CR6iaRZH.d.mts.map → migration-DAPtRIp2.d.mts.map} +1 -1
  55. package/dist/orm.d.mts +3 -3
  56. package/dist/orm.mjs +37 -17
  57. package/dist/orm.mjs.map +1 -1
  58. package/dist/pack-BUb_cutQ.d.mts.map +1 -1
  59. package/dist/query-ast.d.mts +3 -3
  60. package/dist/query-ast__control.d.mts +2 -2
  61. package/dist/query-ast__execution.d.mts +2 -2
  62. package/dist/query-builder.d.mts +4 -4
  63. package/dist/query-builder__contract-free.d.mts +5 -5
  64. package/dist/{query-plan-C0-Yu8hf-DdilEdW6.d.mts → query-plan-C0-Yu8hf-BnYfzKMn.d.mts} +2 -2
  65. package/dist/{query-plan-C0-Yu8hf-DdilEdW6.d.mts.map → query-plan-C0-Yu8hf-BnYfzKMn.d.mts.map} +1 -1
  66. package/dist/runtime.d.mts +6 -6
  67. package/dist/runtime.mjs +7 -8
  68. package/dist/runtime.mjs.map +1 -1
  69. package/dist/value.d.mts +2 -2
  70. package/dist/value.mjs +1 -1
  71. package/dist/wire.d.mts +2 -2
  72. package/package.json +20 -20
  73. package/dist/authoring-entity-types-DkFfee0x-DzGu9hUw.mjs.map +0 -1
  74. package/dist/contract-builder-DUX8KLUR.d.mts.map +0 -1
  75. package/dist/contract-builder-ckSdJi66.mjs.map +0 -1
  76. package/dist/control-adapter-BAu56y_q.d.mts +0 -1
  77. package/dist/dist-C7Ykq48Q.mjs.map +0 -1
  78. package/dist/dist-Czwqx_i3.mjs.map +0 -1
  79. package/dist/index-Dv2PNMiG.d.mts.map +0 -1
  80. package/dist/index-wKMm41HC.d.mts +0 -30
  81. package/dist/index-wKMm41HC.d.mts.map +0 -1
  82. package/dist/interpreter-lsgY0F-Q-BNJcdxhl.mjs.map +0 -1
package/dist/orm.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"orm.mjs","names":["#contract","#modelName","#executor","#mutationDefaults","#collectionName","#state","#cloneWithVariant","#clone","#compileWhereObject","#query","#rejectIncludes","#withCreateDefaults","#injectDiscriminator","#stripUndefined","#toDocument","#drainPlan","#insertOneResultShape","#insertManyResultShape","#requireFilters","#rejectWindowing","#mergeFilters","#withUpdateDefaults","#resolveUpdateDoc","#modelResultShape","#readMatchingIds","#executePlan","#wrapFieldOpValue","#toSetFields","#compile","#planMeta","#wrapCommand","#modelFields","#idFieldShape","#wrapFieldValue","#wrapValueObject","#appliedDefaults","#toUpdateDocument","#wrapDotPathValue","#variantName"],"sources":["../../../../2-mongo-family/5-query-builders/orm/dist/index.mjs"],"sourcesContent":["import { domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace } from \"@internal/contract/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { AsyncIterableResult } from \"@internal/framework-components/runtime\";\nimport { AggregateCommand, DeleteManyCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, InsertOneCommand, MongoAndExpr, MongoFieldFilter, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoProjectStage, MongoSkipStage, MongoSortStage, MongoUnwindStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, freezeMongoResultShape, isMongoFilterExpr } from \"@internal/mongo-query-ast/execution\";\nimport { contractFieldToMongoFieldShape, contractModelToMongoResultShape } from \"@internal/mongo-query-builder\";\nimport { MongoParamRef } from \"@internal/mongo-value\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/collection-state.ts\nfunction emptyCollectionState() {\n\treturn {\n\t\tfilters: [],\n\t\tincludes: [],\n\t\torderBy: void 0,\n\t\tselectedFields: void 0,\n\t\tlimit: void 0,\n\t\toffset: void 0\n\t};\n}\n//#endregion\n//#region src/compile.ts\nfunction compileIncludes(includes) {\n\tconst stages = [];\n\tfor (const inc of includes) {\n\t\tstages.push(new MongoLookupStage({\n\t\t\tfrom: inc.from,\n\t\t\tlocalField: inc.localField,\n\t\t\tforeignField: inc.foreignField,\n\t\t\tas: inc.relationName\n\t\t}));\n\t\tif (inc.cardinality === \"N:1\" || inc.cardinality === \"1:1\") stages.push(new MongoUnwindStage(`$${inc.relationName}`, true));\n\t}\n\treturn stages;\n}\nfunction compileMongoQuery(collection, state, storageHash, model) {\n\tconst stages = [];\n\tconst singleFilter = state.filters.length === 1 ? state.filters[0] : void 0;\n\tif (singleFilter) stages.push(new MongoMatchStage(singleFilter));\n\telse if (state.filters.length > 1) stages.push(new MongoMatchStage(MongoAndExpr.of([...state.filters])));\n\tif (state.includes.length > 0) stages.push(...compileIncludes(state.includes));\n\tif (state.orderBy) stages.push(new MongoSortStage(state.orderBy));\n\tif (state.offset !== void 0) stages.push(new MongoSkipStage(state.offset));\n\tif (state.limit !== void 0) stages.push(new MongoLimitStage(state.limit));\n\tif (state.selectedFields && state.selectedFields.length > 0) {\n\t\tconst projection = {};\n\t\tfor (const field of state.selectedFields) projection[field] = 1;\n\t\tfor (const inc of state.includes) projection[inc.relationName] = 1;\n\t\tif (!Object.hasOwn(projection, \"_id\")) projection[\"_id\"] = 0;\n\t\tstages.push(new MongoProjectStage(projection));\n\t}\n\tconst meta = {\n\t\ttarget: \"mongo\",\n\t\tstorageHash,\n\t\tlane: \"mongo-orm\"\n\t};\n\tconst command = new AggregateCommand(collection, stages);\n\tconst selection = state.selectedFields !== void 0 && state.selectedFields.length > 0 ? state.selectedFields : void 0;\n\tconst includeRelationNames = state.includes.length > 0 ? state.includes.map((inc) => inc.relationName) : void 0;\n\treturn {\n\t\tcollection,\n\t\tcommand,\n\t\tmeta,\n\t\tresultShape: contractModelToMongoResultShape(model, {\n\t\t\t...ifDefined(\"selection\", selection),\n\t\t\t...ifDefined(\"includeRelationNames\", includeRelationNames)\n\t\t})\n\t};\n}\n//#endregion\n//#region src/field-accessor.ts\nfunction createFieldExpression(fieldPath) {\n\treturn {\n\t\tset(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$set\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tunset() {\n\t\t\treturn {\n\t\t\t\toperator: \"$unset\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(\"\")\n\t\t\t};\n\t\t},\n\t\tinc(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$inc\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tmul(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$mul\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpush(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$push\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpull(match) {\n\t\t\treturn {\n\t\t\t\toperator: \"$pull\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(match)\n\t\t\t};\n\t\t},\n\t\taddToSet(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$addToSet\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpop(end) {\n\t\t\treturn {\n\t\t\t\toperator: \"$pop\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(end)\n\t\t\t};\n\t\t}\n\t};\n}\nfunction createFieldAccessor() {\n\treturn new Proxy((() => {}), {\n\t\tget(_target, prop) {\n\t\t\treturn createFieldExpression(prop);\n\t\t},\n\t\tapply(_target, _thisArg, args) {\n\t\t\treturn createFieldExpression(args[0]);\n\t\t}\n\t});\n}\nfunction compileFieldOperations(ops, wrapValue) {\n\tconst grouped = {};\n\tfor (const op of ops) {\n\t\tlet group = grouped[op.operator];\n\t\tif (!group) {\n\t\t\tgroup = {};\n\t\t\tgrouped[op.operator] = group;\n\t\t}\n\t\tgroup[op.field] = wrapValue(op.field, op.value, op.operator);\n\t}\n\treturn grouped;\n}\n//#endregion\n//#region src/orm-errors.ts\nfunction ormError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/collection.ts\nfunction resolveCollectionName(model, modelName) {\n\treturn model.storage.collection ?? modelName;\n}\nfunction topLevelUpdateFields(updateDoc) {\n\tconst fields = /* @__PURE__ */ new Set();\n\tfor (const operatorGroup of Object.values(updateDoc)) for (const fieldPath of Object.keys(operatorGroup)) fields.add(fieldPath.split(\".\")[0] ?? fieldPath);\n\treturn fields;\n}\nfunction isUnknownRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nvar MongoCollectionImpl = class MongoCollectionImpl {\n\t#contract;\n\t#modelName;\n\t#executor;\n\t#mutationDefaults;\n\t#collectionName;\n\t#state;\n\t#variantName;\n\tconstructor(contract, modelName, executor, mutationDefaults) {\n\t\tthis.#contract = contract;\n\t\tthis.#modelName = modelName;\n\t\tthis.#executor = executor;\n\t\tthis.#mutationDefaults = mutationDefaults;\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(contract.domain)[modelName]);\n\t\tthis.#collectionName = resolveCollectionName(model, modelName);\n\t\tthis.#state = emptyCollectionState();\n\t}\n\tvariant(variantName) {\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model?.discriminator || !model.variants) return blindCast(this);\n\t\tconst variantEntry = model.variants[variantName];\n\t\tif (!variantEntry) return blindCast(this);\n\t\tconst filter = MongoFieldFilter.eq(model.discriminator.field, new MongoParamRef(variantEntry.value));\n\t\treturn this.#cloneWithVariant({ filters: [...this.#state.filters, filter] }, variantName);\n\t}\n\twhere(filter) {\n\t\tif (isMongoFilterExpr(filter)) return this.#clone({ filters: [...this.#state.filters, filter] });\n\t\tconst compiled = this.#compileWhereObject(blindCast(filter));\n\t\treturn this.#clone({ filters: [...this.#state.filters, ...compiled] });\n\t}\n\tselect(...fields) {\n\t\treturn this.#clone({ selectedFields: [...this.#state.selectedFields ?? [], ...fields] });\n\t}\n\tinclude(relationName) {\n\t\tconst relation = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]).relations?.[relationName];\n\t\tif (!relation) throw ormError(\"ORM.RELATION_UNKNOWN\", `Unknown relation \"${relationName}\" on model \"${this.#modelName}\"`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tif (!(\"on\" in relation)) throw ormError(\"ORM.INCLUDE_UNSUPPORTED\", `Relation \"${relationName}\" is an embed relation — only reference relations can be included`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tconst ref = relation;\n\t\tconst localField = ref.on.localFields[0];\n\t\tconst foreignField = ref.on.targetFields[0];\n\t\tif (!localField || !foreignField || ref.on.localFields.length !== 1 || ref.on.targetFields.length !== 1) throw ormError(\"ORM.INCLUDE_UNSUPPORTED\", `Compound references are not yet supported: relation \"${relationName}\"`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tconst targetModelName = ref.to.model;\n\t\tconst targetModel = castAs(domainModelsAtDefaultNamespace(this.#contract.domain)[targetModelName]);\n\t\tif (!targetModel) throw new InternalError(`Target model \"${targetModelName}\" not found for relation \"${relationName}\"`);\n\t\tconst includeExpr = {\n\t\t\trelationName,\n\t\t\tfrom: resolveCollectionName(targetModel, targetModelName),\n\t\t\tlocalField,\n\t\t\tforeignField,\n\t\t\tcardinality: ref.cardinality\n\t\t};\n\t\treturn blindCast(this.#clone({ includes: [...this.#state.includes, includeExpr] }));\n\t}\n\torderBy(spec) {\n\t\tconst merged = {\n\t\t\t...this.#state.orderBy,\n\t\t\t...spec\n\t\t};\n\t\treturn this.#clone({ orderBy: merged });\n\t}\n\tlimit(n) {\n\t\treturn this.#clone({ limit: n });\n\t}\n\toffset(n) {\n\t\treturn this.#clone({ offset: n });\n\t}\n\tall() {\n\t\treturn this.#query();\n\t}\n\tasync first() {\n\t\tconst result = this.#clone({ limit: 1 }).#query();\n\t\tfor await (const row of result) return row;\n\t\treturn null;\n\t}\n\tasync create(data) {\n\t\tthis.#rejectIncludes(\"create\");\n\t\tconst normalized = this.#withCreateDefaults(this.#injectDiscriminator(this.#stripUndefined(blindCast(data))), /* @__PURE__ */ new Map());\n\t\tconst document = this.#toDocument(normalized);\n\t\tconst command = new InsertOneCommand(this.#collectionName, document);\n\t\tconst insertedId = blindCast((await this.#drainPlan(command, this.#insertOneResultShape()))[0]).insertedId;\n\t\treturn blindCast({\n\t\t\t_id: insertedId,\n\t\t\t...normalized\n\t\t});\n\t}\n\tcreateAll(data) {\n\t\tthis.#rejectIncludes(\"createAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\t\tconst normalizedRows = data.map((d) => self.#withCreateDefaults(self.#injectDiscriminator(self.#stripUndefined(blindCast(d))), defaultValueCache));\n\t\t\tconst documents = normalizedRows.map((d) => self.#toDocument(d));\n\t\t\tconst command = new InsertManyCommand(self.#collectionName, documents);\n\t\t\tconst insertedIds = blindCast((await self.#drainPlan(command, self.#insertManyResultShape()))[0]).insertedIds;\n\t\t\tfor (let i = 0; i < normalizedRows.length; i++) yield blindCast({\n\t\t\t\t_id: insertedIds[i],\n\t\t\t\t...normalizedRows[i]\n\t\t\t});\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync createAndCount(data) {\n\t\tthis.#rejectIncludes(\"createAndCount\");\n\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\tconst documents = data.map((d) => this.#toDocument(this.#withCreateDefaults(this.#injectDiscriminator(this.#stripUndefined(blindCast(d))), defaultValueCache)));\n\t\tconst command = new InsertManyCommand(this.#collectionName, documents);\n\t\treturn blindCast((await this.#drainPlan(command))[0]).insertedCount;\n\t}\n\tasync update(dataOrCallback) {\n\t\tthis.#requireFilters(\"update\");\n\t\tthis.#rejectWindowing(\"update\");\n\t\tthis.#rejectIncludes(\"update\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst updateDoc = this.#withUpdateDefaults(this.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\tconst command = new FindOneAndUpdateCommand(this.#collectionName, filter, updateDoc, false);\n\t\tconst result = (await this.#drainPlan(command, this.#modelResultShape()))[0];\n\t\treturn result === void 0 ? null : blindCast(result);\n\t}\n\tupdateAll(dataOrCallback) {\n\t\tthis.#requireFilters(\"updateAll\");\n\t\tthis.#rejectWindowing(\"updateAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst ids = await self.#readMatchingIds();\n\t\t\tif (ids.length === 0) return;\n\t\t\tconst filter = self.#mergeFilters();\n\t\t\tconst updateDoc = self.#withUpdateDefaults(self.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\t\tconst command = new UpdateManyCommand(self.#collectionName, filter, updateDoc);\n\t\t\tawait self.#drainPlan(command);\n\t\t\tconst idFilter = MongoFieldFilter.in(\"_id\", ids.map((id) => new MongoParamRef(id)));\n\t\t\tyield* self.#clone({ filters: [idFilter] }).#query();\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync updateAndCount(dataOrCallback) {\n\t\tthis.#requireFilters(\"updateAndCount\");\n\t\tthis.#rejectWindowing(\"updateAndCount\");\n\t\tthis.#rejectIncludes(\"updateAndCount\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst updateDoc = this.#withUpdateDefaults(this.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\tconst command = new UpdateManyCommand(this.#collectionName, filter, updateDoc);\n\t\treturn (await this.#executePlan(command)).affectedRows;\n\t}\n\tasync delete() {\n\t\tthis.#requireFilters(\"delete\");\n\t\tthis.#rejectWindowing(\"delete\");\n\t\tthis.#rejectIncludes(\"delete\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst command = new FindOneAndDeleteCommand(this.#collectionName, filter);\n\t\tconst result = (await this.#drainPlan(command, this.#modelResultShape()))[0];\n\t\treturn result === void 0 ? null : blindCast(result);\n\t}\n\tdeleteAll() {\n\t\tthis.#requireFilters(\"deleteAll\");\n\t\tthis.#rejectWindowing(\"deleteAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst docs = [];\n\t\t\tfor await (const row of self.#query()) docs.push(row);\n\t\t\tconst filter = self.#mergeFilters();\n\t\t\tconst command = new DeleteManyCommand(self.#collectionName, filter);\n\t\t\tawait self.#drainPlan(command);\n\t\t\tyield* docs;\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync deleteAndCount() {\n\t\tthis.#requireFilters(\"deleteAndCount\");\n\t\tthis.#rejectWindowing(\"deleteAndCount\");\n\t\tthis.#rejectIncludes(\"deleteAndCount\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst command = new DeleteManyCommand(this.#collectionName, filter);\n\t\treturn (await this.#executePlan(command)).affectedRows;\n\t}\n\tasync upsert(input) {\n\t\tthis.#requireFilters(\"upsert\");\n\t\tthis.#rejectWindowing(\"upsert\");\n\t\tthis.#rejectIncludes(\"upsert\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\tconst allCreateFields = this.#toDocument(this.#withCreateDefaults(this.#injectDiscriminator(this.#stripUndefined(blindCast(input.create))), defaultValueCache));\n\t\tlet updateDoc;\n\t\tif (typeof input.update === \"function\") {\n\t\t\tconst accessor = createFieldAccessor();\n\t\t\tconst ops = input.update(accessor);\n\t\t\tif (ops.find((op) => op.field === \"_id\")) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tconst dotPathOp = ops.find((op) => op.field.includes(\".\"));\n\t\t\tif (dotPathOp) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `upsert() does not support dot-path field operations (found \"${dotPathOp.field}\"). Dot-path updates conflict with \\$setOnInsert on the insert path, producing incomplete documents. Use top-level field operations instead.`, { meta: {\n\t\t\t\tmethod: \"upsert\",\n\t\t\t\tfield: dotPathOp.field\n\t\t\t} });\n\t\t\tupdateDoc = compileFieldOperations(ops, (field, value, operator) => this.#wrapFieldOpValue(field, value, operator));\n\t\t} else {\n\t\t\tconst setFields = this.#toSetFields(blindCast(input.update));\n\t\t\tupdateDoc = {};\n\t\t\tif (Object.keys(setFields).length > 0) updateDoc[\"$set\"] = setFields;\n\t\t}\n\t\tupdateDoc = this.#withUpdateDefaults(updateDoc, defaultValueCache);\n\t\tconst updatedFields = topLevelUpdateFields(updateDoc);\n\t\tconst insertOnlyFields = {};\n\t\tfor (const [key, value] of Object.entries(allCreateFields)) if (!updatedFields.has(key)) insertOnlyFields[key] = value;\n\t\tif (Object.keys(insertOnlyFields).length > 0) updateDoc[\"$setOnInsert\"] = insertOnlyFields;\n\t\tconst command = new FindOneAndUpdateCommand(this.#collectionName, filter, updateDoc, true);\n\t\treturn blindCast((await this.#drainPlan(command, this.#modelResultShape()))[0]);\n\t}\n\tasync #readMatchingIds() {\n\t\tconst idQuery = this.#clone({\n\t\t\tincludes: [],\n\t\t\tselectedFields: [\"_id\"],\n\t\t\torderBy: void 0,\n\t\t\tlimit: void 0,\n\t\t\toffset: void 0\n\t\t});\n\t\tconst ids = [];\n\t\tconst { resultShape: _rs, ...planWithoutShape } = idQuery.#compile();\n\t\tfor await (const row of this.#executor.query(planWithoutShape)) {\n\t\t\tconst storageRow = blindCast(row);\n\t\t\tids.push(storageRow[\"_id\"]);\n\t\t}\n\t\treturn ids;\n\t}\n\t#query() {\n\t\tconst plan = this.#compile();\n\t\treturn this.#executor.query(plan);\n\t}\n\t#compile() {\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model: \"${this.#modelName}\".`, { meta: { model: this.#modelName } });\n\t\treturn compileMongoQuery(this.#collectionName, this.#state, this.#contract.storage.storageHash, model);\n\t}\n\t#wrapCommand(command, resultShape) {\n\t\treturn {\n\t\t\tcollection: this.#collectionName,\n\t\t\tcommand,\n\t\t\tmeta: this.#planMeta(),\n\t\t\t...ifDefined(\"resultShape\", resultShape)\n\t\t};\n\t}\n\t#executePlan(command) {\n\t\treturn this.#executor.execute(this.#wrapCommand(command));\n\t}\n\tasync #drainPlan(command, resultShape) {\n\t\tconst plan = this.#wrapCommand(command, resultShape);\n\t\tconst result = this.#executor.query(plan);\n\t\tconst rows = [];\n\t\tfor await (const row of result) rows.push(row);\n\t\treturn rows;\n\t}\n\t#modelFields() {\n\t\treturn blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName])?.fields ?? {};\n\t}\n\t#idFieldShape() {\n\t\tconst idField = this.#modelFields()[\"_id\"];\n\t\treturn idField ? contractFieldToMongoFieldShape(idField) : Object.freeze({ kind: \"unknown\" });\n\t}\n\t#insertOneResultShape() {\n\t\treturn freezeMongoResultShape({\n\t\t\tkind: \"document\",\n\t\t\tfields: { insertedId: this.#idFieldShape() }\n\t\t});\n\t}\n\t#insertManyResultShape() {\n\t\treturn freezeMongoResultShape({\n\t\t\tkind: \"document\",\n\t\t\tfields: { insertedIds: {\n\t\t\t\tkind: \"array\",\n\t\t\t\tnullable: false,\n\t\t\t\telement: this.#idFieldShape()\n\t\t\t} }\n\t\t});\n\t}\n\t#modelResultShape() {\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model) return Object.freeze({ kind: \"unknown\" });\n\t\treturn contractModelToMongoResultShape(model);\n\t}\n\t#compileWhereObject(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst filters = [];\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst wrapped = this.#wrapFieldValue(value, fields[key]);\n\t\t\tfilters.push(MongoFieldFilter.eq(key, wrapped));\n\t\t}\n\t\treturn filters;\n\t}\n\t#wrapFieldValue(value, field) {\n\t\tif (field === void 0) return new MongoParamRef(value);\n\t\tif (field.type.kind === \"scalar\") return new MongoParamRef(value, { codecId: field.type.codecId });\n\t\tif (field.type.kind === \"valueObject\") {\n\t\t\tconst voName = field.type.name;\n\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\tif (!voDef || value === null) return new MongoParamRef(value);\n\t\t\tif (field.many && Array.isArray(value)) return value.map((item) => this.#wrapValueObject(blindCast(item), voDef));\n\t\t\treturn this.#wrapValueObject(blindCast(value), voDef);\n\t\t}\n\t\treturn new MongoParamRef(value);\n\t}\n\t#wrapValueObject(data, voDef) {\n\t\tconst doc = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst fieldDef = voDef.fields[key];\n\t\t\tdoc[key] = this.#wrapFieldValue(value, fieldDef);\n\t\t}\n\t\treturn doc;\n\t}\n\t#toDocument(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst doc = {};\n\t\tfor (const [key, value] of Object.entries(data)) if (value !== void 0) doc[key] = this.#wrapFieldValue(value, fields[key]);\n\t\treturn doc;\n\t}\n\t#toSetFields(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (key === \"_id\" && value !== void 0) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tif (value !== void 0) result[key] = this.#wrapFieldValue(value, fields[key]);\n\t\t}\n\t\treturn result;\n\t}\n\t#appliedDefaults(op, values, defaultValueCache) {\n\t\tconst applied = this.#mutationDefaults?.applyMutationDefaults({\n\t\t\top,\n\t\t\tnamespace: UNBOUND_NAMESPACE_ID,\n\t\t\tentry: this.#collectionName,\n\t\t\tvalues,\n\t\t\tdefaultValueCache\n\t\t}) ?? [];\n\t\treturn Object.fromEntries(applied.map(({ field, value }) => [field, value]));\n\t}\n\t#withCreateDefaults(values, defaultValueCache) {\n\t\treturn {\n\t\t\t...values,\n\t\t\t...this.#appliedDefaults(\"create\", values, defaultValueCache)\n\t\t};\n\t}\n\t#withUpdateDefaults(updateDoc, defaultValueCache) {\n\t\tconst explicit = Object.fromEntries([...topLevelUpdateFields(updateDoc)].map((field) => [field, true]));\n\t\tconst generated = this.#appliedDefaults(\"update\", explicit, defaultValueCache);\n\t\tif (Object.keys(generated).length === 0) return updateDoc;\n\t\treturn {\n\t\t\t...updateDoc,\n\t\t\t$set: {\n\t\t\t\t...updateDoc[\"$set\"],\n\t\t\t\t...this.#toSetFields(generated)\n\t\t\t}\n\t\t};\n\t}\n\t#stripUndefined(data) {\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(data)) if (value !== void 0) result[key] = value;\n\t\treturn result;\n\t}\n\t#toUpdateDocument(data) {\n\t\treturn { $set: this.#toSetFields(data) };\n\t}\n\t#resolveUpdateDoc(dataOrCallback) {\n\t\tif (typeof dataOrCallback === \"function\") {\n\t\t\tconst ops = dataOrCallback(createFieldAccessor());\n\t\t\tif (ops.find((op) => op.field === \"_id\")) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tif (ops.length === 0) return { $set: {} };\n\t\t\treturn compileFieldOperations(ops, (field, value, operator) => this.#wrapFieldOpValue(field, value, operator));\n\t\t}\n\t\treturn this.#toUpdateDocument(blindCast(dataOrCallback));\n\t}\n\t#wrapFieldOpValue(field, value, operator) {\n\t\tif (operator === \"$unset\") return value;\n\t\tconst topLevelField = field.split(\".\")[0] ?? field;\n\t\tconst contractField = this.#modelFields()[topLevelField];\n\t\tif (!contractField) return value;\n\t\tif (field.includes(\".\")) return this.#wrapDotPathValue(field, value);\n\t\tif (value instanceof MongoParamRef && contractField.type.kind === \"scalar\") return new MongoParamRef(value.value, { codecId: contractField.type.codecId });\n\t\tif (contractField.type.kind === \"valueObject\" && value instanceof MongoParamRef) {\n\t\t\tconst raw = value.value;\n\t\t\tif (isUnknownRecord(raw)) {\n\t\t\t\tconst voName = contractField.type.name;\n\t\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\t\tif (voDef) return this.#wrapValueObject(raw, voDef);\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}\n\t#wrapDotPathValue(dotPath, value) {\n\t\tconst parts = dotPath.split(\".\");\n\t\tconst fields = this.#modelFields();\n\t\tlet currentField = parts[0] ? fields[parts[0]] : void 0;\n\t\tfor (let i = 1; i < parts.length; i++) {\n\t\t\tif (currentField?.type.kind !== \"valueObject\") return value;\n\t\t\tconst voName = currentField.type.name;\n\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\tif (!voDef) return value;\n\t\t\tconst partKey = parts[i];\n\t\t\tcurrentField = partKey ? voDef.fields[partKey] : void 0;\n\t\t}\n\t\tif (currentField?.type.kind === \"scalar\" && value instanceof MongoParamRef) return new MongoParamRef(value.value, { codecId: currentField.type.codecId });\n\t\tif (currentField?.type.kind === \"valueObject\" && value instanceof MongoParamRef) {\n\t\t\tconst raw = value.value;\n\t\t\tif (isUnknownRecord(raw)) {\n\t\t\t\tconst voName = currentField.type.name;\n\t\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\t\tif (voDef) return this.#wrapValueObject(raw, voDef);\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}\n\t#mergeFilters() {\n\t\tconst [single] = this.#state.filters;\n\t\tif (this.#state.filters.length === 1 && single) return single;\n\t\treturn MongoAndExpr.of([...this.#state.filters]);\n\t}\n\t#requireFilters(methodName) {\n\t\tif (this.#state.filters.length === 0) throw ormError(\"ORM.WHERE_MISSING\", `${methodName}() requires a .where() filter. Call .where() before .${methodName}()`, { meta: { method: methodName } });\n\t}\n\t#rejectWindowing(methodName) {\n\t\tif (this.#state.orderBy !== void 0 || this.#state.limit !== void 0 || this.#state.offset !== void 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `${methodName}() does not support orderBy/offset/limit. Remove windowing before calling .${methodName}()`, { meta: {\n\t\t\tmethod: methodName,\n\t\t\treason: \"windowing\"\n\t\t} });\n\t}\n\t#rejectIncludes(methodName) {\n\t\tif (this.#state.includes.length > 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `${methodName}() does not support .include(). Remove includes before calling .${methodName}()`, { meta: {\n\t\t\tmethod: methodName,\n\t\t\treason: \"includes\"\n\t\t} });\n\t}\n\t#planMeta() {\n\t\treturn {\n\t\t\ttarget: \"mongo\",\n\t\t\tstorageHash: this.#contract.storage.storageHash,\n\t\t\tlane: \"mongo-orm\"\n\t\t};\n\t}\n\t#injectDiscriminator(data) {\n\t\tif (!this.#variantName) return data;\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model?.discriminator || !model.variants) return data;\n\t\tconst variantEntry = model.variants[this.#variantName];\n\t\tif (!variantEntry) return data;\n\t\treturn {\n\t\t\t...data,\n\t\t\t[model.discriminator.field]: variantEntry.value\n\t\t};\n\t}\n\t#clone(overrides) {\n\t\tconst instance = new MongoCollectionImpl(this.#contract, this.#modelName, this.#executor, this.#mutationDefaults);\n\t\tinstance.#state = {\n\t\t\t...this.#state,\n\t\t\t...overrides\n\t\t};\n\t\tinstance.#collectionName = this.#collectionName;\n\t\tinstance.#variantName = this.#variantName;\n\t\treturn instance;\n\t}\n\t#cloneWithVariant(overrides, variantName) {\n\t\tconst instance = new MongoCollectionImpl(this.#contract, this.#modelName, this.#executor, this.#mutationDefaults);\n\t\tinstance.#state = {\n\t\t\t...this.#state,\n\t\t\t...overrides\n\t\t};\n\t\tinstance.#collectionName = this.#collectionName;\n\t\tinstance.#variantName = variantName;\n\t\treturn instance;\n\t}\n};\nfunction createMongoCollection(contract, modelName, executor, mutationDefaults) {\n\treturn new MongoCollectionImpl(contract, modelName, executor, mutationDefaults);\n}\n//#endregion\n//#region src/mongo-orm.ts\nfunction mongoOrm(options) {\n\tconst { contract, executor, mutationDefaults } = options;\n\tconst executionDefaults = contract.execution?.mutations.defaults ?? [];\n\tif (executionDefaults.length > 0 && mutationDefaults === void 0) throw ormError(\"ORM.MUTATION_DEFAULTS_MISSING\", \"The contract has execution defaults (fields such as temporal.createdAt() that the ORM fills on write), but mongoOrm() was built without mutationDefaults, so those fields would never be written. Pass the execution context: mongoOrm({ contract, executor, mutationDefaults: context }), or create the client with mongo().\", { meta: { fields: executionDefaults.map((d) => `${d.ref.entry}.${d.ref.field}`) } });\n\tconst client = {};\n\tfor (const [rootName, rootRef] of Object.entries(contract.roots)) client[rootName] = createMongoCollection(contract, blindCast(rootRef.model), executor, mutationDefaults);\n\treturn blindCast(client);\n}\n//#endregion\n//#region src/raw-collection.ts\nfunction createRawMongoCollection(collectionName, meta) {\n\tfunction buildable(command) {\n\t\treturn { build: () => ({\n\t\t\tcollection: collectionName,\n\t\t\tcommand,\n\t\t\tmeta\n\t\t}) };\n\t}\n\treturn {\n\t\taggregate(pipeline) {\n\t\t\treturn buildable(new RawAggregateCommand(collectionName, pipeline));\n\t\t},\n\t\tinsertOne(document) {\n\t\t\treturn buildable(new RawInsertOneCommand(collectionName, document));\n\t\t},\n\t\tinsertMany(documents) {\n\t\t\treturn buildable(new RawInsertManyCommand(collectionName, documents));\n\t\t},\n\t\tupdateOne(filter, update) {\n\t\t\treturn buildable(new RawUpdateOneCommand(collectionName, filter, update));\n\t\t},\n\t\tupdateMany(filter, update) {\n\t\t\treturn buildable(new RawUpdateManyCommand(collectionName, filter, update));\n\t\t},\n\t\tdeleteOne(filter) {\n\t\t\treturn buildable(new RawDeleteOneCommand(collectionName, filter));\n\t\t},\n\t\tdeleteMany(filter) {\n\t\t\treturn buildable(new RawDeleteManyCommand(collectionName, filter));\n\t\t},\n\t\tfindOneAndUpdate(filter, update, options) {\n\t\t\treturn buildable(new RawFindOneAndUpdateCommand(collectionName, filter, update, options?.upsert ?? false));\n\t\t},\n\t\tfindOneAndDelete(filter) {\n\t\t\treturn buildable(new RawFindOneAndDeleteCommand(collectionName, filter));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/mongo-raw.ts\nfunction mongoRaw(options) {\n\tconst { contract } = options;\n\treturn { collection(rootName) {\n\t\tconst modelName = contract.roots[rootName]?.model;\n\t\tconst models = domainModelsAtDefaultNamespace(contract.domain);\n\t\tif (!modelName || !Object.hasOwn(models, modelName)) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model \"${modelName ?? \"\"}\" for root \"${rootName}\"`, { meta: {\n\t\t\tmodel: modelName ?? \"\",\n\t\t\troot: rootName\n\t\t} });\n\t\treturn createRawMongoCollection(models[modelName].storage.collection ?? modelName, {\n\t\t\ttarget: \"mongo\",\n\t\t\tstorageHash: contract.storage.storageHash,\n\t\t\tlane: \"mongo-raw\"\n\t\t});\n\t} };\n}\n//#endregion\nexport { compileMongoQuery, createFieldAccessor, createMongoCollection, mongoOrm, mongoRaw };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAWA,SAAS,uBAAuB;CAC/B,OAAO;EACN,SAAS,CAAC;EACV,UAAU,CAAC;EACX,SAAS,KAAK;EAC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GA,SAAS,SAAS,SAAS;CAC1B,MAAM,EAAE,aAAa;CACrB,OAAO,EAAE,WAAW,UAAU;EAC7B,MAAM,YAAY,SAAS,MAAM,SAAS,EAAE;EAC5C,MAAM,SAAS,+BAA+B,SAAS,MAAM;EAC7D,IAAI,CAAC,aAAa,CAAC,OAAO,OAAO,QAAQ,SAAS,GAAG,MAAM,SAAS,qBAAqB,kBAAkB,aAAa,GAAG,cAAc,SAAS,IAAI,EAAE,MAAM;GAC7J,OAAO,aAAa;GACpB,MAAM;EACP,EAAE,CAAC;EACH,OAAO,yBAAyB,OAAO,UAAU,CAAC,QAAQ,cAAc,WAAW;GAClF,QAAQ;GACR,aAAa,SAAS,QAAQ;GAC9B,MAAM;EACP,CAAC;CACF,EAAE;AACH"}
1
+ {"version":3,"file":"orm.mjs","names":["#contract","#modelName","#executor","#mutationDefaults","#collectionName","#state","#cloneWithVariant","#clone","#compileWhereObject","#query","#rejectIncludes","#withCreateDefaults","#injectDiscriminator","#stripUndefined","#toDocument","#drainPlan","#insertOneResultShape","#insertManyResultShape","#requireFilters","#rejectWindowing","#mergeFilters","#withUpdateDefaults","#resolveUpdateDoc","#modelResultShape","#readMatchingIds","#executePlan","#wrapFieldOpValue","#toSetFields","#compile","#modelWithVariantFields","#planMeta","#wrapCommand","#variantName","#modelFields","#idFieldShape","#wrapFieldValue","#fieldParam","#wrapValueObject","#appliedDefaults","#toUpdateDocument","#wrapDotPathValue"],"sources":["../../../../2-mongo-family/5-query-builders/orm/dist/index.mjs"],"sourcesContent":["import { domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace } from \"@internal/contract/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { AsyncIterableResult } from \"@internal/framework-components/runtime\";\nimport { AggregateCommand, DeleteManyCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, InsertOneCommand, MongoAndExpr, MongoFieldFilter, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoProjectStage, MongoSkipStage, MongoSortStage, MongoUnwindStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, freezeMongoResultShape, isMongoFilterExpr } from \"@internal/mongo-query-ast/execution\";\nimport { contractFieldToMongoFieldShape, contractModelToMongoResultShape } from \"@internal/mongo-query-builder\";\nimport { MongoParamRef } from \"@internal/mongo-value\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/collection-state.ts\nfunction emptyCollectionState() {\n\treturn {\n\t\tfilters: [],\n\t\tincludes: [],\n\t\torderBy: void 0,\n\t\tselectedFields: void 0,\n\t\tlimit: void 0,\n\t\toffset: void 0\n\t};\n}\n//#endregion\n//#region src/compile.ts\nfunction compileIncludes(includes) {\n\tconst stages = [];\n\tfor (const inc of includes) {\n\t\tstages.push(new MongoLookupStage({\n\t\t\tfrom: inc.from,\n\t\t\tlocalField: inc.localField,\n\t\t\tforeignField: inc.foreignField,\n\t\t\tas: inc.relationName\n\t\t}));\n\t\tif (inc.cardinality === \"N:1\" || inc.cardinality === \"1:1\") stages.push(new MongoUnwindStage(`$${inc.relationName}`, true));\n\t}\n\treturn stages;\n}\nfunction compileMongoQuery(collection, state, storageHash, model) {\n\tconst stages = [];\n\tconst singleFilter = state.filters.length === 1 ? state.filters[0] : void 0;\n\tif (singleFilter) stages.push(new MongoMatchStage(singleFilter));\n\telse if (state.filters.length > 1) stages.push(new MongoMatchStage(MongoAndExpr.of([...state.filters])));\n\tif (state.includes.length > 0) stages.push(...compileIncludes(state.includes));\n\tif (state.orderBy) stages.push(new MongoSortStage(state.orderBy));\n\tif (state.offset !== void 0) stages.push(new MongoSkipStage(state.offset));\n\tif (state.limit !== void 0) stages.push(new MongoLimitStage(state.limit));\n\tif (state.selectedFields && state.selectedFields.length > 0) {\n\t\tconst projection = {};\n\t\tfor (const field of state.selectedFields) projection[field] = 1;\n\t\tfor (const inc of state.includes) projection[inc.relationName] = 1;\n\t\tif (!Object.hasOwn(projection, \"_id\")) projection[\"_id\"] = 0;\n\t\tstages.push(new MongoProjectStage(projection));\n\t}\n\tconst meta = {\n\t\ttarget: \"mongo\",\n\t\tstorageHash,\n\t\tlane: \"mongo-orm\"\n\t};\n\tconst command = new AggregateCommand(collection, stages);\n\tconst selection = state.selectedFields !== void 0 && state.selectedFields.length > 0 ? state.selectedFields : void 0;\n\tconst includeRelationNames = state.includes.length > 0 ? state.includes.map((inc) => inc.relationName) : void 0;\n\treturn {\n\t\tcollection,\n\t\tcommand,\n\t\tmeta,\n\t\tresultShape: contractModelToMongoResultShape(model, {\n\t\t\t...ifDefined(\"selection\", selection),\n\t\t\t...ifDefined(\"includeRelationNames\", includeRelationNames)\n\t\t})\n\t};\n}\n//#endregion\n//#region src/field-accessor.ts\nfunction createFieldExpression(fieldPath) {\n\treturn {\n\t\tset(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$set\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tunset() {\n\t\t\treturn {\n\t\t\t\toperator: \"$unset\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(\"\")\n\t\t\t};\n\t\t},\n\t\tinc(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$inc\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tmul(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$mul\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpush(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$push\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpull(match) {\n\t\t\treturn {\n\t\t\t\toperator: \"$pull\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(match)\n\t\t\t};\n\t\t},\n\t\taddToSet(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$addToSet\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpop(end) {\n\t\t\treturn {\n\t\t\t\toperator: \"$pop\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(end)\n\t\t\t};\n\t\t}\n\t};\n}\nfunction createFieldAccessor() {\n\treturn new Proxy((() => {}), {\n\t\tget(_target, prop) {\n\t\t\treturn createFieldExpression(prop);\n\t\t},\n\t\tapply(_target, _thisArg, args) {\n\t\t\treturn createFieldExpression(args[0]);\n\t\t}\n\t});\n}\nfunction compileFieldOperations(ops, wrapValue) {\n\tconst grouped = {};\n\tfor (const op of ops) {\n\t\tlet group = grouped[op.operator];\n\t\tif (!group) {\n\t\t\tgroup = {};\n\t\t\tgrouped[op.operator] = group;\n\t\t}\n\t\tgroup[op.field] = wrapValue(op.field, op.value, op.operator);\n\t}\n\treturn grouped;\n}\n//#endregion\n//#region src/orm-errors.ts\nfunction ormError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/collection.ts\nfunction resolveCollectionName(model, modelName) {\n\treturn model.storage.collection ?? modelName;\n}\nfunction topLevelUpdateFields(updateDoc) {\n\tconst fields = /* @__PURE__ */ new Set();\n\tfor (const operatorGroup of Object.values(updateDoc)) for (const fieldPath of Object.keys(operatorGroup)) fields.add(fieldPath.split(\".\")[0] ?? fieldPath);\n\treturn fields;\n}\nfunction isUnknownRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nvar MongoCollectionImpl = class MongoCollectionImpl {\n\t#contract;\n\t#modelName;\n\t#executor;\n\t#mutationDefaults;\n\t#collectionName;\n\t#state;\n\t#variantName;\n\tconstructor(contract, modelName, executor, mutationDefaults) {\n\t\tthis.#contract = contract;\n\t\tthis.#modelName = modelName;\n\t\tthis.#executor = executor;\n\t\tthis.#mutationDefaults = mutationDefaults;\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(contract.domain)[modelName]);\n\t\tthis.#collectionName = resolveCollectionName(model, modelName);\n\t\tthis.#state = emptyCollectionState();\n\t}\n\tvariant(variantName) {\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model?.discriminator || !model.variants) return blindCast(this);\n\t\tconst variantEntry = model.variants[variantName];\n\t\tif (!variantEntry) return blindCast(this);\n\t\tconst filter = MongoFieldFilter.eq(model.discriminator.field, new MongoParamRef(variantEntry.value));\n\t\treturn this.#cloneWithVariant({ filters: [...this.#state.filters, filter] }, variantName);\n\t}\n\twhere(filter) {\n\t\tif (isMongoFilterExpr(filter)) return this.#clone({ filters: [...this.#state.filters, filter] });\n\t\tconst compiled = this.#compileWhereObject(blindCast(filter));\n\t\treturn this.#clone({ filters: [...this.#state.filters, ...compiled] });\n\t}\n\tselect(...fields) {\n\t\treturn this.#clone({ selectedFields: [...this.#state.selectedFields ?? [], ...fields] });\n\t}\n\tinclude(relationName) {\n\t\tconst relation = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]).relations?.[relationName];\n\t\tif (!relation) throw ormError(\"ORM.RELATION_UNKNOWN\", `Unknown relation \"${relationName}\" on model \"${this.#modelName}\"`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tif (!(\"on\" in relation)) throw ormError(\"ORM.INCLUDE_UNSUPPORTED\", `Relation \"${relationName}\" is an embed relation — only reference relations can be included`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tconst ref = relation;\n\t\tconst localField = ref.on.localFields[0];\n\t\tconst foreignField = ref.on.targetFields[0];\n\t\tif (!localField || !foreignField || ref.on.localFields.length !== 1 || ref.on.targetFields.length !== 1) throw ormError(\"ORM.INCLUDE_UNSUPPORTED\", `Compound references are not yet supported: relation \"${relationName}\"`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tconst targetModelName = ref.to.model;\n\t\tconst targetModel = castAs(domainModelsAtDefaultNamespace(this.#contract.domain)[targetModelName]);\n\t\tif (!targetModel) throw new InternalError(`Target model \"${targetModelName}\" not found for relation \"${relationName}\"`);\n\t\tconst includeExpr = {\n\t\t\trelationName,\n\t\t\tfrom: resolveCollectionName(targetModel, targetModelName),\n\t\t\tlocalField,\n\t\t\tforeignField,\n\t\t\tcardinality: ref.cardinality\n\t\t};\n\t\treturn blindCast(this.#clone({ includes: [...this.#state.includes, includeExpr] }));\n\t}\n\torderBy(spec) {\n\t\tconst merged = {\n\t\t\t...this.#state.orderBy,\n\t\t\t...spec\n\t\t};\n\t\treturn this.#clone({ orderBy: merged });\n\t}\n\tlimit(n) {\n\t\treturn this.#clone({ limit: n });\n\t}\n\toffset(n) {\n\t\treturn this.#clone({ offset: n });\n\t}\n\tall() {\n\t\treturn this.#query();\n\t}\n\tasync first() {\n\t\tconst result = this.#clone({ limit: 1 }).#query();\n\t\tfor await (const row of result) return row;\n\t\treturn null;\n\t}\n\tasync create(data) {\n\t\tthis.#rejectIncludes(\"create\");\n\t\tconst normalized = this.#withCreateDefaults(this.#injectDiscriminator(this.#stripUndefined(blindCast(data))), /* @__PURE__ */ new Map());\n\t\tconst document = this.#toDocument(normalized);\n\t\tconst command = new InsertOneCommand(this.#collectionName, document);\n\t\tconst insertedId = blindCast((await this.#drainPlan(command, this.#insertOneResultShape()))[0]).insertedId;\n\t\treturn blindCast({\n\t\t\t_id: insertedId,\n\t\t\t...normalized\n\t\t});\n\t}\n\tcreateAll(data) {\n\t\tthis.#rejectIncludes(\"createAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\t\tconst normalizedRows = data.map((d) => self.#withCreateDefaults(self.#injectDiscriminator(self.#stripUndefined(blindCast(d))), defaultValueCache));\n\t\t\tconst documents = normalizedRows.map((d) => self.#toDocument(d));\n\t\t\tconst command = new InsertManyCommand(self.#collectionName, documents);\n\t\t\tconst insertedIds = blindCast((await self.#drainPlan(command, self.#insertManyResultShape()))[0]).insertedIds;\n\t\t\tfor (let i = 0; i < normalizedRows.length; i++) yield blindCast({\n\t\t\t\t_id: insertedIds[i],\n\t\t\t\t...normalizedRows[i]\n\t\t\t});\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync createAndCount(data) {\n\t\tthis.#rejectIncludes(\"createAndCount\");\n\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\tconst documents = data.map((d) => this.#toDocument(this.#withCreateDefaults(this.#injectDiscriminator(this.#stripUndefined(blindCast(d))), defaultValueCache)));\n\t\tconst command = new InsertManyCommand(this.#collectionName, documents);\n\t\treturn blindCast((await this.#drainPlan(command))[0]).insertedCount;\n\t}\n\tasync update(dataOrCallback) {\n\t\tthis.#requireFilters(\"update\");\n\t\tthis.#rejectWindowing(\"update\");\n\t\tthis.#rejectIncludes(\"update\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst updateDoc = this.#withUpdateDefaults(this.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\tconst command = new FindOneAndUpdateCommand(this.#collectionName, filter, updateDoc, false);\n\t\tconst result = (await this.#drainPlan(command, this.#modelResultShape()))[0];\n\t\treturn result === void 0 ? null : blindCast(result);\n\t}\n\tupdateAll(dataOrCallback) {\n\t\tthis.#requireFilters(\"updateAll\");\n\t\tthis.#rejectWindowing(\"updateAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst ids = await self.#readMatchingIds();\n\t\t\tif (ids.length === 0) return;\n\t\t\tconst filter = self.#mergeFilters();\n\t\t\tconst updateDoc = self.#withUpdateDefaults(self.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\t\tconst command = new UpdateManyCommand(self.#collectionName, filter, updateDoc);\n\t\t\tawait self.#drainPlan(command);\n\t\t\tconst idFilter = MongoFieldFilter.in(\"_id\", ids.map((id) => new MongoParamRef(id)));\n\t\t\tyield* self.#clone({ filters: [idFilter] }).#query();\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync updateAndCount(dataOrCallback) {\n\t\tthis.#requireFilters(\"updateAndCount\");\n\t\tthis.#rejectWindowing(\"updateAndCount\");\n\t\tthis.#rejectIncludes(\"updateAndCount\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst updateDoc = this.#withUpdateDefaults(this.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\tconst command = new UpdateManyCommand(this.#collectionName, filter, updateDoc);\n\t\treturn (await this.#executePlan(command)).affectedRows;\n\t}\n\tasync delete() {\n\t\tthis.#requireFilters(\"delete\");\n\t\tthis.#rejectWindowing(\"delete\");\n\t\tthis.#rejectIncludes(\"delete\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst command = new FindOneAndDeleteCommand(this.#collectionName, filter);\n\t\tconst result = (await this.#drainPlan(command, this.#modelResultShape()))[0];\n\t\treturn result === void 0 ? null : blindCast(result);\n\t}\n\tdeleteAll() {\n\t\tthis.#requireFilters(\"deleteAll\");\n\t\tthis.#rejectWindowing(\"deleteAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst docs = [];\n\t\t\tfor await (const row of self.#query()) docs.push(row);\n\t\t\tconst filter = self.#mergeFilters();\n\t\t\tconst command = new DeleteManyCommand(self.#collectionName, filter);\n\t\t\tawait self.#drainPlan(command);\n\t\t\tyield* docs;\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync deleteAndCount() {\n\t\tthis.#requireFilters(\"deleteAndCount\");\n\t\tthis.#rejectWindowing(\"deleteAndCount\");\n\t\tthis.#rejectIncludes(\"deleteAndCount\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst command = new DeleteManyCommand(this.#collectionName, filter);\n\t\treturn (await this.#executePlan(command)).affectedRows;\n\t}\n\tasync upsert(input) {\n\t\tthis.#requireFilters(\"upsert\");\n\t\tthis.#rejectWindowing(\"upsert\");\n\t\tthis.#rejectIncludes(\"upsert\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\tconst allCreateFields = this.#toDocument(this.#withCreateDefaults(this.#injectDiscriminator(this.#stripUndefined(blindCast(input.create))), defaultValueCache));\n\t\tlet updateDoc;\n\t\tif (typeof input.update === \"function\") {\n\t\t\tconst accessor = createFieldAccessor();\n\t\t\tconst ops = input.update(accessor);\n\t\t\tif (ops.find((op) => op.field === \"_id\")) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tconst dotPathOp = ops.find((op) => op.field.includes(\".\"));\n\t\t\tif (dotPathOp) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `upsert() does not support dot-path field operations (found \"${dotPathOp.field}\"). Dot-path updates conflict with \\$setOnInsert on the insert path, producing incomplete documents. Use top-level field operations instead.`, { meta: {\n\t\t\t\tmethod: \"upsert\",\n\t\t\t\tfield: dotPathOp.field\n\t\t\t} });\n\t\t\tupdateDoc = compileFieldOperations(ops, (field, value, operator) => this.#wrapFieldOpValue(field, value, operator));\n\t\t} else {\n\t\t\tconst setFields = this.#toSetFields(blindCast(input.update));\n\t\t\tupdateDoc = {};\n\t\t\tif (Object.keys(setFields).length > 0) updateDoc[\"$set\"] = setFields;\n\t\t}\n\t\tupdateDoc = this.#withUpdateDefaults(updateDoc, defaultValueCache);\n\t\tconst updatedFields = topLevelUpdateFields(updateDoc);\n\t\tconst insertOnlyFields = {};\n\t\tfor (const [key, value] of Object.entries(allCreateFields)) if (!updatedFields.has(key)) insertOnlyFields[key] = value;\n\t\tif (Object.keys(insertOnlyFields).length > 0) updateDoc[\"$setOnInsert\"] = insertOnlyFields;\n\t\tconst command = new FindOneAndUpdateCommand(this.#collectionName, filter, updateDoc, true);\n\t\treturn blindCast((await this.#drainPlan(command, this.#modelResultShape()))[0]);\n\t}\n\tasync #readMatchingIds() {\n\t\tconst idQuery = this.#clone({\n\t\t\tincludes: [],\n\t\t\tselectedFields: [\"_id\"],\n\t\t\torderBy: void 0,\n\t\t\tlimit: void 0,\n\t\t\toffset: void 0\n\t\t});\n\t\tconst ids = [];\n\t\tconst { resultShape: _rs, ...planWithoutShape } = idQuery.#compile();\n\t\tfor await (const row of this.#executor.query(planWithoutShape)) {\n\t\t\tconst storageRow = blindCast(row);\n\t\t\tids.push(storageRow[\"_id\"]);\n\t\t}\n\t\treturn ids;\n\t}\n\t#query() {\n\t\tconst plan = this.#compile();\n\t\treturn this.#executor.query(plan);\n\t}\n\t#compile() {\n\t\tconst model = this.#modelWithVariantFields();\n\t\tif (!model) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model: \"${this.#modelName}\".`, { meta: { model: this.#modelName } });\n\t\treturn compileMongoQuery(this.#collectionName, this.#state, this.#contract.storage.storageHash, model);\n\t}\n\t#wrapCommand(command, resultShape) {\n\t\treturn {\n\t\t\tcollection: this.#collectionName,\n\t\t\tcommand,\n\t\t\tmeta: this.#planMeta(),\n\t\t\t...ifDefined(\"resultShape\", resultShape)\n\t\t};\n\t}\n\t#executePlan(command) {\n\t\treturn this.#executor.execute(this.#wrapCommand(command));\n\t}\n\tasync #drainPlan(command, resultShape) {\n\t\tconst plan = this.#wrapCommand(command, resultShape);\n\t\tconst result = this.#executor.query(plan);\n\t\tconst rows = [];\n\t\tfor await (const row of result) rows.push(row);\n\t\treturn rows;\n\t}\n\t#modelFields() {\n\t\treturn this.#modelWithVariantFields()?.fields ?? {};\n\t}\n\t#modelWithVariantFields() {\n\t\tconst models = domainModelsAtDefaultNamespace(this.#contract.domain);\n\t\tconst model = blindCast(models[this.#modelName]);\n\t\tif (model === void 0 || this.#variantName === void 0) return model;\n\t\tconst variant = blindCast(models[this.#variantName]);\n\t\treturn variant === void 0 ? model : {\n\t\t\t...model,\n\t\t\tfields: {\n\t\t\t\t...model.fields,\n\t\t\t\t...variant.fields\n\t\t\t}\n\t\t};\n\t}\n\t#idFieldShape() {\n\t\tconst idField = this.#modelFields()[\"_id\"];\n\t\treturn idField ? contractFieldToMongoFieldShape(idField) : Object.freeze({ kind: \"unknown\" });\n\t}\n\t#insertOneResultShape() {\n\t\treturn freezeMongoResultShape({\n\t\t\tkind: \"document\",\n\t\t\tfields: { insertedId: this.#idFieldShape() }\n\t\t});\n\t}\n\t#insertManyResultShape() {\n\t\treturn freezeMongoResultShape({\n\t\t\tkind: \"document\",\n\t\t\tfields: { insertedIds: {\n\t\t\t\tkind: \"array\",\n\t\t\t\tnullable: false,\n\t\t\t\telement: this.#idFieldShape()\n\t\t\t} }\n\t\t});\n\t}\n\t#modelResultShape() {\n\t\tconst model = this.#modelWithVariantFields();\n\t\tif (!model) return Object.freeze({ kind: \"unknown\" });\n\t\treturn contractModelToMongoResultShape(model);\n\t}\n\t#compileWhereObject(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst filters = [];\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst wrapped = this.#wrapFieldValue(value, fields[key], key);\n\t\t\tfilters.push(MongoFieldFilter.eq(key, wrapped));\n\t\t}\n\t\treturn filters;\n\t}\n\t#wrapFieldValue(value, field, path) {\n\t\tif (field === void 0) return new MongoParamRef(value);\n\t\tif (field.type.kind === \"scalar\") return this.#fieldParam(value, field.type.codecId, path);\n\t\tif (field.type.kind === \"valueObject\") {\n\t\t\tconst voName = field.type.name;\n\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\tif (!voDef || value === null) return new MongoParamRef(value);\n\t\t\tif (field.many && Array.isArray(value)) return value.map((item, index) => this.#wrapValueObject(blindCast(item), voDef, `${path}.${index}`));\n\t\t\treturn this.#wrapValueObject(blindCast(value), voDef, path);\n\t\t}\n\t\treturn new MongoParamRef(value);\n\t}\n\t#fieldParam(value, codecId, path) {\n\t\treturn new MongoParamRef(value, {\n\t\t\tcodecId,\n\t\t\tname: path,\n\t\t\tcollection: this.#collectionName\n\t\t});\n\t}\n\t#wrapValueObject(data, voDef, path) {\n\t\tconst doc = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst fieldDef = voDef.fields[key];\n\t\t\tdoc[key] = this.#wrapFieldValue(value, fieldDef, `${path}.${key}`);\n\t\t}\n\t\treturn doc;\n\t}\n\t#toDocument(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst doc = {};\n\t\tfor (const [key, value] of Object.entries(data)) if (value !== void 0) doc[key] = this.#wrapFieldValue(value, fields[key], key);\n\t\treturn doc;\n\t}\n\t#toSetFields(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (key === \"_id\" && value !== void 0) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tif (value !== void 0) result[key] = this.#wrapFieldValue(value, fields[key], key);\n\t\t}\n\t\treturn result;\n\t}\n\t#appliedDefaults(op, values, defaultValueCache) {\n\t\tconst applied = this.#mutationDefaults?.applyMutationDefaults({\n\t\t\top,\n\t\t\tnamespace: UNBOUND_NAMESPACE_ID,\n\t\t\tentry: this.#collectionName,\n\t\t\tvalues,\n\t\t\tdefaultValueCache\n\t\t}) ?? [];\n\t\treturn Object.fromEntries(applied.map(({ field, value }) => [field, value]));\n\t}\n\t#withCreateDefaults(values, defaultValueCache) {\n\t\treturn {\n\t\t\t...values,\n\t\t\t...this.#appliedDefaults(\"create\", values, defaultValueCache)\n\t\t};\n\t}\n\t#withUpdateDefaults(updateDoc, defaultValueCache) {\n\t\tconst explicit = Object.fromEntries([...topLevelUpdateFields(updateDoc)].map((field) => [field, true]));\n\t\tconst generated = this.#appliedDefaults(\"update\", explicit, defaultValueCache);\n\t\tif (Object.keys(generated).length === 0) return updateDoc;\n\t\treturn {\n\t\t\t...updateDoc,\n\t\t\t$set: {\n\t\t\t\t...updateDoc[\"$set\"],\n\t\t\t\t...this.#toSetFields(generated)\n\t\t\t}\n\t\t};\n\t}\n\t#stripUndefined(data) {\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(data)) if (value !== void 0) result[key] = value;\n\t\treturn result;\n\t}\n\t#toUpdateDocument(data) {\n\t\treturn { $set: this.#toSetFields(data) };\n\t}\n\t#resolveUpdateDoc(dataOrCallback) {\n\t\tif (typeof dataOrCallback === \"function\") {\n\t\t\tconst ops = dataOrCallback(createFieldAccessor());\n\t\t\tif (ops.find((op) => op.field === \"_id\")) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tif (ops.length === 0) return { $set: {} };\n\t\t\treturn compileFieldOperations(ops, (field, value, operator) => this.#wrapFieldOpValue(field, value, operator));\n\t\t}\n\t\treturn this.#toUpdateDocument(blindCast(dataOrCallback));\n\t}\n\t#wrapFieldOpValue(field, value, operator) {\n\t\tif (operator === \"$unset\") return value;\n\t\tconst topLevelField = field.split(\".\")[0] ?? field;\n\t\tconst contractField = this.#modelFields()[topLevelField];\n\t\tif (!contractField) return value;\n\t\tif (field.includes(\".\")) return this.#wrapDotPathValue(field, value);\n\t\tif (value instanceof MongoParamRef && contractField.type.kind === \"scalar\") return this.#fieldParam(value.value, contractField.type.codecId, field);\n\t\tif (contractField.type.kind === \"valueObject\" && value instanceof MongoParamRef) {\n\t\t\tconst raw = value.value;\n\t\t\tif (isUnknownRecord(raw)) {\n\t\t\t\tconst voName = contractField.type.name;\n\t\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\t\tif (voDef) return this.#wrapValueObject(raw, voDef, field);\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}\n\t#wrapDotPathValue(dotPath, value) {\n\t\tconst parts = dotPath.split(\".\");\n\t\tconst fields = this.#modelFields();\n\t\tlet currentField = parts[0] ? fields[parts[0]] : void 0;\n\t\tfor (let i = 1; i < parts.length; i++) {\n\t\t\tif (currentField?.type.kind !== \"valueObject\") return value;\n\t\t\tconst voName = currentField.type.name;\n\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\tif (!voDef) return value;\n\t\t\tconst partKey = parts[i];\n\t\t\tcurrentField = partKey ? voDef.fields[partKey] : void 0;\n\t\t}\n\t\tif (currentField?.type.kind === \"scalar\" && value instanceof MongoParamRef) return this.#fieldParam(value.value, currentField.type.codecId, dotPath);\n\t\tif (currentField?.type.kind === \"valueObject\" && value instanceof MongoParamRef) {\n\t\t\tconst raw = value.value;\n\t\t\tif (isUnknownRecord(raw)) {\n\t\t\t\tconst voName = currentField.type.name;\n\t\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\t\tif (voDef) return this.#wrapValueObject(raw, voDef, dotPath);\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}\n\t#mergeFilters() {\n\t\tconst [single] = this.#state.filters;\n\t\tif (this.#state.filters.length === 1 && single) return single;\n\t\treturn MongoAndExpr.of([...this.#state.filters]);\n\t}\n\t#requireFilters(methodName) {\n\t\tif (this.#state.filters.length === 0) throw ormError(\"ORM.WHERE_MISSING\", `${methodName}() requires a .where() filter. Call .where() before .${methodName}()`, { meta: { method: methodName } });\n\t}\n\t#rejectWindowing(methodName) {\n\t\tif (this.#state.orderBy !== void 0 || this.#state.limit !== void 0 || this.#state.offset !== void 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `${methodName}() does not support orderBy/offset/limit. Remove windowing before calling .${methodName}()`, { meta: {\n\t\t\tmethod: methodName,\n\t\t\treason: \"windowing\"\n\t\t} });\n\t}\n\t#rejectIncludes(methodName) {\n\t\tif (this.#state.includes.length > 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `${methodName}() does not support .include(). Remove includes before calling .${methodName}()`, { meta: {\n\t\t\tmethod: methodName,\n\t\t\treason: \"includes\"\n\t\t} });\n\t}\n\t#planMeta() {\n\t\treturn {\n\t\t\ttarget: \"mongo\",\n\t\t\tstorageHash: this.#contract.storage.storageHash,\n\t\t\tlane: \"mongo-orm\"\n\t\t};\n\t}\n\t#injectDiscriminator(data) {\n\t\tif (!this.#variantName) return data;\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model?.discriminator || !model.variants) return data;\n\t\tconst variantEntry = model.variants[this.#variantName];\n\t\tif (!variantEntry) return data;\n\t\treturn {\n\t\t\t...data,\n\t\t\t[model.discriminator.field]: variantEntry.value\n\t\t};\n\t}\n\t#clone(overrides) {\n\t\tconst instance = new MongoCollectionImpl(this.#contract, this.#modelName, this.#executor, this.#mutationDefaults);\n\t\tinstance.#state = {\n\t\t\t...this.#state,\n\t\t\t...overrides\n\t\t};\n\t\tinstance.#collectionName = this.#collectionName;\n\t\tinstance.#variantName = this.#variantName;\n\t\treturn instance;\n\t}\n\t#cloneWithVariant(overrides, variantName) {\n\t\tconst instance = new MongoCollectionImpl(this.#contract, this.#modelName, this.#executor, this.#mutationDefaults);\n\t\tinstance.#state = {\n\t\t\t...this.#state,\n\t\t\t...overrides\n\t\t};\n\t\tinstance.#collectionName = this.#collectionName;\n\t\tinstance.#variantName = variantName;\n\t\treturn instance;\n\t}\n};\nfunction createMongoCollection(contract, modelName, executor, mutationDefaults) {\n\treturn new MongoCollectionImpl(contract, modelName, executor, mutationDefaults);\n}\n//#endregion\n//#region src/mongo-orm.ts\nfunction mongoOrm(options) {\n\tconst { contract, executor, mutationDefaults } = options;\n\tconst executionDefaults = contract.execution?.mutations.defaults ?? [];\n\tif (executionDefaults.length > 0 && mutationDefaults === void 0) throw ormError(\"ORM.MUTATION_DEFAULTS_MISSING\", \"The contract has execution defaults (fields such as temporal.createdAt() that the ORM fills on write), but mongoOrm() was built without mutationDefaults, so those fields would never be written. Pass the execution context: mongoOrm({ contract, executor, mutationDefaults: context }), or create the client with mongo().\", { meta: { fields: executionDefaults.map((d) => `${d.ref.entry}.${d.ref.field}`) } });\n\tconst client = {};\n\tfor (const [rootName, rootRef] of Object.entries(contract.roots)) client[rootName] = createMongoCollection(contract, blindCast(rootRef.model), executor, mutationDefaults);\n\treturn blindCast(client);\n}\n//#endregion\n//#region src/raw-collection.ts\nfunction createRawMongoCollection(collectionName, meta) {\n\tfunction buildable(command) {\n\t\treturn { build: () => ({\n\t\t\tcollection: collectionName,\n\t\t\tcommand,\n\t\t\tmeta\n\t\t}) };\n\t}\n\treturn {\n\t\taggregate(pipeline) {\n\t\t\treturn buildable(new RawAggregateCommand(collectionName, pipeline));\n\t\t},\n\t\tinsertOne(document) {\n\t\t\treturn buildable(new RawInsertOneCommand(collectionName, document));\n\t\t},\n\t\tinsertMany(documents) {\n\t\t\treturn buildable(new RawInsertManyCommand(collectionName, documents));\n\t\t},\n\t\tupdateOne(filter, update) {\n\t\t\treturn buildable(new RawUpdateOneCommand(collectionName, filter, update));\n\t\t},\n\t\tupdateMany(filter, update) {\n\t\t\treturn buildable(new RawUpdateManyCommand(collectionName, filter, update));\n\t\t},\n\t\tdeleteOne(filter) {\n\t\t\treturn buildable(new RawDeleteOneCommand(collectionName, filter));\n\t\t},\n\t\tdeleteMany(filter) {\n\t\t\treturn buildable(new RawDeleteManyCommand(collectionName, filter));\n\t\t},\n\t\tfindOneAndUpdate(filter, update, options) {\n\t\t\treturn buildable(new RawFindOneAndUpdateCommand(collectionName, filter, update, options?.upsert ?? false));\n\t\t},\n\t\tfindOneAndDelete(filter) {\n\t\t\treturn buildable(new RawFindOneAndDeleteCommand(collectionName, filter));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/mongo-raw.ts\nfunction mongoRaw(options) {\n\tconst { contract } = options;\n\treturn { collection(rootName) {\n\t\tconst modelName = contract.roots[rootName]?.model;\n\t\tconst models = domainModelsAtDefaultNamespace(contract.domain);\n\t\tif (!modelName || !Object.hasOwn(models, modelName)) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model \"${modelName ?? \"\"}\" for root \"${rootName}\"`, { meta: {\n\t\t\tmodel: modelName ?? \"\",\n\t\t\troot: rootName\n\t\t} });\n\t\treturn createRawMongoCollection(models[modelName].storage.collection ?? modelName, {\n\t\t\ttarget: \"mongo\",\n\t\t\tstorageHash: contract.storage.storageHash,\n\t\t\tlane: \"mongo-raw\"\n\t\t});\n\t} };\n}\n//#endregion\nexport { compileMongoQuery, createFieldAccessor, createMongoCollection, mongoOrm, mongoRaw };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAWA,SAAS,uBAAuB;CAC/B,OAAO;EACN,SAAS,CAAC;EACV,UAAU,CAAC;EACX,SAAS,KAAK;EACd,gBAAgB,KAAK;EACrB,OAAO,KAAK;EACZ,QAAQ,KAAK;CACd;AACD;AAGA,SAAS,gBAAgB,UAAU;CAClC,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,OAAO,UAAU;EAC3B,OAAO,KAAK,IAAI,iBAAiB;GAChC,MAAM,IAAI;GACV,YAAY,IAAI;GAChB,cAAc,IAAI;GAClB,IAAI,IAAI;EACT,CAAC,CAAC;EACF,IAAI,IAAI,gBAAgB,SAAS,IAAI,gBAAgB,OAAO,OAAO,KAAK,IAAI,iBAAiB,IAAI,IAAI,gBAAgB,IAAI,CAAC;CAC3H;CACA,OAAO;AACR;AACA,SAAS,kBAAkB,YAAY,OAAO,aAAa,OAAO;CACjE,MAAM,SAAS,CAAC;CAChB,MAAM,eAAe,MAAM,QAAQ,WAAW,IAAI,MAAM,QAAQ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M,SAAS,+BAA+B,SAAS,MAAM;EAC7D,IAAI,CAAC,aAAa,CAAC,OAAO,OAAO,QAAQ,SAAS,GAAG,MAAM,SAAS,qBAAqB,kBAAkB,aAAa,GAAG,cAAc,SAAS,IAAI,EAAE,MAAM;GAC7J,OAAO,aAAa;GACpB,MAAM;EACP,EAAE,CAAC;EACH,OAAO,yBAAyB,OAAO,UAAU,CAAC,QAAQ,cAAc,WAAW;GAClF,QAAQ;GACR,aAAa,SAAS,QAAQ;GAC9B,MAAM;EACP,CAAC;CACF,EAAE;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"pack-BUb_cutQ.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/pack.d.mts"],"mappings":";;;;;cAOc,wBAAwB;cACxB;WACH;aACE;aACA;aACA;aACA;aACA;eACE;;aAEF;aACA;aACA;eACE,2CAA2C;QAClD;wCACgC;;;;;;cAM1B;WACH;WACA;WACA;WACA;WACA;aACE,gEAAgE;aAChE;eACE;iBACE;iBACA;iBACA;iBACA;iBACA;mBACE;;iBAEF;iBACA;iBACA;mBACE,2CAA2C;YAClD;4CACgC;;;;aAI/B,gBAAgB"}
1
+ {"version":3,"file":"pack-BUb_cutQ.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/pack.d.mts"],"mappings":";;;;;cAQc,wBAAwB;cACxB;WACH;aACE;aACA;aACA;aACA;aACA;eACE;;aAEF;aACA;aACA;eACE,2CAA2C;QAClD;wCACgC;;;;;;cAM1B;WACH;WACA;WACA;WACA;WACA;aACE,gEAAgE;aAChE;eACE;iBACE;iBACA;iBACA;iBACA;iBACA;mBACE;;iBAEF;iBACA;iBACA;mBACE,2CAA2C;YAClD;4CACgC;;;;aAI/B,gBAAgB"}
@@ -1,5 +1,5 @@
1
1
  import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
- import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
3
- import { C as keysToKeySpec, S as defaultMongoIndexName, _ as MongoInspectionCommandVisitor, a as CollModOptions, b as MongoMigrationStep, c as CreateIndexCommand, d as DropIndexCommand, f as ListCollectionsCommand, g as MongoDdlCommandVisitor, h as MongoDataTransformOperation, i as CollModCommand, l as CreateIndexOptions, m as MongoDataTransformCheck, n as AnyMongoInspectionCommand, o as CreateCollectionCommand, p as ListIndexesCommand, r as AnyMongoMigrationOperation, s as CreateCollectionOptions, t as AnyMongoDdlCommand, u as DropCollectionCommand, v as MongoMigrationCheck, x as buildIndexOpId, y as MongoMigrationPlanOperation } from "./control-DNe7Gps7.mjs";
4
- import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-CKnUiOfm.mjs";
2
+ import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-C0-Yu8hf-BnYfzKMn.mjs";
3
+ import { C as keysToKeySpec, S as defaultMongoIndexName, _ as MongoInspectionCommandVisitor, a as CollModOptions, b as MongoMigrationStep, c as CreateIndexCommand, d as DropIndexCommand, f as ListCollectionsCommand, g as MongoDdlCommandVisitor, h as MongoDataTransformOperation, i as CollModCommand, l as CreateIndexOptions, m as MongoDataTransformCheck, n as AnyMongoInspectionCommand, o as CreateCollectionCommand, p as ListIndexesCommand, r as AnyMongoMigrationOperation, s as CreateCollectionOptions, t as AnyMongoDdlCommand, u as DropCollectionCommand, v as MongoMigrationCheck, x as buildIndexOpId, y as MongoMigrationPlanOperation } from "./control-BKLGhv19.mjs";
4
+ import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-BRC7ECq8.mjs";
5
5
  export { type AggRecordArgs, AggregateCommand, type AnyMongoCommand, type AnyMongoDdlCommand, type AnyMongoInspectionCommand, type AnyMongoMigrationOperation, CollModCommand, type CollModOptions, CreateCollectionCommand, type CreateCollectionOptions, CreateIndexCommand, type CreateIndexOptions, DeleteManyCommand, type DeleteManyResult, DeleteOneCommand, type DeleteOneResult, type DeleteResult, DropCollectionCommand, DropIndexCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, type InsertManyResult, InsertOneCommand, type InsertOneResult, ListCollectionsCommand, ListIndexesCommand, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, type MongoAggExpr, type MongoAggExprRewriter, type MongoAggExprVisitor, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, type MongoAggSwitchBranch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, type MongoDataTransformCheck, type MongoDataTransformOperation, type MongoDdlCommandVisitor, type MongoDensifyRange, MongoDensifyStage, MongoExistsExpr, MongoExprFilter, MongoFacetStage, MongoFieldFilter, type MongoFieldShape, type MongoFillOutput, MongoFillStage, type MongoFilterExpr, type MongoFilterRewriter, type MongoFilterVisitor, MongoGeoNearStage, MongoGraphLookupStage, type MongoGroupId, MongoGroupStage, type MongoIndexKey, type MongoIndexKeyDirection, type MongoInspectionCommandVisitor, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, type MongoMigrationCheck, type MongoMigrationPlanOperation, type MongoMigrationStep, MongoNotExpr, MongoOrExpr, MongoOutStage, type MongoPipelineStage, MongoProjectStage, type MongoProjectionValue, type MongoQueryPlan, MongoRedactStage, MongoReplaceRootStage, type MongoResultShape, MongoSampleStage, MongoSearchMetaStage, MongoSearchStage, MongoSetWindowFieldsStage, MongoSkipStage, MongoSortByCountStage, MongoSortStage, type MongoStageRewriterContext, type MongoStageVisitor, MongoUnionWithStage, MongoUnwindStage, type MongoUpdatePipelineStage, type MongoUpdateSpec, MongoVectorSearchStage, type MongoWindowField, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, type RawMongoCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, type UpdateManyResult, UpdateOneCommand, type UpdateOneResult, type UpdateResult, buildIndexOpId, defaultMongoIndexName, freezeMongoFieldShape, freezeMongoResultShape, isExprArray, isMongoFilterExpr, isRecordArgs, keysToKeySpec };
@@ -1,4 +1,4 @@
1
1
  import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
- import { B as MongoFilterExpr, E as MongoAndExpr, H as MongoFilterVisitor, I as MongoFieldFilter, N as MongoExistsExpr, P as MongoExprFilter, Q as MongoOrExpr, Z as MongoNotExpr } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
3
- import { C as keysToKeySpec, S as defaultMongoIndexName, _ as MongoInspectionCommandVisitor, a as CollModOptions, b as MongoMigrationStep, c as CreateIndexCommand, d as DropIndexCommand, f as ListCollectionsCommand, g as MongoDdlCommandVisitor, h as MongoDataTransformOperation, i as CollModCommand, l as CreateIndexOptions, m as MongoDataTransformCheck, n as AnyMongoInspectionCommand, o as CreateCollectionCommand, p as ListIndexesCommand, r as AnyMongoMigrationOperation, s as CreateCollectionOptions, t as AnyMongoDdlCommand, u as DropCollectionCommand, v as MongoMigrationCheck, x as buildIndexOpId, y as MongoMigrationPlanOperation } from "./control-DNe7Gps7.mjs";
2
+ import { B as MongoFilterExpr, E as MongoAndExpr, H as MongoFilterVisitor, I as MongoFieldFilter, N as MongoExistsExpr, P as MongoExprFilter, Q as MongoOrExpr, Z as MongoNotExpr } from "./query-plan-C0-Yu8hf-BnYfzKMn.mjs";
3
+ import { C as keysToKeySpec, S as defaultMongoIndexName, _ as MongoInspectionCommandVisitor, a as CollModOptions, b as MongoMigrationStep, c as CreateIndexCommand, d as DropIndexCommand, f as ListCollectionsCommand, g as MongoDdlCommandVisitor, h as MongoDataTransformOperation, i as CollModCommand, l as CreateIndexOptions, m as MongoDataTransformCheck, n as AnyMongoInspectionCommand, o as CreateCollectionCommand, p as ListIndexesCommand, r as AnyMongoMigrationOperation, s as CreateCollectionOptions, t as AnyMongoDdlCommand, u as DropCollectionCommand, v as MongoMigrationCheck, x as buildIndexOpId, y as MongoMigrationPlanOperation } from "./control-BKLGhv19.mjs";
4
4
  export { type AnyMongoDdlCommand, type AnyMongoInspectionCommand, type AnyMongoMigrationOperation, CollModCommand, type CollModOptions, CreateCollectionCommand, type CreateCollectionOptions, CreateIndexCommand, type CreateIndexOptions, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, type MongoDataTransformCheck, type MongoDataTransformOperation, type MongoDdlCommandVisitor, MongoExistsExpr, MongoExprFilter, MongoFieldFilter, type MongoFilterExpr, type MongoFilterVisitor, type MongoIndexKey, type MongoIndexKeyDirection, type MongoInspectionCommandVisitor, type MongoMigrationCheck, type MongoMigrationPlanOperation, type MongoMigrationStep, MongoNotExpr, MongoOrExpr, buildIndexOpId, defaultMongoIndexName, keysToKeySpec };
@@ -1,3 +1,3 @@
1
- import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
2
- import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-CKnUiOfm.mjs";
1
+ import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-C0-Yu8hf-BnYfzKMn.mjs";
2
+ import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-BRC7ECq8.mjs";
3
3
  export { type AggRecordArgs, AggregateCommand, type AnyMongoCommand, DeleteManyCommand, type DeleteManyResult, DeleteOneCommand, type DeleteOneResult, type DeleteResult, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, type InsertManyResult, InsertOneCommand, type InsertOneResult, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, type MongoAggExpr, type MongoAggExprRewriter, type MongoAggExprVisitor, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, type MongoAggSwitchBranch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, type MongoDensifyRange, MongoDensifyStage, MongoExistsExpr, MongoExprFilter, MongoFacetStage, MongoFieldFilter, type MongoFieldShape, type MongoFillOutput, MongoFillStage, type MongoFilterExpr, type MongoFilterRewriter, type MongoFilterVisitor, MongoGeoNearStage, MongoGraphLookupStage, type MongoGroupId, MongoGroupStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoNotExpr, MongoOrExpr, MongoOutStage, type MongoPipelineStage, MongoProjectStage, type MongoProjectionValue, type MongoQueryPlan, MongoRedactStage, MongoReplaceRootStage, type MongoResultShape, MongoSampleStage, MongoSearchMetaStage, MongoSearchStage, MongoSetWindowFieldsStage, MongoSkipStage, MongoSortByCountStage, MongoSortStage, type MongoStageRewriterContext, type MongoStageVisitor, MongoUnionWithStage, MongoUnwindStage, type MongoUpdatePipelineStage, type MongoUpdateSpec, MongoVectorSearchStage, type MongoWindowField, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, type RawMongoCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, type UpdateManyResult, UpdateOneCommand, type UpdateOneResult, type UpdateResult, freezeMongoFieldShape, freezeMongoResultShape, isExprArray, isMongoFilterExpr, isRecordArgs };
@@ -1,9 +1,9 @@
1
1
  import { C as MongoContract, V as MongoModelsMap, at as RootModelName, n as ExtractMongoCodecTypes, t as AnyMongoTypeMaps, w as MongoContractWithTypeMaps, z as MongoModelDefinition } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
2
  import "./index-CLPkwReD.mjs";
3
- import { c as MongoValue } from "./index-wKMm41HC.mjs";
4
- import { B as MongoFilterExpr, L as MongoFieldShape, Mt as UpdateManyCommand, Nt as UpdateOneCommand, R as MongoFillOutput, a as DeleteOneCommand, c as InsertManyCommand, d as MongoAggAccumulator, et as MongoPipelineStage, i as DeleteManyCommand, j as MongoDensifyRange, l as InsertOneCommand, m as MongoAggExpr, n as AggregateCommand, o as FindOneAndDeleteCommand, ot as MongoResultShape, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, vt as MongoUpdatePipelineStage, xt as MongoWindowField } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
5
- import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, r as DeleteResult } from "./execution-CKnUiOfm.mjs";
6
- import { A as TypedUpdateOp, C as ProjectedShape, D as StringField, E as SortSpec, F as expr, M as UpdaterResult, N as ValidPaths, O as TypedAccumulatorExpr, P as createFieldAccessor, S as PathCompletions, T as ResolveRow, _ as NullableDocField, a as DocShape, b as ObjectExpression, c as FieldAccessor, d as LeafExpression, f as LiteralValue, g as NestedDocShape, h as ModelToDocShape, i as DocField, j as UnwoundShape, k as TypedAggExpr, l as GroupSpec, m as ModelNestedShape, n as BooleanField, o as Expression, p as ModelArrayField, r as DateField, s as ExtractDocShape, t as ArrayField, u as GroupedDocShape, v as NullableNumericField, w as ResolvePath, x as ObjectField, y as NumericField } from "./field-accessor-DHsAPiW3-DpQqiFg4.mjs";
3
+ import { f as MongoValue } from "./index-9DDQlC5U.mjs";
4
+ import { B as MongoFilterExpr, L as MongoFieldShape, Mt as UpdateManyCommand, Nt as UpdateOneCommand, R as MongoFillOutput, a as DeleteOneCommand, c as InsertManyCommand, d as MongoAggAccumulator, et as MongoPipelineStage, i as DeleteManyCommand, j as MongoDensifyRange, l as InsertOneCommand, m as MongoAggExpr, n as AggregateCommand, o as FindOneAndDeleteCommand, ot as MongoResultShape, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, vt as MongoUpdatePipelineStage, xt as MongoWindowField } from "./query-plan-C0-Yu8hf-BnYfzKMn.mjs";
5
+ import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, r as DeleteResult } from "./execution-BRC7ECq8.mjs";
6
+ import { A as TypedUpdateOp, C as ProjectedShape, D as StringField, E as SortSpec, F as expr, M as UpdaterResult, N as ValidPaths, O as TypedAccumulatorExpr, P as createFieldAccessor, S as PathCompletions, T as ResolveRow, _ as NullableDocField, a as DocShape, b as ObjectExpression, c as FieldAccessor, d as LeafExpression, f as LiteralValue, g as NestedDocShape, h as ModelToDocShape, i as DocField, j as UnwoundShape, k as TypedAggExpr, l as GroupSpec, m as ModelNestedShape, n as BooleanField, o as Expression, p as ModelArrayField, r as DateField, s as ExtractDocShape, t as ArrayField, u as GroupedDocShape, v as NullableNumericField, w as ResolvePath, x as ObjectField, y as NumericField } from "./field-accessor-DHsAPiW3-mPtxx6Gz.mjs";
7
7
  import { ContractField } from "@prisma/orm-framework/contract/types";
8
8
  //#region ../../../2-mongo-family/5-query-builders/query-builder/dist/index.d.mts
9
9
  //#region src/accumulator-helpers.d.ts
@@ -1,9 +1,9 @@
1
1
  import { A as MongoIndexKey } from "./mongo-value-set-BngSUlOh-BhDGXjM_.mjs";
2
- import { c as MongoValue } from "./index-wKMm41HC.mjs";
3
- import { B as MongoFilterExpr, et as MongoPipelineStage, l as InsertOneCommand, n as AggregateCommand, s as FindOneAndUpdateCommand } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
4
- import { c as CreateIndexCommand, l as CreateIndexOptions, o as CreateCollectionCommand, s as CreateCollectionOptions } from "./control-DNe7Gps7.mjs";
5
- import "./execution-CKnUiOfm.mjs";
6
- import { M as UpdaterResult, a as DocShape, c as FieldAccessor } from "./field-accessor-DHsAPiW3-DpQqiFg4.mjs";
2
+ import { f as MongoValue } from "./index-9DDQlC5U.mjs";
3
+ import { B as MongoFilterExpr, et as MongoPipelineStage, l as InsertOneCommand, n as AggregateCommand, s as FindOneAndUpdateCommand } from "./query-plan-C0-Yu8hf-BnYfzKMn.mjs";
4
+ import { c as CreateIndexCommand, l as CreateIndexOptions, o as CreateCollectionCommand, s as CreateCollectionOptions } from "./control-BKLGhv19.mjs";
5
+ import "./execution-BRC7ECq8.mjs";
6
+ import { M as UpdaterResult, a as DocShape, c as FieldAccessor } from "./field-accessor-DHsAPiW3-mPtxx6Gz.mjs";
7
7
  //#region ../../../2-mongo-family/5-query-builders/query-builder/dist/exports/contract-free.d.mts
8
8
  //#region src/contract-free/collection.d.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { c as MongoValue, t as Document } from "./index-wKMm41HC.mjs";
1
+ import { f as MongoValue, i as Document } from "./index-9DDQlC5U.mjs";
2
2
  import { QueryPlan } from "@prisma/orm-framework/components/runtime";
3
3
  //#region ../../../2-mongo-family/4-query/query-ast/dist/query-plan-C0-Yu8hf.d.mts
4
4
  //#region src/ast-node.d.ts
@@ -819,4 +819,4 @@ interface MongoQueryPlan<Row = unknown, Command extends AnyMongoCommand = AnyMon
819
819
  }
820
820
  //#endregion
821
821
  export { MongoOutStage as $, MongoCountStage as A, RawUpdateManyCommand as At, MongoFilterExpr as B, MongoAggReduce as C, RawDeleteManyCommand as Ct, MongoAstNode as D, RawInsertManyCommand as Dt, MongoAndExpr as E, RawFindOneAndUpdateCommand as Et, MongoFacetStage as F, freezeMongoResultShape as Ft, MongoGroupId as G, MongoFilterVisitor as H, MongoFieldFilter as I, isExprArray as It, MongoLookupStage as J, MongoGroupStage as K, MongoFieldShape as L, isMongoFilterExpr as Lt, MongoDensifyStage as M, UpdateManyCommand as Mt, MongoExistsExpr as N, UpdateOneCommand as Nt, MongoBucketAutoStage as O, RawInsertOneCommand as Ot, MongoExprFilter as P, freezeMongoFieldShape as Pt, MongoOrExpr as Q, MongoFillOutput as R, isRecordArgs as Rt, MongoAggOperator as S, RawAggregateCommand as St, MongoAggSwitchBranch as T, RawFindOneAndDeleteCommand as Tt, MongoGeoNearStage as U, MongoFilterRewriter as V, MongoGraphLookupStage as W, MongoMergeStage as X, MongoMatchStage as Y, MongoNotExpr as Z, MongoAggFieldRef as _, MongoUnwindStage as _t, DeleteOneCommand as a, MongoReplaceRootStage as at, MongoAggMap as b, MongoVectorSearchStage as bt, InsertManyCommand as c, MongoSearchMetaStage as ct, MongoAggAccumulator as d, MongoSkipStage as dt, MongoPipelineStage as et, MongoAggArrayFilter as f, MongoSortByCountStage as ft, MongoAggExprVisitor as g, MongoUnionWithStage as gt, MongoAggExprRewriter as h, MongoStageVisitor as ht, DeleteManyCommand as i, MongoRedactStage as it, MongoDensifyRange as j, RawUpdateOneCommand as jt, MongoBucketStage as k, RawMongoCommand as kt, InsertOneCommand as l, MongoSearchStage as lt, MongoAggExpr as m, MongoStageRewriterContext as mt, AggregateCommand as n, MongoProjectionValue as nt, FindOneAndDeleteCommand as o, MongoResultShape as ot, MongoAggCond as p, MongoSortStage as pt, MongoLimitStage as q, AnyMongoCommand as r, MongoQueryPlan as rt, FindOneAndUpdateCommand as s, MongoSampleStage as st, AggRecordArgs as t, MongoProjectStage as tt, MongoAddFieldsStage as u, MongoSetWindowFieldsStage as ut, MongoAggLet as v, MongoUpdatePipelineStage as vt, MongoAggSwitch as w, RawDeleteOneCommand as wt, MongoAggMergeObjects as x, MongoWindowField as xt, MongoAggLiteral as y, MongoUpdateSpec as yt, MongoFillStage as z };
822
- //# sourceMappingURL=query-plan-C0-Yu8hf-DdilEdW6.d.mts.map
822
+ //# sourceMappingURL=query-plan-C0-Yu8hf-BnYfzKMn.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-plan-C0-Yu8hf-DdilEdW6.d.mts","names":[],"sources":["../../../../2-mongo-family/4-query/query-ast/dist/query-plan-C0-Yu8hf.d.mts"],"mappings":";;;;uBAGuB;oBACH;YACR;;;;KAIP,sBAAsB,eAAe,SAAS,eAAe;KAC7D,+BAA+B;uBACb,uBAAuB;WACnC,OAAO,GAAG,SAAS,kBAAkB,KAAK;WAC1C,QAAQ,SAAS,4BAA4B;;cAE1C,wBAAwB;WAC3B;WACA,QAAQ;EACjB,YAAY,QAAQ;EACpB,OAAO,GAAG,SAAS,kBAAkB,KAAK;EAC1C,QAAQ,SAAS,4BAA4B;;cAEjC,0BAA0B;WAC7B;WACA,YAAY,SAAS,eAAe;EAC7C,YAAY,YAAY,eAAe;EACvC,OAAO,GAAG,SAAS,kBAAkB,KAAK;EAC1C,QAAQ,SAAS,4BAA4B;;cAEjC,uBAAuB;WAC1B;WACA,MAAM,SAAS;EACxB,YAAY,MAAM;EAClB,OAAO,GAAG,SAAS,kBAAkB,KAAK;EAC1C,QAAQ,UAAU,4BAA4B;;cAElC,wBAAwB;WAC3B;WACA;EACT,YAAY;EACZ,OAAO,GAAG,SAAS,kBAAkB,KAAK;EAC1C,QAAQ,UAAU,4BAA4B;;cAElC,uBAAuB;WAC1B;WACA;EACT,YAAY;EACZ,OAAO,GAAG,SAAS,kBAAkB,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ongoCodec } from "./index-Dv2PNMiG.mjs";
2
- import { o as MongoParamRef } from "./index-wKMm41HC.mjs";
3
- import { ot as MongoResultShape, rt as MongoQueryPlan } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
4
- import "./execution-CKnUiOfm.mjs";
5
- import { r as AnyMongoDmlWireCommand } from "./index-BOnCg-qJ.mjs";
6
- import { a as MongoLoweredDraft, i as MongoDriver, t as MongoAdapter } from "./index-CrO8iljZ.mjs";
1
+ import { r as MongoCodecRegistry, t as MongoCodec } from "./index--ynTw_5M.mjs";
2
+ import { l as MongoParamRef } from "./index-9DDQlC5U.mjs";
3
+ import { ot as MongoResultShape, rt as MongoQueryPlan } from "./query-plan-C0-Yu8hf-BnYfzKMn.mjs";
4
+ import "./execution-BRC7ECq8.mjs";
5
+ import { r as AnyMongoDmlWireCommand } from "./index-BfTXOq5S.mjs";
6
+ import { a as MongoLoweredDraft, i as MongoDriver, t as MongoAdapter } from "./index-RT8HbGQG.mjs";
7
7
  import { AfterExecuteResult, AfterQueryResult, AsyncIterableResult, ExecuteInterceptResult, ExecutionPlan, MutationDefaultGeneratorContributor, MutationDefaults, ParamRefMutator, QueryInterceptResult, RuntimeExecuteOptions, RuntimeMiddleware, RuntimeMiddlewareContext, RuntimeStatementStats } from "@prisma/orm-framework/components/runtime";
8
8
  import { RuntimeAdapterDescriptor, RuntimeAdapterInstance, RuntimeDriverDescriptor, RuntimeDriverInstance, RuntimeExtensionDescriptor, RuntimeExtensionInstance, RuntimeTargetDescriptor, RuntimeTargetInstance, RuntimeTargetInstance as RuntimeTargetInstance$1 } from "@prisma/orm-framework/components/execution";
9
9
  //#region ../../../2-mongo-family/7-runtime/dist/index.d.mts
package/dist/runtime.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as newMongoCodecRegistry } from "./dist-Czwqx_i3.mjs";
2
- import { t as MongoParamRef } from "./dist-C7Ykq48Q.mjs";
1
+ import { n as newMongoCodecRegistry } from "./dist-CqUoKyeL.mjs";
2
+ import { t as MongoParamRef } from "./dist-CO2arS1K.mjs";
3
3
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
4
4
  import { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from "@prisma/orm-framework/components/runtime";
5
5
  import { blindCast } from "@prisma/orm-framework/utils/casts";
@@ -278,12 +278,11 @@ function* flattenMongoParamRefs(draft) {
278
278
  }
279
279
  function substituteSlot(value, overrides) {
280
280
  if (value instanceof MongoParamRef) {
281
- if (overrides.has(value)) {
282
- const opts = {};
283
- if (value.name !== void 0) opts.name = value.name;
284
- if (value.codecId !== void 0) opts.codecId = value.codecId;
285
- return new MongoParamRef(overrides.get(value), opts);
286
- }
281
+ if (overrides.has(value)) return new MongoParamRef(overrides.get(value), {
282
+ ...ifDefined("name", value.name),
283
+ ...ifDefined("codecId", value.codecId),
284
+ ...ifDefined("collection", value.collection)
285
+ });
287
286
  return value;
288
287
  }
289
288
  if (Array.isArray(value)) return value.map((item) => substituteSlot(item, overrides));