eas-cli 16.15.0 → 16.16.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 (38) hide show
  1. package/README.md +137 -84
  2. package/build/commandUtils/workflow/fetchLogs.d.ts +2 -0
  3. package/build/commandUtils/workflow/fetchLogs.js +16 -0
  4. package/build/commandUtils/workflow/stateMachine.d.ts +44 -0
  5. package/build/commandUtils/workflow/stateMachine.js +212 -0
  6. package/build/commandUtils/workflow/types.d.ts +39 -0
  7. package/build/commandUtils/workflow/types.js +13 -0
  8. package/build/commandUtils/workflow/utils.d.ts +12 -0
  9. package/build/commandUtils/workflow/utils.js +116 -0
  10. package/build/commands/workflow/cancel.js +3 -6
  11. package/build/commands/workflow/logs.d.ts +18 -0
  12. package/build/commands/workflow/logs.js +94 -0
  13. package/build/commands/workflow/run.d.ts +105 -0
  14. package/build/commands/workflow/run.js +280 -0
  15. package/build/commands/workflow/runs.js +4 -3
  16. package/build/commands/workflow/view.d.ts +17 -0
  17. package/build/commands/workflow/view.js +95 -0
  18. package/build/credentials/ios/appstore/bundleIdCapabilities.d.ts +4 -17
  19. package/build/credentials/ios/appstore/bundleIdCapabilities.js +45 -625
  20. package/build/credentials/ios/appstore/capabilityIdentifiers.js +33 -34
  21. package/build/credentials/ios/appstore/capabilityList.d.ts +33 -0
  22. package/build/credentials/ios/appstore/capabilityList.js +646 -0
  23. package/build/graphql/generated.d.ts +236 -19
  24. package/build/graphql/queries/WorkflowJobQuery.d.ts +7 -0
  25. package/build/graphql/queries/WorkflowJobQuery.js +29 -0
  26. package/build/graphql/queries/WorkflowRunQuery.js +13 -13
  27. package/build/graphql/types/WorkflowJob.d.ts +1 -0
  28. package/build/graphql/types/WorkflowJob.js +32 -0
  29. package/build/graphql/types/WorkflowRun.js +18 -0
  30. package/build/worker/assets.d.ts +0 -3
  31. package/build/worker/assets.js +3 -3
  32. package/build/worker/upload.js +4 -8
  33. package/build/worker/utils/multipart.d.ts +5 -4
  34. package/build/worker/utils/multipart.js +44 -9
  35. package/oclif.manifest.json +85 -1
  36. package/package.json +2 -2
  37. package/build/commandUtils/workflows.d.ts +0 -20
  38. package/build/commandUtils/workflows.js +0 -21
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createMultipartBodyFromFilesAsync = exports.multipartContentType = void 0;
3
+ exports.createMultipartBodyFromFilesAsync = exports.multipartContentType = exports.createReadStreamAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const node_crypto_1 = require("node:crypto");
5
6
  const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
6
7
  const CRLF = '\r\n';
7
8
  const BOUNDARY_HYPHEN_CHARS = '--';
@@ -21,12 +22,46 @@ const encodeName = (input) => {
21
22
  }
22
23
  });
23
24
  };
