@xyo-network/payload 2.22.18 → 2.22.21
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/Huri/Huri.d.ts +6 -1
- package/dist/cjs/Wrapper/Wrapper.d.ts +6 -1
- package/dist/cjs/isXyoPayloadOfSchemaType.d.ts +6 -1
- package/dist/cjs/models/Base.d.ts +8 -2
- package/dist/cjs/models/Meta.d.ts +5 -6
- package/dist/docs.json +8857 -2
- package/dist/esm/Huri/Huri.d.ts +6 -1
- package/dist/esm/Wrapper/Wrapper.d.ts +6 -1
- package/dist/esm/isXyoPayloadOfSchemaType.d.ts +6 -1
- package/dist/esm/models/Base.d.ts +8 -2
- package/dist/esm/models/Meta.d.ts +5 -6
- package/package.json +4 -3
- package/src/models/Base.ts +9 -2
- package/src/models/Meta.ts +5 -6
package/dist/esm/Huri/Huri.d.ts
CHANGED
|
@@ -21,7 +21,12 @@ export declare class Huri {
|
|
|
21
21
|
private validateParse;
|
|
22
22
|
get href(): string;
|
|
23
23
|
toString(): string;
|
|
24
|
-
fetch(): Promise<
|
|
24
|
+
fetch(): Promise<{
|
|
25
|
+
schema: string;
|
|
26
|
+
previousHash?: string | undefined;
|
|
27
|
+
sources?: string[] | undefined;
|
|
28
|
+
timestamp?: number | undefined;
|
|
29
|
+
} | undefined>;
|
|
25
30
|
static fetch(huri: Huri): Promise<XyoPayload | undefined>;
|
|
26
31
|
private static parseProtocol;
|
|
27
32
|
private static parsePath;
|
|
@@ -5,5 +5,10 @@ export declare class XyoPayloadWrapper<T extends XyoPayload> extends XyoHasher<T
|
|
|
5
5
|
get payload(): T;
|
|
6
6
|
get body(): T;
|
|
7
7
|
get meta(): T;
|
|
8
|
-
static load(address: XyoDataLike | Huri): Promise<XyoPayloadWrapper<
|
|
8
|
+
static load(address: XyoDataLike | Huri): Promise<XyoPayloadWrapper<{
|
|
9
|
+
schema: string;
|
|
10
|
+
previousHash?: string | undefined;
|
|
11
|
+
sources?: string[] | undefined;
|
|
12
|
+
timestamp?: number | undefined;
|
|
13
|
+
}> | undefined>;
|
|
9
14
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { XyoPayload } from './models';
|
|
2
2
|
import { XyoSchemaPayload } from './Schema';
|
|
3
|
-
export declare const isXyoPayloadOfSchemaType: <T extends
|
|
3
|
+
export declare const isXyoPayloadOfSchemaType: <T extends {
|
|
4
|
+
schema: string;
|
|
5
|
+
previousHash?: string | undefined;
|
|
6
|
+
sources?: string[] | undefined;
|
|
7
|
+
timestamp?: number | undefined;
|
|
8
|
+
}>(schema: string) => (x: XyoPayload) => x is T;
|
|
4
9
|
export declare const isXyoSchemaPayload: (x: XyoPayload) => x is XyoSchemaPayload;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { EmptyObject } from '@xyo-network/core';
|
|
2
|
+
export declare type WithTimestamp<T> = T & {
|
|
3
|
+
timestamp: number;
|
|
4
|
+
};
|
|
5
|
+
export declare type XyoPayload<T extends EmptyObject = EmptyObject> = {
|
|
2
6
|
schema: string;
|
|
3
7
|
previousHash?: string;
|
|
4
8
|
sources?: string[];
|
|
5
9
|
timestamp?: number;
|
|
6
|
-
}
|
|
10
|
+
} & T;
|
|
11
|
+
/** @deprecated use XyoPayload instead */
|
|
12
|
+
export declare type XyoPayloadBase<T extends EmptyObject = EmptyObject> = XyoPayload<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmptyObject } from '@xyo-network/core';
|
|
2
|
-
import {
|
|
2
|
+
import { XyoPayload } from './Base';
|
|
3
3
|
export interface XyoPayloadMetaBase {
|
|
4
4
|
_hash: string;
|
|
5
5
|
_observeDuration?: number;
|
|
@@ -14,12 +14,11 @@ export interface XyoPayloadMetaBase {
|
|
|
14
14
|
export interface XyoQueryPayloadMetaBase extends XyoPayloadMetaBase {
|
|
15
15
|
_queryId: string;
|
|
16
16
|
}
|
|
17
|
-
export declare type XyoPayload<T extends EmptyObject = EmptyObject> = T & XyoPayloadBase;
|
|
18
17
|
export declare type XyoPayloadMeta<T extends EmptyObject = EmptyObject> = T & XyoPayloadMetaBase;
|
|
19
18
|
export declare type XyoPartialPayloadMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoPayloadMetaBase>;
|
|
20
|
-
export declare type XyoPayloadWithMeta<T extends EmptyObject = EmptyObject> = T & XyoPayloadMetaBase &
|
|
21
|
-
export declare type XyoPayloadWithPartialMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoPayloadMetaBase> &
|
|
19
|
+
export declare type XyoPayloadWithMeta<T extends EmptyObject = EmptyObject> = T & XyoPayloadMetaBase & XyoPayload;
|
|
20
|
+
export declare type XyoPayloadWithPartialMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoPayloadMetaBase> & XyoPayload;
|
|
22
21
|
export declare type XyoQueryPayloadMeta<T extends EmptyObject = EmptyObject> = T & XyoQueryPayloadMetaBase;
|
|
23
22
|
export declare type XyoQueryPartialPayloadMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoQueryPayloadMetaBase>;
|
|
24
|
-
export declare type XyoQueryPayloadWithMeta<T extends EmptyObject = EmptyObject> = T & XyoQueryPayloadMetaBase &
|
|
25
|
-
export declare type XyoQueryPayloadWithPartialMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoQueryPayloadMetaBase> &
|
|
23
|
+
export declare type XyoQueryPayloadWithMeta<T extends EmptyObject = EmptyObject> = T & XyoQueryPayloadMetaBase & XyoPayload;
|
|
24
|
+
export declare type XyoQueryPayloadWithPartialMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoQueryPayloadMetaBase> & XyoPayload;
|
package/package.json
CHANGED
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/sdk-js": "^2.6.2",
|
|
14
|
-
"@xyo-network/account": "^2.22.
|
|
15
|
-
"@xyo-network/core": "^2.22.
|
|
14
|
+
"@xyo-network/account": "^2.22.21",
|
|
15
|
+
"@xyo-network/core": "^2.22.21",
|
|
16
16
|
"axios": "^0.27.2"
|
|
17
17
|
},
|
|
18
18
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
19
19
|
"devDependencies": {
|
|
20
|
+
"@xylabs/tsconfig": "^2.5.6",
|
|
20
21
|
"tslib": "^2.4.0"
|
|
21
22
|
},
|
|
22
23
|
"browser": "dist/esm/index.js",
|
|
@@ -51,6 +52,6 @@
|
|
|
51
52
|
},
|
|
52
53
|
"sideEffects": false,
|
|
53
54
|
"types": "dist/esm/index.d.ts",
|
|
54
|
-
"version": "2.22.
|
|
55
|
+
"version": "2.22.21",
|
|
55
56
|
"packageManager": "yarn@3.1.1"
|
|
56
57
|
}
|
package/src/models/Base.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { EmptyObject } from '@xyo-network/core'
|
|
2
|
+
|
|
3
|
+
export type WithTimestamp<T> = T & { timestamp: number }
|
|
4
|
+
|
|
5
|
+
export type XyoPayload<T extends EmptyObject = EmptyObject> = {
|
|
2
6
|
schema: string
|
|
3
7
|
previousHash?: string
|
|
4
8
|
sources?: string[]
|
|
5
9
|
timestamp?: number
|
|
6
|
-
}
|
|
10
|
+
} & T
|
|
11
|
+
|
|
12
|
+
/** @deprecated use XyoPayload instead */
|
|
13
|
+
export type XyoPayloadBase<T extends EmptyObject = EmptyObject> = XyoPayload<T>
|
package/src/models/Meta.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmptyObject } from '@xyo-network/core'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { XyoPayload } from './Base'
|
|
4
4
|
|
|
5
5
|
export interface XyoPayloadMetaBase {
|
|
6
6
|
_hash: string
|
|
@@ -17,14 +17,13 @@ export interface XyoPayloadMetaBase {
|
|
|
17
17
|
export interface XyoQueryPayloadMetaBase extends XyoPayloadMetaBase {
|
|
18
18
|
_queryId: string
|
|
19
19
|
}
|
|
20
|
-
export type XyoPayload<T extends EmptyObject = EmptyObject> = T & XyoPayloadBase
|
|
21
20
|
|
|
22
21
|
export type XyoPayloadMeta<T extends EmptyObject = EmptyObject> = T & XyoPayloadMetaBase
|
|
23
22
|
export type XyoPartialPayloadMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoPayloadMetaBase>
|
|
24
|
-
export type XyoPayloadWithMeta<T extends EmptyObject = EmptyObject> = T & XyoPayloadMetaBase &
|
|
25
|
-
export type XyoPayloadWithPartialMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoPayloadMetaBase> &
|
|
23
|
+
export type XyoPayloadWithMeta<T extends EmptyObject = EmptyObject> = T & XyoPayloadMetaBase & XyoPayload
|
|
24
|
+
export type XyoPayloadWithPartialMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoPayloadMetaBase> & XyoPayload
|
|
26
25
|
|
|
27
26
|
export type XyoQueryPayloadMeta<T extends EmptyObject = EmptyObject> = T & XyoQueryPayloadMetaBase
|
|
28
27
|
export type XyoQueryPartialPayloadMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoQueryPayloadMetaBase>
|
|
29
|
-
export type XyoQueryPayloadWithMeta<T extends EmptyObject = EmptyObject> = T & XyoQueryPayloadMetaBase &
|
|
30
|
-
export type XyoQueryPayloadWithPartialMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoQueryPayloadMetaBase> &
|
|
28
|
+
export type XyoQueryPayloadWithMeta<T extends EmptyObject = EmptyObject> = T & XyoQueryPayloadMetaBase & XyoPayload
|
|
29
|
+
export type XyoQueryPayloadWithPartialMeta<T extends EmptyObject = EmptyObject> = T & Partial<XyoQueryPayloadMetaBase> & XyoPayload
|