eas-cli 16.7.1 → 16.8.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.
- package/README.md +120 -76
- package/build/build/runBuildAndSubmit.js +4 -4
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.d.ts +3 -1
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +7 -3
- package/build/commands/build/configure.js +2 -2
- package/build/commands/update/configure.js +2 -2
- package/build/commands/update/index.js +4 -4
- package/build/commands/update/roll-back-to-embedded.js +2 -2
- package/build/commands/workflow/list.d.ts +12 -0
- package/build/commands/workflow/list.js +52 -0
- package/build/commands/workflow/run.js +0 -1
- package/build/commands/workflow/runs.d.ts +16 -0
- package/build/commands/workflow/runs.js +87 -0
- package/build/graphql/generated.d.ts +131 -4
- package/build/graphql/generated.js +0 -1
- package/build/graphql/queries/AppQuery.d.ts +3 -1
- package/build/graphql/queries/AppQuery.js +57 -0
- package/build/graphql/queries/WorkflowRunQuery.d.ts +2 -1
- package/build/graphql/queries/WorkflowRunQuery.js +38 -0
- package/build/graphql/types/Workflow.d.ts +1 -0
- package/build/graphql/types/Workflow.js +14 -0
- package/build/graphql/types/WorkflowRun.d.ts +1 -0
- package/build/graphql/types/WorkflowRun.js +20 -0
- package/build/project/android/gradleUtils.d.ts +8 -1
- package/build/project/android/gradleUtils.js +4 -1
- package/oclif.manifest.json +74 -1
- package/package.json +3 -3
|
@@ -258,8 +258,8 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
|
|
|
258
258
|
env: buildProfile.profile.env,
|
|
259
259
|
easJsonAccessor,
|
|
260
260
|
});
|
|
261
|
-
const
|
|
262
|
-
if ((0, projectUtils_1.isUsingEASUpdate)(buildCtx.exp, buildCtx.projectId,
|
|
261
|
+
const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
|
262
|
+
if ((0, projectUtils_1.isUsingEASUpdate)(buildCtx.exp, buildCtx.projectId, easJsonCliConfig.updateManifestHostOverride ?? null)) {
|
|
263
263
|
const doesChannelExist = await (0, queries_1.doesChannelExistAsync)(graphqlClient, {
|
|
264
264
|
appId: buildCtx.projectId,
|
|
265
265
|
channelName: buildProfile.profile.channel,
|
|
@@ -390,7 +390,7 @@ async function validateExpoUpdatesInstalledAsProjectDependencyAsync({ exp, proje
|
|
|
390
390
|
message: `Would you like to install the "expo-updates" package and configure EAS Update now?`,
|
|
391
391
|
});
|
|
392
392
|
if (installExpoUpdates) {
|
|
393
|
-
const
|
|
393
|
+
const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
|
394
394
|
await (0, configure_2.ensureEASUpdateIsConfiguredAsync)({
|
|
395
395
|
exp,
|
|
396
396
|
projectId,
|
|
@@ -398,7 +398,7 @@ async function validateExpoUpdatesInstalledAsProjectDependencyAsync({ exp, proje
|
|
|
398
398
|
platform: platform_1.RequestedPlatform.All,
|
|
399
399
|
vcsClient,
|
|
400
400
|
env,
|
|
401
|
-
manifestHostOverride:
|
|
401
|
+
manifestHostOverride: easJsonCliConfig.updateManifestHostOverride ?? null,
|
|
402
402
|
});
|
|
403
403
|
log_1.default.withTick('Installed expo-updates and configured EAS Update.');
|
|
404
404
|
throw new Error('Command must be re-run to pick up new updates configuration.');
|
package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.d.ts
CHANGED
|
@@ -14,4 +14,6 @@ export declare function findProjectRootAsync({ cwd, defaultToProcessCwd, }?: {
|
|
|
14
14
|
*
|
|
15
15
|
* @deprecated Should not be used outside of context functions.
|
|
16
16
|
*/
|
|
17
|
-
export declare function findProjectDirAndVerifyProjectSetupAsync(
|
|
17
|
+
export declare function findProjectDirAndVerifyProjectSetupAsync({ cwd, }?: {
|
|
18
|
+
cwd?: string;
|
|
19
|
+
}): Promise<string>;
|
|
@@ -6,6 +6,7 @@ const eas_json_1 = require("@expo/eas-json");
|
|
|
6
6
|
const PackageManagerUtils = tslib_1.__importStar(require("@expo/package-manager"));
|
|
7
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
8
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
9
|
+
const getenv_1 = tslib_1.__importDefault(require("getenv"));
|
|
9
10
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
11
|
const pkg_dir_1 = tslib_1.__importDefault(require("pkg-dir"));
|
|
11
12
|
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
@@ -15,7 +16,10 @@ const vcs_1 = require("../../../vcs");
|
|
|
15
16
|
async function applyCliConfigAsync(projectDir) {
|
|
16
17
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
17
18
|
const config = await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor);
|
|
18
|
-
|
|
19
|
+
const shouldSkipVersionCheck = getenv_1.default.boolish('EAS_SKIP_CLI_VERSION_CHECK', false);
|
|
20
|
+
if (!shouldSkipVersionCheck &&
|
|
21
|
+
config?.version &&
|
|
22
|
+
!semver_1.default.satisfies(easCli_1.easCliVersion, config.version)) {
|
|
19
23
|
throw new Error(`You are on eas-cli@${easCli_1.easCliVersion} which does not satisfy the CLI version constraint defined in eas.json (${config.version}).\n\nThis error probably means that you need update your eas-cli to a newer version.\nRun ${chalk_1.default.bold('npm install -g eas-cli')} to update the eas-cli to the latest version.`);
|
|
20
24
|
}
|
|
21
25
|
}
|
|
@@ -88,8 +92,8 @@ let ranEnsureEasCliIsNotInDependencies = false;
|
|
|
88
92
|
*
|
|
89
93
|
* @deprecated Should not be used outside of context functions.
|
|
90
94
|
*/
|
|
91
|
-
async function findProjectDirAndVerifyProjectSetupAsync() {
|
|
92
|
-
const projectDir = await findProjectRootAsync();
|
|
95
|
+
async function findProjectDirAndVerifyProjectSetupAsync({ cwd, } = {}) {
|
|
96
|
+
const projectDir = await findProjectRootAsync({ cwd });
|
|
93
97
|
await applyCliConfigAsync(projectDir);
|
|
94
98
|
if (!ranEnsureEasCliIsNotInDependencies) {
|
|
95
99
|
ranEnsureEasCliIsNotInDependencies = true;
|
|
@@ -54,8 +54,8 @@ class BuildConfigure extends EasCommand_1.default {
|
|
|
54
54
|
});
|
|
55
55
|
if (didCreateEasJson) {
|
|
56
56
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
57
|
-
const
|
|
58
|
-
if ((0, projectUtils_1.isUsingEASUpdate)(exp, projectId,
|
|
57
|
+
const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
|
58
|
+
if ((0, projectUtils_1.isUsingEASUpdate)(exp, projectId, easJsonCliConfig.updateManifestHostOverride ?? null)) {
|
|
59
59
|
await (0, configure_2.ensureEASUpdateIsConfiguredInEasJsonAsync)(projectDir);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -36,7 +36,7 @@ class UpdateConfigure extends EasCommand_1.default {
|
|
|
36
36
|
log_1.default.log('💡 The following process will configure your project to use EAS Update. These changes only apply to your local project files and you can safely revert them at any time.');
|
|
37
37
|
await vcsClient.ensureRepoExistsAsync();
|
|
38
38
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
39
|
-
const
|
|
39
|
+
const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
|
40
40
|
await (0, configure_2.ensureEASUpdateIsConfiguredAsync)({
|
|
41
41
|
exp,
|
|
42
42
|
projectId,
|
|
@@ -45,7 +45,7 @@ class UpdateConfigure extends EasCommand_1.default {
|
|
|
45
45
|
vcsClient,
|
|
46
46
|
env: undefined,
|
|
47
47
|
forceNativeConfigSync: true,
|
|
48
|
-
manifestHostOverride:
|
|
48
|
+
manifestHostOverride: easJsonCliConfig.updateManifestHostOverride ?? null,
|
|
49
49
|
});
|
|
50
50
|
await (0, configure_2.ensureEASUpdateIsConfiguredInEasJsonAsync)(projectDir);
|
|
51
51
|
log_1.default.addNewLineIfNone();
|
|
@@ -112,7 +112,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
112
112
|
const { exp: expPossiblyWithoutEasUpdateConfigured, projectId, projectDir, } = await getDynamicPublicProjectConfigAsync();
|
|
113
113
|
await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)(graphqlClient, [generated_1.StatuspageServiceName.EasUpdate]);
|
|
114
114
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
115
|
-
const
|
|
115
|
+
const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
|
116
116
|
await (0, configure_1.ensureEASUpdateIsConfiguredAsync)({
|
|
117
117
|
exp: expPossiblyWithoutEasUpdateConfigured,
|
|
118
118
|
platform: requestedPlatform,
|
|
@@ -120,7 +120,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
120
120
|
projectId,
|
|
121
121
|
vcsClient,
|
|
122
122
|
env: undefined,
|
|
123
|
-
manifestHostOverride:
|
|
123
|
+
manifestHostOverride: easJsonCliConfig.updateManifestHostOverride ?? null,
|
|
124
124
|
});
|
|
125
125
|
const { exp } = await getDynamicPublicProjectConfigAsync();
|
|
126
126
|
const { exp: expPrivate } = await getDynamicPrivateProjectConfigAsync();
|
|
@@ -345,8 +345,8 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
345
345
|
isGitWorkingTreeDirty,
|
|
346
346
|
awaitingCodeSigningInfo: !!codeSigningInfo,
|
|
347
347
|
environment: environment ?? null,
|
|
348
|
-
manifestHostOverride:
|
|
349
|
-
assetHostOverride:
|
|
348
|
+
manifestHostOverride: easJsonCliConfig.updateManifestHostOverride ?? null,
|
|
349
|
+
assetHostOverride: easJsonCliConfig.updateAssetHostOverride ?? null,
|
|
350
350
|
};
|
|
351
351
|
});
|
|
352
352
|
let newUpdates;
|
|
@@ -79,7 +79,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
|
|
|
79
79
|
const { exp: expPossiblyWithoutEasUpdateConfigured, projectId, projectDir, } = await getDynamicPublicProjectConfigAsync();
|
|
80
80
|
await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)(graphqlClient, [generated_1.StatuspageServiceName.EasUpdate]);
|
|
81
81
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
82
|
-
const
|
|
82
|
+
const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
|
83
83
|
await (0, configure_1.ensureEASUpdateIsConfiguredAsync)({
|
|
84
84
|
exp: expPossiblyWithoutEasUpdateConfigured,
|
|
85
85
|
platform: platformFlag,
|
|
@@ -87,7 +87,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
|
|
|
87
87
|
projectId,
|
|
88
88
|
vcsClient,
|
|
89
89
|
env: undefined,
|
|
90
|
-
manifestHostOverride:
|
|
90
|
+
manifestHostOverride: easJsonCliConfig.updateManifestHostOverride ?? null,
|
|
91
91
|
});
|
|
92
92
|
// check that the expo-updates package version supports roll back to embedded
|
|
93
93
|
await (0, projectUtils_1.enforceRollBackToEmbeddedUpdateSupportAsync)(projectDir);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export default class WorkflowList extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
};
|
|
7
|
+
static contextDefinition: {
|
|
8
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
9
|
+
projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
|
|
10
|
+
};
|
|
11
|
+
runAsync(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
5
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
6
|
+
const AppQuery_1 = require("../../graphql/queries/AppQuery");
|
|
7
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
8
|
+
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
9
|
+
const json_1 = require("../../utils/json");
|
|
10
|
+
class WorkflowList extends EasCommand_1.default {
|
|
11
|
+
static description = 'List workflows for the current project';
|
|
12
|
+
static flags = {
|
|
13
|
+
...flags_1.EasJsonOnlyFlag,
|
|
14
|
+
};
|
|
15
|
+
static contextDefinition = {
|
|
16
|
+
...this.ContextOptions.ProjectId,
|
|
17
|
+
...this.ContextOptions.LoggedIn,
|
|
18
|
+
};
|
|
19
|
+
async runAsync() {
|
|
20
|
+
const { flags } = await this.parse(WorkflowList);
|
|
21
|
+
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(WorkflowList, {
|
|
22
|
+
nonInteractive: true,
|
|
23
|
+
});
|
|
24
|
+
if (flags.json) {
|
|
25
|
+
(0, json_1.enableJsonOutput)();
|
|
26
|
+
}
|
|
27
|
+
const workflows = await AppQuery_1.AppQuery.byIdWorkflowsAsync(graphqlClient, projectId);
|
|
28
|
+
const result = workflows.map(workflow => ({
|
|
29
|
+
id: workflow.id,
|
|
30
|
+
name: workflow.name,
|
|
31
|
+
fileName: workflow.fileName,
|
|
32
|
+
createdAt: workflow.createdAt,
|
|
33
|
+
updatedAt: workflow.updatedAt,
|
|
34
|
+
}));
|
|
35
|
+
if (flags.json) {
|
|
36
|
+
(0, json_1.printJsonOnlyOutput)(result);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
log_1.default.addNewLineIfNone();
|
|
40
|
+
result.forEach(workflow => {
|
|
41
|
+
log_1.default.log((0, formatFields_1.default)([
|
|
42
|
+
{ label: 'ID', value: workflow.id },
|
|
43
|
+
{ label: 'Name', value: workflow.name ?? '-' },
|
|
44
|
+
{ label: 'File name', value: workflow.fileName },
|
|
45
|
+
{ label: 'Created At', value: workflow.createdAt },
|
|
46
|
+
{ label: 'Updated At', value: workflow.updatedAt },
|
|
47
|
+
]));
|
|
48
|
+
log_1.default.addNewLineIfNone();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = WorkflowList;
|
|
@@ -196,7 +196,6 @@ async function waitForWorkflowRunToEndAsync(graphqlClient, { workflowRunId }) {
|
|
|
196
196
|
case generated_1.WorkflowRunStatus.ActionRequired:
|
|
197
197
|
spinner.warn('Workflow run is waiting for action.');
|
|
198
198
|
break;
|
|
199
|
-
case generated_1.WorkflowRunStatus.PendingCancel:
|
|
200
199
|
case generated_1.WorkflowRunStatus.Canceled:
|
|
201
200
|
spinner.warn('Workflow run has been canceled.');
|
|
202
201
|
return workflowRun;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
import { WorkflowRunStatus } from '../../graphql/generated';
|
|
3
|
+
export default class WorkflowRunList extends EasCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
7
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
workflow: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
+
status: import("@oclif/core/lib/interfaces").OptionFlag<WorkflowRunStatus | undefined>;
|
|
10
|
+
};
|
|
11
|
+
static contextDefinition: {
|
|
12
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
13
|
+
projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
|
|
14
|
+
};
|
|
15
|
+
runAsync(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
6
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
8
|
+
const generated_1 = require("../../graphql/generated");
|
|
9
|
+
const AppQuery_1 = require("../../graphql/queries/AppQuery");
|
|
10
|
+
const WorkflowRunQuery_1 = require("../../graphql/queries/WorkflowRunQuery");
|
|
11
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
12
|
+
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
13
|
+
const json_1 = require("../../utils/json");
|
|
14
|
+
function processWorkflowRuns(runs) {
|
|
15
|
+
return runs.map(run => {
|
|
16
|
+
const finishedAt = run.status === generated_1.WorkflowRunStatus.InProgress ? null : run.updatedAt;
|
|
17
|
+
return {
|
|
18
|
+
id: run.id,
|
|
19
|
+
status: run.status,
|
|
20
|
+
gitCommitMessage: run.gitCommitMessage ?? null,
|
|
21
|
+
gitCommitHash: run.gitCommitHash ?? null,
|
|
22
|
+
startedAt: run.createdAt,
|
|
23
|
+
finishedAt,
|
|
24
|
+
workflowId: run.workflow.id,
|
|
25
|
+
workflowName: run.workflow.name ?? null,
|
|
26
|
+
workflowFileName: run.workflow.fileName,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
class WorkflowRunList extends EasCommand_1.default {
|
|
31
|
+
static description = 'list recent workflow runs for this project, with their IDs, statuses, and timestamps';
|
|
32
|
+
static flags = {
|
|
33
|
+
workflow: core_1.Flags.string({
|
|
34
|
+
description: 'If present, the query will only return runs for the specified workflow file name',
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
status: core_1.Flags.enum({
|
|
38
|
+
description: 'If present, filter the returned runs to select those with the specified status',
|
|
39
|
+
required: false,
|
|
40
|
+
options: Object.values(generated_1.WorkflowRunStatus),
|
|
41
|
+
}),
|
|
42
|
+
...flags_1.EasJsonOnlyFlag,
|
|
43
|
+
limit: (0, pagination_1.getLimitFlagWithCustomValues)({ defaultTo: 10, limit: 100 }),
|
|
44
|
+
};
|
|
45
|
+
static contextDefinition = {
|
|
46
|
+
...this.ContextOptions.ProjectId,
|
|
47
|
+
...this.ContextOptions.LoggedIn,
|
|
48
|
+
};
|
|
49
|
+
async runAsync() {
|
|
50
|
+
const { flags } = await this.parse(WorkflowRunList);
|
|
51
|
+
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(WorkflowRunList, {
|
|
52
|
+
nonInteractive: true,
|
|
53
|
+
});
|
|
54
|
+
if (flags.json) {
|
|
55
|
+
(0, json_1.enableJsonOutput)();
|
|
56
|
+
}
|
|
57
|
+
const workflowFileName = flags.workflow;
|
|
58
|
+
const status = flags.status;
|
|
59
|
+
const limit = flags.limit ?? 10;
|
|
60
|
+
let runs;
|
|
61
|
+
if (workflowFileName) {
|
|
62
|
+
runs = await WorkflowRunQuery_1.WorkflowRunQuery.byAppIdFileNameAndStatusAsync(graphqlClient, projectId, workflowFileName, status, limit);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
runs = await AppQuery_1.AppQuery.byIdWorkflowRunsFilteredByStatusAsync(graphqlClient, projectId, status, limit);
|
|
66
|
+
}
|
|
67
|
+
const result = processWorkflowRuns(runs);
|
|
68
|
+
if (flags.json) {
|
|
69
|
+
(0, json_1.printJsonOnlyOutput)(result);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
log_1.default.addNewLineIfNone();
|
|
73
|
+
result.forEach(run => {
|
|
74
|
+
log_1.default.log((0, formatFields_1.default)([
|
|
75
|
+
{ label: 'Run ID', value: run.id },
|
|
76
|
+
{ label: 'Workflow', value: run.workflowFileName },
|
|
77
|
+
{ label: 'Status', value: run.status },
|
|
78
|
+
{ label: 'Started At', value: run.startedAt },
|
|
79
|
+
{ label: 'Finished At', value: run.finishedAt },
|
|
80
|
+
{ label: 'Git Commit Message', value: run.gitCommitMessage ?? 'null' },
|
|
81
|
+
{ label: 'Git Commit Hash', value: run.gitCommitHash ?? 'null' },
|
|
82
|
+
]));
|
|
83
|
+
log_1.default.addNewLineIfNone();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.default = WorkflowRunList;
|
|
@@ -1485,7 +1485,7 @@ export type AppWorkflowRunGitBranchesPaginatedArgs = {
|
|
|
1485
1485
|
export type AppWorkflowRunsPaginatedArgs = {
|
|
1486
1486
|
after?: InputMaybe<Scalars['String']['input']>;
|
|
1487
1487
|
before?: InputMaybe<Scalars['String']['input']>;
|
|
1488
|
-
filter?: InputMaybe<
|
|
1488
|
+
filter?: InputMaybe<AppWorkflowRunFilterInput>;
|
|
1489
1489
|
first?: InputMaybe<Scalars['Int']['input']>;
|
|
1490
1490
|
last?: InputMaybe<Scalars['Int']['input']>;
|
|
1491
1491
|
};
|
|
@@ -1892,6 +1892,10 @@ export type AppWorkflowRunEdge = {
|
|
|
1892
1892
|
cursor: Scalars['String']['output'];
|
|
1893
1893
|
node: WorkflowRun;
|
|
1894
1894
|
};
|
|
1895
|
+
export type AppWorkflowRunFilterInput = {
|
|
1896
|
+
requestedGitRef?: InputMaybe<Scalars['String']['input']>;
|
|
1897
|
+
status?: InputMaybe<WorkflowRunStatus>;
|
|
1898
|
+
};
|
|
1895
1899
|
export type AppWorkflowRunGitBranchEdge = {
|
|
1896
1900
|
__typename?: 'AppWorkflowRunGitBranchEdge';
|
|
1897
1901
|
cursor: Scalars['String']['output'];
|
|
@@ -7292,6 +7296,7 @@ export type WorkflowRevisionsPaginatedArgs = {
|
|
|
7292
7296
|
export type WorkflowRunsPaginatedArgs = {
|
|
7293
7297
|
after?: InputMaybe<Scalars['String']['input']>;
|
|
7294
7298
|
before?: InputMaybe<Scalars['String']['input']>;
|
|
7299
|
+
filter?: InputMaybe<WorkflowRunFilterInput>;
|
|
7295
7300
|
first?: InputMaybe<Scalars['Int']['input']>;
|
|
7296
7301
|
last?: InputMaybe<Scalars['Int']['input']>;
|
|
7297
7302
|
};
|
|
@@ -7377,12 +7382,17 @@ export type WorkflowProjectSourceInput = {
|
|
|
7377
7382
|
export declare enum WorkflowProjectSourceType {
|
|
7378
7383
|
Gcs = "GCS"
|
|
7379
7384
|
}
|
|
7380
|
-
/** Look up Workflow by ID */
|
|
7381
7385
|
export type WorkflowQuery = {
|
|
7382
7386
|
__typename?: 'WorkflowQuery';
|
|
7387
|
+
/** Look up Workflow by app ID and file name */
|
|
7388
|
+
byAppIdAndFileName: Workflow;
|
|
7389
|
+
/** Look up Workflow by ID */
|
|
7383
7390
|
byId: Workflow;
|
|
7384
7391
|
};
|
|
7385
|
-
|
|
7392
|
+
export type WorkflowQueryByAppIdAndFileNameArgs = {
|
|
7393
|
+
appId: Scalars['ID']['input'];
|
|
7394
|
+
fileName: Scalars['String']['input'];
|
|
7395
|
+
};
|
|
7386
7396
|
export type WorkflowQueryByIdArgs = {
|
|
7387
7397
|
workflowId: Scalars['ID']['input'];
|
|
7388
7398
|
};
|
|
@@ -7462,6 +7472,7 @@ export type WorkflowRunError = {
|
|
|
7462
7472
|
};
|
|
7463
7473
|
export type WorkflowRunFilterInput = {
|
|
7464
7474
|
requestedGitRef?: InputMaybe<Scalars['String']['input']>;
|
|
7475
|
+
status?: InputMaybe<WorkflowRunStatus>;
|
|
7465
7476
|
};
|
|
7466
7477
|
export type WorkflowRunGitBranchFilterInput = {
|
|
7467
7478
|
searchTerm?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -7500,7 +7511,6 @@ export declare enum WorkflowRunStatus {
|
|
|
7500
7511
|
Failure = "FAILURE",
|
|
7501
7512
|
InProgress = "IN_PROGRESS",
|
|
7502
7513
|
New = "NEW",
|
|
7503
|
-
PendingCancel = "PENDING_CANCEL",
|
|
7504
7514
|
Success = "SUCCESS"
|
|
7505
7515
|
}
|
|
7506
7516
|
export declare enum WorkflowRunTriggerEventType {
|
|
@@ -12542,6 +12552,63 @@ export type AppByFullNameQuery = {
|
|
|
12542
12552
|
};
|
|
12543
12553
|
};
|
|
12544
12554
|
};
|
|
12555
|
+
export type AppByIdWorkflowsQueryVariables = Exact<{
|
|
12556
|
+
appId: Scalars['String']['input'];
|
|
12557
|
+
}>;
|
|
12558
|
+
export type AppByIdWorkflowsQuery = {
|
|
12559
|
+
__typename?: 'RootQuery';
|
|
12560
|
+
app: {
|
|
12561
|
+
__typename?: 'AppQuery';
|
|
12562
|
+
byId: {
|
|
12563
|
+
__typename?: 'App';
|
|
12564
|
+
id: string;
|
|
12565
|
+
workflows: Array<{
|
|
12566
|
+
__typename?: 'Workflow';
|
|
12567
|
+
id: string;
|
|
12568
|
+
name?: string | null;
|
|
12569
|
+
fileName: string;
|
|
12570
|
+
createdAt: any;
|
|
12571
|
+
updatedAt: any;
|
|
12572
|
+
}>;
|
|
12573
|
+
};
|
|
12574
|
+
};
|
|
12575
|
+
};
|
|
12576
|
+
export type AppByIdWorkflowRunsFilteredByStatusQueryVariables = Exact<{
|
|
12577
|
+
appId: Scalars['String']['input'];
|
|
12578
|
+
status?: InputMaybe<WorkflowRunStatus>;
|
|
12579
|
+
limit: Scalars['Int']['input'];
|
|
12580
|
+
}>;
|
|
12581
|
+
export type AppByIdWorkflowRunsFilteredByStatusQuery = {
|
|
12582
|
+
__typename?: 'RootQuery';
|
|
12583
|
+
app: {
|
|
12584
|
+
__typename?: 'AppQuery';
|
|
12585
|
+
byId: {
|
|
12586
|
+
__typename?: 'App';
|
|
12587
|
+
id: string;
|
|
12588
|
+
runs: {
|
|
12589
|
+
__typename?: 'AppWorkflowRunsConnection';
|
|
12590
|
+
edges: Array<{
|
|
12591
|
+
__typename?: 'AppWorkflowRunEdge';
|
|
12592
|
+
node: {
|
|
12593
|
+
__typename?: 'WorkflowRun';
|
|
12594
|
+
id: string;
|
|
12595
|
+
status: WorkflowRunStatus;
|
|
12596
|
+
gitCommitMessage?: string | null;
|
|
12597
|
+
gitCommitHash?: string | null;
|
|
12598
|
+
createdAt: any;
|
|
12599
|
+
updatedAt: any;
|
|
12600
|
+
workflow: {
|
|
12601
|
+
__typename?: 'Workflow';
|
|
12602
|
+
id: string;
|
|
12603
|
+
name?: string | null;
|
|
12604
|
+
fileName: string;
|
|
12605
|
+
};
|
|
12606
|
+
};
|
|
12607
|
+
}>;
|
|
12608
|
+
};
|
|
12609
|
+
};
|
|
12610
|
+
};
|
|
12611
|
+
};
|
|
12545
12612
|
export type AppStoreConnectApiKeyByIdQueryVariables = Exact<{
|
|
12546
12613
|
ascApiKeyId: Scalars['ID']['input'];
|
|
12547
12614
|
}>;
|
|
@@ -14452,6 +14519,43 @@ export type WorkflowRunByIdWithJobsQuery = {
|
|
|
14452
14519
|
};
|
|
14453
14520
|
};
|
|
14454
14521
|
};
|
|
14522
|
+
export type WorkflowRunsForAppIdFileNameAndStatusQueryVariables = Exact<{
|
|
14523
|
+
appId: Scalars['ID']['input'];
|
|
14524
|
+
fileName: Scalars['String']['input'];
|
|
14525
|
+
status?: InputMaybe<WorkflowRunStatus>;
|
|
14526
|
+
limit: Scalars['Int']['input'];
|
|
14527
|
+
}>;
|
|
14528
|
+
export type WorkflowRunsForAppIdFileNameAndStatusQuery = {
|
|
14529
|
+
__typename?: 'RootQuery';
|
|
14530
|
+
workflows: {
|
|
14531
|
+
__typename?: 'WorkflowQuery';
|
|
14532
|
+
byAppIdAndFileName: {
|
|
14533
|
+
__typename?: 'Workflow';
|
|
14534
|
+
id: string;
|
|
14535
|
+
runs: {
|
|
14536
|
+
__typename?: 'WorkflowRunsConnection';
|
|
14537
|
+
edges: Array<{
|
|
14538
|
+
__typename?: 'WorkflowRunEdge';
|
|
14539
|
+
node: {
|
|
14540
|
+
__typename?: 'WorkflowRun';
|
|
14541
|
+
id: string;
|
|
14542
|
+
status: WorkflowRunStatus;
|
|
14543
|
+
gitCommitMessage?: string | null;
|
|
14544
|
+
gitCommitHash?: string | null;
|
|
14545
|
+
createdAt: any;
|
|
14546
|
+
updatedAt: any;
|
|
14547
|
+
workflow: {
|
|
14548
|
+
__typename?: 'Workflow';
|
|
14549
|
+
id: string;
|
|
14550
|
+
name?: string | null;
|
|
14551
|
+
fileName: string;
|
|
14552
|
+
};
|
|
14553
|
+
};
|
|
14554
|
+
}>;
|
|
14555
|
+
};
|
|
14556
|
+
};
|
|
14557
|
+
};
|
|
14558
|
+
};
|
|
14455
14559
|
export type AccountFragment = {
|
|
14456
14560
|
__typename?: 'Account';
|
|
14457
14561
|
id: string;
|
|
@@ -15076,6 +15180,29 @@ export type WebhookFragment = {
|
|
|
15076
15180
|
createdAt: any;
|
|
15077
15181
|
updatedAt: any;
|
|
15078
15182
|
};
|
|
15183
|
+
export type WorkflowFragment = {
|
|
15184
|
+
__typename?: 'Workflow';
|
|
15185
|
+
id: string;
|
|
15186
|
+
name?: string | null;
|
|
15187
|
+
fileName: string;
|
|
15188
|
+
createdAt: any;
|
|
15189
|
+
updatedAt: any;
|
|
15190
|
+
};
|
|
15191
|
+
export type WorkflowRunFragment = {
|
|
15192
|
+
__typename?: 'WorkflowRun';
|
|
15193
|
+
id: string;
|
|
15194
|
+
status: WorkflowRunStatus;
|
|
15195
|
+
gitCommitMessage?: string | null;
|
|
15196
|
+
gitCommitHash?: string | null;
|
|
15197
|
+
createdAt: any;
|
|
15198
|
+
updatedAt: any;
|
|
15199
|
+
workflow: {
|
|
15200
|
+
__typename?: 'Workflow';
|
|
15201
|
+
id: string;
|
|
15202
|
+
name?: string | null;
|
|
15203
|
+
fileName: string;
|
|
15204
|
+
};
|
|
15205
|
+
};
|
|
15079
15206
|
export type AndroidAppBuildCredentialsFragment = {
|
|
15080
15207
|
__typename?: 'AndroidAppBuildCredentials';
|
|
15081
15208
|
id: string;
|
|
@@ -898,7 +898,6 @@ var WorkflowRunStatus;
|
|
|
898
898
|
WorkflowRunStatus["Failure"] = "FAILURE";
|
|
899
899
|
WorkflowRunStatus["InProgress"] = "IN_PROGRESS";
|
|
900
900
|
WorkflowRunStatus["New"] = "NEW";
|
|
901
|
-
WorkflowRunStatus["PendingCancel"] = "PENDING_CANCEL";
|
|
902
901
|
WorkflowRunStatus["Success"] = "SUCCESS";
|
|
903
902
|
})(WorkflowRunStatus || (exports.WorkflowRunStatus = WorkflowRunStatus = {}));
|
|
904
903
|
var WorkflowRunTriggerEventType;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AppFragment } from '../generated';
|
|
2
|
+
import { AppFragment, WorkflowFragment, WorkflowRunFragment, WorkflowRunStatus } from '../generated';
|
|
3
3
|
export declare const AppQuery: {
|
|
4
4
|
byIdAsync(graphqlClient: ExpoGraphqlClient, projectId: string): Promise<AppFragment>;
|
|
5
5
|
byFullNameAsync(graphqlClient: ExpoGraphqlClient, fullName: string): Promise<AppFragment>;
|
|
6
|
+
byIdWorkflowsAsync(graphqlClient: ExpoGraphqlClient, appId: string): Promise<WorkflowFragment[]>;
|
|
7
|
+
byIdWorkflowRunsFilteredByStatusAsync(graphqlClient: ExpoGraphqlClient, appId: string, status?: WorkflowRunStatus, limit?: number): Promise<WorkflowRunFragment[]>;
|
|
6
8
|
};
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppQuery = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
/* eslint-disable graphql/template-strings */
|
|
5
6
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
6
7
|
const graphql_1 = require("graphql");
|
|
7
8
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
9
|
const client_1 = require("../client");
|
|
9
10
|
const App_1 = require("../types/App");
|
|
11
|
+
const Workflow_1 = require("../types/Workflow");
|
|
12
|
+
const WorkflowRun_1 = require("../types/WorkflowRun");
|
|
10
13
|
exports.AppQuery = {
|
|
11
14
|
async byIdAsync(graphqlClient, projectId) {
|
|
12
15
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
@@ -46,4 +49,58 @@ exports.AppQuery = {
|
|
|
46
49
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
47
50
|
return data.app.byFullName;
|
|
48
51
|
},
|
|
52
|
+
async byIdWorkflowsAsync(graphqlClient, appId) {
|
|
53
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
54
|
+
.query((0, graphql_tag_1.default) `
|
|
55
|
+
query AppByIdWorkflowsQuery($appId: String!) {
|
|
56
|
+
app {
|
|
57
|
+
byId(appId: $appId) {
|
|
58
|
+
id
|
|
59
|
+
workflows {
|
|
60
|
+
id
|
|
61
|
+
...WorkflowFragment
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
${(0, graphql_1.print)(Workflow_1.WorkflowFragmentNode)}
|
|
67
|
+
`, { appId }, { additionalTypenames: ['App'] })
|
|
68
|
+
.toPromise());
|
|
69
|
+
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
70
|
+
return data.app.byId.workflows;
|
|
71
|
+
},
|
|
72
|
+
async byIdWorkflowRunsFilteredByStatusAsync(graphqlClient, appId, status, limit) {
|
|
73
|
+
validateLimit(limit);
|
|
74
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
75
|
+
.query((0, graphql_tag_1.default) `
|
|
76
|
+
query AppByIdWorkflowRunsFilteredByStatusQuery(
|
|
77
|
+
$appId: String!
|
|
78
|
+
$status: WorkflowRunStatus
|
|
79
|
+
$limit: Int!
|
|
80
|
+
) {
|
|
81
|
+
app {
|
|
82
|
+
byId(appId: $appId) {
|
|
83
|
+
id
|
|
84
|
+
runs: workflowRunsPaginated(last: $limit, filter: { status: $status }) {
|
|
85
|
+
edges {
|
|
86
|
+
node {
|
|
87
|
+
id
|
|
88
|
+
...WorkflowRunFragment
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
${(0, graphql_1.print)(WorkflowRun_1.WorkflowRunFragmentNode)}
|
|
96
|
+
`, { appId, status, limit }, { additionalTypenames: ['App'] })
|
|
97
|
+
.toPromise());
|
|
98
|
+
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
99
|
+
return data.app.byId.runs.edges.map(edge => edge.node);
|
|
100
|
+
},
|
|
49
101
|
};
|
|
102
|
+
function validateLimit(limit) {
|
|
103
|
+
(0, assert_1.default)(limit, 'limit is required');
|
|
104
|
+
(0, assert_1.default)(limit > 0, 'limit must be greater than 0');
|
|
105
|
+
(0, assert_1.default)(limit <= 100, 'limit must be less than or equal to 100');
|
|
106
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { WorkflowRunByIdQuery, WorkflowRunByIdWithJobsQuery } from '../generated';
|
|
2
|
+
import { WorkflowRunByIdQuery, WorkflowRunByIdWithJobsQuery, WorkflowRunFragment, WorkflowRunStatus } from '../generated';
|
|
3
3
|
export declare const WorkflowRunQuery: {
|
|
4
4
|
byIdAsync(graphqlClient: ExpoGraphqlClient, workflowRunId: string, { useCache }?: {
|
|
5
5
|
useCache?: boolean | undefined;
|
|
@@ -7,4 +7,5 @@ export declare const WorkflowRunQuery: {
|
|
|
7
7
|
withJobsByIdAsync(graphqlClient: ExpoGraphqlClient, workflowRunId: string, { useCache }?: {
|
|
8
8
|
useCache?: boolean | undefined;
|
|
9
9
|
}): Promise<WorkflowRunByIdWithJobsQuery['workflowRuns']['byId']>;
|
|
10
|
+
byAppIdFileNameAndStatusAsync(graphqlClient: ExpoGraphqlClient, appId: string, fileName: string, status?: WorkflowRunStatus, limit?: number): Promise<WorkflowRunFragment[]>;
|
|
10
11
|
};
|