cogsbox-shape 0.5.144 → 0.5.145
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/schema.d.ts +43 -25
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -306,33 +306,41 @@ type DeriveViewDefaults<TTableName extends keyof TRegistry, TSelection, TRegistr
|
|
|
306
306
|
]> | null : never : never : never;
|
|
307
307
|
} : {})>;
|
|
308
308
|
export type DeriveViewResultFromBox<TBox extends CreateSchemaBoxReturn<any, any>, TTableName extends keyof TBox, TSelection extends TBox[TTableName]["RelationSelection"]> = {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
309
|
+
definition: TBox[TTableName]["definition"];
|
|
310
|
+
schemaKey: TTableName;
|
|
311
|
+
schemas: {
|
|
312
|
+
sql: TBox[TTableName]["schemas"]["sql"];
|
|
313
|
+
client: z.ZodObject<_DeriveViewShape<TTableName, TSelection, {
|
|
314
|
+
[K in keyof TBox]: {
|
|
315
|
+
rawSchema: TBox[K]["definition"];
|
|
316
|
+
zodSchemas: {
|
|
317
|
+
sqlSchema: TBox[K]["schemas"]["sql"];
|
|
318
|
+
clientSchema: TBox[K]["schemas"]["client"];
|
|
319
|
+
validationSchema: TBox[K]["schemas"]["validation"];
|
|
320
|
+
defaultValues: TBox[K]["defaults"];
|
|
321
|
+
toClient: TBox[K]["transforms"]["toClient"];
|
|
322
|
+
toDb: TBox[K]["transforms"]["toDb"];
|
|
323
|
+
};
|
|
320
324
|
};
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
325
|
+
}, "clientSchema">>;
|
|
326
|
+
validation: z.ZodObject<_DeriveViewShape<TTableName, TSelection, {
|
|
327
|
+
[K in keyof TBox]: {
|
|
328
|
+
rawSchema: TBox[K]["definition"];
|
|
329
|
+
zodSchemas: {
|
|
330
|
+
sqlSchema: TBox[K]["schemas"]["sql"];
|
|
331
|
+
clientSchema: TBox[K]["schemas"]["client"];
|
|
332
|
+
validationSchema: TBox[K]["schemas"]["validation"];
|
|
333
|
+
defaultValues: TBox[K]["defaults"];
|
|
334
|
+
toClient: TBox[K]["transforms"]["toClient"];
|
|
335
|
+
toDb: TBox[K]["transforms"]["toDb"];
|
|
336
|
+
};
|
|
333
337
|
};
|
|
334
|
-
}
|
|
335
|
-
}
|
|
338
|
+
}, "validationSchema">>;
|
|
339
|
+
};
|
|
340
|
+
transforms: {
|
|
341
|
+
toClient: TBox[TTableName]["transforms"]["toClient"];
|
|
342
|
+
toDb: TBox[TTableName]["transforms"]["toDb"];
|
|
343
|
+
};
|
|
336
344
|
defaults: DeriveViewDefaults<TTableName, TSelection, {
|
|
337
345
|
[K in keyof TBox]: {
|
|
338
346
|
rawSchema: TBox[K]["definition"];
|
|
@@ -346,6 +354,13 @@ export type DeriveViewResultFromBox<TBox extends CreateSchemaBoxReturn<any, any>
|
|
|
346
354
|
};
|
|
347
355
|
};
|
|
348
356
|
}>;
|
|
357
|
+
isView: true;
|
|
358
|
+
viewSelection: TSelection;
|
|
359
|
+
baseTable: TTableName;
|
|
360
|
+
nav?: undefined;
|
|
361
|
+
createView?: undefined;
|
|
362
|
+
RelationSelection?: undefined;
|
|
363
|
+
__registry: TBox;
|
|
349
364
|
};
|
|
350
365
|
export type DeriveViewResult<TTableName extends keyof TRegistry, TSelection, TRegistry extends RegistryShape> = {
|
|
351
366
|
definition: TRegistry[TTableName]["rawSchema"];
|
|
@@ -363,6 +378,9 @@ export type DeriveViewResult<TTableName extends keyof TRegistry, TSelection, TRe
|
|
|
363
378
|
isView: true;
|
|
364
379
|
viewSelection: TSelection;
|
|
365
380
|
baseTable: TTableName;
|
|
381
|
+
nav?: undefined;
|
|
382
|
+
createView?: undefined;
|
|
383
|
+
RelationSelection?: undefined;
|
|
366
384
|
__registry: TRegistry;
|
|
367
385
|
};
|
|
368
386
|
export type DeriveViewFromSchema<TSchema extends {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cogsbox-shape",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.145",
|
|
4
4
|
"description": "A TypeScript library for creating type-safe database schemas with Zod validation, SQL type definitions, and automatic client/server transformations. Unifies client, server, and database types through a single schema definition, with built-in support for relationships and serialization.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|