24
- async function* createReadStreamAsync(filePath) {
25
- for await (const raw of node_fs_1.default.createReadStream(filePath)) {
26
- const chunk = raw;
27
- yield new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
25
+ async function* createReadStreamAsync(fileEntry) {
26
+ let handle;
27
+ try {
28
+ handle = await node_fs_1.default.promises.open(fileEntry.path);
29
+ const hash = (0, node_crypto_1.createHash)('sha512');
30
+ // NOTE(@kitten): fs.createReadStream() was previously used here as an async iterator
31
+ // However, if an early 'end' event is emitted, the async iterator may abort too early and cut off file contents
32
+ let bytesTotal = 0;
33
+ while (bytesTotal < fileEntry.size) {
34
+ const read = await handle.read();
35
+ const output = read.buffer.subarray(0, read.bytesRead);
36
+ bytesTotal += output.byteLength;
37
+ if (bytesTotal > fileEntry.size) {
38
+ throw new RangeError(`Asset "${fileEntry.path}" was modified during the upload (length mismatch)`);
39
+ }
40
+ if (output.byteLength) {
41
+ hash.update(output);
42
+ }
43
+ if (bytesTotal === fileEntry.size) {
44
+ const sha512 = hash.digest('hex');
45
+ if (sha512 !== fileEntry.sha512) {
46
+ throw new Error(`Asset "${fileEntry.path}" was modified during the upload (checksum mismatch)`);
47
+ }
48
+ }
49
+ if (output.byteLength) {
50
+ yield output;
51
+ }
52
+ else {
53
+ break;
54
+ }
55
+ }
56
+ if (bytesTotal < fileEntry.size) {
57
+ throw new RangeError(`Asset "${fileEntry.path}" was modified during the upload (length mismatch)`);
58
+ }
59
+ }
60
+ finally {
61
+ await handle?.close();
28
62
  }
29
63
  }
64
+ exports.createReadStreamAsync = createReadStreamAsync;
30
65
  const makeFormHeader = (params) => {
31
66
  const name = encodeName(params.name);
32
67
  let header = BOUNDARY_HYPHEN_CHARS + BOUNDARY_ID + CRLF;
@@ -47,12 +82,12 @@ async function* createMultipartBodyFromFilesAsync(entries, onProgressUpdate) {
47
82
  for (let idx = 0; idx < entries.length; idx++) {
48
83
  const entry = entries[idx];
49
84
  const header = makeFormHeader({
50
- name: entry.name,
51
- contentType: entry.contentType,
52
- contentLength: entry.contentLength,
85
+ name: entry.sha512,
86
+ contentType: entry.type,
87
+ contentLength: entry.size,
53
88
  });
54
89
  yield encoder.encode(header);
55
- yield* createReadStreamAsync(entry.filePath);
90
+ yield* createReadStreamAsync(entry);
56
91
  yield encoder.encode(CRLF);
57
92
  if (onProgressUpdate) {
58
93
  onProgressUpdate((idx + 1) / entries.length);
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "16.15.0",
2
+ "version": "16.16.0",
3
3
  "commands": {
4
4
  "analytics": {
5
5
  "id": "analytics",
@@ -4196,6 +4196,45 @@
4196
4196
  "loggedIn": {}
4197
4197
  }
4198
4198
  },
4199
+ "workflow:logs": {
4200
+ "id": "workflow:logs",
4201
+ "description": "view logs for a workflow run, selecting a job and step to view. You can pass in either a workflow run ID or a job ID. If no ID is passed in, you will be prompted to select from recent workflow runs for the current project.",
4202
+ "strict": true,
4203
+ "pluginName": "eas-cli",
4204
+ "pluginAlias": "eas-cli",
4205
+ "pluginType": "core",
4206
+ "aliases": [],
4207
+ "flags": {
4208
+ "json": {
4209
+ "name": "json",
4210
+ "type": "boolean",
4211
+ "description": "Enable JSON output, non-JSON messages will be printed to stderr.",
4212
+ "allowNo": false
4213
+ },
4214
+ "non-interactive": {
4215
+ "name": "non-interactive",
4216
+ "type": "boolean",
4217
+ "description": "Run the command in non-interactive mode.",
4218
+ "allowNo": false
4219
+ },
4220
+ "all-steps": {
4221
+ "name": "all-steps",
4222
+ "type": "boolean",
4223
+ "description": "Print all logs, rather than prompting for a specific step. This will be automatically set when in non-interactive mode.",
4224
+ "allowNo": false
4225
+ }
4226
+ },
4227
+ "args": {
4228
+ "id": {
4229
+ "name": "id",
4230
+ "description": "ID of the workflow run or workflow job to view logs for"
4231
+ }
4232
+ },
4233
+ "contextDefinition": {
4234
+ "projectId": {},
4235
+ "loggedIn": {}
4236
+ }
4237
+ },
4199
4238
  "workflow:run": {
4200
4239
  "id": "workflow:run",
4201
4240
  "description": "run an EAS workflow",
@@ -4218,6 +4257,18 @@
4218
4257
  "description": "Exit codes: 0 = success, 11 = failure, 12 = canceled, 13 = wait aborted.",
4219
4258
  "allowNo": true
4220
4259
  },
4260
+ "input": {
4261
+ "name": "input",
4262
+ "type": "option",
4263
+ "char": "F",
4264
+ "summary": "Set workflow inputs",
4265
+ "description": "Add a parameter in key=value format. Use multiple instances of this flag to set multiple inputs.",
4266
+ "multiple": true,
4267
+ "aliases": [
4268
+ "f",
4269
+ "field"
4270
+ ]
4271
+ },
4221
4272
  "json": {
4222
4273
  "name": "json",
4223
4274
  "type": "boolean",
@@ -4320,6 +4371,39 @@
4320
4371
  "loggedIn": {}
4321
4372
  }
4322
4373
  },
4374
+ "workflow:view": {
4375
+ "id": "workflow:view",
4376
+ "description": "view details for a workflow run, including jobs. If no run ID is provided, you will be prompted to select from recent workflow runs for the current project.",
4377
+ "strict": true,
4378
+ "pluginName": "eas-cli",
4379
+ "pluginAlias": "eas-cli",
4380
+ "pluginType": "core",
4381
+ "aliases": [],
4382
+ "flags": {
4383
+ "json": {
4384
+ "name": "json",
4385
+ "type": "boolean",
4386
+ "description": "Enable JSON output, non-JSON messages will be printed to stderr.",
4387
+ "allowNo": false
4388
+ },
4389
+ "non-interactive": {
4390
+ "name": "non-interactive",
4391
+ "type": "boolean",
4392
+ "description": "Run the command in non-interactive mode.",
4393
+ "allowNo": false
4394
+ }
4395
+ },
4396
+ "args": {
4397
+ "id": {
4398
+ "name": "id",
4399
+ "description": "ID of the workflow run to view"
4400
+ }
4401
+ },
4402
+ "contextDefinition": {
4403
+ "projectId": {},
4404
+ "loggedIn": {}
4405
+ }
4406
+ },
4323
4407
  "build:version:get": {
4324
4408
  "id": "build:version:get",
4325
4409
  "description": "get the latest version from EAS servers",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eas-cli",
3
3
  "description": "EAS command line tool",
4
- "version": "16.15.0",
4
+ "version": "16.16.0",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bin": {
7
7
  "eas": "./bin/run"
@@ -241,5 +241,5 @@
241
241
  "node": "20.11.0",
242
242
  "yarn": "1.22.21"
243
243
  },
244
- "gitHead": "72f3ba817fcf4f210ef9786c2346d76ce32a0378"
244
+ "gitHead": "8e96143b59aa8cd4b1b1bb269670ed3b56768258"
245
245
  }
@@ -1,20 +0,0 @@
1
- import { WorkflowRunFragment } from '../graphql/generated';
2
- export type WorkflowRunResult = {
3
- id: string;
4
- status: string;
5
- gitCommitMessage: string | null;
6
- gitCommitHash: string | null;
7
- startedAt: string;
8
- finishedAt: string;
9
- workflowId: string;
10
- workflowName: string | null;
11
- workflowFileName: string;
12
- };
13
- export declare function processWorkflowRuns(runs: WorkflowRunFragment[]): WorkflowRunResult[];
14
- export type WorkflowResult = {
15
- id: string;
16
- name?: string | null | undefined;
17
- fileName: string;
18
- createdAt: string;
19
- updatedAt: string;
20
- };
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.processWorkflowRuns = void 0;
4
- const generated_1 = require("../graphql/generated");
5
- function processWorkflowRuns(runs) {
6
- return runs.map(run => {
7
- const finishedAt = run.status === generated_1.WorkflowRunStatus.InProgress ? null : run.updatedAt;
8
- return {
9
- id: run.id,
10
- status: run.status,
11
- gitCommitMessage: run.gitCommitMessage?.split('\n')[0] ?? null,
12
- gitCommitHash: run.gitCommitHash ?? null,
13
- startedAt: run.createdAt,
14
- finishedAt,
15
- workflowId: run.workflow.id,
16
- workflowName: run.workflow.name ?? null,
17
- workflowFileName: run.workflow.fileName,
18
- };
19
- });
20
- }
21
- exports.processWorkflowRuns = processWorkflowRuns;