cogsbox-shape 0.5.147 → 0.5.148

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.js +7 -2
  2. package/package.json +1 -1
package/dist/schema.js CHANGED
@@ -456,11 +456,14 @@ export function createSchema(schema, relations) {
456
456
  const fullSchema = { ...schema, ...(relations || {}) };
457
457
  let pkKeys = [];
458
458
  let clientPkKeys = [];
459
- const pkResolver = schema.__pkResolver;
460
459
  for (const key in fullSchema) {
460
+ const value = fullSchema[key];
461
461
  if (key === "_tableName" ||
462
462
  key.startsWith("__") ||
463
- key === String(SchemaWrapperBrand))
463
+ key === String(SchemaWrapperBrand) ||
464
+ key === "isClient" ||
465
+ key === "primaryKeySQL" ||
466
+ typeof value === "function")
464
467
  continue;
465
468
  const definition = fullSchema[key];
466
469
  // Handle new-style references
@@ -781,6 +784,8 @@ export function createSchemaBox(schemas, resolver) {
781
784
  toClient: entry.zodSchemas.toClient, // May need composition for nested
782
785
  toDb: entry.zodSchemas.toDb,
783
786
  },
787
+ pk: entry.zodSchemas.pk,
788
+ clientPk: entry.zodSchemas.clientPk,
784
789
  defaults: defaults,
785
790
  isView: true, // Discriminator
786
791
  viewSelection: selection, // Store what was selected
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogsbox-shape",
3
- "version": "0.5.147",
3
+ "version": "0.5.148",
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",