@prisma/orm-family-mongo 0.16.0-dev.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +27 -0
  3. package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs +176 -0
  4. package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs.map +1 -0
  5. package/dist/canonicalization-hooks-DF3Z6sjO.mjs +22 -0
  6. package/dist/canonicalization-hooks-DF3Z6sjO.mjs.map +1 -0
  7. package/dist/codec.d.mts +2 -0
  8. package/dist/codec.mjs +2 -0
  9. package/dist/config-types-CFDf9ivE.mjs +37 -0
  10. package/dist/config-types-CFDf9ivE.mjs.map +1 -0
  11. package/dist/config-types-CQOf5N7R.d.mts +12 -0
  12. package/dist/config-types-CQOf5N7R.d.mts.map +1 -0
  13. package/dist/contract-builder-BFq0gOMV.mjs +634 -0
  14. package/dist/contract-builder-BFq0gOMV.mjs.map +1 -0
  15. package/dist/contract-builder-DB8nguDE.d.mts +445 -0
  16. package/dist/contract-builder-DB8nguDE.d.mts.map +1 -0
  17. package/dist/contract-errors-BCN6RVI5-kMurtAbI.mjs +9 -0
  18. package/dist/contract-errors-BCN6RVI5-kMurtAbI.mjs.map +1 -0
  19. package/dist/contract-psl.d.mts +45 -0
  20. package/dist/contract-psl.d.mts.map +1 -0
  21. package/dist/contract-psl.mjs +2 -0
  22. package/dist/contract-psl__provider.d.mts +15 -0
  23. package/dist/contract-psl__provider.d.mts.map +1 -0
  24. package/dist/contract-psl__provider.mjs +82 -0
  25. package/dist/contract-psl__provider.mjs.map +1 -0
  26. package/dist/contract-ts.d.mts +3 -0
  27. package/dist/contract-ts.mjs +3 -0
  28. package/dist/contract-ts__config-types.d.mts +2 -0
  29. package/dist/contract-ts__config-types.mjs +2 -0
  30. package/dist/contract-ts__contract-builder.d.mts +2 -0
  31. package/dist/contract-ts__contract-builder.mjs +2 -0
  32. package/dist/contract.d.mts +3 -0
  33. package/dist/contract.mjs +3 -0
  34. package/dist/contract__canonicalization-hooks.d.mts +9 -0
  35. package/dist/contract__canonicalization-hooks.d.mts.map +1 -0
  36. package/dist/contract__canonicalization-hooks.mjs +2 -0
  37. package/dist/contract__entity-kinds.d.mts +17 -0
  38. package/dist/contract__entity-kinds.d.mts.map +1 -0
  39. package/dist/contract__entity-kinds.mjs +2 -0
  40. package/dist/control-C7-kthr1.d.mts +193 -0
  41. package/dist/control-C7-kthr1.d.mts.map +1 -0
  42. package/dist/control-CClR5JMr.mjs +127 -0
  43. package/dist/control-CClR5JMr.mjs.map +1 -0
  44. package/dist/control-CFr3tYsg.mjs +398 -0
  45. package/dist/control-CFr3tYsg.mjs.map +1 -0
  46. package/dist/control-Cj81sPbj.d.mts +101 -0
  47. package/dist/control-Cj81sPbj.d.mts.map +1 -0
  48. package/dist/control-adapter-Db5pT77b.d.mts +83 -0
  49. package/dist/control-adapter-Db5pT77b.d.mts.map +1 -0
  50. package/dist/dist-C7Ykq48Q.mjs +19 -0
  51. package/dist/dist-C7Ykq48Q.mjs.map +1 -0
  52. package/dist/dist-Czwqx_i3.mjs +58 -0
  53. package/dist/dist-Czwqx_i3.mjs.map +1 -0
  54. package/dist/dist-DHrEJnhK.mjs +236 -0
  55. package/dist/dist-DHrEJnhK.mjs.map +1 -0
  56. package/dist/dist-Dyp05u64.mjs +1546 -0
  57. package/dist/dist-Dyp05u64.mjs.map +1 -0
  58. package/dist/emitter.d.mts +22 -0
  59. package/dist/emitter.d.mts.map +1 -0
  60. package/dist/emitter.mjs +2 -0
  61. package/dist/entity-kinds-B4KNTF8z-DPIuUuuB.mjs +603 -0
  62. package/dist/entity-kinds-B4KNTF8z-DPIuUuuB.mjs.map +1 -0
  63. package/dist/execution-CKnUiOfm.d.mts +48 -0
  64. package/dist/execution-CKnUiOfm.d.mts.map +1 -0
  65. package/dist/execution-D5XyZ5XS.mjs +1269 -0
  66. package/dist/execution-D5XyZ5XS.mjs.map +1 -0
  67. package/dist/exports-Bx-hlnZ3.mjs +209 -0
  68. package/dist/exports-Bx-hlnZ3.mjs.map +1 -0
  69. package/dist/exports-CJMh0VTU.mjs +156 -0
  70. package/dist/exports-CJMh0VTU.mjs.map +1 -0
  71. package/dist/family.d.mts +10 -0
  72. package/dist/family.mjs +9 -0
  73. package/dist/family__control-adapter.d.mts +2 -0
  74. package/dist/family__control-adapter.mjs +1 -0
  75. package/dist/family__control.d.mts +2 -0
  76. package/dist/family__control.mjs +3 -0
  77. package/dist/family__ir.d.mts +3 -0
  78. package/dist/family__ir.mjs +4 -0
  79. package/dist/family__migration.d.mts +2 -0
  80. package/dist/family__migration.mjs +2 -0
  81. package/dist/family__pack.d.mts +2 -0
  82. package/dist/family__pack.mjs +16 -0
  83. package/dist/family__pack.mjs.map +1 -0
  84. package/dist/family__runtime.d.mts +3 -0
  85. package/dist/family__runtime.mjs +2 -0
  86. package/dist/family__schema-verify.d.mts +2 -0
  87. package/dist/family__schema-verify.mjs +2 -0
  88. package/dist/field-accessor-0oUt6RZC-B_Z30uAA.mjs +234 -0
  89. package/dist/field-accessor-0oUt6RZC-B_Z30uAA.mjs.map +1 -0
  90. package/dist/field-accessor-DHsAPiW3-BdYCspQC.d.mts +588 -0
  91. package/dist/field-accessor-DHsAPiW3-BdYCspQC.d.mts.map +1 -0
  92. package/dist/filter-expressions-Uo8ZdzwB-53qnqceS.mjs +181 -0
  93. package/dist/filter-expressions-Uo8ZdzwB-53qnqceS.mjs.map +1 -0
  94. package/dist/index-BR0ue13b.d.mts +136 -0
  95. package/dist/index-BR0ue13b.d.mts.map +1 -0
  96. package/dist/index-Cd2zLiU6.d.mts +128 -0
  97. package/dist/index-Cd2zLiU6.d.mts.map +1 -0
  98. package/dist/index-DAOkcTCK.d.mts +151 -0
  99. package/dist/index-DAOkcTCK.d.mts.map +1 -0
  100. package/dist/index-Dv2PNMiG.d.mts +53 -0
  101. package/dist/index-Dv2PNMiG.d.mts.map +1 -0
  102. package/dist/index-DxoO-ywI.d.mts +178 -0
  103. package/dist/index-DxoO-ywI.d.mts.map +1 -0
  104. package/dist/index-wKMm41HC.d.mts +30 -0
  105. package/dist/index-wKMm41HC.d.mts.map +1 -0
  106. package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs +1091 -0
  107. package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs.map +1 -0
  108. package/dist/ir-CQrenTYt.d.mts +147 -0
  109. package/dist/ir-CQrenTYt.d.mts.map +1 -0
  110. package/dist/ir-Ch2aPr7a.mjs +62 -0
  111. package/dist/ir-Ch2aPr7a.mjs.map +1 -0
  112. package/dist/lowering.d.mts +2 -0
  113. package/dist/lowering.mjs +1 -0
  114. package/dist/migration-CNDQv5yB.d.mts +50 -0
  115. package/dist/migration-CNDQv5yB.d.mts.map +1 -0
  116. package/dist/migration-dcM7u4HG.mjs +52 -0
  117. package/dist/migration-dcM7u4HG.mjs.map +1 -0
  118. package/dist/mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs +119 -0
  119. package/dist/mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs.map +1 -0
  120. package/dist/mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts +27 -0
  121. package/dist/mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts.map +1 -0
  122. package/dist/mongo-contract-view-rcWzby6f-wRBCUnBt.mjs +17 -0
  123. package/dist/mongo-contract-view-rcWzby6f-wRBCUnBt.mjs.map +1 -0
  124. package/dist/mongo-value-set-tNn9-pun-dJYx_rVD.d.mts +536 -0
  125. package/dist/mongo-value-set-tNn9-pun-dJYx_rVD.d.mts.map +1 -0
  126. package/dist/mongodb-types-B4HmhF1S.d.mts +2 -0
  127. package/dist/orm.d.mts +311 -0
  128. package/dist/orm.d.mts.map +1 -0
  129. package/dist/orm.mjs +664 -0
  130. package/dist/orm.mjs.map +1 -0
  131. package/dist/pack-D9aLY50F.d.mts +44 -0
  132. package/dist/pack-D9aLY50F.d.mts.map +1 -0
  133. package/dist/query-ast.d.mts +5 -0
  134. package/dist/query-ast.mjs +4 -0
  135. package/dist/query-ast__control.d.mts +4 -0
  136. package/dist/query-ast__control.mjs +3 -0
  137. package/dist/query-ast__execution.d.mts +3 -0
  138. package/dist/query-ast__execution.mjs +3 -0
  139. package/dist/query-builder.d.mts +836 -0
  140. package/dist/query-builder.d.mts.map +1 -0
  141. package/dist/query-builder.mjs +3 -0
  142. package/dist/query-builder__contract-free.d.mts +83 -0
  143. package/dist/query-builder__contract-free.d.mts.map +1 -0
  144. package/dist/query-builder__contract-free.mjs +107 -0
  145. package/dist/query-builder__contract-free.mjs.map +1 -0
  146. package/dist/query-plan-C0-Yu8hf-DdilEdW6.d.mts +822 -0
  147. package/dist/query-plan-C0-Yu8hf-DdilEdW6.d.mts.map +1 -0
  148. package/dist/runtime-DPkRW4iu.d.mts +1 -0
  149. package/dist/runtime.d.mts +286 -0
  150. package/dist/runtime.d.mts.map +1 -0
  151. package/dist/runtime.mjs +532 -0
  152. package/dist/runtime.mjs.map +1 -0
  153. package/dist/schema-ir.d.mts +2 -0
  154. package/dist/schema-ir.mjs +2 -0
  155. package/dist/schema-verify-DJGr28XW.d.mts +23 -0
  156. package/dist/schema-verify-DJGr28XW.d.mts.map +1 -0
  157. package/dist/value.d.mts +2 -0
  158. package/dist/value.mjs +2 -0
  159. package/dist/value__mongodb-types.d.mts +2 -0
  160. package/dist/value__mongodb-types.mjs +1 -0
  161. package/dist/verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs +447 -0
  162. package/dist/verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs.map +1 -0
  163. package/dist/wire.d.mts +3 -0
  164. package/dist/wire.mjs +190 -0
  165. package/dist/wire.mjs.map +1 -0
  166. package/package.json +89 -0
