@dxos/plugin-client 0.7.4 → 0.7.5-main.9cb18ac
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 +163 -221
- 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 +165 -224
- 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 +163 -221
- 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/meta.d.ts +0 -10
- package/dist/types/src/meta.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.tsx +3 -1
- package/src/meta.ts +0 -14
- 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,15 +131,14 @@ 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
144
|
code
|
|
@@ -198,7 +181,7 @@ var Code = ({ code }) => {
|
|
|
198
181
|
var translations_default = [
|
|
199
182
|
{
|
|
200
183
|
"en-US": {
|
|
201
|
-
[
|
|
184
|
+
[import_chunk_RUA5KXVW.CLIENT_PLUGIN]: {
|
|
202
185
|
"open shell label": "Open HALO",
|
|
203
186
|
"recovery code dialog title": "Account Recovery",
|
|
204
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.",
|
|
@@ -211,7 +194,6 @@ var translations_default = [
|
|
|
211
194
|
}
|
|
212
195
|
];
|
|
213
196
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-client/src/ClientPlugin.tsx";
|
|
214
|
-
var parseClientPlugin = (plugin) => (plugin?.provides).client instanceof import_react_client.Client ? plugin : void 0;
|
|
215
197
|
var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitationParam = "deviceInvitationCode", onClientInitialized, onReady, onReset, ...options }) => {
|
|
216
198
|
(0, import_react2.registerSignalsRuntime)();
|
|
217
199
|
let client;
|
|
@@ -222,7 +204,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
222
204
|
return baseUrl.toString();
|
|
223
205
|
};
|
|
224
206
|
return {
|
|
225
|
-
meta:
|
|
207
|
+
meta: import_chunk_RUA5KXVW.meta_default,
|
|
226
208
|
initialize: async () => {
|
|
227
209
|
const config = new import_config.Config(await (0, import_config.Storage)(), (0, import_config.Envs)(), (0, import_config.Local)(), (0, import_config.Defaults)());
|
|
228
210
|
client = new import_react_client.Client({
|
|
@@ -249,7 +231,7 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
249
231
|
}, children)
|
|
250
232
|
};
|
|
251
233
|
},
|
|
252
|
-
ready: async (plugins) => {
|
|
234
|
+
ready: async ({ plugins }) => {
|
|
253
235
|
if (error) {
|
|
254
236
|
throw error;
|
|
255
237
|
}
|
|
@@ -261,47 +243,48 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
261
243
|
provides: {
|
|
262
244
|
translations: translations_default,
|
|
263
245
|
surface: {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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
|
+
]
|
|
281
269
|
},
|
|
282
270
|
graph: {
|
|
283
271
|
builder: (plugins) => {
|
|
284
|
-
const
|
|
285
|
-
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`;
|
|
286
274
|
return (0, import_plugin_graph.createExtension)({
|
|
287
|
-
id:
|
|
275
|
+
id: import_chunk_RUA5KXVW.CLIENT_PLUGIN,
|
|
288
276
|
filter: (node) => node.id === "root",
|
|
289
277
|
actions: () => [
|
|
290
278
|
{
|
|
291
279
|
id,
|
|
292
280
|
data: async () => {
|
|
293
|
-
await
|
|
294
|
-
{
|
|
295
|
-
plugin: import_chunk_XYLDQWFV.CLIENT_PLUGIN,
|
|
296
|
-
action: import_chunk_XYLDQWFV.ClientAction.SHARE_IDENTITY
|
|
297
|
-
}
|
|
298
|
-
]);
|
|
281
|
+
await dispatch?.((0, import_app_framework.createIntent)(import_chunk_NFO3ADQC.ClientAction.ShareIdentity));
|
|
299
282
|
},
|
|
300
283
|
properties: {
|
|
301
284
|
label: [
|
|
302
285
|
"open shell label",
|
|
303
286
|
{
|
|
304
|
-
ns:
|
|
287
|
+
ns: import_chunk_RUA5KXVW.CLIENT_PLUGIN
|
|
305
288
|
}
|
|
306
289
|
],
|
|
307
290
|
icon: "ph--address-book--regular",
|
|
@@ -319,149 +302,108 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
319
302
|
}
|
|
320
303
|
},
|
|
321
304
|
intent: {
|
|
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
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
await client.services.services.EdgeAgentService.createAgent(null, {
|
|
425
|
-
timeout: 1e4
|
|
426
|
-
});
|
|
427
|
-
return {
|
|
428
|
-
data: true
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
case import_chunk_XYLDQWFV.ClientAction.CREATE_RECOVERY_CODE: {
|
|
432
|
-
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
433
|
-
F: __dxlog_file,
|
|
434
|
-
L: 289,
|
|
435
|
-
S: void 0,
|
|
436
|
-
A: [
|
|
437
|
-
"client.services.services.IdentityService",
|
|
438
|
-
"'IdentityService not available'"
|
|
439
|
-
]
|
|
440
|
-
});
|
|
441
|
-
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
442
|
-
return {
|
|
443
|
-
data: true,
|
|
444
|
-
intents: [
|
|
445
|
-
[
|
|
446
|
-
{
|
|
447
|
-
action: import_app_framework.LayoutAction.SET_LAYOUT,
|
|
448
|
-
data: {
|
|
449
|
-
element: "dialog",
|
|
450
|
-
dialogBlockAlign: "start",
|
|
451
|
-
dialogType: "alert",
|
|
452
|
-
state: true,
|
|
453
|
-
component: "dxos.org/plugin/client/RecoveryCodeDialog",
|
|
454
|
-
subject: {
|
|
455
|
-
code: seedphrase
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
]
|
|
460
|
-
]
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
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
|
+
]
|
|
465
407
|
}
|
|
466
408
|
}
|
|
467
409
|
};
|
|
@@ -469,7 +411,6 @@ var ClientPlugin = ({ appKey, invitationUrl = window.location.origin, invitation
|
|
|
469
411
|
var src_default = ClientPlugin;
|
|
470
412
|
// Annotate the CommonJS export names for ESM import in node:
|
|
471
413
|
0 && (module.exports = {
|
|
472
|
-
ClientPlugin
|
|
473
|
-
parseClientPlugin
|
|
414
|
+
ClientPlugin
|
|
474
415
|
});
|
|
475
416
|
//# sourceMappingURL=index.cjs.map
|