@limrun/ui 0.9.0-rc.2 → 0.9.0-rc.5

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.
Files changed (78) hide show
  1. package/README.md +0 -9
  2. package/dist/components/inspect-overlay.d.ts +33 -0
  3. package/dist/components/remote-control.d.ts +86 -0
  4. package/dist/core/ax-fetcher.d.ts +49 -0
  5. package/dist/core/ax-tree.d.ts +99 -0
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.css +1 -1
  8. package/dist/index.d.ts +3 -2
  9. package/dist/index.js +1491 -777
  10. package/package.json +8 -17
  11. package/src/components/inspect-overlay.css +223 -0
  12. package/src/components/inspect-overlay.tsx +437 -0
  13. package/src/components/remote-control.tsx +547 -9
  14. package/src/core/ax-fetcher.test.ts +418 -0
  15. package/src/core/ax-fetcher.ts +377 -0
  16. package/src/core/ax-tree.test.ts +491 -0
  17. package/src/core/ax-tree.ts +416 -0
  18. package/src/demo.tsx +93 -10
  19. package/src/index.ts +17 -2
  20. package/vite.config.ts +2 -6
  21. package/vitest.config.ts +23 -0
  22. package/dist/components/device-install/device-install-dialog.d.ts +0 -5
  23. package/dist/components/device-install/index.d.ts +0 -2
  24. package/dist/core/device-install/apple/client.d.ts +0 -17
  25. package/dist/core/device-install/apple/crypto.d.ts +0 -20
  26. package/dist/core/device-install/apple/gsa-srp.d.ts +0 -26
  27. package/dist/core/device-install/apple/index.d.ts +0 -5
  28. package/dist/core/device-install/apple/provisioning.d.ts +0 -161
  29. package/dist/core/device-install/apple/relay.d.ts +0 -29
  30. package/dist/core/device-install/index.d.ts +0 -4
  31. package/dist/core/device-install/operations/index.d.ts +0 -6
  32. package/dist/core/device-install/operations/limbuild-client.d.ts +0 -28
  33. package/dist/core/device-install/operations/operations.d.ts +0 -32
  34. package/dist/core/device-install/operations/relay-client.d.ts +0 -25
  35. package/dist/core/device-install/operations/relay-protocol.d.ts +0 -27
  36. package/dist/core/device-install/operations/usbmux.d.ts +0 -32
  37. package/dist/core/device-install/operations/webusb.d.ts +0 -21
  38. package/dist/core/device-install/storage/browser-storage.d.ts +0 -43
  39. package/dist/core/device-install/storage/index.d.ts +0 -1
  40. package/dist/core/device-install/types.d.ts +0 -48
  41. package/dist/device-install/index.cjs +0 -1
  42. package/dist/device-install/index.d.ts +0 -3
  43. package/dist/device-install/index.js +0 -77
  44. package/dist/device-install/react.cjs +0 -1
  45. package/dist/device-install/react.d.ts +0 -1
  46. package/dist/device-install/react.js +0 -4
  47. package/dist/device-install-dialog-CSwQgbBm.js +0 -2
  48. package/dist/device-install-dialog-nThj775b.mjs +0 -395
  49. package/dist/device-install-dialog.css +0 -1
  50. package/dist/hooks/index.d.ts +0 -1
  51. package/dist/hooks/use-device-install.d.ts +0 -70
  52. package/dist/use-device-install-C1uVac59.mjs +0 -13541
  53. package/dist/use-device-install-Ca4jcVKU.js +0 -31
  54. package/src/components/device-install/device-install-dialog.css +0 -244
  55. package/src/components/device-install/device-install-dialog.tsx +0 -432
  56. package/src/components/device-install/index.ts +0 -2
  57. package/src/core/device-install/apple/client.ts +0 -152
  58. package/src/core/device-install/apple/crypto.ts +0 -202
  59. package/src/core/device-install/apple/gsa-srp.ts +0 -127
  60. package/src/core/device-install/apple/index.ts +0 -5
  61. package/src/core/device-install/apple/provisioning.ts +0 -298
  62. package/src/core/device-install/apple/relay.ts +0 -221
  63. package/src/core/device-install/index.ts +0 -4
  64. package/src/core/device-install/operations/index.ts +0 -6
  65. package/src/core/device-install/operations/limbuild-client.ts +0 -104
  66. package/src/core/device-install/operations/operations.ts +0 -217
  67. package/src/core/device-install/operations/relay-client.ts +0 -255
  68. package/src/core/device-install/operations/relay-protocol.ts +0 -71
  69. package/src/core/device-install/operations/usbmux.ts +0 -270
  70. package/src/core/device-install/operations/webusb-dom.d.ts +0 -54
  71. package/src/core/device-install/operations/webusb.ts +0 -105
  72. package/src/core/device-install/storage/browser-storage.ts +0 -251
  73. package/src/core/device-install/storage/index.ts +0 -1
  74. package/src/core/device-install/types.ts +0 -65
  75. package/src/device-install/index.ts +0 -3
  76. package/src/device-install/react.ts +0 -1
  77. package/src/hooks/index.ts +0 -1
  78. package/src/hooks/use-device-install.ts +0 -1067