@@ -0,0 +1,588 @@
1
+ import { C as MongoContract, V as MongoModelsMap, a as ExtractMongoTypeMaps, o as InferModelRow, t as AnyMongoTypeMaps, w as MongoContractWithTypeMaps } from "./mongo-value-set-tNn9-pun-dJYx_rVD.mjs";
2
+ import "./index-Cd2zLiU6.mjs";
3
+ import { c as MongoValue } from "./index-wKMm41HC.mjs";
4
+ import { B as MongoFilterExpr, d as MongoAggAccumulator, m as MongoAggExpr, vt as MongoUpdatePipelineStage } from "./query-plan-C0-Yu8hf-DdilEdW6.mjs";
5
+ import "./execution-CKnUiOfm.mjs";
6
+ import { ContractValueObjectDefinitions } from "@prisma/orm-framework/contract/types";
7
+ //#region ../../../2-mongo-family/5-query-builders/query-builder/dist/field-accessor-DHsAPiW3.d.mts
8
+ //#region src/types.d.ts
9
+ interface DocField {
10
+ readonly codecId: string;
11
+ readonly nullable: boolean;
12
+ }
13
+ type NumericField = {
14
+ readonly codecId: 'mongo/double@1';
15
+ readonly nullable: false;
16
+ };
17
+ type NullableNumericField = {
18
+ readonly codecId: 'mongo/double@1';
19
+ readonly nullable: true;
20
+ };
21
+ type StringField = {
22
+ readonly codecId: 'mongo/string@1';
23
+ readonly nullable: false;
24
+ };
25
+ type ArrayField = {
26
+ readonly codecId: 'mongo/array@1';
27
+ readonly nullable: false;
28
+ };
29
+ type BooleanField = {
30
+ readonly codecId: 'mongo/bool@1';
31
+ readonly nullable: false;
32
+ };
33
+ type DateField = {
34
+ readonly codecId: 'mongo/date@1';
35
+ readonly nullable: false;
36
+ };
37
+ type NullableDocField = {
38
+ readonly codecId: string;
39
+ readonly nullable: true;
40
+ };
41
+ type LiteralValue<F extends DocField> = F extends StringField ? string : F extends NumericField ? number : F extends BooleanField ? boolean : F extends DateField ? Date : unknown;
42
+ type DocShape = Record<string, DocField>;
43
+ type ExtractCodecId<F> = F extends {
44
+ type: {
45
+ kind: 'scalar';
46
+ codecId: infer C;
47
+ };
48
+ } ? C : F extends {
49
+ codecId: infer C extends string;
50
+ } ? C : string;
51
+ type ModelToDocShape<TContract extends MongoContract, ModelName extends string & keyof MongoModelsMap<TContract>> = { [K in keyof MongoModelsMap<TContract>[ModelName]['fields'] & string]: {
52
+ readonly codecId: ExtractCodecId<MongoModelsMap<TContract>[ModelName]['fields'][K]>;
53
+ readonly nullable: MongoModelsMap<TContract>[ModelName]['fields'][K]['nullable'];
54
+ }; } & ModelOriginBranded<ModelName>;
55
+ /**
56
+ * Per-field resolver. Walks `Shape`'s string keys, routing
57
+ * `ModelArrayField` (the lookup marker) through `InferModelRow` and
58
+ * everything else through the codec-lookup branch.
59
+ *
60
+ * Internal helper — public callers should use `ResolveRow`, which adds
61
+ * the model-origin brand detection on top.
62
+ */
63
+ type ResolveFields<Shape extends DocShape, CodecTypes extends Record<string, {
64
+ readonly output: unknown;
65
+ }>, TContract extends MongoContract> = { -readonly [K in keyof Shape & string]: Shape[K] extends ModelArrayField<infer ModelName> ? IsConcreteContract<TContract> extends true ? TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps> ? ModelName extends string & keyof MongoModelsMap<TContract> ? Array<InferModelRow<TContract, ModelName>> : unknown[] : unknown[] : unknown[] : Shape[K]['codecId'] extends keyof CodecTypes ? Shape[K]['nullable'] extends true ? CodecTypes[Shape[K]['codecId']]['output'] | null : CodecTypes[Shape[K]['codecId']]['output'] : unknown; };
66
+ /**
67
+ * Resolve a `DocShape` to a concrete row object type.
68
+ *
69
+ * The optional `TContract` parameter exists so the resolver can:
70
+ *
71
+ * 1. Detect the `ModelOriginBrand` on `Shape` — the phantom symbol
72
+ * placed by `ModelToDocShape`. When present (and the contract has
73
+ * type maps), the row is resolved via `InferModelRow<TC, M>` from
74
+ * `@internal/mongo-contract`, which walks scalar / valueObject /
75
+ * union field kinds (handling nested value-objects and `many: true`).
76
+ * This makes entry-point reads (`q.from('users').build()`) and
77
+ * shape-extending stages (`match`, `addFields`) resolve value-object
78
+ * fields to their concrete nested types instead of `unknown`.
79
+ *
80
+ * 2. Detect the per-field `ModelArrayField<ModelName>` marker produced
81
+ * by `lookup()` and resolve it to `Array<InferModelRow<TC, M>>` so
82
+ * lookup rows carry the same fully-typed foreign rows.
83
+ *
84
+ * When the contract is not threaded through (or lacks the type-map
85
+ * phantom), both branches fall back to `unknown` / `unknown[]` —
86
+ * preserving the legacy resolver shape for call sites that do not need
87
+ * model-row resolution.
88
+ */
89
+ /**
90
+ * Flatten an intersection `A & B` into a single object literal so callers
91
+ * (and `expectTypeOf().toEqualTypeOf<…>()`) see one homogeneous record
92
+ * rather than the intersection form. Vitest's strict equality check
93
+ * treats `A & B` as distinct from the structurally-equivalent flat
94
+ * record, even when assignability is bidirectional, so the
95
+ * `ResolveRow` brand-positive branch normalises its result through this.
96
+ */
97
+ type Flatten<T> = T extends (infer U) ? { [K in keyof U]: U[K]; } : never;
98
+ /**
99
+ * Decide whether to route a brand-positive `ResolveRow` through
100
+ * `InferModelRow`. The default `MongoContract` (no concrete models)
101
+ * still satisfies `MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps>`
102
+ * because the phantom key is optional, but `InferModelRow<MongoContract, …>`
103
+ * collapses to an empty/unknown row. Gate on the presence of the
104
+ * type-maps phantom: a concrete contract attaches concrete `TestTypeMaps`-
105
+ * shaped maps, while the default `MongoContract` has no phantom and
106
+ * `ExtractMongoTypeMaps` resolves to `never`.
107
+ */
108
+ type IsConcreteContract<TContract> = [ExtractMongoTypeMaps<TContract>] extends [never] ? false : true;
109
+ type ResolveRow<Shape extends DocShape, CodecTypes extends Record<string, {
110
+ readonly output: unknown;
111
+ }>, TContract extends MongoContract = MongoContract> = Shape extends {
112
+ readonly [ModelOriginBrand]?: infer ModelName extends string;
113
+ } ? IsConcreteContract<TContract> extends true ? TContract extends MongoContractWithTypeMaps<MongoContract, AnyMongoTypeMaps> ? ModelName extends string & keyof MongoModelsMap<TContract> ? Flatten<InferModelRow<TContract, ModelName> & Omit<ResolveFields<Shape, CodecTypes, TContract>, keyof InferModelRow<TContract, ModelName>>> : ResolveFields<Shape, CodecTypes, TContract> : ResolveFields<Shape, CodecTypes, TContract> : ResolveFields<Shape, CodecTypes, TContract> : ResolveFields<Shape, CodecTypes, TContract>;
114
+ interface TypedAggExpr<F extends DocField> {
115
+ readonly _field: F;
116
+ readonly node: MongoAggExpr;
117
+ }
118
+ interface TypedAccumulatorExpr<F extends DocField> {
119
+ readonly _field: F;
120
+ readonly node: MongoAggAccumulator;
121
+ }
122
+ type ExtractDocShape<T extends Record<string, TypedAggExpr<DocField>>> = { [K in keyof T & string]: T[K]['_field']; };
123
+ type SortSpec<S extends DocShape> = Partial<Record<keyof S & string, 1 | -1>>;
124
+ type ProjectedShape<Shape extends DocShape, Spec extends Record<string, 1 | TypedAggExpr<DocField>>> = { [K in keyof Spec & string]: Spec[K] extends 1 ? K extends keyof Shape ? Shape[K] : DocField : Spec[K] extends TypedAggExpr<infer F> ? F : DocField; } & ('_id' extends keyof Shape ? '_id' extends keyof Spec ? Record<keyof never, never> : Pick<Shape, '_id'> : Record<keyof never, never>);
125
+ type GroupSpec = {
126
+ _id: TypedAggExpr<DocField> | null;
127
+ [key: string]: TypedAggExpr<DocField> | TypedAccumulatorExpr<DocField> | null;
128
+ };
129
+ type GroupedDocShape<Spec extends GroupSpec> = { [K in keyof Spec & string]: Spec[K] extends TypedAggExpr<infer F> ? F : Spec[K] extends TypedAccumulatorExpr<infer F> ? F : Spec[K] extends null ? {
130
+ readonly codecId: 'mongo/null@1';
131
+ readonly nullable: true;
132
+ } : DocField; };
133
+ /**
134
+ * Intentionally identity — full array element type extraction is deferred.
135
+ * Used by `UnwoundShape` so the unwind result shape can be refined later
136
+ * without changing the public API.
137
+ */
138
+ type UnwrapArrayDocField<F extends DocField> = F;
139
+ /**
140
+ * `$unwind` reshapes the array slot but leaves the rest of the document
141
+ * structurally intact. The mapped iteration is keyed on `keyof S & string`,
142
+ * which discards the symbol-keyed `ModelOriginBrand` carried by
143
+ * model-rooted shapes. Preserve the brand explicitly so post-unwind
144
+ * `ResolveRow` still routes through `InferModelRow` and value-object
145
+ * fields keep their concrete nested types.
146
+ */
147
+ type UnwoundShape<S extends DocShape, K extends keyof S & string> = { [P in keyof S & string]: P extends K ? UnwrapArrayDocField<S[P]> : S[P]; } & (S extends ModelOriginBranded<infer ModelName extends string> ? ModelOriginBranded<ModelName> : unknown);
148
+ //#endregion
149
+ //#region src/resolve-path.d.ts
150
+ /**
151
+ * Marker `DocField` variant representing a non-leaf (value-object) path in
152
+ * a [NestedDocShape]. Extends `DocField` with a `fields` property carrying
153
+ * the sub-shape so the pipeline builder can recurse into it.
154
+ *
155
+ * `codecId` is the reserved literal `'prisma/object@1'`; the accessor's
156
+ * runtime implementation does not serialize it — the codec id is a purely
157
+ * type-level sentinel used by `Expression<F>` to select the reduced
158
+ * operator surface for non-leaf paths.
159
+ *
160
+ * `nullable` tracks whether the value object itself may be absent/null on
161
+ * the parent document. The callable form currently does not propagate the
162
+ * parent's `nullable` flag onto leaves beneath it (path traversal under a
163
+ * nullable parent resolves to the leaf's own `nullable` — matching how
164
+ * MongoDB treats missing intermediate documents).
165
+ */
166
+ interface ObjectField<N extends NestedDocShape> extends DocField {
167
+ readonly codecId: 'prisma/object@1';
168
+ readonly nullable: boolean;
169
+ readonly fields: N;
170
+ }
171
+ /**
172
+ * Marker `DocField` variant representing "an array of foreign-model rows"
173
+ * — the result of a `$lookup` whose foreign side was selected via the
174
+ * typed `col` accessor. `ModelName` is the literal foreign model name
175
+ * (e.g. `'User'`), preserved in the type so `ResolveRow` can resolve the
176
+ * field to `ResolveRow<ModelToDocShape<TC, ModelName>, …>[]` rather than
177
+ * the opaque `unknown[]` produced by the legacy `mongo/array@1` sentinel.
178
+ *
179
+ * Like `ObjectField`, the codec id is a purely type-level sentinel —
180
+ * there is no runtime codec entry for `'prisma/modelArray@1'`. The
181
+ * surrounding pipeline emits the standard `MongoLookupStage` whose
182
+ * runtime shape is unchanged; the marker exists solely to thread the
183
+ * foreign element type through the result-row resolver.
184
+ */
185
+ interface ModelArrayField<ModelName extends string> extends DocField {
186
+ readonly codecId: 'prisma/modelArray@1';
187
+ readonly nullable: false;
188
+ readonly model: ModelName;
189
+ }
190
+ /**
191
+ * Phantom-symbol brand placed on `ModelToDocShape`'s output (and inherited
192
+ * through shape-extending stages like `addFields`, `match`, `lookup`) so
193
+ * `ResolveRow` can route value-object resolution through `InferModelRow`
194
+ * — which walks the contract's `valueObjects` registry and resolves
195
+ * nested types — instead of falling through the codec-lookup branch to
196
+ * `unknown`.
197
+ *
198
+ * The brand is keyed on a `unique symbol` rather than a string so it is
199
+ * invisible to every `keyof Shape & string` walk in the package
200
+ * (`SortSpec`, `ProjectedShape`, `GroupedDocShape`, the field accessor's
201
+ * `Object.keys` iteration, etc.). Field accessors do not surface a
202
+ * `__modelOrigin` autocomplete entry; sorts cannot key on it; projections
203
+ * cannot reference it.
204
+ *
205
+ * Shape-extending stages preserve the brand because intersection types
206
+ * (`Shape & NewFields`) carry through symbol-keyed properties. Shape-
207
+ * replacing stages (`replaceRoot`, `group`, `project`) construct fresh
208
+ * `DocShape`s from scratch, naturally dropping the brand — which is the
209
+ * intended behaviour, since those stages legitimately leave model
210
+ * territory.
211
+ */
212
+ declare const ModelOriginBrand: unique symbol;
213
+ type ModelOriginBrand = typeof ModelOriginBrand;
214
+ /**
215
+ * Brand carrier — a Shape whose row type should be resolved via
216
+ * `InferModelRow<TContract, ModelName>` rather than the per-field codec
217
+ * walk. Use as `ModelToDocShape<TC, ModelName> & ModelOriginBranded<ModelName>`.
218
+ */
219
+ type ModelOriginBranded<ModelName extends string> = {
220
+ readonly [ModelOriginBrand]?: ModelName;
221
+ };
222
+ /**
223
+ * Document shape that carries nested value-object sub-shapes.
224
+ *
225
+ * Structurally identical to a flat `DocShape` (`Record<string, DocField>`),
226
+ * but individual values may be `ObjectField<SubShape>` carrying a nested
227
+ * `NestedDocShape` sub-tree. The pipeline builder threads a
228
+ * `NestedDocShape` alongside the flat `DocShape` so the callable
229
+ * `f('a.b.c')` form can validate dot-paths at the type level.
230
+ *
231
+ * When a stage transforms the root shape in a way that invalidates nested
232
+ * paths (e.g. `$group`, `$project`, `$replaceRoot`), the thread is reset
233
+ * to the empty shape `Record<string, never>` — which makes `ValidPaths`
234
+ * resolve to `never` and so disables the callable form downstream.
235
+ */
236
+ type NestedDocShape = Record<string, DocField>;
237
+ type FieldToLeaf<F> = F extends {
238
+ readonly type: {
239
+ readonly kind: 'scalar';
240
+ readonly codecId: infer C extends string;
241
+ };
242
+ readonly nullable: infer N extends boolean;
243
+ } ? {
244
+ readonly codecId: C;
245
+ readonly nullable: N;
246
+ } : F extends {
247
+ readonly many: true;
248
+ readonly nullable: infer N extends boolean;
249
+ } ? {
250
+ readonly codecId: 'mongo/array@1';
251
+ readonly nullable: N;
252
+ } : DocField;
253
+ /**
254
+ * Translate a single contract field to its nested-shape form. Scalars
255
+ * become `DocField` leaves; value-object fields become
256
+ * `ObjectField<Sub>`; `many: true` stops at a leaf; anything else falls
257
+ * through to the opaque `DocField` base.
258
+ *
259
+ * Kept as a per-field helper (rather than a `Fields → NestedShape` helper
260
+ * that maps over keys internally) so the parent mapped type stays
261
+ * homomorphic over the model/value-object `fields` record. Homomorphic
262
+ * mapped types preserve the literal keys of their source object through
263
+ * TypeScript's intersection-collapsing machinery, which keeps
264
+ * `ModelNestedShape` hover output and `keyof`/indexed-access resolution
265
+ * concrete instead of collapsing to `{ [x: string]: … }`.
266
+ */
267
+ type TranslateField<TContract extends MongoContract, F> = F extends {
268
+ readonly many: true;
269
+ } ? FieldToLeaf<F> : F extends {
270
+ readonly type: {
271
+ readonly kind: 'valueObject';
272
+ readonly name: infer VOName extends string;
273
+ };
274
+ readonly nullable: infer Null extends boolean;
275
+ } ? ObjectField<VONestedShape<TContract, VOName>> & {
276
+ readonly nullable: Null;
277
+ } : F extends {
278
+ readonly type: {
279
+ readonly kind: 'scalar';
280
+ readonly codecId: string;
281
+ };
282
+ } ? FieldToLeaf<F> : DocField;
283
+ /**
284
+ * Resolve a named value object from the contract into its own
285
+ * `NestedDocShape`. The mapped iteration is inlined here (not delegated
286
+ * to a generic helper) so that the homomorphism over
287
+ * `VOs[VOName]['fields']` is preserved and the hover / indexed-access
288
+ * surface stays concrete at instantiation time.
289
+ */
290
+ type VONestedShape<TContract extends MongoContract, VOName extends string> = [ContractValueObjectDefinitions<TContract>] extends [infer VOs extends Record<string, {
291
+ readonly fields: Record<string, unknown>;
292
+ }>] ? VOName extends keyof VOs & string ? { readonly [K in keyof VOs[VOName]['fields'] & string]: TranslateField<TContract, VOs[VOName]['fields'][K]>; } : never : never;
293
+ /**
294
+ * Build the `NestedDocShape` for a model. Scalar leaves resolve to their
295
+ * concrete codec id; value-object fields recurse into the referenced
296
+ * `valueObjects[VOName].fields` table, producing a tree that
297
+ * `ResolvePath` / `ValidPaths` can walk.
298
+ *
299
+ * The mapped iteration is inlined (not hidden behind a helper type that
300
+ * takes `Fields` as a generic) so TypeScript recognises the mapped type
301
+ * as homomorphic over `MongoModelsMap<TContract>[ModelName]['fields']`. That
302
+ * preserves the literal field-name keys at instantiation — without this,
303
+ * the intersection of `Record<string, ContractField>` and the specific
304
+ * literal field record collapses `keyof` to `string` and the result hover
305
+ * degrades to `{ readonly [x: string]: any }`.
306
+ */
307
+ type ModelNestedShape<TContract extends MongoContract, ModelName extends string & keyof MongoModelsMap<TContract>> = { readonly [K in keyof MongoModelsMap<TContract>[ModelName]['fields'] & string]: TranslateField<TContract, MongoModelsMap<TContract>[ModelName]['fields'][K]>; };
308
+ /**
309
+ * Resolve a dot-path against a `NestedDocShape`. Returns:
310
+ * - the leaf `DocField` when `Path` terminates on a scalar/array leaf,
311
+ * - the `ObjectField<Sub>` when `Path` terminates on a value object (so
312
+ * the caller can operate on the whole sub-document),
313
+ * - `never` when the path is invalid (unknown segment, or a scalar
314
+ * segment followed by further traversal).
315
+ *
316
+ * Paired with the constrained callable `<P extends ValidPaths<N>>(path: P)
317
+ * => Expression<ResolvePath<N, P>>` so the IDE offers completions and
318
+ * rejects bad paths with a clear error instead of silently resolving to
319
+ * `never`.
320
+ */
321
+ type ResolvePath<N extends NestedDocShape, Path extends string> = Path extends `${infer Head}.${infer Rest}` ? Head extends keyof N & string ? N[Head] extends ObjectField<infer Sub> ? ResolvePath<Sub, Rest> : never : never : Path extends keyof N & string ? N[Path] : never;
322
+ /**
323
+ * Union of every valid dot-path within a `NestedDocShape`. Includes
324
+ * top-level keys (scalar leaves *and* value-object roots) and every
325
+ * recursive descent through `ObjectField` sub-shapes.
326
+ *
327
+ * Non-leaf paths are intentionally included — `f('address')` yields an
328
+ * `Expression<ObjectField<…>>` whose reduced operator surface (`set`,
329
+ * `unset`, `exists`, `eq(null)`, `ne(null)`) lets callers operate on the
330
+ * whole value object. Leaf paths like `f('address.city')` get the full
331
+ * leaf operator surface.
332
+ *
333
+ * The `string extends keyof N` guard short-circuits to `never` for
334
+ * open-ended index-signature shapes (e.g. the default
335
+ * `Record<string, never>` used to represent "no nested information" —
336
+ * notably downstream of replacement stages in the pipeline builder). An
337
+ * open-ended `keyof` cannot resolve a specific literal path, so the
338
+ * callable form must be disabled at the type level.
339
+ */
340
+ type ValidPaths<N extends NestedDocShape> = string extends keyof N ? never : { [K in keyof N & string]: N[K] extends ObjectField<infer Sub> ? K | `${K}.${ValidPaths<Sub>}` : K; }[keyof N & string];
341
+ /**
342
+ * IDE-oriented alias for `ValidPaths`. Kept as a separate export so future
343
+ * refinements (e.g. ArkType-style lazy expansion for very deep shapes) can
344
+ * diverge from the strict `ValidPaths` constraint without breaking
345
+ * downstream consumers. For now the two are intentionally equivalent.
346
+ */
347
+ type PathCompletions<N extends NestedDocShape> = ValidPaths<N>;
348
+ //#endregion
349
+ //#region src/update-ops.d.ts
350
+ /**
351
+ * Per-field update operations produced by `Expression`'s update methods
352
+ * (`set`, `inc`, `push`, …). A write terminal folds an array of these into a
353
+ * `MongoUpdateSpec` record (`{ $set: { … }, $inc: { … }, … }`) before
354
+ * constructing the underlying `UpdateManyCommand` / `UpdateOneCommand` AST node.
355
+ *
356
+ * One `TypedUpdateOp` value corresponds to one Mongo update operator applied
357
+ * to one field path. The `op` string is the wire-level operator name (`$set`,
358
+ * `$inc`, …); the `path` is the dot-path to the field (or its top-level name).
359
+ */
360
+ type TypedUpdateOp = {
361
+ readonly op: '$set';
362
+ readonly path: string;
363
+ readonly value: MongoValue;
364
+ } | {
365
+ readonly op: '$unset';
366
+ readonly path: string;
367
+ } | {
368
+ readonly op: '$rename';
369
+ readonly path: string;
370
+ readonly newName: string;
371
+ } | {
372
+ readonly op: '$inc';
373
+ readonly path: string;
374
+ readonly amount: number;
375
+ } | {
376
+ readonly op: '$mul';
377
+ readonly path: string;
378
+ readonly factor: number;
379
+ } | {
380
+ readonly op: '$min';
381
+ readonly path: string;
382
+ readonly value: MongoValue;
383
+ } | {
384
+ readonly op: '$max';
385
+ readonly path: string;
386
+ readonly value: MongoValue;
387
+ } | {
388
+ readonly op: '$push';
389
+ readonly path: string;
390
+ readonly value: MongoValue;
391
+ } | {
392
+ readonly op: '$addToSet';
393
+ readonly path: string;
394
+ readonly value: MongoValue;
395
+ } | {
396
+ readonly op: '$pop';
397
+ readonly path: string;
398
+ readonly direction: 1 | -1;
399
+ } | {
400
+ readonly op: '$pull';
401
+ readonly path: string;
402
+ readonly value: MongoValue;
403
+ } | {
404
+ readonly op: '$pullAll';
405
+ readonly path: string;
406
+ readonly values: ReadonlyArray<MongoValue>;
407
+ } | {
408
+ readonly op: '$currentDate';
409
+ readonly path: string;
410
+ } | {
411
+ readonly op: '$setOnInsert';
412
+ readonly path: string;
413
+ readonly value: MongoValue;
414
+ };
415
+ /**
416
+ * The return type for updater callbacks. Typed as a union of homogeneous
417
+ * arrays so mixed-shape updaters (operator + pipeline stage in the same
418
+ * array) are a compile error. The runtime guard in `resolveUpdaterResult`
419
+ * remains as defence-in-depth.
420
+ */
421
+ type UpdaterResult = ReadonlyArray<TypedUpdateOp> | ReadonlyArray<MongoUpdatePipelineStage>;
422
+ //#endregion
423
+ //#region src/field-accessor.d.ts
424
+ /**
425
+ * Operator surface for leaf (scalar) paths — today's full set: filter,
426
+ * update, and aggregation operators. Returned by `Expression<F>` for any
427
+ * `F extends DocField` that is not an `ObjectField<…>` sub-tree.
428
+ *
429
+ * Operator surfaces are intentionally not trait-gated by codec in this
430
+ * revision — tracked on Linear as TML-2259 (scope extended to cover the
431
+ * query-builder's `Expression<F>`). Calling, e.g. `.inc(1)` on a
432
+ * string-typed expression compiles; the runtime relies on Mongo to
433
+ * surface the error. Trait-gating can be tightened in a follow-up
434
+ * without changing the accessor's public shape.
435
+ */
436
+ interface LeafExpression<F extends DocField> extends TypedAggExpr<F> {
437
+ readonly _path: string;
438
+ eq(value: MongoValue): MongoFilterExpr;
439
+ ne(value: MongoValue): MongoFilterExpr;
440
+ gt(value: MongoValue): MongoFilterExpr;
441
+ gte(value: MongoValue): MongoFilterExpr;
442
+ lt(value: MongoValue): MongoFilterExpr;
443
+ lte(value: MongoValue): MongoFilterExpr;
444
+ in(values: ReadonlyArray<MongoValue>): MongoFilterExpr;
445
+ nin(values: ReadonlyArray<MongoValue>): MongoFilterExpr;
446
+ exists(flag?: boolean): MongoFilterExpr;
447
+ /**
448
+ * `$type` filter: `{ field: { $type: bsonType } }`. Rides
449
+ * `MongoFieldFilter`'s generic `op` string — no dedicated AST node. The
450
+ * BSON type is expressed as Mongo's alias string (e.g. `'string'`) or
451
+ * numeric type code; an array selects any of several types.
452
+ */
453
+ type(bsonType: MongoValue): MongoFilterExpr;
454
+ set(value: MongoValue): TypedUpdateOp;
455
+ unset(): TypedUpdateOp;
456
+ rename(newName: string): TypedUpdateOp;
457
+ inc(amount: number): TypedUpdateOp;
458
+ mul(factor: number): TypedUpdateOp;
459
+ min(value: MongoValue): TypedUpdateOp;
460
+ max(value: MongoValue): TypedUpdateOp;
461
+ push(value: MongoValue): TypedUpdateOp;
462
+ addToSet(value: MongoValue): TypedUpdateOp;
463
+ pop(direction?: 1 | -1): TypedUpdateOp;
464
+ pull(value: MongoValue): TypedUpdateOp;
465
+ pullAll(values: ReadonlyArray<MongoValue>): TypedUpdateOp;
466
+ currentDate(): TypedUpdateOp;
467
+ setOnInsert(value: MongoValue): TypedUpdateOp;
468
+ }
469
+ /**
470
+ * Operator surface for non-leaf (value-object) paths — `f('address')`
471
+ * when `address` is a `ContractValueObject`. Intentionally minimal: the
472
+ * whole-value ops that make sense on a structured sub-document
473
+ * (`set`/`unset`/`exists`, null presence via `eq(null)`/`ne(null)`). Field-
474
+ * level ops belong on the constituent leaves (`f('address.city')`).
475
+ *
476
+ * The aggregation `node` is still present (`TypedAggExpr<ObjectField<N>>`)
477
+ * so the value object can be piped through `$addFields` /
478
+ * `$replaceRoot` / etc. as-is.
479
+ */
480
+ interface ObjectExpression<N extends NestedDocShape> extends TypedAggExpr<ObjectField<N>> {
481
+ readonly _path: string;
482
+ exists(flag?: boolean): MongoFilterExpr;
483
+ eq(value: null): MongoFilterExpr;
484
+ ne(value: null): MongoFilterExpr;
485
+ set(value: MongoValue): TypedUpdateOp;
486
+ unset(): TypedUpdateOp;
487
+ }
488
+ /**
489
+ * The unified field accessor expression returned by `FieldAccessor` (per
490
+ * [ADR 180](../../../../docs/architecture%20docs/adrs/ADR%20180%20-%20Dot-path%20field%20accessor.md)).
491
+ *
492
+ * Resolves to `ObjectExpression<Sub>` when `F` is an `ObjectField<Sub>`
493
+ * (non-leaf path), otherwise to `LeafExpression<F>` (the full operator
494
+ * surface). The conditional is driven off the `fields` marker that
495
+ * `ObjectField` adds to `DocField`, so existing code that uses plain
496
+ * `DocField` shapes continues to resolve to `LeafExpression`.
497
+ */
498
+ type Expression<F extends DocField> = F extends ObjectField<infer N> ? ObjectExpression<N> : LeafExpression<F>;
499
+ /**
500
+ * Emitters for MongoDB update-pipeline stages (`$addFields`/`$set`,
501
+ * `$project`/`$unset`, `$replaceRoot`/`$replaceWith`). These return
502
+ * `MongoUpdatePipelineStage` nodes and let an updater callback express
503
+ * the pipeline-form update as an alternative to the typed-operator form.
504
+ *
505
+ * The two forms are mutually exclusive per updater call: `resolveUpdaterResult`
506
+ * rejects arrays that mix `TypedUpdateOp` and `MongoUpdatePipelineStage`
507
+ * entries with a clear error — an updater callback must return either all
508
+ * typed ops or all pipeline stages. Pick the form that matches the update
509
+ * you want and commit to it for that call site.
510
+ *
511
+ * Accessible via `f.stage` on the `FieldAccessor`.
512
+ */
513
+ interface StageEmitters {
514
+ set(fields: Record<string, MongoAggExpr>): MongoUpdatePipelineStage;
515
+ unset(...paths: ReadonlyArray<string>): MongoUpdatePipelineStage;
516
+ replaceRoot(newRoot: MongoAggExpr): MongoUpdatePipelineStage;
517
+ replaceWith(newRoot: MongoAggExpr): MongoUpdatePipelineStage;
518
+ }
519
+ /**
520
+ * The unified `FieldAccessor` per ADR 180.
521
+ *
522
+ * - Property access (`f.status`) returns an `Expression<F>` whose codec
523
+ * comes from the current pipeline shape `S`.
524
+ * - Callable form (`f('address.city')`) returns an `Expression<ResolvePath<N, P>>`
525
+ * where `N` is the nested shape carrying value-object sub-shapes.
526
+ * Paths that don't exist in `N` are rejected with a compile-time error
527
+ * (via `P extends ValidPaths<N>`). Non-leaf paths like `f('address')`
528
+ * resolve to an `ObjectExpression` whose reduced surface covers the
529
+ * whole-value operations (`set`, `unset`, `exists`, `eq(null)`,
530
+ * `ne(null)`).
531
+ * - `f.rawPath('path')` is a deliberate escape hatch that skips path
532
+ * validation and returns a `LeafExpression<F>` for the given string.
533
+ * Intended for migration authoring where the target field is not yet
534
+ * part of the typed contract (e.g. a backfill writing a newly-added
535
+ * column before the contract hash rolls forward). The method name is
536
+ * deliberately `rawPath` rather than `raw` so it does not shadow a
537
+ * legitimate top-level `raw` field on a user model.
538
+ * - `f.stage` exposes pipeline-style update emitters (`$set`, `$unset`,
539
+ * `$replaceRoot`, `$replaceWith`).
540
+ *
541
+ * When `N` is `Record<string, never>` (the default — e.g. after a
542
+ * replacement stage like `$group` / `$project` / `$replaceRoot`),
543
+ * `ValidPaths<N>` is `never` and the callable form is effectively
544
+ * disabled at the type level. This keeps the builder sound downstream of
545
+ * stages that invalidate the original document's nested-path tree.
546
+ * `f.rawPath(...)` remains available in that state for callers that need
547
+ * an explicit unvalidated path.
548
+ */
549
+ type FieldAccessor<S extends DocShape, N extends NestedDocShape = Record<string, never>> = { readonly [K in keyof S & string]: Expression<S[K]>; } & (<P extends ValidPaths<N>>(path: P) => Expression<ResolvePath<N, P>>) & {
550
+ readonly stage: StageEmitters;
551
+ /**
552
+ * Escape hatch: build a `LeafExpression<F>` for an unvalidated string
553
+ * path. Use only when the path is intentionally outside the typed
554
+ * model surface — data-migration authoring is the canonical case
555
+ * (e.g. backfilling a field that is not yet in the contract). Default
556
+ * `F` is the opaque `DocField`; callers can narrow via the explicit
557
+ * generic: `f.rawPath<StringField>("status").set("active")`.
558
+ *
559
+ * The method is named `rawPath` (not `raw`) so a user model with a
560
+ * top-level `raw` field still resolves `f.raw` to the field-expression
561
+ * property, not to this escape hatch. Does not participate in
562
+ * `ValidPaths<N>` / `ResolvePath<N, P>` — the path is passed through
563
+ * verbatim and no IDE autocomplete is offered.
564
+ */
565
+ rawPath<F extends DocField = DocField>(path: string): LeafExpression<F>;
566
+ };
567
+ /**
568
+ * Wrap a boolean aggregation expression as an `$expr` filter
569
+ * (`MongoExprFilter`). Lets a `$match` express an aggregation-expression
570
+ * predicate — e.g. comparing two field references via `fn.eq(a, b)` — in
571
+ * the typed AST rather than via a raw escape hatch. Pairs with `.type()`
572
+ * to express filters like `{ _id: { $type: 'string' }, $expr: { $eq: ['$_id', '$space'] } }`.
573
+ */
574
+ declare function expr(predicate: TypedAggExpr<DocField>): MongoFilterExpr;
575
+ /**
576
+ * Construct a unified `FieldAccessor<S, N>` proxy. Property access creates
577
+ * an `Expression` using the property name as the field path; callable
578
+ * form accepts a dot-path string validated against `N` at compile time.
579
+ *
580
+ * The proxy target is a function so the resulting object is both callable
581
+ * and indexable. Symbol-keyed accesses (e.g. `Symbol.toPrimitive`) return
582
+ * `undefined` to keep accidental coercion behaviour unsurprising —
583
+ * matching the previous `FieldProxy` / `FilterProxy` semantics.
584
+ */
585
+ declare function createFieldAccessor<S extends DocShape, N extends NestedDocShape = Record<string, never>>(): FieldAccessor<S, N>;
586
+ //#endregion
587
+ export { TypedUpdateOp as A, ProjectedShape as C, StringField as D, SortSpec as E, expr as F, UpdaterResult as M, ValidPaths as N, TypedAccumulatorExpr as O, createFieldAccessor as P, PathCompletions as S, ResolveRow as T, NullableDocField as _, DocShape as a, ObjectExpression as b, FieldAccessor as c, LeafExpression as d, LiteralValue as f, NestedDocShape as g, ModelToDocShape as h, DocField as i, UnwoundShape as j, TypedAggExpr as k, GroupSpec as l, ModelNestedShape as m, BooleanField as n, Expression as o, ModelArrayField as p, DateField as r, ExtractDocShape as s, ArrayField as t, GroupedDocShape as u, NullableNumericField as v, ResolvePath as w, ObjectField as x, NumericField as y };
588
+ //# sourceMappingURL=field-accessor-DHsAPiW3-BdYCspQC.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-accessor-DHsAPiW3-BdYCspQC.d.mts","names":[],"sources":["../../../../2-mongo-family/5-query-builders/query-builder/dist/field-accessor-DHsAPiW3.d.mts"],"mappings":";;;;;;;;UAKU;WACC;WACA;;KAEN;WACM;WACA;;KAEN;WACM;WACA;;KAEN;WACM;WACA;;KAEN;WACM;WACA;;KAEN;WACM;WACA;;KAEN;WACM;WACA;;KAEN;WACM;WACA;;KAEN,aAAa,UAAU,YAAY,UAAU,uBAAuB,UAAU,wBAAwB,UAAU,yBAAyB,UAAU,YAAY;KAC/J,WAAW,eAAe;KAC1B,eAAe,KAAK;EACvB;IACE;IACA,eAAe;;IAEf,IAAI;EACN,eAAe;IACb;KACC,gBAAgB,kBAAkB,eAAe,iCAAiC,eAAe,iBAAiB,WAAW,eAAe,WAAW;WACjJ,SAAS,eAAe,eAAe,WAAW,qBAAqB;WACvE,UAAU,eAAe,WAAW,qBAAqB;OAC7D,mBAAmB;;;;;;;;;KASrB,cAAc,cAAc,UAAU,mBAAmB;WACnD;IACP,kBAAkB,8BAA8B,WAAW,iBAAiB,MAAM,WAAW,sBAAsB,aAAa,mBAAmB,0BAA0B,kBAAkB,0BAA0B,eAAe,oBAAoB,iCAAiC,e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