eas-cli 23.2.0 → 24.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.
Files changed (103) hide show
  1. package/README.md +636 -331
  2. package/build/build/utils/url.d.ts +1 -0
  3. package/build/build/utils/url.js +4 -0
  4. package/build/channel/protection.d.ts +4 -0
  5. package/build/channel/protection.js +49 -0
  6. package/build/channel/queries.d.ts +6 -0
  7. package/build/channel/queries.js +5 -1
  8. package/build/commands/channel/protect.d.ts +16 -0
  9. package/build/commands/channel/protect.js +68 -0
  10. package/build/commands/channel/unprotect.d.ts +16 -0
  11. package/build/commands/channel/unprotect.js +78 -0
  12. package/build/commands/observe/errors.d.ts +27 -0
  13. package/build/commands/observe/errors.js +122 -0
  14. package/build/commands/observe/event.d.ts +18 -0
  15. package/build/commands/observe/event.js +149 -0
  16. package/build/commands/observe/events.d.ts +2 -0
  17. package/build/commands/observe/events.js +10 -4
  18. package/build/commands/observe/metrics-summary.d.ts +1 -0
  19. package/build/commands/observe/metrics-summary.js +3 -2
  20. package/build/commands/observe/metrics.d.ts +2 -0
  21. package/build/commands/observe/metrics.js +8 -4
  22. package/build/commands/observe/routes.d.ts +2 -1
  23. package/build/commands/observe/routes.js +5 -5
  24. package/build/commands/observe/session.d.ts +1 -0
  25. package/build/commands/observe/session.js +14 -8
  26. package/build/commands/observe/versions.d.ts +1 -0
  27. package/build/commands/observe/versions.js +3 -2
  28. package/build/commands/project/status.d.ts +16 -0
  29. package/build/commands/project/status.js +47 -0
  30. package/build/commands/simulator/egress.d.ts +13 -0
  31. package/build/commands/simulator/egress.js +60 -0
  32. package/build/commands/simulator/get.js +3 -1
  33. package/build/commands/simulator/index.d.ts +2 -0
  34. package/build/commands/simulator/index.js +81 -11
  35. package/build/credentials/ios/credentials.d.ts +5 -3
  36. package/build/credentials/ios/utils/printCredentials.js +6 -1
  37. package/build/graphql/generated.d.ts +2388 -1092
  38. package/build/graphql/generated.js +64 -17
  39. package/build/graphql/mutations/RealtimeLogsMutation.d.ts +2 -2
  40. package/build/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +1 -1
  41. package/build/graphql/queries/AppStoreConnectApiKeyQuery.js +1 -1
  42. package/build/graphql/queries/ChannelQuery.js +2 -0
  43. package/build/graphql/queries/DeviceRunSessionQuery.js +25 -0
  44. package/build/graphql/queries/ObserveQuery.d.ts +62 -30
  45. package/build/graphql/queries/ObserveQuery.js +276 -121
  46. package/build/graphql/queries/SubmissionQuery.d.ts +6 -1
  47. package/build/graphql/queries/SubmissionQuery.js +41 -0
  48. package/build/graphql/types/Observe.d.ts +5 -3
  49. package/build/graphql/types/Observe.js +80 -21
  50. package/build/graphql/types/UpdateChannelBasicInfo.js +1 -0
  51. package/build/observe/fetchCustomEvents.d.ts +6 -4
  52. package/build/observe/fetchCustomEvents.js +4 -2
  53. package/build/observe/fetchErrors.d.ts +32 -0
  54. package/build/observe/fetchErrors.js +42 -0
  55. package/build/observe/fetchEvents.d.ts +9 -6
  56. package/build/observe/fetchEvents.js +16 -17
  57. package/build/observe/fetchMetrics.d.ts +2 -2
  58. package/build/observe/fetchMetrics.js +9 -9
  59. package/build/observe/fetchNavigationRoutes.d.ts +7 -5
  60. package/build/observe/fetchNavigationRoutes.js +8 -8
  61. package/build/observe/fetchSessions.d.ts +13 -11
  62. package/build/observe/fetchSessions.js +59 -30
  63. package/build/observe/fetchVersions.d.ts +4 -3
  64. package/build/observe/fetchVersions.js +7 -11
  65. package/build/observe/flags.d.ts +6 -0
  66. package/build/observe/flags.js +12 -2
  67. package/build/observe/formatCustomEvents.d.ts +16 -10
  68. package/build/observe/formatCustomEvents.js +61 -28
  69. package/build/observe/formatErrors.d.ts +97 -0
  70. package/build/observe/formatErrors.js +203 -0
  71. package/build/observe/formatEvents.d.ts +11 -5
  72. package/build/observe/formatEvents.js +46 -18
  73. package/build/observe/formatMetrics.d.ts +4 -4
  74. package/build/observe/formatMetrics.js +2 -2
  75. package/build/observe/formatNavigationRoutes.d.ts +4 -4
  76. package/build/observe/formatNavigationRoutes.js +3 -3
  77. package/build/observe/formatSessions.d.ts +3 -3
  78. package/build/observe/formatSessions.js +8 -8
  79. package/build/observe/formatVersions.js +2 -2
  80. package/build/observe/platforms.d.ts +10 -19
  81. package/build/observe/platforms.js +42 -40
  82. package/build/project/projectStatus.d.ts +96 -0
  83. package/build/project/projectStatus.js +314 -0
  84. package/build/simulator/egress.d.ts +121 -0
  85. package/build/simulator/egress.js +865 -0
  86. package/build/simulator/env.d.ts +5 -0
  87. package/build/simulator/env.js +42 -1
  88. package/build/simulator/utils.d.ts +53 -2
  89. package/build/simulator/utils.js +158 -10
  90. package/build/submit/utils/urls.js +2 -3
  91. package/build/utils/centrifuge.d.ts +2 -2
  92. package/oclif.manifest.json +1162 -546
  93. package/package.json +7 -7
  94. package/build/chat/chatClient.d.ts +0 -37
  95. package/build/chat/chatClient.js +0 -359
  96. package/build/chat/detectProject.d.ts +0 -5
  97. package/build/chat/detectProject.js +0 -41
  98. package/build/chat/renderMarkdown.d.ts +0 -7
  99. package/build/chat/renderMarkdown.js +0 -47
  100. package/build/chat/replInput.d.ts +0 -10
  101. package/build/chat/replInput.js +0 -52
  102. package/build/commands/chat.d.ts +0 -18
  103. package/build/commands/chat.js +0 -221
