opacacms 0.3.2 → 0.3.4

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 (58) hide show
  1. package/dist/admin/index.js +1 -1
  2. package/dist/admin/react.js +1 -1
  3. package/dist/admin/vue.js +1 -1
  4. package/dist/admin/webcomponent.js +35 -37
  5. package/dist/{chunk-g9bxb6h0.js → chunk-2fm4kv2q.js} +1 -1
  6. package/dist/chunk-2vbfc4q8.js +6 -0
  7. package/dist/{chunk-adq2b75c.js → chunk-40tky6qh.js} +2 -2
  8. package/dist/{chunk-e0g6gn7n.js → chunk-49e16hjg.js} +3 -3
  9. package/dist/{chunk-fnsf1dfm.js → chunk-526a3gqx.js} +1 -1
  10. package/dist/{chunk-sqsfk9p4.js → chunk-6m1jhxmd.js} +1 -1
  11. package/dist/{chunk-6bywt602.js → chunk-8sqjbsgt.js} +1 -26
  12. package/dist/{chunk-n1twhqmf.js → chunk-acghejk8.js} +1 -1
  13. package/dist/{chunk-m24yqkeq.js → chunk-b1g8jmth.js} +3 -3
  14. package/dist/{chunk-5422w4eq.js → chunk-cm5rvcnn.js} +5 -5
  15. package/dist/{chunk-941zxavt.js → chunk-h2y2t07h.js} +4 -4
  16. package/dist/{chunk-6qs0g65f.js → chunk-h8v093av.js} +1 -1
  17. package/dist/{chunk-m5ems3hh.js → chunk-hthm9srb.js} +1 -1
  18. package/dist/{chunk-2k3ysje3.js → chunk-nch158fe.js} +1 -1
  19. package/dist/{chunk-naqcqj8n.js → chunk-pj31j6j0.js} +4 -4
  20. package/dist/{chunk-qsh2nqz3.js → chunk-pw2a9war.js} +3 -3
  21. package/dist/{chunk-j8js1y0h.js → chunk-r5k7jw66.js} +1 -1
  22. package/dist/{chunk-48ywpd0a.js → chunk-vmz9ncf1.js} +1 -1
  23. package/dist/{chunk-qhdsjek6.js → chunk-wry3rqh0.js} +3 -3
  24. package/dist/cli/index.js +6793 -6
  25. package/dist/client.js +3 -3
  26. package/dist/db/better-sqlite.js +4 -4
  27. package/dist/db/bun-sqlite.js +4 -4
  28. package/dist/db/d1.js +4 -4
  29. package/dist/db/index.js +8 -8
  30. package/dist/db/postgres.js +4 -4
  31. package/dist/db/sqlite.js +4 -4
  32. package/dist/index.js +7 -7
  33. package/dist/runtimes/bun.js +6 -6
  34. package/dist/runtimes/cloudflare-workers.js +6 -6
  35. package/dist/runtimes/next.js +6 -6
  36. package/dist/runtimes/node.js +6 -6
  37. package/dist/schema/index.js +3 -3
  38. package/dist/server.js +6 -6
  39. package/dist/storage/index.js +1 -1
  40. package/package.json +12 -11
  41. package/dist/chunk-0hxz770x.js +0 -10
  42. package/dist/chunk-2gdsy99f.js +0 -581
  43. package/dist/chunk-3j9zjfmn.js +0 -376
  44. package/dist/chunk-5b8r0v8c.js +0 -47
  45. package/dist/chunk-71wwx9vj.js +0 -413
  46. package/dist/chunk-9by912e9.js +0 -318
  47. package/dist/chunk-f3dg5dq4.js +0 -75
  48. package/dist/chunk-g17v7yfr.js +0 -237
  49. package/dist/chunk-gzdfc1ct.js +0 -1137
  50. package/dist/chunk-h6dhexzr.js +0 -94
  51. package/dist/chunk-jvv72110.js +0 -98
  52. package/dist/chunk-rg3jrfgg.js +0 -93
  53. package/dist/chunk-rjvcp6ph.js +0 -95
  54. package/dist/chunk-v0nazhmk.js +0 -263
  55. package/dist/chunk-wqvdwck9.js +0 -326
  56. package/dist/chunk-x7bnzswh.js +0 -174
  57. package/dist/chunk-y4e9twg2.js +0 -76
  58. package/src/cli/index.ts +0 -117
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sanitizeGraphQLName
3
- } from "./chunk-5b8r0v8c.js";
3
+ } from "./chunk-2vbfc4q8.js";
4
4
 
