@prisma-next/mongo-runtime 0.5.0-dev.66 → 0.5.0-dev.67

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/index.d.mts CHANGED
@@ -6,7 +6,6 @@ import { AnyMongoWireCommand } from "@prisma-next/mongo-wire";
6
6
  import { MongoAdapter, MongoDriver } from "@prisma-next/mongo-lowering";
7
7
 
8
8
  //#region src/mongo-execution-plan.d.ts
9
-
10
9
  /**
11
10
  * Mongo-domain execution plan: a query lowered to the wire-command shape
12
11
  * that a Mongo driver can run.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/mongo-execution-plan.ts","../src/mongo-execution-stack.ts","../src/mongo-middleware.ts","../src/mongo-runtime.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;AAwBA;;;;;;;;;ACFA;AAIA;;;;;AAM2C,UDR1B,kBCQ0B,CAAA,MAAA,OAAA,CAAA,SDRgB,aCQhB,CDR8B,GCQ9B,CAAA,CAAA;EAAW,SAAA,OAAA,EDPlC,mBCOkC;EAA5C,SAAA,WAAA,CAAA,EDNe,gBCMf;;;;;;;;ADRV;AAAyE,UCFxD,wBAAA,CDEwD;EACrD,SAAA,MAAA,EAAA,GAAA,GCFK,kBDEL;;AADuC,UCE1C,4BDF0C,CAAA,kBAAA,MAAA,GAAA,OAAA,EAAA,wBCIjC,uBDJiC,CAAA,OAAA,ECIF,SDJE,CAAA,GCIW,uBDJX,CAAA,OAAA,ECMvD,SDNuD,CAAA,CAAA,SCQjD,uBDRiD,CAAA,OAAA,ECQhB,SDRgB,ECQL,eDRK,CAAA,ECSvD,wBDTuD,CAAA;UCW1C,wEACP,gCAAgC,YACtC;UAEa,2FAEU,gCAEvB,aACE,4BAA4B,oBACxB,kCAAkC,WAAW,mBACnD,0BAxBJ;AAIiB,UAsBA,6BAtB4B,CAAA,kBAAA,MAAA,GAAA,OAAA,CAAA,SAuBnC,wBAvBmC,CAA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AI3B;;;;;AAG3C;;;;;AAIA;;;;;;;;;;AASA;EAGiB,OAAA,CAAA,GAAA,CAAA,CAAA,IAAA,EEUP,cFVO,CEUQ,GFVuB,CAAA,EAAA,OAAA,CAAA,EEWlC,qBFXkC,CAAA,EEY3C,mBFZ2C,CEYvB,GFZuB,CAAA;EACF,KAAA,EAAA,EEYnC,OFZmC,CAAA,IAAA,CAAA;;AAAW,iBE6GzC,kBAAA,CF7GyC,OAAA,EE6Gb,mBF7Ga,CAAA,EE6GS,YF7GT"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/mongo-execution-plan.ts","../src/mongo-execution-stack.ts","../src/mongo-middleware.ts","../src/mongo-runtime.ts"],"mappings":";;;;;;;;;;;;;AAwBA;;;;;;;;;;;;;;;UAAiB,kBAAA,wBAA0C,aAAA,CAAc,GAAA;EAAA,SAC9D,OAAA,EAAS,mBAAA;EAAA,SACT,WAAA,GAAc,gBAAA;AAAA;;;;;;;AAFzB;UCFiB,wBAAA;EAAA,SACN,MAAA,QAAc,kBAAA;AAAA;AAAA,UAGR,4BAAA,6DAES,uBAAA,UAA+B,SAAA,IAAa,uBAAA,UAElE,SAAA,WAEM,uBAAA,UAAiC,SAAA,EAAW,eAAA,GAClD,wBAAA;AAAA,UAEa,2BAAA,6CACP,sBAAA,UAAgC,SAAA,GACtC,YAAA;AAAA,UAEa,6BAAA,8DAEU,sBAAA,UAEvB,SAAA,IACE,2BAAA,CAA4B,SAAA,WACxB,wBAAA,UAAkC,SAAA,EAAW,gBAAA,GACnD,wBAAA;AAAA,UAEa,6BAAA,6CACP,wBAAA,UAAkC,SAAA;AAAA,UAE3B,+BAAA,6CACP,0BAAA,UAAoC,SAAA,EAAW,6BAAA,CAA8B,SAAA,IACnF,wBAAA;EACF,MAAA,IAAU,6BAAA,CAA8B,SAAA;AAAA;;;;UAMzB,mBAAA;EAAA,SACN,MAAA,EAAQ,4BAAA,CAA6B,SAAA;EAAA,SACrC,OAAA,EAAS,6BAAA,C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A;EAAA,SACR,UAAA,YAAsB,eAAA;EAAA,SACtB,IAAA;AAAA;AAAA,UAGM,YAAA;EHZQ;;;;;;ACJzB;;;;;AAIA;;;;;;;;;;EEkCE,OAAA,MACE,IAAA,EAAM,cAAA,CAAe,GAAA,GACrB,OAAA,GAAU,qBAAA,GACT,mBAAA,CAAoB,GAAA;EACvB,KAAA,IAAS,OAAA;AAAA;AAAA,iBAiGK,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAsB,YAAA"}
package/dist/index.mjs CHANGED
@@ -4,7 +4,6 @@ import { newMongoCodecRegistry } from "@prisma-next/mongo-codec";
4
4
  import { ifDefined } from "@prisma-next/utils/defined";
5
5
  import { canonicalStringify } from "@prisma-next/utils/canonical-stringify";
6
6
  import { hashContent } from "@prisma-next/utils/hash-content";
7
-
8
7
  //#region src/mongo-execution-stack.ts
9
8
  function createMongoExecutionStack(options) {
10
9
  return createExecutionStack({
@@ -44,7 +43,6 @@ function createMongoExecutionContext(options) {
44
43
  function* iterateCodecs(registry) {
45
44
  yield* registry.values();
46
45
  }
47
-
48
46
  //#endregion
49
47
  //#region src/codecs/decoding.ts
50
48
  const WIRE_PREVIEW_LIMIT = 100;
@@ -140,7 +138,6 @@ async function decodeMongoRow(row, shape, registry, collection, ctx = {}) {
140
138
  await Promise.all(tasks);
141
139
  return out;
142
140
  }
143
-
144
141
  //#endregion
145
142
  //#region src/content-hash.ts
146
143
  /**
@@ -185,7 +182,6 @@ function computeMongoContentHash(exec) {
185
182
  command: { ...exec.command }
186
183
  }));
187
184
  }
188
-
189
185
  //#endregion
190
186
  //#region src/mongo-runtime.ts
191
187
  function noop() {}
@@ -212,7 +208,8 @@ var MongoRuntimeImpl = class extends RuntimeCore {
212
208
  middleware,
213
209
  ctx
214
210
  });
215
- this.#adapter = options.context.stack.adapter.create(options.context.stack);
211
+ const adapterInstance = options.context.stack.adapter.create(options.context.stack);
212
+ this.#adapter = adapterInstance;
216
213
  this.#driver = options.driver;
217
214
  this.#codecs = options.context.codecs;
218
215
  }
@@ -247,7 +244,7 @@ var MongoRuntimeImpl = class extends RuntimeCore {
247
244
  function createMongoRuntime(options) {
248
245
  return new MongoRuntimeImpl(options);
249
246
  }
250
-
251
247
  //#endregion
252
248
  export { createMongoExecutionContext, createMongoExecutionStack, createMongoRuntime };
249
+
253
250
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["contributors: ReadonlyArray<MongoStaticContributions & { readonly id: string }>","out: Record<string, unknown>","tasks: Array<Promise<void>>","nested: Record<string, unknown>","arr: unknown[]","#adapter","#driver","#codecs","ctx: MongoMiddlewareContext","codecCtx: CodecCallContext"],"sources":["../src/mongo-execution-stack.ts","../src/codecs/decoding.ts","../src/content-hash.ts","../src/mongo-runtime.ts"],"sourcesContent":["import {\n createExecutionStack,\n type ExecutionStack,\n type RuntimeAdapterDescriptor,\n type RuntimeAdapterInstance,\n type RuntimeDriverDescriptor,\n type RuntimeDriverInstance,\n type RuntimeExtensionDescriptor,\n type RuntimeExtensionInstance,\n type RuntimeTargetDescriptor,\n type RuntimeTargetInstance,\n} from '@prisma-next/framework-components/execution';\nimport { runtimeError } from '@prisma-next/framework-components/runtime';\nimport type { MongoCodec } from '@prisma-next/mongo-codec';\nimport { type MongoCodecRegistry, newMongoCodecRegistry } from '@prisma-next/mongo-codec';\nimport type { MongoAdapter } from '@prisma-next/mongo-lowering';\n\n/**\n * Mongo-specific static contributions a runtime descriptor declares.\n *\n * Mirrors `SqlStaticContributions` in shape: a `codecs()` getter that yields a `MongoCodecRegistry` populated with this contributor's codecs. The registry is then walked by `createMongoExecutionContext` and folded into the single per-execution registry the runtime reads from at decode time.\n */\nexport interface MongoStaticContributions {\n readonly codecs: () => MongoCodecRegistry;\n}\n\nexport interface MongoRuntimeTargetDescriptor<\n TTargetId extends string = 'mongo',\n TTargetInstance extends RuntimeTargetInstance<'mongo', TTargetId> = RuntimeTargetInstance<\n 'mongo',\n TTargetId\n >,\n> extends RuntimeTargetDescriptor<'mongo', TTargetId, TTargetInstance>,\n MongoStaticContributions {}\n\nexport interface MongoRuntimeAdapterInstance<TTargetId extends string = 'mongo'>\n extends RuntimeAdapterInstance<'mongo', TTargetId>,\n MongoAdapter {}\n\nexport interface MongoRuntimeAdapterDescriptor<\n TTargetId extends string = 'mongo',\n TAdapterInstance extends RuntimeAdapterInstance<\n 'mongo',\n TTargetId\n > = MongoRuntimeAdapterInstance<TTargetId>,\n> extends RuntimeAdapterDescriptor<'mongo', TTargetId, TAdapterInstance>,\n MongoStaticContributions {}\n\nexport interface MongoRuntimeExtensionInstance<TTargetId extends string = 'mongo'>\n extends RuntimeExtensionInstance<'mongo', TTargetId> {}\n\nexport interface MongoRuntimeExtensionDescriptor<TTargetId extends string = 'mongo'>\n extends RuntimeExtensionDescriptor<'mongo', TTargetId, MongoRuntimeExtensionInstance<TTargetId>>,\n MongoStaticContributions {\n create(): MongoRuntimeExtensionInstance<TTargetId>;\n}\n\n/**\n * The Mongo execution stack: target + adapter + optional driver + extension packs. Mirrors `SqlExecutionStack`. Constructed via `createMongoExecutionStack`.\n */\nexport interface MongoExecutionStack<TTargetId extends string = 'mongo'> {\n readonly target: MongoRuntimeTargetDescriptor<TTargetId>;\n readonly adapter: MongoRuntimeAdapterDescriptor<TTargetId>;\n readonly driver:\n | RuntimeDriverDescriptor<\n 'mongo',\n TTargetId,\n unknown,\n RuntimeDriverInstance<'mongo', TTargetId>\n >\n | undefined;\n readonly extensionPacks: readonly MongoRuntimeExtensionDescriptor<TTargetId>[];\n}\n\nexport function createMongoExecutionStack<TTargetId extends string = 'mongo'>(options: {\n readonly target: MongoRuntimeTargetDescriptor<TTargetId>;\n readonly adapter: MongoRuntimeAdapterDescriptor<TTargetId>;\n readonly driver?:\n | RuntimeDriverDescriptor<\n 'mongo',\n TTargetId,\n unknown,\n RuntimeDriverInstance<'mongo', TTargetId>\n >\n | undefined;\n readonly extensionPacks?: readonly MongoRuntimeExtensionDescriptor<TTargetId>[] | undefined;\n}): MongoExecutionStack<TTargetId> {\n const stack = createExecutionStack({\n target: options.target,\n adapter: options.adapter,\n driver: options.driver,\n extensionPacks: options.extensionPacks,\n });\n return stack as ExecutionStack<'mongo', TTargetId> as MongoExecutionStack<TTargetId>;\n}\n\n/**\n * Read-only view of the codec registry exposed on `MongoExecutionContext`.\n *\n * Hides `register()` and the iterator from public surface — users do not mutate the per-execution codec registry. Internal aggregation in `createMongoExecutionContext` keeps using the full `MongoCodecRegistry` (it needs `register()`).\n */\nexport interface MongoCodecLookup {\n get(id: string): MongoCodec<string> | undefined;\n has(id: string): boolean;\n}\n\n/**\n * Per-execution context aggregated from a `MongoExecutionStack`.\n *\n * Carries the user's contract, a read-only lookup over the codec registry composed from every stack contributor, and a back-reference to the stack itself so the runtime can reach the adapter without users threading it explicitly.\n *\n * Mirrors SQL's `ExecutionContext` in role; Mongo's flavour is leaner because there are no parameterised codecs, JSON-schema validators, or mutation-default generators in scope yet.\n */\nexport interface MongoExecutionContext<TTargetId extends string = 'mongo'> {\n readonly contract: unknown;\n readonly codecs: MongoCodecLookup;\n readonly stack: MongoExecutionStack<TTargetId>;\n}\n\nexport function createMongoExecutionContext<TTargetId extends string = 'mongo'>(options: {\n readonly contract: unknown;\n readonly stack: MongoExecutionStack<TTargetId>;\n}): MongoExecutionContext<TTargetId> {\n const registry = newMongoCodecRegistry();\n const owners = new Map<string, string>();\n\n const contributors: ReadonlyArray<MongoStaticContributions & { readonly id: string }> = [\n options.stack.target,\n options.stack.adapter,\n ...options.stack.extensionPacks,\n ];\n\n for (const contributor of contributors) {\n const contributed = contributor.codecs();\n for (const codec of iterateCodecs(contributed)) {\n const existingOwner = owners.get(codec.id);\n if (existingOwner !== undefined) {\n throw runtimeError(\n 'RUNTIME.DUPLICATE_CODEC',\n `Duplicate Mongo codec id '${codec.id}' contributed by '${contributor.id}' (already registered by '${existingOwner}').`,\n { codecId: codec.id, existingOwner, incomingOwner: contributor.id },\n );\n }\n registry.register(codec);\n owners.set(codec.id, contributor.id);\n }\n }\n\n return Object.freeze({\n contract: options.contract,\n codecs: registry,\n stack: options.stack,\n });\n}\n\nfunction* iterateCodecs(registry: MongoCodecRegistry): Iterable<MongoCodec<string>> {\n yield* registry.values();\n}\n","import type { CodecCallContext } from '@prisma-next/framework-components/codec';\nimport { runtimeError } from '@prisma-next/framework-components/runtime';\nimport type { MongoFieldShape, MongoResultShape } from '@prisma-next/mongo-query-ast/execution';\nimport type { MongoCodecLookup } from '../mongo-execution-stack';\n\nconst WIRE_PREVIEW_LIMIT = 100;\n\nfunction previewWireValue(wireValue: unknown): string {\n if (typeof wireValue === 'string') {\n return wireValue.length > WIRE_PREVIEW_LIMIT\n ? `${wireValue.substring(0, WIRE_PREVIEW_LIMIT)}...`\n : wireValue;\n }\n return String(wireValue).substring(0, WIRE_PREVIEW_LIMIT);\n}\n\nfunction wrapDecodeFailure(\n error: unknown,\n collection: string,\n path: string,\n codecId: string,\n wireValue: unknown,\n): never {\n const message = error instanceof Error ? error.message : String(error);\n const wrapped = runtimeError(\n 'RUNTIME.DECODE_FAILED',\n `Failed to decode field ${path} in collection '${collection}' with codec '${codecId}': ${message}`,\n {\n collection,\n path,\n codec: codecId,\n wirePreview: previewWireValue(wireValue),\n },\n );\n wrapped.cause = error;\n throw wrapped;\n}\n\nexport async function decodeMongoRow(\n row: unknown,\n shape: MongoResultShape,\n registry: MongoCodecLookup,\n collection: string,\n ctx: CodecCallContext = {},\n): Promise<unknown> {\n if (shape.kind === 'unknown') {\n return row;\n }\n if (typeof row !== 'object' || row === null) {\n return row;\n }\n const rowObj = row as Record<string, unknown>;\n const out: Record<string, unknown> = {};\n const tasks: Array<Promise<void>> = [];\n\n function scheduleLeaf(\n path: string,\n codecId: string,\n wire: unknown,\n assign: (v: unknown) => void,\n ): void {\n const codec = registry.get(codecId);\n if (!codec) {\n assign(wire);\n return;\n }\n tasks.push(\n (async () => {\n try {\n assign(await codec.decode(wire, ctx));\n } catch (error) {\n wrapDecodeFailure(error, collection, path, codecId, wire);\n }\n })(),\n );\n }\n\n function walkField(\n value: unknown,\n fieldShape: MongoFieldShape,\n path: string,\n assign: (v: unknown) => void,\n ): void {\n // Exhaustive over `MongoFieldShape['kind']` by construction:\n // adding a new variant must add a corresponding arm or the\n // `satisfies never` below would error at type-check time.\n switch (fieldShape.kind) {\n case 'unknown':\n assign(value);\n return;\n case 'leaf':\n if (value === null || value === undefined) {\n assign(value);\n return;\n }\n scheduleLeaf(path, fieldShape.codecId, value, assign);\n return;\n case 'document': {\n if (value === null || value === undefined) {\n assign(value);\n return;\n }\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n assign(value);\n return;\n }\n const vObj = value as Record<string, unknown>;\n // Pre-seed with a shallow copy so unshaped subdocument keys\n // round-trip verbatim. Subsequent walkField assignments overwrite\n // shaped keys with their decoded values. Mirrors the top-level\n // pass-through invariant — the decode path is structurally\n // additive at every nesting depth, not just the root.\n const nested: Record<string, unknown> = { ...vObj };\n assign(nested);\n for (const [fk, fShape] of Object.entries(fieldShape.fields)) {\n walkField(vObj[fk], fShape, `${path}.${fk}`, (v) => {\n nested[fk] = v;\n });\n }\n return;\n }\n case 'array': {\n if (value === null || value === undefined) {\n assign(value);\n return;\n }\n if (!Array.isArray(value)) {\n assign(value);\n return;\n }\n const arr: unknown[] = [];\n assign(arr);\n for (let i = 0; i < value.length; i++) {\n const el = value[i];\n walkField(el, fieldShape.element, `${path}.${i}`, (v) => {\n arr[i] = v;\n });\n }\n return;\n }\n }\n // The switch above is exhaustive over `MongoFieldShape['kind']`. The\n // `satisfies never` below is a compile-time guard that fails if a new\n // variant is added without a corresponding arm.\n /* v8 ignore start */\n fieldShape satisfies never;\n /* v8 ignore stop */\n }\n\n for (const [k, fShape] of Object.entries(shape.fields)) {\n walkField(rowObj[k], fShape, k, (v) => {\n out[k] = v;\n });\n }\n\n // Pass through any row fields the shape does not describe. The shape is a\n // partial, lane-vouched description of what the runtime knows how to decode;\n // fields outside that description (e.g. polymorphic variant fields the base\n // model's shape doesn't enumerate, sidecar fields a future schema migration\n // adds) round-trip verbatim. Drop semantics belongs to explicit projection\n // (`select` / `$project`), not to the structural decode path.\n for (const k of Object.keys(rowObj)) {\n if (!Object.hasOwn(shape.fields, k)) {\n out[k] = rowObj[k];\n }\n }\n\n await Promise.all(tasks);\n return out;\n}\n","import { canonicalStringify } from '@prisma-next/utils/canonical-stringify';\nimport { hashContent } from '@prisma-next/utils/hash-content';\nimport type { MongoExecutionPlan } from './mongo-execution-plan';\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 `@prisma-next/utils/hash-content` for the\n * rationale.\n *\n * @internal\n */\nexport function computeMongoContentHash(exec: MongoExecutionPlan): Promise<string> {\n // Spread `exec.command` to a plain object: `canonicalStringify`\n // rejects class instances by design (so `Map`/`Set`/class instances\n // cannot collapse to `{}` and silently collide). All wire-command\n // data lives on own enumerable properties, so this preserves the\n // same canonical form and therefore the same hash.\n return hashContent(\n canonicalStringify({\n storageHash: exec.meta.storageHash,\n command: { ...exec.command },\n }),\n );\n}\n","import type { CodecCallContext } from '@prisma-next/framework-components/codec';\nimport {\n AsyncIterableResult,\n checkAborted,\n checkMiddlewareCompatibility,\n RuntimeCore,\n type RuntimeExecuteOptions,\n runWithMiddleware,\n} from '@prisma-next/framework-components/runtime';\nimport type { MongoAdapter, MongoDriver } from '@prisma-next/mongo-lowering';\nimport type { MongoQueryPlan } from '@prisma-next/mongo-query-ast/execution';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { decodeMongoRow } from './codecs/decoding';\nimport { computeMongoContentHash } from './content-hash';\nimport type { MongoExecutionPlan } from './mongo-execution-plan';\nimport type { MongoCodecLookup, MongoExecutionContext } from './mongo-execution-stack';\nimport type { MongoMiddleware, MongoMiddlewareContext } from './mongo-middleware';\n\nfunction noop() {}\n\n/**\n * Mongo runtime options.\n *\n * The runtime takes a {@link MongoExecutionContext} (built via\n * `createMongoExecutionContext`) and a driver. Codec resolution flows from\n * the context — there is no `codecs` field on this options bag. The adapter\n * is reached via `context.stack.adapter` (instantiated lazily through the\n * stack's `create(stack)` factory). See ADR — Mongo result-shape as a\n * structural plan field, § Codec registry: stack aggregation, not user\n * threading.\n */\nexport interface MongoRuntimeOptions {\n readonly context: MongoExecutionContext;\n readonly driver: MongoDriver;\n readonly middleware?: readonly MongoMiddleware[];\n readonly mode?: 'strict' | 'permissive';\n}\n\nexport interface MongoRuntime {\n /**\n * Execute a `MongoQueryPlan` and return an async iterable of rows.\n *\n * The optional `options.signal` is threaded through\n * `lower → adapter.lower → resolveValue → codec.encode` so codec authors\n * who forward the signal to their underlying SDK get true cancellation\n * of in-flight network calls. The runtime additionally observes the\n * signal at two boundaries:\n *\n * - **Already-aborted at entry** — first `next()` throws\n * `RUNTIME.ABORTED { phase: 'stream' }` before any work is done.\n * (Inherited from `RuntimeCore.execute`.)\n * - **Mid-encode abort** — surfaces as\n * `RUNTIME.ABORTED { phase: 'encode' }` from inside `resolveValue`'s\n * per-level `Promise.all` race.\n *\n * Mongo's read path decodes rows via `resultShape` (per ADR 209). The\n * same `CodecCallContext` is forwarded into each `codec.decode(wire, ctx)`\n * call, so async decoders that respect the signal get cancellation; the\n * runtime itself does not currently emit a `phase: 'decode'` envelope.\n */\n execute<Row>(\n plan: MongoQueryPlan<Row>,\n options?: RuntimeExecuteOptions,\n ): AsyncIterableResult<Row>;\n close(): Promise<void>;\n}\n\nclass MongoRuntimeImpl\n extends RuntimeCore<MongoQueryPlan, MongoExecutionPlan, MongoMiddleware>\n implements MongoRuntime\n{\n readonly #adapter: MongoAdapter;\n readonly #driver: MongoDriver;\n readonly #codecs: MongoCodecLookup;\n\n constructor(options: MongoRuntimeOptions) {\n const middleware = options.middleware ? [...options.middleware] : [];\n const targetId = options.context.stack.target.targetId;\n for (const mw of middleware) {\n checkMiddlewareCompatibility(mw, 'mongo', targetId);\n }\n\n const ctx: MongoMiddlewareContext = {\n contract: options.context.contract,\n mode: options.mode ?? 'strict',\n now: () => Date.now(),\n log: { info: noop, warn: noop, error: noop },\n // ctx is only invoked by runWithMiddleware with execs this runtime lowered;\n // the framework parameter type is the cross-family base.\n contentHash: (exec) => computeMongoContentHash(exec as MongoExecutionPlan),\n };\n\n super({ middleware, ctx });\n\n const adapterDescriptor = options.context.stack.adapter;\n const adapterInstance = adapterDescriptor.create(options.context.stack);\n this.#adapter = adapterInstance;\n this.#driver = options.driver;\n this.#codecs = options.context.codecs;\n }\n\n protected override async lower(\n plan: MongoQueryPlan,\n ctx: CodecCallContext,\n ): Promise<MongoExecutionPlan> {\n return {\n command: await this.#adapter.lower(plan, ctx),\n meta: plan.meta,\n ...ifDefined('resultShape', plan.resultShape),\n };\n }\n\n protected override runDriver(exec: MongoExecutionPlan): AsyncIterable<Record<string, unknown>> {\n return this.#driver.execute<Record<string, unknown>>(exec.command);\n }\n\n override execute<Row>(\n plan: MongoQueryPlan & { readonly _row?: Row },\n options?: RuntimeExecuteOptions,\n ): AsyncIterableResult<Row> {\n const self = this;\n const signal = options?.signal;\n const codecCtx: CodecCallContext = signal === undefined ? {} : { signal };\n const generator = async function* (): AsyncGenerator<Row, void, unknown> {\n checkAborted(codecCtx, 'stream');\n const compiled = await self.runBeforeCompile(plan);\n const exec = await self.lower(compiled, codecCtx);\n const stream = runWithMiddleware<MongoExecutionPlan, Record<string, unknown>>(\n exec,\n self.middleware,\n self.ctx,\n () => self.runDriver(exec),\n );\n for await (const rawRow of stream) {\n if (exec.resultShape === undefined) {\n yield rawRow as Row;\n } else {\n // Source the collection from the lowered exec rather than the\n // pre-lowering plan: a `runBeforeCompile` middleware is allowed to\n // rewrite collection names during compilation, and the wire\n // command carried by `exec` is always authoritative for what just\n // ran.\n const decoded = await decodeMongoRow(\n rawRow,\n exec.resultShape,\n self.#codecs,\n exec.command.collection,\n codecCtx,\n );\n yield decoded as Row;\n }\n }\n };\n return new AsyncIterableResult(generator());\n }\n\n override async close(): Promise<void> {\n await this.#driver.close();\n }\n}\n\nexport function createMongoRuntime(options: MongoRuntimeOptions): MongoRuntime {\n return new MongoRuntimeImpl(options);\n}\n"],"mappings":";;;;;;;;AA0EA,SAAgB,0BAA8D,SAY3C;AAOjC,QANc,qBAAqB;EACjC,QAAQ,QAAQ;EAChB,SAAS,QAAQ;EACjB,QAAQ,QAAQ;EAChB,gBAAgB,QAAQ;EACzB,CAAC;;AA2BJ,SAAgB,4BAAgE,SAG3C;CACnC,MAAM,WAAW,uBAAuB;CACxC,MAAM,yBAAS,IAAI,KAAqB;CAExC,MAAMA,eAAkF;EACtF,QAAQ,MAAM;EACd,QAAQ,MAAM;EACd,GAAG,QAAQ,MAAM;EAClB;AAED,MAAK,MAAM,eAAe,cAAc;EACtC,MAAM,cAAc,YAAY,QAAQ;AACxC,OAAK,MAAM,SAAS,cAAc,YAAY,EAAE;GAC9C,MAAM,gBAAgB,OAAO,IAAI,MAAM,G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M,OAAO;EACb,MAAM,SAAS,SAAS;EACxB,MAAMG,WAA6B,WAAW,SAAY,EAAE,GAAG,EAAE,QAAQ;EACzE,MAAM,YAAY,mBAAuD;AACvE,gBAAa,UAAU,SAAS;GAChC,MAAM,WAAW,MAAM,KAAK,iBAAiB,KAAK;GAClD,MAAM,OAAO,MAAM,KAAK,MAAM,UAAU,SAAS;GACjD,MAAM,SAAS,kBACb,MACA,KAAK,YACL,KAAK,WACC,KAAK,UAAU,KAAK,CAC3B;AACD,cAAW,MAAM,UAAU,OACzB,KAAI,KAAK,gBAAgB,OACvB,OAAM;OAcN,OAPgB,MAAM,eACpB,QACA,KAAK,aACL,MAAKF,QACL,KAAK,QAAQ,YACb,SACD;;AAKP,SAAO,IAAI,oBAAoB,WAAW,CAAC;;CAG7C,MAAe,QAAuB;AACpC,QAAM,MAAKD,OAAQ,OAAO;;;AAI9B,SAAgB,mBAAmB,SAA4C;AAC7E,QAAO,IAAI,iBAAiB,QAAQ"}
1
+ {"version":3,"file":"index.mjs","names":["#adapter","#driver","#codecs"],"sources":["../src/mongo-execution-stack.ts","../src/codecs/decoding.ts","../src/content-hash.ts","../src/mongo-runtime.ts"],"sourcesContent":["import {\n createExecutionStack,\n type ExecutionStack,\n type RuntimeAdapterDescriptor,\n type RuntimeAdapterInstance,\n type RuntimeDriverDescriptor,\n type RuntimeDriverInstance,\n type RuntimeExtensionDescriptor,\n type RuntimeExtensionInstance,\n type RuntimeTargetDescriptor,\n type RuntimeTargetInstance,\n} from '@prisma-next/framework-components/execution';\nimport { runtimeError } from '@prisma-next/framework-components/runtime';\nimport type { MongoCodec } from '@prisma-next/mongo-codec';\nimport { type MongoCodecRegistry, newMongoCodecRegistry } from '@prisma-next/mongo-codec';\nimport type { MongoAdapter } from '@prisma-next/mongo-lowering';\n\n/**\n * Mongo-specific static contributions a runtime descriptor declares.\n *\n * Mirrors `SqlStaticContributions` in shape: a `codecs()` getter that yields a `MongoCodecRegistry` populated with this contributor's codecs. The registry is then walked by `createMongoExecutionContext` and folded into the single per-execution registry the runtime reads from at decode time.\n */\nexport interface MongoStaticContributions {\n readonly codecs: () => MongoCodecRegistry;\n}\n\nexport interface MongoRuntimeTargetDescriptor<\n TTargetId extends string = 'mongo',\n TTargetInstance extends RuntimeTargetInstance<'mongo', TTargetId> = RuntimeTargetInstance<\n 'mongo',\n TTargetId\n >,\n> extends RuntimeTargetDescriptor<'mongo', TTargetId, TTargetInstance>,\n MongoStaticContributions {}\n\nexport interface MongoRuntimeAdapterInstance<TTargetId extends string = 'mongo'>\n extends RuntimeAdapterInstance<'mongo', TTargetId>,\n MongoAdapter {}\n\nexport interface MongoRuntimeAdapterDescriptor<\n TTargetId extends string = 'mongo',\n TAdapterInstance extends RuntimeAdapterInstance<\n 'mongo',\n TTargetId\n > = MongoRuntimeAdapterInstance<TTargetId>,\n> extends RuntimeAdapterDescriptor<'mongo', TTargetId, TAdapterInstance>,\n MongoStaticContributions {}\n\nexport interface MongoRuntimeExtensionInstance<TTargetId extends string = 'mongo'>\n extends RuntimeExtensionInstance<'mongo', TTargetId> {}\n\nexport interface MongoRuntimeExtensionDescriptor<TTargetId extends string = 'mongo'>\n extends RuntimeExtensionDescriptor<'mongo', TTargetId, MongoRuntimeExtensionInstance<TTargetId>>,\n MongoStaticContributions {\n create(): MongoRuntimeExtensionInstance<TTargetId>;\n}\n\n/**\n * The Mongo execution stack: target + adapter + optional driver + extension packs. Mirrors `SqlExecutionStack`. Constructed via `createMongoExecutionStack`.\n */\nexport interface MongoExecutionStack<TTargetId extends string = 'mongo'> {\n readonly target: MongoRuntimeTargetDescriptor<TTargetId>;\n readonly adapter: MongoRuntimeAdapterDescriptor<TTargetId>;\n readonly driver:\n | RuntimeDriverDescriptor<\n 'mongo',\n TTargetId,\n unknown,\n RuntimeDriverInstance<'mongo', TTargetId>\n >\n | undefined;\n readonly extensionPacks: readonly MongoRuntimeExtensionDescriptor<TTargetId>[];\n}\n\nexport function createMongoExecutionStack<TTargetId extends string = 'mongo'>(options: {\n readonly target: MongoRuntimeTargetDescriptor<TTargetId>;\n readonly adapter: MongoRuntimeAdapterDescriptor<TTargetId>;\n readonly driver?:\n | RuntimeDriverDescriptor<\n 'mongo',\n TTargetId,\n unknown,\n RuntimeDriverInstance<'mongo', TTargetId>\n >\n | undefined;\n readonly extensionPacks?: readonly MongoRuntimeExtensionDescriptor<TTargetId>[] | undefined;\n}): MongoExecutionStack<TTargetId> {\n const stack = createExecutionStack({\n target: options.target,\n adapter: options.adapter,\n driver: options.driver,\n extensionPacks: options.extensionPacks,\n });\n return stack as ExecutionStack<'mongo', TTargetId> as MongoExecutionStack<TTargetId>;\n}\n\n/**\n * Read-only view of the codec registry exposed on `MongoExecutionContext`.\n *\n * Hides `register()` and the iterator from public surface — users do not mutate the per-execution codec registry. Internal aggregation in `createMongoExecutionContext` keeps using the full `MongoCodecRegistry` (it needs `register()`).\n */\nexport interface MongoCodecLookup {\n get(id: string): MongoCodec<string> | undefined;\n has(id: string): boolean;\n}\n\n/**\n * Per-execution context aggregated from a `MongoExecutionStack`.\n *\n * Carries the user's contract, a read-only lookup over the codec registry composed from every stack contributor, and a back-reference to the stack itself so the runtime can reach the adapter without users threading it explicitly.\n *\n * Mirrors SQL's `ExecutionContext` in role; Mongo's flavour is leaner because there are no parameterised codecs, JSON-schema validators, or mutation-default generators in scope yet.\n */\nexport interface MongoExecutionContext<TTargetId extends string = 'mongo'> {\n readonly contract: unknown;\n readonly codecs: MongoCodecLookup;\n readonly stack: MongoExecutionStack<TTargetId>;\n}\n\nexport function createMongoExecutionContext<TTargetId extends string = 'mongo'>(options: {\n readonly contract: unknown;\n readonly stack: MongoExecutionStack<TTargetId>;\n}): MongoExecutionContext<TTargetId> {\n const registry = newMongoCodecRegistry();\n const owners = new Map<string, string>();\n\n const contributors: ReadonlyArray<MongoStaticContributions & { readonly id: string }> = [\n options.stack.target,\n options.stack.adapter,\n ...options.stack.extensionPacks,\n ];\n\n for (const contributor of contributors) {\n const contributed = contributor.codecs();\n for (const codec of iterateCodecs(contributed)) {\n const existingOwner = owners.get(codec.id);\n if (existingOwner !== undefined) {\n throw runtimeError(\n 'RUNTIME.DUPLICATE_CODEC',\n `Duplicate Mongo codec id '${codec.id}' contributed by '${contributor.id}' (already registered by '${existingOwner}').`,\n { codecId: codec.id, existingOwner, incomingOwner: contributor.id },\n );\n }\n registry.register(codec);\n owners.set(codec.id, contributor.id);\n }\n }\n\n return Object.freeze({\n contract: options.contract,\n codecs: registry,\n stack: options.stack,\n });\n}\n\nfunction* iterateCodecs(registry: MongoCodecRegistry): Iterable<MongoCodec<string>> {\n yield* registry.values();\n}\n","import type { CodecCallContext } from '@prisma-next/framework-components/codec';\nimport { runtimeError } from '@prisma-next/framework-components/runtime';\nimport type { MongoFieldShape, MongoResultShape } from '@prisma-next/mongo-query-ast/execution';\nimport type { MongoCodecLookup } from '../mongo-execution-stack';\n\nconst WIRE_PREVIEW_LIMIT = 100;\n\nfunction previewWireValue(wireValue: unknown): string {\n if (typeof wireValue === 'string') {\n return wireValue.length > WIRE_PREVIEW_LIMIT\n ? `${wireValue.substring(0, WIRE_PREVIEW_LIMIT)}...`\n : wireValue;\n }\n return String(wireValue).substring(0, WIRE_PREVIEW_LIMIT);\n}\n\nfunction wrapDecodeFailure(\n error: unknown,\n collection: string,\n path: string,\n codecId: string,\n wireValue: unknown,\n): never {\n const message = error instanceof Error ? error.message : String(error);\n const wrapped = runtimeError(\n 'RUNTIME.DECODE_FAILED',\n `Failed to decode field ${path} in collection '${collection}' with codec '${codecId}': ${message}`,\n {\n collection,\n path,\n codec: codecId,\n wirePreview: previewWireValue(wireValue),\n },\n );\n wrapped.cause = error;\n throw wrapped;\n}\n\nexport async function decodeMongoRow(\n row: unknown,\n shape: MongoResultShape,\n registry: MongoCodecLookup,\n collection: string,\n ctx: CodecCallContext = {},\n): Promise<unknown> {\n if (shape.kind === 'unknown') {\n return row;\n }\n if (typeof row !== 'object' || row === null) {\n return row;\n }\n const rowObj = row as Record<string, unknown>;\n const out: Record<string, unknown> = {};\n const tasks: Array<Promise<void>> = [];\n\n function scheduleLeaf(\n path: string,\n codecId: string,\n wire: unknown,\n assign: (v: unknown) => void,\n ): void {\n const codec = registry.get(codecId);\n if (!codec) {\n assign(wire);\n return;\n }\n tasks.push(\n (async () => {\n try {\n assign(await codec.decode(wire, ctx));\n } catch (error) {\n wrapDecodeFailure(error, collection, path, codecId, wire);\n }\n })(),\n );\n }\n\n function walkField(\n value: unknown,\n fieldShape: MongoFieldShape,\n path: string,\n assign: (v: unknown) => void,\n ): void {\n // Exhaustive over `MongoFieldShape['kind']` by construction:\n // adding a new variant must add a corresponding arm or the\n // `satisfies never` below would error at type-check time.\n switch (fieldShape.kind) {\n case 'unknown':\n assign(value);\n return;\n case 'leaf':\n if (value === null || value === undefined) {\n assign(value);\n return;\n }\n scheduleLeaf(path, fieldShape.codecId, value, assign);\n return;\n case 'document': {\n if (value === null || value === undefined) {\n assign(value);\n return;\n }\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n assign(value);\n return;\n }\n const vObj = value as Record<string, unknown>;\n // Pre-seed with a shallow copy so unshaped subdocument keys\n // round-trip verbatim. Subsequent walkField assignments overwrite\n // shaped keys with their decoded values. Mirrors the top-level\n // pass-through invariant — the decode path is structurally\n // additive at every nesting depth, not just the root.\n const nested: Record<string, unknown> = { ...vObj };\n assign(nested);\n for (const [fk, fShape] of Object.entries(fieldShape.fields)) {\n walkField(vObj[fk], fShape, `${path}.${fk}`, (v) => {\n nested[fk] = v;\n });\n }\n return;\n }\n case 'array': {\n if (value === null || value === undefined) {\n assign(value);\n return;\n }\n if (!Array.isArray(value)) {\n assign(value);\n return;\n }\n const arr: unknown[] = [];\n assign(arr);\n for (let i = 0; i < value.length; i++) {\n const el = value[i];\n walkField(el, fieldShape.element, `${path}.${i}`, (v) => {\n arr[i] = v;\n });\n }\n return;\n }\n }\n // The switch above is exhaustive over `MongoFieldShape['kind']`. The\n // `satisfies never` below is a compile-time guard that fails if a new\n // variant is added without a corresponding arm.\n /* v8 ignore start */\n fieldShape satisfies never;\n /* v8 ignore stop */\n }\n\n for (const [k, fShape] of Object.entries(shape.fields)) {\n walkField(rowObj[k], fShape, k, (v) => {\n out[k] = v;\n });\n }\n\n // Pass through any row fields the shape does not describe. The shape is a\n // partial, lane-vouched description of what the runtime knows how to decode;\n // fields outside that description (e.g. polymorphic variant fields the base\n // model's shape doesn't enumerate, sidecar fields a future schema migration\n // adds) round-trip verbatim. Drop semantics belongs to explicit projection\n // (`select` / `$project`), not to the structural decode path.\n for (const k of Object.keys(rowObj)) {\n if (!Object.hasOwn(shape.fields, k)) {\n out[k] = rowObj[k];\n }\n }\n\n await Promise.all(tasks);\n return out;\n}\n","import { canonicalStringify } from '@prisma-next/utils/canonical-stringify';\nimport { hashContent } from '@prisma-next/utils/hash-content';\nimport type { MongoExecutionPlan } from './mongo-execution-plan';\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 `@prisma-next/utils/hash-content` for the\n * rationale.\n *\n * @internal\n */\nexport function computeMongoContentHash(exec: MongoExecutionPlan): Promise<string> {\n // Spread `exec.command` to a plain object: `canonicalStringify`\n // rejects class instances by design (so `Map`/`Set`/class instances\n // cannot collapse to `{}` and silently collide). All wire-command\n // data lives on own enumerable properties, so this preserves the\n // same canonical form and therefore the same hash.\n return hashContent(\n canonicalStringify({\n storageHash: exec.meta.storageHash,\n command: { ...exec.command },\n }),\n );\n}\n","import type { CodecCallContext } from '@prisma-next/framework-components/codec';\nimport {\n AsyncIterableResult,\n checkAborted,\n checkMiddlewareCompatibility,\n RuntimeCore,\n type RuntimeExecuteOptions,\n runWithMiddleware,\n} from '@prisma-next/framework-components/runtime';\nimport type { MongoAdapter, MongoDriver } from '@prisma-next/mongo-lowering';\nimport type { MongoQueryPlan } from '@prisma-next/mongo-query-ast/execution';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { decodeMongoRow } from './codecs/decoding';\nimport { computeMongoContentHash } from './content-hash';\nimport type { MongoExecutionPlan } from './mongo-execution-plan';\nimport type { MongoCodecLookup, MongoExecutionContext } from './mongo-execution-stack';\nimport type { MongoMiddleware, MongoMiddlewareContext } from './mongo-middleware';\n\nfunction noop() {}\n\n/**\n * Mongo runtime options.\n *\n * The runtime takes a {@link MongoExecutionContext} (built via\n * `createMongoExecutionContext`) and a driver. Codec resolution flows from\n * the context — there is no `codecs` field on this options bag. The adapter\n * is reached via `context.stack.adapter` (instantiated lazily through the\n * stack's `create(stack)` factory). See ADR — Mongo result-shape as a\n * structural plan field, § Codec registry: stack aggregation, not user\n * threading.\n */\nexport interface MongoRuntimeOptions {\n readonly context: MongoExecutionContext;\n readonly driver: MongoDriver;\n readonly middleware?: readonly MongoMiddleware[];\n readonly mode?: 'strict' | 'permissive';\n}\n\nexport interface MongoRuntime {\n /**\n * Execute a `MongoQueryPlan` and return an async iterable of rows.\n *\n * The optional `options.signal` is threaded through\n * `lower → adapter.lower → resolveValue → codec.encode` so codec authors\n * who forward the signal to their underlying SDK get true cancellation\n * of in-flight network calls. The runtime additionally observes the\n * signal at two boundaries:\n *\n * - **Already-aborted at entry** — first `next()` throws\n * `RUNTIME.ABORTED { phase: 'stream' }` before any work is done.\n * (Inherited from `RuntimeCore.execute`.)\n * - **Mid-encode abort** — surfaces as\n * `RUNTIME.ABORTED { phase: 'encode' }` from inside `resolveValue`'s\n * per-level `Promise.all` race.\n *\n * Mongo's read path decodes rows via `resultShape` (per ADR 209). The\n * same `CodecCallContext` is forwarded into each `codec.decode(wire, ctx)`\n * call, so async decoders that respect the signal get cancellation; the\n * runtime itself does not currently emit a `phase: 'decode'` envelope.\n */\n execute<Row>(\n plan: MongoQueryPlan<Row>,\n options?: RuntimeExecuteOptions,\n ): AsyncIterableResult<Row>;\n close(): Promise<void>;\n}\n\nclass MongoRuntimeImpl\n extends RuntimeCore<MongoQueryPlan, MongoExecutionPlan, MongoMiddleware>\n implements MongoRuntime\n{\n readonly #adapter: MongoAdapter;\n readonly #driver: MongoDriver;\n readonly #codecs: MongoCodecLookup;\n\n constructor(options: MongoRuntimeOptions) {\n const middleware = options.middleware ? [...options.middleware] : [];\n const targetId = options.context.stack.target.targetId;\n for (const mw of middleware) {\n checkMiddlewareCompatibility(mw, 'mongo', targetId);\n }\n\n const ctx: MongoMiddlewareContext = {\n contract: options.context.contract,\n mode: options.mode ?? 'strict',\n now: () => Date.now(),\n log: { info: noop, warn: noop, error: noop },\n // ctx is only invoked by runWithMiddleware with execs this runtime lowered;\n // the framework parameter type is the cross-family base.\n contentHash: (exec) => computeMongoContentHash(exec as MongoExecutionPlan),\n };\n\n super({ middleware, ctx });\n\n const adapterDescriptor = options.context.stack.adapter;\n const adapterInstance = adapterDescriptor.create(options.context.stack);\n this.#adapter = adapterInstance;\n this.#driver = options.driver;\n this.#codecs = options.context.codecs;\n }\n\n protected override async lower(\n plan: MongoQueryPlan,\n ctx: CodecCallContext,\n ): Promise<MongoExecutionPlan> {\n return {\n command: await this.#adapter.lower(plan, ctx),\n meta: plan.meta,\n ...ifDefined('resultShape', plan.resultShape),\n };\n }\n\n protected override runDriver(exec: MongoExecutionPlan): AsyncIterable<Record<string, unknown>> {\n return this.#driver.execute<Record<string, unknown>>(exec.command);\n }\n\n override execute<Row>(\n plan: MongoQueryPlan & { readonly _row?: Row },\n options?: RuntimeExecuteOptions,\n ): AsyncIterableResult<Row> {\n const self = this;\n const signal = options?.signal;\n const codecCtx: CodecCallContext = signal === undefined ? {} : { signal };\n const generator = async function* (): AsyncGenerator<Row, void, unknown> {\n checkAborted(codecCtx, 'stream');\n const compiled = await self.runBeforeCompile(plan);\n const exec = await self.lower(compiled, codecCtx);\n const stream = runWithMiddleware<MongoExecutionPlan, Record<string, unknown>>(\n exec,\n self.middleware,\n self.ctx,\n () => self.runDriver(exec),\n );\n for await (const rawRow of stream) {\n if (exec.resultShape === undefined) {\n yield rawRow as Row;\n } else {\n // Source the collection from the lowered exec rather than the\n // pre-lowering plan: a `runBeforeCompile` middleware is allowed to\n // rewrite collection names during compilation, and the wire\n // command carried by `exec` is always authoritative for what just\n // ran.\n const decoded = await decodeMongoRow(\n rawRow,\n exec.resultShape,\n self.#codecs,\n exec.command.collection,\n codecCtx,\n );\n yield decoded as Row;\n }\n }\n };\n return new AsyncIterableResult(generator());\n }\n\n override async close(): Promise<void> {\n await this.#driver.close();\n }\n}\n\nexport function createMongoRuntime(options: MongoRuntimeOptions): MongoRuntime {\n return new MongoRuntimeImpl(options);\n}\n"],"mappings":";;;;;;;AA0EA,SAAgB,0BAA8D,SAY3C;CAOjC,OANc,qBAAqB;EACjC,QAAQ,QAAQ;EAChB,SAAS,QAAQ;EACjB,QAAQ,QAAQ;EAChB,gBAAgB,QAAQ;EACzB,CACW;;AA0Bd,SAAgB,4BAAgE,SAG3C;CACnC,MAAM,WAAW,uBAAuB;CACxC,MAAM,yBAAS,IAAI,KAAqB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6B;EAC7B,OAAO;GACL,SAAS,MAAM,KAAKF,SAAS,MAAM,MAAM,IAAI;GAC7C,MAAM,KAAK;GACX,GAAG,UAAU,eAAe,KAAK,YAAY;GAC9C;;CAGH,UAA6B,MAAkE;EAC7F,OAAO,KAAKC,QAAQ,QAAiC,KAAK,QAAQ;;CAGpE,QACE,MACA,SAC0B;EAC1B,MAAM,OAAO;EACb,MAAM,SAAS,SAAS;EACxB,MAAM,WAA6B,WAAW,KAAA,IAAY,EAAE,GAAG,EAAE,QAAQ;EACzE,MAAM,YAAY,mBAAuD;GACvE,aAAa,UAAU,SAAS;GAChC,MAAM,WAAW,MAAM,KAAK,iBAAiB,KAAK;GAClD,MAAM,OAAO,MAAM,KAAK,MAAM,UAAU,SAAS;GACjD,MAAM,SAAS,kBACb,MACA,KAAK,YACL,KAAK,WACC,KAAK,UAAU,KAAK,CAC3B;GACD,WAAW,MAAM,UAAU,QACzB,IAAI,KAAK,gBAAgB,KAAA,GACvB,MAAM;QAcN,MAAM,MAPgB,eACpB,QACA,KAAK,aACL,KAAKC,SACL,KAAK,QAAQ,YACb,SACD;;EAKP,OAAO,IAAI,oBAAoB,WAAW,CAAC;;CAG7C,MAAe,QAAuB;EACpC,MAAM,KAAKD,QAAQ,OAAO;;;AAI9B,SAAgB,mBAAmB,SAA4C;CAC7E,OAAO,IAAI,iBAAiB,QAAQ"}
package/package.json CHANGED
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "name": "@prisma-next/mongo-runtime",
3
- "version": "0.5.0-dev.66",
3
+ "version": "0.5.0-dev.67",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "MongoDB runtime implementation for Prisma Next",
8
8
  "dependencies": {
9
- "@prisma-next/framework-components": "0.5.0-dev.66",
10
- "@prisma-next/mongo-lowering": "0.5.0-dev.66",
11
- "@prisma-next/mongo-codec": "0.5.0-dev.66",
12
- "@prisma-next/mongo-query-ast": "0.5.0-dev.66",
13
- "@prisma-next/mongo-wire": "0.5.0-dev.66",
14
- "@prisma-next/contract": "0.5.0-dev.66",
15
- "@prisma-next/utils": "0.5.0-dev.66"
9
+ "@prisma-next/contract": "0.5.0-dev.67",
10
+ "@prisma-next/framework-components": "0.5.0-dev.67",
11
+ "@prisma-next/mongo-lowering": "0.5.0-dev.67",
12
+ "@prisma-next/mongo-codec": "0.5.0-dev.67",
13
+ "@prisma-next/utils": "0.5.0-dev.67",
14
+ "@prisma-next/mongo-wire": "0.5.0-dev.67",
15
+ "@prisma-next/mongo-query-ast": "0.5.0-dev.67"
16
16
  },
17
17
  "devDependencies": {
18
18
  "mongodb": "^6.16.0",
19
19
  "mongodb-memory-server": "10.4.3",
20
- "tsdown": "0.18.4",
20
+ "tsdown": "0.22.0",
21
21
  "typescript": "5.9.3",
22
- "vitest": "4.0.17",
23
- "@prisma-next/adapter-mongo": "0.5.0-dev.66",
24
- "@prisma-next/mongo-contract-ts": "0.5.0-dev.66",
25
- "@prisma-next/family-mongo": "0.5.0-dev.66",
26
- "@prisma-next/mongo-query-builder": "0.5.0-dev.66",
27
- "@prisma-next/mongo-value": "0.5.0-dev.66",
28
- "@prisma-next/driver-mongo": "0.5.0-dev.66",
29
- "@prisma-next/mongo-contract": "0.5.0-dev.66",
30
- "@prisma-next/target-mongo": "0.5.0-dev.66",
22
+ "vitest": "4.1.5",
23
+ "@prisma-next/adapter-mongo": "0.5.0-dev.67",
24
+ "@prisma-next/family-mongo": "0.5.0-dev.67",
25
+ "@prisma-next/middleware-telemetry": "0.5.0-dev.67",
26
+ "@prisma-next/mongo-query-builder": "0.5.0-dev.67",
27
+ "@prisma-next/mongo-contract-ts": "0.5.0-dev.67",
28
+ "@prisma-next/driver-mongo": "0.5.0-dev.67",
29
+ "@prisma-next/mongo-value": "0.5.0-dev.67",
30
+ "@prisma-next/mongo-contract": "0.5.0-dev.67",
31
+ "@prisma-next/target-mongo": "0.5.0-dev.67",
31
32
  "@prisma-next/test-utils": "0.0.1",
32
33
  "@prisma-next/tsconfig": "0.0.0",
33
- "@prisma-next/middleware-telemetry": "0.5.0-dev.66",
34
34
  "@prisma-next/tsdown": "0.0.0"
35
35
  },
36
36
  "files": [