@@ -1,26 +0,0 @@
1
- export type AppleSRPProtocol = 's2k' | 's2k_fo';
2
- export type AppleSRPInitRequest = {
3
- a: string;
4
- accountName: string;
5
- protocols: AppleSRPProtocol[];
6
- };
7
- export type AppleSRPInitResponse = {
8
- iteration: number;
9
- salt: string;
10
- protocol: AppleSRPProtocol;
11
- b: string;
12
- c: string;
13
- };
14
- export type AppleSRPCompleteProof = {
15
- accountName: string;
16
- m1: string;
17
- m2: string;
18
- c: string;
19
- };
20
- export declare class AppleGsaSrpClient {
21
- private readonly accountName;
22
- private srpClient?;
23
- constructor(accountName: string);
24
- init(): Promise<AppleSRPInitRequest>;
25
- complete(password: string, serverData: AppleSRPInitResponse): Promise<AppleSRPCompleteProof>;
26
- }
@@ -1,5 +0,0 @@
1
- export * from './client';
2
- export * from './crypto';
3
- export * from './gsa-srp';
4
- export * from './provisioning';
5
- export * from './relay';
@@ -1,161 +0,0 @@
1
- import { ProvisioningProfileInfo, StoredSigningAssets } from '../types';
2
- import { AppleProvisioningRequest } from './relay';
3
- export type AppleDeveloperPortalTeam = {
4
- name?: string;
5
- teamId?: string;
6
- providerId?: string | number;
7
- publicProviderId?: string;
8
- type?: string;
9
- subType?: string;
10
- };
11
- export type AppleDeveloperPortalDevice = {
12
- deviceId?: string;
13
- name?: string;
14
- deviceNumber?: string;
15
- deviceClass?: string;
16
- model?: string;
17
- status?: string;
18
- };
19
- export type AppleDeveloperPortalAppID = {
20
- appId?: string;
21
- appIdId?: string;
22
- identifier?: string;
23
- bundleId?: string;
24
- name?: string;
25
- prefix?: string;
26
- platform?: string;
27
- };
28
- export type AppleDeveloperPortalResponse = {
29
- resultCode?: number;
30
- resultString?: string;
31
- userString?: string;
32
- teams?: AppleDeveloperPortalTeam[];
33
- provider?: AppleDeveloperPortalTeam;
34
- availableProviders?: AppleDeveloperPortalTeam[];
35
- appIds?: AppleDeveloperPortalAppID[];
36
- devices?: AppleDeveloperPortalDevice[];
37
- certRequests?: Array<Record<string, unknown>>;
38
- certRequest?: Record<string, unknown>;
39
- appId?: Record<string, unknown>;
40
- device?: Record<string, unknown>;
41
- provisioningProfile?: Record<string, unknown>;
42
- provisioningProfiles?: Array<Record<string, unknown>>;
43
- };
44
- export type AppleProvisioningContext = {
45
- bundleID: string;
46
- deviceUDID: string;
47
- teamID?: string;
48
- };
49
- export type AppleSigningAssetCacheInput = {
50
- bundleID: string;
51
- deviceUDID?: string;
52
- teamID?: string;
53
- };
54
- export type PutAppleGeneratedSigningAssetsInput = {
55
- bundleID: string;
56
- deviceUDID?: string;
57
- teamID?: string;
58
- certificateID?: string;
59
- certificateP12Base64: string;
60
- certificatePassword: string;
61
- provisioningProfileBase64: string;
62
- profile: ProvisioningProfileInfo;
63
- };
64
- export declare function listTeamsRequest(): AppleProvisioningRequest;
65
- export declare function findBundleIDRequest({ bundleID, teamID }: Pick<AppleProvisioningContext, 'bundleID' | 'teamID'>): {
66
- method: "POST";
67
- path: string;
68
- payload: Record<string, unknown>;
69
- };
70
- export declare function findDeviceRequest({ deviceUDID, teamID }: Pick<AppleProvisioningContext, 'deviceUDID' | 'teamID'>): {
71
- method: "POST";
72
- path: string;
73
- payload: Record<string, unknown>;
74
- };
75
- export declare function findDevelopmentCertificatesRequest(teamID?: string): {
76
- method: "POST";
77
- path: string;
78
- payload: Record<string, unknown>;
79
- };
80
- export declare function findDevelopmentProfilesRequest({ bundleID, teamID, }: Pick<AppleProvisioningContext, 'bundleID' | 'teamID'>): {
81
- method: "POST";
82
- path: string;
83
- payload: Record<string, unknown>;
84
- };
85
- export declare function registerDeviceRequest({ deviceUDID, teamID, name, }: Pick<AppleProvisioningContext, 'deviceUDID' | 'teamID'> & {
86
- name?: string;
87
- }): {
88
- method: "POST";
89
- path: string;
90
- payload: {
91
- teamId: string;
92
- deviceNames: string;
93
- deviceNumbers: string;
94
- deviceClasses: string;
95
- register: string;
96
- };
97
- };
98
- export declare function createBundleIDRequest({ bundleID, teamID, name, }: Pick<AppleProvisioningContext, 'bundleID' | 'teamID'> & {
99
- name?: string;
100
- }): {
101
- method: "POST";
102
- path: string;
103
- payload: {
104
- teamId: string;
105
- name: string;
106
- identifier: string;
107
- type: string;
108
- };
109
- };
110
- export declare function submitDevelopmentCSRRequest({ csrPEM, teamID, }: {
111
- csrPEM: string;
112
- teamID?: string;
113
- }): {
114
- method: "POST";
115
- path: string;
116
- payload: {
117
- teamId: string;
118
- type: string;
119
- csrContent: string;
120
- };
121
- };
122
- export declare function downloadCertificateRequest(certificateID: string, teamID?: string): {
123
- method: "GET";
124
- path: string;
125
- payload: {
126
- teamId: string;
127
- certificateId: string;
128
- type: string;
129
- };
130
- };
131
- export declare function createDevelopmentProfileRequest({ bundleID, teamID, appIDID, certificateID, deviceIDs, name, }: Pick<AppleProvisioningContext, 'bundleID' | 'teamID'> & {
132
- appIDID: string;
133
- certificateID: string;
134
- deviceIDs: string[];
135
- name?: string;
136
- }): {
137
- method: "POST";
138
- path: string;
139
- payload: {
140
- teamId: string;
141
- provisioningProfileName: string;
142
- certificateIds: string[];
143
- appIdId: string;
144
- deviceIds: string[];
145
- distributionType: string;
146
- subPlatform: string;
147
- };
148
- };
149
- export declare function downloadProfileRequest(profileID: string, teamID?: string): {
150
- method: "GET";
151
- path: string;
152
- payload: {
153
- teamId: string;
154
- provisioningProfileId: string;
155
- };
156
- };
157
- export declare function getReusableAppleSigningAssets({ bundleID, deviceUDID, teamID, }: AppleSigningAssetCacheInput): Promise<StoredSigningAssets | undefined>;
158
- export declare function putAppleGeneratedSigningAssets(input: PutAppleGeneratedSigningAssetsInput): Promise<StoredSigningAssets>;
159
- export declare function storedSigningAssetsReusable(stored: StoredSigningAssets, { bundleID, deviceUDID, teamID }: AppleSigningAssetCacheInput): boolean;
160
- export declare function selectDeveloperPortalTeam(body: unknown): AppleDeveloperPortalTeam | undefined;
161
- export declare function teamIDCandidates(body: unknown): string[];
@@ -1,29 +0,0 @@
1
- import { AppleSRPCompleteProof, AppleSRPInitRequest, AppleSRPInitResponse } from './gsa-srp';
2
- export type AppleRelayResponse<T = unknown> = {
3
- status: number;
4
- statusText: string;
5
- headers?: Record<string, string>;
6
- body?: T;
7
- rawBody?: string;
8
- rawBodyBase64?: string;
9
- };
10
- export type AppleProvisioningRequest = {
11
- method?: 'GET' | 'POST';
12
- path: string;
13
- payload?: unknown;
14
- };
15
- export declare function createAppleRelaySession(limbuildApiUrl: string, token?: string): Promise<{
16
- appleSessionId: string;
17
- }>;
18
- export declare function deleteAppleRelaySession(limbuildApiUrl: string, appleSessionId: string, token?: string): Promise<void>;
19
- export declare function proxySrpInit(limbuildApiUrl: string, appleSessionId: string, payload: AppleSRPInitRequest, token?: string): Promise<AppleRelayResponse<AppleSRPInitResponse>>;
20
- export declare function proxySrpComplete(limbuildApiUrl: string, appleSessionId: string, payload: AppleSRPCompleteProof & {
21
- rememberMe: boolean;
22
- trustTokens: string[];
23
- }, token?: string): Promise<AppleRelayResponse<unknown>>;
24
- export declare function triggerTrustedDeviceTwoFactor(limbuildApiUrl: string, appleSessionId: string, token?: string): Promise<AppleRelayResponse<unknown>>;
25
- export declare function triggerPhoneTwoFactor(limbuildApiUrl: string, appleSessionId: string, phoneNumberId: number, mode?: string, token?: string): Promise<AppleRelayResponse<unknown>>;
26
- export declare function proxyTwoFactorCode(limbuildApiUrl: string, appleSessionId: string, code: string, token?: string): Promise<AppleRelayResponse<unknown>>;
27
- export declare function proxyPhoneTwoFactorCode(limbuildApiUrl: string, appleSessionId: string, phoneNumberId: number, code: string, mode?: string, token?: string): Promise<AppleRelayResponse<unknown>>;
28
- export declare function fetchAppleAccountSession(limbuildApiUrl: string, appleSessionId: string, token?: string): Promise<AppleRelayResponse<unknown>>;
29
- export declare function proxyProvisioningRequest<T = unknown>(limbuildApiUrl: string, appleSessionId: string, request: AppleProvisioningRequest, token?: string): Promise<AppleRelayResponse<T>>;
@@ -1,4 +0,0 @@
1
- export * from './types';
2
- export * from './apple';
3
- export * from './operations';
4
- export * from './storage';
@@ -1,6 +0,0 @@
1
- export * from './limbuild-client';
2
- export * from './operations';
3
- export * from './relay-client';
4
- export * from './relay-protocol';
5
- export * from './usbmux';
6
- export * from './webusb';
@@ -1,28 +0,0 @@
1
- import { BuildLogLine, DeviceInstallBuildStatus } from '../types';
2
- export type LimbuildInfo = {
3
- homeDir?: string;
4
- lastBuildConfig?: {
5
- bundleId?: string;
6
- sdk?: string;
7
- };
8
- };
9
- export type StartSignedDeviceBuildOptions = {
10
- limbuildApiUrl: string;
11
- token?: string;
12
- certificateP12Base64: string;
13
- certificatePassword: string;
14
- provisioningProfileBase64: string;
15
- };
16
- export type BuildLogEventsOptions = {
17
- limbuildApiUrl: string;
18
- execId: string;
19
- token?: string;
20
- onLine: (line: BuildLogLine) => void;
21
- onStatus: (status: DeviceInstallBuildStatus) => void;
22
- onError?: (error: Error) => void;
23
- };
24
- export declare function fetchLimbuildInfo(limbuildApiUrl: string, token?: string): Promise<LimbuildInfo>;
25
- export declare function startSignedDeviceBuild({ limbuildApiUrl, token, certificateP12Base64, certificatePassword, provisioningProfileBase64, }: StartSignedDeviceBuildOptions): Promise<{
26
- execId?: string;
27
- }>;
28
- export declare function watchBuildLogEvents({ limbuildApiUrl, execId, token, onLine, onStatus, onError, }: BuildLogEventsOptions): () => void;
@@ -1,32 +0,0 @@
1
- import { DeviceHello, DeviceInstallLog, PairRecordPayload } from '../types';
2
- import { RelayClient } from './relay-client';
3
- import { UsbmuxSession } from './usbmux';
4
- import { UsbmuxCandidate } from './webusb';
5
- export type DeviceRelayTarget = {
6
- device: USBDevice;
7
- candidate: UsbmuxCandidate;
8
- session?: UsbmuxSession;
9
- claimedInterfaceNumber?: number;
10
- hello: DeviceHello;
11
- };
12
- export type RequestUSBAccessOptions = {
13
- log: DeviceInstallLog;
14
- };
15
- export type StartPairingRelayOptions = {
16
- limbuildApiUrl: string;
17
- token?: string;
18
- log: DeviceInstallLog;
19
- target: DeviceRelayTarget;
20
- };
21
- export type StartInstallRelayOptions = StartPairingRelayOptions & {
22
- pairRecord: PairRecordPayload;
23
- };
24
- export declare function requestUSBAccess({ log }: RequestUSBAccessOptions): Promise<DeviceRelayTarget>;
25
- export declare function startPairingRelay({ limbuildApiUrl, token, log, target }: StartPairingRelayOptions): Promise<{
26
- relay: RelayClient;
27
- pairRecord: PairRecordPayload;
28
- target: DeviceRelayTarget;
29
- }>;
30
- export declare function startInstallRelay({ limbuildApiUrl, token, log, target, pairRecord, }: StartInstallRelayOptions): Promise<RelayClient>;
31
- export declare function closeDeviceRelayTarget(target: DeviceRelayTarget | undefined, log?: DeviceInstallLog): Promise<void>;
32
- export declare function deviceRelayWebSocketUrl(limbuildApiUrl: string, token?: string): string;
@@ -1,25 +0,0 @@
1
- import { DeviceHello, DeviceInstallLog, PairRecordPayload } from '../types';
2
- import { UsbmuxSession } from './usbmux';
3
- export declare class RelayClient {
4
- private readonly webSocketUrl;
5
- private readonly session;
6
- private readonly deviceHello;
7
- private readonly log;
8
- private socket?;
9
- private streams;
10
- private frameQueue;
11
- private closed;
12
- private pairRecordWaiter?;
13
- constructor(webSocketUrl: string, session: UsbmuxSession, deviceHello: DeviceHello, log: DeviceInstallLog);
14
- connect(): Promise<void>;
15
- startPairing(): Promise<PairRecordPayload>;
16
- startInstall(pairRecord: PairRecordPayload): Promise<void>;
17
- close(): void;
18
- private enqueueFrame;
19
- private handleFrame;
20
- private handleError;
21
- private handlePairRecordReady;
22
- private handleOpenStream;
23
- private pumpDeviceToServer;
24
- private send;
25
- }
@@ -1,27 +0,0 @@
1
- export declare const RELAY_PROTOCOL_VERSION = 1;
2
- export declare const RELAY_HEADER_BYTES = 16;
3
- export declare const RelayMessageType: {
4
- readonly DeviceHello: 1;
5
- readonly OpenStream: 2;
6
- readonly OpenResult: 3;
7
- readonly StreamData: 4;
8
- readonly StreamClose: 5;
9
- readonly InstallProgress: 6;
10
- readonly Error: 7;
11
- readonly Ping: 8;
12
- readonly Pong: 9;
13
- readonly StartPairing: 10;
14
- readonly StartInstall: 11;
15
- readonly PairRecordReady: 12;
16
- };
17
- export type RelayMessageType = (typeof RelayMessageType)[keyof typeof RelayMessageType];
18
- export type RelayFrame = {
19
- type: RelayMessageType;
20
- requestId: number;
21
- streamId: number;
22
- payload: Uint8Array;
23
- };
24
- export declare function encodeFrame(frame: RelayFrame): Uint8Array<ArrayBuffer>;
25
- export declare function decodeFrame(data: Uint8Array): RelayFrame;
26
- export declare function encodeJson(value: unknown): Uint8Array<ArrayBufferLike>;
27
- export declare function decodeJson<T>(payload: Uint8Array): T;
@@ -1,32 +0,0 @@
1
- import { UsbmuxCandidate, getBulkEndpoints } from './webusb';
2
- export type UsbmuxSession = {
3
- device: USBDevice;
4
- candidate: UsbmuxCandidate;
5
- inEndpoint: ReturnType<typeof getBulkEndpoints>['inEndpoint'];
6
- outEndpoint: ReturnType<typeof getBulkEndpoints>['outEndpoint'];
7
- muxVersion: number;
8
- txSeq: number;
9
- rxSeq: number;
10
- nextSport: number;
11
- streams: Map<string, UsbmuxStream>;
12
- writeChain: Promise<void>;
13
- closed: boolean;
14
- };
15
- export type UsbmuxStream = {
16
- session: UsbmuxSession;
17
- sport: number;
18
- dport: number;
19
- seq: number;
20
- ack: number;
21
- queue: Uint8Array[];
22
- waiters: Array<(value: Uint8Array) => void>;
23
- error?: Error;
24
- opened: Promise<void>;
25
- resolveOpened: () => void;
26
- rejectOpened: (error: Error) => void;
27
- };
28
- export declare function createUsbmuxSession(device: USBDevice, candidate: UsbmuxCandidate): Promise<UsbmuxSession>;
29
- export declare function openStream(session: UsbmuxSession, port: number): Promise<UsbmuxStream>;
30
- export declare function sendStreamData(stream: UsbmuxStream, bytes: Uint8Array): Promise<void>;
31
- export declare function receiveStreamData(stream: UsbmuxStream): Promise<Uint8Array<ArrayBufferLike>>;
32
- export declare function closeUsbmuxSession(session: UsbmuxSession): void;
@@ -1,21 +0,0 @@
1
- export type UsbEndpoint = {
2
- endpointNumber: number;
3
- direction: 'in' | 'out';
4
- type: string;
5
- packetSize: number;
6
- };
7
- export type UsbmuxCandidate = {
8
- configurationValue: number;
9
- interfaceNumber: number;
10
- alternateSetting: number;
11
- endpoints: UsbEndpoint[];
12
- };
13
- export declare function requestAppleDevice(): Promise<USBDevice>;
14
- export declare function findUsbmuxCandidates(device: USBDevice): UsbmuxCandidate[];
15
- export declare function claimUsbmux(device: USBDevice, candidate: UsbmuxCandidate): Promise<void>;
16
- export declare function getBulkEndpoints(candidate: UsbmuxCandidate): {
17
- outEndpoint: UsbEndpoint;
18
- inEndpoint: UsbEndpoint;
19
- };
20
- export declare function transferOutWithZlp(device: USBDevice, endpoint: UsbEndpoint, bytes: Uint8Array): Promise<void>;
21
- export declare function transferIn(device: USBDevice, endpoint: UsbEndpoint, size?: number): Promise<Uint8Array<ArrayBufferLike>>;
@@ -1,43 +0,0 @@
1
- import { ProvisioningProfileInfo, PutSigningAssetsInput, StoredPairRecord, StoredSigningAssets, PairRecordPayload } from '../types';
2
- export declare function normalizeUDID(udid?: string): string;
3
- export declare function normalizeBundleID(bundleID?: string): string;
4
- export declare function getPairRecord(udid?: string): Promise<StoredPairRecord | undefined>;
5
- export declare function putPairRecord(record: PairRecordPayload, metadata?: {
6
- productName?: string;
7
- }): Promise<StoredPairRecord>;
8
- export declare function getSigningAssets({ deviceUDID, bundleID, }: {
9
- deviceUDID?: string;
10
- bundleID?: string;
11
- }): Promise<StoredSigningAssets | undefined>;
12
- export declare function getLatestSigningAssets(): Promise<StoredSigningAssets>;
13
- export declare function putSigningAssets(input: PutSigningAssetsInput): Promise<StoredSigningAssets>;
14
- export declare function findSigningAssetsForBundle(bundleID?: string): Promise<StoredSigningAssets[]>;
15
- export declare function profileContainsDevice(profile: ProvisioningProfileInfo, deviceUDID?: string): boolean;
16
- export declare function profileMatchesBundleID(profile: ProvisioningProfileInfo, bundleID?: string): boolean;
17
- export declare function parseProvisioningProfile(file: File): Promise<{
18
- name: string | undefined;
19
- uuid: string | undefined;
20
- teamID: string;
21
- applicationIdentifier: string | undefined;
22
- bundleID: string | undefined;
23
- provisionedDevices: string[];
24
- expirationDate: string | undefined;
25
- }>;
26
- export declare function parseProvisioningProfileBase64(base64: string): {
27
- name: string | undefined;
28
- uuid: string | undefined;
29
- teamID: string;
30
- applicationIdentifier: string | undefined;
31
- bundleID: string | undefined;
32
- provisionedDevices: string[];
33
- expirationDate: string | undefined;
34
- };
35
- export declare function parseProvisioningProfileBytes(bytes: Uint8Array): {
36
- name: string | undefined;
37
- uuid: string | undefined;
38
- teamID: string;
39
- applicationIdentifier: string | undefined;
40
- bundleID: string | undefined;
41
- provisionedDevices: string[];
42
- expirationDate: string | undefined;
43
- };
@@ -1 +0,0 @@
1
- export * from './browser-storage';
@@ -1,48 +0,0 @@
1
- export type DeviceInstallLog = (message: string, detail?: string) => void;
2
- export type DeviceInstallStep = 'build' | 'usb' | 'pair' | 'install';
3
- export type DeviceInstallStepStatus = 'idle' | 'active' | 'complete' | 'error';
4
- export type DeviceInstallBusyAction = 'build' | 'usb' | 'pair' | 'install';
5
- export type DeviceInstallBuildStatus = 'idle' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
6
- export type BuildLogLine = {
7
- type: 'command' | 'stdout' | 'stderr' | 'meta';
8
- data: string;
9
- };
10
- export type DeviceHello = {
11
- serialNumber?: string;
12
- productName?: string;
13
- manufacturerName?: string;
14
- productId: number;
15
- vendorId: number;
16
- };
17
- export type PairRecordPayload = {
18
- udid: string;
19
- pairRecordBase64: string;
20
- };
21
- export type StoredPairRecord = PairRecordPayload & {
22
- productName?: string;
23
- updatedAt: string;
24
- };
25
- export type ProvisioningProfileInfo = {
26
- name?: string;
27
- uuid?: string;
28
- teamID?: string;
29
- applicationIdentifier?: string;
30
- bundleID?: string;
31
- provisionedDevices: string[];
32
- expirationDate?: string;
33
- };
34
- export type StoredSigningAssets = {
35
- id: string;
36
- deviceUDID?: string;
37
- teamID?: string;
38
- bundleID: string;
39
- certificateID?: string;
40
- certificateP12Base64: string;
41
- certificateFileName?: string;
42
- certificatePassword: string;
43
- provisioningProfileBase64: string;
44
- profileFileName?: string;
45
- profile: ProvisioningProfileInfo;
46
- updatedAt: string;
47
- };
48
- export type PutSigningAssetsInput = Omit<StoredSigningAssets, 'id' | 'updatedAt'>;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../use-device-install-Ca4jcVKU.js"),t=require("../device-install-dialog-CSwQgbBm.js");exports.AppleGsaSrpClient=e.AppleGsaSrpClient;exports.RELAY_HEADER_BYTES=e.RELAY_HEADER_BYTES;exports.RELAY_PROTOCOL_VERSION=e.RELAY_PROTOCOL_VERSION;exports.RelayClient=e.RelayClient;exports.RelayMessageType=e.RelayMessageType;exports.claimUsbmux=e.claimUsbmux;exports.closeDeviceRelayTarget=e.closeDeviceRelayTarget;exports.closeUsbmuxSession=e.closeUsbmuxSession;exports.createAppleRelaySession=e.createAppleRelaySession;exports.createBundleIDRequest=e.createBundleIDRequest;exports.createDevelopmentProfileRequest=e.createDevelopmentProfileRequest;exports.createUsbmuxSession=e.createUsbmuxSession;exports.decodeFrame=e.decodeFrame;exports.decodeJson=e.decodeJson;exports.deleteAppleRelaySession=e.deleteAppleRelaySession;exports.deviceRelayWebSocketUrl=e.deviceRelayWebSocketUrl;exports.downloadCertificateRequest=e.downloadCertificateRequest;exports.downloadProfileRequest=e.downloadProfileRequest;exports.encodeFrame=e.encodeFrame;exports.encodeJson=e.encodeJson;exports.exportAppleCertificateP12=e.exportAppleCertificateP12;exports.fetchAppleAccountSession=e.fetchAppleAccountSession;exports.fetchLimbuildInfo=e.fetchLimbuildInfo;exports.findBundleIDRequest=e.findBundleIDRequest;exports.findDevelopmentCertificatesRequest=e.findDevelopmentCertificatesRequest;exports.findDevelopmentProfilesRequest=e.findDevelopmentProfilesRequest;exports.findDeviceRequest=e.findDeviceRequest;exports.findSigningAssetsForBundle=e.findSigningAssetsForBundle;exports.findUsbmuxCandidates=e.findUsbmuxCandidates;exports.generateAppleSigningKeyAndCSR=e.generateAppleSigningKeyAndCSR;exports.getBulkEndpoints=e.getBulkEndpoints;exports.getLatestSigningAssets=e.getLatestSigningAssets;exports.getPairRecord=e.getPairRecord;exports.getReusableAppleSigningAssets=e.getReusableAppleSigningAssets;exports.getSigningAssets=e.getSigningAssets;exports.listTeamsRequest=e.listTeamsRequest;exports.normalizeBundleID=e.normalizeBundleID;exports.normalizeUDID=e.normalizeUDID;exports.openStream=e.openStream;exports.parseProvisioningProfile=e.parseProvisioningProfile;exports.parseProvisioningProfileBase64=e.parseProvisioningProfileBase64;exports.parseProvisioningProfileBytes=e.parseProvisioningProfileBytes;exports.profileContainsDevice=e.profileContainsDevice;exports.profileMatchesBundleID=e.profileMatchesBundleID;exports.proxyPhoneTwoFactorCode=e.proxyPhoneTwoFactorCode;exports.proxyProvisioningRequest=e.proxyProvisioningRequest;exports.proxySrpComplete=e.proxySrpComplete;exports.proxySrpInit=e.proxySrpInit;exports.proxyTwoFactorCode=e.proxyTwoFactorCode;exports.putAppleGeneratedSigningAssets=e.putAppleGeneratedSigningAssets;exports.putPairRecord=e.putPairRecord;exports.putSigningAssets=e.putSigningAssets;exports.receiveStreamData=e.receiveStreamData;exports.registerDeviceRequest=e.registerDeviceRequest;exports.requestAppleDevice=e.requestAppleDevice;exports.requestUSBAccess=e.requestUSBAccess;exports.selectDeveloperPortalTeam=e.selectDeveloperPortalTeam;exports.sendStreamData=e.sendStreamData;exports.startBrowserOwnedAppleIDLogin=e.startBrowserOwnedAppleIDLogin;exports.startInstallRelay=e.startInstallRelay;exports.startPairingRelay=e.startPairingRelay;exports.startSignedDeviceBuild=e.startSignedDeviceBuild;exports.storedSigningAssetsReusable=e.storedSigningAssetsReusable;exports.submitDevelopmentCSRRequest=e.submitDevelopmentCSRRequest;exports.teamIDCandidates=e.teamIDCandidates;exports.transferIn=e.transferIn;exports.transferOutWithZlp=e.transferOutWithZlp;exports.triggerPhoneTwoFactor=e.triggerPhoneTwoFactor;exports.triggerTrustedDeviceTwoFactor=e.triggerTrustedDeviceTwoFactor;exports.useDeviceInstall=e.useDeviceInstall;exports.watchBuildLogEvents=e.watchBuildLogEvents;exports.DeviceInstallDialog=t.DeviceInstallDialog;exports.DeviceInstallRelay=t.DeviceInstallDialog;
@@ -1,3 +0,0 @@
1
- export * from '../core/device-install';
2
- export { DeviceInstallDialog, DeviceInstallRelay } from '../components/device-install';
3
- export { useDeviceInstall } from '../hooks/use-device-install';
@@ -1,77 +0,0 @@
1
- import { A as a, O as t, N as i, R as n, P as r, a0 as o, L as l, Z as p, q as c, d, j as g, V as u, S as R, U as D, v as S, M as f, i as m, k as A, Q as v, T as P, e as y, D as I, F as q, f as C, b as B, c as x, a as T, ab as b, $ as w, g as E, a1 as h, a9 as F, a6 as L, m as U, a8 as O, l as _, a5 as Y, a4 as k, W as z, ae as G, af as J, ag as M, ac as W, ad as H, C as K, E as N, x as V, w as Z, B as j, p as Q, a7 as X, aa as $, Y as ee, r as se, _ as ae, I as te, o as ie, X as ne, s as re, K as oe, J as le, G as pe, n as ce, h as de, t as ge, a3 as ue, a2 as Re, z as De, y as Se, u as fe, H as me } from "../use-device-install-C1uVac59.mjs";
2
- import { D as ve, D as Pe } from "../device-install-dialog-nThj775b.mjs";
3
- export {
4
- a as AppleGsaSrpClient,
5
- ve as DeviceInstallDialog,
6
- Pe as DeviceInstallRelay,
7
- t as RELAY_HEADER_BYTES,
8
- i as RELAY_PROTOCOL_VERSION,
9
- n as RelayClient,
10
- r as RelayMessageType,
11
- o as claimUsbmux,
12
- l as closeDeviceRelayTarget,
13
- p as closeUsbmuxSession,
14
- c as createAppleRelaySession,
15
- d as createBundleIDRequest,
16
- g as createDevelopmentProfileRequest,
17
- u as createUsbmuxSession,
18
- R as decodeFrame,
19
- D as decodeJson,
20
- S as deleteAppleRelaySession,
21
- f as deviceRelayWebSocketUrl,
22
- m as downloadCertificateRequest,
23
- A as downloadProfileRequest,
24
- v as encodeFrame,
25
- P as encodeJson,
26
- y as exportAppleCertificateP12,
27
- I as fetchAppleAccountSession,
28
- q as fetchLimbuildInfo,
29
- C as findBundleIDRequest,
30
- B as findDevelopmentCertificatesRequest,
31
- x as findDevelopmentProfilesRequest,
32
- T as findDeviceRequest,
33
- b as findSigningAssetsForBundle,
34
- w as findUsbmuxCandidates,
35
- E as generateAppleSigningKeyAndCSR,
36
- h as getBulkEndpoints,
37
- F as getLatestSigningAssets,
38
- L as getPairRecord,
39
- U as getReusableAppleSigningAssets,
40
- O as getSigningAssets,
41
- _ as listTeamsRequest,
42
- Y as normalizeBundleID,
43
- k as normalizeUDID,
44
- z as openStream,
45
- G as parseProvisioningProfile,
46
- J as parseProvisioningProfileBase64,
47
- M as parseProvisioningProfileBytes,
48
- W as profileContainsDevice,
49
- H as profileMatchesBundleID,
50
- K as proxyPhoneTwoFactorCode,
51
- N as proxyProvisioningRequest,
52
- V as proxySrpComplete,
53
- Z as proxySrpInit,
54
- j as proxyTwoFactorCode,
55
- Q as putAppleGeneratedSigningAssets,
56
- X as putPairRecord,
57
- $ as putSigningAssets,
58
- ee as receiveStreamData,
59
- se as registerDeviceRequest,
60
- ae as requestAppleDevice,
61
- te as requestUSBAccess,
62
- ie as selectDeveloperPortalTeam,
63
- ne as sendStreamData,
64
- re as startBrowserOwnedAppleIDLogin,
65
- oe as startInstallRelay,
66
- le as startPairingRelay,
67
- pe as startSignedDeviceBuild,
68
- ce as storedSigningAssetsReusable,
69
- de as submitDevelopmentCSRRequest,
70
- ge as teamIDCandidates,
71
- ue as transferIn,
72
- Re as transferOutWithZlp,
73
- De as triggerPhoneTwoFactor,
74
- Se as triggerTrustedDeviceTwoFactor,
75
- fe as useDeviceInstall,
76
- me as watchBuildLogEvents
77
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../use-device-install-Ca4jcVKU.js");exports.useDeviceInstall=e.useDeviceInstall;
@@ -1 +0,0 @@
1
- export { useDeviceInstall } from '../hooks/use-device-install';
@@ -1,4 +0,0 @@
1
- import { u as a } from "../use-device-install-C1uVac59.mjs";
2
- export {
3
- a as useDeviceInstall
4
- };
@@ -1,2 +0,0 @@
1
- "use strict";require('./device-install-dialog.css');const e=require("react/jsx-runtime"),u=require("react"),y=require("./use-device-install-Ca4jcVKU.js");function x(s){var n,r,a="";if(typeof s=="string"||typeof s=="number")a+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(n=0;n<d;n++)s[n]&&(r=x(s[n]))&&(a&&(a+=" "),a+=r)}else for(r in s)s[r]&&(a&&(a+=" "),a+=r);return a}function m(){for(var s,n,r=0,a="",d=arguments.length;r<d;r++)(s=arguments[r])&&(n=x(s))&&(a&&(a+=" "),a+=n);return a}const N=[{id:"build",title:"Start a device build",description:"Upload signing assets if needed, then follow the live build logs until the device build succeeds."},{id:"usb",title:"Access USB procedures",description:"Allow WebUSB access to the connected iPhone from a Chromium browser on a secure origin."},{id:"pair",title:"Pair with this browser",description:"Pair once and store the pair record locally so future installs can reuse it."},{id:"install",title:"Start installation",description:"Relay the last successful device build to the paired iPhone."}];function S({disabled:s,...n}){const[r,a]=u.useState(!1),[d,_]=u.useState(""),[h,j]=u.useState(""),[v,f]=u.useState(""),g=u.useId(),l=y.useDeviceInstall(n),b=(t,o)=>{l.setSigningFiles({[t]:o.currentTarget.files?.[0]})};return e.jsxs("div",{className:"lr-device-install",children:[e.jsx("button",{type:"button",className:"lr-device-install__trigger",disabled:s||!n.apiUrl,onClick:()=>a(!0),children:"Install to iPhone"}),r&&e.jsx("div",{className:"lr-device-install__backdrop",role:"presentation",children:e.jsxs("section",{"aria-labelledby":g,"aria-modal":"true",className:"lr-device-install__dialog",role:"dialog",children:[e.jsxs("header",{className:"lr-device-install__header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:g,children:"Install to a real iPhone"}),e.jsx("p",{children:"Follow each step to build, authorize USB, pair, and install from this browser."})]}),e.jsx("button",{type:"button",className:"lr-device-install__icon-button",onClick:()=>a(!1),children:"Close"})]}),l.error&&e.jsx("div",{className:"lr-device-install__error",children:l.error}),e.jsx("div",{className:"lr-device-install__steps",children:N.map((t,o)=>e.jsxs(A,{index:o+1,step:t,active:l.currentStep===t.id,status:l.stepStatuses[t.id],children:[t.id==="build"&&e.jsxs("div",{className:"lr-device-install__step-body",children:[e.jsxs("div",{className:"lr-device-install__grid",children:[e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Apple ID"}),e.jsx("input",{type:"email",autoComplete:"username",placeholder:"name@example.com",value:d,onChange:i=>_(i.currentTarget.value)})]}),e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Apple ID password"}),e.jsx("input",{type:"password",autoComplete:"current-password",placeholder:"Password stays in this browser",value:h,onChange:i=>j(i.currentTarget.value)})]}),e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Generated .p12 password"}),e.jsx("input",{type:"password",placeholder:"Used when exporting Apple certificate",onChange:i=>l.setSigningFiles({certificatePassword:i.currentTarget.value})})]})]}),e.jsxs("div",{className:"lr-device-install__actions",children:[e.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:s||!n.apiUrl||!d||!h||l.busyAction==="build",onClick:()=>void l.startAppleIDLogin({accountName:d,password:h}),children:l.appleSigningStatus==="authenticating"?"Signing in...":"Sign in with Apple ID"}),e.jsxs("span",{className:"lr-device-install__hint",children:["Apple password is used only by browser-side SRP. Status: ",l.appleSigningStatus]})]}),l.appleSigningStatus==="two-factor-required"&&e.jsxs("div",{className:"lr-device-install__grid",children:[e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Two-factor code"}),e.jsx("input",{type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:v,onChange:i=>f(i.currentTarget.value)})]}),e.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:!v||l.busyAction==="build",onClick:()=>void l.submitAppleTwoFactorCode(v),children:"Submit Apple ID code"})]}),l.appleTeams.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Apple Developer team"}),e.jsx("select",{value:l.selectedAppleTeamID??"",onChange:i=>l.setSelectedAppleTeamID(i.currentTarget.value||void 0),children:l.appleTeams.map((i,p)=>{const c=i.teamId??(i.providerId===void 0?void 0:String(i.providerId))??i.publicProviderId??"";return e.jsxs("option",{value:c,children:[i.name??"Apple Developer Team"," ",c?`(${c})`:""]},`${c}-${p}`)})})]}),l.applePortalSummary&&e.jsxs("p",{className:"lr-device-install__hint",children:["Found ",l.applePortalSummary.certificateCount," certificates and"," ",l.applePortalSummary.profileCount," provisioning profiles."]})]}),l.appleAppIDs.length>0&&e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Bundle ID"}),e.jsx("select",{value:l.appleBundleID,onChange:i=>l.setAppleBundleID(i.currentTarget.value),children:l.appleAppIDs.map((i,p)=>{const c=i.identifier??i.bundleId??"";return e.jsxs("option",{value:c,children:[i.name??c," ",c?`(${c})`:""]},`${c}-${p}`)})})]}),e.jsxs("div",{className:"lr-device-install__grid",children:[e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Certificate (.p12)"}),e.jsx("input",{type:"file",accept:".p12,application/x-pkcs12",onChange:i=>b("certificateFile",i)})]}),e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Provisioning profile"}),e.jsx("input",{type:"file",accept:".mobileprovision",onChange:i=>b("provisioningProfileFile",i)})]}),e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Uploaded .p12 password"}),e.jsx("input",{type:"password",placeholder:"Export password",onChange:i=>l.setSigningFiles({certificatePassword:i.currentTarget.value})})]})]}),e.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:s||!l.canBuild,onClick:()=>void l.startDeviceBuild(),children:l.busyAction==="build"?"Starting build...":"Start device build"}),e.jsxs("details",{className:"lr-device-install__build-logs",open:l.buildLogPanelOpen,onToggle:i=>l.setBuildLogPanelOpen(i.currentTarget.open),children:[e.jsxs("summary",{children:["Build logs (",l.buildStatus,")"]}),e.jsx("pre",{children:l.buildLogs.length>0?l.buildLogs.filter(i=>i.type!=="meta").map(i=>i.data).join(`
2
- `):"Build logs will appear here while the device build is running."})]})]}),t.id==="usb"&&e.jsxs("div",{className:"lr-device-install__step-body",children:[e.jsx("p",{children:"WebUSB works in Chromium browsers on secure origins. Connect the iPhone over USB and approve the browser permission prompt."}),e.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:s||!l.canRequestUSBAccess,onClick:()=>void l.requestUSBAccess(),children:l.busyAction==="usb"?"Selecting iPhone...":"Allow USB access"}),l.device&&e.jsx("div",{className:"lr-device-install__device",children:`${l.device.productName??"iPhone"} ${l.device.serialNumber??""}`.trim()}),l.appleDevices.length>0&&e.jsxs("label",{className:"lr-device-install__field",children:[e.jsx("span",{children:"Apple Developer devices"}),e.jsx("select",{multiple:!0,value:l.selectedAppleDeviceIDs,onChange:i=>l.setSelectedAppleDeviceIDs(Array.from(i.currentTarget.selectedOptions).map(p=>p.value)),children:l.appleDevices.map(i=>e.jsxs("option",{value:i.deviceId??"",children:[i.name??i.model??"Apple device"," ",i.deviceNumber??""]},i.deviceId??i.deviceNumber))})]}),l.device&&!l.connectedAppleDeviceRegistered&&e.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:s||!!l.busyAction,onClick:()=>void l.registerConnectedAppleDevice(),children:"Register connected iPhone"}),e.jsx("button",{type:"button",className:"lr-device-install__secondary",disabled:s||!l.canPrepareAppleSigningAssets,onClick:()=>void l.prepareAppleSigningAssets(),children:l.appleSigningStatus==="preparing-assets"?"Preparing signing assets...":"Generate certificate and profile"}),l.hasSigningAssets&&e.jsx("p",{children:"Signing assets are stored in this browser for the selected bundle and device."})]}),t.id==="pair"&&e.jsxs("div",{className:"lr-device-install__step-body",children:[l.pairConfirmationRequired&&e.jsxs("p",{children:["Unlock the iPhone and tap ",e.jsx("strong",{children:"Trust"})," in the system dialog, then confirm the pair record."]}),e.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:s||!l.canPairBrowser,onClick:()=>void l.pairBrowser(),children:l.busyAction==="pair"?"Pairing...":l.pairConfirmationRequired?"Confirm pair record":"Pair browser"}),e.jsx("p",{children:l.hasPairRecord?"Pair record is stored locally. Installation is available.":"Pair this browser once before installing."})]}),t.id==="install"&&e.jsxs("div",{className:"lr-device-install__step-body",children:[e.jsx("button",{type:"button",className:"lr-device-install__primary",disabled:s||!l.canInstall,onClick:()=>void l.startInstallation(),children:l.busyAction==="install"?"Installing...":"Install last build"}),e.jsx("button",{type:"button",className:"lr-device-install__secondary",onClick:l.stopRelay,children:"Stop relay"})]})]},t.id))}),e.jsxs("footer",{className:"lr-device-install__logs",children:[e.jsx("h3",{children:"Progress"}),e.jsx("ol",{children:l.logs.map((t,o)=>e.jsx("li",{children:t},`${o}-${t.slice(0,24)}`))})]})]})})]})}function A({index:s,step:n,active:r,status:a,children:d}){return e.jsxs("article",{className:m("lr-device-install__step",r&&"lr-device-install__step--active"),children:[e.jsxs("div",{className:"lr-device-install__step-header",children:[e.jsx("div",{className:"lr-device-install__step-number",children:s}),e.jsxs("div",{children:[e.jsx("h3",{children:n.title}),e.jsx("p",{children:n.description})]}),e.jsx("span",{className:m("lr-device-install__status",`lr-device-install__status--${a}`),children:a})]}),d]})}exports.DeviceInstallDialog=S;exports.clsx=m;