eas-cli 24.5.0 → 24.7.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 (45) hide show
  1. package/README.md +133 -133
  2. package/build/build/build.js +71 -17
  3. package/build/build/logs.d.ts +10 -0
  4. package/build/build/logs.js +91 -0
  5. package/build/commandUtils/logs/format.d.ts +10 -0
  6. package/build/commandUtils/logs/format.js +21 -0
  7. package/build/commandUtils/logs/parseLogs.d.ts +7 -0
  8. package/build/commandUtils/{workflow/logs → logs}/parseLogs.js +1 -21
  9. package/build/commandUtils/logs/state.d.ts +14 -0
  10. package/build/commandUtils/logs/state.js +71 -0
  11. package/build/commandUtils/logs/types.d.ts +19 -0
  12. package/build/commandUtils/logs/types.js +2 -0
  13. package/build/commandUtils/logs/watcher.d.ts +23 -0
  14. package/build/commandUtils/logs/watcher.js +80 -0
  15. package/build/commandUtils/workflow/{logs/fetchLogs.d.ts → fetchLogs.d.ts} +2 -2
  16. package/build/commandUtils/workflow/{logs/fetchLogs.js → fetchLogs.js} +1 -1
  17. package/build/commandUtils/workflow/logs.d.ts +8 -0
  18. package/build/commandUtils/workflow/logs.js +43 -0
  19. package/build/commandUtils/workflow/stateMachine.d.ts +4 -3
  20. package/build/commandUtils/workflow/stateMachine.js +4 -3
  21. package/build/commandUtils/workflow/types.d.ts +0 -19
  22. package/build/commandUtils/workflow/utils.d.ts +3 -7
  23. package/build/commandUtils/workflow/utils.js +12 -29
  24. package/build/commands/go.js +15 -16
  25. package/build/credentials/manager/ManageIos.js +2 -2
  26. package/build/credentials/manager/SetUpIosBuildCredentials.js +2 -2
  27. package/build/graphql/generated.d.ts +221 -17
  28. package/build/graphql/generated.js +22 -2
  29. package/build/graphql/queries/DeviceRunSessionQuery.js +5 -0
  30. package/build/graphql/queries/UserQuery.d.ts +2 -1
  31. package/build/graphql/queries/UserQuery.js +39 -23
  32. package/build/graphql/types/Actor.d.ts +1 -0
  33. package/build/graphql/types/Actor.js +34 -0
  34. package/build/ora.d.ts +1 -0
  35. package/build/ora.js +5 -1
  36. package/build/simulator/utils.d.ts +7 -6
  37. package/build/simulator/utils.js +34 -13
  38. package/build/utils/centrifuge.js +2 -0
  39. package/oclif.manifest.json +645 -645
  40. package/package.json +2 -2
  41. package/build/commandUtils/workflow/logs/parseLogs.d.ts +0 -14
  42. package/build/commandUtils/workflow/logs/watcher.d.ts +0 -32
  43. package/build/commandUtils/workflow/logs/watcher.js +0 -162
  44. package/build/user/actions.d.ts +0 -3
  45. package/build/user/actions.js +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eas-cli",
3
- "version": "24.5.0",
3
+ "version": "24.7.0",
4
4
  "description": "EAS command line tool",
5
5
  "keywords": [
6
6
  "cli",
@@ -268,5 +268,5 @@
268
268
  "engines": {
269
269
  "node": "^20.18.3 || >=22.0.0"
270
270
  },
271
- "gitHead": "43068db22a079c67198fc7f7ccb5e85286ba3207"
271
+ "gitHead": "4a109648a6c59d4d897c6a3a880f77a6e49a4632"
272
272
  }
