cogsbox-shape 0.5.125 → 0.5.127

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 (2) hide show
  1. package/dist/schema.d.ts +42 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -304,6 +304,48 @@ type DeriveViewDefaults<TTableName extends keyof TRegistry, TSelection, TRegistr
304
304
  1
305
305
  ]> | null : never : never : never;
306
306
  } : {})>;
307
+ export type DeriveViewResultFromBox<TBox extends CreateSchemaBoxReturn<any, any>, TTableName extends keyof TBox, TSelection extends TBox[TTableName]["RelationSelection"]> = {
308
+ sql: TBox[TTableName]["schemas"]["sql"];
309
+ client: z.ZodObject<_DeriveViewShape<TTableName, TSelection, {
310
+ [K in keyof TBox]: {
311
+ rawSchema: TBox[K]["definition"];
312
+ zodSchemas: {
313
+ sqlSchema: TBox[K]["schemas"]["sql"];
314
+ clientSchema: TBox[K]["schemas"]["client"];
315
+ validationSchema: TBox[K]["schemas"]["validation"];
316
+ defaultValues: TBox[K]["defaults"];
317
+ toClient: TBox[K]["transforms"]["toClient"];
318
+ toDb: TBox[K]["transforms"]["toDb"];
319
+ };
320
+ };
321
+ }, "clientSchema">>;
322
+ validation: z.ZodObject<_DeriveViewShape<TTableName, TSelection, {
323
+ [K in keyof TBox]: {
324
+ rawSchema: TBox[K]["definition"];
325
+ zodSchemas: {
326
+ sqlSchema: TBox[K]["schemas"]["sql"];
327
+ clientSchema: TBox[K]["schemas"]["client"];
328
+ validationSchema: TBox[K]["schemas"]["validation"];
329
+ defaultValues: TBox[K]["defaults"];
330
+ toClient: TBox[K]["transforms"]["toClient"];
331
+ toDb: TBox[K]["transforms"]["toDb"];
332
+ };
333
+ };
334
+ }, "validationSchema">>;
335
+ defaults: DeriveViewDefaults<TTableName, TSelection, {
336
+ [K in keyof TBox]: {
337
+ rawSchema: TBox[K]["definition"];
338
+ zodSchemas: {
339
+ sqlSchema: TBox[K]["schemas"]["sql"];
340
+ clientSchema: TBox[K]["schemas"]["client"];
341
+ validationSchema: TBox[K]["schemas"]["validation"];
342
+ defaultValues: TBox[K]["defaults"];
343
+ toClient: TBox[K]["transforms"]["toClient"];
344
+ toDb: TBox[K]["transforms"]["toDb"];
345
+ };
346
+ };
347
+ }>;
348
+ };
307
349
  export type DeriveViewResult<TTableName extends keyof TRegistry, TSelection, TRegistry extends RegistryShape> = {
308
350
  sql: TRegistry[TTableName]["zodSchemas"]["sqlSchema"];
309
351
  client: z.ZodObject<_DeriveViewShape<TTableName, TSelection, TRegistry, "clientSchema">>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogsbox-shape",
3
- "version": "0.5.125",
3
+ "version": "0.5.127",
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",