opacacms 0.1.11 → 0.1.13
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/admin/index.js +9464 -21
- package/dist/admin/webcomponent.d.ts +1 -1
- package/dist/admin/webcomponent.js +9620 -6
- package/dist/admin.css +1 -0
- package/dist/{chunk-6dhs73zq.js → chunk-0am1m47g.js} +1 -1
- package/dist/{chunk-0nf7fe26.js → chunk-0d9aqz6z.js} +1 -1
- package/dist/{chunk-cvdd4eqh.js → chunk-2kyhqvhc.js} +5 -1
- package/dist/{chunk-gjjcc4hm.js → chunk-2z8wxx9g.js} +21 -6
- package/dist/{chunk-xg35h5a3.js → chunk-7fyepksb.js} +1 -1
- package/dist/{chunk-njytmdb4.js → chunk-pxh5encs.js} +34 -24
- package/dist/{chunk-n8aekdnr.js → chunk-qkn1ykrj.js} +33 -23
- package/dist/{chunk-kwp83w8b.js → chunk-wmvjvn7b.js} +4 -4
- package/dist/{chunk-qrt22f6e.js → chunk-wq314kkx.js} +35 -25
- package/dist/{chunk-eqtsfyjf.js → chunk-x2ejaftz.js} +52 -28
- package/dist/{chunk-6ew02s0c.js → chunk-xtwc125q.js} +18 -18
- package/dist/cli/index.js +5 -5
- package/dist/db/better-sqlite.d.ts +1 -0
- package/dist/db/better-sqlite.js +3 -3
- package/dist/db/bun-sqlite.d.ts +1 -0
- package/dist/db/bun-sqlite.js +3 -3
- package/dist/db/d1.js +3 -3
- package/dist/db/index.d.ts +3 -0
- package/dist/db/index.js +17 -13
- package/dist/db/postgres.js +3 -3
- package/dist/db/sqlite.js +3 -3
- package/dist/runtimes/bun.js +2 -2
- package/dist/runtimes/cloudflare-workers.js +2 -2
- package/dist/runtimes/next.js +2 -2
- package/dist/runtimes/node.js +2 -2
- package/dist/server.js +2 -2
- package/package.json +8 -2
- package/bun.lock +0 -34
- package/dist/admin/index.css +0 -47
- package/dist/api.d.ts +0 -6
- package/dist/api.js +0 -27
- package/dist/chunk-2zm8cy1w.js +0 -9482
- package/global.d.ts +0 -11
- package/src/admin/api-client.ts +0 -63
- package/src/admin/auth-client.ts +0 -40
- package/src/admin/custom-field.ts +0 -179
- package/src/admin/index.ts +0 -15
- package/src/admin/react.tsx +0 -72
- package/src/admin/router.ts +0 -9
- package/src/admin/stores/admin-queries.ts +0 -121
- package/src/admin/stores/auth.ts +0 -61
- package/src/admin/stores/column-visibility.ts +0 -67
- package/src/admin/stores/config.ts +0 -15
- package/src/admin/stores/media.ts +0 -95
- package/src/admin/stores/query.ts +0 -13
- package/src/admin/stores/ui.ts +0 -29
- package/src/admin/ui/admin-client.tsx +0 -283
- package/src/admin/ui/admin-layout.tsx +0 -276
- package/src/admin/ui/components/ColumnVisibilityToggle.tsx +0 -141
- package/src/admin/ui/components/DataDetailSheet.tsx +0 -141
- package/src/admin/ui/components/DataDetailView.tsx +0 -175
- package/src/admin/ui/components/Table.tsx +0 -67
- package/src/admin/ui/components/fields/ArrayField.tsx +0 -166
- package/src/admin/ui/components/fields/BlocksField.tsx +0 -202
- package/src/admin/ui/components/fields/BooleanField.tsx +0 -50
- package/src/admin/ui/components/fields/CollapsibleField.tsx +0 -75
- package/src/admin/ui/components/fields/DateField.tsx +0 -45
- package/src/admin/ui/components/fields/FileField.tsx +0 -322
- package/src/admin/ui/components/fields/GroupField.tsx +0 -50
- package/src/admin/ui/components/fields/JoinField.tsx +0 -23
- package/src/admin/ui/components/fields/NumberField.tsx +0 -46
- package/src/admin/ui/components/fields/RadioField.tsx +0 -62
- package/src/admin/ui/components/fields/RelationshipField.tsx +0 -278
- package/src/admin/ui/components/fields/RowField.tsx +0 -40
- package/src/admin/ui/components/fields/SelectField.tsx +0 -59
- package/src/admin/ui/components/fields/TabsField.tsx +0 -101
- package/src/admin/ui/components/fields/TextAreaField.tsx +0 -54
- package/src/admin/ui/components/fields/TextField.tsx +0 -49
- package/src/admin/ui/components/fields/VirtualField.tsx +0 -53
- package/src/admin/ui/components/fields/index.tsx +0 -371
- package/src/admin/ui/components/fields/richtext-editor/index.tsx +0 -211
- package/src/admin/ui/components/fields/richtext-editor/nodes/ImageComponent.tsx +0 -142
- package/src/admin/ui/components/fields/richtext-editor/nodes/ImageNode.tsx +0 -95
- package/src/admin/ui/components/fields/richtext-editor/plugins/ComponentPickerPlugin.tsx +0 -226
- package/src/admin/ui/components/fields/richtext-editor/plugins/EditableSyncPlugin.tsx +0 -16
- package/src/admin/ui/components/fields/richtext-editor/plugins/NotionToolbarPlugin.tsx +0 -184
- package/src/admin/ui/components/fields/richtext-editor/plugins/SimpleToolbarPlugin.tsx +0 -240
- package/src/admin/ui/components/fields/richtext-editor/plugins/ValueSyncPlugin.tsx +0 -40
- package/src/admin/ui/components/fields/utils.ts +0 -1
- package/src/admin/ui/components/link.tsx +0 -41
- package/src/admin/ui/components/media/AssetManagerModal.tsx +0 -334
- package/src/admin/ui/components/toast.tsx +0 -72
- package/src/admin/ui/components/ui/accordion.tsx +0 -51
- package/src/admin/ui/components/ui/alert-dialog.tsx +0 -98
- package/src/admin/ui/components/ui/blocks.tsx +0 -32
- package/src/admin/ui/components/ui/breadcrumbs.tsx +0 -59
- package/src/admin/ui/components/ui/button.tsx +0 -26
- package/src/admin/ui/components/ui/collapsible.tsx +0 -124
- package/src/admin/ui/components/ui/dialog.tsx +0 -79
- package/src/admin/ui/components/ui/group.tsx +0 -20
- package/src/admin/ui/components/ui/index.ts +0 -17
- package/src/admin/ui/components/ui/input.tsx +0 -12
- package/src/admin/ui/components/ui/join.tsx +0 -53
- package/src/admin/ui/components/ui/label.tsx +0 -11
- package/src/admin/ui/components/ui/radio-group.tsx +0 -75
- package/src/admin/ui/components/ui/relationship-detail-sheet.tsx +0 -122
- package/src/admin/ui/components/ui/relationship.tsx +0 -58
- package/src/admin/ui/components/ui/scroll-area.tsx +0 -19
- package/src/admin/ui/components/ui/select.tsx +0 -187
- package/src/admin/ui/components/ui/separator.tsx +0 -21
- package/src/admin/ui/components/ui/sheet.tsx +0 -106
- package/src/admin/ui/components/ui/tabs.tsx +0 -116
- package/src/admin/ui/components/ui/utils.ts +0 -3
- package/src/admin/ui/hooks/use-debounce.ts +0 -15
- package/src/admin/ui/styles/_locale-switcher.scss +0 -33
- package/src/admin/ui/styles/accordion.scss +0 -60
- package/src/admin/ui/styles/animations.scss +0 -41
- package/src/admin/ui/styles/asset-manager.scss +0 -547
- package/src/admin/ui/styles/badge.scss +0 -13
- package/src/admin/ui/styles/base.scss +0 -22
- package/src/admin/ui/styles/button.scss +0 -161
- package/src/admin/ui/styles/card.scss +0 -13
- package/src/admin/ui/styles/collapsible.scss +0 -75
- package/src/admin/ui/styles/data-detail.scss +0 -92
- package/src/admin/ui/styles/dialog.scss +0 -102
- package/src/admin/ui/styles/empty-state.scss +0 -22
- package/src/admin/ui/styles/group.scss +0 -19
- package/src/admin/ui/styles/index.scss +0 -33
- package/src/admin/ui/styles/input.scss +0 -80
- package/src/admin/ui/styles/label.scss +0 -12
- package/src/admin/ui/styles/layout.scss +0 -56
- package/src/admin/ui/styles/lexical.scss +0 -469
- package/src/admin/ui/styles/loading.scss +0 -102
- package/src/admin/ui/styles/media-registry.scss +0 -597
- package/src/admin/ui/styles/pagination.scss +0 -20
- package/src/admin/ui/styles/radio-group.scss +0 -66
- package/src/admin/ui/styles/row.scss +0 -17
- package/src/admin/ui/styles/scrollbar.scss +0 -36
- package/src/admin/ui/styles/select.scss +0 -121
- package/src/admin/ui/styles/separator.scss +0 -14
- package/src/admin/ui/styles/sheet.scss +0 -152
- package/src/admin/ui/styles/sidebar.scss +0 -148
- package/src/admin/ui/styles/switch.scss +0 -59
- package/src/admin/ui/styles/table.scss +0 -207
- package/src/admin/ui/styles/tabs.scss +0 -62
- package/src/admin/ui/styles/toast.scss +0 -45
- package/src/admin/ui/styles/variables.scss +0 -24
- package/src/admin/ui/views/collection-list-view.tsx +0 -720
- package/src/admin/ui/views/dashboard-view.tsx +0 -263
- package/src/admin/ui/views/document-edit-view.tsx +0 -384
- package/src/admin/ui/views/global-edit-view.tsx +0 -226
- package/src/admin/ui/views/init-view.tsx +0 -182
- package/src/admin/ui/views/login-view.tsx +0 -123
- package/src/admin/ui/views/media-registry-view.tsx +0 -1104
- package/src/admin/ui/views/settings-view.tsx +0 -729
- package/src/admin/webcomponent.tsx +0 -15
- package/src/api.ts +0 -9
- package/src/auth/index.ts +0 -194
- package/src/auth/migrations.ts +0 -87
- package/src/auth/premissions.ts +0 -46
- package/src/cli/commands/generate-types.ts +0 -116
- package/src/cli/commands/init.ts +0 -95
- package/src/cli/commands/migrate-commands.ts +0 -160
- package/src/cli/commands/seed-command.ts +0 -11
- package/src/cli/d1-mock.ts +0 -101
- package/src/cli/index.test.ts +0 -84
- package/src/cli/index.ts +0 -183
- package/src/cli/r2-mock.ts +0 -217
- package/src/cli/seeding.ts +0 -409
- package/src/client.ts +0 -181
- package/src/config-utils.ts +0 -102
- package/src/config.ts +0 -49
- package/src/db/adapter.ts +0 -53
- package/src/db/better-sqlite.ts +0 -632
- package/src/db/bun-sqlite.ts +0 -646
- package/src/db/d1.ts +0 -711
- package/src/db/index.ts +0 -6
- package/src/db/kysely/data-mapper.ts +0 -142
- package/src/db/kysely/field-mapper.ts +0 -148
- package/src/db/kysely/migration-generator.ts +0 -223
- package/src/db/kysely/query-builder.ts +0 -92
- package/src/db/kysely/schema-builder.ts +0 -439
- package/src/db/kysely/sql-utils.ts +0 -13
- package/src/db/postgres.ts +0 -621
- package/src/db/sqlite.ts +0 -660
- package/src/db/system-schema.ts +0 -121
- package/src/index.ts +0 -13
- package/src/runtimes/README.md +0 -59
- package/src/runtimes/bun.ts +0 -49
- package/src/runtimes/cloudflare-workers.ts +0 -38
- package/src/runtimes/next.ts +0 -26
- package/src/runtimes/node.ts +0 -52
- package/src/schema/collection.ts +0 -184
- package/src/schema/fields/base.ts +0 -164
- package/src/schema/fields/index.ts +0 -427
- package/src/schema/global.ts +0 -145
- package/src/schema/index.ts +0 -4
- package/src/schema/infer.ts +0 -72
- package/src/server/admin-router.ts +0 -20
- package/src/server/admin.ts +0 -142
- package/src/server/assets.ts +0 -306
- package/src/server/collection-router.ts +0 -55
- package/src/server/handlers.ts +0 -722
- package/src/server/middlewares/admin.ts +0 -27
- package/src/server/middlewares/auth.ts +0 -89
- package/src/server/middlewares/context.ts +0 -17
- package/src/server/middlewares/cors.ts +0 -24
- package/src/server/middlewares/database-init.ts +0 -74
- package/src/server/middlewares/rate-limit.ts +0 -77
- package/src/server/router.ts +0 -47
- package/src/server/setup-middlewares.ts +0 -58
- package/src/server/system-router.ts +0 -35
- package/src/server.ts +0 -9
- package/src/storage/adapters/cloudflare-r2.ts +0 -136
- package/src/storage/adapters/local.ts +0 -146
- package/src/storage/adapters/s3.ts +0 -186
- package/src/storage/errors.ts +0 -46
- package/src/storage/index.ts +0 -5
- package/src/storage/types.ts +0 -39
- package/src/types.ts +0 -577
- package/src/utils/lexical.ts +0 -37
- package/src/utils/logger.ts +0 -73
- package/src/validation.ts +0 -429
- package/src/validator.ts +0 -179
- package/test/admin-custom-field.test.ts +0 -162
- package/test/admin-react-field.test.tsx +0 -134
- package/test/api-features.test.ts +0 -78
- package/test/api.test.ts +0 -178
- package/test/auth.test.ts +0 -62
- package/test/cli-integration.test.ts +0 -148
- package/test/cli.test.ts +0 -25
- package/test/db/postgres.test.ts +0 -95
- package/test/db/sqlite-filter.test.ts +0 -53
- package/test/db/sqlite.test.ts +0 -82
- package/test/engine-features.test.ts +0 -79
- package/test/globals.test.ts +0 -74
- package/test/integration-tmp/db-app/opacacms.config.ts +0 -15
- package/test/integration-tmp/my-sqlite-app/opacacms.config.ts +0 -25
- package/test/integration-tmp/my-test-app/index.ts +0 -8
- package/test/integration-tmp/my-test-app/opacacms.config.ts +0 -16
- package/test/integration-tmp/my-test-app/package.json +0 -12
- package/test/populate.test.ts +0 -79
- package/test/runtimes.test.ts +0 -43
- package/test/schema-builder.test.ts +0 -107
- package/test/schema-features.test.ts +0 -63
- package/test/seeding.test.ts +0 -68
- package/test/storage/local.test.ts +0 -72
- package/test/storage/s3.test.ts +0 -60
- package/test/structural-data.test.ts +0 -100
- package/test/test-setup.ts +0 -11
- package/test/validation.test.ts +0 -162
- package/tsconfig.json +0 -42
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
flattenPayload,
|
|
4
4
|
pushSchema,
|
|
5
5
|
unflattenRow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-xtwc125q.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseDatabaseAdapter
|
|
9
9
|
} from "./chunk-s8mqwnm1.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
flattenFields,
|
|
15
15
|
toSnakeCase
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2kyhqvhc.js";
|
|
17
17
|
import {
|
|
18
18
|
__require
|
|
19
19
|
} from "./chunk-8sqjbsgt.js";
|
|
@@ -31,6 +31,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
31
31
|
_rawDb;
|
|
32
32
|
_db;
|
|
33
33
|
_collections = [];
|
|
34
|
+
_globals = [];
|
|
34
35
|
push;
|
|
35
36
|
migrationDir;
|
|
36
37
|
pushDestructive;
|
|
@@ -66,7 +67,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
66
67
|
if (!colDef)
|
|
67
68
|
return data;
|
|
68
69
|
const result = { ...data };
|
|
69
|
-
const { flattenFields: flattenFields2 } = await import("./chunk-
|
|
70
|
+
const { flattenFields: flattenFields2 } = await import("./chunk-7fyepksb.js");
|
|
70
71
|
const allFields = flattenFields2(colDef.fields);
|
|
71
72
|
for (const field of allFields) {
|
|
72
73
|
const colName = toSnakeCase(field.name);
|
|
@@ -101,7 +102,8 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
101
102
|
return result;
|
|
102
103
|
}
|
|
103
104
|
async count(collection, query) {
|
|
104
|
-
|
|
105
|
+
const tableName = toSnakeCase(collection);
|
|
106
|
+
let qb = this._db.selectFrom(tableName).select((eb) => eb.fn.count("id").as("count"));
|
|
105
107
|
if (query && Object.keys(query).length > 0) {
|
|
106
108
|
qb = qb.where((eb) => buildKyselyWhere(eb, query) || eb.val(true));
|
|
107
109
|
}
|
|
@@ -109,6 +111,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
109
111
|
return Number(result?.count || 0);
|
|
110
112
|
}
|
|
111
113
|
async create(collection, data) {
|
|
114
|
+
const tableName = toSnakeCase(collection);
|
|
112
115
|
return this._db.transaction().execute(async (tx) => {
|
|
113
116
|
const colDef = this._collections.find((c) => c.slug === collection);
|
|
114
117
|
const jsonFields = colDef?.fields.filter((f) => ["richtext", "json", "file"].includes(f.type)).map((f) => f.name) || [];
|
|
@@ -149,9 +152,9 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
154
|
const coercedData = await this.coerceData(collection, filteredData);
|
|
152
|
-
await tx.insertInto(
|
|
155
|
+
await tx.insertInto(tableName).values(coercedData).execute();
|
|
153
156
|
for (const [key, values] of Object.entries(hasManyData)) {
|
|
154
|
-
const joinTableName = `${
|
|
157
|
+
const joinTableName = `${tableName}_${toSnakeCase(key)}_relations`.toLowerCase();
|
|
155
158
|
if (values.length > 0) {
|
|
156
159
|
const joinData = values.map((val, idx) => {
|
|
157
160
|
const tId = typeof val === "object" ? val.id : val;
|
|
@@ -165,7 +168,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
165
168
|
const block = blocks[i];
|
|
166
169
|
if (!block.blockType)
|
|
167
170
|
continue;
|
|
168
|
-
const blockTableName = `${
|
|
171
|
+
const blockTableName = `${tableName}_${toSnakeCase(key)}_${block.blockType}`.toLowerCase();
|
|
169
172
|
const bId = block.id || crypto.randomUUID();
|
|
170
173
|
const blockDef = colDef?.fields.find((f) => f.name === key && f.type === "blocks");
|
|
171
174
|
const blockConfig = blockDef?.blocks?.find((b) => b.slug === block.blockType);
|
|
@@ -190,8 +193,9 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
190
193
|
});
|
|
191
194
|
}
|
|
192
195
|
async findOne(collection, query, tx) {
|
|
196
|
+
const tableName = toSnakeCase(collection);
|
|
193
197
|
const executor = tx || this._db;
|
|
194
|
-
let qb = executor.selectFrom(
|
|
198
|
+
let qb = executor.selectFrom(tableName).selectAll();
|
|
195
199
|
if (query && Object.keys(query).length > 0) {
|
|
196
200
|
qb = qb.where((eb) => buildKyselyWhere(eb, query) || eb.val(true));
|
|
197
201
|
}
|
|
@@ -201,14 +205,14 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
201
205
|
const unflattened = unflattenRow(row);
|
|
202
206
|
const colDef = this._collections.find((c) => c.slug === collection);
|
|
203
207
|
if (colDef) {
|
|
204
|
-
const { getRelationalFields, toSnakeCase: toSnakeCase2 } = await import("./chunk-
|
|
208
|
+
const { getRelationalFields, toSnakeCase: toSnakeCase2 } = await import("./chunk-7fyepksb.js");
|
|
205
209
|
const relationalFields = getRelationalFields(colDef.fields);
|
|
206
210
|
for (const field of relationalFields) {
|
|
207
211
|
if (!field.name)
|
|
208
212
|
continue;
|
|
209
213
|
const snakeName = toSnakeCase2(field.name);
|
|
210
214
|
if (field.type === "relationship" && "hasMany" in field && field.hasMany) {
|
|
211
|
-
const joinTableName = `${
|
|
215
|
+
const joinTableName = `${tableName}_${snakeName}_relations`.toLowerCase();
|
|
212
216
|
try {
|
|
213
217
|
const relations = await executor.selectFrom(joinTableName).selectAll().where("source_id", "=", row.id).orderBy("order", "asc").execute();
|
|
214
218
|
unflattened[field.name] = relations.map((r) => r.target_id);
|
|
@@ -216,7 +220,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
216
220
|
} else if (field.type === "blocks" && field.blocks) {
|
|
217
221
|
const blockData = [];
|
|
218
222
|
for (const b of field.blocks) {
|
|
219
|
-
const blockTableName = `${
|
|
223
|
+
const blockTableName = `${tableName}_${snakeName}_${b.slug}`.toLowerCase();
|
|
220
224
|
try {
|
|
221
225
|
const blocks = await executor.selectFrom(blockTableName).selectAll().where("_parent_id", "=", row.id).execute();
|
|
222
226
|
for (const blk of blocks) {
|
|
@@ -242,7 +246,8 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
242
246
|
const limit = options?.limit || 10;
|
|
243
247
|
const offset = (page - 1) * limit;
|
|
244
248
|
const total = await this.count(collection, query);
|
|
245
|
-
|
|
249
|
+
const tableName = toSnakeCase(collection);
|
|
250
|
+
let qb = this._db.selectFrom(tableName).selectAll().limit(limit).offset(offset);
|
|
246
251
|
if (query && Object.keys(query).length > 0) {
|
|
247
252
|
qb = qb.where((eb) => buildKyselyWhere(eb, query) || eb.val(true));
|
|
248
253
|
}
|
|
@@ -270,6 +275,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
270
275
|
};
|
|
271
276
|
}
|
|
272
277
|
async update(collection, query, data) {
|
|
278
|
+
const tableName = toSnakeCase(collection);
|
|
273
279
|
return this._db.transaction().execute(async (tx) => {
|
|
274
280
|
let normalizedQuery = query;
|
|
275
281
|
if (typeof query !== "object" || query === null) {
|
|
@@ -302,10 +308,10 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
302
308
|
flatData.updated_at = new Date().toISOString();
|
|
303
309
|
if (Object.keys(flatData).length > 0) {
|
|
304
310
|
const coercedData = await this.coerceData(collection, flatData);
|
|
305
|
-
await tx.updateTable(
|
|
311
|
+
await tx.updateTable(tableName).set(coercedData).where("id", "=", current.id).execute();
|
|
306
312
|
}
|
|
307
313
|
for (const [key, values] of Object.entries(hasManyData)) {
|
|
308
|
-
const joinTableName = `${
|
|
314
|
+
const joinTableName = `${tableName}_${toSnakeCase(key)}_relations`.toLowerCase();
|
|
309
315
|
await tx.deleteFrom(joinTableName).where("source_id", "=", current.id).execute();
|
|
310
316
|
if (values.length > 0) {
|
|
311
317
|
const joinData = values.map((val, idx) => {
|
|
@@ -319,7 +325,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
319
325
|
const fieldDef = colDef?.fields.find((f) => f.name === key);
|
|
320
326
|
if (fieldDef?.type === "blocks" && fieldDef.blocks) {
|
|
321
327
|
for (const b of fieldDef.blocks) {
|
|
322
|
-
const blockTableName = `${
|
|
328
|
+
const blockTableName = `${tableName}_${toSnakeCase(key)}_${b.slug}`.toLowerCase();
|
|
323
329
|
try {
|
|
324
330
|
await tx.deleteFrom(blockTableName).where("_parent_id", "=", current.id).execute();
|
|
325
331
|
} catch (e) {}
|
|
@@ -329,7 +335,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
329
335
|
const block = blocks[i];
|
|
330
336
|
if (!block.blockType)
|
|
331
337
|
continue;
|
|
332
|
-
const blockTableName = `${
|
|
338
|
+
const blockTableName = `${tableName}_${toSnakeCase(key)}_${block.blockType}`.toLowerCase();
|
|
333
339
|
const bId = block.id || crypto.randomUUID();
|
|
334
340
|
const blockConfig = fieldDef?.blocks?.find((b) => b.slug === block.blockType);
|
|
335
341
|
const blockJsonFields = blockConfig?.fields.filter((f) => ["richtext", "json", "file"].includes(f.type)).map((f) => f.name) || [];
|
|
@@ -353,6 +359,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
353
359
|
});
|
|
354
360
|
}
|
|
355
361
|
async delete(collection, query) {
|
|
362
|
+
const tableName = toSnakeCase(collection);
|
|
356
363
|
let normalizedQuery = query;
|
|
357
364
|
if (typeof query !== "object" || query === null) {
|
|
358
365
|
normalizedQuery = { id: query };
|
|
@@ -366,13 +373,13 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
366
373
|
for (const field of colDef.fields) {
|
|
367
374
|
const snakeName = toSnakeCase(field.name);
|
|
368
375
|
if (field.type === "relationship" && "hasMany" in field && field.hasMany) {
|
|
369
|
-
const joinTableName = `${
|
|
376
|
+
const joinTableName = `${tableName}_${snakeName}_relations`.toLowerCase();
|
|
370
377
|
try {
|
|
371
378
|
await tx.deleteFrom(joinTableName).where("source_id", "=", current.id).execute();
|
|
372
379
|
} catch (e) {}
|
|
373
380
|
} else if (field.type === "blocks" && field.blocks) {
|
|
374
381
|
for (const b of field.blocks) {
|
|
375
|
-
const blockTableName = `${
|
|
382
|
+
const blockTableName = `${tableName}_${snakeName}_${b.slug}`.toLowerCase();
|
|
376
383
|
try {
|
|
377
384
|
await tx.deleteFrom(blockTableName).where("_parent_id", "=", current.id).execute();
|
|
378
385
|
} catch (e) {}
|
|
@@ -380,13 +387,14 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
380
387
|
}
|
|
381
388
|
}
|
|
382
389
|
}
|
|
383
|
-
await tx.deleteFrom(
|
|
390
|
+
await tx.deleteFrom(tableName).where("id", "=", current.id).execute();
|
|
384
391
|
});
|
|
385
392
|
return true;
|
|
386
393
|
}
|
|
387
394
|
async updateMany(collection, query, data) {
|
|
395
|
+
const tableName = toSnakeCase(collection);
|
|
388
396
|
return this._db.transaction().execute(async (tx) => {
|
|
389
|
-
let qb = tx.updateTable(
|
|
397
|
+
let qb = tx.updateTable(tableName);
|
|
390
398
|
if (query && Object.keys(query).length > 0) {
|
|
391
399
|
qb = qb.where((eb) => buildKyselyWhere(eb, query) || eb.val(true));
|
|
392
400
|
}
|
|
@@ -413,8 +421,9 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
413
421
|
});
|
|
414
422
|
}
|
|
415
423
|
async deleteMany(collection, query) {
|
|
424
|
+
const tableName = toSnakeCase(collection);
|
|
416
425
|
return this._db.transaction().execute(async (tx) => {
|
|
417
|
-
let selectQb = tx.selectFrom(
|
|
426
|
+
let selectQb = tx.selectFrom(tableName).select("id");
|
|
418
427
|
if (query && Object.keys(query).length > 0) {
|
|
419
428
|
selectQb = selectQb.where((eb) => buildKyselyWhere(eb, query) || eb.val(true));
|
|
420
429
|
}
|
|
@@ -427,13 +436,13 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
427
436
|
for (const field of colDef.fields) {
|
|
428
437
|
const snakeName = toSnakeCase(field.name);
|
|
429
438
|
if (field.type === "relationship" && "hasMany" in field && field.hasMany) {
|
|
430
|
-
const joinTableName = `${
|
|
439
|
+
const joinTableName = `${tableName}_${snakeName}_relations`.toLowerCase();
|
|
431
440
|
try {
|
|
432
441
|
await tx.deleteFrom(joinTableName).where("source_id", "in", ids).execute();
|
|
433
442
|
} catch (e) {}
|
|
434
443
|
} else if (field.type === "blocks" && field.blocks) {
|
|
435
444
|
for (const b of field.blocks) {
|
|
436
|
-
const blockTableName = `${
|
|
445
|
+
const blockTableName = `${tableName}_${snakeName}_${b.slug}`.toLowerCase();
|
|
437
446
|
try {
|
|
438
447
|
await tx.deleteFrom(blockTableName).where("_parent_id", "in", ids).execute();
|
|
439
448
|
} catch (e) {}
|
|
@@ -441,24 +450,38 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
441
450
|
}
|
|
442
451
|
}
|
|
443
452
|
}
|
|
444
|
-
const result = await tx.deleteFrom(
|
|
453
|
+
const result = await tx.deleteFrom(tableName).where("id", "in", ids).executeTakeFirst();
|
|
445
454
|
return Number(result.numDeletedRows || 0);
|
|
446
455
|
});
|
|
447
456
|
}
|
|
448
457
|
async findGlobal(slug) {
|
|
449
|
-
const
|
|
458
|
+
const tableName = toSnakeCase(slug);
|
|
459
|
+
const row = await this._db.selectFrom(tableName).selectAll().limit(1).executeTakeFirst();
|
|
450
460
|
return row ? unflattenRow(row) : null;
|
|
451
461
|
}
|
|
452
462
|
async updateGlobal(slug, data) {
|
|
463
|
+
const tableName = toSnakeCase(slug);
|
|
453
464
|
const existing = await this.findGlobal(slug);
|
|
454
465
|
const flatData = flattenPayload(data);
|
|
455
|
-
|
|
466
|
+
const globalDef = this._globals.find((g) => g.slug === slug);
|
|
467
|
+
const ts = globalDef?.timestamps !== false;
|
|
468
|
+
if (ts) {
|
|
469
|
+
const config = typeof globalDef?.timestamps === "object" ? globalDef.timestamps : {};
|
|
470
|
+
const updatedField = toSnakeCase(config.updatedAt || "updatedAt");
|
|
471
|
+
flatData[updatedField] = new Date().toISOString();
|
|
472
|
+
}
|
|
456
473
|
if (!existing) {
|
|
457
474
|
if (!flatData.id)
|
|
458
475
|
flatData.id = "global";
|
|
459
|
-
|
|
476
|
+
if (ts) {
|
|
477
|
+
const config = typeof globalDef?.timestamps === "object" ? globalDef.timestamps : {};
|
|
478
|
+
const createdField = toSnakeCase(config.createdAt || "createdAt");
|
|
479
|
+
if (!flatData[createdField])
|
|
480
|
+
flatData[createdField] = flatData[toSnakeCase(config.updatedAt || "updatedAt")];
|
|
481
|
+
}
|
|
482
|
+
await this._db.insertInto(tableName).values(flatData).execute();
|
|
460
483
|
} else {
|
|
461
|
-
await this._db.updateTable(
|
|
484
|
+
await this._db.updateTable(tableName).set(flatData).where("id", "=", existing.id).execute();
|
|
462
485
|
}
|
|
463
486
|
return this.findGlobal(slug);
|
|
464
487
|
}
|
|
@@ -485,6 +508,7 @@ class BetterSQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
485
508
|
}
|
|
486
509
|
async migrate(collections, globals = []) {
|
|
487
510
|
this._collections = collections;
|
|
511
|
+
this._globals = globals;
|
|
488
512
|
if (this.push) {
|
|
489
513
|
await pushSchema(this._db, "sqlite", collections, globals, {
|
|
490
514
|
pushDestructive: this.pushDestructive
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
mapFieldToPostgresType,
|
|
8
8
|
mapFieldToSQLiteType,
|
|
9
9
|
toSnakeCase
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2kyhqvhc.js";
|
|
11
11
|
import {
|
|
12
12
|
getSystemCollections,
|
|
13
13
|
init_system_schema
|
|
@@ -279,7 +279,7 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
|
|
|
279
279
|
}
|
|
280
280
|
await builder.execute();
|
|
281
281
|
if (versions) {
|
|
282
|
-
const versionsTable = `${
|
|
282
|
+
const versionsTable = `${tableName}_versions`.toLowerCase();
|
|
283
283
|
assertSafeIdentifier(versionsTable);
|
|
284
284
|
expectedTableNames.add(versionsTable);
|
|
285
285
|
if (!existingTableSet.has(versionsTable)) {
|
|
@@ -291,10 +291,10 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
|
|
|
291
291
|
let existingColumns = [];
|
|
292
292
|
try {
|
|
293
293
|
if (dialect === "postgres") {
|
|
294
|
-
const res = await sql`SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = ${
|
|
294
|
+
const res = await sql`SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = ${tableName}`.execute(db);
|
|
295
295
|
existingColumns = res.rows.map((r) => r.column_name);
|
|
296
296
|
} else {
|
|
297
|
-
const res = await sql`PRAGMA table_info(${sql.id(
|
|
297
|
+
const res = await sql`PRAGMA table_info(${sql.id(tableName)})`.execute(db);
|
|
298
298
|
existingColumns = res.rows.map((r) => r.name);
|
|
299
299
|
}
|
|
300
300
|
} catch (e) {
|
|
@@ -309,14 +309,14 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
|
|
|
309
309
|
continue;
|
|
310
310
|
assertSafeIdentifier(colName);
|
|
311
311
|
if (!existingColSet.has(colName)) {
|
|
312
|
-
logger.info(` -> Adding missing column: ${logger.format("green", `${
|
|
312
|
+
logger.info(` -> Adding missing column: ${logger.format("green", `${tableName}.${colName}`)}`);
|
|
313
313
|
const colType = mapType(field);
|
|
314
|
-
await db.schema.alterTable(
|
|
314
|
+
await db.schema.alterTable(tableName).addColumn(colName, colType).execute();
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
if (versions?.drafts && !existingColSet.has("_status")) {
|
|
318
|
-
logger.info(` -> Adding missing status column to: ${
|
|
319
|
-
await db.schema.alterTable(
|
|
318
|
+
logger.info(` -> Adding missing status column to: ${tableName}`);
|
|
319
|
+
await db.schema.alterTable(tableName).addColumn("_status", "text", (col) => col.defaultTo("draft")).execute();
|
|
320
320
|
}
|
|
321
321
|
if (hasTimestamps) {
|
|
322
322
|
const ts = collection.timestamps ?? {};
|
|
@@ -325,19 +325,19 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
|
|
|
325
325
|
const updatedField = toSnakeCase(config.updatedAt ?? "updatedAt");
|
|
326
326
|
const tsType = dialect === "postgres" ? "timestamp with time zone" : "text";
|
|
327
327
|
if (!existingColSet.has(createdField)) {
|
|
328
|
-
logger.info(` -> Adding missing timestamp column: ${
|
|
329
|
-
await db.schema.alterTable(
|
|
328
|
+
logger.info(` -> Adding missing timestamp column: ${tableName}.${createdField}`);
|
|
329
|
+
await db.schema.alterTable(tableName).addColumn(createdField, tsType, (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`)).execute();
|
|
330
330
|
}
|
|
331
331
|
if (!existingColSet.has(updatedField)) {
|
|
332
|
-
logger.info(` -> Adding missing timestamp column: ${
|
|
333
|
-
await db.schema.alterTable(
|
|
332
|
+
logger.info(` -> Adding missing timestamp column: ${tableName}.${updatedField}`);
|
|
333
|
+
await db.schema.alterTable(tableName).addColumn(updatedField, tsType, (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`)).execute();
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
if (versions) {
|
|
337
|
-
const versionsTable = `${
|
|
337
|
+
const versionsTable = `${tableName}_versions`.toLowerCase();
|
|
338
338
|
expectedTableNames.add(versionsTable);
|
|
339
339
|
if (!existingTableSet.has(versionsTable)) {
|
|
340
|
-
logger.info(` -> Creating missing versions table for: ${
|
|
340
|
+
logger.info(` -> Creating missing versions table for: ${tableName}`);
|
|
341
341
|
await db.schema.createTable(versionsTable).addColumn("id", "text", (col) => col.primaryKey()).addColumn("_parent_id", "text", (col) => col.notNull()).addColumn("_version_data", dialect === "postgres" ? "jsonb" : "text", (col) => col.notNull()).addColumn("_status", "text").addColumn("created_at", dialect === "postgres" ? "timestamp with time zone" : "text", (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`)).execute();
|
|
342
342
|
}
|
|
343
343
|
}
|
|
@@ -354,9 +354,9 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
|
|
|
354
354
|
expectedCols.add("id");
|
|
355
355
|
for (const existingCol of existingColumns) {
|
|
356
356
|
if (!expectedCols.has(existingCol)) {
|
|
357
|
-
logger.info(` -> Dropping stale column: ${logger.format("red", `${
|
|
357
|
+
logger.info(` -> Dropping stale column: ${logger.format("red", `${tableName}.${existingCol}`)}`);
|
|
358
358
|
try {
|
|
359
|
-
await db.schema.alterTable(
|
|
359
|
+
await db.schema.alterTable(tableName).dropColumn(existingCol).execute();
|
|
360
360
|
} catch (_) {
|
|
361
361
|
logger.warn(`Failed to drop column ${existingCol}.`);
|
|
362
362
|
}
|
|
@@ -369,7 +369,7 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
|
|
|
369
369
|
if (field.type === "relationship" && "hasMany" in field && field.hasMany) {
|
|
370
370
|
const sourceIdType = "text";
|
|
371
371
|
const colName = toSnakeCase(field.name);
|
|
372
|
-
const joinTableName = `${
|
|
372
|
+
const joinTableName = `${tableName}_${colName}_relations`.toLowerCase();
|
|
373
373
|
assertSafeIdentifier(joinTableName);
|
|
374
374
|
expectedTableNames.add(joinTableName);
|
|
375
375
|
if (!existingTableSet.has(joinTableName)) {
|
|
@@ -386,7 +386,7 @@ async function pushSchema(db, dialect, collections, globals = [], options = {})
|
|
|
386
386
|
const blockSlug = toSnakeCase(block.slug);
|
|
387
387
|
assertSafeIdentifier(blockName);
|
|
388
388
|
assertSafeIdentifier(blockSlug);
|
|
389
|
-
const blockTableName = `${
|
|
389
|
+
const blockTableName = `${tableName}_${blockName}_${blockSlug}`.toLowerCase();
|
|
390
390
|
assertSafeIdentifier(blockTableName);
|
|
391
391
|
expectedTableNames.add(blockTableName);
|
|
392
392
|
if (!existingTableSet.has(blockTableName)) {
|
package/dist/cli/index.js
CHANGED
|
@@ -101,7 +101,7 @@ Commands:`);
|
|
|
101
101
|
}
|
|
102
102
|
let configPath = values.config ? resolve(process.cwd(), values.config) : "";
|
|
103
103
|
if (!configPath) {
|
|
104
|
-
const defaults = ["opacacms.config.ts", "opacacms.config.js", "src/opacacms.config.ts", "src/opacacms.config.js", "
|
|
104
|
+
const defaults = ["opacacms.config.ts", "opacacms.config.js", "src/opacacms.config.ts", "src/opacacms.config.js", "opaca.config.ts", "opaca.config.js"];
|
|
105
105
|
for (const d of defaults) {
|
|
106
106
|
if (fs.existsSync(resolve(process.cwd(), d))) {
|
|
107
107
|
configPath = resolve(process.cwd(), d);
|
|
@@ -116,22 +116,22 @@ Commands:`);
|
|
|
116
116
|
const opaca = await loadConfig(configPath);
|
|
117
117
|
switch (command) {
|
|
118
118
|
case "migrate:create": {
|
|
119
|
-
const { migrateCreateCommand } = await import("../chunk-
|
|
119
|
+
const { migrateCreateCommand } = await import("../chunk-0am1m47g.js");
|
|
120
120
|
await migrateCreateCommand(opaca, positionals[1], values.out);
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
case "migrate": {
|
|
124
|
-
const { migrateRunCommand } = await import("../chunk-
|
|
124
|
+
const { migrateRunCommand } = await import("../chunk-0am1m47g.js");
|
|
125
125
|
await migrateRunCommand(opaca.db);
|
|
126
126
|
break;
|
|
127
127
|
}
|
|
128
128
|
case "migrate:status": {
|
|
129
|
-
const { migrateStatusCommand } = await import("../chunk-
|
|
129
|
+
const { migrateStatusCommand } = await import("../chunk-0am1m47g.js");
|
|
130
130
|
await migrateStatusCommand(opaca);
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
133
133
|
case "migrate:d1": {
|
|
134
|
-
const { migrateD1Command } = await import("../chunk-
|
|
134
|
+
const { migrateD1Command } = await import("../chunk-0am1m47g.js");
|
|
135
135
|
await migrateD1Command(values.out || "./migrations", !!values.remote, values.binding || "DB");
|
|
136
136
|
break;
|
|
137
137
|
}
|
package/dist/db/better-sqlite.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BetterSQLiteAdapter,
|
|
3
3
|
createBetterSQLiteAdapter
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import"../chunk-
|
|
4
|
+
} from "../chunk-x2ejaftz.js";
|
|
5
|
+
import"../chunk-xtwc125q.js";
|
|
6
6
|
import"../chunk-s8mqwnm1.js";
|
|
7
7
|
import"../chunk-62ev8gnc.js";
|
|
8
|
-
import"../chunk-
|
|
8
|
+
import"../chunk-2kyhqvhc.js";
|
|
9
9
|
import"../chunk-ybbbqj63.js";
|
|
10
10
|
import"../chunk-8sqjbsgt.js";
|
|
11
11
|
export {
|
package/dist/db/bun-sqlite.d.ts
CHANGED
package/dist/db/bun-sqlite.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BunSQLiteAdapter,
|
|
3
3
|
createBunSQLiteAdapter
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import"../chunk-
|
|
4
|
+
} from "../chunk-2z8wxx9g.js";
|
|
5
|
+
import"../chunk-xtwc125q.js";
|
|
6
6
|
import"../chunk-s8mqwnm1.js";
|
|
7
7
|
import"../chunk-62ev8gnc.js";
|
|
8
|
-
import"../chunk-
|
|
8
|
+
import"../chunk-2kyhqvhc.js";
|
|
9
9
|
import"../chunk-ybbbqj63.js";
|
|
10
10
|
import"../chunk-8sqjbsgt.js";
|
|
11
11
|
export {
|
package/dist/db/d1.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
D1Adapter,
|
|
3
3
|
createD1Adapter
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import"../chunk-
|
|
4
|
+
} from "../chunk-wq314kkx.js";
|
|
5
|
+
import"../chunk-xtwc125q.js";
|
|
6
6
|
import"../chunk-s8mqwnm1.js";
|
|
7
7
|
import"../chunk-62ev8gnc.js";
|
|
8
|
-
import"../chunk-
|
|
8
|
+
import"../chunk-2kyhqvhc.js";
|
|
9
9
|
import"../chunk-ybbbqj63.js";
|
|
10
10
|
import"../chunk-8sqjbsgt.js";
|
|
11
11
|
export {
|
package/dist/db/index.d.ts
CHANGED
package/dist/db/index.js
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BunSQLiteAdapter,
|
|
3
|
-
createBunSQLiteAdapter
|
|
4
|
-
} from "../chunk-gjjcc4hm.js";
|
|
5
|
-
import {
|
|
6
|
-
BetterSQLiteAdapter,
|
|
7
|
-
createBetterSQLiteAdapter
|
|
8
|
-
} from "../chunk-eqtsfyjf.js";
|
|
9
1
|
import {
|
|
10
2
|
D1Adapter,
|
|
11
3
|
createD1Adapter
|
|
12
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-wq314kkx.js";
|
|
13
5
|
import {
|
|
14
6
|
PostgresAdapter,
|
|
15
7
|
createPostgresAdapter
|
|
16
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-pxh5encs.js";
|
|
17
9
|
import {
|
|
18
10
|
SQLiteAdapter,
|
|
19
11
|
createSQLiteAdapter
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import
|
|
12
|
+
} from "../chunk-qkn1ykrj.js";
|
|
13
|
+
import {
|
|
14
|
+
BunSQLiteAdapter,
|
|
15
|
+
createBunSQLiteAdapter
|
|
16
|
+
} from "../chunk-2z8wxx9g.js";
|
|
17
|
+
import {
|
|
18
|
+
BetterSQLiteAdapter,
|
|
19
|
+
createBetterSQLiteAdapter
|
|
20
|
+
} from "../chunk-x2ejaftz.js";
|
|
21
|
+
import"../chunk-xtwc125q.js";
|
|
22
22
|
import {
|
|
23
23
|
BaseDatabaseAdapter
|
|
24
24
|
} from "../chunk-s8mqwnm1.js";
|
|
25
25
|
import"../chunk-62ev8gnc.js";
|
|
26
|
-
import"../chunk-
|
|
26
|
+
import"../chunk-2kyhqvhc.js";
|
|
27
27
|
import"../chunk-ybbbqj63.js";
|
|
28
28
|
import"../chunk-8sqjbsgt.js";
|
|
29
|
+
|
|
30
|
+
// src/db/index.ts
|
|
31
|
+
import { sql } from "kysely";
|
|
29
32
|
export {
|
|
33
|
+
sql,
|
|
30
34
|
createSQLiteAdapter,
|
|
31
35
|
createPostgresAdapter,
|
|
32
36
|
createD1Adapter,
|
package/dist/db/postgres.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresAdapter,
|
|
3
3
|
createPostgresAdapter
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import"../chunk-
|
|
4
|
+
} from "../chunk-pxh5encs.js";
|
|
5
|
+
import"../chunk-xtwc125q.js";
|
|
6
6
|
import"../chunk-s8mqwnm1.js";
|
|
7
7
|
import"../chunk-62ev8gnc.js";
|
|
8
|
-
import"../chunk-
|
|
8
|
+
import"../chunk-2kyhqvhc.js";
|
|
9
9
|
import"../chunk-ybbbqj63.js";
|
|
10
10
|
import"../chunk-8sqjbsgt.js";
|
|
11
11
|
export {
|
package/dist/db/sqlite.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SQLiteAdapter,
|
|
3
3
|
createSQLiteAdapter
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import"../chunk-
|
|
4
|
+
} from "../chunk-qkn1ykrj.js";
|
|
5
|
+
import"../chunk-xtwc125q.js";
|
|
6
6
|
import"../chunk-s8mqwnm1.js";
|
|
7
7
|
import"../chunk-62ev8gnc.js";
|
|
8
|
-
import"../chunk-
|
|
8
|
+
import"../chunk-2kyhqvhc.js";
|
|
9
9
|
import"../chunk-ybbbqj63.js";
|
|
10
10
|
import"../chunk-8sqjbsgt.js";
|
|
11
11
|
export {
|
package/dist/runtimes/bun.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAPIRouter
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-0d9aqz6z.js";
|
|
4
4
|
import"../chunk-dy5t83hr.js";
|
|
5
5
|
import"../chunk-62ev8gnc.js";
|
|
6
|
-
import"../chunk-
|
|
6
|
+
import"../chunk-2kyhqvhc.js";
|
|
7
7
|
import"../chunk-ybbbqj63.js";
|
|
8
8
|
import"../chunk-8sqjbsgt.js";
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAPIRouter
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-0d9aqz6z.js";
|
|
4
4
|
import"../chunk-dy5t83hr.js";
|
|
5
5
|
import"../chunk-62ev8gnc.js";
|
|
6
|
-
import"../chunk-
|
|
6
|
+
import"../chunk-2kyhqvhc.js";
|
|
7
7
|
import"../chunk-ybbbqj63.js";
|
|
8
8
|
import"../chunk-8sqjbsgt.js";
|
|
9
9
|
|
package/dist/runtimes/next.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAPIRouter
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-0d9aqz6z.js";
|
|
4
4
|
import"../chunk-dy5t83hr.js";
|
|
5
5
|
import"../chunk-62ev8gnc.js";
|
|
6
|
-
import"../chunk-
|
|
6
|
+
import"../chunk-2kyhqvhc.js";
|
|
7
7
|
import"../chunk-ybbbqj63.js";
|
|
8
8
|
import"../chunk-8sqjbsgt.js";
|
|
9
9
|
|
package/dist/runtimes/node.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAPIRouter
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-0d9aqz6z.js";
|
|
4
4
|
import"../chunk-dy5t83hr.js";
|
|
5
5
|
import"../chunk-62ev8gnc.js";
|
|
6
|
-
import"../chunk-
|
|
6
|
+
import"../chunk-2kyhqvhc.js";
|
|
7
7
|
import"../chunk-ybbbqj63.js";
|
|
8
8
|
import"../chunk-8sqjbsgt.js";
|
|
9
9
|
|
package/dist/server.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createGlobalHandlers,
|
|
5
5
|
createHandlers,
|
|
6
6
|
hydrateDoc
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-0d9aqz6z.js";
|
|
8
8
|
import {
|
|
9
9
|
defineConfig
|
|
10
10
|
} from "./chunk-zvwb67nd.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
BaseDatabaseAdapter
|
|
14
14
|
} from "./chunk-s8mqwnm1.js";
|
|
15
15
|
import"./chunk-62ev8gnc.js";
|
|
16
|
-
import"./chunk-
|
|
16
|
+
import"./chunk-2kyhqvhc.js";
|
|
17
17
|
import"./chunk-ybbbqj63.js";
|
|
18
18
|
import"./chunk-8sqjbsgt.js";
|
|
19
19
|
export {
|