5
5
  // src/client.ts
6
6
  var capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
@@ -0,0 +1,6 @@
1
+ // src/utils/string.ts
2
+ function sanitizeGraphQLName(name) {
3
+ return name.replace(/[^_a-zA-Z0-9]/g, "_");
4
+ }
5
+
6
+ export { sanitizeGraphQLName };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getSystemCollections,
3
3
  init_system_schema
4
- } from "./chunk-6qs0g65f.js";
5
- import"./chunk-6bywt602.js";
4
+ } from "./chunk-h8v093av.js";
5
+ import"./chunk-8sqjbsgt.js";
6
6
  init_system_schema();
7
7
 
8
8
  export {
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-j8js1y0h.js";
6
+ } from "./chunk-r5k7jw66.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-jq1drsen.js";
21
21
  import {
22
22
  __require
23
- } from "./chunk-6bywt602.js";
23
+ } from "./chunk-8sqjbsgt.js";
24
24
 
25
25
  // src/db/sqlite.ts
26
26
  import fs from "node:fs/promises";
@@ -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-sqsfk9p4.js");
66
+ const { createOpacaKysely } = await import("./chunk-6m1jhxmd.js");
67
67
  this._db = createOpacaKysely({
68
68
  dialect: new SqliteDialect({
69
69
  database: this._rawDb
@@ -5,7 +5,7 @@ import {
5
5
  mapFieldToSQLiteType,
6
6
  toSnakeCase
7
7
  } from "./chunk-qxt9vge8.js";
8
- import"./chunk-6bywt602.js";
8
+ import"./chunk-8sqjbsgt.js";
9
9
  export {
10
10
  toSnakeCase,
11
11
  mapFieldToSQLiteType,
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  toSnakeCase
7
7
  } from "./chunk-qxt9vge8.js";
8
- import"./chunk-6bywt602.js";
8
+ import"./chunk-8sqjbsgt.js";
9
9
 
10
10
  // src/db/kysely/factory.ts
11
11
  import { CamelCasePlugin, Kysely } from "kysely";
@@ -1,6 +1,4 @@
1
1
  import { createRequire } from "node:module";
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
2
  var __defProp = Object.defineProperty;
5
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -8,28 +6,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  function __accessProp(key) {
9
7
  return this[key];
10
8
  }
11
- var __toESMCache_node;
12
- var __toESMCache_esm;
13
- var __toESM = (mod, isNodeMode, target) => {
14
- var canCache = mod != null && typeof mod === "object";
15
- if (canCache) {
16
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
- var cached = cache.get(mod);
18
- if (cached)
19
- return cached;
20
- }
21
- target = mod != null ? __create(__getProtoOf(mod)) : {};
22
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
23
- for (let key of __getOwnPropNames(mod))
24
- if (!__hasOwnProp.call(to, key))
25
- __defProp(to, key, {
26
- get: __accessProp.bind(mod, key),
27
- enumerable: true
28
- });
29
- if (canCache)
30
- cache.set(mod, to);
31
- return to;
32
- };
33
9
  var __toCommonJS = (from) => {
34
10
  var entry = (__moduleCache ??= new WeakMap).get(from), desc;
35
11
  if (entry)
@@ -47,7 +23,6 @@ var __toCommonJS = (from) => {
47
23
  return entry;
48
24
  };
49
25
  var __moduleCache;
50
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
51
26
  var __returnValue = (v) => v;
52
27
  function __exportSetter(name, newValue) {
53
28
  this[name] = __returnValue.bind(null, newValue);
@@ -64,4 +39,4 @@ var __export = (target, all) => {
64
39
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
65
40
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
66
41
 
67
- export { __toESM, __toCommonJS, __commonJS, __export, __esm, __require };
42
+ export { __toCommonJS, __export, __esm, __require };
@@ -2,7 +2,7 @@ import {
2
2
  init_compiler,
3
3
  init_zod,
4
4
  zodToOpacaFields
5
- } from "./chunk-m5ems3hh.js";
5
+ } from "./chunk-hthm9srb.js";
6
6
 
7
7
  // src/schema/collection.ts
8
8
  init_compiler();
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  exports_compiler,
3
3
  init_compiler
4
- } from "./chunk-m5ems3hh.js";
4
+ } from "./chunk-hthm9srb.js";
5
5
  import {
6
6
  OpacaLogger
7
7
  } from "./chunk-jq1drsen.js";
8
8
  import {
9
9
  getSystemCollections,
10
10
  init_system_schema
11
- } from "./chunk-6qs0g65f.js";
11
+ } from "./chunk-h8v093av.js";
12
12
  import {
13
13
  __toCommonJS
14
- } from "./chunk-6bywt602.js";
14
+ } from "./chunk-8sqjbsgt.js";
15
15
 
16
16
  // src/auth/index.ts
17
17
  import { apiKey } from "@better-auth/api-key";
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-j8js1y0h.js";
6
+ } from "./chunk-r5k7jw66.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-jq1drsen.js";
20
20
  import {
21
21
  __require
22
- } from "./chunk-6bywt602.js";
22
+ } from "./chunk-8sqjbsgt.js";
23
23
 
