eas-cli 21.0.2 → 21.1.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 +180 -170
- package/build/build/metadata.js +5 -1
- package/build/chat/chatClient.d.ts +37 -0
- package/build/chat/chatClient.js +359 -0
- package/build/chat/detectProject.d.ts +5 -0
- package/build/chat/detectProject.js +41 -0
- package/build/chat/renderMarkdown.d.ts +7 -0
- package/build/chat/renderMarkdown.js +47 -0
- package/build/chat/replInput.d.ts +10 -0
- package/build/chat/replInput.js +52 -0
- package/build/commands/chat.d.ts +18 -0
- package/build/commands/chat.js +221 -0
- package/build/commands/env/create.d.ts +1 -0
- package/build/commands/env/create.js +4 -1
- package/build/commands/env/set.d.ts +27 -0
- package/build/commands/env/set.js +222 -0
- package/build/commands/env/update.d.ts +1 -0
- package/build/commands/env/update.js +4 -1
- package/build/commands/observe/events.js +6 -5
- package/build/commands/observe/metrics-summary.js +4 -3
- package/build/commands/observe/metrics.js +5 -4
- package/build/commands/observe/routes.js +4 -3
- package/build/commands/observe/session.d.ts +6 -1
- package/build/commands/observe/session.js +133 -7
- package/build/commands/observe/versions.js +4 -3
- package/build/commands/simulator/start.d.ts +2 -1
- package/build/commands/simulator/start.js +27 -3
- package/build/graphql/generated.d.ts +94 -0
- package/build/graphql/mutations/PublishMutation.js +4 -1
- package/build/graphql/queries/ObserveQuery.d.ts +2 -1
- package/build/graphql/queries/ObserveQuery.js +7 -1
- package/build/observe/fetchCustomEvents.d.ts +2 -1
- package/build/observe/fetchCustomEvents.js +1 -0
- package/build/observe/fetchSessions.d.ts +42 -0
- package/build/observe/fetchSessions.js +36 -0
- package/build/observe/formatSessions.d.ts +16 -0
- package/build/observe/formatSessions.js +36 -0
- package/build/observe/metricNames.d.ts +7 -0
- package/build/observe/metricNames.js +13 -0
- package/oclif.manifest.json +1180 -877
- package/package.json +5 -5
|
@@ -2,12 +2,17 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class ObserveSession extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static args: {
|
|
5
|
-
sessionId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
sessionId: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
'project-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
days: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
sort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
'event-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
16
|
};
|
|
12
17
|
static contextDefinition: {
|
|
13
18
|
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
@@ -3,26 +3,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
6
|
+
const errors_1 = require("../../commandUtils/errors");
|
|
6
7
|
const flags_1 = require("../../commandUtils/flags");
|
|
7
8
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
9
|
+
const ObserveQuery_1 = require("../../graphql/queries/ObserveQuery");
|
|
10
|
+
const fetchEvents_1 = require("../../observe/fetchEvents");
|
|
8
11
|
const fetchSessions_1 = require("../../observe/fetchSessions");
|
|
9
12
|
const flags_2 = require("../../observe/flags");
|
|
10
13
|
const formatSessions_1 = require("../../observe/formatSessions");
|
|
14
|
+
const metricNames_1 = require("../../observe/metricNames");
|
|
11
15
|
const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
|
|
16
|
+
const startAndEndTime_1 = require("../../observe/startAndEndTime");
|
|
17
|
+
const prompts_1 = require("../../prompts");
|
|
12
18
|
const json_1 = require("../../utils/json");
|
|
13
19
|
// Fixed at 100 — the maximum page size accepted by the underlying events and
|
|
14
20
|
// customEventList queries. Until there's a dedicated sessions query, this
|
|
15
21
|
// command pulls one page of each and merges client-side.
|
|
16
22
|
const SESSION_PAGE_SIZE = 100;
|
|
23
|
+
// How many candidate events to present in the picker. Small enough to browse;
|
|
24
|
+
// users narrow further with --days / --sort.
|
|
25
|
+
const PICKER_CANDIDATE_LIMIT = 25;
|
|
17
26
|
class ObserveSession extends EasCommand_1.default {
|
|
18
27
|
static description = 'display the timeline of metric and log events for a specific session';
|
|
19
28
|
static args = {
|
|
20
29
|
sessionId: core_1.Args.string({
|
|
21
|
-
description: 'Session ID to inspect',
|
|
22
|
-
required:
|
|
30
|
+
description: 'Session ID to inspect (omit in interactive mode to pick one from a list)',
|
|
31
|
+
required: false,
|
|
23
32
|
}),
|
|
24
33
|
};
|
|
25
34
|
static flags = {
|
|
35
|
+
sort: core_1.Flags.option({
|
|
36
|
+
description: 'Sort order for candidate events when picking a session (if omitted in interactive mode, you will be prompted)',
|
|
37
|
+
options: Object.values(fetchEvents_1.EventsOrderPreset).map(s => s.toLowerCase()),
|
|
38
|
+
required: false,
|
|
39
|
+
})(),
|
|
40
|
+
'event-name': core_1.Flags.string({
|
|
41
|
+
description: 'Metric or log event name to pick candidate sessions by (e.g. tti, cold_launch, login_pressed). If omitted in interactive mode, you will be prompted.',
|
|
42
|
+
}),
|
|
43
|
+
...flags_2.ObserveTimeRangeFlags,
|
|
26
44
|
...flags_2.ObserveProjectIdFlag,
|
|
27
45
|
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
28
46
|
};
|
|
@@ -35,22 +53,47 @@ class ObserveSession extends EasCommand_1.default {
|
|
|
35
53
|
};
|
|
36
54
|
async runAsync() {
|
|
37
55
|
const { flags, args } = await this.parse(ObserveSession);
|
|
56
|
+
const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
|
|
38
57
|
const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
|
|
39
58
|
command: this,
|
|
40
59
|
commandClass: ObserveSession,
|
|
41
60
|
loggedInOnlyContextDefinition: ObserveSession.loggedInOnlyContextDefinition,
|
|
42
61
|
projectIdOverride: flags['project-id'],
|
|
43
|
-
nonInteractive
|
|
62
|
+
nonInteractive,
|
|
44
63
|
});
|
|
45
|
-
if (
|
|
64
|
+
if (json) {
|
|
46
65
|
(0, json_1.enableJsonOutput)();
|
|
47
66
|
}
|
|
67
|
+
let sessionId;
|
|
68
|
+
if (args.sessionId) {
|
|
69
|
+
const pickerFlagsProvided = flags['event-name'] !== undefined ||
|
|
70
|
+
flags.sort !== undefined ||
|
|
71
|
+
flags.days !== undefined ||
|
|
72
|
+
flags.start !== undefined ||
|
|
73
|
+
flags.end !== undefined;
|
|
74
|
+
if (pickerFlagsProvided) {
|
|
75
|
+
throw new errors_1.EasCommandError('The picker flags (--event-name, --sort, --days, --start, --end) describe how to find a session and cannot be combined with a session ID argument.');
|
|
76
|
+
}
|
|
77
|
+
sessionId = args.sessionId;
|
|
78
|
+
}
|
|
79
|
+
else if (nonInteractive) {
|
|
80
|
+
throw new errors_1.EasCommandError('A session ID argument is required in non-interactive mode. In interactive mode, you can omit the session ID to pick one from a list of events.');
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
sessionId = await pickSessionIdInteractivelyAsync({
|
|
84
|
+
graphqlClient,
|
|
85
|
+
projectId,
|
|
86
|
+
eventNameFlag: flags['event-name'],
|
|
87
|
+
sort: flags.sort,
|
|
88
|
+
timeRangeFlags: { days: flags.days, start: flags.start, end: flags.end },
|
|
89
|
+
});
|
|
90
|
+
}
|
|
48
91
|
const { entries, metadata, hasMoreMetricEvents, hasMoreLogEvents } = await (0, fetchSessions_1.fetchObserveSessionEventsAsync)(graphqlClient, projectId, {
|
|
49
|
-
sessionId
|
|
92
|
+
sessionId,
|
|
50
93
|
limit: SESSION_PAGE_SIZE,
|
|
51
94
|
});
|
|
52
|
-
if (
|
|
53
|
-
(0, json_1.printJsonOnlyOutput)((0, formatSessions_1.buildObserveSessionEventsJson)(entries,
|
|
95
|
+
if (json) {
|
|
96
|
+
(0, json_1.printJsonOnlyOutput)((0, formatSessions_1.buildObserveSessionEventsJson)(entries, sessionId, metadata, hasMoreMetricEvents, hasMoreLogEvents));
|
|
54
97
|
}
|
|
55
98
|
else {
|
|
56
99
|
log_1.default.addNewLineIfNone();
|
|
@@ -63,3 +106,86 @@ class ObserveSession extends EasCommand_1.default {
|
|
|
63
106
|
}
|
|
64
107
|
}
|
|
65
108
|
exports.default = ObserveSession;
|
|
109
|
+
async function pickSessionIdInteractivelyAsync({ graphqlClient, projectId, eventNameFlag, sort, timeRangeFlags, }) {
|
|
110
|
+
const { startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(timeRangeFlags);
|
|
111
|
+
const eventNameChoice = eventNameFlag
|
|
112
|
+
? { name: eventNameFlag, isMetric: (0, metricNames_1.isKnownMetricName)(eventNameFlag) }
|
|
113
|
+
: await promptForEventNameAsync({ graphqlClient, projectId, startTime, endTime });
|
|
114
|
+
let sortValue;
|
|
115
|
+
if (sort) {
|
|
116
|
+
const preset = sort.toUpperCase();
|
|
117
|
+
const sortIsValueBased = preset === fetchEvents_1.EventsOrderPreset.Slowest || preset === fetchEvents_1.EventsOrderPreset.Fastest;
|
|
118
|
+
if (!eventNameChoice.isMetric && sortIsValueBased) {
|
|
119
|
+
throw new errors_1.EasCommandError(`--sort=${sort} is only supported for metric events. Use newest or oldest for log events.`);
|
|
120
|
+
}
|
|
121
|
+
sortValue = sort;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
sortValue = await promptForSortOrderAsync(eventNameChoice.isMetric);
|
|
125
|
+
}
|
|
126
|
+
const candidates = eventNameChoice.isMetric
|
|
127
|
+
? (await (0, fetchSessions_1.fetchSessionMetricCandidatesAsync)(graphqlClient, projectId, {
|
|
128
|
+
metricName: (0, metricNames_1.resolveMetricName)(eventNameChoice.name),
|
|
129
|
+
sort: sortValue,
|
|
130
|
+
startTime,
|
|
131
|
+
endTime,
|
|
132
|
+
limit: PICKER_CANDIDATE_LIMIT,
|
|
133
|
+
})).map(event => ({ sessionId: event.sessionId, title: (0, formatSessions_1.formatMetricCandidateTitle)(event) }))
|
|
134
|
+
: (await (0, fetchSessions_1.fetchSessionLogCandidatesAsync)(graphqlClient, projectId, {
|
|
135
|
+
eventName: eventNameChoice.name,
|
|
136
|
+
orderAscending: sortValue.toUpperCase() === fetchEvents_1.EventsOrderPreset.Oldest,
|
|
137
|
+
startTime,
|
|
138
|
+
endTime,
|
|
139
|
+
limit: PICKER_CANDIDATE_LIMIT,
|
|
140
|
+
})).map(event => ({ sessionId: event.sessionId, title: (0, formatSessions_1.formatLogCandidateTitle)(event) }));
|
|
141
|
+
if (candidates.length === 0) {
|
|
142
|
+
throw new errors_1.EasCommandError(`No events found for "${eventNameChoice.name}" in the selected time range. Try widening the window with --days or picking a different --event-name.`);
|
|
143
|
+
}
|
|
144
|
+
return await promptForSessionIdAsync(candidates);
|
|
145
|
+
}
|
|
146
|
+
async function promptForSortOrderAsync(isMetric) {
|
|
147
|
+
const choices = [
|
|
148
|
+
{ title: 'Newest first', value: fetchEvents_1.EventsOrderPreset.Newest.valueOf().toLowerCase() },
|
|
149
|
+
{ title: 'Oldest first', value: fetchEvents_1.EventsOrderPreset.Oldest.valueOf().toLowerCase() },
|
|
150
|
+
...(isMetric
|
|
151
|
+
? [
|
|
152
|
+
{
|
|
153
|
+
title: 'Slowest first (highest metric value)',
|
|
154
|
+
value: fetchEvents_1.EventsOrderPreset.Slowest.valueOf().toLowerCase(),
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
title: 'Fastest first (lowest metric value)',
|
|
158
|
+
value: fetchEvents_1.EventsOrderPreset.Fastest.valueOf().toLowerCase(),
|
|
159
|
+
},
|
|
160
|
+
]
|
|
161
|
+
: []),
|
|
162
|
+
];
|
|
163
|
+
return await (0, prompts_1.selectAsync)('Sort candidate events by', choices);
|
|
164
|
+
}
|
|
165
|
+
async function promptForEventNameAsync({ graphqlClient, projectId, startTime, endTime, }) {
|
|
166
|
+
const { names: customEventNames } = await ObserveQuery_1.ObserveQuery.customEventNamesAsync(graphqlClient, {
|
|
167
|
+
appId: projectId,
|
|
168
|
+
startTime,
|
|
169
|
+
endTime,
|
|
170
|
+
});
|
|
171
|
+
const metricChoices = Object.entries(metricNames_1.METRIC_SHORT_NAMES).map(([fullName, displayName]) => ({
|
|
172
|
+
title: `${displayName} (metric)`,
|
|
173
|
+
value: { name: fullName, isMetric: true },
|
|
174
|
+
}));
|
|
175
|
+
const logChoices = customEventNames.map(({ eventName, count }) => ({
|
|
176
|
+
title: `${eventName} (${count} log event${count === 1 ? '' : 's'})`,
|
|
177
|
+
value: { name: eventName, isMetric: false },
|
|
178
|
+
}));
|
|
179
|
+
const choices = [...metricChoices, ...logChoices];
|
|
180
|
+
if (choices.length === 0) {
|
|
181
|
+
throw new errors_1.EasCommandError('No metric or log events found for the selected time range. Widen the window with --days or wait for data to arrive.');
|
|
182
|
+
}
|
|
183
|
+
return await (0, prompts_1.selectAsync)('Select an event name', choices);
|
|
184
|
+
}
|
|
185
|
+
async function promptForSessionIdAsync(candidates) {
|
|
186
|
+
const choices = candidates.map(c => ({
|
|
187
|
+
title: c.title,
|
|
188
|
+
value: c.sessionId,
|
|
189
|
+
}));
|
|
190
|
+
return await (0, prompts_1.selectAsync)('Select an event (its session will be shown)', choices);
|
|
191
|
+
}
|
|
@@ -28,20 +28,21 @@ class ObserveVersions extends EasCommand_1.default {
|
|
|
28
28
|
};
|
|
29
29
|
async runAsync() {
|
|
30
30
|
const { flags } = await this.parse(ObserveVersions);
|
|
31
|
+
const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
|
|
31
32
|
const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
|
|
32
33
|
command: this,
|
|
33
34
|
commandClass: ObserveVersions,
|
|
34
35
|
loggedInOnlyContextDefinition: ObserveVersions.loggedInOnlyContextDefinition,
|
|
35
36
|
projectIdOverride: flags['project-id'],
|
|
36
|
-
nonInteractive
|
|
37
|
+
nonInteractive,
|
|
37
38
|
});
|
|
38
|
-
if (
|
|
39
|
+
if (json) {
|
|
39
40
|
(0, json_1.enableJsonOutput)();
|
|
40
41
|
}
|
|
41
42
|
const { startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(flags);
|
|
42
43
|
const platforms = (0, platforms_1.appPlatformsFromFlag)(flags.platform);
|
|
43
44
|
const results = await (0, fetchVersions_1.fetchObserveVersionsAsync)(graphqlClient, projectId, platforms, startTime, endTime);
|
|
44
|
-
if (
|
|
45
|
+
if (json) {
|
|
45
46
|
(0, json_1.printJsonOnlyOutput)((0, formatVersions_1.buildObserveVersionsJson)(results));
|
|
46
47
|
}
|
|
47
48
|
else {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
export default class SimulatorStart extends EasCommand {
|
|
3
3
|
static hidden: boolean;
|
|
4
|
+
static aliases: string[];
|
|
4
5
|
static description: string;
|
|
5
6
|
static flags: {
|
|
6
7
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios", import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
10
|
type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
11
|
'package-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
12
|
'max-duration-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -11,6 +11,7 @@ const DeviceRunSessionMutation_1 = require("../../graphql/mutations/DeviceRunSes
|
|
|
11
11
|
const DeviceRunSessionQuery_1 = require("../../graphql/queries/DeviceRunSessionQuery");
|
|
12
12
|
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
13
13
|
const ora_1 = require("../../ora");
|
|
14
|
+
const prompts_1 = require("../../prompts");
|
|
14
15
|
const env_1 = require("../../simulator/env");
|
|
15
16
|
const utils_1 = require("../../simulator/utils");
|
|
16
17
|
const json_1 = require("../../utils/json");
|
|
@@ -21,15 +22,20 @@ const OUT_CONFIG_TYPE_VALUES = {
|
|
|
21
22
|
Env: 'env',
|
|
22
23
|
Dotenv: 'dotenv',
|
|
23
24
|
};
|
|
25
|
+
const PLATFORM_FLAG_VALUES = ['android', 'ios'];
|
|
26
|
+
const APP_PLATFORM_BY_FLAG_VALUE = {
|
|
27
|
+
android: generated_1.AppPlatform.Android,
|
|
28
|
+
ios: generated_1.AppPlatform.Ios,
|
|
29
|
+
};
|
|
24
30
|
class SimulatorStart extends EasCommand_1.default {
|
|
25
31
|
static hidden = true;
|
|
32
|
+
static aliases = ['simulator'];
|
|
26
33
|
static description = '[EXPERIMENTAL] start a remote simulator session on EAS and get instructions to connect to it';
|
|
27
34
|
static flags = {
|
|
28
35
|
platform: core_1.Flags.option({
|
|
29
36
|
char: 'p',
|
|
30
37
|
description: 'Device platform',
|
|
31
|
-
options:
|
|
32
|
-
required: true,
|
|
38
|
+
options: PLATFORM_FLAG_VALUES,
|
|
33
39
|
})(),
|
|
34
40
|
type: core_1.Flags.option({
|
|
35
41
|
description: 'Type of simulator session to create',
|
|
@@ -74,13 +80,13 @@ class SimulatorStart extends EasCommand_1.default {
|
|
|
74
80
|
if (existingDeviceRunSessionId && !flags.force) {
|
|
75
81
|
throw new Error(`Existing simulator session in environment. Use --force to create a new simulator session.`);
|
|
76
82
|
}
|
|
83
|
+
const platform = await resolvePlatformAsync(flags.platform, nonInteractive);
|
|
77
84
|
if (existingDeviceRunSessionId) {
|
|
78
85
|
log_1.default.warn(` Overwriting previous simulator session (id: ${existingDeviceRunSessionId}). ` +
|
|
79
86
|
`The previous remote session will continue running until stopped. ` +
|
|
80
87
|
`To stop it, run: eas simulator:stop --id ${existingDeviceRunSessionId}`);
|
|
81
88
|
log_1.default.newLine();
|
|
82
89
|
}
|
|
83
|
-
const platform = flags.platform === 'android' ? generated_1.AppPlatform.Android : generated_1.AppPlatform.Ios;
|
|
84
90
|
const createSpinner = (0, ora_1.ora)('🚀 Creating simulator session').start();
|
|
85
91
|
let deviceRunSessionId;
|
|
86
92
|
let deviceRunSessionUrl;
|
|
@@ -171,6 +177,24 @@ class SimulatorStart extends EasCommand_1.default {
|
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
exports.default = SimulatorStart;
|
|
180
|
+
async function resolvePlatformAsync(platform, nonInteractive) {
|
|
181
|
+
if (platform) {
|
|
182
|
+
return APP_PLATFORM_BY_FLAG_VALUE[platform];
|
|
183
|
+
}
|
|
184
|
+
if (nonInteractive) {
|
|
185
|
+
throw new Error('The --platform flag must be set when running in non-interactive mode.');
|
|
186
|
+
}
|
|
187
|
+
const { selectedPlatform } = await (0, prompts_1.promptAsync)({
|
|
188
|
+
type: 'select',
|
|
189
|
+
message: 'Select platform',
|
|
190
|
+
name: 'selectedPlatform',
|
|
191
|
+
choices: [
|
|
192
|
+
{ title: 'Android', value: generated_1.AppPlatform.Android },
|
|
193
|
+
{ title: 'iOS', value: generated_1.AppPlatform.Ios },
|
|
194
|
+
],
|
|
195
|
+
});
|
|
196
|
+
return selectedPlatform;
|
|
197
|
+
}
|
|
174
198
|
async function writeSimulatorEnvSafelyAsync(projectDir, environmentVariables) {
|
|
175
199
|
try {
|
|
176
200
|
await (0, env_1.writeSimulatorEnvAsync)(projectDir, environmentVariables);
|
|
@@ -1397,6 +1397,10 @@ export type App = Project & {
|
|
|
1397
1397
|
workerDeploymentsCrashes?: Maybe<WorkerDeploymentCrashes>;
|
|
1398
1398
|
workerDeploymentsRequest: WorkerDeploymentRequestEdge;
|
|
1399
1399
|
workerDeploymentsRequests?: Maybe<WorkerDeploymentRequests>;
|
|
1400
|
+
/** Caches associated with this app, ordered by last access time (most recent first). */
|
|
1401
|
+
workflowCachesPaginated: AppWorkflowCachesConnection;
|
|
1402
|
+
/** Per-type caching configuration for this app. */
|
|
1403
|
+
workflowCachingConfig: WorkflowCachingConfig;
|
|
1400
1404
|
workflowDeviceTestCaseHistory: WorkflowDeviceTestCaseHistory;
|
|
1401
1405
|
workflowDeviceTestCaseInsights: WorkflowDeviceTestCaseInsights;
|
|
1402
1406
|
workflowRunGitBranchesPaginated: AppWorkflowRunGitBranchesConnection;
|
|
@@ -1645,6 +1649,13 @@ export type AppWorkerDeploymentsRequestsArgs = {
|
|
|
1645
1649
|
timespan: DatasetTimespan;
|
|
1646
1650
|
};
|
|
1647
1651
|
/** Represents an Exponent App (or Experience in legacy terms) */
|
|
1652
|
+
export type AppWorkflowCachesPaginatedArgs = {
|
|
1653
|
+
after?: InputMaybe<Scalars['String']['input']>;
|
|
1654
|
+
before?: InputMaybe<Scalars['String']['input']>;
|
|
1655
|
+
first?: InputMaybe<Scalars['Int']['input']>;
|
|
1656
|
+
last?: InputMaybe<Scalars['Int']['input']>;
|
|
1657
|
+
};
|
|
1658
|
+
/** Represents an Exponent App (or Experience in legacy terms) */
|
|
1648
1659
|
export type AppWorkflowDeviceTestCaseHistoryArgs = {
|
|
1649
1660
|
filters?: InputMaybe<WorkflowDeviceTestCaseHistoryFiltersInput>;
|
|
1650
1661
|
path: Scalars['String']['input'];
|
|
@@ -1809,6 +1820,8 @@ export type AppMutation = {
|
|
|
1809
1820
|
setPushSecurityEnabled: App;
|
|
1810
1821
|
/** Set resource class experiment for app */
|
|
1811
1822
|
setResourceClassExperiment: App;
|
|
1823
|
+
/** Set per-type caching configuration for the app. */
|
|
1824
|
+
setWorkflowCachingConfig: App;
|
|
1812
1825
|
};
|
|
1813
1826
|
export type AppMutationCreateAppArgs = {
|
|
1814
1827
|
appInput: AppInput;
|
|
@@ -1831,6 +1844,10 @@ export type AppMutationSetResourceClassExperimentArgs = {
|
|
|
1831
1844
|
appId: Scalars['ID']['input'];
|
|
1832
1845
|
resourceClassExperiment?: InputMaybe<ResourceClassExperiment>;
|
|
1833
1846
|
};
|
|
1847
|
+
export type AppMutationSetWorkflowCachingConfigArgs = {
|
|
1848
|
+
appId: Scalars['ID']['input'];
|
|
1849
|
+
config: WorkflowCachingConfigInput;
|
|
1850
|
+
};
|
|
1834
1851
|
/** App-level notification preference */
|
|
1835
1852
|
export type AppNotificationPreference = NotificationPreference & {
|
|
1836
1853
|
__typename?: 'AppNotificationPreference';
|
|
@@ -2895,6 +2912,16 @@ export type AppWithGithubRepositoryInput = {
|
|
|
2895
2912
|
installationIdentifier?: InputMaybe<Scalars['String']['input']>;
|
|
2896
2913
|
projectName: Scalars['String']['input'];
|
|
2897
2914
|
};
|
|
2915
|
+
export type AppWorkflowCacheEdge = {
|
|
2916
|
+
__typename?: 'AppWorkflowCacheEdge';
|
|
2917
|
+
cursor: Scalars['String']['output'];
|
|
2918
|
+
node: WorkflowCache;
|
|
2919
|
+
};
|
|
2920
|
+
export type AppWorkflowCachesConnection = {
|
|
2921
|
+
__typename?: 'AppWorkflowCachesConnection';
|
|
2922
|
+
edges: Array<AppWorkflowCacheEdge>;
|
|
2923
|
+
pageInfo: PageInfo;
|
|
2924
|
+
};
|
|
2898
2925
|
export type AppWorkflowFilterInput = {
|
|
2899
2926
|
requestedGitRef?: InputMaybe<Scalars['String']['input']>;
|
|
2900
2927
|
};
|
|
@@ -7651,6 +7678,7 @@ export type RootMutation = {
|
|
|
7651
7678
|
webhook: WebhookMutation;
|
|
7652
7679
|
/** Mutations that modify a websiteNotification */
|
|
7653
7680
|
websiteNotifications: WebsiteNotificationMutation;
|
|
7681
|
+
workflowCache: WorkflowCacheMutation;
|
|
7654
7682
|
workflowDeviceTestCaseResult: WorkflowDeviceTestCaseResultMutation;
|
|
7655
7683
|
workflowJobAppleDeviceRegistrationRequest: WorkflowJobAppleDeviceRegistrationRequestMutation;
|
|
7656
7684
|
workflowJobApproval: WorkflowJobApprovalMutation;
|
|
@@ -8945,6 +8973,11 @@ export type UpdatesTimelineFilter = {
|
|
|
8945
8973
|
channel?: InputMaybe<Scalars['String']['input']>;
|
|
8946
8974
|
platform?: InputMaybe<AppPlatform>;
|
|
8947
8975
|
runtimeVersions?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
8976
|
+
/**
|
|
8977
|
+
* Case-insensitive substring match on update group message and branch name.
|
|
8978
|
+
* Embedded updates are matched on channel and runtime version.
|
|
8979
|
+
*/
|
|
8980
|
+
searchTerm?: InputMaybe<Scalars['String']['input']>;
|
|
8948
8981
|
types?: InputMaybe<Array<UpdatesTimelineItemType>>;
|
|
8949
8982
|
};
|
|
8950
8983
|
export type UpdatesTimelineItem = EmbeddedUpdate | UpdateGroup;
|
|
@@ -10146,6 +10179,66 @@ export declare enum WorkflowArtifactStorageType {
|
|
|
10146
10179
|
Gcs = "GCS",
|
|
10147
10180
|
R2 = "R2"
|
|
10148
10181
|
}
|
|
10182
|
+
export type WorkflowCache = {
|
|
10183
|
+
__typename?: 'WorkflowCache';
|
|
10184
|
+
createdAt: Scalars['DateTime']['output'];
|
|
10185
|
+
/** Actor who created this cache. Null if the creating user no longer exists. */
|
|
10186
|
+
creatingActor?: Maybe<Actor>;
|
|
10187
|
+
/** Git branch name the cache was created from. Null for user-scoped caches. */
|
|
10188
|
+
gitBranchName?: Maybe<Scalars['String']['output']>;
|
|
10189
|
+
/**
|
|
10190
|
+
* Build that created this cache. Null if the cache was created by a job run
|
|
10191
|
+
* or the build no longer exists.
|
|
10192
|
+
*/
|
|
10193
|
+
hydratingBuild?: Maybe<Build>;
|
|
10194
|
+
/**
|
|
10195
|
+
* Job run that created this cache. Null if the cache was created by a build
|
|
10196
|
+
* or the job run no longer exists.
|
|
10197
|
+
*/
|
|
10198
|
+
hydratingJobRun?: Maybe<JobRun>;
|
|
10199
|
+
id: Scalars['ID']['output'];
|
|
10200
|
+
/** Cache key used to identify the cache entry. */
|
|
10201
|
+
key: Scalars['String']['output'];
|
|
10202
|
+
/**
|
|
10203
|
+
* Time the cache was last used to restore, or the creation time if it has
|
|
10204
|
+
* never been restored.
|
|
10205
|
+
*/
|
|
10206
|
+
lastAccessedAt: Scalars['DateTime']['output'];
|
|
10207
|
+
/** Size of the cache archive in bytes. Null if the cache has not been hydrated yet. */
|
|
10208
|
+
sizeBytes?: Maybe<Scalars['Float']['output']>;
|
|
10209
|
+
};
|
|
10210
|
+
export type WorkflowCacheMutation = {
|
|
10211
|
+
__typename?: 'WorkflowCacheMutation';
|
|
10212
|
+
deleteWorkflowCache: WorkflowCache;
|
|
10213
|
+
};
|
|
10214
|
+
export type WorkflowCacheMutationDeleteWorkflowCacheArgs = {
|
|
10215
|
+
cacheId: Scalars['ID']['input'];
|
|
10216
|
+
};
|
|
10217
|
+
export type WorkflowCachingConfig = {
|
|
10218
|
+
__typename?: 'WorkflowCachingConfig';
|
|
10219
|
+
/**
|
|
10220
|
+
* Whether the ccache compiler cache is enabled. Null if not explicitly
|
|
10221
|
+
* configured, in which case the account-level default applies.
|
|
10222
|
+
*/
|
|
10223
|
+
ccacheEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
10224
|
+
/**
|
|
10225
|
+
* Whether the Gradle build cache is enabled. Null if not explicitly
|
|
10226
|
+
* configured, in which case it is disabled.
|
|
10227
|
+
*/
|
|
10228
|
+
gradleCacheEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
10229
|
+
};
|
|
10230
|
+
export type WorkflowCachingConfigInput = {
|
|
10231
|
+
/**
|
|
10232
|
+
* Pass true or false to explicitly enable or disable, null to reset to the account-level
|
|
10233
|
+
* default, or omit the field to leave it unchanged.
|
|
10234
|
+
*/
|
|
10235
|
+
ccacheEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
|
10236
|
+
/**
|
|
10237
|
+
* Pass true or false to explicitly enable or disable, null to reset to the default
|
|
10238
|
+
* (disabled), or omit the field to leave it unchanged.
|
|
10239
|
+
*/
|
|
10240
|
+
gradleCacheEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
|
10241
|
+
};
|
|
10149
10242
|
/**
|
|
10150
10243
|
* Grouping key from the [shard N] prefix-stripped error_message. `count` is
|
|
10151
10244
|
* computed with uniqExact(test_case_result_id) so RMT pre-merge duplicates do
|
|
@@ -18586,6 +18679,7 @@ export type AppObserveCustomEventListQueryVariables = Exact<{
|
|
|
18586
18679
|
filter?: InputMaybe<AppObserveCustomEventListFilter>;
|
|
18587
18680
|
first?: InputMaybe<Scalars['Int']['input']>;
|
|
18588
18681
|
after?: InputMaybe<Scalars['String']['input']>;
|
|
18682
|
+
orderBy?: InputMaybe<AppObserveCustomEventListOrderBy>;
|
|
18589
18683
|
}>;
|
|
18590
18684
|
export type AppObserveCustomEventListQuery = {
|
|
18591
18685
|
__typename?: 'RootQuery';
|
|
@@ -6,7 +6,9 @@ const graphql_1 = require("graphql");
|
|
|
6
6
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
7
|
const client_1 = require("../client");
|
|
8
8
|
const Update_1 = require("../types/Update");
|
|
9
|
-
|
|
9
|
+
function getTurtleJobRunId() {
|
|
10
|
+
return process.env.EAS_BUILD_PLATFORM ? undefined : process.env.EAS_BUILD_ID;
|
|
11
|
+
}
|
|
10
12
|
exports.PublishMutation = {
|
|
11
13
|
async getUploadURLsAsync(graphqlClient, contentTypes) {
|
|
12
14
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
@@ -25,6 +27,7 @@ exports.PublishMutation = {
|
|
|
25
27
|
return data.asset.getSignedAssetUploadSpecifications;
|
|
26
28
|
},
|
|
27
29
|
async publishUpdateGroupAsync(graphqlClient, publishUpdateGroupsInput) {
|
|
30
|
+
const turtleJobRunId = getTurtleJobRunId();
|
|
28
31
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
29
32
|
.mutation((0, graphql_tag_1.default) `
|
|
30
33
|
mutation UpdatePublishMutation($publishUpdateGroupsInput: [PublishUpdateGroupInput!]!) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AppObserveAppVersion, AppObserveCustomEvent, AppObserveCustomEventListFilter, AppObserveCustomEventName, AppObserveEvent, AppObserveEventsFilter, AppObserveEventsOrderBy, AppObserveNavigationRoute, AppObserveNavigationRoutesFilter, AppObserveNavigationRoutesOrderBy, AppObservePlatform, AppObserveTimeSeriesStatistics, PageInfo } from '../generated';
|
|
2
|
+
import { AppObserveAppVersion, AppObserveCustomEvent, AppObserveCustomEventListFilter, AppObserveCustomEventListOrderBy, AppObserveCustomEventName, AppObserveEvent, AppObserveEventsFilter, AppObserveEventsOrderBy, AppObserveNavigationRoute, AppObserveNavigationRoutesFilter, AppObserveNavigationRoutesOrderBy, AppObservePlatform, AppObserveTimeSeriesStatistics, PageInfo } from '../generated';
|
|
3
3
|
export type AppObserveTimeSeriesResult = {
|
|
4
4
|
appVersionMarkers: AppObserveAppVersion[];
|
|
5
5
|
eventCount: number;
|
|
@@ -17,6 +17,7 @@ type AppObserveCustomEventListQueryVariables = {
|
|
|
17
17
|
filter?: AppObserveCustomEventListFilter;
|
|
18
18
|
first?: number;
|
|
19
19
|
after?: string;
|
|
20
|
+
orderBy?: AppObserveCustomEventListOrderBy;
|
|
20
21
|
};
|
|
21
22
|
type AppObserveNavigationRoutesQueryVariables = {
|
|
22
23
|
appId: string;
|
|
@@ -114,12 +114,18 @@ exports.ObserveQuery = {
|
|
|
114
114
|
$filter: AppObserveCustomEventListFilter
|
|
115
115
|
$first: Int
|
|
116
116
|
$after: String
|
|
117
|
+
$orderBy: AppObserveCustomEventListOrderBy
|
|
117
118
|
) {
|
|
118
119
|
app {
|
|
119
120
|
byId(appId: $appId) {
|
|
120
121
|
id
|
|
121
122
|
observe {
|
|
122
|
-
customEventList(
|
|
123
|
+
customEventList(
|
|
124
|
+
filter: $filter
|
|
125
|
+
first: $first
|
|
126
|
+
after: $after
|
|
127
|
+
orderBy: $orderBy
|
|
128
|
+
) {
|
|
123
129
|
pageInfo {
|
|
124
130
|
hasNextPage
|
|
125
131
|
hasPreviousPage
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AppObserveCustomEvent, AppObservePlatform, PageInfo } from '../graphql/generated';
|
|
2
|
+
import { AppObserveCustomEvent, AppObserveCustomEventListOrderBy, AppObservePlatform, PageInfo } from '../graphql/generated';
|
|
3
3
|
interface FetchCustomEventsOptions {
|
|
4
4
|
eventName?: string;
|
|
5
5
|
limit: number;
|
|
@@ -10,6 +10,7 @@ interface FetchCustomEventsOptions {
|
|
|
10
10
|
appVersion?: string;
|
|
11
11
|
updateId?: string;
|
|
12
12
|
sessionId?: string;
|
|
13
|
+
orderBy?: AppObserveCustomEventListOrderBy;
|
|
13
14
|
}
|
|
14
15
|
interface FetchCustomEventsResult {
|
|
15
16
|
events: AppObserveCustomEvent[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { AppObserveCustomEvent, AppObserveEvent } from '../graphql/generated';
|
|
2
3
|
export interface SessionEventEntry {
|
|
3
4
|
source: 'metric' | 'log';
|
|
4
5
|
timestamp: string;
|
|
@@ -49,3 +50,44 @@ export interface FetchSessionEventsResult {
|
|
|
49
50
|
hasMoreLogEvents: boolean;
|
|
50
51
|
}
|
|
51
52
|
export declare function fetchObserveSessionEventsAsync(graphqlClient: ExpoGraphqlClient, appId: string, options: FetchSessionEventsOptions): Promise<FetchSessionEventsResult>;
|
|
53
|
+
/**
|
|
54
|
+
* A metric event that is guaranteed to belong to a session — used as a
|
|
55
|
+
* candidate when picking a session to inspect via `observe:session`.
|
|
56
|
+
*/
|
|
57
|
+
export type SessionMetricCandidate = AppObserveEvent & {
|
|
58
|
+
sessionId: string;
|
|
59
|
+
};
|
|
60
|
+
export interface FetchSessionMetricCandidatesOptions {
|
|
61
|
+
metricName: string;
|
|
62
|
+
/** One of EventsOrderPreset (case-insensitive). */
|
|
63
|
+
sort: string;
|
|
64
|
+
startTime: string;
|
|
65
|
+
endTime: string;
|
|
66
|
+
limit: number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Fetch a page of metric events for the given metricName + window, ordered
|
|
70
|
+
* per `sort`, and filtered to events that have a sessionId. The events query
|
|
71
|
+
* supports server-side ordering, so `sort` is passed straight through.
|
|
72
|
+
*/
|
|
73
|
+
export declare function fetchSessionMetricCandidatesAsync(graphqlClient: ExpoGraphqlClient, appId: string, options: FetchSessionMetricCandidatesOptions): Promise<SessionMetricCandidate[]>;
|
|
74
|
+
/**
|
|
75
|
+
* A custom log event that is guaranteed to belong to a session — used as a
|
|
76
|
+
* candidate when picking a session to inspect via `observe:session`.
|
|
77
|
+
*/
|
|
78
|
+
export type SessionLogCandidate = AppObserveCustomEvent & {
|
|
79
|
+
sessionId: string;
|
|
80
|
+
};
|
|
81
|
+
export interface FetchSessionLogCandidatesOptions {
|
|
82
|
+
eventName: string;
|
|
83
|
+
/** True → oldest-first (ascending timestamp); false → newest-first. */
|
|
84
|
+
orderAscending: boolean;
|
|
85
|
+
startTime: string;
|
|
86
|
+
endTime: string;
|
|
87
|
+
limit: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Fetch a page of custom log events for the given eventName + window, ordered
|
|
91
|
+
* by timestamp server-side, and filtered to events that have a sessionId.
|
|
92
|
+
*/
|
|
93
|
+
export declare function fetchSessionLogCandidatesAsync(graphqlClient: ExpoGraphqlClient, appId: string, options: FetchSessionLogCandidatesOptions): Promise<SessionLogCandidate[]>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchObserveSessionEventsAsync = fetchObserveSessionEventsAsync;
|
|
4
|
+
exports.fetchSessionMetricCandidatesAsync = fetchSessionMetricCandidatesAsync;
|
|
5
|
+
exports.fetchSessionLogCandidatesAsync = fetchSessionLogCandidatesAsync;
|
|
4
6
|
const generated_1 = require("../graphql/generated");
|
|
5
7
|
const fetchCustomEvents_1 = require("./fetchCustomEvents");
|
|
6
8
|
const fetchEvents_1 = require("./fetchEvents");
|
|
@@ -84,3 +86,37 @@ async function fetchObserveSessionEventsAsync(graphqlClient, appId, options) {
|
|
|
84
86
|
hasMoreLogEvents: logResult.pageInfo.hasNextPage,
|
|
85
87
|
};
|
|
86
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Fetch a page of metric events for the given metricName + window, ordered
|
|
91
|
+
* per `sort`, and filtered to events that have a sessionId. The events query
|
|
92
|
+
* supports server-side ordering, so `sort` is passed straight through.
|
|
93
|
+
*/
|
|
94
|
+
async function fetchSessionMetricCandidatesAsync(graphqlClient, appId, options) {
|
|
95
|
+
const { events } = await (0, fetchEvents_1.fetchObserveEventsAsync)(graphqlClient, appId, {
|
|
96
|
+
metricName: options.metricName,
|
|
97
|
+
orderBy: (0, fetchEvents_1.resolveOrderBy)(options.sort),
|
|
98
|
+
limit: options.limit,
|
|
99
|
+
startTime: options.startTime,
|
|
100
|
+
endTime: options.endTime,
|
|
101
|
+
});
|
|
102
|
+
return events.filter((e) => !!e.sessionId);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Fetch a page of custom log events for the given eventName + window, ordered
|
|
106
|
+
* by timestamp server-side, and filtered to events that have a sessionId.
|
|
107
|
+
*/
|
|
108
|
+
async function fetchSessionLogCandidatesAsync(graphqlClient, appId, options) {
|
|
109
|
+
const { events } = await (0, fetchCustomEvents_1.fetchObserveCustomEventsAsync)(graphqlClient, appId, {
|
|
110
|
+
eventName: options.eventName,
|
|
111
|
+
limit: options.limit,
|
|
112
|
+
startTime: options.startTime,
|
|
113
|
+
endTime: options.endTime,
|
|
114
|
+
orderBy: {
|
|
115
|
+
field: generated_1.AppObserveCustomEventListOrderByField.Timestamp,
|
|
116
|
+
direction: options.orderAscending
|
|
117
|
+
? generated_1.AppObserveEventsOrderByDirection.Asc
|
|
118
|
+
: generated_1.AppObserveEventsOrderByDirection.Desc,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
return events.filter((e) => !!e.sessionId);
|
|
122
|
+
}
|