eas-cli 24.1.1 → 24.2.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 (85) hide show
  1. package/README.md +237 -131
  2. package/build/channel/insights/formatInsights.js +1 -5
  3. package/build/commandUtils/EasCommand.d.ts +2 -1
  4. package/build/commandUtils/EasCommand.js +2 -1
  5. package/build/commandUtils/context/ContextField.d.ts +2 -0
  6. package/build/commandUtils/context/ProjectIdContextField.d.ts +1 -1
  7. package/build/commandUtils/context/ProjectIdContextField.js +4 -1
  8. package/build/commandUtils/flags.d.ts +3 -0
  9. package/build/commandUtils/flags.js +6 -1
  10. package/build/commandUtils/pagination.js +2 -2
  11. package/build/commandUtils/planGating.d.ts +2 -0
  12. package/build/commandUtils/planGating.js +10 -0
  13. package/build/commands/channel/insights.d.ts +2 -2
  14. package/build/commands/channel/insights.js +1 -13
  15. package/build/commands/observe/errors.d.ts +0 -1
  16. package/build/commands/observe/errors.js +3 -10
  17. package/build/commands/observe/event.d.ts +0 -1
  18. package/build/commands/observe/event.js +3 -11
  19. package/build/commands/observe/events.d.ts +0 -1
  20. package/build/commands/observe/events.js +3 -10
  21. package/build/commands/observe/metrics-summary.d.ts +0 -1
  22. package/build/commands/observe/metrics-summary.js +3 -10
  23. package/build/commands/observe/metrics.d.ts +0 -1
  24. package/build/commands/observe/metrics.js +3 -10
  25. package/build/commands/observe/routes.d.ts +0 -1
  26. package/build/commands/observe/routes.js +3 -10
  27. package/build/commands/observe/session.d.ts +0 -1
  28. package/build/commands/observe/session.js +3 -10
  29. package/build/commands/observe/versions.d.ts +0 -1
  30. package/build/commands/observe/versions.js +3 -10
  31. package/build/commands/simulator/egress.js +1 -1
  32. package/build/commands/simulator/index.js +2 -6
  33. package/build/commands/update/insights.d.ts +1 -1
  34. package/build/commands/update/insights.js +1 -13
  35. package/build/commands/workflow/insights/index.d.ts +23 -0
  36. package/build/commands/workflow/insights/index.js +80 -0
  37. package/build/commands/workflow/insights/maestro.d.ts +26 -0
  38. package/build/commands/workflow/insights/maestro.js +140 -0
  39. package/build/graphql/generated.d.ts +261 -0
  40. package/build/graphql/generated.js +2 -0
  41. package/build/graphql/queries/AppQuery.d.ts +4 -0
  42. package/build/graphql/queries/AppQuery.js +19 -0
  43. package/build/graphql/queries/WorkflowDeviceTestCaseInsightsQuery.d.ts +27 -0
  44. package/build/graphql/queries/WorkflowDeviceTestCaseInsightsQuery.js +173 -0
  45. package/build/graphql/queries/WorkflowsInsightsQuery.d.ts +13 -0
  46. package/build/graphql/queries/WorkflowsInsightsQuery.js +84 -0
  47. package/build/insights/formatFilters.d.ts +2 -0
  48. package/build/insights/formatFilters.js +10 -0
  49. package/build/insights/formatRunsOverTime.d.ts +13 -0
  50. package/build/insights/formatRunsOverTime.js +49 -0
  51. package/build/insights/formatTimespan.d.ts +5 -1
  52. package/build/insights/formatTimespan.js +12 -0
  53. package/build/insights/metrics.d.ts +22 -0
  54. package/build/insights/metrics.js +48 -0
  55. package/build/insights/timeRange.d.ts +5 -0
  56. package/build/insights/timeRange.js +17 -1
  57. package/build/observe/flags.d.ts +0 -3
  58. package/build/observe/flags.js +1 -6
  59. package/build/observe/formatErrors.js +3 -5
  60. package/build/observe/planGating.js +2 -5
  61. package/build/observe/startAndEndTime.js +9 -0
  62. package/build/simulator/egress.js +4 -1
  63. package/build/simulator/utils.d.ts +5 -1
  64. package/build/simulator/utils.js +21 -28
  65. package/build/update/insights/formatInsights.js +1 -5
  66. package/build/utils/terminalText.d.ts +1 -0
  67. package/build/utils/terminalText.js +4 -0
  68. package/build/workflow/insights/filters.d.ts +30 -0
  69. package/build/workflow/insights/filters.js +79 -0
  70. package/build/workflow/insights/formatInsights.d.ts +44 -0
  71. package/build/workflow/insights/formatInsights.js +155 -0
  72. package/build/workflow/insights/formatMaestroInsights.d.ts +105 -0
  73. package/build/workflow/insights/formatMaestroInsights.js +298 -0
  74. package/build/workflow/insights/granularity.d.ts +27 -0
  75. package/build/workflow/insights/granularity.js +79 -0
  76. package/build/workflow/insights/maestroFilters.d.ts +23 -0
  77. package/build/workflow/insights/maestroFilters.js +47 -0
  78. package/build/workflow/insights/maestroSort.d.ts +7 -0
  79. package/build/workflow/insights/maestroSort.js +27 -0
  80. package/build/workflow/insights/planGating.d.ts +6 -0
  81. package/build/workflow/insights/planGating.js +33 -0
  82. package/oclif.manifest.json +1941 -1561
  83. package/package.json +5 -5
  84. package/build/observe/resolveProjectContext.d.ts +0 -22
  85. package/build/observe/resolveProjectContext.js +0 -21
