cojson-storage-indexeddb 0.8.44 → 0.8.45
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,15 @@
|
|
|
1
1
|
# cojson-storage-indexeddb
|
|
2
2
|
|
|
3
|
+
## 0.8.45
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [6f0bd7f]
|
|
8
|
+
- Updated dependencies [fca6a0b]
|
|
9
|
+
- Updated dependencies [88d7d9a]
|
|
10
|
+
- cojson@0.8.45
|
|
11
|
+
- cojson-storage@0.8.45
|
|
12
|
+
|
|
3
13
|
## 0.8.44
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -6,23 +6,20 @@ 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
8
|
const node = new LocalNode(new ControlledAgent(agentSecret, Crypto), Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
9
|
-
node.syncManager.addPeer(await IDBStorage.asPeer({
|
|
10
|
-
console.log("yay!");
|
|
11
|
-
const _group = node.createGroup();
|
|
9
|
+
node.syncManager.addPeer(await IDBStorage.asPeer({}));
|
|
12
10
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
13
11
|
expect(node.syncManager.peers.indexedDB).toBeDefined();
|
|
14
12
|
});
|
|
15
13
|
test("Should be able to sync data to database and then load that from a new node", async () => {
|
|
16
14
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
17
15
|
const node1 = new LocalNode(new ControlledAgent(agentSecret, Crypto), Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
18
|
-
node1.syncManager.addPeer(await IDBStorage.asPeer({
|
|
19
|
-
console.log("yay!");
|
|
16
|
+
node1.syncManager.addPeer(await IDBStorage.asPeer({ localNodeName: "node1" }));
|
|
20
17
|
const group = node1.createGroup();
|
|
21
18
|
const map = group.createMap();
|
|
22
19
|
map.set("hello", "world");
|
|
23
20
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
24
21
|
const node2 = new LocalNode(new ControlledAgent(agentSecret, Crypto), Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
25
|
-
node2.syncManager.addPeer(await IDBStorage.asPeer({
|
|
22
|
+
node2.syncManager.addPeer(await IDBStorage.asPeer({ localNodeName: "node2" }));
|
|
26
23
|
const map2 = await node2.load(map.id);
|
|
27
24
|
if (map2 === "unavailable") {
|
|
28
25
|
throw new Error("Map is unavailable");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idbNode.test.js","sourceRoot":"","sources":["../../src/tests/idbNode.test.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC,CAAC,yBAAyB;AAEvD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAChE,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,IAAI,eAAe,CAAC,WAAW,EAAE,MAAM,CAAC,EACxC,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,EACzD,MAAM,CACP,CAAC;IAEF,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,EAAE,
|
|
1
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
|
|
6
6
|
"types": "src/index.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"cojson": "0.8.
|
|
10
|
-
"cojson-storage": "0.8.
|
|
9
|
+
"cojson": "0.8.45",
|
|
10
|
+
"cojson-storage": "0.8.45"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@vitest/browser": "^0.34.1",
|
|
@@ -15,11 +15,7 @@ test("Should be able to initialize and load from empty DB", async () => {
|
|
|
15
15
|
Crypto,
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
node.syncManager.addPeer(await IDBStorage.asPeer({
|
|
19
|
-
|
|
20
|
-
console.log("yay!");
|
|
21
|
-
|
|
22
|
-
const _group = node.createGroup();
|
|
18
|
+
node.syncManager.addPeer(await IDBStorage.asPeer({}));
|
|
23
19
|
|
|
24
20
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
25
21
|
|
|
@@ -36,11 +32,9 @@ test("Should be able to sync data to database and then load that from a new node
|
|
|
36
32
|
);
|
|
37
33
|
|
|
38
34
|
node1.syncManager.addPeer(
|
|
39
|
-
await IDBStorage.asPeer({
|
|
35
|
+
await IDBStorage.asPeer({ localNodeName: "node1" }),
|
|
40
36
|
);
|
|
41
37
|
|
|
42
|
-
console.log("yay!");
|
|
43
|
-
|
|
44
38
|
const group = node1.createGroup();
|
|
45
39
|
|
|
46
40
|
const map = group.createMap();
|
|
@@ -56,7 +50,7 @@ test("Should be able to sync data to database and then load that from a new node
|
|
|
56
50
|
);
|
|
57
51
|
|
|
58
52
|
node2.syncManager.addPeer(
|
|
59
|
-
await IDBStorage.asPeer({
|
|
53
|
+
await IDBStorage.asPeer({ localNodeName: "node2" }),
|
|
60
54
|
);
|
|
61
55
|
|
|
62
56
|
const map2 = await node2.load(map.id);
|