@xyo-network/xl1-protocol-sdk 1.30.2 → 1.30.4
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/neutral/block/hydrate/BoundWitnessHydrator.d.ts +8 -12
- package/dist/neutral/block/hydrate/BoundWitnessHydrator.d.ts.map +1 -1
- package/dist/neutral/index.mjs +357 -302
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/primitives/datalake/NamedDataLake.d.ts +7 -0
- package/dist/neutral/primitives/datalake/NamedDataLake.d.ts.map +1 -0
- package/dist/neutral/primitives/datalake/PayloadLocator.d.ts +55 -0
- package/dist/neutral/primitives/datalake/PayloadLocator.d.ts.map +1 -0
- package/dist/neutral/primitives/datalake/index.d.ts +2 -0
- package/dist/neutral/primitives/datalake/index.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DataLakeViewerMethods } from '@xyo-network/xl1-protocol-lib';
|
|
2
|
+
/** A datalake registered with a caller-supplied name for provenance tracking. */
|
|
3
|
+
export interface NamedDataLake {
|
|
4
|
+
name: string;
|
|
5
|
+
viewer: DataLakeViewerMethods;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=NamedDataLake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NamedDataLake.d.ts","sourceRoot":"","sources":["../../../../src/primitives/datalake/NamedDataLake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAE1E,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,qBAAqB,CAAA;CAC9B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/sdk-js';
|
|
2
|
+
import type { Payload } from '@xyo-network/sdk-js';
|
|
3
|
+
import type { NamedDataLake } from './NamedDataLake.ts';
|
|
4
|
+
/** A payload paired with the name of the datalake that served it. */
|
|
5
|
+
export interface PayloadLocation {
|
|
6
|
+
payload: Payload;
|
|
7
|
+
source: string;
|
|
8
|
+
}
|
|
9
|
+
/** Parameters for PayloadLocator. */
|
|
10
|
+
export interface PayloadLocatorParams {
|
|
11
|
+
datalakes: readonly NamedDataLake[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Stateless multi-datalake fetch orchestration.
|
|
15
|
+
*
|
|
16
|
+
* Given hash(es) and a list of named datalakes, finds where each hash lives.
|
|
17
|
+
* Filters non-Payload datalake entries (e.g. ArrayBuffer) — use a binary-aware locator
|
|
18
|
+
* if you need those.
|
|
19
|
+
*
|
|
20
|
+
* No caching: callers that want caching should wrap this (see BoundWitnessHydrator for
|
|
21
|
+
* one example of wrapping with an LRU).
|
|
22
|
+
*/
|
|
23
|
+
export declare class PayloadLocator {
|
|
24
|
+
protected readonly datalakes: readonly NamedDataLake[];
|
|
25
|
+
/**
|
|
26
|
+
* @throws if `params.datalakes` is empty. Required at construction to fail fast on misconfig.
|
|
27
|
+
* The only zero-datalake calls that wouldn't already throw are degenerate (no hashes input),
|
|
28
|
+
* not load-bearing enough to justify loosening the guard.
|
|
29
|
+
*/
|
|
30
|
+
constructor(params: PayloadLocatorParams);
|
|
31
|
+
/**
|
|
32
|
+
* Exhaustive: queries every datalake for the hash(es). Does NOT short-circuit.
|
|
33
|
+
*
|
|
34
|
+
* Scalar form returns an array with one `PayloadLocation` per datalake that has the hash
|
|
35
|
+
* (in registration order; empty if no datalake had it).
|
|
36
|
+
* Batch form returns a Map keyed by input hash, value is the same per-hash array.
|
|
37
|
+
*/
|
|
38
|
+
findAll(hash: Hash): Promise<PayloadLocation[]>;
|
|
39
|
+
findAll(hashes: readonly Hash[]): Promise<Map<Hash, PayloadLocation[]>>;
|
|
40
|
+
/**
|
|
41
|
+
* First-found across datalakes in registration order. Short-circuits per hash:
|
|
42
|
+
* once a hash is located in datalake N, later datalakes are not queried for it.
|
|
43
|
+
*
|
|
44
|
+
* Scalar form returns the single PayloadLocation (or `undefined` if no datalake had it).
|
|
45
|
+
* Batch form returns a Map keyed by input hash, preserving insertion order. Missing
|
|
46
|
+
* hashes are simply absent from the map.
|
|
47
|
+
*/
|
|
48
|
+
findFirst(hash: Hash): Promise<PayloadLocation | undefined>;
|
|
49
|
+
findFirst(hashes: readonly Hash[]): Promise<Map<Hash, PayloadLocation>>;
|
|
50
|
+
/** Fetch a single hash from a single datalake, filtering non-Payload entries. */
|
|
51
|
+
protected fetchOne(dl: NamedDataLake, hash: Hash): Promise<Payload | undefined>;
|
|
52
|
+
protected findAllBatch(hashes: readonly Hash[]): Promise<Map<Hash, PayloadLocation[]>>;
|
|
53
|
+
protected findFirstBatch(hashes: readonly Hash[]): Promise<Map<Hash, PayloadLocation>>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=PayloadLocator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayloadLocator.d.ts","sourceRoot":"","sources":["../../../../src/primitives/datalake/PayloadLocator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,qCAAqC;AACrC,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAA;CACpC;AAED;;;;;;;;;GASG;AACH,qBAAa,cAAc;IACzB,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAA;IAEtD;;;;OAIG;gBACS,MAAM,EAAE,oBAAoB;IAUxC;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAC/C,OAAO,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAWvE;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAC3D,SAAS,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAWvE,iFAAiF;cACjE,QAAQ,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;cAQrE,YAAY,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;cAe5E,cAAc,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;CAkB7F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/primitives/datalake/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,oCAAoC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/primitives/datalake/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,oCAAoC,CAAA;AAClD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xl1-protocol-sdk",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.4",
|
|
4
4
|
"description": "XYO Layer One SDK Protocol",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"README.md"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@xyo-network/xl1-protocol-
|
|
46
|
-
"@xyo-network/xl1-protocol-
|
|
47
|
-
"@xyo-network/xl1-schema": "~1.30.
|
|
45
|
+
"@xyo-network/xl1-protocol-lib": "~1.30.4",
|
|
46
|
+
"@xyo-network/xl1-protocol-model": "~1.30.4",
|
|
47
|
+
"@xyo-network/xl1-schema": "~1.30.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@bitauth/libauth": "~3.0.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"wasm-feature-detect": "~1.8.0",
|
|
103
103
|
"webextension-polyfill": "^0.12.0",
|
|
104
104
|
"zod": "~4.4.3",
|
|
105
|
-
"@xyo-network/xl1-network-model": "~1.30.
|
|
105
|
+
"@xyo-network/xl1-network-model": "~1.30.4"
|
|
106
106
|
},
|
|
107
107
|
"peerDependencies": {
|
|
108
108
|
"@bitauth/libauth": "~3.0",
|