opacacms 0.3.17 → 0.3.18
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/webcomponent.js +14 -14
- package/dist/admin.css +1 -1
- package/dist/cli/core/seeding/auto-seed.d.ts +1 -1
- package/dist/config.d.ts +2 -6
- package/dist/db/adapter.d.ts +1 -1
- package/dist/db/better-sqlite.d.ts +1 -1
- package/dist/db/better-sqlite.js +5 -1
- package/dist/db/d1.d.ts +1 -1
- package/dist/db/kysely/plugins/draft-swapper.d.ts +2 -2
- package/dist/db/kysely/plugins/i18n-fallback.d.ts +2 -2
- package/dist/db/kysely/plugins/json-flattener.d.ts +2 -2
- package/dist/db/kysely/plugins/virtual-field-resolver.d.ts +2 -2
- package/dist/db/kysely/schema-builder.d.ts +1 -1
- package/dist/db/kysely/snapshot/snapshot-manager.d.ts +1 -1
- package/dist/db/sqlite.d.ts +1 -1
- package/dist/db/sqlite.js +5 -1
- package/dist/types.d.ts +3 -3
- package/package.json +1 -1
package/dist/db/sqlite.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare class SQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
32
32
|
findGlobal<T extends object>(slug: string): Promise<T | null>;
|
|
33
33
|
updateGlobal<T extends object>(slug: string, data: Partial<T>): Promise<T>;
|
|
34
34
|
runMigrations(): Promise<void>;
|
|
35
|
-
migrate(collections: Collection[], globals?: Global[]): Promise<void>;
|
|
35
|
+
migrate(collections: Collection[] | readonly Collection[], globals?: Global[] | readonly Global[]): Promise<void>;
|
|
36
36
|
}
|
|
37
37
|
export declare function createSQLiteAdapter(path: string, options?: {
|
|
38
38
|
push?: boolean;
|
package/dist/db/sqlite.js
CHANGED
|
@@ -62,7 +62,11 @@ class SQLiteAdapter extends BaseDatabaseAdapter {
|
|
|
62
62
|
if (this._db)
|
|
63
63
|
return;
|
|
64
64
|
const { createRequire } = await import("node:module");
|
|
65
|
-
const
|
|
65
|
+
const moduleUrl = typeof import.meta !== "undefined" ? import.meta.url : undefined;
|
|
66
|
+
if (!moduleUrl) {
|
|
67
|
+
throw new Error("Cannot use SQLiteAdapter in this environment: import.meta.url is undefined. If you are using Cloudflare Workers, please use D1Adapter instead.");
|
|
68
|
+
}
|
|
69
|
+
const require2 = createRequire(moduleUrl);
|
|
66
70
|
const Database = require2("better-sqlite3");
|
|
67
71
|
this._rawDb = new Database(this.path);
|
|
68
72
|
const { createOpacaKysely } = await import("../chunk-gzbz5jwy.js");
|
package/dist/types.d.ts
CHANGED
|
@@ -524,9 +524,9 @@ export interface OpacaConfig<Resource extends string = string> {
|
|
|
524
524
|
/** Configuration for the internal logger. */
|
|
525
525
|
logger?: OpacaLoggerConfig;
|
|
526
526
|
/** List of collections that define your content models. */
|
|
527
|
-
collections: Collection[];
|
|
527
|
+
collections: Collection[] | readonly Collection[];
|
|
528
528
|
/** List of global singletons for site-wide settings. */
|
|
529
|
-
globals?: Global[];
|
|
529
|
+
globals?: Global[] | readonly Global[];
|
|
530
530
|
/** Configuration for the Admin UI dashboard and layout. */
|
|
531
531
|
admin?: AdminConfig;
|
|
532
532
|
/** Configuration for the REST and GraphQL APIs. */
|
|
@@ -685,7 +685,7 @@ export interface DatabaseAdapter {
|
|
|
685
685
|
deleteMany?(collection: string, query: Record<string, unknown>): Promise<number>;
|
|
686
686
|
findGlobal?<T extends object>(slug: string): Promise<T | null>;
|
|
687
687
|
updateGlobal?<T extends object>(slug: string, data: Partial<T>): Promise<T>;
|
|
688
|
-
migrate(collections: Collection[], globals?: Global[]): Promise<void>;
|
|
688
|
+
migrate(collections: Collection[] | readonly Collection[], globals?: Global[] | readonly Global[]): Promise<void>;
|
|
689
689
|
/**
|
|
690
690
|
* Run file-based migrations from the migrations directory.
|
|
691
691
|
*/
|