@@ -1,14 +0,0 @@
1
- import { WorkflowJobResult, WorkflowLogs, WorkflowRawLogLine } from '../types';
2
- import { ExpoGraphqlClient } from '../../context/contextUtils/createGraphqlClient';
3
- export declare function parseLogLines(rawLogs: string): {
4
- logLines: WorkflowRawLogLine[];
5
- errors: Error[];
6
- };
7
- export declare function mergeLogLines<T extends WorkflowRawLogLine>(...logLineGroups: T[][]): T[];
8
- export declare function groupLogLinesIntoSteps(logLines: WorkflowRawLogLine[], accumulator?: WorkflowLogs): WorkflowLogs;
9
- export declare function fetchAndParseLogsFromJobAsync(state: {
10
- graphqlClient: ExpoGraphqlClient;
11
- }, job: WorkflowJobResult): Promise<WorkflowRawLogLine[] | null>;
12
- export declare function fetchAndProcessLogsFromJobAsync(state: {
13
- graphqlClient: ExpoGraphqlClient;
14
- }, job: WorkflowJobResult): Promise<WorkflowLogs | null>;
@@ -1,32 +0,0 @@
1
- import { WorkflowJobResult, WorkflowLogs, WorkflowRawLogLine } from '../types';
2
- import { RealtimeLogsTargetInput } from '../../../graphql/generated';
3
- import { RealtimeLogsClient } from '../../../utils/centrifuge';
4
- import { ExpoGraphqlClient } from '../../context/contextUtils/createGraphqlClient';
5
- export declare class WorkflowJobLogsState {
6
- private fileLogIds;
7
- private realtimeLogLines;
8
- private realtimeLogIds;
9
- private haveFileLogsCaughtUp;
10
- private realtimeLogsRevealed;
11
- private groupedLogs;
12
- ingestFileLogLines(logLines: WorkflowRawLogLine[]): void;
13
- ingestRealtimeLogLines(data: unknown): boolean;
14
- markCompleted(): void;
15
- getLogs(): WorkflowLogs;
16
- private revealRealtimeLogs;
17
- }
18
- export declare function realtimeLogsTargetForJob(job: WorkflowJobResult): RealtimeLogsTargetInput | null;
19
- export declare class WorkflowRunLogsWatcher {
20
- private readonly graphqlClient;
21
- private readonly createRealtimeLogsClient;
22
- private readonly onRealtimeLogs;
23
- private readonly trackedJobs;
24
- private realtimeLogsClient?;
25
- constructor(graphqlClient: ExpoGraphqlClient, createRealtimeLogsClient: () => RealtimeLogsClient | null, onRealtimeLogs: () => void);
26
- syncJobsAsync(jobs: WorkflowJobResult[]): Promise<Map<string, WorkflowJobLogsState>>;
27
- close(): void;
28
- private syncJobAsync;
29
- private fetchLogsAsync;
30
- private getRealtimeLogsClient;
31
- private subscribeAsync;
32
- }
@@ -1,162 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WorkflowRunLogsWatcher = exports.WorkflowJobLogsState = void 0;
4
- exports.realtimeLogsTargetForJob = realtimeLogsTargetForJob;
5
- const tslib_1 = require("tslib");
6
- const parseLogs_1 = require("./parseLogs");
7
- const generated_1 = require("../../../graphql/generated");
8
- const log_1 = tslib_1.__importDefault(require("../../../log"));
9
- const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
10
- function isRealtimeLogLine(entry) {
11
- return (typeof entry === 'object' &&
12
- entry !== null &&
13
- typeof entry.logId === 'string');
14
- }
15
- class WorkflowJobLogsState {
16
- fileLogIds = new Set();
17
- realtimeLogLines = [];
18
- realtimeLogIds = new Set();
19
- haveFileLogsCaughtUp = false;
20
- realtimeLogsRevealed = false;
21
- groupedLogs = new Map();
22
- ingestFileLogLines(logLines) {
23
- this.fileLogIds = new Set(logLines.flatMap(logLine => (logLine.logId ? [logLine.logId] : [])));
24
- if (!this.haveFileLogsCaughtUp &&
25
- this.realtimeLogLines.some(logLine => this.fileLogIds.has(logLine.logId))) {
26
- this.haveFileLogsCaughtUp = true;
27
- }
28
- this.realtimeLogLines = this.realtimeLogLines.filter(logLine => !this.fileLogIds.has(logLine.logId));
29
- this.realtimeLogIds = new Set(this.realtimeLogLines.map(logLine => logLine.logId));
30
- if (this.haveFileLogsCaughtUp) {
31
- this.realtimeLogsRevealed = true;
32
- }
33
- this.groupedLogs = (0, parseLogs_1.groupLogLinesIntoSteps)((0, parseLogs_1.mergeLogLines)(logLines, this.realtimeLogsRevealed ? this.realtimeLogLines : []));
34
- }
35
- ingestRealtimeLogLines(data) {
36
- if (!Array.isArray(data)) {
37
- return false;
38
- }
39
- const publishedLogLines = data.filter(isRealtimeLogLine);
40
- if (publishedLogLines.length === 0) {
41
- return false;
42
- }
43
- if (!this.haveFileLogsCaughtUp &&
44
- publishedLogLines.some(logLine => this.fileLogIds.has(logLine.logId))) {
45
- this.haveFileLogsCaughtUp = true;
46
- }
47
- const newLogLines = publishedLogLines.filter(logLine => !this.fileLogIds.has(logLine.logId) && !this.realtimeLogIds.has(logLine.logId));
48
- for (const logLine of newLogLines) {
49
- this.realtimeLogLines.push(logLine);
50
- this.realtimeLogIds.add(logLine.logId);
51
- }
52
- if (!this.realtimeLogsRevealed) {
53
- if (this.haveFileLogsCaughtUp) {
54
- this.revealRealtimeLogs();
55
- }
56
- }
57
- else if (newLogLines.length > 0) {
58
- (0, parseLogs_1.groupLogLinesIntoSteps)(newLogLines, this.groupedLogs);
59
- }
60
- return true;
61
- }
62
- markCompleted() {
63
- this.revealRealtimeLogs();
64
- }
65
- getLogs() {
66
- return this.groupedLogs;
67
- }
68
- revealRealtimeLogs() {
69
- if (this.realtimeLogsRevealed) {
70
- return;
71
- }
72
- this.realtimeLogsRevealed = true;
73
- (0, parseLogs_1.groupLogLinesIntoSteps)(this.realtimeLogLines, this.groupedLogs);
74
- }
75
- }
76
- exports.WorkflowJobLogsState = WorkflowJobLogsState;
77
- function realtimeLogsTargetForJob(job) {
78
- if (job.turtleJobRun?.id) {
79
- return { type: generated_1.RealtimeLogsTargetType.JobRun, id: job.turtleJobRun.id };
80
- }
81
- const buildId = job.turtleBuild?.id ?? job.outputs?.build_id;
82
- if (buildId) {
83
- return { type: generated_1.RealtimeLogsTargetType.Build, id: buildId };
84
- }
85
- return null;
86
- }
87
- class WorkflowRunLogsWatcher {
88
- graphqlClient;
89
- createRealtimeLogsClient;
90
- onRealtimeLogs;
91
- trackedJobs = new Map();
92
- realtimeLogsClient;
93
- constructor(graphqlClient, createRealtimeLogsClient, onRealtimeLogs) {
94
- this.graphqlClient = graphqlClient;
95
- this.createRealtimeLogsClient = createRealtimeLogsClient;
96
- this.onRealtimeLogs = onRealtimeLogs;
97
- }
98
- async syncJobsAsync(jobs) {
99
- await Promise.all(jobs.map(job => this.syncJobAsync(job)));
100
- return new Map(jobs.map(job => [
101
- job.id,
102
- (0, nullthrows_1.default)(this.trackedJobs.get(job.id), 'job has to be in tracked jobs after it was synced').logsState,
103
- ]));
104
- }
105
- close() {
106
- for (const trackedJob of this.trackedJobs.values()) {
107
- trackedJob.subscription?.close();
108
- trackedJob.subscription = null;
109
- }
110
- this.realtimeLogsClient?.close();
111
- }
112
- async syncJobAsync(job) {
113
- let trackedJob = this.trackedJobs.get(job.id);
114
- if (!trackedJob) {
115
- trackedJob = { logsState: new WorkflowJobLogsState(), subscription: null };
116
- this.trackedJobs.set(job.id, trackedJob);
117
- }
118
- const workflowInProgress = job.status === generated_1.WorkflowJobStatus.InProgress;
119
- if (!workflowInProgress) {
120
- trackedJob.subscription?.close();
121
- trackedJob.subscription = null;
122
- return;
123
- }
124
- await Promise.all([
125
- trackedJob.subscription ? Promise.resolve() : this.subscribeAsync(job, trackedJob),
126
- this.fetchLogsAsync(job, trackedJob),
127
- ]);
128
- }
129
- async fetchLogsAsync(job, trackedJob) {
130
- try {
131
- const logLines = await (0, parseLogs_1.fetchAndParseLogsFromJobAsync)({ graphqlClient: this.graphqlClient }, job);
132
- if (logLines) {
133
- trackedJob.logsState.ingestFileLogLines(logLines);
134
- }
135
- }
136
- catch (err) {
137
- log_1.default.debug(`Failed to fetch logs for job ${job.id}: ${err.message}`);
138
- }
139
- }
140
- getRealtimeLogsClient() {
141
- if (this.realtimeLogsClient === undefined) {
142
- this.realtimeLogsClient = this.createRealtimeLogsClient();
143
- }
144
- return this.realtimeLogsClient;
145
- }
146
- async subscribeAsync(job, trackedJob) {
147
- const target = realtimeLogsTargetForJob(job);
148
- if (!target) {
149
- return;
150
- }
151
- const realtimeLogsClient = this.getRealtimeLogsClient();
152
- if (!realtimeLogsClient) {
153
- return;
154
- }
155
- trackedJob.subscription = await realtimeLogsClient.subscribeAsync({ target }, data => {
156
- if (trackedJob.logsState.ingestRealtimeLogLines(data)) {
157
- this.onRealtimeLogs();
158
- }
159
- });
160
- }
161
- }
162
- exports.WorkflowRunLogsWatcher = WorkflowRunLogsWatcher;
@@ -1,3 +0,0 @@
1
- import { Actor } from './User';
2
- import { AccountFragment } from '../graphql/generated';
3
- export declare function ensureActorHasPrimaryAccount(user: Actor): AccountFragment;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureActorHasPrimaryAccount = ensureActorHasPrimaryAccount;
4
- function ensureActorHasPrimaryAccount(user) {
5
- if (user.__typename === 'User' || user.__typename === 'SSOUser') {
6
- return user.primaryAccount;
7
- }
8
- throw new Error('This action is not supported for robot users.');
9
- }