eas-cli 21.2.0 → 21.3.0
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 +243 -115
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +31 -16
- package/build/commands/observe/events.js +5 -4
- package/build/commands/observe/metrics-summary.js +2 -1
- package/build/commands/observe/metrics.js +3 -2
- package/build/commands/observe/routes.js +3 -2
- package/build/commands/observe/session.js +8 -2
- package/build/commands/project/icon/set.d.ts +15 -0
- package/build/commands/project/icon/set.js +93 -0
- package/build/commands/project/init.d.ts +3 -0
- package/build/commands/project/init.js +34 -7
- package/build/commands/testflight/crashes.d.ts +23 -0
- package/build/commands/testflight/crashes.js +82 -0
- package/build/commands/testflight/feedback.d.ts +23 -0
- package/build/commands/testflight/feedback.js +82 -0
- package/build/graphql/generated.d.ts +206 -254
- package/build/graphql/generated.js +18 -23
- package/build/graphql/mutations/UploadSessionMutation.d.ts +5 -1
- package/build/graphql/mutations/UploadSessionMutation.js +15 -0
- package/build/graphql/queries/AppQuery.d.ts +1 -0
- package/build/graphql/queries/AppQuery.js +19 -0
- package/build/observe/fetchEvents.js +7 -1
- package/build/observe/fetchMetrics.js +6 -0
- package/build/observe/fetchNavigationRoutes.js +6 -0
- package/build/observe/fetchSessions.d.ts +7 -0
- package/build/observe/fetchSessions.js +16 -0
- package/build/observe/planGating.d.ts +15 -0
- package/build/observe/planGating.js +48 -0
- package/build/project/accountSelection.d.ts +4 -0
- package/build/project/accountSelection.js +56 -0
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +4 -3
- package/build/project/projectInitialization.d.ts +13 -3
- package/build/project/projectInitialization.js +52 -80
- package/build/testflight/app.d.ts +18 -0
- package/build/testflight/app.js +124 -0
- package/build/testflight/fetch.d.ts +56 -0
- package/build/testflight/fetch.js +116 -0
- package/build/testflight/format.d.ts +4 -0
- package/build/testflight/format.js +104 -0
- package/build/testflight/queries.d.ts +16 -0
- package/build/testflight/queries.js +123 -0
- package/build/testflight/target.d.ts +15 -0
- package/build/testflight/target.js +32 -0
- package/build/uploads.d.ts +7 -1
- package/build/uploads.js +9 -0
- package/build/user/User.d.ts +6 -0
- package/build/user/User.js +18 -0
- package/oclif.manifest.json +1494 -1138
- package/package.json +8 -5
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TESTFLIGHT_PAGE_SIZE = void 0;
|
|
4
|
+
exports.listAndRenderTestFlightFeedbackAsync = listAndRenderTestFlightFeedbackAsync;
|
|
5
|
+
exports.listAndRenderTestFlightCrashesAsync = listAndRenderTestFlightCrashesAsync;
|
|
6
|
+
exports.viewAndRenderBetaFeedbackAsync = viewAndRenderBetaFeedbackAsync;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
|
+
const fetch_1 = require("./fetch");
|
|
10
|
+
const format_1 = require("./format");
|
|
11
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
12
|
+
const json_1 = require("../utils/json");
|
|
13
|
+
const queries_1 = require("../utils/queries");
|
|
14
|
+
/** Feedback and crashes render as multi-line blocks, so default to a smaller page than lists do. */
|
|
15
|
+
exports.TESTFLIGHT_PAGE_SIZE = 20;
|
|
16
|
+
const FEEDBACK_RENDERING = {
|
|
17
|
+
jsonKey: 'feedback',
|
|
18
|
+
formatItem: format_1.formatTestFlightFeedback,
|
|
19
|
+
emptyMessage: bundleId => `No TestFlight feedback has been submitted for ${chalk_1.default.bold(bundleId)}.`,
|
|
20
|
+
loadMorePrompt: 'Load more feedback?',
|
|
21
|
+
moreAvailableHint: (shown, total) => `Showing ${shown} of ${total} feedback submissions. Use --offset and --limit to see more.`,
|
|
22
|
+
};
|
|
23
|
+
const CRASHES_RENDERING = {
|
|
24
|
+
jsonKey: 'crashes',
|
|
25
|
+
formatItem: format_1.formatTestFlightCrash,
|
|
26
|
+
emptyMessage: bundleId => `No TestFlight crashes have been reported for ${chalk_1.default.bold(bundleId)}.`,
|
|
27
|
+
loadMorePrompt: 'Load more crashes?',
|
|
28
|
+
moreAvailableHint: (shown, total) => `Showing ${shown} of ${total} crashes. Use --offset and --limit to see more.`,
|
|
29
|
+
};
|
|
30
|
+
async function listAndRenderAsync({ bundleId, query, rendering, paginatedQueryOptions, }) {
|
|
31
|
+
const { json, nonInteractive, offset } = paginatedQueryOptions;
|
|
32
|
+
const limit = paginatedQueryOptions.limit ?? exports.TESTFLIGHT_PAGE_SIZE;
|
|
33
|
+
if (json) {
|
|
34
|
+
const [items, total] = await Promise.all([
|
|
35
|
+
query.queryAsync(limit, offset),
|
|
36
|
+
query.getTotalAsync(),
|
|
37
|
+
]);
|
|
38
|
+
(0, json_1.printJsonOnlyOutput)({
|
|
39
|
+
[rendering.jsonKey]: items,
|
|
40
|
+
total,
|
|
41
|
+
offset,
|
|
42
|
+
limit,
|
|
43
|
+
hasNextPage: offset + items.length < total,
|
|
44
|
+
});
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const renderPage = (items, pageOffset) => {
|
|
48
|
+
log_1.default.addNewLineIfNone();
|
|
49
|
+
if (items.length === 0) {
|
|
50
|
+
log_1.default.log(pageOffset === 0
|
|
51
|
+
? rendering.emptyMessage(bundleId)
|
|
52
|
+
: chalk_1.default.dim('No items past this offset.'));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
log_1.default.log(items.map((item, index) => rendering.formatItem(item, pageOffset + index + 1)).join('\n\n'));
|
|
56
|
+
};
|
|
57
|
+
if (nonInteractive) {
|
|
58
|
+
const items = await query.queryAsync(limit, offset);
|
|
59
|
+
renderPage(items, offset);
|
|
60
|
+
const total = await query.getTotalAsync();
|
|
61
|
+
if (offset + items.length < total) {
|
|
62
|
+
log_1.default.newLine();
|
|
63
|
+
log_1.default.log(chalk_1.default.dim(rendering.moreAvailableHint(offset + items.length, total)));
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// `paginatedQueryWithConfirmPromptAsync` renders one page at a time without reporting the offset
|
|
68
|
+
// it used, so track how many items have been rendered to keep the numbering absolute.
|
|
69
|
+
let renderedCount = 0;
|
|
70
|
+
await (0, queries_1.paginatedQueryWithConfirmPromptAsync)({
|
|
71
|
+
limit,
|
|
72
|
+
offset,
|
|
73
|
+
queryToPerform: (pageLimit, pageOffset) => query.queryAsync(pageLimit, pageOffset),
|
|
74
|
+
promptOptions: {
|
|
75
|
+
title: rendering.loadMorePrompt,
|
|
76
|
+
renderListItems: items => {
|
|
77
|
+
renderPage(items, offset + renderedCount);
|
|
78
|
+
renderedCount += items.length;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** List screenshot feedback submitted by TestFlight testers. */
|
|
84
|
+
async function listAndRenderTestFlightFeedbackAsync(app, paginatedQueryOptions) {
|
|
85
|
+
await listAndRenderAsync({
|
|
86
|
+
bundleId: app.attributes.bundleId,
|
|
87
|
+
query: (0, fetch_1.getTestFlightFeedbackQuery)(app),
|
|
88
|
+
rendering: FEEDBACK_RENDERING,
|
|
89
|
+
paginatedQueryOptions,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** List crashes reported by TestFlight testers. */
|
|
93
|
+
async function listAndRenderTestFlightCrashesAsync(app, paginatedQueryOptions) {
|
|
94
|
+
await listAndRenderAsync({
|
|
95
|
+
bundleId: app.attributes.bundleId,
|
|
96
|
+
query: (0, fetch_1.getTestFlightCrashesQuery)(app),
|
|
97
|
+
rendering: CRASHES_RENDERING,
|
|
98
|
+
paginatedQueryOptions,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Render a single submission identified by an EAS workflow trigger's
|
|
103
|
+
* `app_store_connect.beta_feedback` payload. Crashes are rendered with their full crash log.
|
|
104
|
+
*/
|
|
105
|
+
async function viewAndRenderBetaFeedbackAsync(app, target, { json }) {
|
|
106
|
+
if (target.type === 'crash') {
|
|
107
|
+
const { crash, logText } = await (0, fetch_1.fetchTestFlightCrashAsync)(app, target.id);
|
|
108
|
+
if (json) {
|
|
109
|
+
(0, json_1.printJsonOnlyOutput)({ crash, logText });
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
log_1.default.addNewLineIfNone();
|
|
113
|
+
log_1.default.log((0, format_1.formatTestFlightCrashDetails)(crash, logText));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const feedback = await (0, fetch_1.fetchTestFlightFeedbackAsync)(app, target.id);
|
|
117
|
+
if (json) {
|
|
118
|
+
(0, json_1.printJsonOnlyOutput)({ feedback });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
log_1.default.addNewLineIfNone();
|
|
122
|
+
log_1.default.log((0, format_1.formatTestFlightFeedback)(feedback));
|
|
123
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BetaFeedbackType } from './fetch';
|
|
2
|
+
export type BetaFeedbackTarget = {
|
|
3
|
+
id: string;
|
|
4
|
+
type: BetaFeedbackType;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Resolve a single submission to look up from what an EAS workflow trigger provides in
|
|
8
|
+
* `app_store_connect.beta_feedback`: either the `url` (which encodes both `id` and `type`) or the
|
|
9
|
+
* bare `id` alongside `type`. Without either, the command's own kind of feedback is assumed.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveBetaFeedbackTarget({ idOrUrl, type, defaultType, }: {
|
|
12
|
+
idOrUrl: string;
|
|
13
|
+
type?: BetaFeedbackType;
|
|
14
|
+
defaultType: BetaFeedbackType;
|
|
15
|
+
}): BetaFeedbackTarget;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveBetaFeedbackTarget = resolveBetaFeedbackTarget;
|
|
4
|
+
/**
|
|
5
|
+
* App Store Connect self-links, which are what EAS workflow triggers put in
|
|
6
|
+
* `app_store_connect.beta_feedback.url`:
|
|
7
|
+
*
|
|
8
|
+
* https://api.appstoreconnect.apple.com/v1/betaFeedbackCrashSubmissions/<id>
|
|
9
|
+
* https://api.appstoreconnect.apple.com/v1/betaFeedbackScreenshotSubmissions/<id>
|
|
10
|
+
*/
|
|
11
|
+
const FEEDBACK_URL_PATTERN = /\/(betaFeedbackCrashSubmissions|betaFeedbackScreenshotSubmissions)\/([^/?#]+)/i;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve a single submission to look up from what an EAS workflow trigger provides in
|
|
14
|
+
* `app_store_connect.beta_feedback`: either the `url` (which encodes both `id` and `type`) or the
|
|
15
|
+
* bare `id` alongside `type`. Without either, the command's own kind of feedback is assumed.
|
|
16
|
+
*/
|
|
17
|
+
function resolveBetaFeedbackTarget({ idOrUrl, type, defaultType, }) {
|
|
18
|
+
const match = idOrUrl.match(FEEDBACK_URL_PATTERN);
|
|
19
|
+
if (match) {
|
|
20
|
+
const urlType = match[1].toLowerCase().startsWith('betafeedbackcrash')
|
|
21
|
+
? 'crash'
|
|
22
|
+
: 'screenshot';
|
|
23
|
+
if (type && type !== urlType) {
|
|
24
|
+
throw new Error(`--type ${type} does not match the URL, which points at ${urlType} feedback. Omit --type when passing a URL.`);
|
|
25
|
+
}
|
|
26
|
+
return { id: decodeURIComponent(match[2]), type: urlType };
|
|
27
|
+
}
|
|
28
|
+
if (/^[a-z][a-z\d+\-.]*:\/\//i.test(idOrUrl)) {
|
|
29
|
+
throw new Error(`Could not tell whether "${idOrUrl}" points at crash or screenshot feedback. Pass the App Store Connect API URL from \${{ app_store_connect.beta_feedback.url }}, or pass the ID with --type.`);
|
|
30
|
+
}
|
|
31
|
+
return { id: idOrUrl, type: type ?? defaultType };
|
|
32
|
+
}
|
package/build/uploads.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Response } from 'node-fetch';
|
|
2
2
|
import { ExpoGraphqlClient } from './commandUtils/context/contextUtils/createGraphqlClient';
|
|
3
|
-
import { AccountUploadSessionType, UploadSessionType } from './graphql/generated';
|
|
3
|
+
import { AccountUploadSessionType, AppUploadSessionType, UploadSessionType } from './graphql/generated';
|
|
4
4
|
import { ProgressHandler } from './utils/progress';
|
|
5
5
|
export interface PresignedPost {
|
|
6
6
|
url: string;
|
|
@@ -13,4 +13,10 @@ export declare function uploadAccountScopedFileAtPathToGCSAsync(graphqlClient: E
|
|
|
13
13
|
path: string;
|
|
14
14
|
handleProgressEvent: ProgressHandler;
|
|
15
15
|
}): Promise<string>;
|
|
16
|
+
export declare function uploadAppScopedFileAtPathToGCSAsync(graphqlClient: ExpoGraphqlClient, { type, appId, path, handleProgressEvent, }: {
|
|
17
|
+
type: AppUploadSessionType;
|
|
18
|
+
appId: string;
|
|
19
|
+
path: string;
|
|
20
|
+
handleProgressEvent?: ProgressHandler;
|
|
21
|
+
}): Promise<string>;
|
|
16
22
|
export declare function uploadWithPresignedPostWithRetryAsync(file: string, presignedPost: PresignedPost, onAssetUploadBegin: () => void): Promise<Response>;
|
package/build/uploads.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uploadFileAtPathToGCSAsync = uploadFileAtPathToGCSAsync;
|
|
4
4
|
exports.uploadAccountScopedFileAtPathToGCSAsync = uploadAccountScopedFileAtPathToGCSAsync;
|
|
5
|
+
exports.uploadAppScopedFileAtPathToGCSAsync = uploadAppScopedFileAtPathToGCSAsync;
|
|
5
6
|
exports.uploadWithPresignedPostWithRetryAsync = uploadWithPresignedPostWithRetryAsync;
|
|
6
7
|
const tslib_1 = require("tslib");
|
|
7
8
|
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
@@ -20,6 +21,14 @@ async function uploadAccountScopedFileAtPathToGCSAsync(graphqlClient, { type, ac
|
|
|
20
21
|
await uploadWithSignedUrlWithProgressAsync(path, signedUrl, handleProgressEvent);
|
|
21
22
|
return signedUrl.bucketKey;
|
|
22
23
|
}
|
|
24
|
+
async function uploadAppScopedFileAtPathToGCSAsync(graphqlClient, { type, appId, path, handleProgressEvent = () => { }, }) {
|
|
25
|
+
const signedUrl = await UploadSessionMutation_1.UploadSessionMutation.createAppScopedUploadSessionAsync(graphqlClient, {
|
|
26
|
+
type,
|
|
27
|
+
appID: appId,
|
|
28
|
+
});
|
|
29
|
+
await uploadWithSignedUrlWithProgressAsync(path, signedUrl, handleProgressEvent);
|
|
30
|
+
return signedUrl.bucketKey;
|
|
31
|
+
}
|
|
23
32
|
async function uploadWithPresignedPostWithRetryAsync(file, presignedPost, onAssetUploadBegin) {
|
|
24
33
|
return await (0, promise_retry_1.default)(async (retry) => {
|
|
25
34
|
// retry fetch errors (usually connection or DNS errors)
|
package/build/user/User.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { CurrentUserQuery, PartnerActor, Robot, SsoUser, User } from '../graphql/generated';
|
|
2
2
|
export type Actor = NonNullable<CurrentUserQuery['meActor']>;
|
|
3
|
+
/**
|
|
4
|
+
* Names of the accounts where the actor can create projects (non-ViewOnly role), listed in the
|
|
5
|
+
* same order as account selection prompts: the personal account first, then team accounts,
|
|
6
|
+
* then organization accounts.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCreatableAccountNames(actor: Actor): string[];
|
|
3
9
|
/**
|
|
4
10
|
* Resolve the name of the actor, either normal user, sso user or robot user.
|
|
5
11
|
* This should be used whenever the "current user" needs to be displayed.
|
package/build/user/User.js
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCreatableAccountNames = getCreatableAccountNames;
|
|
3
4
|
exports.getActorDisplayName = getActorDisplayName;
|
|
4
5
|
exports.getActorUsername = getActorUsername;
|
|
6
|
+
const generated_1 = require("../graphql/generated");
|
|
7
|
+
/**
|
|
8
|
+
* Names of the accounts where the actor can create projects (non-ViewOnly role), listed in the
|
|
9
|
+
* same order as account selection prompts: the personal account first, then team accounts,
|
|
10
|
+
* then organization accounts.
|
|
11
|
+
*/
|
|
12
|
+
function getCreatableAccountNames(actor) {
|
|
13
|
+
const creatableAccounts = actor.accounts.filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly);
|
|
14
|
+
if (actor.__typename === 'Robot') {
|
|
15
|
+
return creatableAccounts.map(it => it.name);
|
|
16
|
+
}
|
|
17
|
+
return [
|
|
18
|
+
...creatableAccounts.filter(a => a.ownerUserActor?.id === actor.id),
|
|
19
|
+
...creatableAccounts.filter(a => a.ownerUserActor && a.ownerUserActor.id !== actor.id),
|
|
20
|
+
...creatableAccounts.filter(a => !a.ownerUserActor),
|
|
21
|
+
].map(it => it.name);
|
|
22
|
+
}
|
|
5
23
|
/**
|
|
6
24
|
* Resolve the name of the actor, either normal user, sso user or robot user.
|
|
7
25
|
* This should be used whenever the "current user" needs to be displayed.
|