cogsbox-shape 0.5.11 → 0.5.12
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 +4 -0
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -1426,6 +1426,9 @@ export declare function createSchema<T extends Schema<any>>(schema: T): {
|
|
|
1426
1426
|
__schemaId: string;
|
|
1427
1427
|
};
|
|
1428
1428
|
};
|
|
1429
|
+
type ConversionType<T extends Schema<any>> = {
|
|
1430
|
+
[K in keyof (SchemaTypes<T>["client"] & SchemaTypes<T>["db"])]: (K extends keyof SchemaTypes<T>["client"] ? SchemaTypes<T>["client"][K] : never) | (K extends keyof SchemaTypes<T>["db"] ? SchemaTypes<T>["db"][K] : never);
|
|
1431
|
+
};
|
|
1429
1432
|
type OmitNever<T> = {
|
|
1430
1433
|
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
|
1431
1434
|
};
|
|
@@ -1446,5 +1449,6 @@ export type SchemaTypes<T extends Schema<any>> = {
|
|
|
1446
1449
|
clientSchema: infer C;
|
|
1447
1450
|
dbSchema: infer D;
|
|
1448
1451
|
} ? C | D : never>;
|
|
1452
|
+
join: ConversionType<T>;
|
|
1449
1453
|
};
|
|
1450
1454
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cogsbox-shape",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
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",
|