eas-cli 16.32.0 → 18.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -92
- package/build/branch/queries.js +6 -1
- package/build/build/createContext.js +5 -3
- package/build/build/queries.js +13 -1
- package/build/build/runBuildAndSubmit.js +2 -0
- package/build/build/utils/devClient.d.ts +1 -0
- package/build/build/utils/devClient.js +3 -2
- package/build/build/utils/repository.js +3 -3
- package/build/build/utils/resourceClass.d.ts +1 -1
- package/build/build/utils/resourceClass.js +2 -2
- package/build/channel/queries.js +10 -1
- package/build/commandUtils/new/templates/AGENTS.md +0 -1
- package/build/commands/account/login.d.ts +1 -0
- package/build/commands/account/login.js +7 -2
- package/build/commands/env/create.js +5 -2
- package/build/commands/env/list.js +1 -5
- package/build/commands/update/index.js +2 -2
- package/build/commands/upload.js +3 -3
- package/build/credentials/ios/api/graphql/mutations/AppleDistributionCertificateMutation.js +1 -3
- package/build/devices/queries.js +23 -2
- package/build/graphql/mutations/EnvironmentVariableMutation.js +1 -4
- package/build/graphql/mutations/PublishMutation.js +1 -4
- package/build/graphql/mutations/UserPreferencesMutation.js +1 -3
- package/build/graphql/mutations/WorkflowRevisionMutation.js +2 -10
- package/build/graphql/queries/AppVersionQuery.js +1 -5
- package/build/log.js +1 -1
- package/build/ora.js +1 -1
- package/build/project/discourageExpoGoForProdAsync.d.ts +4 -0
- package/build/project/discourageExpoGoForProdAsync.js +46 -0
- package/build/rollout/actions/ManageRollout.js +5 -1
- package/build/rollout/actions/SelectRuntime.js +10 -1
- package/build/update/queries.js +28 -2
- package/build/user/SessionManager.d.ts +3 -2
- package/build/user/SessionManager.js +6 -6
- package/build/user/expoBrowserAuthFlowLauncher.d.ts +3 -0
- package/build/user/{expoSsoLauncher.js → expoBrowserAuthFlowLauncher.js} +21 -47
- package/build/user/fetchSessionSecretAndUserFromBrowserAuthFlow.d.ts +7 -0
- package/build/user/fetchSessionSecretAndUserFromBrowserAuthFlow.js +14 -0
- package/build/utils/prompts.js +3 -3
- package/build/utils/usage/checkForOverages.js +4 -2
- package/build/worker/mutations.js +2 -8
- package/oclif.manifest.json +8 -48
- package/package.json +60 -63
- package/build/commands/submit/upload-to-asc.d.ts +0 -12
- package/build/commands/submit/upload-to-asc.js +0 -217
- package/build/submit/ios/AscApiClient.d.ts +0 -247
- package/build/submit/ios/AscApiClient.js +0 -287
- package/build/user/expoSsoLauncher.d.ts +0 -3
- package/build/user/fetchSessionSecretAndSsoUser.d.ts +0 -5
- package/build/user/fetchSessionSecretAndSsoUser.js +0 -17
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AscApiClient = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const results_1 = require("@expo/results");
|
|
6
|
-
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
7
|
-
const zod_1 = require("zod");
|
|
8
|
-
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
9
|
-
const GetApi = {
|
|
10
|
-
'/v1/apps/:id': {
|
|
11
|
-
path: zod_1.z.object({
|
|
12
|
-
id: zod_1.z.string(),
|
|
13
|
-
}),
|
|
14
|
-
request: zod_1.z.object({
|
|
15
|
-
'fields[apps]': zod_1.z.array(zod_1.z.enum(['bundleId', 'name'])).refine(opts => {
|
|
16
|
-
// Let's say we currently require fetching these two and nothing else.
|
|
17
|
-
return opts.includes('bundleId') && opts.includes('name');
|
|
18
|
-
}),
|
|
19
|
-
}),
|
|
20
|
-
response: zod_1.z.object({
|
|
21
|
-
data: zod_1.z.object({
|
|
22
|
-
type: zod_1.z.literal('apps'),
|
|
23
|
-
id: zod_1.z.string(),
|
|
24
|
-
attributes: zod_1.z.object({
|
|
25
|
-
bundleId: zod_1.z.string(),
|
|
26
|
-
name: zod_1.z.string(),
|
|
27
|
-
}),
|
|
28
|
-
}),
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
'/v1/buildUploadFiles/:id': {
|
|
32
|
-
path: zod_1.z.object({
|
|
33
|
-
id: zod_1.z.string(),
|
|
34
|
-
}),
|
|
35
|
-
request: zod_1.z.object({
|
|
36
|
-
'fields[buildUploadFiles]': zod_1.z.array(zod_1.z.enum(['assetDeliveryState'])).refine(opts => {
|
|
37
|
-
return opts.includes('assetDeliveryState');
|
|
38
|
-
}),
|
|
39
|
-
}),
|
|
40
|
-
response: zod_1.z.object({
|
|
41
|
-
data: zod_1.z.object({
|
|
42
|
-
type: zod_1.z.literal('buildUploadFiles'),
|
|
43
|
-
id: zod_1.z.string(),
|
|
44
|
-
attributes: zod_1.z.object({
|
|
45
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/appmediaassetstate
|
|
46
|
-
assetDeliveryState: zod_1.z.object({
|
|
47
|
-
state: zod_1.z.enum(['AWAITING_UPLOAD', 'UPLOAD_COMPLETE', 'COMPLETE', 'FAILED']),
|
|
48
|
-
errors: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
|
|
49
|
-
warnings: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
|
|
50
|
-
}),
|
|
51
|
-
}),
|
|
52
|
-
}),
|
|
53
|
-
}),
|
|
54
|
-
},
|
|
55
|
-
'/v1/buildUploads/:id': {
|
|
56
|
-
path: zod_1.z.object({
|
|
57
|
-
id: zod_1.z.string(),
|
|
58
|
-
}),
|
|
59
|
-
request: zod_1.z.object({
|
|
60
|
-
'fields[buildUploads]': zod_1.z.array(zod_1.z.enum(['build', 'state'])).refine(opts => {
|
|
61
|
-
return opts.includes('build') && opts.includes('state');
|
|
62
|
-
}),
|
|
63
|
-
include: zod_1.z.array(zod_1.z.enum(['build'])).refine(opts => {
|
|
64
|
-
return opts.includes('build');
|
|
65
|
-
}),
|
|
66
|
-
}),
|
|
67
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadresponse
|
|
68
|
-
response: zod_1.z.object({
|
|
69
|
-
data: zod_1.z.object({
|
|
70
|
-
type: zod_1.z.literal('buildUploads'),
|
|
71
|
-
id: zod_1.z.string(),
|
|
72
|
-
attributes: zod_1.z.object({
|
|
73
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/buildupload/attributes-data.dictionary/state-data.dictionary
|
|
74
|
-
state: zod_1.z.object({
|
|
75
|
-
state: zod_1.z.enum(['AWAITING_UPLOAD', 'PROCESSING', 'COMPLETE', 'FAILED']),
|
|
76
|
-
infos: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
|
|
77
|
-
errors: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
|
|
78
|
-
warnings: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
|
|
79
|
-
}),
|
|
80
|
-
}),
|
|
81
|
-
}),
|
|
82
|
-
}),
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
const PostApi = {
|
|
86
|
-
'/v1/buildUploads': {
|
|
87
|
-
request: zod_1.z.object({
|
|
88
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary
|
|
89
|
-
data: zod_1.z.object({
|
|
90
|
-
type: zod_1.z.literal('buildUploads'),
|
|
91
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary/attributes-data.dictionary
|
|
92
|
-
attributes: zod_1.z.object({
|
|
93
|
-
cfBundleShortVersionString: zod_1.z.string(),
|
|
94
|
-
cfBundleVersion: zod_1.z.string(),
|
|
95
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/platform
|
|
96
|
-
platform: zod_1.z.enum(['IOS', 'MAC_OS', 'TV_OS', 'VISION_OS']),
|
|
97
|
-
}),
|
|
98
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary/relationships-data.dictionary
|
|
99
|
-
relationships: zod_1.z.object({
|
|
100
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary/relationships-data.dictionary/app-data.dictionary
|
|
101
|
-
app: zod_1.z.object({
|
|
102
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadcreaterequest/data-data.dictionary/relationships-data.dictionary/app-data.dictionary/data-data.dictionary
|
|
103
|
-
data: zod_1.z.object({
|
|
104
|
-
type: zod_1.z.literal('apps'),
|
|
105
|
-
id: zod_1.z.string(),
|
|
106
|
-
}),
|
|
107
|
-
}),
|
|
108
|
-
}),
|
|
109
|
-
}),
|
|
110
|
-
}),
|
|
111
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadresponse
|
|
112
|
-
response: zod_1.z.object({
|
|
113
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/buildupload
|
|
114
|
-
data: zod_1.z.object({
|
|
115
|
-
id: zod_1.z.string(),
|
|
116
|
-
type: zod_1.z.literal('buildUploads'),
|
|
117
|
-
}),
|
|
118
|
-
}),
|
|
119
|
-
},
|
|
120
|
-
'/v1/buildUploadFiles': {
|
|
121
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest
|
|
122
|
-
request: zod_1.z.object({
|
|
123
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary
|
|
124
|
-
data: zod_1.z.object({
|
|
125
|
-
type: zod_1.z.literal('buildUploadFiles'),
|
|
126
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary/attributes-data.dictionary
|
|
127
|
-
attributes: zod_1.z.object({
|
|
128
|
-
assetType: zod_1.z.enum(['ASSET', 'ASSET_DESCRIPTION', 'ASSET_SPI']),
|
|
129
|
-
fileName: zod_1.z.string(),
|
|
130
|
-
fileSize: zod_1.z.number().min(1).max(9007199254740991),
|
|
131
|
-
uti: zod_1.z.enum([
|
|
132
|
-
'com.apple.binary-property-list',
|
|
133
|
-
'com.apple.ipa',
|
|
134
|
-
'com.apple.pkg',
|
|
135
|
-
'com.apple.xml-property-list',
|
|
136
|
-
'com.pkware.zip-archive',
|
|
137
|
-
]),
|
|
138
|
-
}),
|
|
139
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary/relationships-data.dictionary
|
|
140
|
-
relationships: zod_1.z.object({
|
|
141
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary/relationships-data.dictionary/buildupload-data.dictionary
|
|
142
|
-
buildUpload: zod_1.z.object({
|
|
143
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfilecreaterequest/data-data.dictionary/relationships-data.dictionary/buildupload-data.dictionary/data-data.dictionary
|
|
144
|
-
data: zod_1.z.object({
|
|
145
|
-
type: zod_1.z.literal('buildUploads'),
|
|
146
|
-
id: zod_1.z.string(),
|
|
147
|
-
}),
|
|
148
|
-
}),
|
|
149
|
-
}),
|
|
150
|
-
}),
|
|
151
|
-
}),
|
|
152
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfileresponse
|
|
153
|
-
response: zod_1.z.object({
|
|
154
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfile
|
|
155
|
-
data: zod_1.z.object({
|
|
156
|
-
type: zod_1.z.literal('buildUploadFiles'),
|
|
157
|
-
id: zod_1.z.string(),
|
|
158
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfile/attributes-data.dictionary
|
|
159
|
-
attributes: zod_1.z.object({
|
|
160
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/appmediaassetstate
|
|
161
|
-
uploadOperations: zod_1.z.array(
|
|
162
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/deliveryfileuploadoperation
|
|
163
|
-
zod_1.z.object({
|
|
164
|
-
length: zod_1.z.number().min(1).max(9007199254740991),
|
|
165
|
-
method: zod_1.z.string(),
|
|
166
|
-
offset: zod_1.z.number().min(0).max(9007199254740991),
|
|
167
|
-
partNumber: zod_1.z.number().min(1).max(9007199254740991),
|
|
168
|
-
requestHeaders: zod_1.z.array(zod_1.z.object({
|
|
169
|
-
name: zod_1.z.string(),
|
|
170
|
-
value: zod_1.z.string(),
|
|
171
|
-
})),
|
|
172
|
-
url: zod_1.z.string(),
|
|
173
|
-
})),
|
|
174
|
-
}),
|
|
175
|
-
}),
|
|
176
|
-
}),
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
const PatchApi = {
|
|
180
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/patch-v1-builduploadfiles-_id_
|
|
181
|
-
'/v1/buildUploadFiles/:id': {
|
|
182
|
-
path: zod_1.z.object({
|
|
183
|
-
id: zod_1.z.string(),
|
|
184
|
-
}),
|
|
185
|
-
request: zod_1.z.object({
|
|
186
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfileupdaterequest/data-data.dictionary
|
|
187
|
-
data: zod_1.z.object({
|
|
188
|
-
id: zod_1.z.string(),
|
|
189
|
-
type: zod_1.z.literal('buildUploadFiles'),
|
|
190
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfileupdaterequest/data-data.dictionary/attributes-data.dictionary
|
|
191
|
-
attributes: zod_1.z.object({
|
|
192
|
-
uploaded: zod_1.z.boolean(),
|
|
193
|
-
}),
|
|
194
|
-
}),
|
|
195
|
-
}),
|
|
196
|
-
response: zod_1.z.object({
|
|
197
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfile
|
|
198
|
-
data: zod_1.z.object({
|
|
199
|
-
type: zod_1.z.literal('buildUploadFiles'),
|
|
200
|
-
id: zod_1.z.string(),
|
|
201
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/builduploadfile/attributes-data.dictionary
|
|
202
|
-
attributes: zod_1.z.object({
|
|
203
|
-
// https://developer.apple.com/documentation/appstoreconnectapi/appmediaassetstate
|
|
204
|
-
assetDeliveryState: zod_1.z.object({
|
|
205
|
-
state: zod_1.z.enum(['AWAITING_UPLOAD', 'UPLOAD_COMPLETE', 'COMPLETE', 'FAILED']),
|
|
206
|
-
errors: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
|
|
207
|
-
warnings: zod_1.z.array(zod_1.z.object({ code: zod_1.z.string(), description: zod_1.z.string() })).optional(),
|
|
208
|
-
}),
|
|
209
|
-
}),
|
|
210
|
-
}),
|
|
211
|
-
}),
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
class AscApiClient {
|
|
215
|
-
baseUrl = 'https://api.appstoreconnect.apple.com';
|
|
216
|
-
token;
|
|
217
|
-
constructor({ token }) {
|
|
218
|
-
this.token = token;
|
|
219
|
-
}
|
|
220
|
-
async getAsync(path, body, params) {
|
|
221
|
-
const schema = GetApi[path];
|
|
222
|
-
let effectivePath = path;
|
|
223
|
-
for (const [key, value] of Object.entries(params ?? {})) {
|
|
224
|
-
effectivePath = effectivePath.replace(`:${key}`, String(value));
|
|
225
|
-
}
|
|
226
|
-
return await this.sendRequestAsync({
|
|
227
|
-
method: 'GET',
|
|
228
|
-
path: `${effectivePath}?${new URLSearchParams(body).toString()}`,
|
|
229
|
-
body,
|
|
230
|
-
requestSchema: schema.request,
|
|
231
|
-
responseSchema: schema.response,
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
async postAsync(path, body) {
|
|
235
|
-
const schema = PostApi[path];
|
|
236
|
-
return await this.sendRequestAsync({
|
|
237
|
-
method: 'POST',
|
|
238
|
-
path,
|
|
239
|
-
body,
|
|
240
|
-
requestSchema: schema.request,
|
|
241
|
-
responseSchema: schema.response,
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
async patchAsync(path, body, params) {
|
|
245
|
-
const schema = PatchApi[path];
|
|
246
|
-
let effectivePath = path;
|
|
247
|
-
for (const [key, value] of Object.entries(params)) {
|
|
248
|
-
effectivePath = effectivePath.replace(`:${key}`, String(value));
|
|
249
|
-
}
|
|
250
|
-
return await this.sendRequestAsync({
|
|
251
|
-
method: 'PATCH',
|
|
252
|
-
path: effectivePath,
|
|
253
|
-
body,
|
|
254
|
-
requestSchema: schema.request,
|
|
255
|
-
responseSchema: schema.response,
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
async sendRequestAsync({ path, method, body, requestSchema, responseSchema, }) {
|
|
259
|
-
const url = new URL(path, this.baseUrl).toString();
|
|
260
|
-
const parsedBody = await (0, results_1.asyncResult)((async () => requestSchema.parse(body))());
|
|
261
|
-
if (!parsedBody.ok) {
|
|
262
|
-
throw new Error(`Malformed request to App Store Connect: ${zod_1.z.prettifyError(parsedBody.enforceError())}`);
|
|
263
|
-
}
|
|
264
|
-
const response = await (0, node_fetch_1.default)(url, {
|
|
265
|
-
method,
|
|
266
|
-
headers: {
|
|
267
|
-
'Content-Type': 'application/json',
|
|
268
|
-
Authorization: `Bearer ${this.token}`,
|
|
269
|
-
},
|
|
270
|
-
body: method === 'GET' ? undefined : JSON.stringify(parsedBody.value),
|
|
271
|
-
});
|
|
272
|
-
if (!response.ok) {
|
|
273
|
-
const text = await response.text();
|
|
274
|
-
throw new Error(`Unexpected response (${response.status}) from App Store Connect: ${text}`, {
|
|
275
|
-
cause: response,
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
const json = await response.json();
|
|
279
|
-
log_1.default.debug(`Response from App Store Connect: ${JSON.stringify(json, null, 2)}`);
|
|
280
|
-
const parsedResponse = await (0, results_1.asyncResult)((async () => responseSchema.parse(json))());
|
|
281
|
-
if (!parsedResponse.ok) {
|
|
282
|
-
throw new Error(`Malformed response from App Store Connect: ${zod_1.z.prettifyError(parsedResponse.enforceError())}`);
|
|
283
|
-
}
|
|
284
|
-
return parsedResponse.value;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
exports.AscApiClient = AscApiClient;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchSessionSecretAndSsoUserAsync = fetchSessionSecretAndSsoUserAsync;
|
|
4
|
-
const expoSsoLauncher_1 = require("./expoSsoLauncher");
|
|
5
|
-
const fetchUser_1 = require("./fetchUser");
|
|
6
|
-
const api_1 = require("../api");
|
|
7
|
-
async function fetchSessionSecretAndSsoUserAsync() {
|
|
8
|
-
const sessionSecret = await (0, expoSsoLauncher_1.getSessionUsingBrowserAuthFlowAsync)({
|
|
9
|
-
expoWebsiteUrl: (0, api_1.getExpoWebsiteBaseUrl)(),
|
|
10
|
-
});
|
|
11
|
-
const userData = await (0, fetchUser_1.fetchUserAsync)({ sessionSecret });
|
|
12
|
-
return {
|
|
13
|
-
sessionSecret,
|
|
14
|
-
id: userData.id,
|
|
15
|
-
username: userData.username,
|
|
16
|
-
};
|
|
17
|
-
}
|