@dxos/plugin-client 0.7.4-staging.f7e8224 → 0.7.5-main.499c70c
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/lib/browser/chunk-52IJQ35F.mjs +78 -0
- package/dist/lib/browser/chunk-52IJQ35F.mjs.map +7 -0
- package/dist/lib/browser/chunk-X4QUPYC6.mjs +12 -0
- package/dist/lib/browser/chunk-X4QUPYC6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +184 -233
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -5
- package/dist/lib/browser/types.mjs +10 -0
- package/dist/lib/browser/types.mjs.map +7 -0
- package/dist/lib/node/chunk-NFO3ADQC.cjs +98 -0
- package/dist/lib/node/chunk-NFO3ADQC.cjs.map +7 -0
- package/dist/lib/node/chunk-RUA5KXVW.cjs +35 -0
- package/dist/lib/node/chunk-RUA5KXVW.cjs.map +7 -0
- package/dist/lib/node/index.cjs +186 -236
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +4 -8
- package/dist/lib/node/meta.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types.cjs +32 -0
- package/dist/lib/node/types.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs +14 -0
- package/dist/lib/node-esm/chunk-GMGRQ5Q7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TI4GNGMM.mjs +79 -0
- package/dist/lib/node-esm/chunk-TI4GNGMM.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +184 -233
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/meta.mjs +1 -5
- package/dist/lib/node-esm/types.mjs +11 -0
- package/dist/lib/node-esm/types.mjs.map +7 -0
- package/dist/types/src/ClientPlugin.d.ts +2 -35
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/components/IdentityDialog.d.ts +1 -0
- package/dist/types/src/components/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/components/JoinDialog.d.ts +1 -0
- package/dist/types/src/components/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.d.ts +1 -0
- package/dist/types/src/components/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts +8 -0
- package/dist/types/src/components/RecoveryCodeDialog.stories.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +0 -10
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +110 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +22 -13
- package/src/ClientPlugin.tsx +111 -200
- package/src/components/IdentityDialog.tsx +13 -11
- package/src/components/JoinDialog.tsx +13 -19
- package/src/components/RecoveryCodeDialog.stories.tsx +50 -0
- package/src/components/RecoveryCodeDialog.tsx +19 -7
- package/src/meta.ts +0 -14
- package/src/translations.ts +5 -4
- package/src/types.ts +115 -0
- package/dist/lib/browser/chunk-FGUXUNOK.mjs +0 -26
- package/dist/lib/browser/chunk-FGUXUNOK.mjs.map +0 -7
- package/dist/lib/node/chunk-XYLDQWFV.cjs +0 -51
- package/dist/lib/node/chunk-XYLDQWFV.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-C6X363FK.mjs +0 -28
- package/dist/lib/node-esm/chunk-C6X363FK.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -29,17 +29,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
31
|
ClientPlugin: () => ClientPlugin,
|
|
32
|
-
default: () => src_default
|
|
33
|
-
parseClientPlugin: () => parseClientPlugin
|
|
32
|
+
default: () => src_default
|
|
34
33
|
});
|
|
35
34
|
module.exports = __toCommonJS(node_exports);
|
|
36
|
-
var
|
|
35
|
+
var import_chunk_NFO3ADQC = require("./chunk-NFO3ADQC.cjs");
|
|
36
|
+
var import_chunk_RUA5KXVW = require("./chunk-RUA5KXVW.cjs");
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_app_framework = require("@dxos/app-framework");
|
|
39
39
|
var import_config = require("@dxos/config");
|
|
40
40
|
var import_react2 = require("@dxos/echo-signals/react");
|
|
41
41
|
var import_invariant = require("@dxos/invariant");
|
|
42
42
|
var import_plugin_graph = require("@dxos/plugin-graph");
|
|
43
|
+
var import_types = require("@dxos/plugin-observability/types");
|
|
43
44
|
var import_react_client = require("@dxos/react-client");
|
|
44
45
|
var import_react3 = __toESM(require("react"));
|
|
45
46
|
var import_app_framework2 = require("@dxos/app-framework");
|
|
@@ -48,49 +49,40 @@ var import_react_ui = require("@dxos/react-ui");
|
|
|
48
49
|
var import_react4 = require("@dxos/shell/react");
|
|
49
50
|
var import_react5 = __toESM(require("react"));
|
|
50
51
|
var import_app_framework3 = require("@dxos/app-framework");
|
|
52
|
+
var import_types2 = require("@dxos/plugin-observability/types");
|
|
51
53
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
52
54
|
var import_react6 = require("@dxos/shell/react");
|
|
53
55
|
var import_react7 = __toESM(require("react"));
|
|
54
56
|
var import_react_ui3 = require("@dxos/react-ui");
|
|
57
|
+
var IDENTITY_DIALOG = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/IdentityDialog`;
|
|
55
58
|
var IdentityDialog = (props) => {
|
|
56
|
-
const dispatch = (0, import_app_framework2.useIntentDispatcher)();
|
|
59
|
+
const { dispatchPromise: dispatch } = (0, import_app_framework2.useIntentDispatcher)();
|
|
57
60
|
const client = (0, import_react_client2.useClient)();
|
|
58
|
-
const handleDone = (0, import_react3.useCallback)(() => dispatch({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
state: false
|
|
63
|
-
}
|
|
64
|
-
}), [
|
|
61
|
+
const handleDone = (0, import_react3.useCallback)(() => dispatch((0, import_app_framework2.createIntent)(import_app_framework2.LayoutAction.SetLayout, {
|
|
62
|
+
element: "dialog",
|
|
63
|
+
state: false
|
|
64
|
+
})), [
|
|
65
65
|
dispatch
|
|
66
66
|
]);
|
|
67
67
|
const handleResetStorage = (0, import_react3.useCallback)(async () => {
|
|
68
68
|
await client.reset();
|
|
69
|
-
await dispatch(
|
|
70
|
-
action: import_chunk_XYLDQWFV.ClientAction.RESET_STORAGE
|
|
71
|
-
});
|
|
69
|
+
await dispatch((0, import_app_framework2.createIntent)(import_chunk_NFO3ADQC.ClientAction.ResetStorage));
|
|
72
70
|
}, [
|
|
73
71
|
dispatch
|
|
74
72
|
]);
|
|
75
73
|
const handleRecover = (0, import_react3.useCallback)(async () => {
|
|
76
74
|
await client.reset();
|
|
77
|
-
await dispatch({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
target: "recoverIdentity"
|
|
81
|
-
}
|
|
82
|
-
});
|
|
75
|
+
await dispatch((0, import_app_framework2.createIntent)(import_chunk_NFO3ADQC.ClientAction.ResetStorage, {
|
|
76
|
+
target: "recoverIdentity"
|
|
77
|
+
}));
|
|
83
78
|
}, [
|
|
84
79
|
dispatch
|
|
85
80
|
]);
|
|
86
81
|
const handleJoinNewIdentity = (0, import_react3.useCallback)(async () => {
|
|
87
82
|
await client.reset();
|
|
88
|
-
await dispatch({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
target: "deviceInvitation"
|
|
92
|
-
}
|
|
93
|
-
});
|
|
83
|
+
await dispatch((0, import_app_framework2.createIntent)(import_chunk_NFO3ADQC.ClientAction.ResetStorage, {
|
|
84
|
+
target: "deviceInvitation"
|
|
85
|
+
}));
|
|
94
86
|
}, [
|
|
95
87
|
dispatch
|
|
96
88
|
]);
|
|
@@ -105,30 +97,22 @@ var IdentityDialog = (props) => {
|
|
|
105
97
|
onJoinNewIdentity: handleJoinNewIdentity
|
|
106
98
|
})));
|
|
107
99
|
};
|
|
100
|
+
var JOIN_DIALOG = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/JoinDialog`;
|
|
108
101
|
var JoinDialog = (props) => {
|
|
109
|
-
const dispatch = (0, import_app_framework3.useIntentDispatcher)();
|
|
110
|
-
const handleCancelResetStorage = (0, import_react5.useCallback)(() => dispatch(
|
|
111
|
-
plugin: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
|
|
112
|
-
action: import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY
|
|
113
|
-
}), [
|
|
102
|
+
const { dispatchPromise: dispatch } = (0, import_app_framework3.useIntentDispatcher)();
|
|
103
|
+
const handleCancelResetStorage = (0, import_react5.useCallback)(() => dispatch((0, import_app_framework3.createIntent)(import_chunk_NFO3ADQC.ClientAction.ShareIdentity)), [
|
|
114
104
|
dispatch
|
|
115
105
|
]);
|
|
116
106
|
const handleDone = (0, import_react5.useCallback)(async (result) => {
|
|
117
107
|
if (result?.identityKey) {
|
|
118
108
|
await Promise.all([
|
|
119
|
-
dispatch({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
})
|
|
126
|
-
dispatch({
|
|
127
|
-
action: import_chunk_XYLDQWFV.OBSERVABILITY_ACTION,
|
|
128
|
-
data: {
|
|
129
|
-
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
130
|
-
}
|
|
131
|
-
})
|
|
109
|
+
dispatch((0, import_app_framework3.createIntent)(import_app_framework3.LayoutAction.SetLayout, {
|
|
110
|
+
element: "dialog",
|
|
111
|
+
state: false
|
|
112
|
+
})),
|
|
113
|
+
dispatch((0, import_app_framework3.createIntent)(import_types2.ObservabilityAction.SendEvent, {
|
|
114
|
+
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
115
|
+
}))
|
|
132
116
|
]);
|
|
133
117
|
}
|
|
134
118
|
}, [
|
|
@@ -147,21 +131,20 @@ var JoinDialog = (props) => {
|
|
|
147
131
|
onDone: handleDone
|
|
148
132
|
}));
|
|
149
133
|
};
|
|
134
|
+
var RECOVER_CODE_DIALOG = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/RecoveryCodeDialog`;
|
|
150
135
|
var RecoveryCodeDialog = ({ code }) => {
|
|
151
|
-
const { t } = (0, import_react_ui3.useTranslation)(
|
|
136
|
+
const { t } = (0, import_react_ui3.useTranslation)(import_chunk_RUA5KXVW.CLIENT_PLUGIN);
|
|
152
137
|
const [confirmation, setConfirmation] = (0, import_react7.useState)(false);
|
|
153
138
|
const handleConfirmation = (0, import_react7.useCallback)((checked) => setConfirmation(checked), []);
|
|
154
139
|
return /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Content, {
|
|
155
140
|
classNames: "bs-content min-bs-[15rem] max-bs-full md:max-is-[40rem] overflow-hidden"
|
|
156
|
-
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Title, {
|
|
157
|
-
classNames: ""
|
|
158
|
-
}, t("recovery code dialog title")), /* @__PURE__ */ import_react7.default.createElement("p", {
|
|
141
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.AlertDialog.Title, null, t("recovery code dialog title")), /* @__PURE__ */ import_react7.default.createElement("p", {
|
|
159
142
|
className: "py-4"
|
|
160
143
|
}, t("recovery code dialog description")), /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Clipboard.Provider, null, /* @__PURE__ */ import_react7.default.createElement(Code, {
|
|
161
|
-
|
|
162
|
-
})), /* @__PURE__ */ import_react7.default.createElement("
|
|
163
|
-
className: "py-4"
|
|
164
|
-
}, t("recovery code dialog warning")), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
144
|
+
code
|
|
145
|
+
})), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
146
|
+
className: "flex flex-col py-4 gap-2"
|
|
147
|
+
}, /* @__PURE__ */ import_react7.default.createElement("p", null, t("recovery code dialog warning 1")), /* @__PURE__ */ import_react7.default.createElement("p", null, t("recovery code dialog warning 2"))), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
165
148
|
className: "flex items-center gap-2 pbe-4"
|
|
166
149
|
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Input.Checkbox, {
|
|
167
150
|
"data-testid": "recoveryCode.confirm",
|
|
@@ -177,32 +160,40 @@ var RecoveryCodeDialog = ({ code }) => {
|
|
|
177
160
|
disabled: !confirmation
|
|
178
161
|
}, t("continue label")))));
|
|
179
162
|
};
|
|
180
|
-
var Code = ({
|
|
163
|
+
var Code = ({ code }) => {
|
|
164
|
+
const words = code.split(" ");
|
|
181
165
|
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
182
166
|
className: "relative p-2 border border-separator rounded group"
|
|
183
167
|
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui3.Clipboard.IconButton, {
|
|
184
|
-
value,
|
|
168
|
+
value: code,
|
|
185
169
|
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
186
|
-
}), /* @__PURE__ */ import_react7.default.createElement("
|
|
187
|
-
className: "
|
|
188
|
-
},
|
|
170
|
+
}), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
171
|
+
className: "grid grid-cols-4"
|
|
172
|
+
}, words.map((word, i) => /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
173
|
+
key: i,
|
|
174
|
+
className: "flex items-center p-2 gap-2 items-center"
|
|
175
|
+
}, /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
176
|
+
className: "w-4 text-xs text-center text-subdued"
|
|
177
|
+
}, i + 1), /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
178
|
+
className: "text-sm"
|
|
179
|
+
}, word)))));
|
|
189
180
|
};
|
|
190
181
|
var translations_default = [
|
|
191
182
|
{
|
|
192
183
|
"en-US": {
|
|
193
|
-
[
|
|
184
|
+
[import_chunk_RUA5KXVW.CLIENT_PLUGIN]: {
|
|
194
185
|
"open shell label": "Open HALO",
|
|
195
|
-
"recovery code dialog title": "Recovery
|
|
186
|
+
"recovery code dialog title": "Account Recovery",
|
|
196
187
|
"recovery code dialog description": "This is your identity recovery code, store it in a safe place. You can use it to recover your identity if you ever lose access to your devices.",
|
|
197
|
-
"recovery code dialog warning": "
|
|
198
|
-
"recovery code
|
|
188
|
+
"recovery code dialog warning 1": "NOTE: This code will not be displayed again.",
|
|
189
|
+
"recovery code dialog warning 2": "It is your private key for recovering DXOS data. Anyone with this key will be able to gain access to your account.",
|
|
190
|
+
"recovery code confirmation label": "Please confirm you have saved the code.",
|
|
199
191
|
"continue label": "Continue"
|
|
200
192
|
}
|
|
201
193
|
}
|
|
202
194
|
}
|
|
203
195
|
];
|
|
204
196
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/ClientPlugin.tsx";
|
|
205
|
-
var parseClientPlugin = (plugin) => (plugin?.provides).client instanceof import_react_client.Client ? plugin : void 0;
|
|
206
197
|
var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitationParam = "deviceInvitationCode", onClientInitialized, onReady, onReset, ...options }) => {
|
|
207
198
|
(0, import_react2.registerSignalsRuntime)();
|
|
208
199
|
let client;
|
|
@@ -213,7 +204,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
213
204
|
return baseUrl.toString();
|
|
214
205
|
};
|
|
215
206
|
return {
|
|
216
|
-
meta:
|
|
207
|
+
meta: import_chunk_RUA5KXVW.meta_default,
|
|
217
208
|
initialize: async () => {
|
|
218
209
|
const config = new import_config.Config(await (0, import_config.Storage)(), (0, import_config.Envs)(), (0, import_config.Local)(), (0, import_config.Defaults)());
|
|
219
210
|
client = new import_react_client.Client({
|
|
@@ -240,7 +231,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
240
231
|
}, children)
|
|
241
232
|
};
|
|
242
233
|
},
|
|
243
|
-
ready: async (plugins) => {
|
|
234
|
+
ready: async ({ plugins }) => {
|
|
244
235
|
if (error) {
|
|
245
236
|
throw error;
|
|
246
237
|
}
|
|
@@ -252,47 +243,48 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
252
243
|
provides: {
|
|
253
244
|
translations: translations_default,
|
|
254
245
|
surface: {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
246
|
+
definitions: () => [
|
|
247
|
+
(0, import_app_framework.createSurface)({
|
|
248
|
+
id: IDENTITY_DIALOG,
|
|
249
|
+
role: "dialog",
|
|
250
|
+
filter: (data) => data.component === IDENTITY_DIALOG,
|
|
251
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(IdentityDialog, {
|
|
252
|
+
...data.subject,
|
|
253
|
+
createInvitationUrl: createDeviceInvitationUrl
|
|
254
|
+
})
|
|
255
|
+
}),
|
|
256
|
+
(0, import_app_framework.createSurface)({
|
|
257
|
+
id: JOIN_DIALOG,
|
|
258
|
+
role: "dialog",
|
|
259
|
+
filter: (data) => data.component === JOIN_DIALOG,
|
|
260
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(JoinDialog, data.subject)
|
|
261
|
+
}),
|
|
262
|
+
(0, import_app_framework.createSurface)({
|
|
263
|
+
id: RECOVER_CODE_DIALOG,
|
|
264
|
+
role: "dialog",
|
|
265
|
+
filter: (data) => data.component === RECOVER_CODE_DIALOG,
|
|
266
|
+
component: ({ data }) => /* @__PURE__ */ import_react.default.createElement(RecoveryCodeDialog, data.subject)
|
|
267
|
+
})
|
|
268
|
+
]
|
|
272
269
|
},
|
|
273
270
|
graph: {
|
|
274
271
|
builder: (plugins) => {
|
|
275
|
-
const
|
|
276
|
-
const id = `${
|
|
272
|
+
const dispatch = (0, import_app_framework.resolvePlugin)(plugins, import_app_framework.parseIntentPlugin)?.provides.intent.dispatchPromise;
|
|
273
|
+
const id = `${import_chunk_RUA5KXVW.CLIENT_PLUGIN}/open-shell`;
|
|
277
274
|
return (0, import_plugin_graph.createExtension)({
|
|
278
|
-
id:
|
|
275
|
+
id: import_chunk_RUA5KXVW.CLIENT_PLUGIN,
|
|
279
276
|
filter: (node) => node.id === "root",
|
|
280
277
|
actions: () => [
|
|
281
278
|
{
|
|
282
279
|
id,
|
|
283
280
|
data: async () => {
|
|
284
|
-
await
|
|
285
|
-
{
|
|
286
|
-
plugin: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
|
|
287
|
-
action: import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY
|
|
288
|
-
}
|
|
289
|
-
]);
|
|
281
|
+
await dispatch?.((0, import_app_framework.createIntent)(import_chunk_NFO3ADQC.ClientAction.ShareIdentity));
|
|
290
282
|
},
|
|
291
283
|
properties: {
|
|
292
284
|
label: [
|
|
293
285
|
"open shell label",
|
|
294
286
|
{
|
|
295
|
-
ns:
|
|
287
|
+
ns: import_chunk_RUA5KXVW.CLIENT_PLUGIN
|
|
296
288
|
}
|
|
297
289
|
],
|
|
298
290
|
icon: "ph--address-book--regular",
|
|
@@ -310,149 +302,108 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
310
302
|
}
|
|
311
303
|
},
|
|
312
304
|
intent: {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
await client.services.services.EdgeAgentService.createAgent(null, {
|
|
416
|
-
timeout: 1e4
|
|
417
|
-
});
|
|
418
|
-
return {
|
|
419
|
-
data: true
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
case import_chunk_XYLDQWFV.ClientAction.CREATE_RECOVERY_CODE: {
|
|
423
|
-
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
424
|
-
F: __dxlog_file,
|
|
425
|
-
L: 289,
|
|
426
|
-
S: void 0,
|
|
427
|
-
A: [
|
|
428
|
-
"client.services.services.IdentityService",
|
|
429
|
-
"'IdentityService not available'"
|
|
430
|
-
]
|
|
431
|
-
});
|
|
432
|
-
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
433
|
-
return {
|
|
434
|
-
data: true,
|
|
435
|
-
intents: [
|
|
436
|
-
[
|
|
437
|
-
{
|
|
438
|
-
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
439
|
-
data: {
|
|
440
|
-
element: "dialog",
|
|
441
|
-
dialogBlockAlign: "start",
|
|
442
|
-
dialogType: "alert",
|
|
443
|
-
state: true,
|
|
444
|
-
component: "dxos.org/plugin/client/RecoveryCodeDialog",
|
|
445
|
-
subject: {
|
|
446
|
-
code: seedphrase
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
]
|
|
451
|
-
]
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
305
|
+
resolvers: () => [
|
|
306
|
+
(0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.CreateIdentity, async () => {
|
|
307
|
+
const data = await client.halo.createIdentity();
|
|
308
|
+
return {
|
|
309
|
+
data,
|
|
310
|
+
intents: [
|
|
311
|
+
(0, import_app_framework.createIntent)(import_types.ObservabilityAction.SendEvent, {
|
|
312
|
+
name: "identity.create"
|
|
313
|
+
})
|
|
314
|
+
]
|
|
315
|
+
};
|
|
316
|
+
}),
|
|
317
|
+
(0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.JoinIdentity, async (data) => {
|
|
318
|
+
return {
|
|
319
|
+
intents: [
|
|
320
|
+
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
321
|
+
element: "dialog",
|
|
322
|
+
component: JOIN_DIALOG,
|
|
323
|
+
dialogBlockAlign: "start",
|
|
324
|
+
subject: {
|
|
325
|
+
initialInvitationCode: data.invitationCode,
|
|
326
|
+
initialDisposition: "accept-halo-invitation"
|
|
327
|
+
}
|
|
328
|
+
})
|
|
329
|
+
]
|
|
330
|
+
};
|
|
331
|
+
}),
|
|
332
|
+
(0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.ShareIdentity, async () => {
|
|
333
|
+
return {
|
|
334
|
+
intents: [
|
|
335
|
+
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
336
|
+
element: "dialog",
|
|
337
|
+
component: IDENTITY_DIALOG,
|
|
338
|
+
dialogBlockAlign: "start"
|
|
339
|
+
}),
|
|
340
|
+
(0, import_app_framework.createIntent)(import_types.ObservabilityAction.SendEvent, {
|
|
341
|
+
name: "identity.share"
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
};
|
|
345
|
+
}),
|
|
346
|
+
(0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.RecoverIdentity, async () => {
|
|
347
|
+
return {
|
|
348
|
+
intents: [
|
|
349
|
+
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
350
|
+
element: "dialog",
|
|
351
|
+
component: JOIN_DIALOG,
|
|
352
|
+
dialogBlockAlign: "start",
|
|
353
|
+
subject: {
|
|
354
|
+
initialDisposition: "recover-identity"
|
|
355
|
+
}
|
|
356
|
+
})
|
|
357
|
+
]
|
|
358
|
+
};
|
|
359
|
+
}),
|
|
360
|
+
(0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.ResetStorage, async (data) => {
|
|
361
|
+
await onReset?.({
|
|
362
|
+
target: data.target
|
|
363
|
+
});
|
|
364
|
+
return {};
|
|
365
|
+
}),
|
|
366
|
+
(0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.CreateAgent, async () => {
|
|
367
|
+
(0, import_invariant.invariant)(client.services.services.EdgeAgentService, "Missing EdgeAgentService", {
|
|
368
|
+
F: __dxlog_file,
|
|
369
|
+
L: 203,
|
|
370
|
+
S: void 0,
|
|
371
|
+
A: [
|
|
372
|
+
"client.services.services.EdgeAgentService",
|
|
373
|
+
"'Missing EdgeAgentService'"
|
|
374
|
+
]
|
|
375
|
+
});
|
|
376
|
+
await client.services.services.EdgeAgentService.createAgent(null, {
|
|
377
|
+
timeout: 1e4
|
|
378
|
+
});
|
|
379
|
+
}),
|
|
380
|
+
(0, import_app_framework.createResolver)(import_chunk_NFO3ADQC.ClientAction.CreateRecoveryCode, async () => {
|
|
381
|
+
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
382
|
+
F: __dxlog_file,
|
|
383
|
+
L: 207,
|
|
384
|
+
S: void 0,
|
|
385
|
+
A: [
|
|
386
|
+
"client.services.services.IdentityService",
|
|
387
|
+
"'IdentityService not available'"
|
|
388
|
+
]
|
|
389
|
+
});
|
|
390
|
+
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
391
|
+
return {
|
|
392
|
+
intents: [
|
|
393
|
+
(0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
|
|
394
|
+
element: "dialog",
|
|
395
|
+
dialogBlockAlign: "start",
|
|
396
|
+
dialogType: "alert",
|
|
397
|
+
state: true,
|
|
398
|
+
component: RECOVER_CODE_DIALOG,
|
|
399
|
+
subject: {
|
|
400
|
+
code: seedphrase
|
|
401
|
+
}
|
|
402
|
+
})
|
|
403
|
+
]
|
|
404
|
+
};
|
|
405
|
+
})
|
|
406
|
+
]
|
|
456
407
|
}
|
|
457
408
|
}
|
|
458
409
|
};
|
|
@@ -460,7 +411,6 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
460
411
|
var src_default = ClientPlugin;
|
|
461
412
|
// Annotate the CommonJS export names for ESM import in node:
|
|
462
413
|
0 && (module.exports = {
|
|
463
|
-
ClientPlugin
|
|
464
|
-
parseClientPlugin
|
|
414
|
+
ClientPlugin
|
|
465
415
|
});
|
|
466
416
|
//# sourceMappingURL=index.cjs.map
|