@xyo-network/xl1-react-client-sdk 1.30.3 → 2.0.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.
- package/dist/browser/client/components/connected/DataLakeOperationsPanel.d.ts +10 -8
- package/dist/browser/client/components/connected/DataLakeOperationsPanel.d.ts.map +1 -1
- package/dist/browser/client/components/connected/DataLakeRequestAccessPanel.d.ts +19 -0
- package/dist/browser/client/components/connected/DataLakeRequestAccessPanel.d.ts.map +1 -0
- package/dist/browser/client/components/connected/PermissionsReviewDialog.d.ts +41 -0
- package/dist/browser/client/components/connected/PermissionsReviewDialog.d.ts.map +1 -0
- package/dist/browser/client/components/connected/RequestPermissionsButton.d.ts +21 -4
- package/dist/browser/client/components/connected/RequestPermissionsButton.d.ts.map +1 -1
- package/dist/browser/client/components/connected/index.d.ts +2 -0
- package/dist/browser/client/components/connected/index.d.ts.map +1 -1
- package/dist/browser/client/index.mjs +359 -116
- package/dist/browser/client/index.mjs.map +4 -4
- package/dist/browser/index.mjs +388 -145
- package/dist/browser/index.mjs.map +4 -4
- package/package.json +74 -74
|
@@ -4,17 +4,19 @@ export interface DataLakeOperationsPanelProps extends StackProps {
|
|
|
4
4
|
timeout?: number;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Combined panel for exercising every page-side data-lake operation against
|
|
8
|
-
* live wallet in a single rendered surface — `
|
|
9
|
-
* stacked with their own controls so a manual tester
|
|
10
|
-
* without jumping between Storybook stories.
|
|
11
|
-
*
|
|
7
|
+
* Combined panel for exercising every page-side data-lake operation against
|
|
8
|
+
* a live wallet in a single rendered surface — `requestAccess`, `list`,
|
|
9
|
+
* `insert`, and `get` stacked with their own controls so a manual tester
|
|
10
|
+
* can drive the full flow without jumping between Storybook stories. The
|
|
11
|
+
* sections are ordered for natural flow: request access first, then
|
|
12
|
+
* enumerate the grants, then insert a payload and read it back by hash in
|
|
12
13
|
* the same scroll. Designed for isolation mode where the args panel isn't
|
|
13
14
|
* available.
|
|
14
15
|
*
|
|
15
|
-
* Single-purpose: composes the
|
|
16
|
-
* section. State within each operation (selected lake,
|
|
17
|
-
* is owned by the underlying panel, not by this
|
|
16
|
+
* Single-purpose: composes the four operation components and labels each
|
|
17
|
+
* section. State within each operation (capability choice, selected lake,
|
|
18
|
+
* hashes, payload JSON) is owned by the underlying panel, not by this
|
|
19
|
+
* wrapper.
|
|
18
20
|
*/
|
|
19
21
|
export declare const DataLakeOperationsPanel: React.FC<DataLakeOperationsPanelProps>;
|
|
20
22
|
//# sourceMappingURL=DataLakeOperationsPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataLakeOperationsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeOperationsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"DataLakeOperationsPanel.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeOperationsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/C,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,MAAM,WAAW,4BAA6B,SAAQ,UAAU;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAqC1E,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StackProps } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface DataLakeRequestAccessPanelProps extends StackProps {
|
|
4
|
+
timeout?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Self-contained RequestAccess flow — picks a capability shape
|
|
8
|
+
* (`viewer`, `runner`, or combined `read + write`) and optionally attaches
|
|
9
|
+
* a schemas filter, then drives `client.dataLakes.requestAccess(options)`
|
|
10
|
+
* through {@link DataLakeRequestAccessButton}. Designed for Storybook's
|
|
11
|
+
* isolation mode where the args panel isn't available, so a manual tester
|
|
12
|
+
* can sweep the four canonical request shapes from one rendered surface.
|
|
13
|
+
*
|
|
14
|
+
* Schemas filter only applies to the write path: `get` is hash-based and
|
|
15
|
+
* the wallet rejects a schemas filter on `viewer` grants. The checkbox
|
|
16
|
+
* auto-disables when the capability has no write component.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DataLakeRequestAccessPanel: React.FC<DataLakeRequestAccessPanelProps>;
|
|
19
|
+
//# sourceMappingURL=DataLakeRequestAccessPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataLakeRequestAccessPanel.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/DataLakeRequestAccessPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,eAAe,CAAA;AAMlE,OAAO,KAA4B,MAAM,OAAO,CAAA;AAShD,MAAM,WAAW,+BAAgC,SAAQ,UAAU;IACjE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAkDhF,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { InvokerPermission } from '@xyo-network/xl1-protocol-lib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface PermissionsReviewDialogProps {
|
|
4
|
+
/** The error (if any) from the most recent re-request attempt. */
|
|
5
|
+
error?: Error;
|
|
6
|
+
/** Permissions already granted to this origin (from `client.permissions.getPermissions()`). */
|
|
7
|
+
granted: InvokerPermission[];
|
|
8
|
+
/** Close the dialog without taking any action. */
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Re-run `client.permissions.requestPermissions(...)` against the same
|
|
12
|
+
* batch the parent `RequestPermissionsButton` was configured with. The
|
|
13
|
+
* dialog doesn't try to compute what's "new" vs "already granted" —
|
|
14
|
+
* the wallet's request handler is the source of truth for that, and any
|
|
15
|
+
* inferred diff here would drift out of sync with caveat-merge rules
|
|
16
|
+
* upstream (e.g. data-lake's append-on-merge). Sending the original
|
|
17
|
+
* batch and letting the wallet decide keeps the behavior consistent.
|
|
18
|
+
*/
|
|
19
|
+
onReRequest: () => void;
|
|
20
|
+
open: boolean;
|
|
21
|
+
/** True while the re-request call is in flight. */
|
|
22
|
+
requesting: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Read-only review of an origin's currently granted permissions, with a
|
|
26
|
+
* single "Re-request permissions" action that re-runs the parent's original
|
|
27
|
+
* `requestPermissions(...)` batch verbatim.
|
|
28
|
+
*
|
|
29
|
+
* Deliberately does **not** compute an "additional" diff. The wallet's
|
|
30
|
+
* request handler owns the merge rules (e.g. data-lake caveats append while
|
|
31
|
+
* `restrictReturnedAccounts` unions), and any client-side diff would drift
|
|
32
|
+
* out of sync the moment those rules change. Sending the original batch is
|
|
33
|
+
* also what the user expects: "I want to ask for the same thing again."
|
|
34
|
+
*
|
|
35
|
+
* The dialog is intentionally permissive about caveat shape: it special-cases
|
|
36
|
+
* the two caveats with structured payloads (`restrictReturnedAccounts`,
|
|
37
|
+
* `dataLakeAccess`) and falls through to a pretty-printed JSON dump for
|
|
38
|
+
* anything else, so newly-added caveat types render without code changes.
|
|
39
|
+
*/
|
|
40
|
+
export declare const PermissionsReviewDialog: React.FC<PermissionsReviewDialogProps>;
|
|
41
|
+
//# sourceMappingURL=PermissionsReviewDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionsReviewDialog.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/PermissionsReviewDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAC/E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,4BAA4B;IAC3C,kEAAkE;IAClE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,+FAA+F;IAC/F,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,kDAAkD;IAClD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;;;;;;;;OAQG;IACH,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,IAAI,EAAE,OAAO,CAAA;IACb,mDAAmD;IACnD,UAAU,EAAE,OAAO,CAAA;CACpB;AAkID;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAmC1E,CAAA"}
|
|
@@ -6,10 +6,27 @@ export interface RequestPermissionsButtonProps extends StackProps {
|
|
|
6
6
|
timeout?: number;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Two-mode entry point for `client.permissions`:
|
|
10
|
+
*
|
|
11
|
+
* - If the origin has no permissions on file (fresh load, or just revoked),
|
|
12
|
+
* the button reads "Request permissions" and calls
|
|
13
|
+
* `client.permissions.requestPermissions(permissions)` on click, opening
|
|
14
|
+
* the wallet's consent popup.
|
|
15
|
+
* - If permissions already exist for this origin, the button flips to
|
|
16
|
+
* "Review permissions" and opens a read-only dialog enumerating each
|
|
17
|
+
* grant. The dialog also surfaces a "Re-request permissions" action
|
|
18
|
+
* that re-runs the same `permissions` batch verbatim — letting the
|
|
19
|
+
* wallet's request handler decide what merges with the existing grants
|
|
20
|
+
* (data-lake caveats append, account caveats union, etc.) instead of
|
|
21
|
+
* trying to compute a client-side diff that would drift out of sync.
|
|
22
|
+
*
|
|
23
|
+
* Successful requests don't render any inline ack list — the review dialog
|
|
24
|
+
* (reached via the button's "Review permissions" mode) is the single
|
|
25
|
+
* source of truth for what the origin has been granted.
|
|
26
|
+
*
|
|
27
|
+
* The initial existing-permissions fetch happens on mount via
|
|
28
|
+
* `client.permissions.getPermissions()`, then refreshes after every successful
|
|
29
|
+
* `requestPermissions` round-trip so the dialog reflects the new state.
|
|
13
30
|
*/
|
|
14
31
|
export declare const RequestPermissionsButton: React.FC<RequestPermissionsButtonProps>;
|
|
15
32
|
//# sourceMappingURL=RequestPermissionsButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestPermissionsButton.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/RequestPermissionsButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"RequestPermissionsButton.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/RequestPermissionsButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAK/C,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,KAEN,MAAM,OAAO,CAAA;AAKd,MAAM,WAAW,6BAA8B,SAAQ,UAAU;IAC/D,WAAW,EAAE,iBAAiB,EAAE,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CA+G5E,CAAA"}
|
|
@@ -8,5 +8,7 @@ export * from './DataLakeInsertPanel.tsx';
|
|
|
8
8
|
export * from './DataLakeListButton.tsx';
|
|
9
9
|
export * from './DataLakeOperationsPanel.tsx';
|
|
10
10
|
export * from './DataLakeRequestAccessButton.tsx';
|
|
11
|
+
export * from './DataLakeRequestAccessPanel.tsx';
|
|
12
|
+
export * from './PermissionsReviewDialog.tsx';
|
|
11
13
|
export * from './RequestPermissionsButton.tsx';
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/components/connected/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA"}
|