@xyo-network/archivist-cookie 2.85.8 → 2.86.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/package.json +11 -13
- package/src/spec/testArchivist.ts +0 -50
package/package.json
CHANGED
|
@@ -11,24 +11,22 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/assert": "^2.13.23",
|
|
14
|
-
"@xylabs/delay": "^2.13.23",
|
|
15
14
|
"@xylabs/lodash": "^2.13.23",
|
|
16
15
|
"@xylabs/promise": "^2.13.23",
|
|
17
|
-
"@xyo-network/archivist-abstract": "~2.
|
|
18
|
-
"@xyo-network/archivist-model": "~2.
|
|
19
|
-
"@xyo-network/boundwitness-model": "~2.
|
|
20
|
-
"@xyo-network/hash": "~2.
|
|
21
|
-
"@xyo-network/
|
|
22
|
-
"@xyo-network/
|
|
23
|
-
"@xyo-network/payload-
|
|
24
|
-
"@xyo-network/payload-wrapper": "~2.85.8",
|
|
16
|
+
"@xyo-network/archivist-abstract": "~2.86.1",
|
|
17
|
+
"@xyo-network/archivist-model": "~2.86.1",
|
|
18
|
+
"@xyo-network/boundwitness-model": "~2.86.1",
|
|
19
|
+
"@xyo-network/hash": "~2.86.1",
|
|
20
|
+
"@xyo-network/module-model": "~2.86.1",
|
|
21
|
+
"@xyo-network/payload-model": "~2.86.1",
|
|
22
|
+
"@xyo-network/payload-wrapper": "~2.86.1",
|
|
25
23
|
"js-cookie": "^3.0.5"
|
|
26
24
|
},
|
|
27
25
|
"devDependencies": {
|
|
28
26
|
"@types/js-cookie": "^3.0.6",
|
|
29
|
-
"@xylabs/ts-scripts-yarn3": "^3.2.
|
|
30
|
-
"@xylabs/tsconfig": "^3.2.
|
|
31
|
-
"@xyo-network/account": "~2.
|
|
27
|
+
"@xylabs/ts-scripts-yarn3": "^3.2.28",
|
|
28
|
+
"@xylabs/tsconfig": "^3.2.28",
|
|
29
|
+
"@xyo-network/account": "~2.86.1",
|
|
32
30
|
"typescript": "^5.3.3"
|
|
33
31
|
},
|
|
34
32
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -70,6 +68,6 @@
|
|
|
70
68
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
71
69
|
},
|
|
72
70
|
"sideEffects": false,
|
|
73
|
-
"version": "2.
|
|
71
|
+
"version": "2.86.1",
|
|
74
72
|
"type": "module"
|
|
75
73
|
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jest-environment jsdom
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { delay } from '@xylabs/delay'
|
|
6
|
-
import { Promisable } from '@xylabs/promise'
|
|
7
|
-
import { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
8
|
-
import { IdSchema } from '@xyo-network/id-payload-plugin'
|
|
9
|
-
import { Payload } from '@xyo-network/payload-model'
|
|
10
|
-
import { PayloadWrapper } from '@xyo-network/payload-wrapper'
|
|
11
|
-
|
|
12
|
-
export const testArchivistRoundTrip = (archivistPromise: Promisable<ArchivistInstance>, name: string) => {
|
|
13
|
-
test(`Archivist RoundTrip [${name}]`, async () => {
|
|
14
|
-
const idPayload: Payload<{ salt: string }> = {
|
|
15
|
-
salt: Date.now().toString(),
|
|
16
|
-
schema: IdSchema,
|
|
17
|
-
}
|
|
18
|
-
const payloadWrapper = PayloadWrapper.wrap(idPayload)
|
|
19
|
-
|
|
20
|
-
const archivist = await archivistPromise
|
|
21
|
-
const insertResult = await archivist.insert([idPayload])
|
|
22
|
-
expect(insertResult).toBeDefined()
|
|
23
|
-
|
|
24
|
-
const getResult = await archivist.get([await payloadWrapper.hashAsync()])
|
|
25
|
-
expect(getResult).toBeDefined()
|
|
26
|
-
expect(getResult.length).toBe(1)
|
|
27
|
-
const gottenPayload = getResult[0]
|
|
28
|
-
if (gottenPayload) {
|
|
29
|
-
const gottenPayloadWrapper = PayloadWrapper.wrap(gottenPayload)
|
|
30
|
-
expect(await gottenPayloadWrapper.hashAsync()).toBe(await payloadWrapper.hashAsync())
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const testArchivistAll = (archivist: Promisable<ArchivistInstance>, name: string) => {
|
|
36
|
-
test(`Archivist All [${name}]`, async () => {
|
|
37
|
-
const idPayload = {
|
|
38
|
-
salt: Date.now().toString(),
|
|
39
|
-
schema: IdSchema,
|
|
40
|
-
}
|
|
41
|
-
const archivistModule = await archivist
|
|
42
|
-
for (let x = 0; x < 10; x++) {
|
|
43
|
-
await archivistModule.insert([idPayload])
|
|
44
|
-
await delay(10)
|
|
45
|
-
}
|
|
46
|
-
const getResult = await archivistModule.all?.()
|
|
47
|
-
expect(getResult).toBeDefined()
|
|
48
|
-
expect(getResult?.length).toBe(2)
|
|
49
|
-
})
|
|
50
|
-
}
|