@xyo-network/api 2.33.13 → 2.33.15
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/cjs/Archivist/Node/Api.d.ts.map +1 -1
- package/dist/cjs/Archivist/Node/Api.js +1 -1
- package/dist/cjs/Archivist/Node/Api.js.map +1 -1
- package/dist/cjs/Archivist/XyoRemoteArchivist.d.ts +1 -1
- package/dist/docs.json +3520 -4597
- package/dist/esm/Archivist/Node/Api.d.ts.map +1 -1
- package/dist/esm/Archivist/Node/Api.js +2 -2
- package/dist/esm/Archivist/Node/Api.js.map +1 -1
- package/dist/esm/Archivist/XyoRemoteArchivist.d.ts +1 -1
- package/package.json +7 -7
- package/src/Archivist/Api.spec.ts +5 -5
- package/src/Archivist/Node/Api.spec.ts +2 -2
- package/src/Archivist/Node/Api.ts +2 -2
- package/src/Archivist/Payload/Api.spec.ts +3 -3
- package/src/Archivist/Payload/Schema/Api.spec.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Api.d.ts","sourceRoot":"","sources":["../../../../src/Archivist/Node/Api.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Api.d.ts","sourceRoot":"","sources":["../../../../src/Archivist/Node/Api.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAA;AAEpE,OAAO,EAAE,YAAY,EAAuB,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAc/C,qBAAa,mBAAmB,CAC9B,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,GAAG,eAAe,GAAG,eAAe,EAAE,EACnF,CAAC,SAAS,WAAW,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,CAC/D,SAAQ,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACzD;;;;OAIG;IACI,MAAM,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC;IAO3F;;;;;;OAMG;IACU,kBAAkB,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,SAAO,EAAE,aAAa,SAAM;;;IAmB5E;;;;;;OAMG;IACU,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,SAAO,EAAE,aAAa,SAAM;;;CAMjH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertEx, delay } from '@xylabs/sdk-js';
|
|
2
|
-
import {
|
|
2
|
+
import { BoundWitnessBuilder } from '@xyo-network/boundwitness';
|
|
3
3
|
import { XyoPayloadBuilder } from '@xyo-network/payload';
|
|
4
4
|
import { XyoApiSimple } from '../../Simple';
|
|
5
5
|
const getRequestStatuses = (results) => {
|
|
@@ -60,7 +60,7 @@ export class XyoArchivistNodeApi extends XyoApiSimple {
|
|
|
60
60
|
*/
|
|
61
61
|
async perform(data, schema, timeout = 5000, retryInterval = 100) {
|
|
62
62
|
const payload = new XyoPayloadBuilder({ schema }).fields(data).build();
|
|
63
|
-
const query = new
|
|
63
|
+
const query = new BoundWitnessBuilder({ inlinePayloads: true }).payload(payload).build();
|
|
64
64
|
const result = await this.performTransaction(query, timeout, retryInterval);
|
|
65
65
|
return result?.[0]?.[0];
|
|
66
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../../../src/Archivist/Node/Api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA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AED;;;;;;OAMG;IACI,KAAK,CAAC,OAAO,CAAgC,IAAO,EAAE,MAAc,EAAE,OAAO,GAAG,IAAI,EAAE,aAAa,GAAG,GAAG;QAC9G,MAAM,OAAO,GAAG,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAA;QACtE,MAAM,KAAK,GAAG,IAAI,mBAAmB,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAO,CAAA;QAC7F,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA;QAC3E,OAAO,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACzB,CAAC;CACF"}
|
|
@@ -5,7 +5,7 @@ import { XyoRemoteArchivistConfig } from './XyoRemoteArchivistConfig';
|
|
|
5
5
|
/** @description Archivist Context that connects to a remote archivist using the API */
|
|
6
6
|
export declare class XyoRemoteArchivist extends XyoArchivist<XyoRemoteArchivistConfig> {
|
|
7
7
|
get api(): import("./Api").XyoArchivistApi;
|
|
8
|
-
queries():
|
|
8
|
+
queries(): string[];
|
|
9
9
|
get archive(): string | undefined;
|
|
10
10
|
get(hashes: string[]): Promise<((import("@xyo-network/payload").SchemaFields & import("@xyo-network/payload").PayloadFields & {
|
|
11
11
|
schema: string;
|
package/package.json
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xylabs/sdk-js": "^2.6.7",
|
|
13
|
-
"@xyo-network/account": "^2.33.
|
|
14
|
-
"@xyo-network/archivist": "^2.33.
|
|
15
|
-
"@xyo-network/boundwitness": "^2.33.
|
|
16
|
-
"@xyo-network/core": "^2.33.
|
|
17
|
-
"@xyo-network/payload": "^2.33.
|
|
18
|
-
"@xyo-network/schema-payload-plugin": "^2.33.
|
|
13
|
+
"@xyo-network/account": "^2.33.15",
|
|
14
|
+
"@xyo-network/archivist": "^2.33.15",
|
|
15
|
+
"@xyo-network/boundwitness": "^2.33.15",
|
|
16
|
+
"@xyo-network/core": "^2.33.15",
|
|
17
|
+
"@xyo-network/payload": "^2.33.15",
|
|
18
|
+
"@xyo-network/schema-payload-plugin": "^2.33.15",
|
|
19
19
|
"axios": "^0.27.2",
|
|
20
20
|
"pako": "^2.0.4",
|
|
21
21
|
"tslib": "^2.4.0"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
},
|
|
58
58
|
"sideEffects": false,
|
|
59
59
|
"types": "dist/esm/index.d.ts",
|
|
60
|
-
"version": "2.33.
|
|
60
|
+
"version": "2.33.15"
|
|
61
61
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XyoAccount } from '@xyo-network/account'
|
|
2
|
-
import {
|
|
2
|
+
import { BoundWitnessBuilder, XyoBoundWitness } from '@xyo-network/boundwitness'
|
|
3
3
|
|
|
4
4
|
import { XyoApiConfig, XyoApiError } from '../models'
|
|
5
5
|
import { testPayload } from '../Test'
|
|
@@ -15,7 +15,7 @@ const configData: XyoApiConfig = {
|
|
|
15
15
|
|
|
16
16
|
describe('postBoundWitness', () => {
|
|
17
17
|
it.each([true, false])('posts a single bound witness', async (inlinePayloads) => {
|
|
18
|
-
const builder = new
|
|
18
|
+
const builder = new BoundWitnessBuilder({ inlinePayloads }).witness(XyoAccount.random()).payload(testPayload)
|
|
19
19
|
const api = new XyoArchivistApi(configData)
|
|
20
20
|
const boundWitness: XyoBoundWitness = builder.build()
|
|
21
21
|
try {
|
|
@@ -32,7 +32,7 @@ describe('postBoundWitness', () => {
|
|
|
32
32
|
|
|
33
33
|
describe('postBoundWitnesses', () => {
|
|
34
34
|
it.each([true, false])('posts multiple bound witnesses', async (inlinePayloads) => {
|
|
35
|
-
const builder = new
|
|
35
|
+
const builder = new BoundWitnessBuilder({ inlinePayloads }).witness(XyoAccount.random()).payload(testPayload)
|
|
36
36
|
const api = new XyoArchivistApi(configData)
|
|
37
37
|
const json = builder.build()
|
|
38
38
|
const boundWitnesses: XyoBoundWitness[] = [json, json]
|
|
@@ -172,7 +172,7 @@ describe.skip('XyoArchivistApi', () => {
|
|
|
172
172
|
let api = new XyoArchivistApi(configData)
|
|
173
173
|
try {
|
|
174
174
|
api = new XyoArchivistApi({ ...configData })
|
|
175
|
-
const boundWitness = new
|
|
175
|
+
const boundWitness = new BoundWitnessBuilder().witness(XyoAccount.random()).build()
|
|
176
176
|
await api.archives.archive().block.post([boundWitness])
|
|
177
177
|
const timestamp = Date.now() + 10000
|
|
178
178
|
// eslint-disable-next-line deprecation/deprecation
|
|
@@ -192,7 +192,7 @@ describe.skip('XyoArchivistApi', () => {
|
|
|
192
192
|
try {
|
|
193
193
|
const archive = await getNewArchive(api)
|
|
194
194
|
api = new XyoArchivistApi({ ...configData })
|
|
195
|
-
const boundWitness = new
|
|
195
|
+
const boundWitness = new BoundWitnessBuilder().witness(XyoAccount.random()).build()
|
|
196
196
|
await api.archives.archive(archive).block.post([boundWitness])
|
|
197
197
|
const timestamp = Date.now() - 10000
|
|
198
198
|
const response = await api.archives.archive(archive).block.find({ order: 'asc', timestamp })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertEx, delay } from '@xylabs/sdk-js'
|
|
2
|
-
import {
|
|
2
|
+
import { BoundWitnessBuilder, XyoBoundWitness } from '@xyo-network/boundwitness'
|
|
3
3
|
import { uuid } from '@xyo-network/core'
|
|
4
4
|
import { XyoPayload, XyoPayloadBuilder } from '@xyo-network/payload'
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ const getQuery = (count = 1): XyoBoundWitness => {
|
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
19
|
payloads.push(new XyoPayloadBuilder({ schema }).fields({ nonce: uuid() } as any).build())
|
|
20
20
|
}
|
|
21
|
-
return new
|
|
21
|
+
return new BoundWitnessBuilder({ inlinePayloads: true }).payloads(payloads).build()
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const issueQuery = async (query: XyoBoundWitness = getQuery()): Promise<string> => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertEx, delay } from '@xylabs/sdk-js'
|
|
2
|
-
import {
|
|
2
|
+
import { BoundWitnessBuilder, XyoBoundWitness } from '@xyo-network/boundwitness'
|
|
3
3
|
import { XyoPayload, XyoPayloadBuilder } from '@xyo-network/payload'
|
|
4
4
|
|
|
5
5
|
import { XyoApiConfig, XyoApiResponseTuple } from '../../models'
|
|
@@ -69,7 +69,7 @@ export class XyoArchivistNodeApi<
|
|
|
69
69
|
*/
|
|
70
70
|
public async perform<T extends Partial<XyoPayload>>(data: T, schema: string, timeout = 5000, retryInterval = 100) {
|
|
71
71
|
const payload = new XyoPayloadBuilder({ schema }).fields(data).build()
|
|
72
|
-
const query = new
|
|
72
|
+
const query = new BoundWitnessBuilder({ inlinePayloads: true }).payload(payload).build() as D
|
|
73
73
|
const result = await this.performTransaction(query, timeout, retryInterval)
|
|
74
74
|
return result?.[0]?.[0]
|
|
75
75
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XyoAccount } from '@xyo-network/account'
|
|
2
|
-
import {
|
|
2
|
+
import { BoundWitnessBuilder } from '@xyo-network/boundwitness'
|
|
3
3
|
|
|
4
4
|
import { XyoApiConfig, XyoApiError } from '../../models'
|
|
5
5
|
import { XyoArchivistApi } from '../Api'
|
|
@@ -24,7 +24,7 @@ describe('XyoArchivistPayloadApi', () => {
|
|
|
24
24
|
it('returns payloads greater than or equal to timestamp', async () => {
|
|
25
25
|
try {
|
|
26
26
|
const timestamp = getTimestampMinutesFromNow(-1)
|
|
27
|
-
const boundWitness = new
|
|
27
|
+
const boundWitness = new BoundWitnessBuilder().witness(XyoAccount.random()).build()
|
|
28
28
|
const blockResult = await api.archive(archive).block.post([boundWitness])
|
|
29
29
|
expect(blockResult?.length).toBe(1)
|
|
30
30
|
const response = await api.archive(archive).block.find({ order: 'asc', timestamp })
|
|
@@ -39,7 +39,7 @@ describe('XyoArchivistPayloadApi', () => {
|
|
|
39
39
|
describe('when order is descending', () => {
|
|
40
40
|
it('returns payloads less than or equal to timestamp', async () => {
|
|
41
41
|
try {
|
|
42
|
-
const boundWitness = new
|
|
42
|
+
const boundWitness = new BoundWitnessBuilder().witness(XyoAccount.random()).build()
|
|
43
43
|
const blockResult = await api.archive(archive).block.post([boundWitness])
|
|
44
44
|
expect(blockResult?.length).toBe(1)
|
|
45
45
|
const timestamp = getTimestampMinutesFromNow(1)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XyoAccount } from '@xyo-network/account'
|
|
2
|
-
import {
|
|
2
|
+
import { BoundWitnessBuilder } from '@xyo-network/boundwitness'
|
|
3
3
|
import { XyoSchemaPayload, XyoSchemaSchema } from '@xyo-network/schema-payload-plugin'
|
|
4
4
|
|
|
5
5
|
import { XyoApiConfig } from '../../../models'
|
|
@@ -24,7 +24,7 @@ describe('XyoArchivistArchiveSchemaApi', () => {
|
|
|
24
24
|
let archive = ''
|
|
25
25
|
beforeAll(async () => {
|
|
26
26
|
archive = await getNewArchive(api)
|
|
27
|
-
const boundWitness = new
|
|
27
|
+
const boundWitness = new BoundWitnessBuilder({ inlinePayloads: true }).witness(XyoAccount.random()).payload(payload).build()
|
|
28
28
|
await api.archives.archive(archive).block.post([boundWitness])
|
|
29
29
|
})
|
|
30
30
|
describe('get', () => {
|