@limrun/ui 0.9.0-rc.9 → 0.13.3-rc.1
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 +430 -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-BJ__DGJ6.mjs +202 -0
- package/dist/browser-storage-C1jQLXat.js +1 -0
- package/dist/client-Bk1N3XIF.mjs +228 -0
- package/dist/client-CnbCWvCs.js +1 -0
- package/dist/components/device-install/index.d.ts +1 -2
- package/dist/core/device-install/apple/provisioning.d.ts +55 -4
- 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 +66 -0
- package/dist/device-build/signing.d.ts +20 -0
- package/dist/device-install/index.cjs +1 -1
- package/dist/device-install/index.d.ts +18 -3
- package/dist/device-install/index.js +570 -76
- package/dist/device-install/react.cjs +1 -1
- package/dist/device-install/react.d.ts +23 -1
- package/dist/device-install/react.js +93 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index-BXg7HdIs.mjs +11547 -0
- package/dist/index-CMeQfhYy.js +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +502 -495
- package/dist/limbuild-client-CFJhYsRx.mjs +79 -0
- package/dist/limbuild-client-C_CMNLYV.js +1 -0
- package/dist/provisioning-CdseoMJQ.mjs +239 -0
- package/dist/provisioning-D2ZZQeyX.js +1 -0
- package/package.json +21 -1
- package/src/app-store-relay/index.test.ts +74 -0
- package/src/app-store-relay/index.ts +447 -0
- package/src/app-store-relay/react.ts +125 -0
- package/src/components/device-install/index.ts +1 -2
- package/src/core/device-install/apple/provisioning.test.ts +84 -0
- package/src/core/device-install/apple/provisioning.ts +91 -7
- package/src/core/device-install/operations/limbuild-client.ts +33 -3
- package/src/core/device-install/storage/browser-storage.ts +29 -14
- package/src/core/device-install/types.ts +5 -1
- package/src/device-build/index.ts +42 -0
- package/src/device-build/react.ts +128 -0
- package/src/device-build/signing.ts +94 -0
- package/src/device-install/index.ts +49 -3
- package/src/device-install/react.ts +180 -1
- package/src/hooks/index.ts +1 -1
- package/src/index.ts +1 -4
- 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,95 @@
|
|
|
1
|
-
import { u as
|
|
1
|
+
import { useState as d, useRef as b, useCallback as u, useEffect as D } from "react";
|
|
2
|
+
import { closeDeviceRelayTarget as l, requestUSBAccess as N, pairDevice as q, startDeviceInstall as C } from "./index.js";
|
|
3
|
+
import { j as T, k as j } from "../browser-storage-BJ__DGJ6.mjs";
|
|
4
|
+
function F({
|
|
5
|
+
apiUrl: a,
|
|
6
|
+
token: v,
|
|
7
|
+
log: e = x
|
|
8
|
+
}) {
|
|
9
|
+
const [r, m] = d(), [o, y] = d(), [h, n] = d(), [P, c] = d(), [S, f] = d(!1), w = b(void 0), R = b(void 0), i = u(async () => {
|
|
10
|
+
w.current?.close(), w.current = void 0, await l(R.current, e);
|
|
11
|
+
}, [e]);
|
|
12
|
+
D(() => {
|
|
13
|
+
R.current = r;
|
|
14
|
+
}, [r]), D(() => () => {
|
|
15
|
+
i();
|
|
16
|
+
}, [i]);
|
|
17
|
+
const A = u(async () => {
|
|
18
|
+
n("usb"), c(void 0), f(!1);
|
|
19
|
+
let t;
|
|
20
|
+
try {
|
|
21
|
+
await i(), t = await N({ log: e });
|
|
22
|
+
const s = await T(t.hello.serialNumber);
|
|
23
|
+
return m(t), y(s), e(s ? "Pair record found" : "No pair record found", t.hello.serialNumber), t;
|
|
24
|
+
} catch (s) {
|
|
25
|
+
await l(t, e), m(void 0), y(void 0), c(p(s));
|
|
26
|
+
return;
|
|
27
|
+
} finally {
|
|
28
|
+
n(void 0);
|
|
29
|
+
}
|
|
30
|
+
}, [i, e]), B = u(async () => {
|
|
31
|
+
if (!a || !r)
|
|
32
|
+
throw new Error("Select a USB device before pairing.");
|
|
33
|
+
n("pair"), c(void 0), f(!1);
|
|
34
|
+
try {
|
|
35
|
+
await i();
|
|
36
|
+
const t = await q({
|
|
37
|
+
limbuildApiUrl: a,
|
|
38
|
+
token: v,
|
|
39
|
+
log: e,
|
|
40
|
+
target: r
|
|
41
|
+
}), s = await j(t.pairRecord, {
|
|
42
|
+
productName: r.hello.productName
|
|
43
|
+
});
|
|
44
|
+
return t.relay.close(), await l(r, e), y(s), f(!1), e("Device paired", "The pair record was stored locally in this browser."), s;
|
|
45
|
+
} catch (t) {
|
|
46
|
+
await l(r, e), f(!0), c(p(t));
|
|
47
|
+
return;
|
|
48
|
+
} finally {
|
|
49
|
+
n(void 0);
|
|
50
|
+
}
|
|
51
|
+
}, [a, i, r, e, v]), E = u(async () => {
|
|
52
|
+
if (!a || !r || !o)
|
|
53
|
+
throw new Error("Select and pair a USB device before starting installation.");
|
|
54
|
+
n("install"), c(void 0);
|
|
55
|
+
try {
|
|
56
|
+
return await i(), w.current = await C({
|
|
57
|
+
limbuildApiUrl: a,
|
|
58
|
+
token: v,
|
|
59
|
+
log: e,
|
|
60
|
+
target: r,
|
|
61
|
+
pairRecord: o
|
|
62
|
+
}), e("Device install started", "Installation will continue through the connected iPhone."), w.current;
|
|
63
|
+
} catch (t) {
|
|
64
|
+
await l(r, e), c(p(t));
|
|
65
|
+
return;
|
|
66
|
+
} finally {
|
|
67
|
+
n(void 0);
|
|
68
|
+
}
|
|
69
|
+
}, [a, i, r, e, o, v]), I = u(() => {
|
|
70
|
+
i(), e("Device relay stopped");
|
|
71
|
+
}, [i, e]);
|
|
72
|
+
return {
|
|
73
|
+
device: r,
|
|
74
|
+
pairRecord: o,
|
|
75
|
+
busyAction: h,
|
|
76
|
+
error: P,
|
|
77
|
+
pairConfirmationRequired: S,
|
|
78
|
+
hasPairRecord: !!o,
|
|
79
|
+
canPair: !!a && !h && !!r,
|
|
80
|
+
canInstall: !!a && !h && !!r && !!o,
|
|
81
|
+
requestUSBAccess: A,
|
|
82
|
+
pairBrowser: B,
|
|
83
|
+
startInstallation: E,
|
|
84
|
+
stopRelay: I,
|
|
85
|
+
clearError: () => c(void 0)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function x() {
|
|
89
|
+
}
|
|
90
|
+
function p(a) {
|
|
91
|
+
return a instanceof Error ? a.message : String(a);
|
|
92
|
+
}
|
|
2
93
|
export {
|
|
3
|
-
|
|
94
|
+
F as useDeviceInstallRelay
|
|
4
95
|
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|