24
24
  // src/db/postgres.ts
25
25
  import fs from "node:fs/promises";
@@ -71,7 +71,7 @@ class PostgresAdapter extends BaseDatabaseAdapter {
71
71
  ssl: this.config.ssl
72
72
  });
73
73
  }
74
- const { createOpacaKysely } = await import("./chunk-sqsfk9p4.js");
74
+ const { createOpacaKysely } = await import("./chunk-6m1jhxmd.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-fnsf1dfm.js");
187
+ const { getRelationalFields: getRelationalFields2, toSnakeCase: toSnakeCase2 } = await import("./chunk-526a3gqx.js");
188
188
  const relationalFields = getRelationalFields2(colDef.fields);
189
189
  for (const field of relationalFields) {
190
190
  if (!field.name)
@@ -584,7 +584,7 @@ class PostgresAdapter extends BaseDatabaseAdapter {
584
584
  }
585
585
  }
586
586
  async migrate(collections, globals = []) {
587
- const { getSystemCollections } = await import("./chunk-adq2b75c.js");
587
+ const { getSystemCollections } = await import("./chunk-40tky6qh.js");
588
588
  this._collections = [...getSystemCollections(), ...collections];
589
589
  this._globals = globals;
590
590
  if (this.push && this._db) {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createAuth,
3
3
  sanitizeConfig
4
- } from "./chunk-m24yqkeq.js";
4
+ } from "./chunk-b1g8jmth.js";
5
5
  import {
6
6
  sanitizeGraphQLName
7
- } from "./chunk-5b8r0v8c.js";
7
+ } from "./chunk-2vbfc4q8.js";
8
8
  import {
9
9
  requestContext
10
10
  } from "./chunk-q5sb5dcr.js";
@@ -19,11 +19,11 @@ import {
19
19
  exports_system_schema,
20
20
  getSystemCollections,
21
21
  init_system_schema
22
- } from "./chunk-6qs0g65f.js";
22
+ } from "./chunk-h8v093av.js";
23
23
  import {
24
24
  __require,
25
25
  __toCommonJS
26
- } from "./chunk-6bywt602.js";
26
+ } from "./chunk-8sqjbsgt.js";
27
27
 
