cogsbox-shape 0.5.86 → 0.5.87

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 CHANGED
@@ -45,11 +45,11 @@ export interface IBuilderMethods<T extends SQLType | RelationConfig<any>, TSql e
45
45
  }) => TNewNext) | TNewNext, defaultValue: TDefaultNext): Prettify<Builder<"new", T, TSql, z.ZodUnion<[
46
46
  TNewNext,
47
47
  z.ZodLiteral<TDefaultNext extends () => infer R ? R : TDefaultNext>
48
- ]>, IsLiteralType<z.infer<TNewNext>> extends true ? TDefaultNext extends () => infer R ? R : TDefaultNext : z.infer<TNewNext>, z.ZodUnion<[
48
+ ]>, IsLiteralType<z.infer<TNewNext>> extends true ? TDefaultNext extends () => infer R ? R : TDefaultNext : z.infer<TNewNext>, (TDefaultNext extends () => infer R ? R : TDefaultNext) extends z.infer<TNewNext> ? z.ZodUnion<[TSql, TNewNext]> : z.ZodUnion<[
49
49
  TSql,
50
50
  TNewNext,
51
51
  z.ZodLiteral<TDefaultNext extends () => infer R ? R : TDefaultNext>
52
- ]>, z.ZodUnion<[
52
+ ]>, (TDefaultNext extends () => infer R ? R : TDefaultNext) extends z.infer<TNewNext> ? z.ZodUnion<[TSql, TNewNext]> : z.ZodUnion<[
53
53
  TSql,
54
54
  TNewNext,
55
55
  z.ZodLiteral<TDefaultNext extends () => infer R ? R : TDefaultNext>
@@ -269,10 +269,6 @@ export declare function schemaRelations<TSchema extends Schema<any>, RefObject e
269
269
  type Prettify<T> = {
270
270
  [K in keyof T]: T[K];
271
271
  } & {};
272
- /**
273
- * [INTERNAL] Recursively derives a Zod schema by inspecting the builder's config.
274
- * This version correctly uses the `schema` property from the relation's config.
275
- */
276
272
  type DeriveSchemaByKey<T, Key extends "zodSqlSchema" | "zodClientSchema" | "zodValidationSchema", Depth extends any[] = []> = Depth["length"] extends 10 ? any : {
277
273
  [K in keyof T as K extends "_tableName" | typeof SchemaWrapperBrand ? never : K]: T[K] extends {
278
274
  config: {
package/dist/schema.js CHANGED
@@ -425,8 +425,6 @@ function isRelation(value) {
425
425
  "toKey" in value &&
426
426
  "schema" in value);
427
427
  }
428
- // PASTE THIS ENTIRE FUNCTION OVER YOUR EXISTING createSchema FUNCTION
429
- // The only change is the `if` condition inside the loop.
430
428
  export function createSchema(schema, relations) {
431
429
  const sqlFields = {};
432
430
  const clientFields = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogsbox-shape",
3
- "version": "0.5.86",
3
+ "version": "0.5.87",
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",