@prisma/orm-family-mongo 8.0.0-rc.14-dev.36 → 8.0.0-rc.14-dev.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime.mjs +15 -10
- package/dist/runtime.mjs.map +1 -1
- package/package.json +20 -20
package/dist/runtime.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as newMongoCodecRegistry } from "./dist-CqUoKyeL.mjs";
|
|
2
2
|
import { t as MongoParamRef } from "./dist-CO2arS1K.mjs";
|
|
3
3
|
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
|
-
import { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from "@prisma/orm-framework/components/runtime";
|
|
4
|
+
import { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, onQueryEndOutsideTransaction, reportExecuteEnding, reportQueryEnding, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from "@prisma/orm-framework/components/runtime";
|
|
5
5
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
6
6
|
import { isInternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
7
7
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -511,7 +511,7 @@ var MongoRuntimeImpl = class extends RuntimeCore {
|
|
|
511
511
|
#driver;
|
|
512
512
|
#codecs;
|
|
513
513
|
constructor(options) {
|
|
514
|
-
const middleware = options.middleware
|
|
514
|
+
const middleware = options.middleware ?? [];
|
|
515
515
|
const targetId = options.context.stack.target.targetId;
|
|
516
516
|
for (const mw of middleware) checkMiddlewareCompatibility(mw, "mongo", targetId);
|
|
517
517
|
const ctx = {
|
|
@@ -589,20 +589,25 @@ var MongoRuntimeImpl = class extends RuntimeCore {
|
|
|
589
589
|
const { codecCtx, middlewareCtx } = this.createQueryContexts(options);
|
|
590
590
|
const generator = async function* () {
|
|
591
591
|
const exec = await self.prepareQueryExecution(plan, codecCtx, middlewareCtx);
|
|
592
|
-
|
|
593
|
-
for await (const rawRow of stream) {
|
|
594
|
-
checkAborted(codecCtx, "stream");
|
|
595
|
-
if (exec.resultShape === void 0) yield blindCast(rawRow);
|
|
596
|
-
else yield blindCast(await decodeMongoRow(rawRow, exec.resultShape, self.#codecs, exec.command.collection, codecCtx));
|
|
597
|
-
}
|
|
592
|
+
yield* reportQueryEnding(onQueryEndOutsideTransaction(self.afterTransactionStageFor(exec, middlewareCtx)), () => self.#decodedRows(exec, codecCtx, middlewareCtx));
|
|
598
593
|
};
|
|
599
594
|
return new AsyncIterableResult(generator());
|
|
600
595
|
}
|
|
596
|
+
async *#decodedRows(exec, codecCtx, middlewareCtx) {
|
|
597
|
+
const stream = runQueryWithMiddleware(exec, this.middleware, middlewareCtx, () => this.runDriver(exec));
|
|
598
|
+
for await (const rawRow of stream) {
|
|
599
|
+
checkAborted(codecCtx, "stream");
|
|
600
|
+
if (exec.resultShape === void 0) yield blindCast(rawRow);
|
|
601
|
+
else yield blindCast(await decodeMongoRow(rawRow, exec.resultShape, this.#codecs, exec.command.collection, codecCtx));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
601
604
|
async execute(plan, options) {
|
|
602
605
|
const { codecCtx, middlewareCtx } = this.createQueryContexts(options);
|
|
603
606
|
const exec = await this.prepareExecuteExecution(plan, codecCtx, middlewareCtx);
|
|
604
|
-
|
|
605
|
-
|
|
607
|
+
return reportExecuteEnding(onQueryEndOutsideTransaction(this.afterTransactionStageFor(exec, middlewareCtx)), async () => {
|
|
608
|
+
checkAborted(codecCtx, "stream");
|
|
609
|
+
return runExecuteWithMiddleware(exec, this.middleware, middlewareCtx, () => this.runExecute(exec));
|
|
610
|
+
});
|
|
606
611
|
}
|
|
607
612
|
async #readDriverStatistics(exec) {
|
|
608
613
|
const countField = statisticsCountField(exec.command.kind);
|
package/dist/runtime.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":["#adapter","#driver","#codecs","#readDriverStatistics"],"sources":["../../../../2-mongo-family/7-runtime/dist/index.mjs"],"sourcesContent":["import { createExecutionStack } from \"@internal/framework-components/execution\";\nimport { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from \"@internal/framework-components/runtime\";\nimport { newMongoCodecRegistry } from \"@internal/mongo-codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isInternalError } from \"@internal/utils/internal-error\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { hashContent } from \"@internal/utils/hash-content\";\nimport { isPlainRecord } from \"@internal/contract/is-plain-record\";\nimport { MongoParamRef } from \"@internal/mongo-value\";\n//#region src/mongo-execution-stack.ts\nfunction createMongoExecutionStack(options) {\n\treturn blindCast(createExecutionStack({\n\t\ttarget: options.target,\n\t\tadapter: options.adapter,\n\t\tdriver: options.driver,\n\t\textensions: options.extensions\n\t}));\n}\nfunction createMongoExecutionContext(options) {\n\tconst registry = newMongoCodecRegistry();\n\tconst owners = /* @__PURE__ */ new Map();\n\tconst contributors = [\n\t\toptions.stack.target,\n\t\toptions.stack.adapter,\n\t\t...options.stack.extensions\n\t];\n\tconst generators = collectMutationDefaultGenerators(contributors);\n\tconst execution = executionOf(options.contract);\n\tassertMutationDefaultGeneratorsAvailable(execution, generators);\n\tfor (const contributor of contributors) {\n\t\tconst contributed = contributor.codecs();\n\t\tfor (const codec of iterateCodecs(contributed)) {\n\t\t\tconst existingOwner = owners.get(codec.id);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate Mongo codec id '${codec.id}' contributed by '${contributor.id}' (already registered by '${existingOwner}').`, {\n\t\t\t\tcodecId: codec.id,\n\t\t\t\texistingOwner,\n\t\t\t\tincomingOwner: contributor.id\n\t\t\t});\n\t\t\tregistry.register(codec);\n\t\t\towners.set(codec.id, contributor.id);\n\t\t}\n\t}\n\treturn Object.freeze({\n\t\tcontract: options.contract,\n\t\tcodecs: registry,\n\t\tstack: options.stack,\n\t\tapplyMutationDefaults: (mutation) => applyMutationDefaults(execution, generators, mutation)\n\t});\n}\nfunction executionOf(contract) {\n\treturn blindCast(contract)?.execution;\n}\nfunction* iterateCodecs(registry) {\n\tyield* registry.values();\n}\n//#endregion\n//#region src/codecs/decoding.ts\nconst WIRE_PREVIEW_LIMIT = 100;\nfunction truncate(text) {\n\treturn text.length > WIRE_PREVIEW_LIMIT ? `${text.substring(0, WIRE_PREVIEW_LIMIT)}...` : text;\n}\n/**\n* JSON text of the wire value, using each BSON class's own JSON form (an `ObjectId` as its hex string, a `Date` as ISO text), or `String(value)` when it has none.\n*/\nfunction previewWireValue(wireValue) {\n\tif (typeof wireValue === \"string\") return truncate(wireValue);\n\ttry {\n\t\treturn truncate(JSON.stringify(wireValue, (_key, value) => typeof value === \"bigint\" ? `${value}n` : value) ?? String(wireValue));\n\t} catch {\n\t\treturn truncate(String(wireValue));\n\t}\n}\nfunction hasHexString(value) {\n\treturn \"toHexString\" in value && typeof value.toHexString === \"function\";\n}\nfunction describeDocumentId(id) {\n\tif (id === void 0) return void 0;\n\tif (typeof id === \"string\") return JSON.stringify(id);\n\tif (typeof id === \"object\" && id !== null && hasHexString(id)) return id.toHexString();\n\treturn previewWireValue(id);\n}\n/**\n* Every decode failure names the collection and field, and the `_id` of the document when the row carries one; inside a document shape marked `row`, that document's `_id` and the field's path from it. A codec's own `RUNTIME.DECODE_FAILED` keeps its code and details, with the location added; any other structured envelope (a dotted `code`, per `isStructuredError`) and an `InternalError` pass through unchanged; everything else is wrapped in a `RUNTIME.DECODE_FAILED` envelope. The original error is the `cause`.\n*/\nfunction wrapDecodeFailure(error, location, codecId, wireValue) {\n\tif (isInternalError(error)) throw error;\n\tconst codecDetails = isStructuredError(error) ? error.meta : void 0;\n\tif (isStructuredError(error) && error.code !== \"RUNTIME.DECODE_FAILED\") throw error;\n\tconst { collection, path, documentId } = location;\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst wrapped = runtimeError(\"RUNTIME.DECODE_FAILED\", `Failed to decode field ${path}${documentId === void 0 ? \"\" : ` of the document with _id ${documentId}`} in collection '${collection}' with codec '${codecId}': ${message}`, {\n\t\t...codecDetails,\n\t\tcollection,\n\t\tpath,\n\t\t...ifDefined(\"documentId\", documentId),\n\t\tcodec: codecId,\n\t\twirePreview: previewWireValue(wireValue)\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\n/**\n* A document may leave out a nullable field entirely (Prisma 6 and the driver both omit it); the field's type says `null`, so an absent value reads as `null`.\n*/\nfunction absentAsNull(value, nullable) {\n\treturn value === void 0 && nullable ? null : value;\n}\nasync function decodeMongoRow(row, shape, registry, collection, ctx = {}) {\n\tif (shape.kind === \"unknown\") return row;\n\tif (typeof row !== \"object\" || row === null) return row;\n\tconst rowObj = blindCast(row);\n\tconst out = {};\n\tconst tasks = [];\n\tfunction scheduleLeaf(path, documentId, codecId, wire, assign) {\n\t\tconst codec = registry.get(codecId);\n\t\tif (!codec) {\n\t\t\tassign(wire);\n\t\t\treturn;\n\t\t}\n\t\ttasks.push((async () => {\n\t\t\ttry {\n\t\t\t\tassign(await codec.decode(wire, ctx));\n\t\t\t} catch (error) {\n\t\t\t\twrapDecodeFailure(error, {\n\t\t\t\t\tcollection,\n\t\t\t\t\tpath,\n\t\t\t\t\tdocumentId\n\t\t\t\t}, codecId, wire);\n\t\t\t}\n\t\t})());\n\t}\n\tfunction walkField(value, fieldShape, path, documentId, assign) {\n\t\tswitch (fieldShape.kind) {\n\t\t\tcase \"unknown\":\n\t\t\t\tassign(value);\n\t\t\t\treturn;\n\t\t\tcase \"leaf\":\n\t\t\t\tif (value === null || value === void 0) {\n\t\t\t\t\tassign(absentAsNull(value, fieldShape.nullable));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tscheduleLeaf(path, documentId, fieldShape.codecId, value, assign);\n\t\t\t\treturn;\n\t\t\tcase \"document\": {\n\t\t\t\tif (value === null || value === void 0) {\n\t\t\t\t\tassign(absentAsNull(value, fieldShape.nullable));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\t\t\t\tassign(value);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst vObj = blindCast(value);\n\t\t\t\tconst nested = { ...vObj };\n\t\t\t\tassign(nested);\n\t\t\t\tfor (const [fk, fShape] of Object.entries(fieldShape.fields)) walkField(vObj[fk], fShape, fieldShape.row ? fk : `${path}.${fk}`, fieldShape.row ? describeDocumentId(vObj[\"_id\"]) : documentId, (v) => {\n\t\t\t\t\tnested[fk] = v;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"array\": {\n\t\t\t\tif (value === null || value === void 0) {\n\t\t\t\t\tassign(absentAsNull(value, fieldShape.nullable));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tassign(value);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst arr = [];\n\t\t\t\tassign(arr);\n\t\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\t\tconst el = value[i];\n\t\t\t\t\twalkField(el, fieldShape.element, `${path}.${i}`, documentId, (v) => {\n\t\t\t\t\t\tarr[i] = v;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t/* v8 ignore stop */\n\t}\n\tconst documentId = describeDocumentId(rowObj[\"_id\"]);\n\tfor (const [k, fShape] of Object.entries(shape.fields)) walkField(rowObj[k], fShape, k, documentId, (v) => {\n\t\tout[k] = v;\n\t});\n\tfor (const k of Object.keys(rowObj)) if (!Object.hasOwn(shape.fields, k)) out[k] = rowObj[k];\n\tawait Promise.all(tasks);\n\treturn out;\n}\n//#endregion\n//#region src/content-hash.ts\n/** @internal */\nconst RUNTIME_CONTENT_HASH_REQUIRES_RESOLVED_COMMAND = \"RUNTIME.CONTENT_HASH_REQUIRES_RESOLVED_COMMAND\";\n/**\n* Resolved wire commands are frozen class instances (`InsertOneWireCommand`, …);\n* pre-resolve `beforeExecute` plans hold a plain-object `MongoLoweredDraft` in the\n* command slot. O(1) prototype check — no tree walk on the hot path.\n*/\nfunction isResolvedMongoWireCommand(command) {\n\tif (command === null || typeof command !== \"object\") return false;\n\tconst proto = Object.getPrototypeOf(command);\n\treturn proto !== null && proto !== Object.prototype;\n}\nfunction assertContentHashOnResolvedCommand(command) {\n\tif (isResolvedMongoWireCommand(command)) return;\n\tthrow runtimeError(RUNTIME_CONTENT_HASH_REQUIRES_RESOLVED_COMMAND, \"contentHash and computeMongoContentHash are only valid on a resolved wire command after parameter resolution. During a before hook, plan.command holds an unresolved MongoLoweredDraft — use params.entries() and the param mutator instead of contentHash or structural reads of plan.command.\", { phase: \"beforeExecute\" });\n}\n/**\n* Computes a stable content hash for a lowered Mongo execution plan.\n*\n* Internally builds an unambiguous canonical-stringified preimage from\n* two components:\n*\n* 1. `meta.storageHash` — discriminates by schema. A migration changes the\n* storage hash, which invalidates cached entries automatically (no\n* per-app invalidation logic needed for schema changes).\n* 2. `exec.command` — the wire command. `canonicalStringify` produces a\n* deterministic serialization that is stable across object key\n* insertion order and that distinguishes types JSON would otherwise\n* conflate (e.g. `BigInt(1)` vs `1`, `Date` vs ISO string, `Buffer`\n* vs number array). The spread converts the frozen wire-command\n* class instance (`InsertOneWireCommand`, `AggregateWireCommand`, …)\n* into a plain object exposing its own enumerable properties\n* (`kind`, `collection`, plus the payload-specific fields like\n* `document`/`filter`/`update`/`pipeline`/…), which is what\n* `canonicalStringify` accepts; class instances are rejected\n* outright to prevent silent collisions.\n*\n* Unlike SQL, there is no separate \"rendered statement\" component because\n* a Mongo `MongoExecutionPlan.command` is the wire command itself —\n* canonicalizing it captures both structure and parameters in one pass.\n*\n* The components are wrapped in an object and canonicalized as a single\n* unit (rather than concatenated with a delimiter) so component\n* boundaries are unambiguous and cannot collide with a different split\n* of the same characters.\n*\n* The canonical string is then piped through `hashContent` to produce a\n* bounded, opaque digest. See `@internal/utils/hash-content` for the\n* rationale.\n*\n* @throws {RuntimeErrorEnvelope} {@link RUNTIME_CONTENT_HASH_REQUIRES_RESOLVED_COMMAND}\n* when `exec.command` is still a pre-resolve draft (plain object), e.g. when\n* `contentHash` is called from `beforeExecute`.\n*\n* @internal\n*/\nfunction computeMongoContentHash(exec) {\n\tassertContentHashOnResolvedCommand(exec.command);\n\treturn hashContent(canonicalStringify({\n\t\tstorageHash: exec.meta.storageHash,\n\t\tcommand: { ...exec.command }\n\t}));\n}\n//#endregion\n//#region src/param-ref-mutator.ts\nfunction* flattenDraftSlot(value) {\n\tif (value instanceof MongoParamRef) {\n\t\tyield value;\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (const item of value) yield* flattenDraftSlot(item);\n\t\treturn;\n\t}\n\tif (isPlainRecord(value)) for (const v of Object.values(value)) yield* flattenDraftSlot(v);\n}\n/**\n* Flat walk over a `MongoLoweredDraft` yielding every `MongoParamRef` leaf\n* regardless of nesting — object values, array elements, filter predicate\n* values, update operator values, and pipeline stage values. Raw command\n* variants carry no `MongoParamRef` nodes so they yield zero entries.\n*\n* **Walk parity:** slot traversal matches `resolveDraftSlot` / `resolveParams`\n* — refs appear only in plain-object and array containers; `Date` and other\n* non-plain objects are leaves (not descended into), so middleware sees every\n* ref the resolve pass will encode.\n*/\nfunction* flattenMongoParamRefs(draft) {\n\tswitch (draft.kind) {\n\t\tcase \"insertOne\":\n\t\tcase \"rawInsertOne\":\n\t\t\tyield* flattenDraftSlot(draft.document);\n\t\t\tbreak;\n\t\tcase \"insertMany\":\n\t\tcase \"rawInsertMany\":\n\t\t\tfor (const doc of draft.documents) yield* flattenDraftSlot(doc);\n\t\t\tbreak;\n\t\tcase \"updateOne\":\n\t\tcase \"updateMany\":\n\t\tcase \"rawUpdateOne\":\n\t\tcase \"rawUpdateMany\":\n\t\t\tyield* flattenDraftSlot(draft.filter);\n\t\t\tyield* flattenDraftSlot(draft.update);\n\t\t\tbreak;\n\t\tcase \"findOneAndUpdate\":\n\t\tcase \"rawFindOneAndUpdate\":\n\t\t\tyield* flattenDraftSlot(draft.filter);\n\t\t\tyield* flattenDraftSlot(draft.update);\n\t\t\tbreak;\n\t\tcase \"deleteOne\":\n\t\tcase \"deleteMany\":\n\t\tcase \"rawDeleteOne\":\n\t\tcase \"rawDeleteMany\":\n\t\t\tyield* flattenDraftSlot(draft.filter);\n\t\t\tbreak;\n\t\tcase \"findOneAndDelete\":\n\t\tcase \"rawFindOneAndDelete\":\n\t\t\tyield* flattenDraftSlot(draft.filter);\n\t\t\tbreak;\n\t\tcase \"aggregate\":\n\t\tcase \"rawAggregate\":\n\t\t\tfor (const stage of draft.pipeline) yield* flattenDraftSlot(stage);\n\t\t\tbreak;\n\t}\n}\nfunction substituteSlot(value, overrides) {\n\tif (value instanceof MongoParamRef) {\n\t\tif (overrides.has(value)) return new MongoParamRef(overrides.get(value), {\n\t\t\t...ifDefined(\"name\", value.name),\n\t\t\t...ifDefined(\"codecId\", value.codecId),\n\t\t\t...ifDefined(\"collection\", value.collection)\n\t\t});\n\t\treturn value;\n\t}\n\tif (Array.isArray(value)) return value.map((item) => substituteSlot(item, overrides));\n\tif (isPlainRecord(value)) {\n\t\tconst out = {};\n\t\tfor (const [k, v] of Object.entries(value)) out[k] = substituteSlot(v, overrides);\n\t\treturn out;\n\t}\n\treturn value;\n}\nfunction substituteDoc(doc, overrides) {\n\treturn blindCast(substituteSlot(doc, overrides));\n}\nfunction isUpdatePipeline(update) {\n\treturn Array.isArray(update);\n}\nfunction substituteUpdate(update, overrides) {\n\tif (isUpdatePipeline(update)) return update.map((stage) => substituteDoc(stage, overrides));\n\treturn substituteDoc(update, overrides);\n}\nfunction buildMutatedDraft(draft, overrides) {\n\tswitch (draft.kind) {\n\t\tcase \"insertOne\": return {\n\t\t\tkind: \"insertOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tdocument: substituteDoc(draft.document, overrides)\n\t\t};\n\t\tcase \"rawInsertOne\": return {\n\t\t\tkind: \"rawInsertOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tdocument: substituteDoc(draft.document, overrides)\n\t\t};\n\t\tcase \"insertMany\": return {\n\t\t\tkind: \"insertMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tdocuments: draft.documents.map((d) => substituteDoc(d, overrides))\n\t\t};\n\t\tcase \"rawInsertMany\": return {\n\t\t\tkind: \"rawInsertMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tdocuments: draft.documents.map((d) => substituteDoc(d, overrides))\n\t\t};\n\t\tcase \"updateOne\": return {\n\t\t\tkind: \"updateOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides),\n\t\t\tupsert: draft.upsert\n\t\t};\n\t\tcase \"updateMany\": return {\n\t\t\tkind: \"updateMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides),\n\t\t\tupsert: draft.upsert\n\t\t};\n\t\tcase \"rawUpdateOne\": return {\n\t\t\tkind: \"rawUpdateOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides)\n\t\t};\n\t\tcase \"rawUpdateMany\": return {\n\t\t\tkind: \"rawUpdateMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides)\n\t\t};\n\t\tcase \"deleteOne\": return {\n\t\t\tkind: \"deleteOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides)\n\t\t};\n\t\tcase \"deleteMany\": return {\n\t\t\tkind: \"deleteMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides)\n\t\t};\n\t\tcase \"rawDeleteOne\": return {\n\t\t\tkind: \"rawDeleteOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides)\n\t\t};\n\t\tcase \"rawDeleteMany\": return {\n\t\t\tkind: \"rawDeleteMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides)\n\t\t};\n\t\tcase \"findOneAndUpdate\": return {\n\t\t\tkind: \"findOneAndUpdate\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides),\n\t\t\tupsert: draft.upsert,\n\t\t\tsort: draft.sort,\n\t\t\treturnDocument: draft.returnDocument\n\t\t};\n\t\tcase \"rawFindOneAndUpdate\": return {\n\t\t\tkind: \"rawFindOneAndUpdate\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides),\n\t\t\tupsert: draft.upsert,\n\t\t\tsort: draft.sort,\n\t\t\treturnDocument: draft.returnDocument\n\t\t};\n\t\tcase \"findOneAndDelete\": return {\n\t\t\tkind: \"findOneAndDelete\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tsort: draft.sort\n\t\t};\n\t\tcase \"rawFindOneAndDelete\": return {\n\t\t\tkind: \"rawFindOneAndDelete\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tsort: draft.sort\n\t\t};\n\t\tcase \"aggregate\": return {\n\t\t\tkind: \"aggregate\",\n\t\t\tcollection: draft.collection,\n\t\t\tpipeline: draft.pipeline.map((s) => substituteDoc(s, overrides))\n\t\t};\n\t\tcase \"rawAggregate\": return {\n\t\t\tkind: \"rawAggregate\",\n\t\t\tcollection: draft.collection,\n\t\t\tpipeline: draft.pipeline.map((s) => substituteDoc(s, overrides))\n\t\t};\n\t}\n}\n/**\n* Build a {@link MongoParamRefMutatorInternal} for the given lowered draft.\n*\n* The mutator captures the draft by reference and uses `flattenMongoParamRefs`\n* on demand to produce `entries()`. Replacements are stored in a lazily-\n* allocated `Map`; the fast path (no replacements) preserves bit-for-bit\n* reference identity to the original draft in `currentDraft()`.\n*/\nfunction createMongoParamRefMutator(draft) {\n\tconst originalDraft = draft;\n\tlet overrides;\n\tconst ensureOverrides = () => {\n\t\tif (!overrides) overrides = /* @__PURE__ */ new Map();\n\t\treturn overrides;\n\t};\n\tfunction* entries() {\n\t\tfor (const ref of flattenMongoParamRefs(originalDraft)) yield blindCast({\n\t\t\tref: blindCast(ref),\n\t\t\tvalue: overrides?.has(ref) ? overrides.get(ref) : ref.value,\n\t\t\tcodecId: ref.codecId\n\t\t});\n\t}\n\tfunction replaceValue(handle, newValue) {\n\t\tensureOverrides().set(blindCast(handle), newValue);\n\t}\n\tfunction replaceValues(updates) {\n\t\tconst map = ensureOverrides();\n\t\tfor (const { ref, newValue } of updates) map.set(blindCast(ref), newValue);\n\t}\n\treturn {\n\t\tentries,\n\t\treplaceValue: blindCast(replaceValue),\n\t\treplaceValues,\n\t\tcurrentDraft() {\n\t\t\tif (!overrides || overrides.size === 0) return originalDraft;\n\t\t\treturn buildMutatedDraft(originalDraft, overrides);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/mongo-runtime.ts\nfunction noop() {}\nfunction isUnknownRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction statisticsCountField(commandKind) {\n\tswitch (commandKind) {\n\t\tcase \"updateOne\":\n\t\tcase \"updateMany\": return \"modifiedCount\";\n\t\tcase \"deleteOne\":\n\t\tcase \"deleteMany\": return \"deletedCount\";\n\t\tdefault: return;\n\t}\n}\nfunction invalidStatisticsResult(commandKind, countField) {\n\treturn runtimeError(\"RUNTIME.MONGO_STATISTICS_RESULT_INVALID\", `Mongo command '${commandKind}' did not return exactly one numeric '${countField}' result`, {\n\t\tcommandKind,\n\t\tcountField\n\t});\n}\nvar MongoRuntimeImpl = class extends RuntimeCore {\n\t#adapter;\n\t#driver;\n\t#codecs;\n\tconstructor(options) {\n\t\tconst middleware = options.middleware ? [...options.middleware] : [];\n\t\tconst targetId = options.context.stack.target.targetId;\n\t\tfor (const mw of middleware) checkMiddlewareCompatibility(mw, \"mongo\", targetId);\n\t\tconst ctx = {\n\t\t\tcontract: options.context.contract,\n\t\t\tmode: options.mode ?? \"strict\",\n\t\t\tnow: () => Date.now(),\n\t\t\tlog: {\n\t\t\t\tinfo: noop,\n\t\t\t\twarn: noop,\n\t\t\t\terror: noop\n\t\t\t},\n\t\t\tcontentHash: (exec) => computeMongoContentHash(blindCast(exec)),\n\t\t\tscope: \"runtime\",\n\t\t\tplanExecutionId: \"\"\n\t\t};\n\t\tsuper({\n\t\t\tmiddleware,\n\t\t\tctx\n\t\t});\n\t\tconst adapterInstance = options.context.stack.adapter.create(options.context.stack);\n\t\tthis.#adapter = adapterInstance;\n\t\tthis.#driver = options.driver;\n\t\tthis.#codecs = options.context.codecs;\n\t}\n\t/* v8 ignore start -- one-phase lower satisfies RuntimeCore; operations use the split preparation pipeline */\n\tasync lower(plan, ctx) {\n\t\treturn {\n\t\t\tcommand: await this.#adapter.lower(plan, ctx),\n\t\t\tmeta: plan.meta,\n\t\t\t...ifDefined(\"resultShape\", plan.resultShape)\n\t\t};\n\t}\n\t/* v8 ignore stop */\n\trunDriver(exec) {\n\t\treturn this.#driver.execute(exec.command);\n\t}\n\trunExecute(exec) {\n\t\treturn this.#readDriverStatistics(exec);\n\t}\n\tcreateQueryContexts(options) {\n\t\tconst signal = options?.signal;\n\t\treturn {\n\t\t\tcodecCtx: signal === void 0 ? {} : { signal },\n\t\t\tmiddlewareCtx: {\n\t\t\t\t...this.ctx,\n\t\t\t\t...ifDefined(\"signal\", signal),\n\t\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t\t}\n\t\t};\n\t}\n\tprepareQueryExecution(plan, codecCtx, middlewareCtx) {\n\t\treturn this.prepareOperation(plan, codecCtx, middlewareCtx, runBeforeQueryChain);\n\t}\n\tprepareExecuteExecution(plan, codecCtx, middlewareCtx) {\n\t\treturn this.prepareOperation(plan, codecCtx, middlewareCtx, runBeforeExecuteChain);\n\t}\n\tasync prepareOperation(plan, codecCtx, middlewareCtx, runBefore) {\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\tconst compiled = await this.runBeforeCompile(plan);\n\t\tconst draft = this.#adapter.structuralLower(compiled);\n\t\tconst mutator = createMongoParamRefMutator(draft);\n\t\tawait runBefore({\n\t\t\tmeta: compiled.meta,\n\t\t\t...ifDefined(\"resultShape\", compiled.resultShape),\n\t\t\tcommand: blindCast(draft)\n\t\t}, this.middleware, middlewareCtx, mutator);\n\t\treturn {\n\t\t\tmeta: compiled.meta,\n\t\t\t...ifDefined(\"resultShape\", compiled.resultShape),\n\t\t\tcommand: await this.#adapter.resolveParams(mutator.currentDraft(), codecCtx)\n\t\t};\n\t}\n\tquery(plan, options) {\n\t\tconst self = this;\n\t\tconst { codecCtx, middlewareCtx } = this.createQueryContexts(options);\n\t\tconst generator = async function* () {\n\t\t\tconst exec = await self.prepareQueryExecution(plan, codecCtx, middlewareCtx);\n\t\t\tconst stream = runQueryWithMiddleware(exec, self.middleware, middlewareCtx, () => self.runDriver(exec));\n\t\t\tfor await (const rawRow of stream) {\n\t\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\t\tif (exec.resultShape === void 0) yield blindCast(rawRow);\n\t\t\t\telse yield blindCast(await decodeMongoRow(rawRow, exec.resultShape, self.#codecs, exec.command.collection, codecCtx));\n\t\t\t}\n\t\t};\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\tasync execute(plan, options) {\n\t\tconst { codecCtx, middlewareCtx } = this.createQueryContexts(options);\n\t\tconst exec = await this.prepareExecuteExecution(plan, codecCtx, middlewareCtx);\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\treturn runExecuteWithMiddleware(exec, this.middleware, middlewareCtx, () => this.runExecute(exec));\n\t}\n\tasync #readDriverStatistics(exec) {\n\t\tconst countField = statisticsCountField(exec.command.kind);\n\t\tif (countField === void 0) throw runtimeError(\"RUNTIME.MONGO_STATISTICS_UNSUPPORTED\", `Mongo command '${exec.command.kind}' does not expose statement statistics`, { commandKind: exec.command.kind });\n\t\tlet affectedRows;\n\t\tfor await (const result of this.#driver.execute(exec.command)) {\n\t\t\tif (affectedRows !== void 0 || !isUnknownRecord(result)) throw invalidStatisticsResult(exec.command.kind, countField);\n\t\t\tconst count = result[countField];\n\t\t\tif (typeof count !== \"number\") throw invalidStatisticsResult(exec.command.kind, countField);\n\t\t\taffectedRows = count;\n\t\t}\n\t\tif (affectedRows === void 0) throw invalidStatisticsResult(exec.command.kind, countField);\n\t\treturn { affectedRows };\n\t}\n\tasync close() {\n\t\tawait this.#driver.close();\n\t}\n};\nfunction createMongoRuntime(options) {\n\treturn new MongoRuntimeImpl(options);\n}\n//#endregion\nexport { createMongoExecutionContext, createMongoExecutionStack, createMongoParamRefMutator, createMongoRuntime, flattenMongoParamRefs };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,0BAA0B,SAAS;CAC3C,OAAO,UAAU,qBAAqB;EACrC,QAAQ,QAAQ;EAChB,SAAS,QAAQ;EACjB,QAAQ,QAAQ;EA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o-family/7-runtime/dist/index.mjs"],"sourcesContent":["import { createExecutionStack } from \"@internal/framework-components/execution\";\nimport { AsyncIterableResult, RuntimeCore, applyMutationDefaults, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, onQueryEndOutsideTransaction, reportExecuteEnding, reportQueryEnding, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeError } from \"@internal/framework-components/runtime\";\nimport { newMongoCodecRegistry } from \"@internal/mongo-codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isInternalError } from \"@internal/utils/internal-error\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { hashContent } from \"@internal/utils/hash-content\";\nimport { isPlainRecord } from \"@internal/contract/is-plain-record\";\nimport { MongoParamRef } from \"@internal/mongo-value\";\n//#region src/mongo-execution-stack.ts\nfunction createMongoExecutionStack(options) {\n\treturn blindCast(createExecutionStack({\n\t\ttarget: options.target,\n\t\tadapter: options.adapter,\n\t\tdriver: options.driver,\n\t\textensions: options.extensions\n\t}));\n}\nfunction createMongoExecutionContext(options) {\n\tconst registry = newMongoCodecRegistry();\n\tconst owners = /* @__PURE__ */ new Map();\n\tconst contributors = [\n\t\toptions.stack.target,\n\t\toptions.stack.adapter,\n\t\t...options.stack.extensions\n\t];\n\tconst generators = collectMutationDefaultGenerators(contributors);\n\tconst execution = executionOf(options.contract);\n\tassertMutationDefaultGeneratorsAvailable(execution, generators);\n\tfor (const contributor of contributors) {\n\t\tconst contributed = contributor.codecs();\n\t\tfor (const codec of iterateCodecs(contributed)) {\n\t\t\tconst existingOwner = owners.get(codec.id);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate Mongo codec id '${codec.id}' contributed by '${contributor.id}' (already registered by '${existingOwner}').`, {\n\t\t\t\tcodecId: codec.id,\n\t\t\t\texistingOwner,\n\t\t\t\tincomingOwner: contributor.id\n\t\t\t});\n\t\t\tregistry.register(codec);\n\t\t\towners.set(codec.id, contributor.id);\n\t\t}\n\t}\n\treturn Object.freeze({\n\t\tcontract: options.contract,\n\t\tcodecs: registry,\n\t\tstack: options.stack,\n\t\tapplyMutationDefaults: (mutation) => applyMutationDefaults(execution, generators, mutation)\n\t});\n}\nfunction executionOf(contract) {\n\treturn blindCast(contract)?.execution;\n}\nfunction* iterateCodecs(registry) {\n\tyield* registry.values();\n}\n//#endregion\n//#region src/codecs/decoding.ts\nconst WIRE_PREVIEW_LIMIT = 100;\nfunction truncate(text) {\n\treturn text.length > WIRE_PREVIEW_LIMIT ? `${text.substring(0, WIRE_PREVIEW_LIMIT)}...` : text;\n}\n/**\n* JSON text of the wire value, using each BSON class's own JSON form (an `ObjectId` as its hex string, a `Date` as ISO text), or `String(value)` when it has none.\n*/\nfunction previewWireValue(wireValue) {\n\tif (typeof wireValue === \"string\") return truncate(wireValue);\n\ttry {\n\t\treturn truncate(JSON.stringify(wireValue, (_key, value) => typeof value === \"bigint\" ? `${value}n` : value) ?? String(wireValue));\n\t} catch {\n\t\treturn truncate(String(wireValue));\n\t}\n}\nfunction hasHexString(value) {\n\treturn \"toHexString\" in value && typeof value.toHexString === \"function\";\n}\nfunction describeDocumentId(id) {\n\tif (id === void 0) return void 0;\n\tif (typeof id === \"string\") return JSON.stringify(id);\n\tif (typeof id === \"object\" && id !== null && hasHexString(id)) return id.toHexString();\n\treturn previewWireValue(id);\n}\n/**\n* Every decode failure names the collection and field, and the `_id` of the document when the row carries one; inside a document shape marked `row`, that document's `_id` and the field's path from it. A codec's own `RUNTIME.DECODE_FAILED` keeps its code and details, with the location added; any other structured envelope (a dotted `code`, per `isStructuredError`) and an `InternalError` pass through unchanged; everything else is wrapped in a `RUNTIME.DECODE_FAILED` envelope. The original error is the `cause`.\n*/\nfunction wrapDecodeFailure(error, location, codecId, wireValue) {\n\tif (isInternalError(error)) throw error;\n\tconst codecDetails = isStructuredError(error) ? error.meta : void 0;\n\tif (isStructuredError(error) && error.code !== \"RUNTIME.DECODE_FAILED\") throw error;\n\tconst { collection, path, documentId } = location;\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst wrapped = runtimeError(\"RUNTIME.DECODE_FAILED\", `Failed to decode field ${path}${documentId === void 0 ? \"\" : ` of the document with _id ${documentId}`} in collection '${collection}' with codec '${codecId}': ${message}`, {\n\t\t...codecDetails,\n\t\tcollection,\n\t\tpath,\n\t\t...ifDefined(\"documentId\", documentId),\n\t\tcodec: codecId,\n\t\twirePreview: previewWireValue(wireValue)\n\t});\n\twrapped.cause = error;\n\tthrow wrapped;\n}\n/**\n* A document may leave out a nullable field entirely (Prisma 6 and the driver both omit it); the field's type says `null`, so an absent value reads as `null`.\n*/\nfunction absentAsNull(value, nullable) {\n\treturn value === void 0 && nullable ? null : value;\n}\nasync function decodeMongoRow(row, shape, registry, collection, ctx = {}) {\n\tif (shape.kind === \"unknown\") return row;\n\tif (typeof row !== \"object\" || row === null) return row;\n\tconst rowObj = blindCast(row);\n\tconst out = {};\n\tconst tasks = [];\n\tfunction scheduleLeaf(path, documentId, codecId, wire, assign) {\n\t\tconst codec = registry.get(codecId);\n\t\tif (!codec) {\n\t\t\tassign(wire);\n\t\t\treturn;\n\t\t}\n\t\ttasks.push((async () => {\n\t\t\ttry {\n\t\t\t\tassign(await codec.decode(wire, ctx));\n\t\t\t} catch (error) {\n\t\t\t\twrapDecodeFailure(error, {\n\t\t\t\t\tcollection,\n\t\t\t\t\tpath,\n\t\t\t\t\tdocumentId\n\t\t\t\t}, codecId, wire);\n\t\t\t}\n\t\t})());\n\t}\n\tfunction walkField(value, fieldShape, path, documentId, assign) {\n\t\tswitch (fieldShape.kind) {\n\t\t\tcase \"unknown\":\n\t\t\t\tassign(value);\n\t\t\t\treturn;\n\t\t\tcase \"leaf\":\n\t\t\t\tif (value === null || value === void 0) {\n\t\t\t\t\tassign(absentAsNull(value, fieldShape.nullable));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tscheduleLeaf(path, documentId, fieldShape.codecId, value, assign);\n\t\t\t\treturn;\n\t\t\tcase \"document\": {\n\t\t\t\tif (value === null || value === void 0) {\n\t\t\t\t\tassign(absentAsNull(value, fieldShape.nullable));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\t\t\t\tassign(value);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst vObj = blindCast(value);\n\t\t\t\tconst nested = { ...vObj };\n\t\t\t\tassign(nested);\n\t\t\t\tfor (const [fk, fShape] of Object.entries(fieldShape.fields)) walkField(vObj[fk], fShape, fieldShape.row ? fk : `${path}.${fk}`, fieldShape.row ? describeDocumentId(vObj[\"_id\"]) : documentId, (v) => {\n\t\t\t\t\tnested[fk] = v;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"array\": {\n\t\t\t\tif (value === null || value === void 0) {\n\t\t\t\t\tassign(absentAsNull(value, fieldShape.nullable));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\tassign(value);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst arr = [];\n\t\t\t\tassign(arr);\n\t\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\t\tconst el = value[i];\n\t\t\t\t\twalkField(el, fieldShape.element, `${path}.${i}`, documentId, (v) => {\n\t\t\t\t\t\tarr[i] = v;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t/* v8 ignore stop */\n\t}\n\tconst documentId = describeDocumentId(rowObj[\"_id\"]);\n\tfor (const [k, fShape] of Object.entries(shape.fields)) walkField(rowObj[k], fShape, k, documentId, (v) => {\n\t\tout[k] = v;\n\t});\n\tfor (const k of Object.keys(rowObj)) if (!Object.hasOwn(shape.fields, k)) out[k] = rowObj[k];\n\tawait Promise.all(tasks);\n\treturn out;\n}\n//#endregion\n//#region src/content-hash.ts\n/** @internal */\nconst RUNTIME_CONTENT_HASH_REQUIRES_RESOLVED_COMMAND = \"RUNTIME.CONTENT_HASH_REQUIRES_RESOLVED_COMMAND\";\n/**\n* Resolved wire commands are frozen class instances (`InsertOneWireCommand`, …);\n* pre-resolve `beforeExecute` plans hold a plain-object `MongoLoweredDraft` in the\n* command slot. O(1) prototype check — no tree walk on the hot path.\n*/\nfunction isResolvedMongoWireCommand(command) {\n\tif (command === null || typeof command !== \"object\") return false;\n\tconst proto = Object.getPrototypeOf(command);\n\treturn proto !== null && proto !== Object.prototype;\n}\nfunction assertContentHashOnResolvedCommand(command) {\n\tif (isResolvedMongoWireCommand(command)) return;\n\tthrow runtimeError(RUNTIME_CONTENT_HASH_REQUIRES_RESOLVED_COMMAND, \"contentHash and computeMongoContentHash are only valid on a resolved wire command after parameter resolution. During a before hook, plan.command holds an unresolved MongoLoweredDraft — use params.entries() and the param mutator instead of contentHash or structural reads of plan.command.\", { phase: \"beforeExecute\" });\n}\n/**\n* Computes a stable content hash for a lowered Mongo execution plan.\n*\n* Internally builds an unambiguous canonical-stringified preimage from\n* two components:\n*\n* 1. `meta.storageHash` — discriminates by schema. A migration changes the\n* storage hash, which invalidates cached entries automatically (no\n* per-app invalidation logic needed for schema changes).\n* 2. `exec.command` — the wire command. `canonicalStringify` produces a\n* deterministic serialization that is stable across object key\n* insertion order and that distinguishes types JSON would otherwise\n* conflate (e.g. `BigInt(1)` vs `1`, `Date` vs ISO string, `Buffer`\n* vs number array). The spread converts the frozen wire-command\n* class instance (`InsertOneWireCommand`, `AggregateWireCommand`, …)\n* into a plain object exposing its own enumerable properties\n* (`kind`, `collection`, plus the payload-specific fields like\n* `document`/`filter`/`update`/`pipeline`/…), which is what\n* `canonicalStringify` accepts; class instances are rejected\n* outright to prevent silent collisions.\n*\n* Unlike SQL, there is no separate \"rendered statement\" component because\n* a Mongo `MongoExecutionPlan.command` is the wire command itself —\n* canonicalizing it captures both structure and parameters in one pass.\n*\n* The components are wrapped in an object and canonicalized as a single\n* unit (rather than concatenated with a delimiter) so component\n* boundaries are unambiguous and cannot collide with a different split\n* of the same characters.\n*\n* The canonical string is then piped through `hashContent` to produce a\n* bounded, opaque digest. See `@internal/utils/hash-content` for the\n* rationale.\n*\n* @throws {RuntimeErrorEnvelope} {@link RUNTIME_CONTENT_HASH_REQUIRES_RESOLVED_COMMAND}\n* when `exec.command` is still a pre-resolve draft (plain object), e.g. when\n* `contentHash` is called from `beforeExecute`.\n*\n* @internal\n*/\nfunction computeMongoContentHash(exec) {\n\tassertContentHashOnResolvedCommand(exec.command);\n\treturn hashContent(canonicalStringify({\n\t\tstorageHash: exec.meta.storageHash,\n\t\tcommand: { ...exec.command }\n\t}));\n}\n//#endregion\n//#region src/param-ref-mutator.ts\nfunction* flattenDraftSlot(value) {\n\tif (value instanceof MongoParamRef) {\n\t\tyield value;\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (const item of value) yield* flattenDraftSlot(item);\n\t\treturn;\n\t}\n\tif (isPlainRecord(value)) for (const v of Object.values(value)) yield* flattenDraftSlot(v);\n}\n/**\n* Flat walk over a `MongoLoweredDraft` yielding every `MongoParamRef` leaf\n* regardless of nesting — object values, array elements, filter predicate\n* values, update operator values, and pipeline stage values. Raw command\n* variants carry no `MongoParamRef` nodes so they yield zero entries.\n*\n* **Walk parity:** slot traversal matches `resolveDraftSlot` / `resolveParams`\n* — refs appear only in plain-object and array containers; `Date` and other\n* non-plain objects are leaves (not descended into), so middleware sees every\n* ref the resolve pass will encode.\n*/\nfunction* flattenMongoParamRefs(draft) {\n\tswitch (draft.kind) {\n\t\tcase \"insertOne\":\n\t\tcase \"rawInsertOne\":\n\t\t\tyield* flattenDraftSlot(draft.document);\n\t\t\tbreak;\n\t\tcase \"insertMany\":\n\t\tcase \"rawInsertMany\":\n\t\t\tfor (const doc of draft.documents) yield* flattenDraftSlot(doc);\n\t\t\tbreak;\n\t\tcase \"updateOne\":\n\t\tcase \"updateMany\":\n\t\tcase \"rawUpdateOne\":\n\t\tcase \"rawUpdateMany\":\n\t\t\tyield* flattenDraftSlot(draft.filter);\n\t\t\tyield* flattenDraftSlot(draft.update);\n\t\t\tbreak;\n\t\tcase \"findOneAndUpdate\":\n\t\tcase \"rawFindOneAndUpdate\":\n\t\t\tyield* flattenDraftSlot(draft.filter);\n\t\t\tyield* flattenDraftSlot(draft.update);\n\t\t\tbreak;\n\t\tcase \"deleteOne\":\n\t\tcase \"deleteMany\":\n\t\tcase \"rawDeleteOne\":\n\t\tcase \"rawDeleteMany\":\n\t\t\tyield* flattenDraftSlot(draft.filter);\n\t\t\tbreak;\n\t\tcase \"findOneAndDelete\":\n\t\tcase \"rawFindOneAndDelete\":\n\t\t\tyield* flattenDraftSlot(draft.filter);\n\t\t\tbreak;\n\t\tcase \"aggregate\":\n\t\tcase \"rawAggregate\":\n\t\t\tfor (const stage of draft.pipeline) yield* flattenDraftSlot(stage);\n\t\t\tbreak;\n\t}\n}\nfunction substituteSlot(value, overrides) {\n\tif (value instanceof MongoParamRef) {\n\t\tif (overrides.has(value)) return new MongoParamRef(overrides.get(value), {\n\t\t\t...ifDefined(\"name\", value.name),\n\t\t\t...ifDefined(\"codecId\", value.codecId),\n\t\t\t...ifDefined(\"collection\", value.collection)\n\t\t});\n\t\treturn value;\n\t}\n\tif (Array.isArray(value)) return value.map((item) => substituteSlot(item, overrides));\n\tif (isPlainRecord(value)) {\n\t\tconst out = {};\n\t\tfor (const [k, v] of Object.entries(value)) out[k] = substituteSlot(v, overrides);\n\t\treturn out;\n\t}\n\treturn value;\n}\nfunction substituteDoc(doc, overrides) {\n\treturn blindCast(substituteSlot(doc, overrides));\n}\nfunction isUpdatePipeline(update) {\n\treturn Array.isArray(update);\n}\nfunction substituteUpdate(update, overrides) {\n\tif (isUpdatePipeline(update)) return update.map((stage) => substituteDoc(stage, overrides));\n\treturn substituteDoc(update, overrides);\n}\nfunction buildMutatedDraft(draft, overrides) {\n\tswitch (draft.kind) {\n\t\tcase \"insertOne\": return {\n\t\t\tkind: \"insertOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tdocument: substituteDoc(draft.document, overrides)\n\t\t};\n\t\tcase \"rawInsertOne\": return {\n\t\t\tkind: \"rawInsertOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tdocument: substituteDoc(draft.document, overrides)\n\t\t};\n\t\tcase \"insertMany\": return {\n\t\t\tkind: \"insertMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tdocuments: draft.documents.map((d) => substituteDoc(d, overrides))\n\t\t};\n\t\tcase \"rawInsertMany\": return {\n\t\t\tkind: \"rawInsertMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tdocuments: draft.documents.map((d) => substituteDoc(d, overrides))\n\t\t};\n\t\tcase \"updateOne\": return {\n\t\t\tkind: \"updateOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides),\n\t\t\tupsert: draft.upsert\n\t\t};\n\t\tcase \"updateMany\": return {\n\t\t\tkind: \"updateMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides),\n\t\t\tupsert: draft.upsert\n\t\t};\n\t\tcase \"rawUpdateOne\": return {\n\t\t\tkind: \"rawUpdateOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides)\n\t\t};\n\t\tcase \"rawUpdateMany\": return {\n\t\t\tkind: \"rawUpdateMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides)\n\t\t};\n\t\tcase \"deleteOne\": return {\n\t\t\tkind: \"deleteOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides)\n\t\t};\n\t\tcase \"deleteMany\": return {\n\t\t\tkind: \"deleteMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides)\n\t\t};\n\t\tcase \"rawDeleteOne\": return {\n\t\t\tkind: \"rawDeleteOne\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides)\n\t\t};\n\t\tcase \"rawDeleteMany\": return {\n\t\t\tkind: \"rawDeleteMany\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides)\n\t\t};\n\t\tcase \"findOneAndUpdate\": return {\n\t\t\tkind: \"findOneAndUpdate\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides),\n\t\t\tupsert: draft.upsert,\n\t\t\tsort: draft.sort,\n\t\t\treturnDocument: draft.returnDocument\n\t\t};\n\t\tcase \"rawFindOneAndUpdate\": return {\n\t\t\tkind: \"rawFindOneAndUpdate\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tupdate: substituteUpdate(draft.update, overrides),\n\t\t\tupsert: draft.upsert,\n\t\t\tsort: draft.sort,\n\t\t\treturnDocument: draft.returnDocument\n\t\t};\n\t\tcase \"findOneAndDelete\": return {\n\t\t\tkind: \"findOneAndDelete\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tsort: draft.sort\n\t\t};\n\t\tcase \"rawFindOneAndDelete\": return {\n\t\t\tkind: \"rawFindOneAndDelete\",\n\t\t\tcollection: draft.collection,\n\t\t\tfilter: substituteDoc(draft.filter, overrides),\n\t\t\tsort: draft.sort\n\t\t};\n\t\tcase \"aggregate\": return {\n\t\t\tkind: \"aggregate\",\n\t\t\tcollection: draft.collection,\n\t\t\tpipeline: draft.pipeline.map((s) => substituteDoc(s, overrides))\n\t\t};\n\t\tcase \"rawAggregate\": return {\n\t\t\tkind: \"rawAggregate\",\n\t\t\tcollection: draft.collection,\n\t\t\tpipeline: draft.pipeline.map((s) => substituteDoc(s, overrides))\n\t\t};\n\t}\n}\n/**\n* Build a {@link MongoParamRefMutatorInternal} for the given lowered draft.\n*\n* The mutator captures the draft by reference and uses `flattenMongoParamRefs`\n* on demand to produce `entries()`. Replacements are stored in a lazily-\n* allocated `Map`; the fast path (no replacements) preserves bit-for-bit\n* reference identity to the original draft in `currentDraft()`.\n*/\nfunction createMongoParamRefMutator(draft) {\n\tconst originalDraft = draft;\n\tlet overrides;\n\tconst ensureOverrides = () => {\n\t\tif (!overrides) overrides = /* @__PURE__ */ new Map();\n\t\treturn overrides;\n\t};\n\tfunction* entries() {\n\t\tfor (const ref of flattenMongoParamRefs(originalDraft)) yield blindCast({\n\t\t\tref: blindCast(ref),\n\t\t\tvalue: overrides?.has(ref) ? overrides.get(ref) : ref.value,\n\t\t\tcodecId: ref.codecId\n\t\t});\n\t}\n\tfunction replaceValue(handle, newValue) {\n\t\tensureOverrides().set(blindCast(handle), newValue);\n\t}\n\tfunction replaceValues(updates) {\n\t\tconst map = ensureOverrides();\n\t\tfor (const { ref, newValue } of updates) map.set(blindCast(ref), newValue);\n\t}\n\treturn {\n\t\tentries,\n\t\treplaceValue: blindCast(replaceValue),\n\t\treplaceValues,\n\t\tcurrentDraft() {\n\t\t\tif (!overrides || overrides.size === 0) return originalDraft;\n\t\t\treturn buildMutatedDraft(originalDraft, overrides);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/mongo-runtime.ts\nfunction noop() {}\nfunction isUnknownRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction statisticsCountField(commandKind) {\n\tswitch (commandKind) {\n\t\tcase \"updateOne\":\n\t\tcase \"updateMany\": return \"modifiedCount\";\n\t\tcase \"deleteOne\":\n\t\tcase \"deleteMany\": return \"deletedCount\";\n\t\tdefault: return;\n\t}\n}\nfunction invalidStatisticsResult(commandKind, countField) {\n\treturn runtimeError(\"RUNTIME.MONGO_STATISTICS_RESULT_INVALID\", `Mongo command '${commandKind}' did not return exactly one numeric '${countField}' result`, {\n\t\tcommandKind,\n\t\tcountField\n\t});\n}\nvar MongoRuntimeImpl = class extends RuntimeCore {\n\t#adapter;\n\t#driver;\n\t#codecs;\n\tconstructor(options) {\n\t\tconst middleware = options.middleware ?? [];\n\t\tconst targetId = options.context.stack.target.targetId;\n\t\tfor (const mw of middleware) checkMiddlewareCompatibility(mw, \"mongo\", targetId);\n\t\tconst ctx = {\n\t\t\tcontract: options.context.contract,\n\t\t\tmode: options.mode ?? \"strict\",\n\t\t\tnow: () => Date.now(),\n\t\t\tlog: {\n\t\t\t\tinfo: noop,\n\t\t\t\twarn: noop,\n\t\t\t\terror: noop\n\t\t\t},\n\t\t\tcontentHash: (exec) => computeMongoContentHash(blindCast(exec)),\n\t\t\tscope: \"runtime\",\n\t\t\tplanExecutionId: \"\"\n\t\t};\n\t\tsuper({\n\t\t\tmiddleware,\n\t\t\tctx\n\t\t});\n\t\tconst adapterInstance = options.context.stack.adapter.create(options.context.stack);\n\t\tthis.#adapter = adapterInstance;\n\t\tthis.#driver = options.driver;\n\t\tthis.#codecs = options.context.codecs;\n\t}\n\t/* v8 ignore start -- one-phase lower satisfies RuntimeCore; operations use the split preparation pipeline */\n\tasync lower(plan, ctx) {\n\t\treturn {\n\t\t\tcommand: await this.#adapter.lower(plan, ctx),\n\t\t\tmeta: plan.meta,\n\t\t\t...ifDefined(\"resultShape\", plan.resultShape)\n\t\t};\n\t}\n\t/* v8 ignore stop */\n\trunDriver(exec) {\n\t\treturn this.#driver.execute(exec.command);\n\t}\n\trunExecute(exec) {\n\t\treturn this.#readDriverStatistics(exec);\n\t}\n\tcreateQueryContexts(options) {\n\t\tconst signal = options?.signal;\n\t\treturn {\n\t\t\tcodecCtx: signal === void 0 ? {} : { signal },\n\t\t\tmiddlewareCtx: {\n\t\t\t\t...this.ctx,\n\t\t\t\t...ifDefined(\"signal\", signal),\n\t\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t\t}\n\t\t};\n\t}\n\tprepareQueryExecution(plan, codecCtx, middlewareCtx) {\n\t\treturn this.prepareOperation(plan, codecCtx, middlewareCtx, runBeforeQueryChain);\n\t}\n\tprepareExecuteExecution(plan, codecCtx, middlewareCtx) {\n\t\treturn this.prepareOperation(plan, codecCtx, middlewareCtx, runBeforeExecuteChain);\n\t}\n\tasync prepareOperation(plan, codecCtx, middlewareCtx, runBefore) {\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\tconst compiled = await this.runBeforeCompile(plan);\n\t\tconst draft = this.#adapter.structuralLower(compiled);\n\t\tconst mutator = createMongoParamRefMutator(draft);\n\t\tawait runBefore({\n\t\t\tmeta: compiled.meta,\n\t\t\t...ifDefined(\"resultShape\", compiled.resultShape),\n\t\t\tcommand: blindCast(draft)\n\t\t}, this.middleware, middlewareCtx, mutator);\n\t\treturn {\n\t\t\tmeta: compiled.meta,\n\t\t\t...ifDefined(\"resultShape\", compiled.resultShape),\n\t\t\tcommand: await this.#adapter.resolveParams(mutator.currentDraft(), codecCtx)\n\t\t};\n\t}\n\tquery(plan, options) {\n\t\tconst self = this;\n\t\tconst { codecCtx, middlewareCtx } = this.createQueryContexts(options);\n\t\tconst generator = async function* () {\n\t\t\tconst exec = await self.prepareQueryExecution(plan, codecCtx, middlewareCtx);\n\t\t\tyield* reportQueryEnding(onQueryEndOutsideTransaction(self.afterTransactionStageFor(exec, middlewareCtx)), () => self.#decodedRows(exec, codecCtx, middlewareCtx));\n\t\t};\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\tasync *#decodedRows(exec, codecCtx, middlewareCtx) {\n\t\tconst stream = runQueryWithMiddleware(exec, this.middleware, middlewareCtx, () => this.runDriver(exec));\n\t\tfor await (const rawRow of stream) {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\tif (exec.resultShape === void 0) yield blindCast(rawRow);\n\t\t\telse yield blindCast(await decodeMongoRow(rawRow, exec.resultShape, this.#codecs, exec.command.collection, codecCtx));\n\t\t}\n\t}\n\tasync execute(plan, options) {\n\t\tconst { codecCtx, middlewareCtx } = this.createQueryContexts(options);\n\t\tconst exec = await this.prepareExecuteExecution(plan, codecCtx, middlewareCtx);\n\t\treturn reportExecuteEnding(onQueryEndOutsideTransaction(this.afterTransactionStageFor(exec, middlewareCtx)), async () => {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\treturn runExecuteWithMiddleware(exec, this.middleware, middlewareCtx, () => this.runExecute(exec));\n\t\t});\n\t}\n\tasync #readDriverStatistics(exec) {\n\t\tconst countField = statisticsCountField(exec.command.kind);\n\t\tif (countField === void 0) throw runtimeError(\"RUNTIME.MONGO_STATISTICS_UNSUPPORTED\", `Mongo command '${exec.command.kind}' does not expose statement statistics`, { commandKind: exec.command.kind });\n\t\tlet affectedRows;\n\t\tfor await (const result of this.#driver.execute(exec.command)) {\n\t\t\tif (affectedRows !== void 0 || !isUnknownRecord(result)) throw invalidStatisticsResult(exec.command.kind, countField);\n\t\t\tconst count = result[countField];\n\t\t\tif (typeof count !== \"number\") throw invalidStatisticsResult(exec.command.kind, countField);\n\t\t\taffectedRows = count;\n\t\t}\n\t\tif (affectedRows === void 0) throw invalidStatisticsResult(exec.command.kind, countField);\n\t\treturn { affectedRows };\n\t}\n\tasync close() {\n\t\tawait this.#driver.close();\n\t}\n};\nfunction createMongoRuntime(options) {\n\treturn new MongoRuntimeImpl(options);\n}\n//#endregion\nexport { createMongoExecutionContext, createMongoExecutionStack, createMongoParamRefMutator, createMongoRuntime, flattenMongoParamRefs };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,0BAA0B,SAAS;CAC3C,OAAO,UAAU,qBAAqB;EACrC,QAAQ,QAAQ;EAChB,SAAS,QAAQ;EACjB,QAAQ,QAA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AAQ;EACb,MAAM,KAAKA,QAAQ,MAAM;CAC1B;AACD;AACA,SAAS,mBAAmB,SAAS;CACpC,OAAO,IAAI,iBAAiB,OAAO;AACpC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-family-mongo",
|
|
3
|
-
"version": "8.0.0-rc.14-dev.
|
|
3
|
+
"version": "8.0.0-rc.14-dev.38",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,30 +9,30 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-framework": "8.0.0-rc.14-dev.
|
|
13
|
-
"@prisma/orm-toolchain": "8.0.0-rc.14-dev.
|
|
12
|
+
"@prisma/orm-framework": "8.0.0-rc.14-dev.38",
|
|
13
|
+
"@prisma/orm-toolchain": "8.0.0-rc.14-dev.38",
|
|
14
14
|
"arktype": "^2.2.2",
|
|
15
15
|
"mongodb": "^7.4.0",
|
|
16
16
|
"pathe": "^2.0.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@internal/family-mongo": "8.0.0-rc.14-dev.
|
|
20
|
-
"@internal/mongo-codec": "8.0.0-rc.14-dev.
|
|
21
|
-
"@internal/mongo-contract": "8.0.0-rc.14-dev.
|
|
22
|
-
"@internal/mongo-contract-prisma6": "8.0.0-rc.14-dev.
|
|
23
|
-
"@internal/mongo-contract-psl": "8.0.0-rc.14-dev.
|
|
24
|
-
"@internal/mongo-contract-ts": "8.0.0-rc.14-dev.
|
|
25
|
-
"@internal/mongo-emitter": "8.0.0-rc.14-dev.
|
|
26
|
-
"@internal/mongo-lowering": "8.0.0-rc.14-dev.
|
|
27
|
-
"@internal/mongo-orm": "8.0.0-rc.14-dev.
|
|
28
|
-
"@internal/mongo-query-ast": "8.0.0-rc.14-dev.
|
|
29
|
-
"@internal/mongo-query-builder": "8.0.0-rc.14-dev.
|
|
30
|
-
"@internal/mongo-runtime": "8.0.0-rc.14-dev.
|
|
31
|
-
"@internal/mongo-schema-ir": "8.0.0-rc.14-dev.
|
|
32
|
-
"@internal/mongo-value": "8.0.0-rc.14-dev.
|
|
33
|
-
"@internal/mongo-wire": "8.0.0-rc.14-dev.
|
|
34
|
-
"@repo/tsconfig": "8.0.0-rc.14-dev.
|
|
35
|
-
"@repo/tsdown": "8.0.0-rc.14-dev.
|
|
19
|
+
"@internal/family-mongo": "8.0.0-rc.14-dev.38",
|
|
20
|
+
"@internal/mongo-codec": "8.0.0-rc.14-dev.38",
|
|
21
|
+
"@internal/mongo-contract": "8.0.0-rc.14-dev.38",
|
|
22
|
+
"@internal/mongo-contract-prisma6": "8.0.0-rc.14-dev.38",
|
|
23
|
+
"@internal/mongo-contract-psl": "8.0.0-rc.14-dev.38",
|
|
24
|
+
"@internal/mongo-contract-ts": "8.0.0-rc.14-dev.38",
|
|
25
|
+
"@internal/mongo-emitter": "8.0.0-rc.14-dev.38",
|
|
26
|
+
"@internal/mongo-lowering": "8.0.0-rc.14-dev.38",
|
|
27
|
+
"@internal/mongo-orm": "8.0.0-rc.14-dev.38",
|
|
28
|
+
"@internal/mongo-query-ast": "8.0.0-rc.14-dev.38",
|
|
29
|
+
"@internal/mongo-query-builder": "8.0.0-rc.14-dev.38",
|
|
30
|
+
"@internal/mongo-runtime": "8.0.0-rc.14-dev.38",
|
|
31
|
+
"@internal/mongo-schema-ir": "8.0.0-rc.14-dev.38",
|
|
32
|
+
"@internal/mongo-value": "8.0.0-rc.14-dev.38",
|
|
33
|
+
"@internal/mongo-wire": "8.0.0-rc.14-dev.38",
|
|
34
|
+
"@repo/tsconfig": "8.0.0-rc.14-dev.38",
|
|
35
|
+
"@repo/tsdown": "8.0.0-rc.14-dev.38",
|
|
36
36
|
"tsdown": "0.22.14",
|
|
37
37
|
"typescript": "5.9.3"
|
|
38
38
|
},
|