@zeno-lib/schema 0.4.1 → 0.5.0

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/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Column, InferInsertModel, InferSelectModel, Table } from "drizzle-orm";
2
2
  import { BuildRefine, BuildSchema, CoerceOptions, CreateSchemaFactoryOptions, NoUnknownKeys, createInsertSchema, createSchemaFactory, createSelectSchema, createUpdateSchema } from "drizzle-orm/zod";
3
3
  import { z } from "zod";
4
- //#region src/index.d.ts
5
4
  declare const noTableSchemaOptions: unique symbol;
6
5
  type NoTableSchemaOptions = {
7
6
  [noTableSchemaOptions]?: never;
@@ -137,5 +136,4 @@ declare const ownedRows: <TSchema extends OwnableSchema, TParentKey extends Colu
137
136
  * as a diff in review.
138
137
  */
139
138
  declare const writableColumns: (exports: Record<string, unknown>) => Record<string, string[]>;
140
- //#endregion
141
139
  export { type DefineTableSchemaOptions, type DefineTableSchemaResult, type OwnedRows, type ZenoTable, createInsertSchema, createSchemaFactory, createSelectSchema, createUpdateSchema, defineServerTableSchema, defineTableSchema, ownedRows, writableColumns };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Table, getColumns, getTableName, getTableUniqueName, is } from "drizzle-orm";
2
2
  import { createInsertSchema, createSchemaFactory, createSchemaFactory as createSchemaFactory$1, createSelectSchema, createUpdateSchema } from "drizzle-orm/zod";
3
3
  import { z } from "zod";
4
- //#region src/index.ts
4
+ // src/index.ts
5
5
  const COLUMN_RULES_KEY = "~zeno";
6
6
  const columnRules = (table) => table[COLUMN_RULES_KEY].columns;
7
7
  const CLIENT_EXCLUDES = /* @__PURE__ */ new Set(["database", "server"]);
@@ -55,7 +55,7 @@ const isPositiveIdentity = (column) => {
55
55
  };
56
56
  const toPositive = (schema) => typeof schema.positive === "function" ? schema.positive() : schema;
57
57
  const positiveCheck = (column) => isPositiveIdentity(column) ? toPositive : void 0;
58
- const TIMESTAMP = /^(\d{4}-\d{2}-\d{2})[T ](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?([+-](?:0\d|1[0-5])(?::?[0-5]\d)?|Z)?$/;
58
+ const TIMESTAMP = /^(\d{4}-\d{2}-\d{2})[T ](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?([+-](?:0\d|1[0-5])(?::?[0-5]\d)?|Z)?$/u;
59
59
  const INFINITIES = /* @__PURE__ */ new Set(["-infinity", "infinity"]);
60
60
  const ISO_DATE = z.iso.date();
61
61
  const isDate = (value) => ISO_DATE.safeParse(value).success;
@@ -157,5 +157,4 @@ const writableColumns = (exports) => {
157
157
  for (const [name, table] of tables) columns[name] = Object.keys(buildTableSchema("writableColumns", table, void 0, CLIENT_EXCLUDES).insert.shape).sort();
158
158
  return columns;
159
159
  };
160
- //#endregion
161
160
  export { createInsertSchema, createSchemaFactory, createSelectSchema, createUpdateSchema, defineServerTableSchema, defineTableSchema, ownedRows, writableColumns };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeno-lib/schema",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "repository": {
5
5
  "url": "https://github.com/zeno-lib/zeno.git",
6
6
  "directory": "packages/schema"
@@ -19,14 +19,14 @@
19
19
  ],
20
20
  "devDependencies": {
21
21
  "@zeno-lib/typescript": "^1.2.0",
22
- "drizzle-orm": "1.0.0-rc.5-5935859",
23
- "tsdown": "^0.23.0",
22
+ "drizzle-orm": "1.0.0-rc.5",
23
+ "tsdown": "^0.23.1",
24
24
  "typescript": "7.0.2",
25
- "vitest": "5.0.3",
26
- "zod": "^4.6.5"
25
+ "vitest": "5.0.5",
26
+ "zod": "^4.6.7"
27
27
  },
28
28
  "peerDependencies": {
29
- "drizzle-orm": "1.0.0-rc.5-5935859",
29
+ "drizzle-orm": "1.0.0-rc.5",
30
30
  "zod": ">=4"
31
31
  },
32
32
  "publishConfig": {
package/src/index.ts CHANGED
@@ -366,7 +366,8 @@ const positiveCheck = (column: Column) =>
366
366
  // minutes, up to the ±15:59 Postgres takes.
367
367
  // The groups are the date and the offset.
368
368
  const TIMESTAMP =
369
- /^(\d{4}-\d{2}-\d{2})[T ](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?([+-](?:0\d|1[0-5])(?::?[0-5]\d)?|Z)?$/
369
+ // biome-ignore lint/style/useNamedCaptureGroup: named groups need ES2018, past the ES6 target
370
+ /^(\d{4}-\d{2}-\d{2})[T ](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?([+-](?:0\d|1[0-5])(?::?[0-5]\d)?|Z)?$/u
370
371
 
371
372
  // Postgres's special values, which the string mode reads back as they are.
372
373
  const INFINITIES: ReadonlySet<string> = new Set(["-infinity", "infinity"])