eas-cli 23.2.0 → 24.0.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 (96) hide show
  1. package/README.md +380 -205
  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/get.js +3 -1
  31. package/build/commands/simulator/index.js +6 -2
  32. package/build/credentials/ios/credentials.d.ts +5 -3
  33. package/build/credentials/ios/utils/printCredentials.js +6 -1
  34. package/build/graphql/generated.d.ts +2288 -1133
  35. package/build/graphql/generated.js +48 -17
  36. package/build/graphql/mutations/RealtimeLogsMutation.d.ts +2 -2
  37. package/build/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +1 -1
  38. package/build/graphql/queries/AppStoreConnectApiKeyQuery.js +1 -1
  39. package/build/graphql/queries/ChannelQuery.js +2 -0
  40. package/build/graphql/queries/DeviceRunSessionQuery.js +5 -0
  41. package/build/graphql/queries/ObserveQuery.d.ts +62 -30
  42. package/build/graphql/queries/ObserveQuery.js +276 -121
  43. package/build/graphql/queries/SubmissionQuery.d.ts +6 -1
  44. package/build/graphql/queries/SubmissionQuery.js +41 -0
  45. package/build/graphql/types/Observe.d.ts +5 -3
  46. package/build/graphql/types/Observe.js +80 -21
  47. package/build/graphql/types/UpdateChannelBasicInfo.js +1 -0
  48. package/build/observe/fetchCustomEvents.d.ts +6 -4
  49. package/build/observe/fetchCustomEvents.js +4 -2
  50. package/build/observe/fetchErrors.d.ts +32 -0
  51. package/build/observe/fetchErrors.js +42 -0
  52. package/build/observe/fetchEvents.d.ts +9 -6
  53. package/build/observe/fetchEvents.js +16 -17
  54. package/build/observe/fetchMetrics.d.ts +2 -2
  55. package/build/observe/fetchMetrics.js +9 -9
  56. package/build/observe/fetchNavigationRoutes.d.ts +7 -5
  57. package/build/observe/fetchNavigationRoutes.js +8 -8
  58. package/build/observe/fetchSessions.d.ts +13 -11
  59. package/build/observe/fetchSessions.js +59 -30
  60. package/build/observe/fetchVersions.d.ts +4 -3
  61. package/build/observe/fetchVersions.js +7 -11
  62. package/build/observe/flags.d.ts +6 -0
  63. package/build/observe/flags.js +12 -2
  64. package/build/observe/formatCustomEvents.d.ts +16 -10
  65. package/build/observe/formatCustomEvents.js +61 -28
  66. package/build/observe/formatErrors.d.ts +97 -0
  67. package/build/observe/formatErrors.js +203 -0
  68. package/build/observe/formatEvents.d.ts +11 -5
  69. package/build/observe/formatEvents.js +46 -18
  70. package/build/observe/formatMetrics.d.ts +4 -4
  71. package/build/observe/formatMetrics.js +2 -2
  72. package/build/observe/formatNavigationRoutes.d.ts +4 -4
  73. package/build/observe/formatNavigationRoutes.js +3 -3
  74. package/build/observe/formatSessions.d.ts +3 -3
  75. package/build/observe/formatSessions.js +8 -8
  76. package/build/observe/formatVersions.js +2 -2
  77. package/build/observe/platforms.d.ts +10 -19
  78. package/build/observe/platforms.js +42 -40
  79. package/build/project/projectStatus.d.ts +96 -0
  80. package/build/project/projectStatus.js +314 -0
  81. package/build/simulator/utils.d.ts +11 -0
  82. package/build/simulator/utils.js +44 -5
  83. package/build/submit/utils/urls.js +2 -3
  84. package/build/utils/centrifuge.d.ts +2 -2
  85. package/oclif.manifest.json +2502 -1986
  86. package/package.json +7 -7
  87. package/build/chat/chatClient.d.ts +0 -37
  88. package/build/chat/chatClient.js +0 -359
  89. package/build/chat/detectProject.d.ts +0 -5
  90. package/build/chat/detectProject.js +0 -41
  91. package/build/chat/renderMarkdown.d.ts +0 -7
  92. package/build/chat/renderMarkdown.js +0 -47
  93. package/build/chat/replInput.d.ts +0 -10
  94. package/build/chat/replInput.js +0 -52
  95. package/build/commands/chat.d.ts +0 -18
  96. package/build/commands/chat.js +0 -221
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildObserveErrorJson = buildObserveErrorJson;
4
+ exports.buildObserveErrorDetail = buildObserveErrorDetail;
5
+ exports.buildObserveErrorGroupsTable = buildObserveErrorGroupsTable;
6
+ exports.buildObserveErrorGroupsJson = buildObserveErrorGroupsJson;
7
+ exports.buildObserveErrorOccurrenceJson = buildObserveErrorOccurrenceJson;
8
+ exports.buildObserveErrorOccurrencesJson = buildObserveErrorOccurrencesJson;
9
+ exports.buildObserveErrorOccurrencesTable = buildObserveErrorOccurrencesTable;
10
+ const tslib_1 = require("tslib");
11
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
12
+ const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
13
+ const formatUtils_1 = require("./formatUtils");
14
+ function buildObserveErrorJson(event) {
15
+ return {
16
+ id: event.id,
17
+ type: event.type ?? null,
18
+ message: event.message ?? null,
19
+ source: event.source ?? null,
20
+ fingerprint: event.fingerprint ?? null,
21
+ severityNumber: event.severityNumber ?? null,
22
+ severityText: event.severityText ?? null,
23
+ isFatal: event.isFatal ?? null,
24
+ timestamp: event.timestamp,
25
+ sessionId: event.sessionId ?? null,
26
+ appVersion: event.appVersion,
27
+ appBuildNumber: event.appBuildNumber,
28
+ appUpdateId: event.appUpdateId ?? null,
29
+ appEasBuildId: event.appEasBuildId ?? null,
30
+ deviceModel: event.deviceModel,
31
+ deviceOs: event.deviceOs,
32
+ deviceOsVersion: event.deviceOsVersion,
33
+ countryCode: event.countryCode ?? null,
34
+ environment: event.environment ?? null,
35
+ easClientId: event.easClientId,
36
+ };
37
+ }
38
+ /**
39
+ * Render a single error (exception) event as a vertical Field/Value detail
40
+ * table, for `eas observe:event`.
41
+ */
42
+ function buildObserveErrorDetail(event) {
43
+ const severity = event.isFatal ? 'fatal' : (event.severityText ?? '-');
44
+ const rows = [
45
+ ['ID', event.id],
46
+ ['Type', 'Error'],
47
+ ['Exception', event.type ?? '-'],
48
+ ['Message', event.message ?? '-'],
49
+ ['Source', event.source ?? '-'],
50
+ ['Fingerprint', event.fingerprint ?? '-'],
51
+ ['Severity', severity],
52
+ ['Timestamp', (0, formatUtils_1.formatLogTimestamp)(event.timestamp)],
53
+ ['Session ID', event.sessionId ?? '-'],
54
+ ['App Version', `${event.appVersion} (${event.appBuildNumber})`],
55
+ ['Update ID', event.appUpdateId ?? '-'],
56
+ ['EAS Build ID', event.appEasBuildId ?? '-'],
57
+ ['Platform', `${event.deviceOs} ${event.deviceOsVersion}`],
58
+ ['Device', event.deviceModel],
59
+ ['Country', event.countryCode ?? '-'],
60
+ ['Environment', event.environment ?? '-'],
61
+ ['EAS Client ID', event.easClientId],
62
+ ];
63
+ return [chalk_1.default.bold('Error event'), '', (0, renderTextTable_1.default)(['Field', 'Value'], rows)].join('\n');
64
+ }
65
+ function truncate(value, maxLength) {
66
+ return value.length > maxLength ? `${value.slice(0, maxLength - 1)}…` : value;
67
+ }
68
+ function buildObserveErrorGroupsTable(groups, options) {
69
+ if (groups.length === 0) {
70
+ return chalk_1.default.yellow('No errors found.');
71
+ }
72
+ const headers = [
73
+ 'Fingerprint',
74
+ 'Type',
75
+ 'Message',
76
+ 'Severity',
77
+ 'Events',
78
+ 'Users',
79
+ 'Sessions',
80
+ 'Last Seen',
81
+ ];
82
+ const rows = groups.map(group => [
83
+ group.fingerprint,
84
+ truncate(group.exceptionType ?? '-', 40),
85
+ truncate(group.exceptionMessage ?? '-', 60),
86
+ group.isFatal ? 'fatal' : (group.severity ?? '-').toString().toLowerCase(),
87
+ (group.eventCount ?? 0).toLocaleString(),
88
+ (group.uniqueUserCount ?? 0).toLocaleString(),
89
+ (group.affectedSessionCount ?? 0).toLocaleString(),
90
+ group.lastSeenAt ? (0, formatUtils_1.formatTimestamp)(group.lastSeenAt) : '-',
91
+ ]);
92
+ const lines = [];
93
+ if (options) {
94
+ const timeDesc = (0, formatUtils_1.buildTimeRangeDescription)(options);
95
+ lines.push(chalk_1.default.bold(`Errors ${timeDesc}`.trim()), '');
96
+ }
97
+ lines.push((0, renderTextTable_1.default)(headers, rows));
98
+ lines.push('', 'Pass --fingerprint <fingerprint> to see individual occurrences with stack traces.');
99
+ return lines.join('\n');
100
+ }
101
+ function buildObserveErrorGroupsJson(groups, isTruncated) {
102
+ return {
103
+ errors: groups.map(group => ({
104
+ fingerprint: group.fingerprint ?? null,
105
+ type: group.exceptionType ?? null,
106
+ message: group.exceptionMessage ?? null,
107
+ source: group.errorSource ?? null,
108
+ severity: group.severity ?? null,
109
+ isFatal: group.isFatal ?? null,
110
+ eventCount: group.eventCount ?? null,
111
+ uniqueUserCount: group.uniqueUserCount ?? null,
112
+ affectedSessionCount: group.affectedSessionCount ?? null,
113
+ firstSeenAt: group.firstSeenAt ?? null,
114
+ lastSeenAt: group.lastSeenAt ?? null,
115
+ platforms: group.platforms ?? [],
116
+ })),
117
+ isTruncated,
118
+ };
119
+ }
120
+ function buildObserveErrorOccurrenceJson(occurrence) {
121
+ return {
122
+ id: occurrence.id,
123
+ type: occurrence.type ?? null,
124
+ message: occurrence.message ?? null,
125
+ source: occurrence.source ?? null,
126
+ fingerprint: occurrence.fingerprint ?? null,
127
+ severityNumber: occurrence.severityNumber ?? null,
128
+ severityText: occurrence.severityText ?? null,
129
+ isFatal: occurrence.isFatal ?? null,
130
+ stacktrace: occurrence.stacktrace ?? null,
131
+ body: occurrence.body ?? null,
132
+ timestamp: occurrence.timestamp,
133
+ sessionId: occurrence.sessionId ?? null,
134
+ appVersion: occurrence.appVersion,
135
+ appBuildNumber: occurrence.appBuildNumber,
136
+ appUpdateId: occurrence.appUpdateId ?? null,
137
+ appEasBuildId: occurrence.appEasBuildId ?? null,
138
+ deviceModel: occurrence.deviceModel,
139
+ deviceOs: occurrence.deviceOs,
140
+ deviceOsVersion: occurrence.deviceOsVersion,
141
+ countryCode: occurrence.countryCode ?? null,
142
+ environment: occurrence.environment ?? null,
143
+ easClientId: occurrence.easClientId,
144
+ properties: occurrence.properties.map(p => ({ key: p.key, value: p.value, type: p.type })),
145
+ };
146
+ }
147
+ function buildObserveErrorOccurrencesJson(occurrences, pageInfo) {
148
+ return {
149
+ occurrences: occurrences.map(buildObserveErrorOccurrenceJson),
150
+ pageInfo: {
151
+ hasNextPage: pageInfo.hasNextPage,
152
+ endCursor: pageInfo.endCursor ?? null,
153
+ },
154
+ };
155
+ }
156
+ /**
157
+ * Render a single error occurrence as a Field/Value detail table followed by
158
+ * its stack trace (and body, if present), for `eas observe:errors --fingerprint`.
159
+ */
160
+ function buildObserveErrorOccurrenceDetail(occurrence) {
161
+ const severity = occurrence.isFatal ? 'fatal' : (occurrence.severityText ?? '-');
162
+ const rows = [
163
+ ['ID', occurrence.id],
164
+ ['Exception', occurrence.type ?? '-'],
165
+ ['Message', occurrence.message ?? '-'],
166
+ ['Source', occurrence.source ?? '-'],
167
+ ['Severity', severity],
168
+ ['Timestamp', (0, formatUtils_1.formatLogTimestamp)(occurrence.timestamp)],
169
+ ['Session ID', occurrence.sessionId ?? '-'],
170
+ ['App Version', `${occurrence.appVersion} (${occurrence.appBuildNumber})`],
171
+ ['Update ID', occurrence.appUpdateId ?? '-'],
172
+ ['Platform', `${occurrence.deviceOs} ${occurrence.deviceOsVersion}`],
173
+ ['Device', occurrence.deviceModel],
174
+ ['Country', occurrence.countryCode ?? '-'],
175
+ ['Environment', occurrence.environment ?? '-'],
176
+ ];
177
+ const lines = [(0, renderTextTable_1.default)(['Field', 'Value'], rows)];
178
+ if (occurrence.stacktrace) {
179
+ lines.push('', chalk_1.default.bold('Stack trace'), '', occurrence.stacktrace);
180
+ }
181
+ if (occurrence.body) {
182
+ lines.push('', chalk_1.default.bold('Body'), '', occurrence.body);
183
+ }
184
+ if (occurrence.properties.length > 0) {
185
+ const propertyRows = occurrence.properties.map(p => [p.key, p.type, p.value]);
186
+ lines.push('', chalk_1.default.bold('Properties'), '', (0, renderTextTable_1.default)(['Key', 'Type', 'Value'], propertyRows));
187
+ }
188
+ return lines.join('\n');
189
+ }
190
+ function buildObserveErrorOccurrencesTable(occurrences, pageInfo, options) {
191
+ if (occurrences.length === 0) {
192
+ return chalk_1.default.yellow(`No occurrences found for fingerprint "${options.fingerprint}".`);
193
+ }
194
+ const timeDesc = (0, formatUtils_1.buildTimeRangeDescription)(options);
195
+ const lines = [chalk_1.default.bold(`Occurrences of ${options.fingerprint} ${timeDesc}`.trim())];
196
+ occurrences.forEach((occurrence, index) => {
197
+ lines.push('', chalk_1.default.bold(`Occurrence ${index + 1}`), '', buildObserveErrorOccurrenceDetail(occurrence));
198
+ });
199
+ if (pageInfo.hasNextPage && pageInfo.endCursor) {
200
+ lines.push('', `Next page: --after ${pageInfo.endCursor}`);
201
+ }
202
+ return lines.join('\n');
203
+ }
@@ -1,8 +1,8 @@
1
- import { AppObserveEvent, PageInfo } from '../graphql/generated';
1
+ import { AppObserveMetric, PageInfo } from '../graphql/generated';
2
2
  export interface ObserveEventJson {
3
3
  id: string;
4
- metricName: string;
5
- metricValue: number;
4
+ name: string;
5
+ value: number;
6
6
  appVersion: string;
7
7
  appBuildNumber: string;
8
8
  appUpdateId: string | null;
@@ -18,6 +18,12 @@ export interface ObserveEventJson {
18
18
  } | null;
19
19
  routeName: string | null;
20
20
  }
