@wxn0brp/db-storage-web 0.110.1 → 0.120.1
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.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/indexed.d.ts +1 -0
- package/dist/indexed.js +2 -0
- package/dist/storage.d.ts +1 -0
- package/dist/storage.js +2 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +3 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ValtheraClass } from "@wxn0brp/db-core";
|
|
2
|
-
import { Data } from "@wxn0brp/db-core/types/data";
|
|
3
2
|
import { Collection } from "@wxn0brp/db-core/helpers/collection";
|
|
4
|
-
|
|
3
|
+
import { Data } from "@wxn0brp/db-core/types/data";
|
|
5
4
|
export * from "./indexed.js";
|
|
5
|
+
export * from "./storage.js";
|
|
6
6
|
export declare function createWebStorageValthera<T extends Record<string, Data[]>>(name: string, data?: T, storage?: Storage): ValtheraClass & {
|
|
7
7
|
[K in keyof T]: Collection<T[K][number]>;
|
|
8
8
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WebStorageActions } from "./storage.js";
|
|
1
|
+
import { forgeTypedValthera, ValtheraClass } from "@wxn0brp/db-core";
|
|
3
2
|
import { IndexedDBActions } from "./indexed.js";
|
|
4
|
-
|
|
3
|
+
import { WebStorageActions } from "./storage.js";
|
|
5
4
|
export * from "./indexed.js";
|
|
5
|
+
export * from "./storage.js";
|
|
6
6
|
export function createWebStorageValthera(name, data, storage = localStorage) {
|
|
7
7
|
const db = new ValtheraClass({
|
|
8
|
-
|
|
8
|
+
adapter: new WebStorageActions(name, storage),
|
|
9
9
|
});
|
|
10
10
|
if (!data)
|
|
11
|
-
return
|
|
11
|
+
return forgeTypedValthera(db);
|
|
12
12
|
for (const collection of Object.keys(data)) {
|
|
13
13
|
db.adapter._write(collection, data[collection]);
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return forgeTypedValthera(db);
|
|
16
16
|
}
|
|
17
17
|
export function createIndexedDBValthera(name) {
|
|
18
18
|
const db = new ValtheraClass({
|
|
19
19
|
adapter: new IndexedDBActions(name),
|
|
20
20
|
});
|
|
21
|
-
return
|
|
21
|
+
return forgeTypedValthera(db);
|
|
22
22
|
}
|
package/dist/indexed.d.ts
CHANGED
package/dist/indexed.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ActionsBase } from "@wxn0brp/db-core/base/actions";
|
|
2
2
|
import { addId } from "@wxn0brp/db-core/helpers/addId";
|
|
3
3
|
import { findObj, matchObj, updateObj } from "@wxn0brp/db-core/utils/process";
|
|
4
|
+
import { version } from "./version.js";
|
|
4
5
|
export class IndexedDBActions extends ActionsBase {
|
|
5
6
|
name;
|
|
6
7
|
db = null;
|
|
7
8
|
_version = 1;
|
|
8
9
|
_inited = false;
|
|
10
|
+
version = version;
|
|
9
11
|
constructor(name) {
|
|
10
12
|
super();
|
|
11
13
|
this.name = name;
|
package/dist/storage.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { CustomActionsBase } from "@wxn0brp/db-core/base/custom";
|
|
|
2
2
|
export declare class WebStorageActions extends CustomActionsBase {
|
|
3
3
|
name: string;
|
|
4
4
|
_storage: Storage;
|
|
5
|
+
version: string;
|
|
5
6
|
constructor(name: string, _storage?: Storage);
|
|
6
7
|
_getPath(collection: string): string;
|
|
7
8
|
_read(collection: string): any;
|
package/dist/storage.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { CustomFileCpu } from "@wxn0brp/db-core";
|
|
2
2
|
import { CustomActionsBase } from "@wxn0brp/db-core/base/custom";
|
|
3
|
+
import { version } from "./version.js";
|
|
3
4
|
export class WebStorageActions extends CustomActionsBase {
|
|
4
5
|
name;
|
|
5
6
|
_storage;
|
|
7
|
+
version = version;
|
|
6
8
|
constructor(name, _storage = localStorage) {
|
|
7
9
|
super();
|
|
8
10
|
this.name = name;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version = "0.120.1";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const version = "0.120.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wxn0brp/db-storage-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.120.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": "wxn0brP",
|
|
@@ -17,12 +17,11 @@
|
|
|
17
17
|
"valtheradb",
|
|
18
18
|
"vdb-adapter"
|
|
19
19
|
],
|
|
20
|
-
"
|
|
21
|
-
"@wxn0brp/db-core": "^0.
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@wxn0brp/db-core": "^0.12.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@wxn0brp/biome": "*",
|
|
25
|
-
"@wxn0brp/db-core": "^0.11.5",
|
|
26
25
|
"tsc-alias": "^1",
|
|
27
26
|
"typescript": "^7"
|
|
28
27
|
},
|