@@ -49,11 +49,7 @@ function buildChannelInsightsJson(summary) {
49
49
  return {
50
50
  channel: summary.channelName,
51
51
  runtimeVersion: summary.runtimeVersion,
52
- timespan: {
53
- start: summary.startTime,
54
- end: summary.endTime,
55
- ...(summary.daysBack !== undefined ? { daysBack: summary.daysBack } : {}),
56
- },
52
+ timespan: (0, formatTimespan_1.toTimespanJson)(summary),
57
53
  embeddedUpdateTotalUniqueUsers: summary.embeddedUpdateTotalUniqueUsers,
58
54
  otaTotalUniqueUsers: summary.otaTotalUniqueUsers,
59
55
  mostPopularUpdates: summary.mostPopularUpdates,
@@ -29,6 +29,7 @@ type GetContextType<Type> = {
29
29
  interface BaseGetContextAsyncArgs {
30
30
  nonInteractive: boolean;
31
31
  vcsClientOverride?: Client;
32
+ projectIdOverride?: string;
32
33
  }
33
34
  interface GetContextAsyncArgsWithRequiredServerSideEnvironmentArgument extends BaseGetContextAsyncArgs {
34
35
  withServerSideEnvironment: string | null;
@@ -140,7 +141,7 @@ export default abstract class EasCommand extends Command {
140
141
  [name: string]: any;
141
142
  } = object>(commandClass: {
142
143
  contextDefinition: ContextInput<C>;
143
- }, { nonInteractive, vcsClientOverride, withServerSideEnvironment, }: C extends GetContextType<typeof EasCommand.ContextOptions.ProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.DynamicProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.OptionalProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.ServerSideEnvironmentVariables> ? GetContextAsyncArgsWithRequiredServerSideEnvironmentArgument : GetContextAsyncArgsWithoutServerSideEnvironmentArgument): Promise<ContextOutput<C>>;
144
+ }, { nonInteractive, vcsClientOverride, projectIdOverride, withServerSideEnvironment, }: C extends GetContextType<typeof EasCommand.ContextOptions.ProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.DynamicProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.OptionalProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.ServerSideEnvironmentVariables> ? GetContextAsyncArgsWithRequiredServerSideEnvironmentArgument : GetContextAsyncArgsWithoutServerSideEnvironmentArgument): Promise<ContextOutput<C>>;
144
145
  private get sessionManager();
145
146
  private get analytics();
146
147
  protected abstract runAsync(): Promise<any>;
@@ -128,7 +128,7 @@ class EasCommand extends core_1.Command {
128
128
  /**
129
129
  * Execute the context in the contextDefinition to satisfy command prerequisites.
130
130
  */
131
- async getContextAsync(commandClass, { nonInteractive, vcsClientOverride,
131
+ async getContextAsync(commandClass, { nonInteractive, vcsClientOverride, projectIdOverride,
132
132
  // if specified and not null, the env vars from the selected environment will be fetched from the server
133
133
  // to resolve dynamic config (if dynamic config context is used) and enable getServerSideEnvironmentVariablesAsync function (if server side environment variables context is used)
134
134
  withServerSideEnvironment, }) {
@@ -143,6 +143,7 @@ class EasCommand extends core_1.Command {
143
143
  sessionManager: this.sessionManager,
144
144
  analytics: this.analytics,
145
145
  vcsClientOverride,
146
+ projectIdOverride,
146
147
  withServerSideEnvironment,
147
148
  }),
148
149
  ]);
@@ -6,6 +6,8 @@ export interface ContextOptions {
6
6
  analytics: Analytics;
7
7
  nonInteractive: boolean;
8
8
  vcsClientOverride?: Client;
9
+ /** Short-circuits project ID resolution. */
10
+ projectIdOverride?: string;
9
11
  /**
10
12
  * If specified, env variables from the selected environment will be fetched from the server and used to evaluate the dynamic config.
11
13
  */
@@ -1,4 +1,4 @@
1
1
  import ContextField, { ContextOptions } from './ContextField';
2
2
  export declare class ProjectIdContextField extends ContextField<string> {
3
- getValueAsync({ nonInteractive, sessionManager }: ContextOptions): Promise<string>;
3
+ getValueAsync({ nonInteractive, sessionManager, projectIdOverride, }: ContextOptions): Promise<string>;
4
4
  }
@@ -7,7 +7,10 @@ const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findP
7
7
  const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
8
8
  const expoConfig_1 = require("../../project/expoConfig");
9
9
  class ProjectIdContextField extends ContextField_1.default {
10
- async getValueAsync({ nonInteractive, sessionManager }) {
10
+ async getValueAsync({ nonInteractive, sessionManager, projectIdOverride, }) {
11
+ if (projectIdOverride) {
12
+ return projectIdOverride;
13
+ }
11
14
  const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
12
15
  const expBefore = await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir);
13
16
  const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
@@ -3,6 +3,9 @@ export declare const EasNonInteractiveAndJsonFlags: {
3
3
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
4
4
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
5
5
  };
6
+ export declare const EasProjectIdFlag: {
7
+ 'project-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ };
6
9
  export declare function resolveNonInteractiveAndJsonFlags(flags: {
7
10
  json?: boolean;
8
11
  'non-interactive'?: boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EasUpdateEnvironmentRequiredFlag = exports.EasUpdateEnvironmentFlag = exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EASEnvironmentVariableScopeFlag = exports.EASVariableVisibilityFlag = exports.EASVariableFormatFlag = exports.EASMultiEnvironmentFlag = exports.EASEnvironmentFlag = exports.EasEnvironmentFlagParameters = exports.EasNonInteractiveAndJsonFlags = void 0;
3
+ exports.EasUpdateEnvironmentRequiredFlag = exports.EasUpdateEnvironmentFlag = exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EASEnvironmentVariableScopeFlag = exports.EASVariableVisibilityFlag = exports.EASVariableFormatFlag = exports.EASMultiEnvironmentFlag = exports.EASEnvironmentFlag = exports.EasEnvironmentFlagParameters = exports.EasProjectIdFlag = exports.EasNonInteractiveAndJsonFlags = void 0;
4
4
  exports.isNonInteractiveByDefault = isNonInteractiveByDefault;
5
5
  exports.resolveNonInteractiveAndJsonFlags = resolveNonInteractiveAndJsonFlags;
6
6
  const core_1 = require("@oclif/core");
@@ -18,6 +18,11 @@ exports.EasNonInteractiveAndJsonFlags = {
18
18
  noCacheDefault: true,
19
19
  }),
20
20
  };
21
+ exports.EasProjectIdFlag = {
22
+ 'project-id': core_1.Flags.string({
23
+ description: 'EAS project ID (defaults to the project ID of the current directory)',
24
+ }),
25
+ };
21
26
  function resolveNonInteractiveAndJsonFlags(flags) {
22
27
  const json = flags.json ?? false;
23
28
  const nonInteractive = flags['non-interactive'] || json;
@@ -15,8 +15,8 @@ const getPaginatedQueryOptions = (flags) => {
15
15
  exports.getPaginatedQueryOptions = getPaginatedQueryOptions;
16
16
  const parseFlagInputStringAsInteger = (input, flagName, lowerLimit, upperLimit) => {
17
17
  const inputAsNumber = Number(input);
18
- if (isNaN(inputAsNumber)) {
19
- throw new Error(`Unable to parse ${input} as a number`);
18
+ if (!Number.isInteger(inputAsNumber)) {
19
+ throw new Error(`Unable to parse ${input} as an integer`);
20
20
  }
21
21
  if (inputAsNumber < lowerLimit || inputAsNumber > upperLimit) {
22
22
  throw new Error(`--${flagName} must be between ${lowerLimit} and ${upperLimit}`);
@@ -0,0 +1,2 @@
1
+ import { GraphQLError } from 'graphql';
2
+ export declare function findPlanGateError(error: unknown, errorCodes: ReadonlySet<string>): GraphQLError | undefined;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findPlanGateError = findPlanGateError;
4
+ const client_1 = require("../graphql/client");
5
+ function findPlanGateError(error, errorCodes) {
6
+ if (!(error instanceof client_1.GraphqlError)) {
7
+ return undefined;
8
+ }
9
+ return error.graphQLErrors.find(e => errorCodes.has(e?.extensions?.errorCode));
10
+ }
@@ -4,11 +4,11 @@ export default class ChannelInsights extends EasCommand {
4
4
  static flags: {
5
5
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
6
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
- channel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
- 'runtime-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
7
  days: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
8
  start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
9
  end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ channel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'runtime-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
12
  };
13
13
  static contextDefinition: {
14
14
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
@@ -20,19 +20,7 @@ class ChannelInsights extends EasCommand_1.default {
20
20
  description: 'Runtime version to query insights for.',
21
21
  required: true,
22
22
  }),
23
- days: core_1.Flags.integer({
24
- description: 'Show insights from the last N days (default 7, mutually exclusive with --start/--end).',
25
- min: 1,
26
- exclusive: ['start', 'end'],
27
- }),
28
- start: core_1.Flags.string({
29
- description: 'Start of insights time range (ISO date).',
30
- exclusive: ['days'],
31
- }),
32
- end: core_1.Flags.string({
33
- description: 'End of insights time range (ISO date).',
34
- exclusive: ['days'],
35
- }),
23
+ ...timeRange_1.InsightsTimeRangeFlags,
36
24
  ...flags_1.EasNonInteractiveAndJsonFlags,
37
25
  };
38
26
  static contextDefinition = {
@@ -22,6 +22,5 @@ export default class ObserveErrors extends EasCommand {
22
22
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
23
23
  projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
24
24
  };
25
- private static loggedInOnlyContextDefinition;
26
25
  runAsync(): Promise<void>;
27
26
  }
@@ -12,7 +12,6 @@ const flags_2 = require("../../observe/flags");
12
12
  const formatErrors_1 = require("../../observe/formatErrors");
13
13
  const planGating_1 = require("../../observe/planGating");
14
14
  const platforms_1 = require("../../observe/platforms");
15
- const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
16
15
  const startAndEndTime_1 = require("../../observe/startAndEndTime");
17
16
  const json_1 = require("../../utils/json");
18
17
  const SEVERITY_BY_FLAG = {
@@ -43,25 +42,19 @@ class ObserveErrors extends EasCommand_1.default {
43
42
  ...flags_2.ObserveBuildNumberFlag,
44
43
  ...flags_2.ObserveUpdateIdFlag,
45
44
  ...flags_2.ObserveEnvironmentFlag,
46
- ...flags_2.ObserveProjectIdFlag,
45
+ ...flags_1.EasProjectIdFlag,
47
46
  ...flags_1.EasNonInteractiveAndJsonFlags,
48
47
  };
49
48
  static contextDefinition = {
50
49
  ...this.ContextOptions.ProjectId,
51
50
  ...this.ContextOptions.LoggedIn,
52
51
  };
53
- static loggedInOnlyContextDefinition = {
54
- ...this.ContextOptions.LoggedIn,
55
- };
56
52
  async runAsync() {
57
53
  const { flags } = await this.parse(ObserveErrors);
58
54
  const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
59
- const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
60
- command: this,
61
- commandClass: ObserveErrors,
62
- loggedInOnlyContextDefinition: ObserveErrors.loggedInOnlyContextDefinition,
63
- projectIdOverride: flags['project-id'],
55
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveErrors, {
64
56
  nonInteractive,
57
+ projectIdOverride: flags['project-id'],
65
58
  });
66
59
  if (!flags.fingerprint && (flags.after || flags.limit)) {
67
60
  throw new Error('--after or --limit can only be used in combination with the --fingerprint flag.');
@@ -13,6 +13,5 @@ export default class ObserveEvent extends EasCommand {
13
13
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
14
14
  projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
15
15
  };
16
- private static loggedInOnlyContextDefinition;
17
16
  runAsync(): Promise<void>;
18
17
  }
@@ -12,9 +12,7 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
12
12
  const formatCustomEvents_1 = require("../../observe/formatCustomEvents");
13
13
  const formatErrors_1 = require("../../observe/formatErrors");
14
14
  const formatEvents_1 = require("../../observe/formatEvents");
15
- const flags_2 = require("../../observe/flags");
16
15
  const planGating_1 = require("../../observe/planGating");
17
- const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
18
16
  const json_1 = require("../../utils/json");
19
17
  class ObserveEvent extends EasCommand_1.default {
20
18
  static description = 'display a single Observe event (metric, log, or error) by its ID. IDs are included in event data when the `--json` flag is passed to `eas observe:session`, `eas observe:metrics`, or `eas observe:events`.';
@@ -25,25 +23,19 @@ class ObserveEvent extends EasCommand_1.default {
25
23
  }),
26
24
  };
27
25
  static flags = {
28
- ...flags_2.ObserveProjectIdFlag,
26
+ ...flags_1.EasProjectIdFlag,
29
27
  ...flags_1.EasNonInteractiveAndJsonFlags,
30
28
  };
31
29
  static contextDefinition = {
32
30
  ...this.ContextOptions.ProjectId,
33
31
  ...this.ContextOptions.LoggedIn,
34
32
  };
35
- static loggedInOnlyContextDefinition = {
36
- ...this.ContextOptions.LoggedIn,
37
- };
38
33
  async runAsync() {
39
34
  const { flags, args } = await this.parse(ObserveEvent);
40
35
  const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
41
- const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
42
- command: this,
43
- commandClass: ObserveEvent,
44
- loggedInOnlyContextDefinition: ObserveEvent.loggedInOnlyContextDefinition,
45
- projectIdOverride: flags['project-id'],
36
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveEvent, {
46
37
  nonInteractive,
38
+ projectIdOverride: flags['project-id'],
47
39
  });
48
40
  if (json) {
49
41
  (0, json_1.enableJsonOutput)();
@@ -25,6 +25,5 @@ export default class ObserveEvents extends EasCommand {
25
25
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
26
26
  projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
27
27
  };
28
- private static loggedInOnlyContextDefinition;
29
28
  runAsync(): Promise<void>;
30
29
  }
@@ -12,7 +12,6 @@ const flags_2 = require("../../observe/flags");
12
12
  const formatCustomEvents_1 = require("../../observe/formatCustomEvents");
13
13
  const planGating_1 = require("../../observe/planGating");
14
14
  const platforms_1 = require("../../observe/platforms");
15
- const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
16
15
  const startAndEndTime_1 = require("../../observe/startAndEndTime");
17
16
  const json_1 = require("../../utils/json");
18
17
  const DEFAULT_EVENTS_LIMIT = 10;
@@ -43,28 +42,22 @@ class ObserveEvents extends EasCommand_1.default {
43
42
  description: 'When no event name argument is provided, list all events across all event names instead of a summary of event names + counts.',
44
43
  default: false,
45
44
  }),
46
- ...flags_2.ObserveProjectIdFlag,
45
+ ...flags_1.EasProjectIdFlag,
47
46
  ...flags_1.EasNonInteractiveAndJsonFlags,
48
47
  };
49
48
  static contextDefinition = {
50
49
  ...this.ContextOptions.ProjectId,
51
50
  ...this.ContextOptions.LoggedIn,
52
51
  };
53
- static loggedInOnlyContextDefinition = {
54
- ...this.ContextOptions.LoggedIn,
55
- };
56
52
  async runAsync() {
57
53
  const { flags, args } = await this.parse(ObserveEvents);
58
54
  const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
59
55
  if (args.eventName && flags['all-events']) {
60
56
  throw new Error('--all-events cannot be combined with an event name argument. Pass an event name to filter by it, or pass --all-events to list all events across all event names.');
61
57
  }
62
- const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
63
- command: this,
64
- commandClass: ObserveEvents,
65
- loggedInOnlyContextDefinition: ObserveEvents.loggedInOnlyContextDefinition,
66
- projectIdOverride: flags['project-id'],
58
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveEvents, {
67
59
  nonInteractive,
60
+ projectIdOverride: flags['project-id'],
68
61
  });
69
62
  if (json) {
70
63
  (0, json_1.enableJsonOutput)();
@@ -17,6 +17,5 @@ export default class ObserveMetricsSummary extends EasCommand {
17
17
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
18
18
  projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
19
19
  };
20
- private static loggedInOnlyContextDefinition;
21
20
  runAsync(): Promise<void>;
22
21
  }
@@ -11,7 +11,6 @@ const formatMetrics_1 = require("../../observe/formatMetrics");
11
11
  const metricNames_1 = require("../../observe/metricNames");
12
12
  const planGating_1 = require("../../observe/planGating");
13
13
  const platforms_1 = require("../../observe/platforms");
14
- const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
15
14
  const startAndEndTime_1 = require("../../observe/startAndEndTime");
16
15
  const json_1 = require("../../utils/json");
17
16
  const DEFAULT_METRICS = [
@@ -48,25 +47,19 @@ class ObserveMetricsSummary extends EasCommand_1.default {
48
47
  })(),
49
48
  ...flags_2.ObserveTimeRangeFlags,
50
49
  ...flags_2.ObserveEnvironmentFlag,
51
- ...flags_2.ObserveProjectIdFlag,
50
+ ...flags_1.EasProjectIdFlag,
52
51
  ...flags_1.EasNonInteractiveAndJsonFlags,
53
52
  };
54
53
  static contextDefinition = {
55
54
  ...this.ContextOptions.ProjectId,
56
55
  ...this.ContextOptions.LoggedIn,
57
56
  };
58
- static loggedInOnlyContextDefinition = {
59
- ...this.ContextOptions.LoggedIn,
60
- };
61
57
  async runAsync() {
62
58
  const { flags } = await this.parse(ObserveMetricsSummary);
63
59
  const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
64
- const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
65
- command: this,
66
- commandClass: ObserveMetricsSummary,
67
- loggedInOnlyContextDefinition: ObserveMetricsSummary.loggedInOnlyContextDefinition,
68
- projectIdOverride: flags['project-id'],
60
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveMetricsSummary, {
69
61
  nonInteractive,
62
+ projectIdOverride: flags['project-id'],
70
63
  });
71
64
  if (json) {
72
65
  (0, json_1.enableJsonOutput)();
@@ -24,6 +24,5 @@ export default class ObserveMetrics extends EasCommand {
24
24
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
25
25
  projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
26
26
  };
27
- private static loggedInOnlyContextDefinition;
28
27
  runAsync(): Promise<void>;
29
28
  }
@@ -13,7 +13,6 @@ const metricNames_1 = require("../../observe/metricNames");
13
13
  const planGating_1 = require("../../observe/planGating");
14
14
  const formatEvents_1 = require("../../observe/formatEvents");
15
15
  const platforms_1 = require("../../observe/platforms");
16
- const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
17
16
  const startAndEndTime_1 = require("../../observe/startAndEndTime");
18
17
  const prompts_1 = require("../../prompts");
19
18
  const json_1 = require("../../utils/json");
@@ -45,25 +44,19 @@ class ObserveMetrics extends EasCommand_1.default {
45
44
  ...flags_2.ObserveBuildNumberFlag,
46
45
  ...flags_2.ObserveUpdateIdFlag,
47
46
  ...flags_2.ObserveEnvironmentFlag,
48
- ...flags_2.ObserveProjectIdFlag,
47
+ ...flags_1.EasProjectIdFlag,
49
48
  ...flags_1.EasNonInteractiveAndJsonFlags,
50
49
  };
51
50
  static contextDefinition = {
52
51
  ...this.ContextOptions.ProjectId,
53
52
  ...this.ContextOptions.LoggedIn,
54
53
  };
55
- static loggedInOnlyContextDefinition = {
56
- ...this.ContextOptions.LoggedIn,
57
- };
58
54
  async runAsync() {
59
55
  const { flags, args } = await this.parse(ObserveMetrics);
60
56
  const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
61
- const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
62
- command: this,
63
- commandClass: ObserveMetrics,
64
- loggedInOnlyContextDefinition: ObserveMetrics.loggedInOnlyContextDefinition,
65
- projectIdOverride: flags['project-id'],
57
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveMetrics, {
66
58
  nonInteractive,
59
+ projectIdOverride: flags['project-id'],
67
60
  });
68
61
  if (json) {
69
62
  (0, json_1.enableJsonOutput)();
@@ -23,6 +23,5 @@ export default class ObserveRoutes extends EasCommand {
23
23
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
24
24
  projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
25
25
  };
26
- private static loggedInOnlyContextDefinition;
27
26
  runAsync(): Promise<void>;
28
27
  }
@@ -12,7 +12,6 @@ const formatNavigationRoutes_1 = require("../../observe/formatNavigationRoutes")
12
12
  const metricNames_1 = require("../../observe/metricNames");
13
13
  const planGating_1 = require("../../observe/planGating");
14
14
  const platforms_1 = require("../../observe/platforms");
15
- const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
16
15
  const startAndEndTime_1 = require("../../observe/startAndEndTime");
17
16
  const json_1 = require("../../utils/json");
18
17
  const DEFAULT_ROUTES_LIMIT = 50;
@@ -47,25 +46,19 @@ class ObserveRoutes extends EasCommand_1.default {
47
46
  multiple: true,
48
47
  }),
49
48
  ...flags_2.ObserveEnvironmentFlag,
50
- ...flags_2.ObserveProjectIdFlag,
49
+ ...flags_1.EasProjectIdFlag,
51
50
  ...flags_1.EasNonInteractiveAndJsonFlags,
52
51
  };
53
52
  static contextDefinition = {
54
53
  ...this.ContextOptions.ProjectId,
55
54
  ...this.ContextOptions.LoggedIn,
56
55
  };
57
- static loggedInOnlyContextDefinition = {
58
- ...this.ContextOptions.LoggedIn,
59
- };
60
56
  async runAsync() {
61
57
  const { flags } = await this.parse(ObserveRoutes);
62
58
  const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
63
- const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
64
- command: this,
65
- commandClass: ObserveRoutes,
66
- loggedInOnlyContextDefinition: ObserveRoutes.loggedInOnlyContextDefinition,
67
- projectIdOverride: flags['project-id'],
59
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveRoutes, {
68
60
  nonInteractive,
61
+ projectIdOverride: flags['project-id'],
69
62
  });
70
63
  if (json) {
71
64
  (0, json_1.enableJsonOutput)();
@@ -19,6 +19,5 @@ export default class ObserveSession extends EasCommand {
19
19
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
20
20
  projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
21
21
  };
22
- private static loggedInOnlyContextDefinition;
23
22
  runAsync(): Promise<void>;
24
23
  }
@@ -13,7 +13,6 @@ const flags_2 = require("../../observe/flags");
13
13
  const planGating_1 = require("../../observe/planGating");
14
14
  const formatSessions_1 = require("../../observe/formatSessions");
15
15
  const metricNames_1 = require("../../observe/metricNames");
16
- const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
17
16
  const startAndEndTime_1 = require("../../observe/startAndEndTime");
18
17
  const prompts_1 = require("../../prompts");
19
18
  const json_1 = require("../../utils/json");
@@ -43,25 +42,19 @@ class ObserveSession extends EasCommand_1.default {
43
42
  }),
44
43
  ...flags_2.ObserveTimeRangeFlags,
45
44
  ...flags_2.ObserveEnvironmentFlag,
46
- ...flags_2.ObserveProjectIdFlag,
45
+ ...flags_1.EasProjectIdFlag,
47
46
  ...flags_1.EasNonInteractiveAndJsonFlags,
48
47
  };
49
48
  static contextDefinition = {
50
49
  ...this.ContextOptions.ProjectId,
51
50
  ...this.ContextOptions.LoggedIn,
52
51
  };
53
- static loggedInOnlyContextDefinition = {
54
- ...this.ContextOptions.LoggedIn,
55
- };
56
52
  async runAsync() {
57
53
  const { flags, args } = await this.parse(ObserveSession);
58
54
  const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
59
- const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
60
- command: this,
61
- commandClass: ObserveSession,
62
- loggedInOnlyContextDefinition: ObserveSession.loggedInOnlyContextDefinition,
63
- projectIdOverride: flags['project-id'],
55
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveSession, {
64
56
  nonInteractive,
57
+ projectIdOverride: flags['project-id'],
65
58
  });
66
59
  if (json) {
67
60
  (0, json_1.enableJsonOutput)();
@@ -15,6 +15,5 @@ export default class ObserveVersions extends EasCommand {
15
15
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
16
16
  projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
17
17
  };
18
- private static loggedInOnlyContextDefinition;
19
18
  runAsync(): Promise<void>;
20
19
  }
@@ -8,7 +8,6 @@ const fetchVersions_1 = require("../../observe/fetchVersions");
8
8
  const flags_2 = require("../../observe/flags");
9
9
  const formatVersions_1 = require("../../observe/formatVersions");
10
10
  const platforms_1 = require("../../observe/platforms");
11
- const resolveProjectContext_1 = require("../../observe/resolveProjectContext");
12
11
  const startAndEndTime_1 = require("../../observe/startAndEndTime");
13
12
  const json_1 = require("../../utils/json");
14
13
  class ObserveVersions extends EasCommand_1.default {
@@ -17,25 +16,19 @@ class ObserveVersions extends EasCommand_1.default {
17
16
  ...flags_2.ObservePlatformFlag,
18
17
  ...flags_2.ObserveTimeRangeFlags,
19
18
  ...flags_2.ObserveEnvironmentFlag,
20
- ...flags_2.ObserveProjectIdFlag,
19
+ ...flags_1.EasProjectIdFlag,
21
20
  ...flags_1.EasNonInteractiveAndJsonFlags,
22
21
  };
23
22
  static contextDefinition = {
24
23
  ...this.ContextOptions.ProjectId,
25
24
  ...this.ContextOptions.LoggedIn,
26
25
  };
27
- static loggedInOnlyContextDefinition = {
28
- ...this.ContextOptions.LoggedIn,
29
- };
30
26
  async runAsync() {
31
27
  const { flags } = await this.parse(ObserveVersions);
32
28
  const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
33
- const { projectId, graphqlClient } = await (0, resolveProjectContext_1.resolveObserveCommandContextAsync)({
34
- command: this,
35
- commandClass: ObserveVersions,
36
- loggedInOnlyContextDefinition: ObserveVersions.loggedInOnlyContextDefinition,
37
- projectIdOverride: flags['project-id'],
29
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveVersions, {
38
30
  nonInteractive,
31
+ projectIdOverride: flags['project-id'],
39
32
  });
40
33
  if (json) {
41
34
  (0, json_1.enableJsonOutput)();
@@ -44,7 +44,7 @@ class SimulatorEgress extends EasCommand_1.default {
44
44
  ...egress,
45
45
  signal: abortController.signal,
46
46
  onConnected: () => {
47
- log_1.default.succeed("Egress tunnel connected. Proxied HTTP(S) requests can use this machine's network.");
47
+ log_1.default.succeed('Egress tunnel connected.');
48
48
  },
49
49
  onDisconnected: () => {
50
50
  log_1.default.warn('Egress tunnel disconnected; reconnecting. Proxied HTTP(S) requests are unavailable until it reconnects.');
@@ -324,9 +324,7 @@ class Simulator extends EasCommand_1.default {
324
324
  const localEgress = (0, utils_1.getLocalEgressConfig)(remoteConfig, egressAllow);
325
325
  if (nonInteractive) {
326
326
  sessionInterrupt.dispose();
327
- if (localEgress) {
328
- 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.`);
329
- }
327
+ // The instructions above already tell the reader to run eas simulator:egress.
330
328
  log_1.default.log(`When you are done, stop the session with: eas simulator:stop --id ${deviceRunSessionId}`);
331
329
  return;
332
330
  }
@@ -336,8 +334,6 @@ class Simulator extends EasCommand_1.default {
336
334
  let egressError;
337
335
  const egressAbortController = new AbortController();
338
336
  if (localEgress) {
339
- log_1.default.log('Press Ctrl+C to stop both the egress client and the simulator session.');
340
- log_1.default.newLine();
341
337
  sessionInterrupt.signal.addEventListener('abort', () => {
342
338
  egressAbortController.abort();
343
339
  }, { once: true });
@@ -345,7 +341,7 @@ class Simulator extends EasCommand_1.default {
345
341
  ...localEgress,
346
342
  signal: egressAbortController.signal,
347
343
  onConnected: () => {
348
- log_1.default.succeed("Egress tunnel connected. Proxied HTTP(S) requests can use this machine's network.");
344
+ log_1.default.succeed('Egress tunnel connected.');
349
345
  },
350
346
  onDisconnected: () => {
351
347
  log_1.default.warn('Egress tunnel disconnected; reconnecting. Proxied HTTP(S) requests are unavailable until it reconnects.');
@@ -7,10 +7,10 @@ export default class UpdateInsights extends EasCommand {
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
- platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
10
  days: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
11
  start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
12
  end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
14
  };
15
15
  static contextDefinition: {
16
16
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
@@ -22,19 +22,7 @@ class UpdateInsights extends EasCommand_1.default {
22
22
  description: 'Filter to a single platform.',
23
23
  options: ['ios', 'android'],
24
24
  })(),
25
- days: core_1.Flags.integer({
26
- description: `Show insights from the last N days (default ${timeRange_1.INSIGHTS_DEFAULT_DAYS_BACK}, mutually exclusive with --start/--end).`,
27
- min: 1,
28
- exclusive: ['start', 'end'],
29
- }),
30
- start: core_1.Flags.string({
31
- description: 'Start of insights time range (ISO date).',
32
- exclusive: ['days'],
33
- }),
34
- end: core_1.Flags.string({
35
- description: 'End of insights time range (ISO date).',
36
- exclusive: ['days'],
37
- }),
25
+ ...timeRange_1.InsightsTimeRangeFlags,
38
26
  ...flags_1.EasNonInteractiveAndJsonFlags,
39
27
  };
40
28
  static contextDefinition = {