eas-cli 16.7.2 → 16.9.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 +128 -78
- package/build/build/runBuildAndSubmit.js +7 -6
- 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/submit/internal.js +1 -0
- package/build/commands/submit.d.ts +1 -0
- package/build/commands/submit.js +8 -1
- 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 +135 -4
- package/build/graphql/generated.js +2 -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/submit/context.d.ts +2 -0
- package/build/submit/context.js +12 -1
- package/build/submit/ios/IosSubmitter.js +2 -1
- package/oclif.manifest.json +81 -1
- package/package.json +3 -3
|
@@ -153,7 +153,7 @@ async function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsClient, pro
|
|
|
153
153
|
});
|
|
154
154
|
for (const startedBuild of startedBuilds) {
|
|
155
155
|
const submitProfile = (0, nullthrows_1.default)(submitProfiles.find(({ platform }) => (0, AppPlatform_1.toAppPlatform)(platform) === startedBuild.build.platform)).profile;
|
|
156
|
-
const submission = await
|
|
156
|
+
const submission = await prepareAndStartAutoSubmissionAsync({
|
|
157
157
|
build: startedBuild.build,
|
|
158
158
|
buildCtx: (0, nullthrows_1.default)(buildCtxByPlatform[startedBuild.build.platform]),
|
|
159
159
|
moreBuilds: startedBuilds.length > 1,
|
|
@@ -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,
|
|
@@ -312,7 +312,7 @@ async function startBuildAsync(ctx) {
|
|
|
312
312
|
}
|
|
313
313
|
return await sendBuildRequestAsync();
|
|
314
314
|
}
|
|
315
|
-
async function
|
|
315
|
+
async function prepareAndStartAutoSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, submitProfile, selectedSubmitProfileName, nonInteractive, }) {
|
|
316
316
|
const platform = (0, AppPlatform_1.toPlatform)(build.platform);
|
|
317
317
|
const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
|
|
318
318
|
platform,
|
|
@@ -331,6 +331,7 @@ async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, pro
|
|
|
331
331
|
vcsClient: buildCtx.vcsClient,
|
|
332
332
|
isVerboseFastlaneEnabled: false,
|
|
333
333
|
specifiedProfile: selectedSubmitProfileName,
|
|
334
|
+
groups: undefined, // use groups from submit profile
|
|
334
335
|
});
|
|
335
336
|
if (moreBuilds) {
|
|
336
337
|
log_1.default.newLine();
|
|
@@ -390,7 +391,7 @@ async function validateExpoUpdatesInstalledAsProjectDependencyAsync({ exp, proje
|
|
|
390
391
|
message: `Would you like to install the "expo-updates" package and configure EAS Update now?`,
|
|
391
392
|
});
|
|
392
393
|
if (installExpoUpdates) {
|
|
393
|
-
const
|
|
394
|
+
const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
|
394
395
|
await (0, configure_2.ensureEASUpdateIsConfiguredAsync)({
|
|
395
396
|
exp,
|
|
396
397
|
projectId,
|
|
@@ -398,7 +399,7 @@ async function validateExpoUpdatesInstalledAsProjectDependencyAsync({ exp, proje
|
|
|
398
399
|
platform: platform_1.RequestedPlatform.All,
|
|
399
400
|
vcsClient,
|
|
400
401
|
env,
|
|
401
|
-
manifestHostOverride:
|
|
402
|
+
manifestHostOverride: easJsonCliConfig.updateManifestHostOverride ?? null,
|
|
402
403
|
});
|
|
403
404
|
log_1.default.withTick('Installed expo-updates and configured EAS Update.');
|
|
404
405
|
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
|
}
|
|
@@ -12,6 +12,7 @@ export default class Submit extends EasCommand {
|
|
|
12
12
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
'verbose-fastlane': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
groups: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
|
|
15
16
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
};
|
|
17
18
|
static contextDefinition: {
|
package/build/commands/submit.js
CHANGED
|
@@ -55,6 +55,11 @@ class Submit extends EasCommand_1.default {
|
|
|
55
55
|
default: false,
|
|
56
56
|
description: 'Enable verbose logging for the submission process',
|
|
57
57
|
}),
|
|
58
|
+
groups: core_1.Flags.string({
|
|
59
|
+
description: 'Internal TestFlight testing groups to add the build to (iOS only). Learn more: https://developer.apple.com/help/app-store-connect/test-a-beta-version/add-internal-testers',
|
|
60
|
+
multiple: true,
|
|
61
|
+
char: 'g',
|
|
62
|
+
}),
|
|
58
63
|
'non-interactive': core_1.Flags.boolean({
|
|
59
64
|
default: false,
|
|
60
65
|
description: 'Run command in non-interactive mode',
|
|
@@ -94,6 +99,7 @@ class Submit extends EasCommand_1.default {
|
|
|
94
99
|
archiveFlags: flagsWithPlatform.archiveFlags,
|
|
95
100
|
nonInteractive: flagsWithPlatform.nonInteractive,
|
|
96
101
|
isVerboseFastlaneEnabled: flagsWithPlatform.isVerboseFastlaneEnabled,
|
|
102
|
+
groups: flagsWithPlatform.groups,
|
|
97
103
|
actor,
|
|
98
104
|
graphqlClient,
|
|
99
105
|
analytics,
|
|
@@ -120,7 +126,7 @@ class Submit extends EasCommand_1.default {
|
|
|
120
126
|
}
|
|
121
127
|
}
|
|
122
128
|
sanitizeFlags(flags) {
|
|
123
|
-
const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, 'verbose-fastlane': isVerboseFastlaneEnabled, ...archiveFlags } = flags;
|
|
129
|
+
const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, 'verbose-fastlane': isVerboseFastlaneEnabled, groups, ...archiveFlags } = flags;
|
|
124
130
|
if (!flags.platform && nonInteractive) {
|
|
125
131
|
core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
|
|
126
132
|
}
|
|
@@ -136,6 +142,7 @@ class Submit extends EasCommand_1.default {
|
|
|
136
142
|
profile,
|
|
137
143
|
nonInteractive,
|
|
138
144
|
isVerboseFastlaneEnabled,
|
|
145
|
+
groups,
|
|
139
146
|
};
|
|
140
147
|
}
|
|
141
148
|
async ensurePlatformSelectedAsync(flags) {
|
|
@@ -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'];
|
|
@@ -2326,6 +2330,7 @@ export declare enum AuthProtocolType {
|
|
|
2326
2330
|
Oidc = "OIDC"
|
|
2327
2331
|
}
|
|
2328
2332
|
export declare enum AuthProviderIdentifier {
|
|
2333
|
+
Generic = "GENERIC",
|
|
2329
2334
|
GoogleWs = "GOOGLE_WS",
|
|
2330
2335
|
MsEntraId = "MS_ENTRA_ID",
|
|
2331
2336
|
Okta = "OKTA",
|
|
@@ -3724,12 +3729,14 @@ export declare enum Feature {
|
|
|
3724
3729
|
export type Fingerprint = {
|
|
3725
3730
|
__typename?: 'Fingerprint';
|
|
3726
3731
|
app: App;
|
|
3732
|
+
buildCount: Scalars['Int']['output'];
|
|
3727
3733
|
builds: AppBuildsConnection;
|
|
3728
3734
|
createdAt: Scalars['DateTime']['output'];
|
|
3729
3735
|
debugInfoUrl?: Maybe<Scalars['String']['output']>;
|
|
3730
3736
|
hash: Scalars['String']['output'];
|
|
3731
3737
|
id: Scalars['ID']['output'];
|
|
3732
3738
|
source?: Maybe<FingerprintSource>;
|
|
3739
|
+
updateCount: Scalars['Int']['output'];
|
|
3733
3740
|
updatedAt: Scalars['DateTime']['output'];
|
|
3734
3741
|
updates: AppUpdatesConnection;
|
|
3735
3742
|
};
|
|
@@ -7292,6 +7299,7 @@ export type WorkflowRevisionsPaginatedArgs = {
|
|
|
7292
7299
|
export type WorkflowRunsPaginatedArgs = {
|
|
7293
7300
|
after?: InputMaybe<Scalars['String']['input']>;
|
|
7294
7301
|
before?: InputMaybe<Scalars['String']['input']>;
|
|
7302
|
+
filter?: InputMaybe<WorkflowRunFilterInput>;
|
|
7295
7303
|
first?: InputMaybe<Scalars['Int']['input']>;
|
|
7296
7304
|
last?: InputMaybe<Scalars['Int']['input']>;
|
|
7297
7305
|
};
|
|
@@ -7359,6 +7367,7 @@ export declare enum WorkflowJobType {
|
|
|
7359
7367
|
Build = "BUILD",
|
|
7360
7368
|
Custom = "CUSTOM",
|
|
7361
7369
|
Deploy = "DEPLOY",
|
|
7370
|
+
Doc = "DOC",
|
|
7362
7371
|
Fingerprint = "FINGERPRINT",
|
|
7363
7372
|
GetBuild = "GET_BUILD",
|
|
7364
7373
|
MaestroCloud = "MAESTRO_CLOUD",
|
|
@@ -7377,12 +7386,17 @@ export type WorkflowProjectSourceInput = {
|
|
|
7377
7386
|
export declare enum WorkflowProjectSourceType {
|
|
7378
7387
|
Gcs = "GCS"
|
|
7379
7388
|
}
|
|
7380
|
-
/** Look up Workflow by ID */
|
|
7381
7389
|
export type WorkflowQuery = {
|
|
7382
7390
|
__typename?: 'WorkflowQuery';
|
|
7391
|
+
/** Look up Workflow by app ID and file name */
|
|
7392
|
+
byAppIdAndFileName: Workflow;
|
|
7393
|
+
/** Look up Workflow by ID */
|
|
7383
7394
|
byId: Workflow;
|
|
7384
7395
|
};
|
|
7385
|
-
|
|
7396
|
+
export type WorkflowQueryByAppIdAndFileNameArgs = {
|
|
7397
|
+
appId: Scalars['ID']['input'];
|
|
7398
|
+
fileName: Scalars['String']['input'];
|
|
7399
|
+
};
|
|
7386
7400
|
export type WorkflowQueryByIdArgs = {
|
|
7387
7401
|
workflowId: Scalars['ID']['input'];
|
|
7388
7402
|
};
|
|
@@ -7462,6 +7476,7 @@ export type WorkflowRunError = {
|
|
|
7462
7476
|
};
|
|
7463
7477
|
export type WorkflowRunFilterInput = {
|
|
7464
7478
|
requestedGitRef?: InputMaybe<Scalars['String']['input']>;
|
|
7479
|
+
status?: InputMaybe<WorkflowRunStatus>;
|
|
7465
7480
|
};
|
|
7466
7481
|
export type WorkflowRunGitBranchFilterInput = {
|
|
7467
7482
|
searchTerm?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -7500,7 +7515,6 @@ export declare enum WorkflowRunStatus {
|
|
|
7500
7515
|
Failure = "FAILURE",
|
|
7501
7516
|
InProgress = "IN_PROGRESS",
|
|
7502
7517
|
New = "NEW",
|
|
7503
|
-
PendingCancel = "PENDING_CANCEL",
|
|
7504
7518
|
Success = "SUCCESS"
|
|
7505
7519
|
}
|
|
7506
7520
|
export declare enum WorkflowRunTriggerEventType {
|
|
@@ -12542,6 +12556,63 @@ export type AppByFullNameQuery = {
|
|
|
12542
12556
|
};
|
|
12543
12557
|
};
|
|
12544
12558
|
};
|
|
12559
|
+
export type AppByIdWorkflowsQueryVariables = Exact<{
|
|
12560
|
+
appId: Scalars['String']['input'];
|
|
12561
|
+
}>;
|
|
12562
|
+
export type AppByIdWorkflowsQuery = {
|
|
12563
|
+
__typename?: 'RootQuery';
|
|
12564
|
+
app: {
|
|
12565
|
+
__typename?: 'AppQuery';
|
|
12566
|
+
byId: {
|
|
12567
|
+
__typename?: 'App';
|
|
12568
|
+
id: string;
|
|
12569
|
+
workflows: Array<{
|
|
12570
|
+
__typename?: 'Workflow';
|
|
12571
|
+
id: string;
|
|
12572
|
+
name?: string | null;
|
|
12573
|
+
fileName: string;
|
|
12574
|
+
createdAt: any;
|
|
12575
|
+
updatedAt: any;
|
|
12576
|
+
}>;
|
|
12577
|
+
};
|
|
12578
|
+
};
|
|
12579
|
+
};
|
|
12580
|
+
export type AppByIdWorkflowRunsFilteredByStatusQueryVariables = Exact<{
|
|
12581
|
+
appId: Scalars['String']['input'];
|
|
12582
|
+
status?: InputMaybe<WorkflowRunStatus>;
|
|
12583
|
+
limit: Scalars['Int']['input'];
|
|
12584
|
+
}>;
|
|
12585
|
+
export type AppByIdWorkflowRunsFilteredByStatusQuery = {
|
|
12586
|
+
__typename?: 'RootQuery';
|
|
12587
|
+
app: {
|
|
12588
|
+
__typename?: 'AppQuery';
|
|
12589
|
+
byId: {
|
|
12590
|
+
__typename?: 'App';
|
|
12591
|
+
id: string;
|
|
12592
|
+
runs: {
|
|
12593
|
+
__typename?: 'AppWorkflowRunsConnection';
|
|
12594
|
+
edges: Array<{
|
|
12595
|
+
__typename?: 'AppWorkflowRunEdge';
|
|
12596
|
+
node: {
|
|
12597
|
+
__typename?: 'WorkflowRun';
|
|
12598
|
+
id: string;
|
|
12599
|
+
status: WorkflowRunStatus;
|
|
12600
|
+
gitCommitMessage?: string | null;
|
|
12601
|
+
gitCommitHash?: string | null;
|
|
12602
|
+
createdAt: any;
|
|
12603
|
+
updatedAt: any;
|
|
12604
|
+
workflow: {
|
|
12605
|
+
__typename?: 'Workflow';
|
|
12606
|
+
id: string;
|
|
12607
|
+
name?: string | null;
|
|
12608
|
+
fileName: string;
|
|
12609
|
+
};
|
|
12610
|
+
};
|
|
12611
|
+
}>;
|
|
12612
|
+
};
|
|
12613
|
+
};
|
|
12614
|
+
};
|
|
12615
|
+
};
|
|
12545
12616
|
export type AppStoreConnectApiKeyByIdQueryVariables = Exact<{
|
|
12546
12617
|
ascApiKeyId: Scalars['ID']['input'];
|
|
12547
12618
|
}>;
|
|
@@ -14452,6 +14523,43 @@ export type WorkflowRunByIdWithJobsQuery = {
|
|
|
14452
14523
|
};
|
|
14453
14524
|
};
|
|
14454
14525
|
};
|
|
14526
|
+
export type WorkflowRunsForAppIdFileNameAndStatusQueryVariables = Exact<{
|
|
14527
|
+
appId: Scalars['ID']['input'];
|
|
14528
|
+
fileName: Scalars['String']['input'];
|
|
14529
|
+
status?: InputMaybe<WorkflowRunStatus>;
|
|
14530
|
+
limit: Scalars['Int']['input'];
|
|
14531
|
+
}>;
|
|
14532
|
+
export type WorkflowRunsForAppIdFileNameAndStatusQuery = {
|
|
14533
|
+
__typename?: 'RootQuery';
|
|
14534
|
+
workflows: {
|
|
14535
|
+
__typename?: 'WorkflowQuery';
|
|
14536
|
+
byAppIdAndFileName: {
|
|
14537
|
+
__typename?: 'Workflow';
|
|
14538
|
+
id: string;
|
|
14539
|
+
runs: {
|
|
14540
|
+
__typename?: 'WorkflowRunsConnection';
|
|
14541
|
+
edges: Array<{
|
|
14542
|
+
__typename?: 'WorkflowRunEdge';
|
|
14543
|
+
node: {
|
|
14544
|
+
__typename?: 'WorkflowRun';
|
|
14545
|
+
id: string;
|
|
14546
|
+
status: WorkflowRunStatus;
|
|
14547
|
+
gitCommitMessage?: string | null;
|
|
14548
|
+
gitCommitHash?: string | null;
|
|
14549
|
+
createdAt: any;
|
|
14550
|
+
updatedAt: any;
|
|
14551
|
+
workflow: {
|
|
14552
|
+
__typename?: 'Workflow';
|
|
14553
|
+
id: string;
|
|
14554
|
+
name?: string | null;
|
|
14555
|
+
fileName: string;
|
|
14556
|
+
};
|
|
14557
|
+
};
|
|
14558
|
+
}>;
|
|
14559
|
+
};
|
|
14560
|
+
};
|
|
14561
|
+
};
|
|
14562
|
+
};
|
|
14455
14563
|
export type AccountFragment = {
|
|
14456
14564
|
__typename?: 'Account';
|
|
14457
14565
|
id: string;
|
|
@@ -15076,6 +15184,29 @@ export type WebhookFragment = {
|
|
|
15076
15184
|
createdAt: any;
|
|
15077
15185
|
updatedAt: any;
|
|
15078
15186
|
};
|
|
15187
|
+
export type WorkflowFragment = {
|
|
15188
|
+
__typename?: 'Workflow';
|
|
15189
|
+
id: string;
|
|
15190
|
+
name?: string | null;
|
|
15191
|
+
fileName: string;
|
|
15192
|
+
createdAt: any;
|
|
15193
|
+
updatedAt: any;
|
|
15194
|
+
};
|
|
15195
|
+
export type WorkflowRunFragment = {
|
|
15196
|
+
__typename?: 'WorkflowRun';
|
|
15197
|
+
id: string;
|
|
15198
|
+
status: WorkflowRunStatus;
|
|
15199
|
+
gitCommitMessage?: string | null;
|
|
15200
|
+
gitCommitHash?: string | null;
|
|
15201
|
+
createdAt: any;
|
|
15202
|
+
updatedAt: any;
|
|
15203
|
+
workflow: {
|
|
15204
|
+
__typename?: 'Workflow';
|
|
15205
|
+
id: string;
|
|
15206
|
+
name?: string | null;
|
|
15207
|
+
fileName: string;
|
|
15208
|
+
};
|
|
15209
|
+
};
|
|
15079
15210
|
export type AndroidAppBuildCredentialsFragment = {
|
|
15080
15211
|
__typename?: 'AndroidAppBuildCredentials';
|
|
15081
15212
|
id: string;
|