@prisma-next/mongo-core 0.0.1

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/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # @prisma-next/mongo-core
2
+
3
+ Core types and validation for Prisma Next MongoDB support.
4
+
5
+ ## Responsibilities
6
+
7
+ - **Contract types**: `MongoContract`, `MongoModelDefinition`, `MongoRelation`, `MongoStorage`, and associated type helpers (`InferModelRow`, `ExtractMongoCodecTypes`)
8
+ - **Contract validation**: Three-layer validation pipeline — structural (Arktype), domain-agnostic (`validateContractDomain`), and Mongo-specific storage (`validateMongoStorage`) — composed by `validateMongoContract`
9
+ - **Codec registry**: Built-in MongoDB codecs (`objectId`, `string`, `date`, etc.) and the `MongoCodecDefinition` type
10
+ - **Query plan types**: `MongoQueryPlan`, `MongoCommand`, and lowering context types consumed by higher layers
11
+
12
+ ## Dependencies
13
+
14
+ - **Depends on**:
15
+ - `@prisma-next/contract` (core contract types)
16
+ - **Depended on by**:
17
+ - `@prisma-next/mongo-orm` (ORM client types and row inference)
18
+ - `@prisma-next/mongo-runtime` (runtime executor)
19
+ - `@prisma-next/target-mongo` (target pack)
20
+ - `@prisma-next/adapter-mongo` (command lowering)
21
+ - `@prisma-next/driver-mongo` (driver types)
@@ -0,0 +1,291 @@
1
+ import { PlanMeta } from "@prisma-next/contract/types";
2
+
3
+ //#region src/contract-types.d.ts
4
+ type MongoStorageCollection = Record<string, never>;
5
+ type MongoStorage = {
6
+ readonly collections: Record<string, MongoStorageCollection>;
7
+ };
8
+ type MongoModelField = {
9
+ readonly codecId: string;
10
+ readonly nullable: boolean;
11
+ };
12
+ type MongoModelStorage = {
13
+ readonly collection?: string;
14
+ };
15
+ type MongoDiscriminator = {
16
+ readonly field: string;
17
+ };
18
+ type MongoVariantEntry = {
19
+ readonly value: string;
20
+ };
21
+ type MongoReferenceRelationOn = {
22
+ readonly localFields: readonly string[];
23
+ readonly targetFields: readonly string[];
24
+ };
25
+ type MongoReferenceRelation = {
26
+ readonly to: string;
27
+ readonly cardinality: '1:1' | '1:N' | 'N:1';
28
+ readonly strategy: 'reference';
29
+ readonly on: MongoReferenceRelationOn;
30
+ };
31
+ type MongoEmbedRelation = {
32
+ readonly to: string;
33
+ readonly cardinality: '1:1' | '1:N';
34
+ readonly strategy: 'embed';
35
+ readonly field: string;
36
+ };
37
+ type MongoRelation = MongoReferenceRelation | MongoEmbedRelation;
38
+ type MongoModelDefinition = {
39
+ readonly fields: Record<string, MongoModelField>;
40
+ readonly storage: MongoModelStorage;
41
+ readonly relations: Record<string, MongoRelation>;
42
+ readonly discriminator?: MongoDiscriminator;
43
+ readonly variants?: Record<string, MongoVariantEntry>;
44
+ readonly base?: string;
45
+ };
46
+ type MongoContract<Roots extends Record<string, string> = Record<string, string>, S extends MongoStorage = MongoStorage, M extends Record<string, MongoModelDefinition> = Record<string, MongoModelDefinition>> = {
47
+ readonly targetFamily: string;
48
+ readonly roots: Roots;
49
+ readonly storage: S;
50
+ readonly models: M;
51
+ };
52
+ type MongoTypeMaps<TCodecTypes extends Record<string, {
53
+ output: unknown;
54
+ }> = Record<string, {
55
+ output: unknown;
56
+ }>> = {
57
+ readonly codecTypes: TCodecTypes;
58
+ };
59
+ type MongoTypeMapsPhantomKey = '__@prisma-next/mongo-core/typeMaps@__';
60
+ type MongoContractWithTypeMaps<TContract, TTypeMaps> = TContract & { readonly [K in MongoTypeMapsPhantomKey]?: TTypeMaps };
61
+ type ExtractMongoTypeMaps<T> = MongoTypeMapsPhantomKey extends keyof T ? NonNullable<T[MongoTypeMapsPhantomKey & keyof T]> : never;
62
+ type ExtractMongoCodecTypes<T> = ExtractMongoTypeMaps<T> extends {
63
+ codecTypes: infer C;
64
+ } ? C extends Record<string, {
65
+ output: unknown;
66
+ }> ? C : Record<string, never> : Record<string, never>;
67
+ type InferModelRow<TContract extends MongoContractWithTypeMaps<MongoContract, MongoTypeMaps>, ModelName extends string & keyof TContract['models'], TFields extends Record<string, {
68
+ codecId: string;
69
+ nullable: boolean;
70
+ }> = TContract['models'][ModelName]['fields'], TCodecTypes extends Record<string, {
71
+ output: unknown;
72
+ }> = ExtractMongoCodecTypes<TContract>> = { -readonly [FieldName in keyof TFields]: TFields[FieldName]['nullable'] extends true ? TCodecTypes[TFields[FieldName]['codecId']]['output'] | null : TCodecTypes[TFields[FieldName]['codecId']]['output'] };
73
+ //#endregion
74
+ //#region src/param-ref.d.ts
75
+ declare class MongoParamRef {
76
+ readonly value: unknown;
77
+ readonly name: string | undefined;
78
+ readonly codecId: string | undefined;
79
+ constructor(value: unknown, options?: {
80
+ name?: string;
81
+ codecId?: string;
82
+ });
83
+ static of(value: unknown, options?: {
84
+ name?: string;
85
+ codecId?: string;
86
+ }): MongoParamRef;
87
+ }
88
+ //#endregion
89
+ //#region src/values.d.ts
90
+ type LiteralValue = string | number | boolean | null | Date;
91
+ type MongoValue = MongoParamRef | LiteralValue | MongoDocument | MongoArray;
92
+ interface MongoDocument {
93
+ readonly [key: string]: MongoValue;
94
+ }
95
+ interface MongoArray extends ReadonlyArray<MongoValue> {}
96
+ type MongoExpr = MongoDocument;
97
+ type MongoUpdateDocument = Record<string, MongoValue>;
98
+ type RawPipeline = ReadonlyArray<Record<string, unknown>>;
99
+ type Document = Record<string, unknown>;
100
+ //#endregion
101
+ //#region src/commands.d.ts
102
+ declare abstract class MongoCommand {
103
+ abstract readonly kind: string;
104
+ readonly collection: string;
105
+ protected constructor(collection: string);
106
+ protected freeze(): void;
107
+ }
108
+ interface FindOptions {
109
+ readonly projection?: Record<string, 1 | 0>;
110
+ readonly sort?: Record<string, 1 | -1>;
111
+ readonly limit?: number;
112
+ readonly skip?: number;
113
+ }
114
+ declare class FindCommand extends MongoCommand {
115
+ readonly kind: "find";
116
+ readonly filter: MongoExpr | undefined;
117
+ readonly projection: Record<string, 1 | 0> | undefined;
118
+ readonly sort: Record<string, 1 | -1> | undefined;
119
+ readonly limit: number | undefined;
120
+ readonly skip: number | undefined;
121
+ constructor(collection: string, filter?: MongoExpr, options?: FindOptions);
122
+ }
123
+ declare class InsertOneCommand extends MongoCommand {
124
+ readonly kind: "insertOne";
125
+ readonly document: Record<string, MongoValue>;
126
+ constructor(collection: string, document: Record<string, MongoValue>);
127
+ }
128
+ declare class UpdateOneCommand extends MongoCommand {
129
+ readonly kind: "updateOne";
130
+ readonly filter: MongoExpr;
131
+ readonly update: MongoUpdateDocument;
132
+ constructor(collection: string, filter: MongoExpr, update: MongoUpdateDocument);
133
+ }
134
+ declare class DeleteOneCommand extends MongoCommand {
135
+ readonly kind: "deleteOne";
136
+ readonly filter: MongoExpr;
137
+ constructor(collection: string, filter: MongoExpr);
138
+ }
139
+ declare class AggregateCommand extends MongoCommand {
140
+ readonly kind: "aggregate";
141
+ readonly pipeline: RawPipeline;
142
+ constructor(collection: string, pipeline: RawPipeline);
143
+ }
144
+ type AnyMongoCommand = FindCommand | InsertOneCommand | UpdateOneCommand | DeleteOneCommand | AggregateCommand;
145
+ //#endregion
146
+ //#region src/wire-commands.d.ts
147
+ declare abstract class MongoWireCommand {
148
+ abstract readonly kind: string;
149
+ readonly collection: string;
150
+ protected constructor(collection: string);
151
+ protected freeze(): void;
152
+ }
153
+ declare class FindWireCommand extends MongoWireCommand {
154
+ readonly kind: "find";
155
+ readonly filter: Document | undefined;
156
+ readonly projection: Document | undefined;
157
+ readonly sort: Document | undefined;
158
+ readonly limit: number | undefined;
159
+ readonly skip: number | undefined;
160
+ constructor(collection: string, filter?: Document, options?: {
161
+ projection?: Document;
162
+ sort?: Document;
163
+ limit?: number;
164
+ skip?: number;
165
+ });
166
+ }
167
+ declare class InsertOneWireCommand extends MongoWireCommand {
168
+ readonly kind: "insertOne";
169
+ readonly document: Document;
170
+ constructor(collection: string, document: Document);
171
+ }
172
+ declare class UpdateOneWireCommand extends MongoWireCommand {
173
+ readonly kind: "updateOne";
174
+ readonly filter: Document;
175
+ readonly update: Document;
176
+ constructor(collection: string, filter: Document, update: Document);
177
+ }
178
+ declare class DeleteOneWireCommand extends MongoWireCommand {
179
+ readonly kind: "deleteOne";
180
+ readonly filter: Document;
181
+ constructor(collection: string, filter: Document);
182
+ }
183
+ declare class AggregateWireCommand extends MongoWireCommand {
184
+ readonly kind: "aggregate";
185
+ readonly pipeline: RawPipeline;
186
+ constructor(collection: string, pipeline: RawPipeline);
187
+ }
188
+ type AnyMongoWireCommand = FindWireCommand | InsertOneWireCommand | UpdateOneWireCommand | DeleteOneWireCommand | AggregateWireCommand;
189
+ //#endregion
190
+ //#region src/plan.d.ts
191
+ interface MongoQueryPlan<Row = unknown> {
192
+ readonly command: AnyMongoCommand;
193
+ readonly meta: PlanMeta;
194
+ readonly _row?: Row;
195
+ }
196
+ interface MongoExecutionPlan<Row = unknown> {
197
+ readonly wireCommand: AnyMongoWireCommand;
198
+ readonly command: AnyMongoCommand;
199
+ readonly meta: PlanMeta;
200
+ readonly _row?: Row;
201
+ }
202
+ //#endregion
203
+ //#region src/adapter-types.d.ts
204
+ interface MongoLoweringContext {
205
+ readonly contract: MongoContract;
206
+ }
207
+ interface MongoAdapter {
208
+ lower<Row>(queryPlan: MongoQueryPlan<Row>, context: MongoLoweringContext): MongoExecutionPlan<Row>;
209
+ }
210
+ //#endregion
211
+ //#region src/codecs.d.ts
212
+ interface MongoCodec<Id extends string = string, TWire = unknown, TJs = unknown> {
213
+ readonly id: Id;
214
+ readonly targetTypes: readonly string[];
215
+ decode(wire: TWire): TJs;
216
+ encode?(value: TJs): TWire;
217
+ }
218
+ declare function mongoCodec<Id extends string, TWire, TJs>(config: {
219
+ typeId: Id;
220
+ targetTypes: readonly string[];
221
+ encode: (value: TJs) => TWire;
222
+ decode: (wire: TWire) => TJs;
223
+ }): MongoCodec<Id, TWire, TJs>;
224
+ type MongoCodecJsType<T> = T extends MongoCodec<string, unknown, infer TJs> ? TJs : never;
225
+ //#endregion
226
+ //#region src/codec-registry.d.ts
227
+ interface MongoCodecRegistry {
228
+ get(id: string): MongoCodec<string> | undefined;
229
+ has(id: string): boolean;
230
+ register(codec: MongoCodec<string>): void;
231
+ [Symbol.iterator](): Iterator<MongoCodec<string>>;
232
+ values(): IterableIterator<MongoCodec<string>>;
233
+ }
234
+ declare function createMongoCodecRegistry(): MongoCodecRegistry;
235
+ //#endregion
236
+ //#region src/driver-types.d.ts
237
+ interface MongoDriver {
238
+ execute<Row>(wireCommand: AnyMongoWireCommand): AsyncIterable<Row>;
239
+ close(): Promise<void>;
240
+ }
241
+ //#endregion
242
+ //#region src/results.d.ts
243
+ interface InsertOneResult {
244
+ readonly insertedId: unknown;
245
+ }
246
+ interface UpdateOneResult {
247
+ readonly matchedCount: number;
248
+ readonly modifiedCount: number;
249
+ }
250
+ interface DeleteOneResult {
251
+ readonly deletedCount: number;
252
+ }
253
+ //#endregion
254
+ //#region src/validate-domain.d.ts
255
+ interface DomainModelShape {
256
+ readonly fields: Record<string, unknown>;
257
+ readonly relations: Record<string, {
258
+ readonly to: string;
259
+ }>;
260
+ readonly discriminator?: {
261
+ readonly field: string;
262
+ };
263
+ readonly variants?: Record<string, unknown>;
264
+ readonly base?: string;
265
+ }
266
+ interface DomainContractShape {
267
+ readonly roots: Record<string, string>;
268
+ readonly models: Record<string, DomainModelShape>;
269
+ }
270
+ interface DomainValidationResult {
271
+ readonly warnings: string[];
272
+ }
273
+ declare function validateContractDomain(contract: DomainContractShape): DomainValidationResult;
274
+ //#endregion
275
+ //#region src/validate-mongo-contract.d.ts
276
+ interface MongoContractIndices {
277
+ readonly variantToBase: Record<string, string>;
278
+ readonly modelToVariants: Record<string, string[]>;
279
+ }
280
+ interface ValidatedMongoContract<TContract extends MongoContract> {
281
+ readonly contract: TContract;
282
+ readonly indices: MongoContractIndices;
283
+ readonly warnings: string[];
284
+ }
285
+ declare function validateMongoContract<TContract extends MongoContract>(value: unknown): ValidatedMongoContract<TContract>;
286
+ //#endregion
287
+ //#region src/validate-storage.d.ts
288
+ declare function validateMongoStorage(contract: MongoContract): void;
289
+ //#endregion
290
+ export { AggregateCommand, AggregateWireCommand, type AnyMongoCommand, type AnyMongoWireCommand, DeleteOneCommand, type DeleteOneResult, DeleteOneWireCommand, type Document, type DomainContractShape, type DomainModelShape, type DomainValidationResult, type ExtractMongoCodecTypes, type ExtractMongoTypeMaps, FindCommand, type FindOptions, FindWireCommand, type InferModelRow, InsertOneCommand, type InsertOneResult, InsertOneWireCommand, type LiteralValue, type MongoAdapter, type MongoArray, type MongoCodec, type MongoCodecJsType, type MongoCodecRegistry, type MongoContract, type MongoContractIndices, type MongoContractWithTypeMaps, type MongoDiscriminator, type MongoDocument, type MongoDriver, type MongoEmbedRelation, type MongoExecutionPlan, type MongoExpr, type MongoLoweringContext, type MongoModelDefinition, type MongoModelField, type MongoModelStorage, MongoParamRef, type MongoQueryPlan, type MongoReferenceRelation, type MongoReferenceRelationOn, type MongoRelation, type MongoStorage, type MongoStorageCollection, type MongoTypeMaps, type MongoTypeMapsPhantomKey, type MongoUpdateDocument, type MongoValue, type MongoVariantEntry, type RawPipeline, UpdateOneCommand, type UpdateOneResult, UpdateOneWireCommand, type ValidatedMongoContract, createMongoCodecRegistry, mongoCodec, validateContractDomain, validateMongoContract, validateMongoStorage };
291
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/contract-types.ts","../src/param-ref.ts","../src/values.ts","../src/commands.ts","../src/wire-commands.ts","../src/plan.ts","../src/adapter-types.ts","../src/codecs.ts","../src/codec-registry.ts","../src/driver-types.ts","../src/results.ts","../src/validate-domain.ts","../src/validate-mongo-contract.ts","../src/validate-storage.ts"],"sourcesContent":[],"mappings":";;;KAEY,sBAAA,GAAyB;KAEzB,YAAA;wBACY,eAAe;AAHvC,CAAA;AAEY,KAMA,eAAA,GANY;EAMZ,SAAA,OAAA,EAAe,MAAA;EAOf,SAAA,QAAA,EAAA,OAAiB;AAM7B,CAAA;AAIY,KAVA,iBAAA,GAUiB;EAMjB,SAAA,UAAA,CAAA,EAAA,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