@limrun/ui 0.13.3-rc.1 → 0.13.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/app-store-relay/index.cjs +4 -4
- package/dist/app-store-relay/index.js +175 -119
- package/dist/app-store-relay/react.cjs +1 -1
- package/dist/app-store-relay/react.js +2 -2
- package/dist/{browser-storage-BJ__DGJ6.mjs → browser-storage-Cx9eW-bm.mjs} +48 -45
- package/dist/browser-storage-jJaIht4K.js +1 -0
- package/dist/{client-CnbCWvCs.js → client-ASLtHFLh.js} +1 -1
- package/dist/{client-Bk1N3XIF.mjs → client-CGdh8yoJ.mjs} +33 -27
- package/dist/components/remote-control.d.ts +144 -0
- package/dist/core/device-install/apple/provisioning.d.ts +4 -4
- package/dist/device-build/index.cjs +1 -1
- package/dist/device-build/index.js +5 -5
- package/dist/device-build/react.cjs +1 -1
- package/dist/device-build/react.js +15 -13
- package/dist/device-install/demo/demo.d.ts +0 -0
- package/dist/device-install/index.cjs +1 -1
- package/dist/device-install/index.d.ts +1 -1
- package/dist/device-install/index.js +134 -121
- package/dist/device-install/react.cjs +1 -1
- package/dist/device-install/react.js +55 -50
- package/dist/{index-BXg7HdIs.mjs → index-DFdCvi2_.mjs} +3 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +1336 -1089
- package/dist/limbuild-client-CgEncrgx.js +1 -0
- package/dist/{limbuild-client-CFJhYsRx.mjs → limbuild-client-D7U7w342.mjs} +4 -2
- package/dist/{provisioning-CdseoMJQ.mjs → provisioning-DKbkBO-p.mjs} +11 -11
- package/dist/{provisioning-D2ZZQeyX.js → provisioning-Va0PH4Kk.js} +1 -1
- package/package.json +1 -1
- package/src/app-store-relay/index.test.ts +1 -5
- package/src/app-store-relay/index.ts +109 -42
- package/src/app-store-relay/react.ts +6 -2
- package/src/components/remote-control.tsx +726 -0
- package/src/core/device-install/apple/client.ts +29 -22
- package/src/core/device-install/apple/crypto.ts +9 -6
- package/src/core/device-install/apple/gsa-srp.ts +3 -7
- package/src/core/device-install/apple/provisioning.ts +16 -18
- package/src/core/device-install/apple/relay.ts +5 -1
- package/src/core/device-install/operations/limbuild-client.ts +8 -1
- package/src/core/device-install/operations/operations.ts +3 -1
- package/src/core/device-install/operations/relay-client.ts +57 -27
- package/src/core/device-install/operations/usbmux.ts +3 -3
- package/src/core/device-install/operations/webusb.ts +9 -4
- package/src/core/device-install/storage/browser-storage.ts +20 -6
- package/src/core/device-install/types.ts +1 -7
- package/src/device-build/react.ts +4 -1
- package/src/device-install/README.md +423 -0
- package/src/device-install/demo/demo.css +493 -0
- package/src/device-install/demo/demo.tsx +1069 -0
- package/src/device-install/demo/index.html +12 -0
- package/src/device-install/index.ts +7 -7
- package/src/device-install/react.ts +26 -17
- package/src/index.ts +1 -1
- package/dist/browser-storage-C1jQLXat.js +0 -1
- package/dist/limbuild-client-C_CMNLYV.js +0 -1
|
@@ -1,88 +1,93 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { closeDeviceRelayTarget as
|
|
3
|
-
import { j as T, k as j } from "../browser-storage-
|
|
1
|
+
import { useState as u, useRef as h, useCallback as l, useEffect as D } from "react";
|
|
2
|
+
import { closeDeviceRelayTarget as d, requestUSBAccess as N, pairDevice as q, startDeviceInstall as C } from "./index.js";
|
|
3
|
+
import { j as T, k as j } from "../browser-storage-Cx9eW-bm.mjs";
|
|
4
4
|
function F({
|
|
5
5
|
apiUrl: a,
|
|
6
6
|
token: v,
|
|
7
|
-
log:
|
|
7
|
+
log: R = x
|
|
8
8
|
}) {
|
|
9
|
-
const [
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const [e, m] = u(), [n, y] = u(), [g, s] = u(), [P, i] = u(), [S, f] = u(!1), w = h(void 0), b = h(void 0), r = h(R);
|
|
10
|
+
r.current = R;
|
|
11
|
+
const c = l(async () => {
|
|
12
|
+
w.current?.close(), w.current = void 0, await d(b.current, r.current);
|
|
13
|
+
}, []);
|
|
12
14
|
D(() => {
|
|
13
|
-
|
|
14
|
-
}, [
|
|
15
|
-
|
|
16
|
-
}, [
|
|
17
|
-
const A =
|
|
18
|
-
|
|
15
|
+
b.current = e;
|
|
16
|
+
}, [e]), D(() => () => {
|
|
17
|
+
c();
|
|
18
|
+
}, [c]);
|
|
19
|
+
const A = l(async () => {
|
|
20
|
+
s("usb"), i(void 0), f(!1);
|
|
19
21
|
let t;
|
|
20
22
|
try {
|
|
21
|
-
await
|
|
22
|
-
const
|
|
23
|
-
return m(t), y(
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
await c(), t = await N({ log: r.current });
|
|
24
|
+
const o = await T(t.hello.serialNumber);
|
|
25
|
+
return m(t), y(o), r.current(
|
|
26
|
+
o ? "Pair record found" : "No pair record found",
|
|
27
|
+
t.hello.serialNumber
|
|
28
|
+
), t;
|
|
29
|
+
} catch (o) {
|
|
30
|
+
await d(t, r.current), m(void 0), y(void 0), i(p(o));
|
|
26
31
|
return;
|
|
27
32
|
} finally {
|
|
28
|
-
|
|
33
|
+
s(void 0);
|
|
29
34
|
}
|
|
30
|
-
}, [
|
|
31
|
-
if (!a || !
|
|
35
|
+
}, [c]), B = l(async () => {
|
|
36
|
+
if (!a || !e)
|
|
32
37
|
throw new Error("Select a USB device before pairing.");
|
|
33
|
-
|
|
38
|
+
s("pair"), i(void 0), f(!1);
|
|
34
39
|
try {
|
|
35
|
-
await
|
|
40
|
+
await c();
|
|
36
41
|
const t = await q({
|
|
37
42
|
limbuildApiUrl: a,
|
|
38
43
|
token: v,
|
|
39
|
-
log:
|
|
40
|
-
target:
|
|
41
|
-
}),
|
|
42
|
-
productName:
|
|
44
|
+
log: r.current,
|
|
45
|
+
target: e
|
|
46
|
+
}), o = await j(t.pairRecord, {
|
|
47
|
+
productName: e.hello.productName
|
|
43
48
|
});
|
|
44
|
-
return t.relay.close(), await
|
|
49
|
+
return t.relay.close(), await d(e, r.current), y(o), f(!1), r.current("Device paired", "The pair record was stored locally in this browser."), o;
|
|
45
50
|
} catch (t) {
|
|
46
|
-
await
|
|
51
|
+
await d(e, r.current), f(!0), i(p(t));
|
|
47
52
|
return;
|
|
48
53
|
} finally {
|
|
49
|
-
|
|
54
|
+
s(void 0);
|
|
50
55
|
}
|
|
51
|
-
}, [a,
|
|
52
|
-
if (!a || !
|
|
56
|
+
}, [a, c, e, v]), E = l(async () => {
|
|
57
|
+
if (!a || !e || !n)
|
|
53
58
|
throw new Error("Select and pair a USB device before starting installation.");
|
|
54
|
-
|
|
59
|
+
s("install"), i(void 0);
|
|
55
60
|
try {
|
|
56
|
-
return await
|
|
61
|
+
return await c(), w.current = await C({
|
|
57
62
|
limbuildApiUrl: a,
|
|
58
63
|
token: v,
|
|
59
|
-
log:
|
|
60
|
-
target:
|
|
61
|
-
pairRecord:
|
|
62
|
-
}),
|
|
64
|
+
log: r.current,
|
|
65
|
+
target: e,
|
|
66
|
+
pairRecord: n
|
|
67
|
+
}), r.current("Device install started", "Installation will continue through the connected iPhone."), w.current;
|
|
63
68
|
} catch (t) {
|
|
64
|
-
await
|
|
69
|
+
await d(e, r.current), i(p(t));
|
|
65
70
|
return;
|
|
66
71
|
} finally {
|
|
67
|
-
|
|
72
|
+
s(void 0);
|
|
68
73
|
}
|
|
69
|
-
}, [a,
|
|
70
|
-
|
|
71
|
-
}, [
|
|
74
|
+
}, [a, c, e, n, v]), I = l(() => {
|
|
75
|
+
c(), r.current("Device relay stopped");
|
|
76
|
+
}, [c]);
|
|
72
77
|
return {
|
|
73
|
-
device:
|
|
74
|
-
pairRecord:
|
|
75
|
-
busyAction:
|
|
78
|
+
device: e,
|
|
79
|
+
pairRecord: n,
|
|
80
|
+
busyAction: g,
|
|
76
81
|
error: P,
|
|
77
82
|
pairConfirmationRequired: S,
|
|
78
|
-
hasPairRecord: !!
|
|
79
|
-
canPair: !!a && !
|
|
80
|
-
canInstall: !!a && !
|
|
83
|
+
hasPairRecord: !!n,
|
|
84
|
+
canPair: !!a && !g && !!e,
|
|
85
|
+
canInstall: !!a && !g && !!e && !!n,
|
|
81
86
|
requestUSBAccess: A,
|
|
82
87
|
pairBrowser: B,
|
|
83
88
|
startInstallation: E,
|
|
84
89
|
stopRelay: I,
|
|
85
|
-
clearError: () =>
|
|
90
|
+
clearError: () => i(void 0)
|
|
86
91
|
};
|
|
87
92
|
}
|
|
88
93
|
function x() {
|
|
@@ -228,13 +228,9 @@ class kn {
|
|
|
228
228
|
async function vn(t, e, r, d) {
|
|
229
229
|
let T = new Uint8Array(await wt.hash(Na.h, Vt(Ir(e))));
|
|
230
230
|
t === "s2k_fo" && (T = Ir(wt.toHex(T)));
|
|
231
|
-
const x = await crypto.subtle.importKey(
|
|
232
|
-
"
|
|
233
|
-
|
|
234
|
-
{ name: "PBKDF2" },
|
|
235
|
-
!1,
|
|
236
|
-
["deriveBits"]
|
|
237
|
-
), l = await crypto.subtle.deriveBits(
|
|
231
|
+
const x = await crypto.subtle.importKey("raw", Vt(T), { name: "PBKDF2" }, !1, [
|
|
232
|
+
"deriveBits"
|
|
233
|
+
]), l = await crypto.subtle.deriveBits(
|
|
238
234
|
{
|
|
239
235
|
name: "PBKDF2",
|
|
240
236
|
hash: { name: "SHA-256" },
|