@@ -33,7 +33,9 @@ class ObserveEvents extends EasCommand_1.default {
33
33
  }),
34
34
  ...flags_2.ObserveTimeRangeFlags,
35
35
  ...flags_2.ObserveAppVersionFlag,
36
+ ...flags_2.ObserveBuildNumberFlag,
36
37
  ...flags_2.ObserveUpdateIdFlag,
38
+ ...flags_2.ObserveEnvironmentFlag,
37
39
  'session-id': core_1.Flags.string({
38
40
  description: 'Filter by session ID. When no event name is given, lists the events in the session instead of the event-name summary.',
39
41
  }),
@@ -68,7 +70,7 @@ class ObserveEvents extends EasCommand_1.default {
68
70
  (0, json_1.enableJsonOutput)();
69
71
  }
70
72
  const { daysBack, startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(flags);
71
- const platform = (0, platforms_1.appObservePlatformFromFlag)(flags.platform);
73
+ const platforms = (0, platforms_1.observePlatformsFromFlag)(flags.platform);
72
74
  // A session ID narrows to a single session, so show that session's events
73
75
  // (like --all-events) instead of the account-wide name+count summary, which
74
76
  // has no session filter.
@@ -77,7 +79,8 @@ class ObserveEvents extends EasCommand_1.default {
77
79
  appId: projectId,
78
80
  startTime,
79
81
  endTime,
80
- platform,
82
+ platforms,
83
+ environment: flags.environment,
81
84
  }));
82
85
  if (json) {
83
86
  (0, json_1.printJsonOnlyOutput)((0, formatCustomEvents_1.buildObserveCustomEventNamesJson)(names, isTruncated));
@@ -99,17 +102,20 @@ class ObserveEvents extends EasCommand_1.default {
99
102
  ...(flags.after && { after: flags.after }),
100
103
  startTime,
101
104
  endTime,
102
- platform,
105
+ platforms,
103
106
  appVersion: flags['app-version'],
107
+ buildNumber: flags['build-number'],
104
108
  updateId: flags['update-id'],
105
109
  sessionId: flags['session-id'],
110
+ environment: flags.environment,
106
111
  }));
