eas-cli 21.2.0 → 21.4.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 +343 -148
- package/build/build/build.js +102 -17
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +31 -16
- package/build/commands/observe/events.js +10 -6
- 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/simulator/events.d.ts +16 -0
- package/build/commands/simulator/events.js +136 -0
- package/build/commands/simulator/get.js +2 -0
- package/build/commands/simulator/list.js +2 -0
- package/build/commands/simulator/start.d.ts +1 -0
- package/build/commands/simulator/start.js +8 -0
- 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 +370 -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/graphql/queries/DeviceRunSessionQuery.d.ts +2 -1
- package/build/graphql/queries/DeviceRunSessionQuery.js +22 -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/simulator/events.d.ts +7 -0
- package/build/simulator/events.js +95 -0
- package/build/simulator/utils.js +1 -1
- 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 +2185 -1728
- package/package.json +8 -5
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
6
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
|
+
const generated_1 = require("../../graphql/generated");
|
|
8
|
+
const DeviceRunSessionQuery_1 = require("../../graphql/queries/DeviceRunSessionQuery");
|
|
9
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
+
const env_1 = require("../../simulator/env");
|
|
11
|
+
const events_1 = require("../../simulator/events");
|
|
12
|
+
const json_1 = require("../../utils/json");
|
|
13
|
+
const promise_1 = require("../../utils/promise");
|
|
14
|
+
const POLL_INTERVAL_MS = 5_000;
|
|
15
|
+
const POST_STOP_REFRESH_COUNT = 2;
|
|
16
|
+
class SimulatorEvents extends EasCommand_1.default {
|
|
17
|
+
static hidden = true;
|
|
18
|
+
static description = '[EXPERIMENTAL] show activity events from a remote simulator session';
|
|
19
|
+
static flags = {
|
|
20
|
+
id: core_1.Flags.string({
|
|
21
|
+
description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
|
|
22
|
+
}),
|
|
23
|
+
follow: core_1.Flags.boolean({
|
|
24
|
+
char: 'f',
|
|
25
|
+
description: 'Keep watching for new events until the session ends.',
|
|
26
|
+
}),
|
|
27
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
28
|
+
};
|
|
29
|
+
static contextDefinition = {
|
|
30
|
+
...this.ContextOptions.LoggedIn,
|
|
31
|
+
...this.ContextOptions.ProjectDir,
|
|
32
|
+
};
|
|
33
|
+
async runAsync() {
|
|
34
|
+
const { flags } = await this.parse(SimulatorEvents);
|
|
35
|
+
const { json: jsonFlag, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
|
|
36
|
+
if (jsonFlag && flags.follow) {
|
|
37
|
+
throw new Error('Use either --json or --follow, not both.');
|
|
38
|
+
}
|
|
39
|
+
if (jsonFlag) {
|
|
40
|
+
(0, json_1.enableJsonOutput)();
|
|
41
|
+
}
|
|
42
|
+
const { projectDir, loggedIn: { graphqlClient }, } = await this.getContextAsync(SimulatorEvents, { nonInteractive });
|
|
43
|
+
await (0, env_1.loadSimulatorEnvAsync)(projectDir);
|
|
44
|
+
const deviceRunSessionId = flags.id ?? process.env[env_1.EAS_SIMULATOR_SESSION_ID];
|
|
45
|
+
if (!deviceRunSessionId) {
|
|
46
|
+
throw new Error(`No simulator session ID provided. Pass --id, or run \`eas simulator:start\` first to write ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`);
|
|
47
|
+
}
|
|
48
|
+
const printedEventIds = new Set();
|
|
49
|
+
let observedRunningSession = false;
|
|
50
|
+
let remainingPostStopRefreshes = 0;
|
|
51
|
+
let latestEvents = [];
|
|
52
|
+
const abortController = new AbortController();
|
|
53
|
+
const { signal } = abortController;
|
|
54
|
+
const abortPromise = new Promise(resolve => {
|
|
55
|
+
signal.addEventListener('abort', () => {
|
|
56
|
+
resolve();
|
|
57
|
+
}, { once: true });
|
|
58
|
+
});
|
|
59
|
+
const interruptHandler = () => {
|
|
60
|
+
if (signal.aborted) {
|
|
61
|
+
process.exit(130);
|
|
62
|
+
}
|
|
63
|
+
abortController.abort();
|
|
64
|
+
};
|
|
65
|
+
if (flags.follow) {
|
|
66
|
+
process.on('SIGINT', interruptHandler);
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
while (!signal.aborted) {
|
|
70
|
+
let session;
|
|
71
|
+
let events;
|
|
72
|
+
try {
|
|
73
|
+
session = await DeviceRunSessionQuery_1.DeviceRunSessionQuery.eventsByIdAsync(graphqlClient, deviceRunSessionId);
|
|
74
|
+
const eventArtifact = session.artifacts.find(artifact => artifact.metadata?.__eas_type === 'session-events');
|
|
75
|
+
events = eventArtifact
|
|
76
|
+
? await (0, events_1.downloadDeviceRunSessionEventsAsync)(eventArtifact.downloadUrl)
|
|
77
|
+
: [];
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
if (!flags.follow) {
|
|
81
|
+
throw err;
|
|
82
|
+
}
|
|
83
|
+
log_1.default.debug(`Failed to poll simulator session events: ${err instanceof Error ? err.message : String(err)}`);
|
|
84
|
+
await Promise.race([(0, promise_1.sleepAsync)(POLL_INTERVAL_MS), abortPromise]);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
latestEvents = events;
|
|
88
|
+
if (jsonFlag) {
|
|
89
|
+
(0, json_1.printJsonOnlyOutput)({ deviceRunSessionId, events });
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const isRunning = session.status === generated_1.DeviceRunSessionStatus.New ||
|
|
93
|
+
session.status === generated_1.DeviceRunSessionStatus.InProgress;
|
|
94
|
+
if (isRunning) {
|
|
95
|
+
observedRunningSession = true;
|
|
96
|
+
remainingPostStopRefreshes = 0;
|
|
97
|
+
}
|
|
98
|
+
else if (observedRunningSession) {
|
|
99
|
+
observedRunningSession = false;
|
|
100
|
+
remainingPostStopRefreshes = POST_STOP_REFRESH_COUNT;
|
|
101
|
+
}
|
|
102
|
+
const shouldRefreshAgain = flags.follow && !signal.aborted && (isRunning || remainingPostStopRefreshes > 0);
|
|
103
|
+
printNewEvents(events, printedEventIds, !shouldRefreshAgain);
|
|
104
|
+
if (!shouldRefreshAgain) {
|
|
105
|
+
if (events.length === 0) {
|
|
106
|
+
log_1.default.log('No simulator session activity has been recorded.');
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!isRunning) {
|
|
111
|
+
remainingPostStopRefreshes -= 1;
|
|
112
|
+
}
|
|
113
|
+
await Promise.race([(0, promise_1.sleepAsync)(POLL_INTERVAL_MS), abortPromise]);
|
|
114
|
+
}
|
|
115
|
+
printNewEvents(latestEvents, printedEventIds, true);
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
if (flags.follow) {
|
|
119
|
+
process.removeListener('SIGINT', interruptHandler);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.default = SimulatorEvents;
|
|
125
|
+
function printNewEvents(events, printedEventIds, includeIncompleteOperations) {
|
|
126
|
+
const displayEvents = (0, events_1.projectDeviceRunSessionEventsForDisplay)(events, {
|
|
127
|
+
includeIncompleteOperations,
|
|
128
|
+
});
|
|
129
|
+
for (const event of displayEvents) {
|
|
130
|
+
if (printedEventIds.has(event.eventId)) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
log_1.default.log((0, events_1.formatDeviceRunSessionEvent)(event));
|
|
134
|
+
printedEventIds.add(event.eventId);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -55,6 +55,7 @@ class SimulatorGet extends EasCommand_1.default {
|
|
|
55
55
|
if (jsonFlag) {
|
|
56
56
|
(0, json_1.printJsonOnlyOutput)({
|
|
57
57
|
id: session.id,
|
|
58
|
+
name: session.name ?? undefined,
|
|
58
59
|
type: (0, utils_1.deviceRunSessionTypeToFlagValue)(session.type),
|
|
59
60
|
status: session.status,
|
|
60
61
|
platform: session.platform,
|
|
@@ -86,6 +87,7 @@ exports.default = SimulatorGet;
|
|
|
86
87
|
function formatSessionFields(session, deviceRunSessionUrl) {
|
|
87
88
|
return (0, formatFields_1.default)([
|
|
88
89
|
{ label: 'ID', value: session.id },
|
|
90
|
+
{ label: 'Name', value: formatNullable(session.name) },
|
|
89
91
|
{ label: 'Type', value: session.type },
|
|
90
92
|
{ label: 'Status', value: session.status },
|
|
91
93
|
{ label: 'Platform', value: session.platform },
|
|
@@ -100,6 +100,7 @@ class SimulatorList extends EasCommand_1.default {
|
|
|
100
100
|
(0, json_1.printJsonOnlyOutput)({
|
|
101
101
|
sessions: sessions.map(session => ({
|
|
102
102
|
id: session.id,
|
|
103
|
+
name: session.name ?? undefined,
|
|
103
104
|
type: (0, utils_1.deviceRunSessionTypeToFlagValue)(session.type),
|
|
104
105
|
status: session.status,
|
|
105
106
|
platform: session.platform,
|
|
@@ -122,6 +123,7 @@ class SimulatorList extends EasCommand_1.default {
|
|
|
122
123
|
const deviceRunSessionUrl = (0, url_1.getDeviceRunSessionUrl)(session.app.ownerAccount.name, session.app.slug, session.id);
|
|
123
124
|
const lines = [
|
|
124
125
|
`ID: ${session.id}`,
|
|
126
|
+
`Name: ${session.name ?? 'null'}`,
|
|
125
127
|
`Type: ${session.type}`,
|
|
126
128
|
`Status: ${session.status}`,
|
|
127
129
|
`Platform: ${session.platform}`,
|
|
@@ -7,6 +7,7 @@ export default class SimulatorStart extends EasCommand {
|
|
|
7
7
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
11
|
type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
12
|
'package-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
13
|
'max-duration-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -37,6 +37,9 @@ class SimulatorStart extends EasCommand_1.default {
|
|
|
37
37
|
description: 'Device platform',
|
|
38
38
|
options: PLATFORM_FLAG_VALUES,
|
|
39
39
|
})(),
|
|
40
|
+
name: core_1.Flags.string({
|
|
41
|
+
description: 'Human-readable name for the simulator session, shown in eas simulator:list and on expo.dev. Defaults to unnamed.',
|
|
42
|
+
}),
|
|
40
43
|
type: core_1.Flags.option({
|
|
41
44
|
description: 'Type of simulator session to create',
|
|
42
45
|
options: Object.values(utils_1.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES),
|
|
@@ -75,6 +78,9 @@ class SimulatorStart extends EasCommand_1.default {
|
|
|
75
78
|
const { projectId, projectDir, loggedIn: { graphqlClient }, } = await this.getContextAsync(SimulatorStart, {
|
|
76
79
|
nonInteractive,
|
|
77
80
|
});
|
|
81
|
+
// The server rejects blank names, so trim here and treat a whitespace-only
|
|
82
|
+
// --name as if it had been omitted rather than surfacing a validation error.
|
|
83
|
+
const name = flags.name?.trim() || undefined;
|
|
78
84
|
await (0, env_1.loadSimulatorEnvAsync)(projectDir);
|
|
79
85
|
const existingDeviceRunSessionId = process.env[env_1.EAS_SIMULATOR_SESSION_ID];
|
|
80
86
|
if (existingDeviceRunSessionId && !flags.force) {
|
|
@@ -93,6 +99,7 @@ class SimulatorStart extends EasCommand_1.default {
|
|
|
93
99
|
try {
|
|
94
100
|
const session = await DeviceRunSessionMutation_1.DeviceRunSessionMutation.createDeviceRunSessionAsync(graphqlClient, {
|
|
95
101
|
appId: projectId,
|
|
102
|
+
name,
|
|
96
103
|
platform,
|
|
97
104
|
type: utils_1.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE[flags.type],
|
|
98
105
|
packageVersion: flags['package-version'],
|
|
@@ -155,6 +162,7 @@ class SimulatorStart extends EasCommand_1.default {
|
|
|
155
162
|
if (jsonFlag) {
|
|
156
163
|
(0, json_1.printJsonOnlyOutput)({
|
|
157
164
|
id: deviceRunSessionId,
|
|
165
|
+
name,
|
|
158
166
|
type: flags.type,
|
|
159
167
|
deviceRunSessionUrl,
|
|
160
168
|
remoteConfig,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export default class TestFlightCrashes extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
12
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<"crash" | "screenshot" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
static contextDefinition: {
|
|
17
|
+
vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
|
|
18
|
+
analytics: import("../../commandUtils/context/AnalyticsContextField").default;
|
|
19
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
20
|
+
privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
|
|
21
|
+
};
|
|
22
|
+
runAsync(): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
6
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
8
|
+
const app_1 = require("../../testflight/app");
|
|
9
|
+
const queries_1 = require("../../testflight/queries");
|
|
10
|
+
const target_1 = require("../../testflight/target");
|
|
11
|
+
const json_1 = require("../../utils/json");
|
|
12
|
+
class TestFlightCrashes extends EasCommand_1.default {
|
|
13
|
+
static description = 'display crashes reported by TestFlight testers, or the full crash log of a single crash';
|
|
14
|
+
static examples = [
|
|
15
|
+
'$ eas testflight:crashes \t # Show the most recent crashes',
|
|
16
|
+
'$ eas testflight:crashes --limit 50 --offset 20 \t # Page through crashes',
|
|
17
|
+
'$ eas testflight:crashes AAo2eIIfGzcb1BzuUv3xrh4 \t # Show the full crash log for one crash',
|
|
18
|
+
'$ eas testflight:crashes --json \t # Print a page of crashes, with paging metadata, as JSON',
|
|
19
|
+
'$ eas testflight:crashes ${{ app_store_connect.beta_feedback.url }} --json \t # Look up whatever an EAS workflow trigger reported',
|
|
20
|
+
];
|
|
21
|
+
static args = {
|
|
22
|
+
id: core_1.Args.string({
|
|
23
|
+
description: 'ID or App Store Connect API URL of a single submission to show. Accepts ${{ app_store_connect.beta_feedback.id }} or ${{ app_store_connect.beta_feedback.url }} from an EAS workflow trigger.',
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
static flags = {
|
|
28
|
+
type: core_1.Flags.option({
|
|
29
|
+
description: 'Kind of feedback the ID refers to. Only needed when passing a bare ID for screenshot feedback; a URL already encodes it.',
|
|
30
|
+
options: ['crash', 'screenshot'],
|
|
31
|
+
})(),
|
|
32
|
+
profile: core_1.Flags.string({
|
|
33
|
+
char: 'e',
|
|
34
|
+
description: 'Name of the submit profile from eas.json used to resolve the bundle identifier and App Store Connect API key. Defaults to "production".',
|
|
35
|
+
}),
|
|
36
|
+
...pagination_1.EasPaginatedQueryFlags,
|
|
37
|
+
limit: (0, pagination_1.getLimitFlagWithCustomValues)({ defaultTo: queries_1.TESTFLIGHT_PAGE_SIZE, limit: 200 }),
|
|
38
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
39
|
+
};
|
|
40
|
+
static contextDefinition = {
|
|
41
|
+
...this.ContextOptions.ProjectConfig,
|
|
42
|
+
...this.ContextOptions.LoggedIn,
|
|
43
|
+
...this.ContextOptions.Analytics,
|
|
44
|
+
...this.ContextOptions.Vcs,
|
|
45
|
+
};
|
|
46
|
+
async runAsync() {
|
|
47
|
+
const { args, flags } = await this.parse(TestFlightCrashes);
|
|
48
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
49
|
+
const { json, nonInteractive } = paginatedQueryOptions;
|
|
50
|
+
if (json) {
|
|
51
|
+
(0, json_1.enableJsonOutput)();
|
|
52
|
+
}
|
|
53
|
+
if (flags.type && !args.id) {
|
|
54
|
+
throw new Error('--type only applies when looking up a single submission by ID or URL.');
|
|
55
|
+
}
|
|
56
|
+
// Resolved before authenticating so a malformed ID or URL fails fast.
|
|
57
|
+
const target = args.id
|
|
58
|
+
? (0, target_1.resolveBetaFeedbackTarget)({ idOrUrl: args.id, type: flags.type, defaultType: 'crash' })
|
|
59
|
+
: null;
|
|
60
|
+
const { loggedIn: { actor, graphqlClient }, privateProjectConfig: { exp, projectId, projectDir }, analytics, vcsClient, } = await this.getContextAsync(TestFlightCrashes, {
|
|
61
|
+
nonInteractive,
|
|
62
|
+
withServerSideEnvironment: null,
|
|
63
|
+
});
|
|
64
|
+
const app = await (0, app_1.resolveTestFlightAppAsync)({
|
|
65
|
+
actor,
|
|
66
|
+
analytics,
|
|
67
|
+
exp,
|
|
68
|
+
graphqlClient,
|
|
69
|
+
nonInteractive,
|
|
70
|
+
profileName: flags.profile,
|
|
71
|
+
projectDir,
|
|
72
|
+
projectId,
|
|
73
|
+
vcsClient,
|
|
74
|
+
});
|
|
75
|
+
if (target) {
|
|
76
|
+
await (0, queries_1.viewAndRenderBetaFeedbackAsync)(app, target, { json });
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
await (0, queries_1.listAndRenderTestFlightCrashesAsync)(app, paginatedQueryOptions);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.default = TestFlightCrashes;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export default class TestFlightFeedback extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
12
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<"crash" | "screenshot" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
static contextDefinition: {
|
|
17
|
+
vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
|
|
18
|
+
analytics: import("../../commandUtils/context/AnalyticsContextField").default;
|
|
19
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
20
|
+
privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
|
|
21
|
+
};
|
|
22
|
+
runAsync(): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
6
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
8
|
+
const app_1 = require("../../testflight/app");
|
|
9
|
+
const queries_1 = require("../../testflight/queries");
|
|
10
|
+
const target_1 = require("../../testflight/target");
|
|
11
|
+
const json_1 = require("../../utils/json");
|
|
12
|
+
class TestFlightFeedback extends EasCommand_1.default {
|
|
13
|
+
static description = 'display screenshot feedback submitted by TestFlight testers, including their comments, device information, and screenshot URLs';
|
|
14
|
+
static examples = [
|
|
15
|
+
'$ eas testflight:feedback \t # Show the most recent feedback submissions',
|
|
16
|
+
'$ eas testflight:feedback --limit 50 --offset 20 \t # Page through submissions',
|
|
17
|
+
'$ eas testflight:feedback --json \t # Print a page of feedback, with paging metadata, as JSON',
|
|
18
|
+
'$ eas testflight:feedback AD8JvKbr0BK0Cj9OnM6WO6I \t # Show a single submission by ID',
|
|
19
|
+
'$ eas testflight:feedback ${{ app_store_connect.beta_feedback.url }} --json \t # Look up whatever an EAS workflow trigger reported',
|
|
20
|
+
];
|
|
21
|
+
static args = {
|
|
22
|
+
id: core_1.Args.string({
|
|
23
|
+
description: 'ID or App Store Connect API URL of a single submission to show. Accepts ${{ app_store_connect.beta_feedback.id }} or ${{ app_store_connect.beta_feedback.url }} from an EAS workflow trigger.',
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
static flags = {
|
|
28
|
+
type: core_1.Flags.option({
|
|
29
|
+
description: 'Kind of feedback the ID refers to. Only needed when passing a bare ID for a crash; a URL already encodes it.',
|
|
30
|
+
options: ['crash', 'screenshot'],
|
|
31
|
+
})(),
|
|
32
|
+
profile: core_1.Flags.string({
|
|
33
|
+
char: 'e',
|
|
34
|
+
description: 'Name of the submit profile from eas.json used to resolve the bundle identifier and App Store Connect API key. Defaults to "production".',
|
|
35
|
+
}),
|
|
36
|
+
...pagination_1.EasPaginatedQueryFlags,
|
|
37
|
+
limit: (0, pagination_1.getLimitFlagWithCustomValues)({ defaultTo: queries_1.TESTFLIGHT_PAGE_SIZE, limit: 200 }),
|
|
38
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
39
|
+
};
|
|
40
|
+
static contextDefinition = {
|
|
41
|
+
...this.ContextOptions.ProjectConfig,
|
|
42
|
+
...this.ContextOptions.LoggedIn,
|
|
43
|
+
...this.ContextOptions.Analytics,
|
|
44
|
+
...this.ContextOptions.Vcs,
|
|
45
|
+
};
|
|
46
|
+
async runAsync() {
|
|
47
|
+
const { args, flags } = await this.parse(TestFlightFeedback);
|
|
48
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
49
|
+
const { json, nonInteractive } = paginatedQueryOptions;
|
|
50
|
+
if (json) {
|
|
51
|
+
(0, json_1.enableJsonOutput)();
|
|
52
|
+
}
|
|
53
|
+
if (flags.type && !args.id) {
|
|
54
|
+
throw new Error('--type only applies when looking up a single submission by ID or URL.');
|
|
55
|
+
}
|
|
56
|
+
// Resolved before authenticating so a malformed ID or URL fails fast.
|
|
57
|
+
const target = args.id
|
|
58
|
+
? (0, target_1.resolveBetaFeedbackTarget)({ idOrUrl: args.id, type: flags.type, defaultType: 'screenshot' })
|
|
59
|
+
: null;
|
|
60
|
+
const { loggedIn: { actor, graphqlClient }, privateProjectConfig: { exp, projectId, projectDir }, analytics, vcsClient, } = await this.getContextAsync(TestFlightFeedback, {
|
|
61
|
+
nonInteractive,
|
|
62
|
+
withServerSideEnvironment: null,
|
|
63
|
+
});
|
|
64
|
+
const app = await (0, app_1.resolveTestFlightAppAsync)({
|
|
65
|
+
actor,
|
|
66
|
+
analytics,
|
|
67
|
+
exp,
|
|
68
|
+
graphqlClient,
|
|
69
|
+
nonInteractive,
|
|
70
|
+
profileName: flags.profile,
|
|
71
|
+
projectDir,
|
|
72
|
+
projectId,
|
|
73
|
+
vcsClient,
|
|
74
|
+
});
|
|
75
|
+
if (target) {
|
|
76
|
+
await (0, queries_1.viewAndRenderBetaFeedbackAsync)(app, target, { json });
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
await (0, queries_1.listAndRenderTestFlightFeedbackAsync)(app, paginatedQueryOptions);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.default = TestFlightFeedback;
|