@xyo-network/huri 4.0.2 → 4.1.0

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.
@@ -0,0 +1,32 @@
1
+ import type { Address, Hash } from '@xylabs/hex';
2
+ import type { Payload } from '@xyo-network/payload-model';
3
+ export type ObjectCategory = 'block' | 'payload';
4
+ export type HuriFetchFunction = (huri: Huri) => Promise<Payload | undefined>;
5
+ export interface HuriOptions {
6
+ archivistUri?: string;
7
+ token?: string;
8
+ }
9
+ export interface FetchedPayload<T extends Payload = Payload> {
10
+ huri?: Huri;
11
+ payload: T;
12
+ }
13
+ export declare class Huri<T extends Payload = Payload> {
14
+ archive?: string;
15
+ archivist?: Address | string;
16
+ hash: Hash;
17
+ originalHref: string;
18
+ protocol?: string;
19
+ token?: string;
20
+ private isHuri;
21
+ constructor(huri: Hash | Huri | string, { archivistUri, token }?: HuriOptions);
22
+ get href(): string;
23
+ static fetch<T extends Payload = Payload>(huri: Huri): Promise<T | undefined>;
24
+ static isHuri(value: unknown): Huri<Payload> | undefined;
25
+ private static parsePath;
26
+ private static parseProtocol;
27
+ fetch(): Promise<T | undefined>;
28
+ toString(): string;
29
+ private parsePath;
30
+ private validateParse;
31
+ }
32
+ //# sourceMappingURL=Huri.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Huri.d.ts","sourceRoot":"","sources":["../../src/Huri.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAIhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,CAAA;AAEhD,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;AAY5E,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IACzD,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,OAAO,EAAE,CAAC,CAAA;CACX;AAED,qBAAa,IAAI,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,OAAO,CAAC,MAAM,CAAO;gBAET,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,GAAE,WAAgB;IAiCjF,IAAI,IAAI,WAaP;WAEY,KAAK,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAKnF,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO;IAM5B,OAAO,CAAC,MAAM,CAAC,SAAS;IAWxB,OAAO,CAAC,MAAM,CAAC,aAAa;IAYtB,KAAK,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAIrC,QAAQ;IAIR,OAAO,CAAC,SAAS;IAyBjB,OAAO,CAAC,aAAa;CAUtB"}
@@ -0,0 +1,2 @@
1
+ export * from './Huri.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
@@ -0,0 +1,32 @@
1
+ import type { Address, Hash } from '@xylabs/hex';
2
+ import type { Payload } from '@xyo-network/payload-model';
3
+ export type ObjectCategory = 'block' | 'payload';
4
+ export type HuriFetchFunction = (huri: Huri) => Promise<Payload | undefined>;
5
+ export interface HuriOptions {
6
+ archivistUri?: string;
7
+ token?: string;
8
+ }
9
+ export interface FetchedPayload<T extends Payload = Payload> {
10
+ huri?: Huri;
11
+ payload: T;
12
+ }
13
+ export declare class Huri<T extends Payload = Payload> {
14
+ archive?: string;
15
+ archivist?: Address | string;
16
+ hash: Hash;
17
+ originalHref: string;
18
+ protocol?: string;
19
+ token?: string;
20
+ private isHuri;
21
+ constructor(huri: Hash | Huri | string, { archivistUri, token }?: HuriOptions);
22
+ get href(): string;
23
+ static fetch<T extends Payload = Payload>(huri: Huri): Promise<T | undefined>;
24
+ static isHuri(value: unknown): Huri<Payload> | undefined;
25
+ private static parsePath;
26
+ private static parseProtocol;
27
+ fetch(): Promise<T | undefined>;
28
+ toString(): string;
29
+ private parsePath;
30
+ private validateParse;
31
+ }
32
+ //# sourceMappingURL=Huri.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Huri.d.ts","sourceRoot":"","sources":["../../src/Huri.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAIhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,CAAA;AAEhD,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;AAY5E,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IACzD,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,OAAO,EAAE,CAAC,CAAA;CACX;AAED,qBAAa,IAAI,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,OAAO,CAAC,MAAM,CAAO;gBAET,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,GAAE,WAAgB;IAiCjF,IAAI,IAAI,WAaP;WAEY,KAAK,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAKnF,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO;IAM5B,OAAO,CAAC,MAAM,CAAC,SAAS;IAWxB,OAAO,CAAC,MAAM,CAAC,aAAa;IAYtB,KAAK,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAIrC,QAAQ;IAIR,OAAO,CAAC,SAAS;IAyBjB,OAAO,CAAC,aAAa;CAUtB"}
@@ -0,0 +1,2 @@
1
+ export * from './Huri.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
@@ -0,0 +1,35 @@
1
+ import { Address, Hash } from '@xylabs/hex';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+
4
+ type ObjectCategory = 'block' | 'payload';
5
+ type HuriFetchFunction = (huri: Huri) => Promise<Payload | undefined>;
6
+ interface HuriOptions {
7
+ archivistUri?: string;
8
+ token?: string;
9
+ }
10
+ interface FetchedPayload<T extends Payload = Payload> {
11
+ huri?: Huri;
12
+ payload: T;
13
+ }
14
+ declare class Huri<T extends Payload = Payload> {
15
+ archive?: string;
16
+ archivist?: Address | string;
17
+ hash: Hash;
18
+ originalHref: string;
19
+ protocol?: string;
20
+ token?: string;
21
+ private isHuri;
22
+ constructor(huri: Hash | Huri | string, { archivistUri, token }?: HuriOptions);
23
+ get href(): string;
24
+ static fetch<T extends Payload = Payload>(huri: Huri): Promise<T | undefined>;
25
+ static isHuri(value: unknown): Huri<Payload> | undefined;
26
+ private static parsePath;
27
+ private static parseProtocol;
28
+ fetch(): Promise<T | undefined>;
29
+ toString(): string;
30
+ private parsePath;
31
+ private validateParse;
32
+ }
33
+
34
+ export { Huri };
35
+ export type { FetchedPayload, HuriFetchFunction, HuriOptions, ObjectCategory };
@@ -0,0 +1,35 @@
1
+ import { Address, Hash } from '@xylabs/hex';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+
4
+ type ObjectCategory = 'block' | 'payload';
5
+ type HuriFetchFunction = (huri: Huri) => Promise<Payload | undefined>;
6
+ interface HuriOptions {
7
+ archivistUri?: string;
8
+ token?: string;
9
+ }
10
+ interface FetchedPayload<T extends Payload = Payload> {
11
+ huri?: Huri;
12
+ payload: T;
13
+ }
14
+ declare class Huri<T extends Payload = Payload> {
15
+ archive?: string;
16
+ archivist?: Address | string;
17
+ hash: Hash;
18
+ originalHref: string;
19
+ protocol?: string;
20
+ token?: string;
21
+ private isHuri;
22
+ constructor(huri: Hash | Huri | string, { archivistUri, token }?: HuriOptions);
23
+ get href(): string;
24
+ static fetch<T extends Payload = Payload>(huri: Huri): Promise<T | undefined>;
25
+ static isHuri(value: unknown): Huri<Payload> | undefined;
26
+ private static parsePath;
27
+ private static parseProtocol;
28
+ fetch(): Promise<T | undefined>;
29
+ toString(): string;
30
+ private parsePath;
31
+ private validateParse;
32
+ }
33
+
34
+ export { Huri };
35
+ export type { FetchedPayload, HuriFetchFunction, HuriOptions, ObjectCategory };
@@ -0,0 +1,35 @@
1
+ import { Address, Hash } from '@xylabs/hex';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+
4
+ type ObjectCategory = 'block' | 'payload';
5
+ type HuriFetchFunction = (huri: Huri) => Promise<Payload | undefined>;
6
+ interface HuriOptions {
7
+ archivistUri?: string;
8
+ token?: string;
9
+ }
10
+ interface FetchedPayload<T extends Payload = Payload> {
11
+ huri?: Huri;
12
+ payload: T;
13
+ }
14
+ declare class Huri<T extends Payload = Payload> {
15
+ archive?: string;
16
+ archivist?: Address | string;
17
+ hash: Hash;
18
+ originalHref: string;
19
+ protocol?: string;
20
+ token?: string;
21
+ private isHuri;
22
+ constructor(huri: Hash | Huri | string, { archivistUri, token }?: HuriOptions);
23
+ get href(): string;
24
+ static fetch<T extends Payload = Payload>(huri: Huri): Promise<T | undefined>;
25
+ static isHuri(value: unknown): Huri<Payload> | undefined;
26
+ private static parsePath;
27
+ private static parseProtocol;
28
+ fetch(): Promise<T | undefined>;
29
+ toString(): string;
30
+ private parsePath;
31
+ private validateParse;
32
+ }
33
+
34
+ export { Huri };
35
+ export type { FetchedPayload, HuriFetchFunction, HuriOptions, ObjectCategory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/huri",
3
- "version": "4.0.2",
3
+ "version": "4.1.0",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -21,26 +21,26 @@
21
21
  "type": "module",
22
22
  "exports": {
23
23
  ".": {
24
- "types": "./dist/types/index.d.ts",
24
+ "types": "./dist/neutral/index.d.ts",
25
25
  "default": "./dist/neutral/index.mjs"
26
26
  },
27
27
  "./package.json": "./package.json"
28
28
  },
29
29
  "module": "dist/neutral/index.mjs",
30
- "types": "dist/types/index.d.ts",
30
+ "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/assert": "^4.12.33",
33
- "@xylabs/axios": "^4.12.33",
34
- "@xylabs/hex": "^4.12.33",
35
- "@xylabs/typeof": "^4.12.33",
36
- "@xyo-network/account": "^4.0.2",
37
- "@xyo-network/payload-model": "^4.0.2"
32
+ "@xylabs/assert": "^4.13.15",
33
+ "@xylabs/axios": "^4.13.15",
34
+ "@xylabs/hex": "^4.13.15",
35
+ "@xylabs/typeof": "^4.13.15",
36
+ "@xyo-network/account": "^4.1.0",
37
+ "@xyo-network/payload-model": "^4.1.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@xylabs/delay": "^4.12.33",
41
- "@xylabs/ts-scripts-yarn3": "^6.5.12",
42
- "@xylabs/tsconfig": "^6.5.12",
43
- "@xylabs/vitest-extended": "^4.12.33",
40
+ "@xylabs/delay": "^4.13.15",
41
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.20",
42
+ "@xylabs/tsconfig": "^7.0.0-rc.20",
43
+ "@xylabs/vitest-extended": "^4.13.15",
44
44
  "typescript": "^5.8.3",
45
45
  "vitest": "^3.2.4"
46
46
  },
File without changes
File without changes
File without changes
File without changes