@limrun/ui 0.14.0-rc.3 → 0.14.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.
- package/dist/app-store-relay/index.cjs +3 -3
- package/dist/app-store-relay/index.d.ts +108 -4
- package/dist/app-store-relay/index.js +353 -160
- package/dist/app-store-relay/react.cjs +1 -1
- package/dist/app-store-relay/react.js +32 -33
- package/dist/apple-credentials/index.cjs +1 -0
- package/dist/apple-credentials/index.d.ts +110 -0
- package/dist/apple-credentials/index.js +291 -0
- package/dist/browser-storage-BnO-Ma-e.mjs +219 -0
- package/dist/browser-storage-DLxIqZk5.js +1 -0
- package/dist/client-C9z_sgOf.js +1 -0
- package/dist/{client-C8ZDEjtD.mjs → client-CFDB4mX5.mjs} +38 -31
- package/dist/components/remote-control.d.ts +156 -0
- package/dist/core/device-install/apple/provisioning.d.ts +25 -0
- package/dist/core/device-install/apple/relay.d.ts +13 -0
- package/dist/core/device-install/storage/browser-storage.d.ts +8 -0
- package/dist/core/device-install/storage/index.d.ts +1 -0
- package/dist/core/device-install/storage/secret-store.d.ts +124 -0
- package/dist/core/device-install/types.d.ts +6 -0
- package/dist/core/errors.d.ts +1 -0
- package/dist/core/play-publish/google.d.ts +1 -1
- package/dist/device-build/index.cjs +1 -1
- package/dist/device-build/index.js +21 -20
- package/dist/device-build/react.cjs +1 -1
- package/dist/device-build/react.js +42 -43
- package/dist/device-install/index.cjs +1 -1
- package/dist/device-install/index.js +64 -63
- package/dist/device-install/react.cjs +1 -1
- package/dist/device-install/react.js +47 -49
- package/dist/errors-BSkqS7U-.js +1 -0
- package/dist/errors-gy8yQJos.mjs +6 -0
- package/dist/gsa-srp-Bme3JLEi.mjs +266 -0
- package/dist/gsa-srp-CCIfUz7Y.js +1 -0
- package/dist/index-ChhtuQ7e.js +22 -0
- package/dist/index-YDu8K9a4.mjs +11279 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1405 -1125
- package/dist/play-publish/index.cjs +1 -1
- package/dist/play-publish/index.js +27 -24
- package/dist/play-publish/react.cjs +1 -1
- package/dist/play-publish/react.d.ts +12 -2
- package/dist/play-publish/react.js +70 -60
- package/dist/{provisioning-BmsEnF6X.mjs → provisioning-CDPvxd1h.mjs} +64 -33
- package/dist/provisioning-CbC4h--7.js +1 -0
- package/package.json +6 -1
- package/src/app-store-relay/index.ts +358 -23
- package/src/app-store-relay/react.ts +1 -4
- package/src/apple-credentials/index.test.ts +180 -0
- package/src/apple-credentials/index.ts +388 -0
- package/src/components/remote-control.css +32 -0
- package/src/components/remote-control.tsx +865 -5
- package/src/core/device-install/apple/client.ts +13 -6
- package/src/core/device-install/apple/provisioning.test.ts +30 -0
- package/src/core/device-install/apple/provisioning.ts +39 -0
- package/src/core/device-install/apple/relay.ts +20 -0
- package/src/core/device-install/operations/operations.ts +7 -5
- package/src/core/device-install/storage/browser-storage.test.ts +65 -0
- package/src/core/device-install/storage/browser-storage.ts +33 -0
- package/src/core/device-install/storage/index.ts +1 -0
- package/src/core/device-install/storage/secret-store.ts +332 -0
- package/src/core/device-install/types.ts +6 -0
- package/src/core/errors.ts +3 -0
- package/src/core/play-publish/google.ts +11 -2
- package/src/device-build/react.ts +1 -4
- package/src/device-install/demo/demo.tsx +1 -4
- package/src/device-install/react.ts +1 -4
- package/src/play-publish/README.md +5 -4
- package/src/play-publish/react.ts +72 -32
- package/vite.config.ts +1 -0
- package/dist/browser-storage-Cx9eW-bm.mjs +0 -205
- package/dist/browser-storage-jJaIht4K.js +0 -1
- package/dist/client-BtC4n_qf.js +0 -1
- package/dist/index-CMeQfhYy.js +0 -22
- package/dist/index-DFdCvi2_.mjs +0 -11543
- package/dist/provisioning-Va0PH4Kk.js +0 -1
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import { A as
|
|
3
|
-
import { f as
|
|
4
|
-
import { A as
|
|
5
|
-
import { l as
|
|
6
|
-
const
|
|
1
|
+
import { p as g, a as d } from "../client-CFDB4mX5.mjs";
|
|
2
|
+
import { A as Ne, f as Oe, o as Fe, b as ze, c as Ve, d as He, e as _e, s as Ge, t as Me, g as We } from "../client-CFDB4mX5.mjs";
|
|
3
|
+
import { f as l } from "../index-YDu8K9a4.mjs";
|
|
4
|
+
import { A as Qe } from "../gsa-srp-Bme3JLEi.mjs";
|
|
5
|
+
import { l as C, f as q, a as B, s as R, b as T, d as E, c as K, e as $, h as k, i as U, r as L, j as x, k as N, m as O, n as F, o as z, q as V, t as H } from "../provisioning-CDPvxd1h.mjs";
|
|
6
|
+
const _ = {
|
|
7
7
|
name: "RSASSA-PKCS1-v1_5",
|
|
8
8
|
modulusLength: 2048,
|
|
9
9
|
publicExponent: new Uint8Array([1, 0, 1]),
|
|
10
10
|
hash: "SHA-256"
|
|
11
11
|
};
|
|
12
|
-
async function
|
|
12
|
+
async function de(e) {
|
|
13
13
|
if (!crypto.subtle)
|
|
14
14
|
throw new Error("WebCrypto is not available in this browser.");
|
|
15
|
-
const t = await crypto.subtle.generateKey(
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const t = await crypto.subtle.generateKey(_, !0, ["sign", "verify"]), r = new Uint8Array(await crypto.subtle.exportKey("spki", t.publicKey)), n = f(
|
|
16
|
+
j(0),
|
|
17
|
+
G(e),
|
|
18
18
|
r,
|
|
19
|
-
|
|
19
|
+
W(0, new Uint8Array())
|
|
20
20
|
), i = new Uint8Array(
|
|
21
21
|
await crypto.subtle.sign(
|
|
22
22
|
"RSASSA-PKCS1-v1_5",
|
|
23
23
|
t.privateKey,
|
|
24
|
-
|
|
24
|
+
ie(n)
|
|
25
25
|
)
|
|
26
|
-
), o =
|
|
26
|
+
), o = f(
|
|
27
27
|
n,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
),
|
|
28
|
+
f(D("1.2.840.113549.1.1.11"), Q()),
|
|
29
|
+
Y(i)
|
|
30
|
+
), a = new Uint8Array(await crypto.subtle.exportKey("pkcs8", t.privateKey));
|
|
31
31
|
return {
|
|
32
32
|
privateKey: t.privateKey,
|
|
33
|
-
privateKeyPKCS8Base64:
|
|
34
|
-
publicKeySPKIBase64:
|
|
35
|
-
csrPEM:
|
|
36
|
-
csrBase64:
|
|
33
|
+
privateKeyPKCS8Base64: m(a),
|
|
34
|
+
publicKeySPKIBase64: m(r),
|
|
35
|
+
csrPEM: ee("CERTIFICATE REQUEST", o),
|
|
36
|
+
csrBase64: m(o)
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function fe(e) {
|
|
40
40
|
if (!e.certificateBase64 && !e.certificatePEM)
|
|
41
41
|
throw new Error("certificateBase64 or certificatePEM is required.");
|
|
42
|
-
const t =
|
|
43
|
-
|
|
44
|
-
), n =
|
|
42
|
+
const t = l.pki.privateKeyFromPem(te("PRIVATE KEY", e.privateKeyPKCS8Base64)), r = e.certificatePEM ? l.pki.certificateFromPem(e.certificatePEM) : l.pki.certificateFromAsn1(
|
|
43
|
+
l.asn1.fromDer(l.util.createBuffer(ne(e.certificateBase64)))
|
|
44
|
+
), n = l.pkcs12.toPkcs12Asn1(t, [r], e.password, {
|
|
45
45
|
algorithm: "3des",
|
|
46
46
|
friendlyName: e.friendlyName
|
|
47
|
-
}), i =
|
|
48
|
-
return
|
|
47
|
+
}), i = l.asn1.toDer(n).getBytes();
|
|
48
|
+
return re(i);
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const t = [
|
|
52
|
-
return e.emailAddress && t.push(
|
|
50
|
+
function G(e) {
|
|
51
|
+
const t = [I("2.5.4.3", J(e.commonName))];
|
|
52
|
+
return e.emailAddress && t.push(I("1.2.840.113549.1.9.1", X(e.emailAddress))), f(...t);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
54
|
+
function I(e, t) {
|
|
55
|
+
return M(f(D(e), t));
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return c(48,
|
|
57
|
+
function f(...e) {
|
|
58
|
+
return c(48, w(...e));
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return c(49,
|
|
60
|
+
function M(...e) {
|
|
61
|
+
return c(49, w(...e));
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function W(e, t) {
|
|
64
64
|
return c(160 + e, t);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function j(e) {
|
|
67
67
|
return c(2, new Uint8Array([e]));
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Q() {
|
|
70
70
|
return new Uint8Array([5, 0]);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function J(e) {
|
|
73
73
|
return c(12, new TextEncoder().encode(e));
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function X(e) {
|
|
76
76
|
return c(22, new TextEncoder().encode(e));
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
return c(3,
|
|
78
|
+
function Y(e) {
|
|
79
|
+
return c(3, w(new Uint8Array([0]), e));
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function D(e) {
|
|
82
82
|
const t = e.split(".").map((n) => parseInt(n, 10));
|
|
83
83
|
if (t.length < 2 || t.some((n) => !Number.isFinite(n)))
|
|
84
84
|
throw new Error(`Invalid OID: ${e}`);
|
|
@@ -93,9 +93,9 @@ function b(e) {
|
|
|
93
93
|
return c(6, new Uint8Array(r));
|
|
94
94
|
}
|
|
95
95
|
function c(e, t) {
|
|
96
|
-
return
|
|
96
|
+
return w(new Uint8Array([e]), Z(t.byteLength), t);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function Z(e) {
|
|
99
99
|
if (e < 128)
|
|
100
100
|
return new Uint8Array([e]);
|
|
101
101
|
const t = [];
|
|
@@ -104,22 +104,22 @@ function _(e) {
|
|
|
104
104
|
t.unshift(r & 255), r >>= 8;
|
|
105
105
|
return new Uint8Array([128 | t.length, ...t]);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function w(...e) {
|
|
108
108
|
const t = e.reduce((i, o) => i + o.byteLength, 0), r = new Uint8Array(t);
|
|
109
109
|
let n = 0;
|
|
110
110
|
for (const i of e)
|
|
111
111
|
r.set(i, n), n += i.byteLength;
|
|
112
112
|
return r;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
const n =
|
|
114
|
+
function ee(e, t) {
|
|
115
|
+
const n = m(t).match(/.{1,64}/g) ?? [];
|
|
116
116
|
return `-----BEGIN ${e}-----
|
|
117
117
|
${n.join(`
|
|
118
118
|
`)}
|
|
119
119
|
-----END ${e}-----
|
|
120
120
|
`;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function te(e, t) {
|
|
123
123
|
const r = t.match(/.{1,64}/g) ?? [];
|
|
124
124
|
return `-----BEGIN ${e}-----
|
|
125
125
|
${r.join(`
|
|
@@ -127,90 +127,90 @@ ${r.join(`
|
|
|
127
127
|
-----END ${e}-----
|
|
128
128
|
`;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function m(e) {
|
|
131
131
|
let t = "";
|
|
132
132
|
for (const r of e)
|
|
133
133
|
t += String.fromCharCode(r);
|
|
134
134
|
return btoa(t);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function re(e) {
|
|
137
137
|
return btoa(e);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function ne(e) {
|
|
140
140
|
return atob(e);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function ie(e) {
|
|
143
143
|
const t = new Uint8Array(e.byteLength);
|
|
144
144
|
return t.set(e), t.buffer;
|
|
145
145
|
}
|
|
146
|
-
async function
|
|
146
|
+
async function s({
|
|
147
147
|
relay: e,
|
|
148
148
|
request: t,
|
|
149
149
|
label: r = "Apple Developer Portal request",
|
|
150
150
|
validatePortalResponse: n = !0,
|
|
151
151
|
mapBody: i
|
|
152
152
|
}) {
|
|
153
|
-
const o = await
|
|
154
|
-
return n &&
|
|
153
|
+
const o = await g(e, t);
|
|
154
|
+
return n && se(o.body, r), i ? i(o.body, o) : o;
|
|
155
155
|
}
|
|
156
|
-
async function
|
|
157
|
-
return
|
|
156
|
+
async function ye(e) {
|
|
157
|
+
return s({
|
|
158
158
|
...e,
|
|
159
|
-
request:
|
|
159
|
+
request: C(),
|
|
160
160
|
label: "Apple Developer team list",
|
|
161
|
-
mapBody: (t) =>
|
|
161
|
+
mapBody: (t) => pe([
|
|
162
162
|
...t?.teams ?? [],
|
|
163
163
|
...t?.availableProviders ?? [],
|
|
164
164
|
...t?.provider ? [t.provider] : []
|
|
165
165
|
])
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
async function
|
|
168
|
+
async function Ae({
|
|
169
169
|
certificateKind: e = "development",
|
|
170
170
|
teamId: t = "",
|
|
171
171
|
...r
|
|
172
172
|
}) {
|
|
173
|
-
return
|
|
173
|
+
return s({
|
|
174
174
|
...r,
|
|
175
|
-
request: e === "distribution" ?
|
|
175
|
+
request: e === "distribution" ? q(t) : B(t),
|
|
176
176
|
label: "Apple Developer certificate list",
|
|
177
177
|
mapBody: (n) => n?.certRequests ?? []
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
async function
|
|
180
|
+
async function me({
|
|
181
181
|
certificateKind: e = "development",
|
|
182
182
|
teamId: t = "",
|
|
183
183
|
csrPEM: r,
|
|
184
184
|
...n
|
|
185
185
|
}) {
|
|
186
|
-
return
|
|
186
|
+
return s({
|
|
187
187
|
...n,
|
|
188
|
-
request: e === "distribution" ?
|
|
188
|
+
request: e === "distribution" ? R({ csrPEM: r, teamID: t }) : T({ csrPEM: r, teamID: t }),
|
|
189
189
|
label: e === "distribution" ? "Apple Distribution certificate creation" : "Apple Development certificate creation",
|
|
190
190
|
mapBody: (i) => i?.certRequest
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function ve({
|
|
194
194
|
certificateKind: e = "development",
|
|
195
195
|
certificateId: t,
|
|
196
196
|
teamId: r = "",
|
|
197
197
|
...n
|
|
198
198
|
}) {
|
|
199
|
-
return
|
|
199
|
+
return s({
|
|
200
200
|
...n,
|
|
201
|
-
request: e === "distribution" ?
|
|
201
|
+
request: e === "distribution" ? E(t, r) : K(t, r),
|
|
202
202
|
label: "Apple certificate download",
|
|
203
203
|
validatePortalResponse: !1,
|
|
204
204
|
mapBody: (i, o) => o
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
|
-
async function
|
|
207
|
+
async function we({
|
|
208
208
|
certificateKind: e = "development",
|
|
209
209
|
certificateId: t,
|
|
210
210
|
teamId: r = "",
|
|
211
211
|
...n
|
|
212
212
|
}) {
|
|
213
|
-
return
|
|
213
|
+
return s({
|
|
214
214
|
...n,
|
|
215
215
|
request: {
|
|
216
216
|
method: "POST",
|
|
@@ -225,49 +225,49 @@ async function ce({
|
|
|
225
225
|
mapBody: (i) => i
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
-
async function
|
|
228
|
+
async function be({
|
|
229
229
|
teamId: e = "",
|
|
230
230
|
search: t = "",
|
|
231
231
|
...r
|
|
232
232
|
}) {
|
|
233
233
|
const n = t.trim().toLowerCase();
|
|
234
|
-
return
|
|
234
|
+
return s({
|
|
235
235
|
...r,
|
|
236
|
-
request:
|
|
236
|
+
request: $({ bundleID: t, teamID: e }),
|
|
237
237
|
label: "Apple bundle ID list",
|
|
238
238
|
// Apple's listAppIds.action returns the full paginated list and does not
|
|
239
239
|
// honor a server-side search filter, so apply the `search` filter here.
|
|
240
240
|
mapBody: (i) => {
|
|
241
241
|
const o = i?.appIds ?? [];
|
|
242
242
|
return n ? o.filter(
|
|
243
|
-
(
|
|
244
|
-
(
|
|
243
|
+
(a) => [a.identifier, a.bundleId, a.name].some(
|
|
244
|
+
(p) => typeof p == "string" && p.toLowerCase().includes(n)
|
|
245
245
|
)
|
|
246
246
|
) : o;
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
async function
|
|
250
|
+
async function Ie({
|
|
251
251
|
teamId: e = "",
|
|
252
252
|
bundleId: t,
|
|
253
253
|
name: r,
|
|
254
254
|
...n
|
|
255
255
|
}) {
|
|
256
|
-
return
|
|
256
|
+
return s({
|
|
257
257
|
...n,
|
|
258
|
-
request:
|
|
258
|
+
request: k({ bundleID: t, teamID: e, name: r }),
|
|
259
259
|
label: "Apple bundle ID creation",
|
|
260
260
|
mapBody: (i) => i?.appId
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
-
async function
|
|
263
|
+
async function Se({
|
|
264
264
|
teamId: e = "",
|
|
265
265
|
appIdId: t,
|
|
266
266
|
bundleId: r,
|
|
267
267
|
name: n,
|
|
268
268
|
...i
|
|
269
269
|
}) {
|
|
270
|
-
return
|
|
270
|
+
return s({
|
|
271
271
|
...i,
|
|
272
272
|
request: {
|
|
273
273
|
method: "POST",
|
|
@@ -283,8 +283,8 @@ async function ue({
|
|
|
283
283
|
mapBody: (o) => o?.appId
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
|
-
async function
|
|
287
|
-
return
|
|
286
|
+
async function De({ teamId: e = "", appIdId: t, ...r }) {
|
|
287
|
+
return s({
|
|
288
288
|
...r,
|
|
289
289
|
request: {
|
|
290
290
|
method: "POST",
|
|
@@ -295,47 +295,47 @@ async function de({ teamId: e = "", appIdId: t, ...r }) {
|
|
|
295
295
|
mapBody: (n) => n
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
|
-
async function
|
|
298
|
+
async function he({
|
|
299
299
|
teamId: e = "",
|
|
300
300
|
deviceUDID: t = "",
|
|
301
301
|
...r
|
|
302
302
|
}) {
|
|
303
|
-
const n =
|
|
304
|
-
return
|
|
303
|
+
const n = S(t);
|
|
304
|
+
return s({
|
|
305
305
|
...r,
|
|
306
|
-
request:
|
|
306
|
+
request: U({ deviceUDID: t, teamID: e }),
|
|
307
307
|
label: "Apple device list",
|
|
308
308
|
// Apple's listDevices.action returns the full paginated list and does not
|
|
309
309
|
// honor a server-side UDID filter, so apply the `deviceUDID` filter here.
|
|
310
310
|
mapBody: (i) => {
|
|
311
311
|
const o = i?.devices ?? [];
|
|
312
|
-
return n ? o.filter((
|
|
312
|
+
return n ? o.filter((a) => S(a.deviceNumber) === n) : o;
|
|
313
313
|
}
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function S(e) {
|
|
317
317
|
return (e ?? "").replace(/-/g, "").replace(/[^a-fA-F0-9]/g, "").toUpperCase();
|
|
318
318
|
}
|
|
319
|
-
async function
|
|
319
|
+
async function Pe({
|
|
320
320
|
teamId: e = "",
|
|
321
321
|
deviceUDID: t,
|
|
322
322
|
name: r,
|
|
323
323
|
...n
|
|
324
324
|
}) {
|
|
325
|
-
return
|
|
325
|
+
return s({
|
|
326
326
|
...n,
|
|
327
|
-
request:
|
|
327
|
+
request: L({ deviceUDID: t, teamID: e, name: r }),
|
|
328
328
|
label: "Apple device registration",
|
|
329
329
|
mapBody: (i) => i?.device
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
|
-
async function
|
|
332
|
+
async function ge({
|
|
333
333
|
teamId: e = "",
|
|
334
334
|
deviceId: t,
|
|
335
335
|
name: r,
|
|
336
336
|
...n
|
|
337
337
|
}) {
|
|
338
|
-
return
|
|
338
|
+
return s({
|
|
339
339
|
...n,
|
|
340
340
|
request: {
|
|
341
341
|
method: "POST",
|
|
@@ -346,8 +346,8 @@ async function me({
|
|
|
346
346
|
mapBody: (i) => i?.device
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
async function
|
|
350
|
-
return
|
|
349
|
+
async function Ce({ teamId: e = "", deviceId: t, ...r }) {
|
|
350
|
+
return s({
|
|
351
351
|
...r,
|
|
352
352
|
request: {
|
|
353
353
|
method: "POST",
|
|
@@ -358,68 +358,79 @@ async function Ae({ teamId: e = "", deviceId: t, ...r }) {
|
|
|
358
358
|
mapBody: (n) => n
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
|
-
async function
|
|
361
|
+
async function qe({
|
|
362
362
|
profileKind: e = "development",
|
|
363
363
|
teamId: t = "",
|
|
364
364
|
bundleId: r = "",
|
|
365
365
|
...n
|
|
366
366
|
}) {
|
|
367
|
-
return
|
|
367
|
+
return s({
|
|
368
368
|
...n,
|
|
369
|
-
request: e === "adhoc" ?
|
|
369
|
+
request: e === "adhoc" ? x({ bundleID: r, teamID: t }) : e === "appstore" ? N({ bundleID: r, teamID: t }) : O({ bundleID: r, teamID: t }),
|
|
370
370
|
label: "Apple provisioning profile list",
|
|
371
371
|
mapBody: (i) => i?.provisioningProfiles ?? []
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
|
-
async function
|
|
374
|
+
async function Be({
|
|
375
375
|
profileKind: e = "development",
|
|
376
376
|
teamId: t = "",
|
|
377
377
|
bundleId: r,
|
|
378
378
|
appIdId: n,
|
|
379
379
|
certificateIds: i,
|
|
380
|
-
deviceIds: o,
|
|
381
|
-
name:
|
|
382
|
-
...
|
|
380
|
+
deviceIds: o = [],
|
|
381
|
+
name: a,
|
|
382
|
+
...p
|
|
383
383
|
}) {
|
|
384
|
-
const [
|
|
385
|
-
if (!
|
|
384
|
+
const [u] = i;
|
|
385
|
+
if (!u)
|
|
386
386
|
throw new Error("At least one certificate ID is required to create an Apple provisioning profile.");
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
appIDID: n,
|
|
393
|
-
certificateID: y,
|
|
394
|
-
deviceIDs: o,
|
|
395
|
-
name: s
|
|
396
|
-
}) : k({
|
|
397
|
-
bundleID: r,
|
|
387
|
+
let A;
|
|
388
|
+
if (e === "appstore") {
|
|
389
|
+
if (!a)
|
|
390
|
+
throw new Error("An explicit name is required to create an App Store provisioning profile.");
|
|
391
|
+
A = z({
|
|
398
392
|
teamID: t,
|
|
399
393
|
appIDID: n,
|
|
400
|
-
certificateID:
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
394
|
+
certificateID: u,
|
|
395
|
+
name: a
|
|
396
|
+
});
|
|
397
|
+
} else e === "adhoc" ? A = V({
|
|
398
|
+
bundleID: r,
|
|
399
|
+
teamID: t,
|
|
400
|
+
appIDID: n,
|
|
401
|
+
certificateID: u,
|
|
402
|
+
deviceIDs: o,
|
|
403
|
+
name: a
|
|
404
|
+
}) : A = H({
|
|
405
|
+
bundleID: r,
|
|
406
|
+
teamID: t,
|
|
407
|
+
appIDID: n,
|
|
408
|
+
certificateID: u,
|
|
409
|
+
deviceIDs: o,
|
|
410
|
+
name: a
|
|
411
|
+
});
|
|
412
|
+
return s({
|
|
413
|
+
...p,
|
|
414
|
+
request: A,
|
|
404
415
|
label: "Apple provisioning profile creation",
|
|
405
|
-
mapBody: (
|
|
416
|
+
mapBody: (P) => P?.provisioningProfile
|
|
406
417
|
});
|
|
407
418
|
}
|
|
408
|
-
async function
|
|
419
|
+
async function Re({
|
|
409
420
|
teamId: e = "",
|
|
410
421
|
profileId: t,
|
|
411
422
|
...r
|
|
412
423
|
}) {
|
|
413
|
-
return
|
|
424
|
+
return s({
|
|
414
425
|
...r,
|
|
415
|
-
request:
|
|
426
|
+
request: F(t, e),
|
|
416
427
|
label: "Apple provisioning profile download",
|
|
417
428
|
validatePortalResponse: !1,
|
|
418
429
|
mapBody: (n, i) => i
|
|
419
430
|
});
|
|
420
431
|
}
|
|
421
|
-
async function
|
|
422
|
-
return
|
|
432
|
+
async function Te({ teamId: e = "", profileId: t, ...r }) {
|
|
433
|
+
return s({
|
|
423
434
|
...r,
|
|
424
435
|
request: {
|
|
425
436
|
method: "POST",
|
|
@@ -430,7 +441,180 @@ async function we({ teamId: e = "", profileId: t, ...r }) {
|
|
|
430
441
|
mapBody: (n) => n
|
|
431
442
|
});
|
|
432
443
|
}
|
|
433
|
-
function
|
|
444
|
+
async function Ee({
|
|
445
|
+
relay: e,
|
|
446
|
+
providerId: t
|
|
447
|
+
}) {
|
|
448
|
+
const r = Number(t), n = await d(e, {
|
|
449
|
+
method: "POST",
|
|
450
|
+
path: "/olympus/v1/session",
|
|
451
|
+
payload: {
|
|
452
|
+
provider: { providerId: Number.isNaN(r) ? t : r }
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
if (n.status < 200 || n.status >= 300)
|
|
456
|
+
throw new Error(
|
|
457
|
+
`App Store Connect provider switch failed: HTTP ${n.status} ${n.rawBody ?? ""}`.trim()
|
|
458
|
+
);
|
|
459
|
+
return n;
|
|
460
|
+
}
|
|
461
|
+
async function Ke({ relay: e }) {
|
|
462
|
+
const t = await d(e, {
|
|
463
|
+
path: "/iris/v1/apiKeys"
|
|
464
|
+
});
|
|
465
|
+
return y(t, "App Store Connect API key list"), h(t.body?.data);
|
|
466
|
+
}
|
|
467
|
+
async function $e({
|
|
468
|
+
relay: e,
|
|
469
|
+
nickname: t,
|
|
470
|
+
roles: r = ["APP_MANAGER"],
|
|
471
|
+
allAppsVisible: n = !0
|
|
472
|
+
}) {
|
|
473
|
+
if (!t)
|
|
474
|
+
throw new Error("A nickname is required to create an App Store Connect API key.");
|
|
475
|
+
const i = await d(e, {
|
|
476
|
+
method: "POST",
|
|
477
|
+
path: "/iris/v1/apiKeys",
|
|
478
|
+
payload: {
|
|
479
|
+
data: {
|
|
480
|
+
type: "apiKeys",
|
|
481
|
+
attributes: {
|
|
482
|
+
nickname: t,
|
|
483
|
+
allAppsVisible: n,
|
|
484
|
+
keyType: "PUBLIC_API",
|
|
485
|
+
roles: r
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
y(i, "App Store Connect API key creation");
|
|
491
|
+
const o = b(i.body?.data);
|
|
492
|
+
if (!o?.id)
|
|
493
|
+
throw new Error("App Store Connect API key creation did not return a key ID.");
|
|
494
|
+
return o;
|
|
495
|
+
}
|
|
496
|
+
async function ke({
|
|
497
|
+
relay: e,
|
|
498
|
+
keyId: t
|
|
499
|
+
}) {
|
|
500
|
+
const r = await d(e, {
|
|
501
|
+
path: `/iris/v1/apiKeys/${encodeURIComponent(t)}`,
|
|
502
|
+
query: { "fields[apiKeys]": "privateKey", include: "provider" }
|
|
503
|
+
});
|
|
504
|
+
y(r, "App Store Connect API key download");
|
|
505
|
+
const n = b(r.body?.data), i = v(n?.attributes, "privateKey");
|
|
506
|
+
if (!i)
|
|
507
|
+
throw new Error(
|
|
508
|
+
`App Store Connect API key ${t} returned no private key. Apple serves it only once; revoke the key and create a new one.`
|
|
509
|
+
);
|
|
510
|
+
const o = (r.body?.included ?? []).find((p) => p.type === "providers"), a = v(o?.attributes, "publicProviderId") ?? v(n?.attributes, "issuerId") ?? o?.id;
|
|
511
|
+
return { privateKeyPem: i, issuerId: a };
|
|
512
|
+
}
|
|
513
|
+
async function oe({ relay: e, bundleId: t }) {
|
|
514
|
+
const r = await d(e, {
|
|
515
|
+
path: "/iris/v1/apps",
|
|
516
|
+
query: { "filter[bundleId]": t }
|
|
517
|
+
});
|
|
518
|
+
return y(r, "App Store Connect app lookup"), h(r.body?.data).find(
|
|
519
|
+
(n) => v(n.attributes, "bundleId") === t
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
async function ae({
|
|
523
|
+
relay: e,
|
|
524
|
+
bundleId: t,
|
|
525
|
+
name: r,
|
|
526
|
+
sku: n,
|
|
527
|
+
primaryLocale: i = "en-US",
|
|
528
|
+
versionString: o = "1.0"
|
|
529
|
+
}) {
|
|
530
|
+
if (!r)
|
|
531
|
+
throw new Error("An app name is required to create an App Store Connect app record.");
|
|
532
|
+
const a = "IOS", p = await d(e, {
|
|
533
|
+
method: "POST",
|
|
534
|
+
path: "/iris/v1/apps",
|
|
535
|
+
payload: {
|
|
536
|
+
data: {
|
|
537
|
+
type: "apps",
|
|
538
|
+
attributes: {
|
|
539
|
+
sku: n || t,
|
|
540
|
+
primaryLocale: i,
|
|
541
|
+
bundleId: t
|
|
542
|
+
},
|
|
543
|
+
relationships: {
|
|
544
|
+
appStoreVersions: {
|
|
545
|
+
data: [{ type: "appStoreVersions", id: `\${store-version-${a}}` }]
|
|
546
|
+
},
|
|
547
|
+
appInfos: {
|
|
548
|
+
data: [{ type: "appInfos", id: "${new-appInfo-id}" }]
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
included: [
|
|
553
|
+
{
|
|
554
|
+
type: "appInfos",
|
|
555
|
+
id: "${new-appInfo-id}",
|
|
556
|
+
relationships: {
|
|
557
|
+
appInfoLocalizations: {
|
|
558
|
+
data: [{ type: "appInfoLocalizations", id: "${new-appInfoLocalization-id}" }]
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
type: "appInfoLocalizations",
|
|
564
|
+
id: "${new-appInfoLocalization-id}",
|
|
565
|
+
attributes: { locale: i, name: r }
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
type: "appStoreVersions",
|
|
569
|
+
id: `\${store-version-${a}}`,
|
|
570
|
+
attributes: { platform: a, versionString: o },
|
|
571
|
+
relationships: {
|
|
572
|
+
appStoreVersionLocalizations: {
|
|
573
|
+
data: [
|
|
574
|
+
{ type: "appStoreVersionLocalizations", id: `\${new-${a}VersionLocalization-id}` }
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
type: "appStoreVersionLocalizations",
|
|
581
|
+
id: `\${new-${a}VersionLocalization-id}`,
|
|
582
|
+
attributes: { locale: i }
|
|
583
|
+
}
|
|
584
|
+
]
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
y(p, "App Store Connect app creation");
|
|
588
|
+
const u = b(p.body?.data);
|
|
589
|
+
if (!u?.id)
|
|
590
|
+
throw new Error("App Store Connect app creation did not return an app ID.");
|
|
591
|
+
return u;
|
|
592
|
+
}
|
|
593
|
+
async function Ue(e) {
|
|
594
|
+
const t = await oe({ relay: e.relay, bundleId: e.bundleId });
|
|
595
|
+
return t ? { app: t, created: !1 } : { app: await ae(e), created: !0 };
|
|
596
|
+
}
|
|
597
|
+
function y(e, t) {
|
|
598
|
+
const r = e.body?.errors;
|
|
599
|
+
if (r && r.length > 0) {
|
|
600
|
+
const n = r.map((i) => i.detail ?? i.title ?? i.code ?? i.status).filter(Boolean).join("; ");
|
|
601
|
+
throw new Error(`${t} failed: ${n || `HTTP ${e.status}`}`);
|
|
602
|
+
}
|
|
603
|
+
if (e.status < 200 || e.status >= 300)
|
|
604
|
+
throw new Error(`${t} failed: HTTP ${e.status} ${e.rawBody ?? ""}`.trim());
|
|
605
|
+
}
|
|
606
|
+
function h(e) {
|
|
607
|
+
return e ? Array.isArray(e) ? e : [e] : [];
|
|
608
|
+
}
|
|
609
|
+
function b(e) {
|
|
610
|
+
if (e)
|
|
611
|
+
return Array.isArray(e) ? e[0] : e;
|
|
612
|
+
}
|
|
613
|
+
function v(e, t) {
|
|
614
|
+
const r = e?.[t];
|
|
615
|
+
return typeof r == "string" && r !== "" ? r : void 0;
|
|
616
|
+
}
|
|
617
|
+
function se(e, t) {
|
|
434
618
|
if (!e)
|
|
435
619
|
throw new Error(`${t} returned an empty response.`);
|
|
436
620
|
if (e.resultCode !== void 0 && e.resultCode !== 0)
|
|
@@ -438,7 +622,7 @@ function X(e, t) {
|
|
|
438
622
|
`${t} failed: ${e.userString ?? e.resultString ?? e.resultCode}`
|
|
439
623
|
);
|
|
440
624
|
}
|
|
441
|
-
function
|
|
625
|
+
function pe(e) {
|
|
442
626
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
443
627
|
for (const n of e) {
|
|
444
628
|
const i = String(
|
|
@@ -449,36 +633,45 @@ function Y(e) {
|
|
|
449
633
|
return r;
|
|
450
634
|
}
|
|
451
635
|
export {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
fe as
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
636
|
+
Qe as AppleGsaSrpClient,
|
|
637
|
+
Ne as AppleRelayWebSocketClient,
|
|
638
|
+
y as assertAppStoreConnectResponseOK,
|
|
639
|
+
se as assertAppleDeveloperPortalResponseOK,
|
|
640
|
+
$e as createAppStoreConnectApiKey,
|
|
641
|
+
ae as createAppStoreConnectApp,
|
|
642
|
+
Ie as createAppleBundleID,
|
|
643
|
+
me as createAppleCertificate,
|
|
644
|
+
Be as createAppleProfile,
|
|
645
|
+
De as deleteAppleBundleID,
|
|
646
|
+
we as deleteAppleCertificate,
|
|
647
|
+
Ce as deleteAppleDevice,
|
|
648
|
+
Te as deleteAppleProfile,
|
|
649
|
+
ke as downloadAppStoreConnectApiKeyPrivateKey,
|
|
650
|
+
ve as downloadAppleCertificate,
|
|
651
|
+
Re as downloadAppleProfile,
|
|
652
|
+
Ue as ensureAppStoreConnectApp,
|
|
653
|
+
fe as exportAppleCertificateP12,
|
|
654
|
+
Oe as fetchAppleAccountSession,
|
|
655
|
+
oe as findAppStoreConnectApp,
|
|
656
|
+
de as generateAppleSigningKeyAndCSR,
|
|
657
|
+
Ke as listAppStoreConnectApiKeys,
|
|
658
|
+
be as listAppleBundleIDs,
|
|
659
|
+
Ae as listAppleCertificates,
|
|
660
|
+
he as listAppleDevices,
|
|
661
|
+
qe as listAppleProfiles,
|
|
662
|
+
ye as listAppleTeams,
|
|
663
|
+
Fe as openAppleRelayWebSocket,
|
|
664
|
+
d as proxyAppStoreConnectRequest,
|
|
665
|
+
ze as proxyPhoneTwoFactorCode,
|
|
666
|
+
Ve as proxySrpComplete,
|
|
667
|
+
He as proxySrpInit,
|
|
668
|
+
_e as proxyTwoFactorCode,
|
|
669
|
+
Pe as registerAppleDevice,
|
|
670
|
+
s as requestAppleProvisioning,
|
|
671
|
+
Ge as startBrowserOwnedAppleIDLogin,
|
|
672
|
+
Ee as switchAppStoreConnectProvider,
|
|
673
|
+
Me as triggerPhoneTwoFactor,
|
|
674
|
+
We as triggerTrustedDeviceTwoFactor,
|
|
675
|
+
Se as updateAppleBundleID,
|
|
676
|
+
ge as updateAppleDevice
|
|
484
677
|
};
|