@xyo-network/xl1-protocol-lib 1.29.3 → 1.29.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/providers/DataLake/Client.d.ts +56 -0
- package/dist/neutral/providers/DataLake/Client.d.ts.map +1 -0
- package/dist/neutral/providers/DataLake/index.d.ts +1 -0
- package/dist/neutral/providers/DataLake/index.d.ts.map +1 -1
- package/dist/neutral/providers/XyoClient.d.ts +2 -0
- package/dist/neutral/providers/XyoClient.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/sdk-js';
|
|
2
|
+
import type { Schema } from '@xyo-network/sdk-js';
|
|
3
|
+
import type { DataLakeData } from './Provider.ts';
|
|
4
|
+
/** Capability the dApp is asking for when calling `requestAccess`. */
|
|
5
|
+
export type DataLakeCapability = 'viewer' | 'runner' | {
|
|
6
|
+
read?: boolean;
|
|
7
|
+
write?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** Options the dApp passes when requesting access to a data lake. */
|
|
10
|
+
export interface DataLakeRequestAccessOptions {
|
|
11
|
+
capability: DataLakeCapability;
|
|
12
|
+
/** Optional schema filter — the wallet's picker only shows lakes whose policy is compatible. */
|
|
13
|
+
schemas?: Schema[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A data lake the user has approved for this origin.
|
|
17
|
+
*
|
|
18
|
+
* The wallet redacts the lake's friendly name, endpoint, and internal id; the
|
|
19
|
+
* page only ever sees the opaque `id` (a fresh-per-grant UUID minted by the
|
|
20
|
+
* wallet) plus the public policy declared on the lake itself.
|
|
21
|
+
*/
|
|
22
|
+
export interface ApprovedDataLake {
|
|
23
|
+
allowedSchemas?: Schema[];
|
|
24
|
+
capabilities: ('viewer' | 'runner')[];
|
|
25
|
+
disallowedSchemas?: Schema[];
|
|
26
|
+
/** Per-origin opaque handle. Pass to `get` / `insert`. Uncorrelated across origins. */
|
|
27
|
+
id: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Page-side surface for wallet-mediated data lake access. Injected onto
|
|
31
|
+
* `globalThis.xyo.dataLakes` by the wallet's content-script. Every call is
|
|
32
|
+
* proxied through the wallet's service worker, which performs the per-origin
|
|
33
|
+
* permission check and the actual network I/O — the page never sees the
|
|
34
|
+
* lake's endpoint or access token.
|
|
35
|
+
*/
|
|
36
|
+
export interface DataLakesClient {
|
|
37
|
+
/** Fetch payloads by hash from the lake bound to `id`. Missing hashes are skipped silently. */
|
|
38
|
+
get: (id: string, hashes: Hash[]) => Promise<DataLakeData[]>;
|
|
39
|
+
/** Write payloads to the lake bound to `id`. Requires the grant to include the `runner` capability. */
|
|
40
|
+
insert: (id: string, payloads: DataLakeData[]) => Promise<DataLakeData[]>;
|
|
41
|
+
/** Approved lakes for this origin. Returns an empty list before any grant exists. */
|
|
42
|
+
list: () => Promise<ApprovedDataLake[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Trigger the wallet's lake-picker popup. Resolves with the per-origin
|
|
45
|
+
* opaque `id` of the chosen lake once the user approves. Rejected if the
|
|
46
|
+
* user denies or no lakes match the requested capability + schemas.
|
|
47
|
+
*
|
|
48
|
+
* A combined `{ read: true, write: true }` request issues a single picker;
|
|
49
|
+
* the user picks one lake and both viewer and runner grants share the same
|
|
50
|
+
* `id`.
|
|
51
|
+
*/
|
|
52
|
+
requestAccess: (options: DataLakeRequestAccessOptions) => Promise<{
|
|
53
|
+
id: string;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=Client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../../src/providers/DataLake/Client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA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Ac,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/DataLake/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GatewayName } from '@xyo-network/xl1-protocol-model';
|
|
2
2
|
import type { XyoPermissions } from '../permissions/index.ts';
|
|
3
|
+
import type { DataLakesClient } from './DataLake/index.ts';
|
|
3
4
|
import type { XyoGateway } from './XyoGateway.ts';
|
|
4
5
|
import type { XyoGatewayRunner } from './XyoGatewayRunner.ts';
|
|
5
6
|
/** @deprecated */
|
|
@@ -13,6 +14,7 @@ export interface XyoRpcGatewayConfig extends XyoGatewayConfig {
|
|
|
13
14
|
}
|
|
14
15
|
/** XyoClient interface. */
|
|
15
16
|
export interface XyoClient {
|
|
17
|
+
dataLakes?: DataLakesClient;
|
|
16
18
|
gateways: Readonly<Partial<Record<GatewayName, XyoGatewayRunner>>>;
|
|
17
19
|
permissions: XyoPermissions;
|
|
18
20
|
/** @deprecated */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoClient.d.ts","sourceRoot":"","sources":["../../../src/providers/XyoClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,kBAAkB;AAClB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,kBAAkB;AAElB,MAAM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AC,CAAC,CAAC,CAAA;IAClE,WAAW,EAAE,cAAc,CAAA;IAE3B,kBAAkB;IAElB,UAAU,CAAC,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,GAAG,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACvG,kBAAkB;IAClB,aAAa,CAAC,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACjD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xl1-protocol-lib",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.4",
|
|
4
4
|
"description": "XYO Layer One Protocol",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@xyo-network/xl1-protocol-model": "~1.29.
|
|
37
|
+
"@xyo-network/xl1-protocol-model": "~1.29.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@bitauth/libauth": "~3.0.0",
|