107
112
  if (args.eventName && events.length === 0) {
108
113
  const { names, isTruncated } = await ObserveQuery_1.ObserveQuery.customEventNamesAsync(graphqlClient, {
109
114
  appId: projectId,
110
115
  startTime,
111
116
  endTime,
112
- platform,
117
+ platforms,
118
+ environment: flags.environment,
113
119
  });
114
120
  if (json) {
115
121
  (0, json_1.printJsonOnlyOutput)((0, formatCustomEvents_1.buildObserveCustomEventsEmptyWithSuggestionsJson)(args.eventName, names, isTruncated));
@@ -5,6 +5,7 @@ export default class ObserveMetricsSummary extends EasCommand {
5
5
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
6
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
7
  'project-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
9
  start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
10
  end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
11
  days: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -47,6 +47,7 @@ class ObserveMetricsSummary extends EasCommand_1.default {
47
47
  options: DEFAULT_STATS_JSON,
48
48
  })(),
49
49
  ...flags_2.ObserveTimeRangeFlags,
50
+ ...flags_2.ObserveEnvironmentFlag,
50
51
  ...flags_2.ObserveProjectIdFlag,
51
52
  ...flags_1.EasNonInteractiveAndJsonFlags,
52
53
  };
@@ -74,8 +75,8 @@ class ObserveMetricsSummary extends EasCommand_1.default {
74
75
  ? flags.metric.map(metricNames_1.resolveMetricName)
75
76
  : DEFAULT_METRICS;
76
77
  const { daysBack, startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(flags);
77
- const platforms = (0, platforms_1.appPlatformsFromFlag)(flags.platform);
78
- const { metricsMap, buildNumbersMap, updateIdsMap, totalEventCounts } = await (0, planGating_1.withObservePlanGateHandlingAsync)(() => (0, fetchMetrics_1.fetchObserveMetricsAsync)(graphqlClient, projectId, metricNames, platforms, startTime, endTime));
78
+ const targets = (0, platforms_1.observePlatformTargetsFromFlag)(flags.platform);
79
+ const { metricsMap, buildNumbersMap, updateIdsMap, totalEventCounts } = await (0, planGating_1.withObservePlanGateHandlingAsync)(() => (0, fetchMetrics_1.fetchObserveMetricsAsync)(graphqlClient, projectId, metricNames, targets, startTime, endTime, flags.environment));
79
80
  const argumentsStat = flags.stat?.length
80
81
  ? Array.from(new Set(flags.stat.map(formatMetrics_1.resolveStatKey)))
81
82
  : undefined;
@@ -8,7 +8,9 @@ export default class ObserveMetrics extends EasCommand {
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
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
12
  'update-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'build-number': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
14
  'app-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
15
  start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
16
  end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -42,7 +42,9 @@ class ObserveMetrics extends EasCommand_1.default {
42
42
  }),
43
43
  ...flags_2.ObserveTimeRangeFlags,
44
44
  ...flags_2.ObserveAppVersionFlag,
45
+ ...flags_2.ObserveBuildNumberFlag,
45
46
  ...flags_2.ObserveUpdateIdFlag,
47
+ ...flags_2.ObserveEnvironmentFlag,
46
48
  ...flags_2.ObserveProjectIdFlag,
47
49
  ...flags_1.EasNonInteractiveAndJsonFlags,
48
50
  };
@@ -83,8 +85,8 @@ class ObserveMetrics extends EasCommand_1.default {
83
85
  }
84
86
  const orderBy = (0, fetchEvents_1.resolveOrderBy)(flags.sort);
85
87
  const { daysBack, startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(flags);
86
- const platform = (0, platforms_1.appObservePlatformFromFlag)(flags.platform);
87
- const platforms = (0, platforms_1.appPlatformsFromFlag)(flags.platform);
88
+ const platforms = (0, platforms_1.observePlatformsFromFlag)(flags.platform);
89
+ const targets = (0, platforms_1.observePlatformTargetsFromFlag)(flags.platform);
88
90
  const [{ events, pageInfo }, totalEventCount] = await (0, planGating_1.withObservePlanGateHandlingAsync)(() => Promise.all([
89
91
  (0, fetchEvents_1.fetchObserveEventsAsync)(graphqlClient, projectId, {
90
92
  metricName,
@@ -93,11 +95,13 @@ class ObserveMetrics extends EasCommand_1.default {
93
95
  ...(flags.after && { after: flags.after }),
94
96
  startTime,
95
97
  endTime,
96
- platform,
98
+ platforms,
97
99
  appVersion: flags['app-version'],
100
+ buildNumber: flags['build-number'],
98
101
  updateId: flags['update-id'],
102
+ environment: flags.environment,
99
103
  }),
100
- (0, fetchEvents_1.fetchTotalEventCountAsync)(graphqlClient, projectId, metricName, platforms, startTime, endTime),
104
+ (0, fetchEvents_1.fetchTotalEventCountAsync)(graphqlClient, projectId, metricName, targets, startTime, endTime, flags.environment),
101
105
  ]));
102
106
  if (json) {
103
107
  (0, json_1.printJsonOnlyOutput)((0, formatEvents_1.buildObserveEventsJson)(events, pageInfo));
@@ -5,9 +5,10 @@ export default class ObserveRoutes extends EasCommand {
5
5
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
6
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
7
  'project-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
- 'build-number': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
9
  'route-name': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  'update-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'build-number': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
12
  'app-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
13
  start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
14
  end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -40,14 +40,13 @@ class ObserveRoutes extends EasCommand_1.default {
40
40
  }),
41
41
  ...flags_2.ObserveTimeRangeFlags,
42
42
  ...flags_2.ObserveAppVersionFlag,
43
+ ...flags_2.ObserveBuildNumberFlag,
43
44
  ...flags_2.ObserveUpdateIdFlag,
44
- 'build-number': core_1.Flags.string({
45
- description: 'Filter by app build number',
46
- }),
47
45
  'route-name': core_1.Flags.string({
48
46
  description: 'Filter by route name (can be specified multiple times to include several routes)',
49
47
  multiple: true,
50
48
  }),
49
+ ...flags_2.ObserveEnvironmentFlag,
51
50
  ...flags_2.ObserveProjectIdFlag,
52
51
  ...flags_1.EasNonInteractiveAndJsonFlags,
53
52
  };
@@ -81,17 +80,18 @@ class ObserveRoutes extends EasCommand_1.default {
81
80
  ? Array.from(new Set(flags['route-name']))
82
81
  : undefined;
83
82
  const { daysBack, startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(flags);
84
- const platforms = (0, platforms_1.appPlatformsFromFlag)(flags.platform);
83
+ const targets = (0, platforms_1.observePlatformTargetsFromFlag)(flags.platform);
85
84
  const { routes, pageInfoByPlatform } = await (0, planGating_1.withObservePlanGateHandlingAsync)(() => (0, fetchNavigationRoutes_1.fetchObserveNavigationRoutesAsync)(graphqlClient, projectId, {
86
85
  startTime,
87
86
  endTime,
88
- platforms,
87
+ targets,
89
88
  limit: flags.limit ?? DEFAULT_ROUTES_LIMIT,
90
89
  ...(flags.after && { after: flags.after }),
91
90
  appVersion: flags['app-version'],
92
91
  updateId: flags['update-id'],
93
92
  buildNumber: flags['build-number'],
94
93
  routeNames,
94
+ environment: flags.environment,
95
95
  }));
96
96
  if (json) {
97
97
  const stats = argumentsStat ?? DEFAULT_STATS_JSON;
@@ -8,6 +8,7 @@ export default class ObserveSession extends EasCommand {
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
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
12
  start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
13
  end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
14
  days: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -42,6 +42,7 @@ class ObserveSession extends EasCommand_1.default {
42
42
  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.',
43
43
  }),
44
44
  ...flags_2.ObserveTimeRangeFlags,
45
+ ...flags_2.ObserveEnvironmentFlag,
45
46
  ...flags_2.ObserveProjectIdFlag,
46
47
  ...flags_1.EasNonInteractiveAndJsonFlags,
47
48
  };
@@ -71,9 +72,10 @@ class ObserveSession extends EasCommand_1.default {
71
72
  flags.sort !== undefined ||
72
73
  flags.days !== undefined ||
73
74
  flags.start !== undefined ||
74
- flags.end !== undefined;
75
+ flags.end !== undefined ||
76
+ flags.environment !== undefined;
75
77
  if (pickerFlagsProvided) {
76
- 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.');
78
+ throw new errors_1.EasCommandError('The picker flags (--event-name, --sort, --days, --start, --end, --environment) describe how to find a session and cannot be combined with a session ID argument.');
77
79
  }
78
80
  sessionId = args.sessionId;
79
81
  }
@@ -92,6 +94,7 @@ class ObserveSession extends EasCommand_1.default {
92
94
  eventNameFlag: flags['event-name'],
93
95
  sort: flags.sort,
94
96
  timeRangeFlags: { days: flags.days, start: flags.start, end: flags.end },
97
+ environment: flags.environment,
95
98
  });
96
99
  }
97
100
  const { entries, metadata, hasMoreMetricEvents, hasMoreLogEvents } = await (0, planGating_1.withObservePlanGateHandlingAsync)(() => (0, fetchSessions_1.fetchObserveSessionEventsAsync)(graphqlClient, projectId, {
@@ -112,11 +115,11 @@ class ObserveSession extends EasCommand_1.default {
112
115
  }
113
116
  }
114
117
  exports.default = ObserveSession;
115
- async function pickSessionIdInteractivelyAsync({ graphqlClient, projectId, eventNameFlag, sort, timeRangeFlags, }) {
118
+ async function pickSessionIdInteractivelyAsync({ graphqlClient, projectId, eventNameFlag, sort, timeRangeFlags, environment, }) {
116
119
  const { startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(timeRangeFlags);
117
120
  const eventNameChoice = eventNameFlag
118
121
  ? { name: eventNameFlag, isMetric: (0, metricNames_1.isKnownMetricName)(eventNameFlag) }
119
- : await promptForEventNameAsync({ graphqlClient, projectId, startTime, endTime });
122
+ : await promptForEventNameAsync({ graphqlClient, projectId, startTime, endTime, environment });
120
123
  let sortValue;
121
124
  if (sort) {
122
125
  const preset = sort.toUpperCase();
@@ -136,6 +139,7 @@ async function pickSessionIdInteractivelyAsync({ graphqlClient, projectId, event
136
139
  startTime,
137
140
  endTime,
138
141
  limit: PICKER_CANDIDATE_LIMIT,
142
+ environment,
139
143
  })).map(event => ({ sessionId: event.sessionId, title: (0, formatSessions_1.formatMetricCandidateTitle)(event) }))
140
144
  : (await (0, fetchSessions_1.fetchSessionLogCandidatesAsync)(graphqlClient, projectId, {
141
145
  eventName: eventNameChoice.name,
@@ -143,6 +147,7 @@ async function pickSessionIdInteractivelyAsync({ graphqlClient, projectId, event
143
147
  startTime,
144
148
  endTime,
145
149
  limit: PICKER_CANDIDATE_LIMIT,
150
+ environment,
146
151
  })).map(event => ({ sessionId: event.sessionId, title: (0, formatSessions_1.formatLogCandidateTitle)(event) }));
147
152
  if (candidates.length === 0) {
148
153
  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.`);
@@ -168,19 +173,20 @@ async function promptForSortOrderAsync(isMetric) {
168
173
  ];
169
174
  return await (0, prompts_1.selectAsync)('Sort candidate events by', choices);
170
175
  }
171
- async function promptForEventNameAsync({ graphqlClient, projectId, startTime, endTime, }) {
176
+ async function promptForEventNameAsync({ graphqlClient, projectId, startTime, endTime, environment, }) {
172
177
  const { names: customEventNames } = await ObserveQuery_1.ObserveQuery.customEventNamesAsync(graphqlClient, {
173
178
  appId: projectId,
174
179
  startTime,
175
180
  endTime,
181
+ environment,
176
182
  });
177
183
  const metricChoices = Object.entries(metricNames_1.METRIC_SHORT_NAMES).map(([fullName, displayName]) => ({
178
184
  title: `${displayName} (metric)`,
179
185
  value: { name: fullName, isMetric: true },
180
186
  }));
181
- const logChoices = customEventNames.map(({ eventName, count }) => ({
182
- title: `${eventName} (${count} log event${count === 1 ? '' : 's'})`,
183
- value: { name: eventName, isMetric: false },
187
+ const logChoices = customEventNames.map(({ name, count }) => ({
188
+ title: `${name} (${count} log event${count === 1 ? '' : 's'})`,
189
+ value: { name, isMetric: false },
184
190
  }));
185
191
  const choices = [...metricChoices, ...logChoices];
186
192
  if (choices.length === 0) {
@@ -5,6 +5,7 @@ export default class ObserveVersions extends EasCommand {
5
5
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
6
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
7
  'project-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
9
  start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
10
  end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
11
  days: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -16,6 +16,7 @@ class ObserveVersions extends EasCommand_1.default {
16
16
  static flags = {
17
17
  ...flags_2.ObservePlatformFlag,
18
18
  ...flags_2.ObserveTimeRangeFlags,
19
+ ...flags_2.ObserveEnvironmentFlag,
19
20
  ...flags_2.ObserveProjectIdFlag,
20
21
  ...flags_1.EasNonInteractiveAndJsonFlags,
21
22
  };
@@ -40,8 +41,8 @@ class ObserveVersions extends EasCommand_1.default {
40
41
  (0, json_1.enableJsonOutput)();
41
42
  }
42
43
  const { startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(flags);
43
- const platforms = (0, platforms_1.appPlatformsFromFlag)(flags.platform);
44
- const results = await (0, fetchVersions_1.fetchObserveVersionsAsync)(graphqlClient, projectId, platforms, startTime, endTime);
44
+ const targets = (0, platforms_1.observePlatformTargetsFromFlag)(flags.platform);
45
+ const results = await (0, fetchVersions_1.fetchObserveVersionsAsync)(graphqlClient, projectId, targets, startTime, endTime, flags.environment);
45
46
  if (json) {
46
47
  (0, json_1.printJsonOnlyOutput)((0, formatVersions_1.buildObserveVersionsJson)(results));
47
48
  }
@@ -0,0 +1,16 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ export default class ProjectStatus extends EasCommand {
3
+ static description: string;
4
+ static aliases: string[];
5
+ static examples: string[];
6
+ static flags: {
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
10
+ };
11
+ static contextDefinition: {
12
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
13
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
14
+ };
15
+ runAsync(): Promise<void>;
16
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
5
+ const flags_1 = require("../../commandUtils/flags");
6
+ const pagination_1 = require("../../commandUtils/pagination");
7
+ const projectStatus_1 = require("../../project/projectStatus");
8
+ const json_1 = require("../../utils/json");
9
+ class ProjectStatus extends EasCommand_1.default {
10
+ static description = 'show a snapshot of the project: recent builds, dev builds, workflow runs, submissions, and updates';
11
+ static aliases = ['status'];
12
+ static examples = [
13
+ '$ eas status \t # Show a concise project snapshot',
14
+ '$ eas status --json \t # Output a machine-readable snapshot for agents and automation',
15
+ '$ eas status --json --limit 10 \t # Include more activity from each section',
16
+ ];
17
+ static flags = {
18
+ limit: (0, pagination_1.getLimitFlagWithCustomValues)({
19
+ defaultTo: projectStatus_1.PROJECT_STATUS_DEFAULT_LIMIT,
20
+ limit: 25,
21
+ description: `The number of items to show in each section. Defaults to ${projectStatus_1.PROJECT_STATUS_DEFAULT_LIMIT} and is capped at 25.`,
22
+ }),
23
+ ...flags_1.EasNonInteractiveAndJsonFlags,
24
+ };
25
+ static contextDefinition = {
26
+ ...this.ContextOptions.ProjectId,
27
+ ...this.ContextOptions.LoggedIn,
28
+ };
29
+ async runAsync() {
30
+ const { flags } = await this.parse(ProjectStatus);
31
+ const { json: jsonFlag, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
32
+ if (jsonFlag) {
33
+ (0, json_1.enableJsonOutput)();
34
+ }
35
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ProjectStatus, { nonInteractive });
36
+ const status = await (0, projectStatus_1.getProjectStatusAsync)(graphqlClient, {
37
+ projectId,
38
+ limit: flags.limit ?? projectStatus_1.PROJECT_STATUS_DEFAULT_LIMIT,
39
+ });
40
+ if (jsonFlag) {
41
+ (0, json_1.printJsonOnlyOutput)(status);
42
+ return;
43
+ }
44
+ (0, projectStatus_1.printProjectStatusAsText)(status);
45
+ }
46
+ }
47
+ exports.default = ProjectStatus;
@@ -0,0 +1,13 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ export default class SimulatorEgress extends EasCommand {
3
+ static hidden: boolean;
4
+ static aliases: string[];
5
+ static description: string;
6
+ static flags: {
7
+ 'config-type': import("@oclif/core/lib/interfaces").OptionFlag<"env" | "dotenv", import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ };
9
+ static contextDefinition: {
10
+ projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
11
+ };
12
+ runAsync(): Promise<void>;
13
+ }
@@ -0,0 +1,60 @@
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 log_1 = tslib_1.__importDefault(require("../../log"));
7
+ const egress_1 = require("../../simulator/egress");
8
+ const env_1 = require("../../simulator/env");
9
+ class SimulatorEgress extends EasCommand_1.default {
10
+ static hidden = true;
11
+ static aliases = ['sim:egress'];
12
+ static description = `[EXPERIMENTAL] run the local egress client for a simulator session to route proxied HTTP(S) requests through this machine`;
13
+ static flags = {
14
+ 'config-type': core_1.Flags.option({
15
+ description: `Read session credentials from ${env_1.SIMULATOR_DOTENV_FILE_NAME} (dotenv) or the current shell environment (env).`,
16
+ options: ['dotenv', 'env'],
17
+ default: 'dotenv',
18
+ })(),
19
+ };
20
+ static contextDefinition = {
21
+ ...this.ContextOptions.ProjectDir,
22
+ };
23
+ async runAsync() {
24
+ const { flags } = await this.parse(SimulatorEgress);
25
+ const { projectDir } = await this.getContextAsync(SimulatorEgress, {
26
+ nonInteractive: true,
27
+ });
28
+ if (flags['config-type'] === 'dotenv') {
29
+ await (0, env_1.loadSimulatorEnvAsync)(projectDir);
30
+ }
31
+ const egress = (0, egress_1.readLocalEgressConfigFromEnv)(process.env);
32
+ const deviceRunSessionId = process.env[env_1.EAS_SIMULATOR_SESSION_ID];
33
+ log_1.default.log(`Starting the local egress client${deviceRunSessionId ? ` for simulator session ${deviceRunSessionId}` : ''}. When connected, proxied HTTP(S) requests can use this machine's network.`);
34
+ log_1.default.log('Press Ctrl+C to stop the egress client. The simulator session keeps running; ' +
35
+ `proxied HTTP(S) requests are unavailable until the tunnel reconnects. Stop the session with \`eas simulator:stop${deviceRunSessionId ? ` --id ${deviceRunSessionId}` : ''}\`.`);
36
+ log_1.default.newLine();
37
+ const abortController = new AbortController();
38
+ const handleSigint = () => {
39
+ abortController.abort();
40
+ };
41
+ process.on('SIGINT', handleSigint);
42
+ try {
43
+ await (0, egress_1.runLocalEgressAsync)({
44
+ ...egress,
45
+ signal: abortController.signal,
46
+ onConnected: () => {
47
+ log_1.default.succeed("Egress tunnel connected. Proxied HTTP(S) requests can use this machine's network.");
48
+ },
49
+ onDisconnected: () => {
50
+ log_1.default.warn('Egress tunnel disconnected; reconnecting. Proxied HTTP(S) requests are unavailable until it reconnects.');
51
+ },
52
+ });
53
+ }
54
+ finally {
55
+ process.removeListener('SIGINT', handleSigint);
56
+ }
57
+ log_1.default.log('Egress client stopped.');
58
+ }
59
+ }
60
+ exports.default = SimulatorEgress;
@@ -66,7 +66,9 @@ class SimulatorGet extends EasCommand_1.default {
66
66
  finishedAt: session.finishedAt ?? undefined,
67
67
  updatedAt: session.updatedAt,
68
68
  deviceRunSessionUrl,
69
- remoteConfig: session.remoteConfig,
69
+ remoteConfig: session.remoteConfig
70
+ ? (0, utils_1.sanitizeRemoteConfigForJson)(session.remoteConfig)
71
+ : session.remoteConfig,
70
72
  artifacts: session.artifacts,
71
73
  });
72
74
  return;
@@ -21,6 +21,8 @@ export default class Simulator extends EasCommand {
21
21
  'max-duration-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
22
  'max-idle-time-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
23
23
  'resource-class': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
+ egress: import("@oclif/core/lib/interfaces").OptionFlag<"local" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
+ 'egress-allow': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
26
  force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
25
27
  'out-config-type': import("@oclif/core/lib/interfaces").OptionFlag<"env" | "dotenv", import("@oclif/core/lib/interfaces").CustomOptions>;
26
28
  };
@@ -14,6 +14,7 @@ const DeviceRunSessionQuery_1 = require("../../graphql/queries/DeviceRunSessionQ
14
14
  const log_1 = tslib_1.__importStar(require("../../log"));
15
15
  const ora_1 = require("../../ora");
16
16
  const prompts_1 = require("../../prompts");
17
+ const egress_1 = require("../../simulator/egress");
17
18
  const env_1 = require("../../simulator/env");
18
19
  const expoGo_1 = require("../../simulator/expoGo");
19
20
  const utils_1 = require("../../simulator/utils");
@@ -26,6 +27,7 @@ const OUT_CONFIG_TYPE_VALUES = {
26
27
  Dotenv: 'dotenv',
27
28
  };
28
29
  const PLATFORM_FLAG_VALUES = ['android', 'ios'];
30
+ const EGRESS_FLAG_VALUES = ['local'];
29
31
  const APP_PLATFORM_BY_FLAG_VALUE = {
30
32
  android: generated_1.AppPlatform.Android,
31
33
  ios: generated_1.AppPlatform.Ios,
@@ -93,6 +95,15 @@ class Simulator extends EasCommand_1.default {
93
95
  hidden: true,
94
96
  options: Object.values(utils_1.DEVICE_RUN_SESSION_RESOURCE_CLASS_FLAG_VALUES),
95
97
  })(),
98
+ egress: core_1.Flags.option({
99
+ description: 'With "local", the simulator system proxy points at this machine: HTTP(S) and WebSocket requests that honor it (WebKit, URLSession) exit from this machine and fail while the egress client is disconnected. Requests from libraries that bypass the system proxy are not covered. The egress client must keep running for the life of the session. Only supported with --platform ios.',
100
+ options: EGRESS_FLAG_VALUES,
101
+ })(),
102
+ 'egress-allow': core_1.Flags.string({
103
+ description: 'Destination on this machine or its network that the simulator may reach through local egress, as an exact host:port (for example localhost:3000). Repeat for multiple destinations. A localhost or 127.0.0.1 entry also forwards that port from the simulator host to this machine (like adb reverse), so dev server URLs that use 127.0.0.1 work. Requires --egress local.',
104
+ multiple: true,
105
+ dependsOn: ['egress'],
106
+ }),
96
107
  force: core_1.Flags.boolean({
97
108
  description: '[default: true] Create a new simulator session even when an existing simulator session is present in the environment.',
98
109
  default: true,
@@ -156,6 +167,17 @@ class Simulator extends EasCommand_1.default {
156
167
  throw new Error(`Existing simulator session in environment. Use --force to create a new simulator session.`);
157
168
  }
158
169
  const platform = await resolvePlatformAsync(flags.platform, nonInteractive);
170
+ const egress = flags.egress === 'local' ? generated_1.DeviceRunSessionEgress.Local : undefined;
171
+ if (egress && platform !== generated_1.AppPlatform.Ios) {
172
+ throw new errors_1.EasCommandError('--egress local is only supported with --platform ios.');
173
+ }
174
+ let egressAllow = [];
175
+ try {
176
+ egressAllow = (0, egress_1.parseEgressAllowList)(flags['egress-allow'] ?? []);
177
+ }
178
+ catch (err) {
179
+ throw new errors_1.EasCommandError(err instanceof Error ? err.message : String(err));
180
+ }
159
181
  if (platform === generated_1.AppPlatform.Android) {
160
182
  log_1.default.warn('Android emulator support in EAS Simulator is still in development. Some features available on iOS may not work on Android yet. Full parity with iOS is coming soon.');
161
183
  log_1.default.newLine();
@@ -181,7 +203,11 @@ class Simulator extends EasCommand_1.default {
181
203
  platform,
182
204
  type: utils_1.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE[flags.type],
183
205
  packageVersion: flags['package-version'],
184
- deviceIdentifier,
206
+ ...(deviceIdentifier
207
+ ? platform === generated_1.AppPlatform.Ios
208
+ ? { ios: { deviceIdentifier } }
209
+ : { android: { deviceIdentifier } }
210
+ : {}),
185
211
  ...(buildId ? { buildId } : {}),
186
212
  ...(applicationArchiveUrlFromFlag
187
213
  ? { applicationArchiveUrl: applicationArchiveUrlFromFlag }
@@ -190,6 +216,7 @@ class Simulator extends EasCommand_1.default {
190
216
  ...(launchArgs?.length ? { launchArgs } : {}),
191
217
  ...(openUrl ? { openUrl } : {}),
192
218
  ...(resourceClass ? { resourceClass } : {}),
219
+ ...(egress ? { egress } : {}),
193
220
  maxRunTimeMinutes: flags['max-duration-minutes'],
194
221
  maxIdleTimeMinutes: flags['max-idle-time-minutes'],
195
222
  });
@@ -263,7 +290,7 @@ class Simulator extends EasCommand_1.default {
263
290
  }
264
291
  if (flags['out-config-type'] === OUT_CONFIG_TYPE_VALUES.Dotenv) {
265
292
  await writeSimulatorEnvSafelyAsync(projectDir, {
266
- ...(0, utils_1.getRemoteSessionEnvironmentVariables)(remoteConfig),
293
+ ...(0, utils_1.getRemoteSessionEnvironmentVariables)(remoteConfig, { egressAllow }),
267
294
  [env_1.EAS_SIMULATOR_SESSION_ID]: deviceRunSessionId,
268
295
  });
269
296
  }
@@ -284,25 +311,65 @@ class Simulator extends EasCommand_1.default {
284
311
  name,
285
312
  type: flags.type,
286
313
  deviceRunSessionUrl,
287
- remoteConfig,
314
+ remoteConfig: (0, utils_1.sanitizeRemoteConfigForJson)(remoteConfig),
288
315
  });
289
316
  return;
290
317
  }
291
318
  log_1.default.newLine();
292
- log_1.default.log((0, utils_1.formatRemoteSessionInstructions)(remoteConfig, flags['out-config-type']));
319
+ log_1.default.log((0, utils_1.formatRemoteSessionInstructions)(remoteConfig, flags['out-config-type'], { egressAllow }));
293
320
  log_1.default.newLine();
321
+ const localEgress = (0, utils_1.getLocalEgressConfig)(remoteConfig, egressAllow);
294
322
  if (nonInteractive) {
295
323
  sessionInterrupt.dispose();
324
+ if (localEgress) {
325
+ log_1.default.log(`Start \`eas simulator:egress${flags['out-config-type'] === OUT_CONFIG_TYPE_VALUES.Env ? ' --config-type env' : ''}\` in another process to connect the tunnel for proxied HTTP(S) requests.`);
326
+ }
296
327
  log_1.default.log(`When you are done, stop the session with: eas simulator:stop --id ${deviceRunSessionId}`);
297
328
  return;
298
329
  }
299
- await waitForSessionEndOrInterruptAsync({
300
- graphqlClient,
301
- deviceRunSessionId,
302
- deviceRunSessionUrl,
303
- projectDir,
304
- sessionInterrupt,
305
- });
330
+ // In interactive mode the egress client runs right here, for as long as the
331
+ // session does. A session with a disconnected tunnel still bills, so Ctrl+C stops both.
332
+ let egressPromise;
333
+ let egressError;
334
+ const egressAbortController = new AbortController();
335
+ if (localEgress) {
336
+ log_1.default.log("🔀 Running the egress client in this terminal. When connected, proxied HTTP(S) requests can use this machine's network.");
337
+ log_1.default.log('Press Ctrl+C to stop both the egress client and the simulator session.');
338
+ log_1.default.newLine();
339
+ sessionInterrupt.signal.addEventListener('abort', () => {
340
+ egressAbortController.abort();
341
+ }, { once: true });
342
+ egressPromise = (0, egress_1.runLocalEgressAsync)({
343
+ ...localEgress,
344
+ signal: egressAbortController.signal,
345
+ onConnected: () => {
346
+ log_1.default.succeed("Egress tunnel connected. Proxied HTTP(S) requests can use this machine's network.");
347
+ },
348
+ onDisconnected: () => {
349
+ log_1.default.warn('Egress tunnel disconnected; reconnecting. Proxied HTTP(S) requests are unavailable until it reconnects.');
350
+ },
351
+ }).catch(err => {
352
+ egressError = err instanceof Error ? err : new Error(String(err));
353
+ log_1.default.error(`${err instanceof Error ? err.message : String(err)} Stopping the simulator session.`);
354
+ sessionInterrupt.abort();
355
+ });
356
+ }
357
+ try {
358
+ await waitForSessionEndOrInterruptAsync({
359
+ graphqlClient,
360
+ deviceRunSessionId,
361
+ deviceRunSessionUrl,
362
+ projectDir,
363
+ sessionInterrupt,
364
+ });
365
+ }
366
+ finally {
367
+ egressAbortController.abort();
368
+ await egressPromise;
369
+ }
370
+ if (egressError) {
371
+ throw egressError;
372
+ }
306
373
  }
307
374
  }
308
375
  exports.default = Simulator;
@@ -398,6 +465,9 @@ function registerSessionInterrupt(deviceRunSessionId) {
398
465
  return {
399
466
  signal,
400
467
  abortPromise,
468
+ abort: () => {
469
+ abortController.abort();
470
+ },
401
471
  dispose: () => process.removeListener('SIGINT', sigintHandler),
402
472
  };
403
473
  }