opacacms 0.3.9 → 0.3.10

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.
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-r5k7jw66.js";
6
+ } from "./chunk-re459gm9.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -14,7 +14,7 @@ import {
14
14
  flattenFields,
15
15
  getRelationalFields,
16
16
  toSnakeCase
17
- } from "./chunk-qxt9vge8.js";
17
+ } from "./chunk-5xpf5jxd.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-jq1drsen.js";
@@ -57,7 +57,7 @@ class BunSQLiteAdapter extends BaseDatabaseAdapter {
57
57
  const { Database } = await import("bun:sqlite");
58
58
  const { BunSqliteDialect } = await import("kysely-bun-sqlite");
59
59
  this._rawDb = new Database(this.path);
60
- const { createOpacaKysely } = await import("./chunk-6m1jhxmd.js");
60
+ const { createOpacaKysely } = await import("./chunk-gzbz5jwy.js");
61
61
  this._db = createOpacaKysely({
62
62
  dialect: new BunSqliteDialect({
63
63
  database: this._rawDb
@@ -19,7 +19,7 @@ function mapFieldToPostgresType(field) {
19
19
  case "boolean":
20
20
  return "boolean";
21
21
  case "date":
22
- return "timestamp with time zone";
22
+ return "timestamptz";
23
23
  case "json":
24
24
  case "file":
25
25
  return "jsonb";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-q5sb5dcr.js";
11
11
  import {
12
12
  toSnakeCase
13
- } from "./chunk-qxt9vge8.js";
13
+ } from "./chunk-5xpf5jxd.js";
14
14
  import {
15
15
  OpacaLogger,
16
16
  logger
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-r5k7jw66.js";
6
+ } from "./chunk-re459gm9.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -14,7 +14,7 @@ import {
14
14
  flattenFields,
15
15
  getRelationalFields,
16
16
  toSnakeCase
17
- } from "./chunk-qxt9vge8.js";
17
+ } from "./chunk-5xpf5jxd.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-jq1drsen.js";
@@ -63,7 +63,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
63
63
  const require2 = createRequire(import.meta.url);
64
64
  const Database = require2("better-sqlite3");
65
65
  this._rawDb = new Database(this.path);
66
- const { createOpacaKysely } = await import("./chunk-6m1jhxmd.js");
66
+ const { createOpacaKysely } = await import("./chunk-gzbz5jwy.js");
67
67
  this._db = createOpacaKysely({
68
68
  dialect: new SqliteDialect({
69
69
  database: this._rawDb
@@ -178,7 +178,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
178
178
  const unflattened = unflattenRow(row);
179
179
  const colDef = this._collections.find((c) => c.slug === collection);
180
180
  if (colDef) {
181
- const { getRelationalFields: getRelationalFields2, toSnakeCase: toSnakeCase2 } = await import("./chunk-526a3gqx.js");
181
+ const { getRelationalFields: getRelationalFields2, toSnakeCase: toSnakeCase2 } = await import("./chunk-z9ek88xr.js");
182
182
  const relationalFields = getRelationalFields2(colDef.fields);
183
183
  for (const field of relationalFields) {
184
184
  if (!field.name)
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-r5k7jw66.js";
6
+ } from "./chunk-re459gm9.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -14,7 +14,7 @@ import {
14
14
  flattenFields,
15
15
  getRelationalFields,
16
16
  toSnakeCase
17
- } from "./chunk-qxt9vge8.js";
17
+ } from "./chunk-5xpf5jxd.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-jq1drsen.js";
@@ -55,7 +55,7 @@ class D1Adapter extends BaseDatabaseAdapter {
55
55
  if (this._db)
56
56
  return;
57
57
  const { D1Dialect } = await import("kysely-d1");
58
- const { createOpacaKysely } = await import("./chunk-6m1jhxmd.js");
58
+ const { createOpacaKysely } = await import("./chunk-gzbz5jwy.js");
59
59
  this._db = createOpacaKysely({
60
60
  dialect: new D1Dialect({ database: this._rawDb }),
61
61
  config: {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-q5sb5dcr.js";
5
5
  import {
6
6
  toSnakeCase
7
- } from "./chunk-qxt9vge8.js";
7
+ } from "./chunk-5xpf5jxd.js";
8
8
  import"./chunk-8sqjbsgt.js";
9
9
 
10
10
  // src/db/kysely/factory.ts
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-r5k7jw66.js";
6
+ } from "./chunk-re459gm9.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  getRelationalFields,
15
15
  toSnakeCase
16
- } from "./chunk-qxt9vge8.js";
16
+ } from "./chunk-5xpf5jxd.js";
17
17
  import {
18
18
  logger
19
19
  } from "./chunk-jq1drsen.js";
@@ -71,7 +71,7 @@ class PostgresAdapter extends BaseDatabaseAdapter {
71
71
  ssl: this.config.ssl
72
72
  });
73
73
  }
74
- const { createOpacaKysely } = await import("./chunk-6m1jhxmd.js");
74
+ const { createOpacaKysely } = await import("./chunk-gzbz5jwy.js");
75
75
  this._db = createOpacaKysely({
76
76
  dialect: new PostgresDialect({
77
77
  pool: {
@@ -184,7 +184,7 @@ class PostgresAdapter extends BaseDatabaseAdapter {
184
184
  const unflattened = unflattenRow(row);
185
185
  const colDef = this._collections.find((c) => c.slug === collection);
186
186
  if (colDef) {
187
- const { getRelationalFields: getRelationalFields2, toSnakeCase: toSnakeCase2 } = await import("./chunk-526a3gqx.js");
187
+ const { getRelationalFields: getRelationalFields2, toSnakeCase: toSnakeCase2 } = await import("./chunk-z9ek88xr.js");
188
188
  const relationalFields = getRelationalFields2(colDef.fields);
189
189
  for (const field of relationalFields) {
190
190
  if (!field.name)
@@ -4,7 +4,7 @@ import {
4
4
  mapFieldToPostgresType,
5
5
  mapFieldToSQLiteType,
6
6
  toSnakeCase
7
- } from "./chunk-qxt9vge8.js";
7
+ } from "./chunk-5xpf5jxd.js";
8
8
  import {
9
9
  logger
10
10
  } from "./chunk-jq1drsen.js";
@@ -269,7 +269,7 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
269
269
  const config = typeof ts === "object" ? ts : {};
270
270
  const createdField = toSnakeCase(config.createdAt ?? "createdAt");
271
271
  const updatedField = toSnakeCase(config.updatedAt ?? "updatedAt");
272
- const tsType = dialect === "postgres" ? "timestamp with time zone" : "text";
272
+ const tsType = dialect === "postgres" ? "timestamptz" : "text";
273
273
  builder = builder.addColumn(createdField, tsType, (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`));
274
274
  builder = builder.addColumn(updatedField, tsType, (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`));
275
275
  }
@@ -298,7 +298,7 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
298
298
  const config = typeof ts === "object" ? ts : {};
299
299
  const createdField = toSnakeCase(config.createdAt ?? "createdAt");
300
300
  const updatedField = toSnakeCase(config.updatedAt ?? "updatedAt");
301
- const tsType = dialect === "postgres" ? "timestamp with time zone" : "text";
301
+ const tsType = dialect === "postgres" ? "timestamptz" : "text";
302
302
  if (!existingColSet.has(createdField)) {
303
303
  logger.info(` -> Adding missing timestamp column: ${tableName}.${createdField}`);
304
304
  await db.schema.alterTable(tableName).addColumn(createdField, tsType, (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`)).execute();
@@ -377,7 +377,7 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
377
377
  return c;
378
378
  });
379
379
  }
380
- const tsType = dialect === "postgres" ? "timestamp with time zone" : "text";
380
+ const tsType = dialect === "postgres" ? "timestamptz" : "text";
381
381
  bBuilder = bBuilder.addColumn("created_at", tsType, (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`));
382
382
  bBuilder = bBuilder.addColumn("updated_at", tsType, (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`));
383
383
  await bBuilder.execute();
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-r5k7jw66.js";
6
+ } from "./chunk-re459gm9.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -14,7 +14,7 @@ import {
14
14
  flattenFields,
15
15
  getRelationalFields,
16
16
  toSnakeCase
17
- } from "./chunk-qxt9vge8.js";
17
+ } from "./chunk-5xpf5jxd.js";
18
18
  import {
19
19
  logger
20
20
  } from "./chunk-jq1drsen.js";
@@ -63,7 +63,7 @@ class SQLiteAdapter extends BaseDatabaseAdapter {
63
63
  const require2 = createRequire(import.meta.url);
64
64
  const Database = require2("better-sqlite3");
65
65
  this._rawDb = new Database(this.path);
66
- const { createOpacaKysely } = await import("./chunk-6m1jhxmd.js");
66
+ const { createOpacaKysely } = await import("./chunk-gzbz5jwy.js");
67
67
  this._db = createOpacaKysely({
68
68
  dialect: new SqliteDialect({
69
69
  database: this._rawDb
@@ -4,7 +4,7 @@ import {
4
4
  mapFieldToPostgresType,
5
5
  mapFieldToSQLiteType,
6
6
  toSnakeCase
7
- } from "./chunk-qxt9vge8.js";
7
+ } from "./chunk-5xpf5jxd.js";
8
8
  import"./chunk-8sqjbsgt.js";
9
9
  export {
10
10
  toSnakeCase,
package/dist/cli/index.js CHANGED
@@ -2594,7 +2594,7 @@ function mapFieldToPostgresType(field) {
2594
2594
  case "boolean":
2595
2595
  return "boolean";
2596
2596
  case "date":
2597
- return "timestamp with time zone";
2597
+ return "timestamptz";
2598
2598
  case "json":
2599
2599
  case "file":
2600
2600
  return "jsonb";
@@ -2716,7 +2716,7 @@ function createSchemaSnapshot(collections, globals, dialect) {
2716
2716
  const config = typeof collection.timestamps === "object" ? collection.timestamps : {};
2717
2717
  const createdField = toSnakeCase(config.createdAt || "createdAt");
2718
2718
  const updatedField = toSnakeCase(config.updatedAt || "updatedAt");
2719
- const tsType = dialect === "postgres" ? "timestamp with time zone" : "text";
2719
+ const tsType = dialect === "postgres" ? "timestamptz" : "text";
2720
2720
  table.columns[createdField] = {
2721
2721
  name: createdField,
2722
2722
  type: tsType,
@@ -2803,7 +2803,7 @@ function createSchemaSnapshot(collections, globals, dialect) {
2803
2803
  defaultValue: bField.defaultValue
2804
2804
  };
2805
2805
  }
2806
- const tsType = dialect === "postgres" ? "timestamp with time zone" : "text";
2806
+ const tsType = dialect === "postgres" ? "timestamptz" : "text";
2807
2807
  blockTable.columns["created_at"] = {
2808
2808
  name: "created_at",
2809
2809
  type: tsType,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  BetterSQLiteAdapter,
3
3
  createBetterSQLiteAdapter
4
- } from "../chunk-pj31j6j0.js";
5
- import"../chunk-r5k7jw66.js";
4
+ } from "../chunk-ec6wz44n.js";
5
+ import"../chunk-re459gm9.js";
6
6
  import"../chunk-s8mqwnm1.js";
7
7
  import"../chunk-q5sb5dcr.js";
8
- import"../chunk-qxt9vge8.js";
8
+ import"../chunk-5xpf5jxd.js";
9
9
  import"../chunk-jq1drsen.js";
10
10
  import"../chunk-h8v093av.js";
11
11
  import"../chunk-8sqjbsgt.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  BunSQLiteAdapter,
3
3
  createBunSQLiteAdapter
4
- } from "../chunk-pw2a9war.js";
5
- import"../chunk-r5k7jw66.js";
4
+ } from "../chunk-5a6cjmfz.js";
5
+ import"../chunk-re459gm9.js";
6
6
  import"../chunk-s8mqwnm1.js";
7
7
  import"../chunk-q5sb5dcr.js";
8
- import"../chunk-qxt9vge8.js";
8
+ import"../chunk-5xpf5jxd.js";
9
9
  import"../chunk-jq1drsen.js";
10
10
  import"../chunk-h8v093av.js";
11
11
  import"../chunk-8sqjbsgt.js";
package/dist/db/d1.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  D1Adapter,
3
3
  createD1Adapter
4
- } from "../chunk-wry3rqh0.js";
5
- import"../chunk-r5k7jw66.js";
4
+ } from "../chunk-g7bgnpy4.js";
5
+ import"../chunk-re459gm9.js";
6
6
  import"../chunk-s8mqwnm1.js";
7
7
  import"../chunk-q5sb5dcr.js";
8
- import"../chunk-qxt9vge8.js";
8
+ import"../chunk-5xpf5jxd.js";
9
9
  import"../chunk-jq1drsen.js";
10
10
  import"../chunk-h8v093av.js";
11
11
  import"../chunk-8sqjbsgt.js";
package/dist/db/index.js CHANGED
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  D1Adapter,
3
3
  createD1Adapter
4
- } from "../chunk-wry3rqh0.js";
4
+ } from "../chunk-g7bgnpy4.js";
5
5
  import {
6
6
  PostgresAdapter,
7
7
  createPostgresAdapter
8
- } from "../chunk-cm5rvcnn.js";
8
+ } from "../chunk-h9ksxnrd.js";
9
9
  import {
10
10
  SQLiteAdapter,
11
11
  createSQLiteAdapter
12
- } from "../chunk-49e16hjg.js";
12
+ } from "../chunk-swa093n5.js";
13
13
  import {
14
14
  BunSQLiteAdapter,
15
15
  createBunSQLiteAdapter
16
- } from "../chunk-pw2a9war.js";
16
+ } from "../chunk-5a6cjmfz.js";
17
17
  import {
18
18
  BetterSQLiteAdapter,
19
19
  createBetterSQLiteAdapter
20
- } from "../chunk-pj31j6j0.js";
21
- import"../chunk-r5k7jw66.js";
20
+ } from "../chunk-ec6wz44n.js";
21
+ import"../chunk-re459gm9.js";
22
22
  import {
23
23
  BaseDatabaseAdapter
24
24
  } from "../chunk-s8mqwnm1.js";
25
25
  import"../chunk-q5sb5dcr.js";
26
- import"../chunk-qxt9vge8.js";
26
+ import"../chunk-5xpf5jxd.js";
27
27
  import"../chunk-jq1drsen.js";
28
28
  import"../chunk-h8v093av.js";
29
29
  import"../chunk-8sqjbsgt.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  PostgresAdapter,
3
3
  createPostgresAdapter
4
- } from "../chunk-cm5rvcnn.js";
5
- import"../chunk-r5k7jw66.js";
4
+ } from "../chunk-h9ksxnrd.js";
5
+ import"../chunk-re459gm9.js";
6
6
  import"../chunk-s8mqwnm1.js";
7
7
  import"../chunk-q5sb5dcr.js";
8
- import"../chunk-qxt9vge8.js";
8
+ import"../chunk-5xpf5jxd.js";
9
9
  import"../chunk-jq1drsen.js";
10
10
  import"../chunk-h8v093av.js";
11
11
  import"../chunk-8sqjbsgt.js";
package/dist/db/sqlite.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  SQLiteAdapter,
3
3
  createSQLiteAdapter
4
- } from "../chunk-49e16hjg.js";
5
- import"../chunk-r5k7jw66.js";
4
+ } from "../chunk-swa093n5.js";
5
+ import"../chunk-re459gm9.js";
6
6
  import"../chunk-s8mqwnm1.js";
7
7
  import"../chunk-q5sb5dcr.js";
8
- import"../chunk-qxt9vge8.js";
8
+ import"../chunk-5xpf5jxd.js";
9
9
  import"../chunk-jq1drsen.js";
10
10
  import"../chunk-h8v093av.js";
11
11
  import"../chunk-8sqjbsgt.js";
@@ -3,12 +3,12 @@ import {
3
3
  } from "../chunk-a3qae86h.js";
4
4
  import {
5
5
  createAPIRouter
6
- } from "../chunk-pqjyh3tk.js";
6
+ } from "../chunk-5y0mkt7x.js";
7
7
  import"../chunk-b1g8jmth.js";
8
8
  import"../chunk-2vbfc4q8.js";
9
9
  import"../chunk-hthm9srb.js";
10
10
  import"../chunk-q5sb5dcr.js";
11
- import"../chunk-qxt9vge8.js";
11
+ import"../chunk-5xpf5jxd.js";
12
12
  import"../chunk-jq1drsen.js";
13
13
  import"../chunk-h8v093av.js";
14
14
  import"../chunk-8sqjbsgt.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createAPIRouter
3
- } from "../chunk-pqjyh3tk.js";
3
+ } from "../chunk-5y0mkt7x.js";
4
4
  import"../chunk-b1g8jmth.js";
5
5
  import"../chunk-2vbfc4q8.js";
6
6
  import"../chunk-hthm9srb.js";
7
7
  import"../chunk-q5sb5dcr.js";
8
- import"../chunk-qxt9vge8.js";
8
+ import"../chunk-5xpf5jxd.js";
9
9
  import"../chunk-jq1drsen.js";
10
10
  import"../chunk-h8v093av.js";
11
11
  import"../chunk-8sqjbsgt.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createAPIRouter
3
- } from "../chunk-pqjyh3tk.js";
3
+ } from "../chunk-5y0mkt7x.js";
4
4
  import"../chunk-b1g8jmth.js";
5
5
  import"../chunk-2vbfc4q8.js";
6
6
  import"../chunk-hthm9srb.js";
7
7
  import"../chunk-q5sb5dcr.js";
8
- import"../chunk-qxt9vge8.js";
8
+ import"../chunk-5xpf5jxd.js";
9
9
  import"../chunk-jq1drsen.js";
10
10
  import"../chunk-h8v093av.js";
11
11
  import"../chunk-8sqjbsgt.js";
@@ -3,12 +3,12 @@ import {
3
3
  } from "../chunk-a3qae86h.js";
4
4
  import {
5
5
  createAPIRouter
6
- } from "../chunk-pqjyh3tk.js";
6
+ } from "../chunk-5y0mkt7x.js";
7
7
  import"../chunk-b1g8jmth.js";
8
8
  import"../chunk-2vbfc4q8.js";
9
9
  import"../chunk-hthm9srb.js";
10
10
  import"../chunk-q5sb5dcr.js";
11
- import"../chunk-qxt9vge8.js";
11
+ import"../chunk-5xpf5jxd.js";
12
12
  import"../chunk-jq1drsen.js";
13
13
  import"../chunk-h8v093av.js";
14
14
  import"../chunk-8sqjbsgt.js";
package/dist/server.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  hydrateDoc,
8
8
  parsePopulate,
9
9
  populateDoc
10
- } from "./chunk-pqjyh3tk.js";
10
+ } from "./chunk-5y0mkt7x.js";
11
11
  import {
12
12
  defineConfig
13
13
  } from "./chunk-1bd7fz7n.js";
@@ -18,7 +18,7 @@ import {
18
18
  BaseDatabaseAdapter
19
19
  } from "./chunk-s8mqwnm1.js";
20
20
  import"./chunk-q5sb5dcr.js";
21
- import"./chunk-qxt9vge8.js";
21
+ import"./chunk-5xpf5jxd.js";
22
22
  import"./chunk-jq1drsen.js";
23
23
  import"./chunk-h8v093av.js";
24
24
  import"./chunk-8sqjbsgt.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opacacms",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "license": "MIT",
5
5
  "description": "OpacaCMS: A lightweight, type-safe, and developer-first Headless CMS for the edge and beyond.",
6
6
  "keywords": [