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

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.
@@ -8,6 +8,7 @@ export type AppleIDLoginInput = {
8
8
  export type AppleIDLoginResult = {
9
9
  appleSessionId: string;
10
10
  completeResponse: AppleRelayResponse;
11
+ twoFactorChallengeResponse?: AppleRelayResponse;
11
12
  requiresTwoFactor: boolean;
12
13
  finishTwoFactor: (code: string) => Promise<AppleRelayResponse>;
13
14
  finalize: () => Promise<AppleRelayResponse>;
@@ -8,13 +8,37 @@ export type AppleDeveloperPortalTeam = {
8
8
  type?: string;
9
9
  subType?: string;
10
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
+ };
11
28
  export type AppleDeveloperPortalResponse = {
29
+ resultCode?: number;
30
+ resultString?: string;
31
+ userString?: string;
12
32
  teams?: AppleDeveloperPortalTeam[];
13
33
  provider?: AppleDeveloperPortalTeam;
14
34
  availableProviders?: AppleDeveloperPortalTeam[];
15
- appIds?: Array<Record<string, unknown>>;
16
- devices?: Array<Record<string, unknown>>;
35
+ appIds?: AppleDeveloperPortalAppID[];
36
+ devices?: AppleDeveloperPortalDevice[];
17
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>;
18
42
  provisioningProfiles?: Array<Record<string, unknown>>;
19
43
  };
20
44
  export type AppleProvisioningContext = {
@@ -41,49 +65,34 @@ export declare function listTeamsRequest(): AppleProvisioningRequest;
41
65
  export declare function findBundleIDRequest({ bundleID, teamID }: Pick<AppleProvisioningContext, 'bundleID' | 'teamID'>): {
42
66
  method: "POST";
43
67
  path: string;
44
- payload: {
45
- pageNumber: number;
46
- pageSize: number;
47
- teamId: string;
48
- };
68
+ payload: Record<string, unknown>;
49
69
  };
50
70
  export declare function findDeviceRequest({ deviceUDID, teamID }: Pick<AppleProvisioningContext, 'deviceUDID' | 'teamID'>): {
51
71
  method: "POST";
52
72
  path: string;
53
- payload: {
54
- pageNumber: number;
55
- pageSize: number;
56
- teamId: string;
57
- };
73
+ payload: Record<string, unknown>;
58
74
  };
59
75
  export declare function findDevelopmentCertificatesRequest(teamID?: string): {
60
76
  method: "POST";
61
77
  path: string;
62
- payload: {
63
- pageNumber: number;
64
- pageSize: number;
65
- teamId: string;
66
- };
78
+ payload: Record<string, unknown>;
67
79
  };
68
80
  export declare function findDevelopmentProfilesRequest({ bundleID, teamID, }: Pick<AppleProvisioningContext, 'bundleID' | 'teamID'>): {
69
81
  method: "POST";
70
82
  path: string;
71
- payload: {
72
- pageNumber: number;
73
- pageSize: number;
74
- teamId: string;
75
- };
83
+ payload: Record<string, unknown>;
76
84
  };
77
- export declare function registerDeviceRequest({ deviceUDID, teamID, name, }: AppleProvisioningContext & {
85
+ export declare function registerDeviceRequest({ deviceUDID, teamID, name, }: Pick<AppleProvisioningContext, 'deviceUDID' | 'teamID'> & {
78
86
  name?: string;
79
87
  }): {
80
88
  method: "POST";
81
89
  path: string;
82
90
  payload: {
83
91
  teamId: string;
84
- name: string;
85
- deviceNumber: string;
86
- deviceClass: string;
92
+ deviceNames: string;
93
+ deviceNumbers: string;
94
+ deviceClasses: string;
95
+ register: string;
87
96
  };
88
97
  };
89
98
  export declare function createBundleIDRequest({ bundleID, teamID, name, }: Pick<AppleProvisioningContext, 'bundleID' | 'teamID'> & {
@@ -106,15 +115,17 @@ export declare function submitDevelopmentCSRRequest({ csrPEM, teamID, }: {
106
115
  path: string;
107
116
  payload: {
108
117
  teamId: string;
118
+ type: string;
109
119
  csrContent: string;
110
120
  };
111
121
  };
112
122
  export declare function downloadCertificateRequest(certificateID: string, teamID?: string): {
113
- method: "POST";
123
+ method: "GET";
114
124
  path: string;
115
125
  payload: {
116
126
  teamId: string;
117
127
  certificateId: string;
128
+ type: string;
118
129
  };
119
130
  };
120
131
  export declare function createDevelopmentProfileRequest({ bundleID, teamID, appIDID, certificateID, deviceIDs, name, }: Pick<AppleProvisioningContext, 'bundleID' | 'teamID'> & {
@@ -127,16 +138,16 @@ export declare function createDevelopmentProfileRequest({ bundleID, teamID, appI
127
138
  path: string;
128
139
  payload: {
129
140
  teamId: string;
130
- appIdId: string;
141
+ provisioningProfileName: string;
131
142
  certificateIds: string[];
143
+ appIdId: string;
132
144
  deviceIds: string[];
133
- distributionMethod: string;
134
- name: string;
145
+ distributionType: string;
135
146
  subPlatform: string;
136
147
  };
137
148
  };
138
149
  export declare function downloadProfileRequest(profileID: string, teamID?: string): {
139
- method: "POST";
150
+ method: "GET";
140
151
  path: string;
141
152
  payload: {
142
153
  teamId: string;
@@ -5,13 +5,7 @@ export type AppleRelayResponse<T = unknown> = {
5
5
  headers?: Record<string, string>;
6
6
  body?: T;
7
7
  rawBody?: string;
8
- bodyBase64?: string;
9
- };
10
- export type AppleRelayRequest = {
11
- method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
12
- url: string;
13
- headers?: Record<string, string>;
14
- body?: BodyInit;
8
+ rawBodyBase64?: string;
15
9
  };
16
10
  export type AppleProvisioningRequest = {
17
11
  method?: 'GET' | 'POST';
@@ -22,12 +16,14 @@ export declare function createAppleRelaySession(limbuildApiUrl: string, token?:
22
16
  appleSessionId: string;
23
17
  }>;
24
18
  export declare function deleteAppleRelaySession(limbuildApiUrl: string, appleSessionId: string, token?: string): Promise<void>;
25
- export declare function relayAppleRequest<T = unknown>(limbuildApiUrl: string, appleSessionId: string, request: AppleRelayRequest, token?: string): Promise<AppleRelayResponse<T>>;
26
19
  export declare function proxySrpInit(limbuildApiUrl: string, appleSessionId: string, payload: AppleSRPInitRequest, token?: string): Promise<AppleRelayResponse<AppleSRPInitResponse>>;
27
20
  export declare function proxySrpComplete(limbuildApiUrl: string, appleSessionId: string, payload: AppleSRPCompleteProof & {
28
21
  rememberMe: boolean;
29
22
  trustTokens: string[];
30
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>>;
31
26
  export declare function proxyTwoFactorCode(limbuildApiUrl: string, appleSessionId: string, code: string, token?: string): Promise<AppleRelayResponse<unknown>>;
32
- export declare function finalizeAppleRelaySession(limbuildApiUrl: string, appleSessionId: 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>>;
33
29
  export declare function proxyProvisioningRequest<T = unknown>(limbuildApiUrl: string, appleSessionId: string, request: AppleProvisioningRequest, token?: string): Promise<AppleRelayResponse<T>>;
@@ -23,3 +23,21 @@ export declare function parseProvisioningProfile(file: File): Promise<{
23
23
  provisionedDevices: string[];
24
24
  expirationDate: string | undefined;
25
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,9 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../use-device-install-DDKRf6IL.js"),d=require("../device-install-dialog-CTwVViYY.js"),y={name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"};async function A(t){if(!crypto.subtle)throw new Error("WebCrypto is not available in this browser.");const n=await crypto.subtle.generateKey(y,!0,["sign","verify"]),r=new Uint8Array(await crypto.subtle.exportKey("spki",n.publicKey)),i=l(v(0),R(t),r,D(0,new Uint8Array)),s=new Uint8Array(await crypto.subtle.sign("RSASSA-PKCS1-v1_5",n.privateKey,U(i))),o=l(i,l(f("1.2.840.113549.1.1.11"),b()),P(s)),g=new Uint8Array(await crypto.subtle.exportKey("pkcs8",n.privateKey));return{privateKey:n.privateKey,privateKeyPKCS8Base64:c(g),publicKeySPKIBase64:c(r),csrPEM:E("CERTIFICATE REQUEST",o),csrBase64:c(o)}}function S(t){if(!t.certificateBase64&&!t.certificatePEM)throw new Error("certificateBase64 or certificatePEM is required.");const n=e.forge.pki.privateKeyFromPem(C("PRIVATE KEY",t.privateKeyPKCS8Base64)),r=t.certificatePEM?e.forge.pki.certificateFromPem(t.certificatePEM):e.forge.pki.certificateFromAsn1(e.forge.asn1.fromDer(e.forge.util.createBuffer(h(t.certificateBase64)))),i=e.forge.pkcs12.toPkcs12Asn1(n,[r],t.password,{algorithm:"3des",friendlyName:t.friendlyName}),s=e.forge.asn1.toDer(i).getBytes();return q(s)}function R(t){const n=[p("2.5.4.3",I(t.commonName))];return t.emailAddress&&n.push(p("1.2.840.113549.1.9.1",w(t.emailAddress))),l(...n)}function p(t,n){return m(l(f(t),n))}function l(...t){return a(48,u(...t))}function m(...t){return a(49,u(...t))}function D(t,n){return a(160+t,n)}function v(t){return a(2,new Uint8Array([t]))}function b(){return new Uint8Array([5,0])}function I(t){return a(12,new TextEncoder().encode(t))}function w(t){return a(22,new TextEncoder().encode(t))}function P(t){return a(3,u(new Uint8Array([0]),t))}function f(t){const n=t.split(".").map(i=>parseInt(i,10));if(n.length<2||n.some(i=>!Number.isFinite(i)))throw new Error(`Invalid OID: ${t}`);const r=[n[0]*40+n[1]];for(const i of n.slice(2)){const s=[i&127];let o=i>>7;for(;o>0;)s.unshift(o&127|128),o>>=7;r.push(...s)}return a(6,new Uint8Array(r))}function a(t,n){return u(new Uint8Array([t]),B(n.byteLength),n)}function B(t){if(t<128)return new Uint8Array([t]);const n=[];let r=t;for(;r>0;)n.unshift(r&255),r>>=8;return new Uint8Array([128|n.length,...n])}function u(...t){const n=t.reduce((s,o)=>s+o.byteLength,0),r=new Uint8Array(n);let i=0;for(const s of t)r.set(s,i),i+=s.byteLength;return r}function E(t,n){const i=c(n).match(/.{1,64}/g)??[];return`-----BEGIN ${t}-----
2
- ${i.join(`
3
- `)}
4
- -----END ${t}-----
5
- `}function C(t,n){const r=n.match(/.{1,64}/g)??[];return`-----BEGIN ${t}-----
6
- ${r.join(`
7
- `)}
8
- -----END ${t}-----
9
- `}function c(t){let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n)}function q(t){return btoa(t)}function h(t){return atob(t)}function U(t){const n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}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.fetchLimbuildInfo=e.fetchLimbuildInfo;exports.finalizeAppleRelaySession=e.finalizeAppleRelaySession;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.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.profileContainsDevice=e.profileContainsDevice;exports.profileMatchesBundleID=e.profileMatchesBundleID;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.relayAppleRequest=e.relayAppleRequest;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.useDeviceInstall=e.useDeviceInstall;exports.watchBuildLogEvents=e.watchBuildLogEvents;exports.DeviceInstallDialog=d.DeviceInstallDialog;exports.DeviceInstallRelay=d.DeviceInstallDialog;exports.exportAppleCertificateP12=S;exports.generateAppleSigningKeyAndCSR=A;
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,212 +1,77 @@
1
- import { f as o } from "../use-device-install-CgrOKKyi.mjs";
2
- import { A as T, L, K as k, R as F, M as N, Z as O, I as M, W as $, o as _, e as G, i as Y, S as z, O as V, Q as W, q as j, J as H, h as J, j as Q, N as Z, P as X, C as ee, z as te, a as re, c as se, d as ne, b as ae, a8 as ie, Y as oe, _ as ce, a6 as ue, a3 as le, k as fe, a5 as pe, l as de, a2 as ye, a1 as ge, T as me, ab as Ae, a9 as Se, aa as Re, B as be, x as we, w as De, y as ve, p as Be, a4 as Ee, a7 as Ie, V as Pe, r as he, v as Ce, X as Ke, F as Ue, n as qe, U as xe, s as Te, H as Le, G as ke, D as Fe, m as Ne, g as Oe, t as Me, a0 as $e, $ as _e, u as Ge, E as Ye } from "../use-device-install-CgrOKKyi.mjs";
3
- import { D as Ve, D as We } from "../device-install-dialog-zzKJu7SM.mjs";
4
- const y = {
5
- name: "RSASSA-PKCS1-v1_5",
6
- modulusLength: 2048,
7
- publicExponent: new Uint8Array([1, 0, 1]),
8
- hash: "SHA-256"
9
- };
10
- async function K(e) {
11
- if (!crypto.subtle)
12
- throw new Error("WebCrypto is not available in this browser.");
13
- const t = await crypto.subtle.generateKey(y, !0, ["sign", "verify"]), r = new Uint8Array(await crypto.subtle.exportKey("spki", t.publicKey)), s = c(
14
- S(0),
15
- g(e),
16
- r,
17
- A(0, new Uint8Array())
18
- ), n = new Uint8Array(
19
- await crypto.subtle.sign("RSASSA-PKCS1-v1_5", t.privateKey, h(s))
20
- ), a = c(
21
- s,
22
- c(p("1.2.840.113549.1.1.11"), R()),
23
- D(n)
24
- ), d = new Uint8Array(await crypto.subtle.exportKey("pkcs8", t.privateKey));
25
- return {
26
- privateKey: t.privateKey,
27
- privateKeyPKCS8Base64: u(d),
28
- publicKeySPKIBase64: u(r),
29
- csrPEM: B("CERTIFICATE REQUEST", a),
30
- csrBase64: u(a)
31
- };
32
- }
33
- function U(e) {
34
- if (!e.certificateBase64 && !e.certificatePEM)
35
- throw new Error("certificateBase64 or certificatePEM is required.");
36
- const t = o.pki.privateKeyFromPem(
37
- E("PRIVATE KEY", e.privateKeyPKCS8Base64)
38
- ), r = e.certificatePEM ? o.pki.certificateFromPem(e.certificatePEM) : o.pki.certificateFromAsn1(
39
- o.asn1.fromDer(o.util.createBuffer(P(e.certificateBase64)))
40
- ), s = o.pkcs12.toPkcs12Asn1(t, [r], e.password, {
41
- algorithm: "3des",
42
- friendlyName: e.friendlyName
43
- }), n = o.asn1.toDer(s).getBytes();
44
- return I(n);
45
- }
46
- function g(e) {
47
- const t = [f("2.5.4.3", b(e.commonName))];
48
- return e.emailAddress && t.push(f("1.2.840.113549.1.9.1", w(e.emailAddress))), c(...t);
49
- }
50
- function f(e, t) {
51
- return m(c(p(e), t));
52
- }
53
- function c(...e) {
54
- return i(48, l(...e));
55
- }
56
- function m(...e) {
57
- return i(49, l(...e));
58
- }
59
- function A(e, t) {
60
- return i(160 + e, t);
61
- }
62
- function S(e) {
63
- return i(2, new Uint8Array([e]));
64
- }
65
- function R() {
66
- return new Uint8Array([5, 0]);
67
- }
68
- function b(e) {
69
- return i(12, new TextEncoder().encode(e));
70
- }
71
- function w(e) {
72
- return i(22, new TextEncoder().encode(e));
73
- }
74
- function D(e) {
75
- return i(3, l(new Uint8Array([0]), e));
76
- }
77
- function p(e) {
78
- const t = e.split(".").map((s) => parseInt(s, 10));
79
- if (t.length < 2 || t.some((s) => !Number.isFinite(s)))
80
- throw new Error(`Invalid OID: ${e}`);
81
- const r = [t[0] * 40 + t[1]];
82
- for (const s of t.slice(2)) {
83
- const n = [s & 127];
84
- let a = s >> 7;
85
- for (; a > 0; )
86
- n.unshift(a & 127 | 128), a >>= 7;
87
- r.push(...n);
88
- }
89
- return i(6, new Uint8Array(r));
90
- }
91
- function i(e, t) {
92
- return l(new Uint8Array([e]), v(t.byteLength), t);
93
- }
94
- function v(e) {
95
- if (e < 128)
96
- return new Uint8Array([e]);
97
- const t = [];
98
- let r = e;
99
- for (; r > 0; )
100
- t.unshift(r & 255), r >>= 8;
101
- return new Uint8Array([128 | t.length, ...t]);
102
- }
103
- function l(...e) {
104
- const t = e.reduce((n, a) => n + a.byteLength, 0), r = new Uint8Array(t);
105
- let s = 0;
106
- for (const n of e)
107
- r.set(n, s), s += n.byteLength;
108
- return r;
109
- }
110
- function B(e, t) {
111
- const s = u(t).match(/.{1,64}/g) ?? [];
112
- return `-----BEGIN ${e}-----
113
- ${s.join(`
114
- `)}
115
- -----END ${e}-----
116
- `;
117
- }
118
- function E(e, t) {
119
- const r = t.match(/.{1,64}/g) ?? [];
120
- return `-----BEGIN ${e}-----
121
- ${r.join(`
122
- `)}
123
- -----END ${e}-----
124
- `;
125
- }
126
- function u(e) {
127
- let t = "";
128
- for (const r of e)
129
- t += String.fromCharCode(r);
130
- return btoa(t);
131
- }
132
- function I(e) {
133
- return btoa(e);
134
- }
135
- function P(e) {
136
- return atob(e);
137
- }
138
- function h(e) {
139
- const t = new Uint8Array(e.byteLength);
140
- return t.set(e), t.buffer;
141
- }
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";
142
3
  export {
143
- T as AppleGsaSrpClient,
144
- Ve as DeviceInstallDialog,
145
- We as DeviceInstallRelay,
146
- L as RELAY_HEADER_BYTES,
147
- k as RELAY_PROTOCOL_VERSION,
148
- F as RelayClient,
149
- N as RelayMessageType,
150
- O as claimUsbmux,
151
- M as closeDeviceRelayTarget,
152
- $ as closeUsbmuxSession,
153
- _ as createAppleRelaySession,
154
- G as createBundleIDRequest,
155
- Y as createDevelopmentProfileRequest,
156
- z as createUsbmuxSession,
157
- V as decodeFrame,
158
- W as decodeJson,
159
- j as deleteAppleRelaySession,
160
- H as deviceRelayWebSocketUrl,
161
- J as downloadCertificateRequest,
162
- Q as downloadProfileRequest,
163
- Z as encodeFrame,
164
- X as encodeJson,
165
- U as exportAppleCertificateP12,
166
- ee as fetchLimbuildInfo,
167
- te as finalizeAppleRelaySession,
168
- re as findBundleIDRequest,
169
- se as findDevelopmentCertificatesRequest,
170
- ne as findDevelopmentProfilesRequest,
171
- ae as findDeviceRequest,
172
- ie as findSigningAssetsForBundle,
173
- oe as findUsbmuxCandidates,
174
- K as generateAppleSigningKeyAndCSR,
175
- ce as getBulkEndpoints,
176
- ue as getLatestSigningAssets,
177
- le as getPairRecord,
178
- fe as getReusableAppleSigningAssets,
179
- pe as getSigningAssets,
180
- de as listTeamsRequest,
181
- ye as normalizeBundleID,
182
- ge as normalizeUDID,
183
- me as openStream,
184
- Ae as parseProvisioningProfile,
185
- Se as profileContainsDevice,
186
- Re as profileMatchesBundleID,
187
- be as proxyProvisioningRequest,
188
- we as proxySrpComplete,
189
- De as proxySrpInit,
190
- ve as proxyTwoFactorCode,
191
- Be as putAppleGeneratedSigningAssets,
192
- Ee as putPairRecord,
193
- Ie as putSigningAssets,
194
- Pe as receiveStreamData,
195
- he as registerDeviceRequest,
196
- Ce as relayAppleRequest,
197
- Ke as requestAppleDevice,
198
- Ue as requestUSBAccess,
199
- qe as selectDeveloperPortalTeam,
200
- xe as sendStreamData,
201
- Te as startBrowserOwnedAppleIDLogin,
202
- Le as startInstallRelay,
203
- ke as startPairingRelay,
204
- Fe as startSignedDeviceBuild,
205
- Ne as storedSigningAssetsReusable,
206
- Oe as submitDevelopmentCSRRequest,
207
- Me as teamIDCandidates,
208
- $e as transferIn,
209
- _e as transferOutWithZlp,
210
- Ge as useDeviceInstall,
211
- Ye as watchBuildLogEvents
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
212
77
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../use-device-install-DDKRf6IL.js");exports.useDeviceInstall=e.useDeviceInstall;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../use-device-install-Ca4jcVKU.js");exports.useDeviceInstall=e.useDeviceInstall;
@@ -1,4 +1,4 @@
1
- import { u as a } from "../use-device-install-CgrOKKyi.mjs";
1
+ import { u as a } from "../use-device-install-C1uVac59.mjs";
2
2
  export {
3
3
  a as useDeviceInstall
4
4
  };
@@ -0,0 +1,2 @@
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;