@xyo-network/archivist 2.64.7 → 2.64.9
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/docs.json +12130 -11908
- package/package.json +17 -17
- package/src/spec/testArchivist.ts +8 -9
package/package.json
CHANGED
|
@@ -11,18 +11,18 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xylabs/assert": "^2.9.3",
|
|
13
13
|
"@xylabs/promise": "^2.9.3",
|
|
14
|
-
"@xyo-network/abstract-archivist": "^2.64.
|
|
15
|
-
"@xyo-network/account": "^2.64.
|
|
16
|
-
"@xyo-network/account-model": "^2.64.
|
|
17
|
-
"@xyo-network/archivist-model": "^2.64.
|
|
18
|
-
"@xyo-network/archivist-wrapper": "^2.64.
|
|
19
|
-
"@xyo-network/boundwitness-model": "^2.64.
|
|
20
|
-
"@xyo-network/core": "^2.64.
|
|
21
|
-
"@xyo-network/memory-archivist": "^2.64.
|
|
22
|
-
"@xyo-network/module": "^2.64.
|
|
23
|
-
"@xyo-network/payload-model": "^2.64.
|
|
24
|
-
"@xyo-network/payload-wrapper": "^2.64.
|
|
25
|
-
"@xyo-network/promise": "^2.64.
|
|
14
|
+
"@xyo-network/abstract-archivist": "^2.64.9",
|
|
15
|
+
"@xyo-network/account": "^2.64.9",
|
|
16
|
+
"@xyo-network/account-model": "^2.64.9",
|
|
17
|
+
"@xyo-network/archivist-model": "^2.64.9",
|
|
18
|
+
"@xyo-network/archivist-wrapper": "^2.64.9",
|
|
19
|
+
"@xyo-network/boundwitness-model": "^2.64.9",
|
|
20
|
+
"@xyo-network/core": "^2.64.9",
|
|
21
|
+
"@xyo-network/memory-archivist": "^2.64.9",
|
|
22
|
+
"@xyo-network/module": "^2.64.9",
|
|
23
|
+
"@xyo-network/payload-model": "^2.64.9",
|
|
24
|
+
"@xyo-network/payload-wrapper": "^2.64.9",
|
|
25
|
+
"@xyo-network/promise": "^2.64.9",
|
|
26
26
|
"js-cookie": "^3.0.5",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"store2": "^2.14.2"
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"@types/js-cookie": "^3.0.3",
|
|
32
32
|
"@types/lodash": "^4.14.195",
|
|
33
33
|
"@xylabs/delay": "^2.9.3",
|
|
34
|
-
"@xylabs/ts-scripts-yarn3": "^2.18.
|
|
35
|
-
"@xylabs/tsconfig": "^2.18.
|
|
36
|
-
"@xyo-network/boundwitness-wrapper": "^2.64.
|
|
37
|
-
"@xyo-network/plugins": "^2.64.
|
|
34
|
+
"@xylabs/ts-scripts-yarn3": "^2.18.7",
|
|
35
|
+
"@xylabs/tsconfig": "^2.18.7",
|
|
36
|
+
"@xyo-network/boundwitness-wrapper": "^2.64.9",
|
|
37
|
+
"@xyo-network/plugins": "^2.64.9",
|
|
38
38
|
"typescript": "^5.1.6"
|
|
39
39
|
},
|
|
40
40
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
},
|
|
72
72
|
"sideEffects": false,
|
|
73
73
|
"types": "dist/types/index.d.ts",
|
|
74
|
-
"version": "2.64.
|
|
74
|
+
"version": "2.64.9"
|
|
75
75
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { delay } from '@xylabs/delay'
|
|
6
6
|
import { ArchivistModule } from '@xyo-network/archivist-model'
|
|
7
|
-
import { ArchivistWrapper } from '@xyo-network/archivist-wrapper'
|
|
8
7
|
import { BoundWitnessWrapper } from '@xyo-network/boundwitness-wrapper'
|
|
9
8
|
import { PayloadHasher } from '@xyo-network/core'
|
|
10
9
|
import { Payload } from '@xyo-network/payload-model'
|
|
@@ -12,7 +11,7 @@ import { PayloadWrapper } from '@xyo-network/payload-wrapper'
|
|
|
12
11
|
import { IdSchema } from '@xyo-network/plugins'
|
|
13
12
|
import { Promisable } from '@xyo-network/promise'
|
|
14
13
|
|
|
15
|
-
export const testArchivistRoundTrip = (
|
|
14
|
+
export const testArchivistRoundTrip = (archivistPromise: Promisable<ArchivistModule>, name: string) => {
|
|
16
15
|
test(`Archivist RoundTrip [${name}]`, async () => {
|
|
17
16
|
const idPayload: Payload<{ salt: string }> = {
|
|
18
17
|
salt: Date.now().toString(),
|
|
@@ -20,14 +19,14 @@ export const testArchivistRoundTrip = (archivist: Promisable<ArchivistModule>, n
|
|
|
20
19
|
}
|
|
21
20
|
const payloadWrapper = PayloadWrapper.wrap(idPayload)
|
|
22
21
|
|
|
23
|
-
const
|
|
24
|
-
const insertResult = await
|
|
22
|
+
const archivist = await archivistPromise
|
|
23
|
+
const insertResult = await archivist.insert([idPayload])
|
|
25
24
|
const insertResultWrappers = insertResult.map((bw) => BoundWitnessWrapper.wrap(bw))
|
|
26
25
|
const insertResultPayload = insertResultWrappers.pop() as BoundWitnessWrapper
|
|
27
26
|
expect(insertResultPayload).toBeDefined()
|
|
28
27
|
|
|
29
28
|
expect(PayloadHasher.find(insertResultPayload.payloadHashes, await payloadWrapper.hashAsync())).toBeDefined()
|
|
30
|
-
const getResult = await
|
|
29
|
+
const getResult = await archivist.get([await payloadWrapper.hashAsync()])
|
|
31
30
|
expect(getResult).toBeDefined()
|
|
32
31
|
expect(getResult.length).toBe(1)
|
|
33
32
|
const gottenPayload = getResult[0]
|
|
@@ -44,13 +43,13 @@ export const testArchivistAll = (archivist: Promisable<ArchivistModule>, name: s
|
|
|
44
43
|
salt: Date.now().toString(),
|
|
45
44
|
schema: IdSchema,
|
|
46
45
|
}
|
|
47
|
-
const
|
|
46
|
+
const archivistModule = await archivist
|
|
48
47
|
for (let x = 0; x < 10; x++) {
|
|
49
|
-
await
|
|
48
|
+
await archivistModule.insert([idPayload])
|
|
50
49
|
await delay(10)
|
|
51
50
|
}
|
|
52
|
-
const getResult = await
|
|
51
|
+
const getResult = await archivistModule.all?.()
|
|
53
52
|
expect(getResult).toBeDefined()
|
|
54
|
-
expect(getResult
|
|
53
|
+
expect(getResult?.length).toBe(2)
|
|
55
54
|
})
|
|
56
55
|
}
|