28
28
  // src/server/admin.ts
29
29
  function createAdminHandlers(config, settings, getAuth) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __esm,
3
3
  __export
4
- } from "./chunk-6bywt602.js";
4
+ } from "./chunk-8sqjbsgt.js";
5
5
 
6
6
  // src/db/system-schema.ts
7
7
  var exports_system_schema = {};
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __esm,
3
3
  __export
4
- } from "./chunk-6bywt602.js";
4
+ } from "./chunk-8sqjbsgt.js";
5
5
 
6
6
  // src/schema/zod.ts
7
7
  import * as zOriginal from "zod";
@@ -13,7 +13,7 @@ import {
13
13
  registerSidebarItem,
14
14
  toggleSidebar
15
15
  } from "./chunk-m83ybzf8.js";
16
- import"./chunk-6bywt602.js";
16
+ import"./chunk-8sqjbsgt.js";
17
17
  export {
18
18
  toggleSidebar,
19
19
  registerSidebarItem,
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-j8js1y0h.js";
6
+ } from "./chunk-r5k7jw66.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-jq1drsen.js";
21
21
  import {
22
22
  __require
23
- } from "./chunk-6bywt602.js";
23
+ } from "./chunk-8sqjbsgt.js";
24
24
 
25
25
  // src/db/better-sqlite.ts
26
26
  import fs from "node:fs/promises";
@@ -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-sqsfk9p4.js");
66
+ const { createOpacaKysely } = await import("./chunk-6m1jhxmd.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-fnsf1dfm.js");
181
+ const { getRelationalFields: getRelationalFields2, toSnakeCase: toSnakeCase2 } = await import("./chunk-526a3gqx.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-j8js1y0h.js";
6
+ } from "./chunk-r5k7jw66.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-jq1drsen.js";
21
21
  import {
22
22
  __require
23
- } from "./chunk-6bywt602.js";
23
+ } from "./chunk-8sqjbsgt.js";
24
24
 
25
25
  // src/db/bun-sqlite.ts
26
26
  import fs from "node:fs/promises";
@@ -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-sqsfk9p4.js");
60
+ const { createOpacaKysely } = await import("./chunk-6m1jhxmd.js");
61
61
  this._db = createOpacaKysely({
62
62
  dialect: new BunSqliteDialect({
63
63
  database: this._rawDb
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  getSystemCollections,
13
13
  init_system_schema
14
- } from "./chunk-6qs0g65f.js";
14
+ } from "./chunk-h8v093av.js";
15
15
 
16
16
  // src/db/kysely/data-mapper.ts
17
17
  function toCamelCase(str) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  notify
3
3
  } from "./chunk-m83ybzf8.js";
4
- import"./chunk-6bywt602.js";
4
+ import"./chunk-8sqjbsgt.js";
5
5
 
6
6
  // src/admin/stores/auth.ts
7
7
  import { atom, computed } from "nanostores";
@@ -3,7 +3,7 @@ import {
3
3
  flattenPayload,
4
4
  pushSchema,
5
5
  unflattenRow
6
- } from "./chunk-j8js1y0h.js";
6
+ } from "./chunk-r5k7jw66.js";
7
7
  import {
8
8
  BaseDatabaseAdapter
9
9
  } from "./chunk-s8mqwnm1.js";
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-jq1drsen.js";
21
21
  import {
22
22
  __require
23
- } from "./chunk-6bywt602.js";
23
+ } from "./chunk-8sqjbsgt.js";
24
24
 
25
25
  // src/db/d1.ts
26
26
  import fs from "node:fs/promises";
@@ -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-sqsfk9p4.js");
58
+ const { createOpacaKysely } = await import("./chunk-6m1jhxmd.js");
59
59
  this._db = createOpacaKysely({
60
60
  dialect: new D1Dialect({ database: this._rawDb }),
61
61
  config: {