cojson-storage-indexeddb 0.13.17 → 0.13.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/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# cojson-storage-indexeddb
|
|
2
2
|
|
|
3
|
+
## 0.13.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [9089252]
|
|
8
|
+
- Updated dependencies [b470f63]
|
|
9
|
+
- Updated dependencies [8b2df0e]
|
|
10
|
+
- Updated dependencies [66373ba]
|
|
11
|
+
- Updated dependencies [f24cad1]
|
|
12
|
+
- cojson@0.13.18
|
|
13
|
+
- cojson-storage@0.13.18
|
|
14
|
+
|
|
3
15
|
## 0.13.17
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LocalNode } from "cojson";
|
|
2
2
|
import { WasmCrypto } from "cojson/crypto/WasmCrypto";
|
|
3
3
|
import { expect, test } from "vitest";
|
|
4
4
|
import { IDBStorage } from "../index.js";
|
|
5
5
|
const Crypto = await WasmCrypto.create();
|
|
6
6
|
test("Should be able to initialize and load from empty DB", async () => {
|
|
7
7
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
8
|
-
const node = new LocalNode(
|
|
8
|
+
const node = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
9
9
|
node.syncManager.addPeer(await IDBStorage.asPeer({}));
|
|
10
10
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
11
11
|
expect(node.syncManager.peers.indexedDB).toBeDefined();
|
|
12
12
|
});
|
|
13
13
|
test("Should be able to sync data to database and then load that from a new node", async () => {
|
|
14
14
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
15
|
-
const node1 = new LocalNode(
|
|
15
|
+
const node1 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
16
16
|
node1.syncManager.addPeer(await IDBStorage.asPeer({ localNodeName: "node1" }));
|
|
17
17
|
const group = node1.createGroup();
|
|
18
18
|
const map = group.createMap();
|
|
19
19
|
map.set("hello", "world");
|
|
20
20
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
21
|
-
const node2 = new LocalNode(
|
|
21
|
+
const node2 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
22
22
|
node2.syncManager.addPeer(await IDBStorage.asPeer({ localNodeName: "node2" }));
|
|
23
23
|
const map2 = await node2.load(map.id);
|
|
24
24
|
if (map2 === "unavailable") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idbNode.test.js","sourceRoot":"","sources":["../../src/tests/idbNode.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"idbNode.test.js","sourceRoot":"","sources":["../../src/tests/idbNode.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;AAEzC,IAAI,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;IACrE,MAAM,WAAW,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;IAElD,MAAM,IAAI,GAAG,IAAI,SAAS,CACxB,WAAW,EACX,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,EACzD,MAAM,CACP,CAAC;IAEF,IAAI,CAAC,W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IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtC,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cojson-storage-indexeddb",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.18",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"cojson": "0.13.
|
|
10
|
-
"cojson-storage": "0.13.
|
|
9
|
+
"cojson": "0.13.18",
|
|
10
|
+
"cojson-storage": "0.13.18"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"typescript": "5.6.2",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LocalNode } from "cojson";
|
|
2
2
|
import { WasmCrypto } from "cojson/crypto/WasmCrypto";
|
|
3
3
|
import { expect, test } from "vitest";
|
|
4
4
|
import { IDBStorage } from "../index.js";
|
|
@@ -9,7 +9,7 @@ test("Should be able to initialize and load from empty DB", async () => {
|
|
|
9
9
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
10
10
|
|
|
11
11
|
const node = new LocalNode(
|
|
12
|
-
|
|
12
|
+
agentSecret,
|
|
13
13
|
Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)),
|
|
14
14
|
Crypto,
|
|
15
15
|
);
|
|
@@ -25,7 +25,7 @@ test("Should be able to sync data to database and then load that from a new node
|
|
|
25
25
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
26
26
|
|
|
27
27
|
const node1 = new LocalNode(
|
|
28
|
-
|
|
28
|
+
agentSecret,
|
|
29
29
|
Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)),
|
|
30
30
|
Crypto,
|
|
31
31
|
);
|
|
@@ -43,7 +43,7 @@ test("Should be able to sync data to database and then load that from a new node
|
|
|
43
43
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
44
44
|
|
|
45
45
|
const node2 = new LocalNode(
|
|
46
|
-
|
|
46
|
+
agentSecret,
|
|
47
47
|
Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)),
|
|
48
48
|
Crypto,
|
|
49
49
|
);
|