21
+ export declare function buildObserveEventJson(event: AppObserveMetric): ObserveEventJson;
22
+ /**
23
+ * Render a single metric event as a vertical Field/Value detail table, for
24
+ * `eas observe:event`.
25
+ */
26
+ export declare function buildObserveEventDetail(event: AppObserveMetric): string;
21
27
  export interface BuildEventsTableOptions {
22
28
  metricName: string;
23
29
  daysBack?: number;
@@ -25,8 +31,8 @@ export interface BuildEventsTableOptions {
25
31
  endTime?: string;
26
32
  totalEventCount?: number;
27
33
  }
28
- export declare function buildObserveEventsTable(events: AppObserveEvent[], pageInfo: PageInfo, options?: BuildEventsTableOptions): string;
29
- export declare function buildObserveEventsJson(events: AppObserveEvent[], pageInfo: PageInfo): {
34
+ export declare function buildObserveEventsTable(events: AppObserveMetric[], pageInfo: PageInfo, options?: BuildEventsTableOptions): string;
35
+ export declare function buildObserveEventsJson(events: AppObserveMetric[], pageInfo: PageInfo): {
30
36
  events: ObserveEventJson[];
31
37
  pageInfo: {
32
38
  hasNextPage: boolean;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildObserveEventJson = buildObserveEventJson;
4
+ exports.buildObserveEventDetail = buildObserveEventDetail;
3
5
  exports.buildObserveEventsTable = buildObserveEventsTable;
4
6
  exports.buildObserveEventsJson = buildObserveEventsJson;
5
7
  const tslib_1 = require("tslib");
@@ -10,6 +12,48 @@ const metricNames_1 = require("./metricNames");
10
12
  function resolveCustomParams(event) {
11
13
  return event.customParams ?? null;
12
14
  }
15
+ function buildObserveEventJson(event) {
16
+ return {
17
+ id: event.id,
18
+ name: event.name,
19
+ value: event.value,
20
+ appVersion: event.appVersion,
21
+ appBuildNumber: event.appBuildNumber,
22
+ appUpdateId: event.appUpdateId ?? null,
23
+ deviceModel: event.deviceModel,
24
+ deviceOs: event.deviceOs,
25
+ deviceOsVersion: event.deviceOsVersion,
26
+ countryCode: event.countryCode ?? null,
27
+ sessionId: event.sessionId ?? null,
28
+ easClientId: event.easClientId,
29
+ timestamp: event.timestamp,
30
+ customParams: resolveCustomParams(event),
31
+ routeName: event.routeName ?? null,
32
+ };
33
+ }
34
+ /**
35
+ * Render a single metric event as a vertical Field/Value detail table, for
36
+ * `eas observe:event`.
37
+ */
38
+ function buildObserveEventDetail(event) {
39
+ const rows = [
40
+ ['ID', event.id],
41
+ ['Type', 'Metric'],
42
+ ['Metric', (0, metricNames_1.getMetricDisplayName)(event.name)],
43
+ ['Value', `${event.value.toFixed(2)}s`],
44
+ ['Timestamp', (0, formatUtils_1.formatLogTimestamp)(event.timestamp)],
45
+ ['Session ID', event.sessionId ?? '-'],
46
+ ['Route', event.routeName ?? '-'],
47
+ ['App Version', `${event.appVersion} (${event.appBuildNumber})`],
48
+ ['Update ID', event.appUpdateId ?? '-'],
49
+ ['Platform', `${event.deviceOs} ${event.deviceOsVersion}`],
50
+ ['Device', event.deviceModel],
51
+ ['Country', event.countryCode ?? '-'],
52
+ ['EAS Client ID', event.easClientId],
53
+ ['Custom Params', event.customParams ? JSON.stringify(event.customParams) : '-'],
54
+ ];
55
+ return [chalk_1.default.bold('Metric event'), '', (0, renderTextTable_1.default)(['Field', 'Value'], rows)].join('\n');
56
+ }
13
57
  function buildObserveEventsTable(events, pageInfo, options) {
14
58
  if (events.length === 0) {
15
59
  return chalk_1.default.yellow('No events found.');
@@ -25,7 +69,7 @@ function buildObserveEventsTable(events, pageInfo, options) {
25
69
  'Timestamp',
26
70
  ];
27
71
  const rows = events.map(event => [
28
- `${event.metricValue.toFixed(2)}s`,
72
+ `${event.value.toFixed(2)}s`,
29
73
  `${event.appVersion} (${event.appBuildNumber})`,
30
74
  ...(hasUpdates ? [event.appUpdateId ?? '-'] : []),
31
75
  `${event.deviceOs} ${event.deviceOsVersion}`,
@@ -50,23 +94,7 @@ function buildObserveEventsTable(events, pageInfo, options) {
50
94
  }
51
95
  function buildObserveEventsJson(events, pageInfo) {
52
96
  return {
53
- events: events.map(event => ({
54
- id: event.id,
55
- metricName: event.metricName,
56
- metricValue: event.metricValue,
57
- appVersion: event.appVersion,
58
- appBuildNumber: event.appBuildNumber,
59
- appUpdateId: event.appUpdateId ?? null,
60
- deviceModel: event.deviceModel,
61
- deviceOs: event.deviceOs,
62
- deviceOsVersion: event.deviceOsVersion,
63
- countryCode: event.countryCode ?? null,
64
- sessionId: event.sessionId ?? null,
65
- easClientId: event.easClientId,
66
- timestamp: event.timestamp,
67
- customParams: resolveCustomParams(event),
68
- routeName: event.routeName ?? null,
69
- })),
97
+ events: events.map(buildObserveEventJson),
70
98
  pageInfo: {
71
99
  hasNextPage: pageInfo.hasNextPage,
72
100
  endCursor: pageInfo.endCursor ?? null,
@@ -1,4 +1,4 @@
1
- import { AppPlatform } from '../graphql/generated';
1
+ import { ObservePlatformKey } from './platforms';
2
2
  export type StatisticKey = 'min' | 'max' | 'median' | 'average' | 'p80' | 'p90' | 'p99' | 'eventCount';
3
3
  export declare const STAT_ALIASES: Record<string, StatisticKey>;
4
4
  export declare const STAT_DISPLAY_NAMES: Record<StatisticKey, string>;
@@ -13,15 +13,15 @@ export interface MetricValues {
13
13
  p99: number | null | undefined;
14
14
  eventCount: number | null | undefined;
15
15
  }
16
- type ObserveMetricsKey = `${string}:${AppPlatform}`;
16
+ type ObserveMetricsKey = `${string}:${ObservePlatformKey}`;
17
17
  export type ObserveMetricsMap = Map<ObserveMetricsKey, Map<string, MetricValues>>;
18
18
  export type BuildNumbersMap = Map<ObserveMetricsKey, string[]>;
19
19
  export type UpdateIdsMap = Map<ObserveMetricsKey, string[]>;
20
- export declare function makeMetricsKey(appVersion: string, platform: AppPlatform): ObserveMetricsKey;
20
+ export declare function makeMetricsKey(appVersion: string, platform: ObservePlatformKey): ObserveMetricsKey;
21
21
  export type MetricValuesJson = Partial<Record<StatisticKey, number | null>>;
22
22
  export interface ObserveMetricsVersionResult {
23
23
  appVersion: string;
24
- platform: AppPlatform;
24
+ platform: ObservePlatformKey;
25
25
  buildNumbers: string[];
26
26
  updateIds: string[];
27
27
  metrics: Record<string, MetricValuesJson>;
@@ -8,10 +8,10 @@ exports.buildObserveMetricsTable = buildObserveMetricsTable;
8
8
  const tslib_1 = require("tslib");
9
9
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
10
  const errors_1 = require("../commandUtils/errors");
11
- const platform_1 = require("../platform");
12
11
  const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
13
12
  const formatUtils_1 = require("./formatUtils");
14
13
  const metricNames_1 = require("./metricNames");
14
+ const platforms_1 = require("./platforms");
15
15
  exports.STAT_ALIASES = {
16
16
  min: 'min',
17
17
  max: 'max',
@@ -147,7 +147,7 @@ function buildObserveMetricsTable(metricsMap, metricNames, stats, options) {
147
147
  const sections = [chalk_1.default.bold(summaryLine)];
148
148
  for (const [platform, platformResults] of byPlatform) {
149
149
  sections.push('');
150
- sections.push(chalk_1.default.bold(platform_1.appPlatformDisplayNames[platform]));
150
+ sections.push(chalk_1.default.bold(platforms_1.observePlatformDisplayNames[platform]));
151
151
  const rows = [];
152
152
  for (const result of platformResults) {
153
153
  const key = makeMetricsKey(result.appVersion, result.platform);
@@ -1,5 +1,5 @@
1
- import { AppPlatform } from '../graphql/generated';
2
1
  import { NavigationRouteWithPlatform } from './fetchNavigationRoutes';
2
+ import { ObservePlatformKey } from './platforms';
3
3
  export type NavigationStatKey = 'median' | 'p90' | 'count';
4
4
  export declare const NAVIGATION_STAT_ALIASES: Record<string, NavigationStatKey>;
5
5
  export declare const NAVIGATION_STAT_DISPLAY_NAMES: Record<NavigationStatKey, string>;
@@ -8,7 +8,7 @@ export declare const NAVIGATION_METRIC_NAMES: string[];
8
8
  export declare function isNavigationMetric(metricName: string): boolean;
9
9
  export interface NavigationRouteValuesJson {
10
10
  routeName: string;
11
- platform: AppPlatform;
11
+ platform: ObservePlatformKey;
12
12
  metrics: Record<string, Partial<Record<NavigationStatKey, number | null>>>;
13
13
  }
14
14
  export interface ObserveNavigationRoutesJsonOutput {
@@ -18,7 +18,7 @@ export interface ObserveNavigationRoutesJsonOutput {
18
18
  endCursor: string | null;
19
19
  }>;
20
20
  }
21
- export declare function buildObserveNavigationRoutesJson(routes: NavigationRouteWithPlatform[], metricNames: string[], stats: NavigationStatKey[], pageInfoByPlatform: Map<AppPlatform, {
21
+ export declare function buildObserveNavigationRoutesJson(routes: NavigationRouteWithPlatform[], metricNames: string[], stats: NavigationStatKey[], pageInfoByPlatform: Map<ObservePlatformKey, {
22
22
  hasNextPage: boolean;
23
23
  endCursor?: string | null;
24
24
  }>): ObserveNavigationRoutesJsonOutput;
@@ -26,7 +26,7 @@ export interface BuildNavigationRoutesTableOptions {
26
26
  daysBack?: number;
27
27
  startTime?: string;
28
28
  endTime?: string;
29
- pageInfoByPlatform?: Map<AppPlatform, {
29
+ pageInfoByPlatform?: Map<ObservePlatformKey, {
30
30
  hasNextPage: boolean;
31
31
  endCursor?: string | null;
32
32
  }>;
@@ -8,8 +8,8 @@ exports.buildObserveNavigationRoutesTable = buildObserveNavigationRoutesTable;
8
8
  const tslib_1 = require("tslib");
9
9
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
10
  const errors_1 = require("../commandUtils/errors");
11
- const platform_1 = require("../platform");
12
11
  const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
12
+ const platforms_1 = require("./platforms");
13
13
  const formatUtils_1 = require("./formatUtils");
14
14
  const metricNames_1 = require("./metricNames");
15
15
  exports.NAVIGATION_STAT_ALIASES = {
@@ -140,7 +140,7 @@ function buildObserveNavigationRoutesTable(routes, metricNames, stats, options)
140
140
  const sections = [chalk_1.default.bold(summaryLine)];
141
141
  for (const [platform, platformRoutes] of byPlatform) {
142
142
  sections.push('');
143
- sections.push(chalk_1.default.bold(platform_1.appPlatformDisplayNames[platform]));
143
+ sections.push(chalk_1.default.bold(platforms_1.observePlatformDisplayNames[platform]));
144
144
  const rows = platformRoutes.map(node => {
145
145
  const cells = [];
146
146
  for (const metricName of metricNames) {
@@ -163,7 +163,7 @@ function buildObserveNavigationRoutesTable(routes, metricNames, stats, options)
163
163
  sections.push((0, renderTextTable_1.default)(headers, rows));
164
164
  const pageInfo = options?.pageInfoByPlatform?.get(platform);
165
165
  if (pageInfo?.hasNextPage && pageInfo.endCursor) {
166
- sections.push(`Next page (${platform_1.appPlatformDisplayNames[platform]}): --after ${pageInfo.endCursor}`);
166
+ sections.push(`Next page (${platforms_1.observePlatformDisplayNames[platform]}): --after ${pageInfo.endCursor}`);
167
167
  }
168
168
  }
169
169
  return sections.join('\n');
@@ -1,4 +1,4 @@
1
- import { AppObserveCustomEvent, AppObserveEvent } from '../graphql/generated';
1
+ import { AppObserveMetric, AppObserveUserEvent } from '../graphql/generated';
2
2
  import { SessionEventEntry, SessionMetadata } from './fetchSessions';
3
3
  export interface BuildSessionEventsOptions {
4
4
  metadata?: SessionMetadata | null;
@@ -23,9 +23,9 @@ export declare function shortSessionId(sessionId: string): string;
23
23
  * One-line title for a metric event shown in the observe:session candidate
24
24
  * picker, e.g. `Jan 15, 10:00:00.000 AM · Startup TTI 1.23s · 1.0.0 · iOS 17.0 · session abc…1234`.
25
25
  */
26
- export declare function formatMetricCandidateTitle(event: AppObserveEvent): string;
26
+ export declare function formatMetricCandidateTitle(event: AppObserveMetric): string;
27
27
  /**
28
28
  * One-line title for a custom log event shown in the observe:session
29
29
  * candidate picker.
30
30
  */
31
- export declare function formatLogCandidateTitle(event: AppObserveCustomEvent): string;
31
+ export declare function formatLogCandidateTitle(event: AppObserveUserEvent): string;
@@ -11,15 +11,15 @@ const formatUtils_1 = require("./formatUtils");
11
11
  const metricNames_1 = require("./metricNames");
12
12
  const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
13
13
  function formatEntryName(entry) {
14
- if (entry.source === 'metric' && entry.metricName) {
15
- const name = (0, metricNames_1.getMetricDisplayName)(entry.metricName);
14
+ if (entry.source === 'metric') {
15
+ const name = (0, metricNames_1.getMetricDisplayName)(entry.name);
16
16
  return entry.routeName ? `${name} · ${entry.routeName}` : name;
17
17
  }
18
- return entry.eventName ?? '-';
18
+ return entry.name;
19
19
  }
20
20
  function formatMetricEntryValue(entry) {
21
- if (typeof entry.metricValue === 'number') {
22
- return `${entry.metricValue.toFixed(2)}s`;
21
+ if (typeof entry.value === 'number') {
22
+ return `${entry.value.toFixed(2)}s`;
23
23
  }
24
24
  return '-';
25
25
  }
@@ -116,8 +116,8 @@ function shortSessionId(sessionId) {
116
116
  * picker, e.g. `Jan 15, 10:00:00.000 AM · Startup TTI 1.23s · 1.0.0 · iOS 17.0 · session abc…1234`.
117
117
  */
118
118
  function formatMetricCandidateTitle(event) {
119
- const displayName = (0, metricNames_1.getMetricDisplayName)(event.metricName);
120
- const value = `${event.metricValue.toFixed(2)}s`;
119
+ const displayName = (0, metricNames_1.getMetricDisplayName)(event.name);
120
+ const value = `${event.value.toFixed(2)}s`;
121
121
  const timestamp = (0, formatUtils_1.formatLogTimestamp)(event.timestamp);
122
122
  const shortSession = shortSessionId(event.sessionId ?? '');
123
123
  const device = `${event.deviceOs} ${event.deviceOsVersion}`;
@@ -132,5 +132,5 @@ function formatLogCandidateTitle(event) {
132
132
  const severity = event.severityText ?? (event.severityNumber != null ? String(event.severityNumber) : '-');
133
133
  const shortSession = shortSessionId(event.sessionId ?? '');
134
134
  const device = `${event.deviceOs} ${event.deviceOsVersion}`;
135
- return `${timestamp} · ${event.eventName} · ${severity} · ${event.appVersion} · ${device} · session ${shortSession}`;
135
+ return `${timestamp} · ${event.name} · ${severity} · ${event.appVersion} · ${device} · session ${shortSession}`;
136
136
  }
@@ -4,9 +4,9 @@ exports.buildObserveVersionsJson = buildObserveVersionsJson;
4
4
  exports.buildObserveVersionsTable = buildObserveVersionsTable;
5
5
  const tslib_1 = require("tslib");
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
- const platform_1 = require("../platform");
8
7
  const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
9
8
  const formatUtils_1 = require("./formatUtils");
9
+ const platforms_1 = require("./platforms");
10
10
  function mapEasBuilds(easBuilds) {
11
11
  return easBuilds.map(b => ({
12
12
  easBuildId: b.easBuildId,
@@ -64,7 +64,7 @@ function buildObserveVersionsTable(results) {
64
64
  if (sections.length > 0) {
65
65
  sections.push('');
66
66
  }
67
- sections.push(chalk_1.default.bold(platform_1.appPlatformDisplayNames[platform]));
67
+ sections.push(chalk_1.default.bold(platforms_1.observePlatformDisplayNames[platform]));
68
68
  const rows = appVersions.map(version => [
69
69
  version.appVersion,
70
70
  (0, formatUtils_1.formatDate)(version.firstSeenAt),
@@ -1,22 +1,13 @@
1
- import { AppObservePlatform, AppPlatform } from '../graphql/generated';
2
- /**
3
- * Allowed values for the --platform flag in observe commands.
4
- * Derived from the AppObservePlatform enum so new platforms added on
5
- * the server are automatically picked up.
6
- */
1
+ import { AppObservePlatform } from '../graphql/generated';
2
+ export declare const APPLE_PLATFORM_FLAG_VALUE = "apple";
7
3
  export declare const allowedPlatformFlagValues: string[];
8
4
  type PlatformFlagValue = (typeof allowedPlatformFlagValues)[number];
9
- /**
10
- * Resolve a single AppObservePlatform from a --platform flag value.
11
- * Returns undefined when no flag was provided.
12
- */
13
- export declare function appObservePlatformFromFlag(flag: PlatformFlagValue | undefined): AppObservePlatform | undefined;
14
- /**
15
- * Resolve a list of AppPlatform values from a --platform flag value.
16
- * Returns the single matching platform when a flag is provided, or all
17
- * known platforms when no flag is provided (so the caller queries every
18
- * platform).
19
- */
20
- export declare function appPlatformsFromFlag(flag: PlatformFlagValue | undefined): AppPlatform[];
21
- export declare const appPlatformToObservePlatform: Record<AppPlatform, AppObservePlatform>;
5
+ export type ObservePlatformKey = AppObservePlatform | 'APPLE';
6
+ export declare const observePlatformDisplayNames: Record<ObservePlatformKey, string>;
7
+ export interface ObservePlatformTarget {
8
+ key: ObservePlatformKey;
9
+ platforms: AppObservePlatform[];
10
+ }
11
+ export declare function observePlatformsFromFlag(flag: PlatformFlagValue | undefined): AppObservePlatform[] | undefined;
12
+ export declare function observePlatformTargetsFromFlag(flag: PlatformFlagValue | undefined): ObservePlatformTarget[];
22
13
  export {};
@@ -1,52 +1,54 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appPlatformToObservePlatform = exports.allowedPlatformFlagValues = void 0;
4
- exports.appObservePlatformFromFlag = appObservePlatformFromFlag;
5
- exports.appPlatformsFromFlag = appPlatformsFromFlag;
3
+ exports.observePlatformDisplayNames = exports.allowedPlatformFlagValues = exports.APPLE_PLATFORM_FLAG_VALUE = void 0;
4
+ exports.observePlatformsFromFlag = observePlatformsFromFlag;
5
+ exports.observePlatformTargetsFromFlag = observePlatformTargetsFromFlag;
6
6
  const generated_1 = require("../graphql/generated");
7
- /**
8
- * Allowed values for the --platform flag in observe commands.
9
- * Derived from the AppObservePlatform enum so new platforms added on
10
- * the server are automatically picked up.
11
- */
12
- exports.allowedPlatformFlagValues = Object.values(generated_1.AppObservePlatform).map(s => s.toLowerCase());
13
- const defaultAppObservePlatform = generated_1.AppObservePlatform.Ios;
14
- const defaultAppPlatform = generated_1.AppPlatform.Ios;
15
- /**
16
- * Resolve a single AppObservePlatform from a --platform flag value.
17
- * Returns undefined when no flag was provided.
18
- */
19
- function appObservePlatformFromFlag(flag) {
7
+ exports.APPLE_PLATFORM_FLAG_VALUE = 'apple';
8
+ const APPLE_OBSERVE_PLATFORMS = [
9
+ generated_1.AppObservePlatform.Ios,
10
+ generated_1.AppObservePlatform.Ipados,
11
+ generated_1.AppObservePlatform.Tvos,
12
+ generated_1.AppObservePlatform.Macos,
13
+ ];
14
+ exports.allowedPlatformFlagValues = [
15
+ ...Object.values(generated_1.AppObservePlatform).map(s => s.toLowerCase()),
16
+ exports.APPLE_PLATFORM_FLAG_VALUE,
17
+ ];
18
+ exports.observePlatformDisplayNames = {
19
+ [generated_1.AppObservePlatform.Android]: 'Android',
20
+ [generated_1.AppObservePlatform.Ios]: 'iOS',
21
+ [generated_1.AppObservePlatform.Ipados]: 'iPadOS',
22
+ [generated_1.AppObservePlatform.Tvos]: 'tvOS',
23
+ [generated_1.AppObservePlatform.Macos]: 'macOS',
24
+ APPLE: 'Apple',
25
+ };
26
+ function singlePlatformFromFlag(flag) {
27
+ const platform = Object.values(generated_1.AppObservePlatform).find(p => p.toLowerCase() === flag);
28
+ if (!platform) {
29
+ throw new Error(`Unknown platform flag value: "${flag}"`);
30
+ }
31
+ return platform;
32
+ }
33
+ function observePlatformsFromFlag(flag) {
20
34
  if (!flag) {
21
35
  return undefined;
22
36
  }
23
- switch (flag) {
24
- case 'android':
25
- return generated_1.AppObservePlatform.Android;
26
- case 'ios':
27
- return generated_1.AppObservePlatform.Ios;
37
+ if (flag === exports.APPLE_PLATFORM_FLAG_VALUE) {
38
+ return APPLE_OBSERVE_PLATFORMS;
28
39
  }
29
- return defaultAppObservePlatform;
40
+ return [singlePlatformFromFlag(flag)];
30
41
  }
31
- /**
32
- * Resolve a list of AppPlatform values from a --platform flag value.
33
- * Returns the single matching platform when a flag is provided, or all
34
- * known platforms when no flag is provided (so the caller queries every
35
- * platform).
36
- */
37
- function appPlatformsFromFlag(flag) {
42
+ function observePlatformTargetsFromFlag(flag) {
38
43
  if (!flag) {
39
- return [generated_1.AppPlatform.Android, generated_1.AppPlatform.Ios];
44
+ return [
45
+ { key: generated_1.AppObservePlatform.Android, platforms: [generated_1.AppObservePlatform.Android] },
46
+ { key: generated_1.AppObservePlatform.Ios, platforms: [generated_1.AppObservePlatform.Ios] },
47
+ ];
40
48
  }
41
- switch (flag) {
42
- case 'android':
43
- return [generated_1.AppPlatform.Android];
44
- case 'ios':
45
- return [generated_1.AppPlatform.Ios];
49
+ if (flag === exports.APPLE_PLATFORM_FLAG_VALUE) {
50
+ return [{ key: 'APPLE', platforms: APPLE_OBSERVE_PLATFORMS }];
46
51
  }
47
- return [defaultAppPlatform];
52
+ const platform = singlePlatformFromFlag(flag);
53
+ return [{ key: platform, platforms: [platform] }];
48
54
  }
49
- exports.appPlatformToObservePlatform = {
50
- [generated_1.AppPlatform.Android]: generated_1.AppObservePlatform.Android,
51
- [generated_1.AppPlatform.Ios]: generated_1.AppObservePlatform.Ios,
52
- };