@limrun/ui 0.9.0-rc.9 → 0.13.3
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/README.md +25 -8
- package/dist/app-store-relay/index.cjs +9 -0
- package/dist/app-store-relay/index.d.ts +102 -0
- package/dist/app-store-relay/index.js +486 -0
- package/dist/app-store-relay/react.cjs +1 -0
- package/dist/app-store-relay/react.d.ts +15 -0
- package/dist/app-store-relay/react.js +65 -0
- package/dist/browser-storage-Cx9eW-bm.mjs +205 -0
- package/dist/browser-storage-jJaIht4K.js +1 -0
- package/dist/client-ASLtHFLh.js +1 -0
- package/dist/client-CGdh8yoJ.mjs +234 -0
- package/dist/components/device-install/index.d.ts +1 -2
- package/dist/core/device-install/apple/provisioning.d.ts +58 -7
- package/dist/core/device-install/operations/limbuild-client.d.ts +15 -1
- package/dist/core/device-install/storage/browser-storage.d.ts +9 -5
- package/dist/core/device-install/types.d.ts +4 -1
- package/dist/device-build/index.cjs +1 -0
- package/dist/device-build/index.d.ts +4 -0
- package/dist/device-build/index.js +84 -0
- package/dist/device-build/react.cjs +1 -0
- package/dist/device-build/react.d.ts +20 -0
- package/dist/device-build/react.js +68 -0
- package/dist/device-build/signing.d.ts +20 -0
- 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 +18 -3
- package/dist/device-install/index.js +583 -76
- package/dist/device-install/react.cjs +1 -1
- package/dist/device-install/react.d.ts +23 -1
- package/dist/device-install/react.js +98 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index-CMeQfhYy.js +22 -0
- package/dist/index-DFdCvi2_.mjs +11543 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +502 -495
- package/dist/limbuild-client-CgEncrgx.js +1 -0
- package/dist/limbuild-client-D7U7w342.mjs +81 -0
- package/dist/provisioning-DKbkBO-p.mjs +239 -0
- package/dist/provisioning-Va0PH4Kk.js +1 -0
- package/package.json +21 -1
- package/src/app-store-relay/index.test.ts +70 -0
- package/src/app-store-relay/index.ts +514 -0
- package/src/app-store-relay/react.ts +129 -0
- package/src/components/device-install/index.ts +1 -2
- 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.test.ts +84 -0
- package/src/core/device-install/apple/provisioning.ts +98 -16
- package/src/core/device-install/apple/relay.ts +5 -1
- package/src/core/device-install/operations/limbuild-client.ts +41 -4
- 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 +43 -14
- package/src/core/device-install/types.ts +6 -8
- package/src/device-build/index.ts +42 -0
- package/src/device-build/react.ts +131 -0
- package/src/device-build/signing.ts +94 -0
- 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 +49 -3
- package/src/device-install/react.ts +189 -1
- package/src/hooks/index.ts +1 -1
- package/src/index.ts +0 -3
- package/vite.config.ts +4 -0
- package/dist/components/device-install/device-install-dialog.d.ts +0 -5
- package/dist/device-install-dialog-CqxDEH85.mjs +0 -443
- package/dist/device-install-dialog-jvqQ-fuo.js +0 -2
- package/dist/device-install-dialog.css +0 -1
- package/dist/hooks/use-device-install.d.ts +0 -73
- package/dist/use-device-install-CAPli9MR.js +0 -31
- package/dist/use-device-install-H8dqqvbR.mjs +0 -13624
- package/src/components/device-install/device-install-dialog.css +0 -325
- package/src/components/device-install/device-install-dialog.tsx +0 -495
- package/src/hooks/use-device-install.ts +0 -1219
|
@@ -1,4 +1,100 @@
|
|
|
1
|
-
import { u as
|
|
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
|
+
function F({
|
|
5
|
+
apiUrl: a,
|
|
6
|
+
token: v,
|
|
7
|
+
log: R = x
|
|
8
|
+
}) {
|
|
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
|
+
}, []);
|
|
14
|
+
D(() => {
|
|
15
|
+
b.current = e;
|
|
16
|
+
}, [e]), D(() => () => {
|
|
17
|
+
c();
|
|
18
|
+
}, [c]);
|
|
19
|
+
const A = l(async () => {
|
|
20
|
+
s("usb"), i(void 0), f(!1);
|
|
21
|
+
let t;
|
|
22
|
+
try {
|
|
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));
|
|
31
|
+
return;
|
|
32
|
+
} finally {
|
|
33
|
+
s(void 0);
|
|
34
|
+
}
|
|
35
|
+
}, [c]), B = l(async () => {
|
|
36
|
+
if (!a || !e)
|
|
37
|
+
throw new Error("Select a USB device before pairing.");
|
|
38
|
+
s("pair"), i(void 0), f(!1);
|
|
39
|
+
try {
|
|
40
|
+
await c();
|
|
41
|
+
const t = await q({
|
|
42
|
+
limbuildApiUrl: a,
|
|
43
|
+
token: v,
|
|
44
|
+
log: r.current,
|
|
45
|
+
target: e
|
|
46
|
+
}), o = await j(t.pairRecord, {
|
|
47
|
+
productName: e.hello.productName
|
|
48
|
+
});
|
|
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;
|
|
50
|
+
} catch (t) {
|
|
51
|
+
await d(e, r.current), f(!0), i(p(t));
|
|
52
|
+
return;
|
|
53
|
+
} finally {
|
|
54
|
+
s(void 0);
|
|
55
|
+
}
|
|
56
|
+
}, [a, c, e, v]), E = l(async () => {
|
|
57
|
+
if (!a || !e || !n)
|
|
58
|
+
throw new Error("Select and pair a USB device before starting installation.");
|
|
59
|
+
s("install"), i(void 0);
|
|
60
|
+
try {
|
|
61
|
+
return await c(), w.current = await C({
|
|
62
|
+
limbuildApiUrl: a,
|
|
63
|
+
token: v,
|
|
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;
|
|
68
|
+
} catch (t) {
|
|
69
|
+
await d(e, r.current), i(p(t));
|
|
70
|
+
return;
|
|
71
|
+
} finally {
|
|
72
|
+
s(void 0);
|
|
73
|
+
}
|
|
74
|
+
}, [a, c, e, n, v]), I = l(() => {
|
|
75
|
+
c(), r.current("Device relay stopped");
|
|
76
|
+
}, [c]);
|
|
77
|
+
return {
|
|
78
|
+
device: e,
|
|
79
|
+
pairRecord: n,
|
|
80
|
+
busyAction: g,
|
|
81
|
+
error: P,
|
|
82
|
+
pairConfirmationRequired: S,
|
|
83
|
+
hasPairRecord: !!n,
|
|
84
|
+
canPair: !!a && !g && !!e,
|
|
85
|
+
canInstall: !!a && !g && !!e && !!n,
|
|
86
|
+
requestUSBAccess: A,
|
|
87
|
+
pairBrowser: B,
|
|
88
|
+
startInstallation: E,
|
|
89
|
+
stopRelay: I,
|
|
90
|
+
clearError: () => i(void 0)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function x() {
|
|
94
|
+
}
|
|
95
|
+
function p(a) {
|
|
96
|
+
return a instanceof Error ? a.message : String(a);
|
|
97
|
+
}
|
|
2
98
|
export {
|
|
3
|
-
|
|
99
|
+
F as useDeviceInstallRelay
|
|
4
100
|
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|