@ocap/indexdb-memory 1.29.0 → 1.29.2
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/lib/db/index.d.cts +2 -2
- package/lib/table/base.d.cts +4 -4
- package/package.json +16 -6
package/lib/db/index.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import LocalBaseIndexDB from "./base.cjs";
|
|
2
2
|
import { IIndexDB, IIndexTable, IndexTableTypeMap } from "@ocap/types";
|
|
3
3
|
import { md5 } from "@ocap/util/lib/md5";
|
|
4
|
-
import
|
|
4
|
+
import Loki from "lokijs";
|
|
5
5
|
|
|
6
6
|
//#region src/db/index.d.ts
|
|
7
7
|
declare class MemoryIndexDB extends LocalBaseIndexDB implements IIndexDB {
|
|
8
8
|
name: string;
|
|
9
9
|
version: string;
|
|
10
10
|
md5: typeof md5;
|
|
11
|
-
db:
|
|
11
|
+
db: Loki;
|
|
12
12
|
tx: IIndexTable<IndexTableTypeMap['tx']>;
|
|
13
13
|
account: IIndexTable<IndexTableTypeMap['account']>;
|
|
14
14
|
asset: IIndexTable<IndexTableTypeMap['asset']>;
|
package/lib/table/base.d.cts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { BaseIndex } from "@ocap/indexdb";
|
|
2
2
|
import { IIndexTable } from "@ocap/types";
|
|
3
|
-
import
|
|
3
|
+
import Loki from "lokijs";
|
|
4
4
|
|
|
5
5
|
//#region src/table/base.d.ts
|
|
6
6
|
type UniqueIndex = string | string[];
|
|
7
7
|
declare class MemoryIndex<T = unknown> extends BaseIndex<T> implements IIndexTable<T> {
|
|
8
|
-
collection:
|
|
8
|
+
collection: Loki.Collection<T & Record<string, unknown>>;
|
|
9
9
|
/**
|
|
10
10
|
* @param name table name
|
|
11
11
|
* @param uniqIndex primary key(s)
|
|
12
12
|
* @param db LokiJS database instance
|
|
13
13
|
*/
|
|
14
|
-
constructor(name: string, uniqIndex: UniqueIndex, db:
|
|
15
|
-
count(...args: Parameters<
|
|
14
|
+
constructor(name: string, uniqIndex: UniqueIndex, db: Loki);
|
|
15
|
+
count(...args: Parameters<Loki.Collection['count']>): number;
|
|
16
16
|
_insert(row: Record<string, unknown>): T & Record<string, unknown>;
|
|
17
17
|
_get(key: string | Record<string, unknown>): (T & Record<string, unknown>) | null;
|
|
18
18
|
_update(key: string | Record<string, unknown>, updates: Record<string, unknown>): T & Record<string, unknown>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/indexdb-memory",
|
|
3
3
|
"description": "OCAP indexdb adapter that uses memory as backend, just for test purpose",
|
|
4
|
-
"version": "1.29.
|
|
4
|
+
"version": "1.29.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
|
7
7
|
"bugs": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"
|
|
16
16
|
],
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@ocap/indexdb-test": "1.29.
|
|
18
|
+
"@ocap/indexdb-test": "1.29.2",
|
|
19
19
|
"@types/debug": "^4.1.12",
|
|
20
20
|
"@types/lodash": "^4.17.10",
|
|
21
21
|
"@types/lokijs": "^1.5.14",
|
|
@@ -39,6 +39,16 @@
|
|
|
39
39
|
"import": "./esm/main.mjs",
|
|
40
40
|
"default": "./lib/main.cjs"
|
|
41
41
|
},
|
|
42
|
+
"./lib/db": {
|
|
43
|
+
"types": "./esm/db/index.d.mts",
|
|
44
|
+
"import": "./esm/db/index.mjs",
|
|
45
|
+
"default": "./lib/db/index.cjs"
|
|
46
|
+
},
|
|
47
|
+
"./lib/db/*": {
|
|
48
|
+
"types": "./esm/db/*.d.mts",
|
|
49
|
+
"import": "./esm/db/*.mjs",
|
|
50
|
+
"default": "./lib/db/*.cjs"
|
|
51
|
+
},
|
|
42
52
|
"./lib/*.js": {
|
|
43
53
|
"types": "./esm/*.d.mts",
|
|
44
54
|
"import": "./esm/*.mjs",
|
|
@@ -68,10 +78,10 @@
|
|
|
68
78
|
},
|
|
69
79
|
"gitHead": "87990c8b5e215107fc587c1ced0d6b3e2cd2483e",
|
|
70
80
|
"dependencies": {
|
|
71
|
-
"@arcblock/did": "1.29.
|
|
72
|
-
"@ocap/indexdb": "1.29.
|
|
73
|
-
"@ocap/types": "1.29.
|
|
74
|
-
"@ocap/util": "1.29.
|
|
81
|
+
"@arcblock/did": "1.29.2",
|
|
82
|
+
"@ocap/indexdb": "1.29.2",
|
|
83
|
+
"@ocap/types": "1.29.2",
|
|
84
|
+
"@ocap/util": "1.29.2",
|
|
75
85
|
"debug": "^4.4.3",
|
|
76
86
|
"lodash": "^4.17.23",
|
|
77
87
|
"lokijs": "^1.5.12"
|