@xyo-network/api 2.27.0-rc.3 → 2.27.0-rc.6
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/XyoRemoteArchivist.d.ts +1 -1
- package/dist/cjs/Archivist/XyoRemoteArchivist.d.ts.map +1 -1
- package/dist/cjs/Archivist/XyoRemoteArchivistConfig.d.ts +3 -1
- package/dist/cjs/Archivist/XyoRemoteArchivistConfig.d.ts.map +1 -1
- package/dist/cjs/Archivist/XyoRemoteArchivistConfig.js +2 -1
- package/dist/cjs/Archivist/XyoRemoteArchivistConfig.js.map +1 -1
- package/dist/docs.json +3245 -3162
- package/dist/esm/Archivist/XyoRemoteArchivist.d.ts +1 -1
- package/dist/esm/Archivist/XyoRemoteArchivist.d.ts.map +1 -1
- package/dist/esm/Archivist/XyoRemoteArchivistConfig.d.ts +3 -1
- package/dist/esm/Archivist/XyoRemoteArchivistConfig.d.ts.map +1 -1
- package/dist/esm/Archivist/XyoRemoteArchivistConfig.js +1 -0
- package/dist/esm/Archivist/XyoRemoteArchivistConfig.js.map +1 -1
- package/package.json +8 -8
- package/src/Archivist/Api.spec.ts +2 -1
- package/src/Archivist/Payload/Api.spec.ts +3 -2
- package/src/Archivist/XyoRemoteArchivistConfig.ts +4 -1
|
@@ -4,7 +4,7 @@ import { XyoRemoteArchivistConfig } from './XyoRemoteArchivistConfig';
|
|
|
4
4
|
/** @description Archivist Context that connects to a remote archivist using the API */
|
|
5
5
|
export declare class XyoRemoteArchivist extends XyoAbstractArchivist<XyoRemoteArchivistConfig> {
|
|
6
6
|
get api(): import("./Api").XyoArchivistApi;
|
|
7
|
-
get queries(): import("@xyo-network/archivist").XyoArchivistQueryPayloadSchema[];
|
|
7
|
+
get queries(): import("@xyo-network/archivist").XyoArchivistQueryPayloadSchema<never>[];
|
|
8
8
|
get archive(): string | undefined;
|
|
9
9
|
get(hashes: string[]): Promise<({
|
|
10
10
|
schema: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoRemoteArchivist.d.ts","sourceRoot":"","sources":["../../../src/Archivist/XyoRemoteArchivist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAsC,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEvH,OAAO,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAA;AAEpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAErE,uFAAuF;AACvF,qBAAa,kBAAmB,SAAQ,oBAAoB,CAAC,wBAAwB,CAAC;IACpF,IAAW,GAAG,oCAEb;IAED,IAAoB,OAAO,
|
|
1
|
+
{"version":3,"file":"XyoRemoteArchivist.d.ts","sourceRoot":"","sources":["../../../src/Archivist/XyoRemoteArchivist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAsC,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEvH,OAAO,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAA;AAEpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAErE,uFAAuF;AACvF,qBAAa,kBAAmB,SAAQ,oBAAoB,CAAC,wBAAwB,CAAC;IACpF,IAAW,GAAG,oCAEb;IAED,IAAoB,OAAO,6EAE1B;IAED,IAAW,OAAO,uBAEjB;IAEY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE;;;;;;IASpB,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE;;;;;;IAuB7B,IAAI,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;CAKjG"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { XyoArchivistConfig, XyoArchivistConfigWrapper } from '@xyo-network/archivist';
|
|
2
2
|
import { XyoPayload } from '@xyo-network/payload';
|
|
3
3
|
import { XyoArchivistApi } from './Api';
|
|
4
|
+
export declare type XyoRemoteArchivistConfigSchema = 'network.xyo.archivist.remote.config';
|
|
5
|
+
export declare const XyoRemoteArchivistConfigSchema = "network.xyo.archivist.remote.config";
|
|
4
6
|
export declare type XyoRemoteArchivistConfig<T extends XyoPayload = XyoPayload> = XyoArchivistConfig<{
|
|
5
|
-
schema:
|
|
7
|
+
schema: XyoRemoteArchivistConfigSchema;
|
|
6
8
|
api?: XyoArchivistApi;
|
|
7
9
|
archive?: string;
|
|
8
10
|
} & T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoRemoteArchivistConfig.d.ts","sourceRoot":"","sources":["../../../src/Archivist/XyoRemoteArchivistConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAEvC,oBAAY,wBAAwB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,kBAAkB,CAC1F;IACE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"XyoRemoteArchivistConfig.d.ts","sourceRoot":"","sources":["../../../src/Archivist/XyoRemoteArchivistConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAEvC,oBAAY,8BAA8B,GAAG,qCAAqC,CAAA;AAClF,eAAO,MAAM,8BAA8B,wCAAwC,CAAA;AAEnF,oBAAY,wBAAwB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,kBAAkB,CAC1F;IACE,MAAM,EAAE,8BAA8B,CAAA;IACtC,GAAG,CAAC,EAAE,eAAe,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,CAAC,CACN,CAAA;AAED,qBAAa,+BAA+B,CAC1C,CAAC,SAAS,UAAU,GAAG,UAAU,EACjC,CAAC,SAAS,wBAAwB,CAAC,CAAC,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC,CACnE,SAAQ,yBAAyB,CAAC,CAAC,CAAC;gBACxB,MAAM,CAAC,EAAE,CAAC;IAItB,IAAW,GAAG,gCAEb;IAED,IAAW,OAAO,uBAEjB;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { XyoArchivistConfigWrapper } from '@xyo-network/archivist';
|
|
2
|
+
export const XyoRemoteArchivistConfigSchema = 'network.xyo.archivist.remote.config';
|
|
2
3
|
export class XyoRemoteArchivistConfigWrapper extends XyoArchivistConfigWrapper {
|
|
3
4
|
constructor(config) {
|
|
4
5
|
super(config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoRemoteArchivistConfig.js","sourceRoot":"","sources":["../../../src/Archivist/XyoRemoteArchivistConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"XyoRemoteArchivistConfig.js","sourceRoot":"","sources":["../../../src/Archivist/XyoRemoteArchivistConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAMtF,MAAM,CAAC,MAAM,8BAA8B,GAAG,qCAAqC,CAAA;AAUnF,MAAM,OAAO,+BAGX,SAAQ,yBAA4B;IACpC,YAAY,MAAU;QACpB,KAAK,CAAC,MAAM,CAAC,CAAA;IACf,CAAC;IAED,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAA;IACzB,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO,CAAA;IAC7B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xylabs/sdk-js": "^2.6.7",
|
|
13
|
-
"@xyo-network/account": "^2.27.0-rc.
|
|
14
|
-
"@xyo-network/archivist": "^2.27.0-rc.
|
|
15
|
-
"@xyo-network/boundwitness": "^2.27.0-rc.
|
|
16
|
-
"@xyo-network/core": "^2.27.0-rc.
|
|
17
|
-
"@xyo-network/payload": "^2.27.0-rc.
|
|
18
|
-
"@xyo-network/schema-payload-plugin": "^2.27.0-rc.
|
|
19
|
-
"@xyo-network/typeof": "^2.27.0-rc.
|
|
13
|
+
"@xyo-network/account": "^2.27.0-rc.6",
|
|
14
|
+
"@xyo-network/archivist": "^2.27.0-rc.6",
|
|
15
|
+
"@xyo-network/boundwitness": "^2.27.0-rc.6",
|
|
16
|
+
"@xyo-network/core": "^2.27.0-rc.6",
|
|
17
|
+
"@xyo-network/payload": "^2.27.0-rc.6",
|
|
18
|
+
"@xyo-network/schema-payload-plugin": "^2.27.0-rc.6",
|
|
19
|
+
"@xyo-network/typeof": "^2.27.0-rc.6",
|
|
20
20
|
"axios": "^0.27.2",
|
|
21
21
|
"pako": "^2.0.4",
|
|
22
22
|
"tslib": "^2.4.0"
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"types": "dist/esm/index.d.ts",
|
|
63
|
-
"version": "2.27.0-rc.
|
|
63
|
+
"version": "2.27.0-rc.6",
|
|
64
64
|
"stableVersion": "2.26.19"
|
|
65
65
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { XyoAccount } from '@xyo-network/account'
|
|
2
2
|
import { XyoBoundWitness, XyoBoundWitnessBuilder } from '@xyo-network/boundwitness'
|
|
3
|
+
import { XyoQuerySchema } from '@xyo-network/payload'
|
|
3
4
|
|
|
4
5
|
import { XyoApiConfig, XyoApiError } from '../models'
|
|
5
6
|
import { testPayload } from '../Test'
|
|
@@ -198,7 +199,7 @@ describe.skip('XyoArchivistApi', () => {
|
|
|
198
199
|
const boundWitness = new XyoBoundWitnessBuilder().witness(XyoAccount.random()).build()
|
|
199
200
|
await api.archives.archive(archive).block.post([boundWitness])
|
|
200
201
|
const timestamp = Date.now() - 10000
|
|
201
|
-
const response = await api.archives.archive(archive).block.find({ order: 'asc', schema:
|
|
202
|
+
const response = await api.archives.archive(archive).block.find({ order: 'asc', schema: XyoQuerySchema, timestamp })
|
|
202
203
|
expect(response?.length).toBe(1)
|
|
203
204
|
const actual = response?.[0]
|
|
204
205
|
expect(actual?._timestamp).toBeTruthy()
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { XyoAccount } from '@xyo-network/account'
|
|
2
2
|
import { XyoBoundWitnessBuilder } from '@xyo-network/boundwitness'
|
|
3
|
+
import { XyoQuerySchema } from '@xyo-network/payload'
|
|
3
4
|
|
|
4
5
|
import { XyoApiConfig, XyoApiError } from '../../models'
|
|
5
6
|
import { XyoArchivistApi } from '../Api'
|
|
@@ -27,7 +28,7 @@ describe('XyoArchivistPayloadApi', () => {
|
|
|
27
28
|
const boundWitness = new XyoBoundWitnessBuilder().witness(XyoAccount.random()).build()
|
|
28
29
|
const blockResult = await api.archive(archive).block.post([boundWitness])
|
|
29
30
|
expect(blockResult?.length).toBe(1)
|
|
30
|
-
const response = await api.archive(archive).block.find({ order: 'asc', schema:
|
|
31
|
+
const response = await api.archive(archive).block.find({ order: 'asc', schema: XyoQuerySchema, timestamp })
|
|
31
32
|
expect(response?.length).toBe(1)
|
|
32
33
|
const actual = response?.[0]
|
|
33
34
|
expect(actual?._timestamp).toBeTruthy()
|
|
@@ -46,7 +47,7 @@ describe('XyoArchivistPayloadApi', () => {
|
|
|
46
47
|
const blockResult = await api.archive(archive).block.post([boundWitness])
|
|
47
48
|
expect(blockResult?.length).toBe(1)
|
|
48
49
|
const timestamp = getTimestampMinutesFromNow(1)
|
|
49
|
-
const response = await api.archive(archive).block.find({ order: 'desc', schema:
|
|
50
|
+
const response = await api.archive(archive).block.find({ order: 'desc', schema: XyoQuerySchema, timestamp })
|
|
50
51
|
expect(response?.length).toBe(1)
|
|
51
52
|
const actual = response?.[0]
|
|
52
53
|
expect(actual?._timestamp).toBeTruthy()
|
|
@@ -3,9 +3,12 @@ import { XyoPayload } from '@xyo-network/payload'
|
|
|
3
3
|
|
|
4
4
|
import { XyoArchivistApi } from './Api'
|
|
5
5
|
|
|
6
|
+
export type XyoRemoteArchivistConfigSchema = 'network.xyo.archivist.remote.config'
|
|
7
|
+
export const XyoRemoteArchivistConfigSchema = 'network.xyo.archivist.remote.config'
|
|
8
|
+
|
|
6
9
|
export type XyoRemoteArchivistConfig<T extends XyoPayload = XyoPayload> = XyoArchivistConfig<
|
|
7
10
|
{
|
|
8
|
-
schema:
|
|
11
|
+
schema: XyoRemoteArchivistConfigSchema
|
|
9
12
|
api?: XyoArchivistApi
|
|
10
13
|
archive?: string
|
|
11
14
|
} & T
|