eas-cli 2.1.0 → 2.2.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 +6 -1047
- package/build/branch/queries.d.ts +10 -2
- package/build/branch/queries.js +30 -30
- package/build/branch/utils.d.ts +4 -0
- package/build/branch/utils.js +15 -0
- package/build/build/android/build.js +3 -3
- package/build/build/android/prepareJob.js +1 -2
- package/build/build/android/syncProjectConfiguration.d.ts +2 -1
- package/build/build/android/syncProjectConfiguration.js +2 -2
- package/build/build/build.js +15 -4
- package/build/build/configure.js +2 -2
- package/build/build/createContext.d.ts +5 -1
- package/build/build/createContext.js +8 -14
- package/build/build/ios/build.js +2 -1
- package/build/build/ios/credentials.js +1 -1
- package/build/build/ios/prepareJob.js +1 -2
- package/build/build/ios/syncProjectConfiguration.d.ts +2 -1
- package/build/build/ios/syncProjectConfiguration.js +2 -2
- package/build/build/local.js +1 -1
- package/build/build/metadata.js +1 -2
- package/build/build/queries.d.ts +9 -0
- package/build/build/queries.js +51 -0
- package/build/build/runBuildAndSubmit.d.ts +3 -1
- package/build/build/runBuildAndSubmit.js +15 -7
- package/build/build/utils/repository.js +5 -1
- package/build/channel/queries.d.ts +17 -0
- package/build/channel/queries.js +137 -0
- package/build/channel/utils.d.ts +22 -0
- package/build/channel/utils.js +87 -0
- package/build/commandUtils/EasCommand.d.ts +68 -7
- package/build/commandUtils/EasCommand.js +60 -79
- package/build/commandUtils/context/ActorContextField.d.ts +5 -0
- package/build/commandUtils/context/ActorContextField.js +11 -0
- package/build/commandUtils/context/ContextField.d.ts +6 -0
- package/build/commandUtils/context/ContextField.js +5 -0
- package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +11 -0
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +27 -0
- package/build/commandUtils/context/OptionalProjectConfigContextField.d.ts +13 -0
- package/build/commandUtils/context/OptionalProjectConfigContextField.js +37 -0
- package/build/commandUtils/context/ProjectConfigContextField.d.ts +13 -0
- package/build/commandUtils/context/ProjectConfigContextField.js +23 -0
- package/build/commandUtils/context/ProjectDirContextField.d.ts +4 -0
- package/build/commandUtils/context/ProjectDirContextField.js +11 -0
- package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.d.ts +21 -0
- package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.js +75 -0
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.d.ts +17 -0
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +102 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +24 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +108 -0
- package/build/commandUtils/flags.d.ts +10 -0
- package/build/commandUtils/flags.js +23 -0
- package/build/commandUtils/pagination.d.ts +7 -4
- package/build/commandUtils/pagination.js +11 -15
- package/build/commands/account/login.d.ts +0 -2
- package/build/commands/account/login.js +2 -7
- package/build/commands/account/logout.d.ts +0 -2
- package/build/commands/account/logout.js +0 -5
- package/build/commands/account/view.d.ts +0 -2
- package/build/commands/account/view.js +0 -5
- package/build/commands/analytics.d.ts +0 -1
- package/build/commands/analytics.js +0 -4
- package/build/commands/branch/create.d.ts +4 -0
- package/build/commands/branch/create.js +18 -18
- package/build/commands/branch/delete.d.ts +4 -0
- package/build/commands/branch/delete.js +29 -26
- package/build/commands/branch/list.d.ts +5 -2
- package/build/commands/branch/list.js +13 -8
- package/build/commands/branch/rename.d.ts +5 -1
- package/build/commands/branch/rename.js +15 -13
- package/build/commands/branch/view.d.ts +5 -2
- package/build/commands/branch/view.js +31 -13
- package/build/commands/build/cancel.d.ts +7 -0
- package/build/commands/build/cancel.js +50 -23
- package/build/commands/build/configure.d.ts +3 -0
- package/build/commands/build/configure.js +12 -7
- package/build/commands/build/index.d.ts +7 -2
- package/build/commands/build/index.js +31 -23
- package/build/commands/build/inspect.d.ts +5 -0
- package/build/commands/build/inspect.js +12 -3
- package/build/commands/build/list.d.ts +7 -2
- package/build/commands/build/list.js +36 -59
- package/build/commands/build/version/set.d.ts +5 -0
- package/build/commands/build/version/set.js +22 -14
- package/build/commands/build/version/sync.d.ts +5 -0
- package/build/commands/build/version/sync.js +22 -13
- package/build/commands/build/view.d.ts +3 -0
- package/build/commands/build/view.js +20 -14
- package/build/commands/channel/create.d.ts +4 -0
- package/build/commands/channel/create.js +32 -25
- package/build/commands/channel/delete.d.ts +3 -0
- package/build/commands/channel/delete.js +36 -59
- package/build/commands/channel/edit.d.ts +7 -7
- package/build/commands/channel/edit.js +39 -72
- package/build/commands/channel/list.d.ts +6 -0
- package/build/commands/channel/list.js +20 -76
- package/build/commands/channel/rollout.d.ts +5 -1
- package/build/commands/channel/rollout.js +34 -35
- package/build/commands/channel/view.d.ts +6 -33
- package/build/commands/channel/view.js +31 -132
- package/build/commands/config.d.ts +6 -2
- package/build/commands/config.js +22 -13
- package/build/commands/credentials.d.ts +4 -0
- package/build/commands/credentials.js +10 -1
- package/build/commands/device/create.d.ts +4 -0
- package/build/commands/device/create.js +15 -3
- package/build/commands/device/delete.d.ts +13 -8
- package/build/commands/device/delete.js +81 -130
- package/build/commands/device/list.d.ts +7 -0
- package/build/commands/device/list.js +42 -63
- package/build/commands/device/view.d.ts +3 -0
- package/build/commands/device/view.js +10 -5
- package/build/commands/diagnostics.d.ts +3 -1
- package/build/commands/diagnostics.js +10 -8
- package/build/commands/metadata/pull.d.ts +4 -0
- package/build/commands/metadata/pull.js +13 -8
- package/build/commands/metadata/push.d.ts +4 -0
- package/build/commands/metadata/push.js +13 -8
- package/build/commands/open.d.ts +3 -0
- package/build/commands/open.js +11 -9
- package/build/commands/project/info.d.ts +3 -0
- package/build/commands/project/info.js +9 -6
- package/build/commands/project/init.d.ts +12 -0
- package/build/commands/project/init.js +155 -8
- package/build/commands/secret/create.d.ts +6 -0
- package/build/commands/secret/create.js +87 -30
- package/build/commands/secret/delete.d.ts +4 -0
- package/build/commands/secret/delete.js +28 -19
- package/build/commands/secret/list.d.ts +3 -0
- package/build/commands/secret/list.js +19 -13
- package/build/commands/submit.d.ts +5 -0
- package/build/commands/submit.js +16 -7
- package/build/commands/update/configure.d.ts +3 -0
- package/build/commands/update/configure.js +22 -16
- package/build/commands/update/delete.d.ts +1 -0
- package/build/commands/update/delete.js +4 -7
- package/build/commands/update/index.d.ts +8 -12
- package/build/commands/update/index.js +90 -166
- package/build/commands/update/list.d.ts +8 -2
- package/build/commands/update/list.js +51 -81
- package/build/commands/update/view.d.ts +0 -4
- package/build/commands/update/view.js +14 -51
- package/build/commands/webhook/create.d.ts +4 -0
- package/build/commands/webhook/create.js +10 -5
- package/build/commands/webhook/delete.d.ts +6 -0
- package/build/commands/webhook/delete.js +26 -14
- package/build/commands/webhook/list.d.ts +3 -0
- package/build/commands/webhook/list.js +13 -9
- package/build/commands/webhook/update.d.ts +1 -0
- package/build/commands/webhook/update.js +3 -1
- package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -6
- package/build/credentials/android/actions/CreateFcm.d.ts +2 -3
- package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/actions/CreateKeystore.d.ts +2 -3
- package/build/credentials/android/actions/CreateKeystore.js +1 -2
- package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/api/GraphqlClient.d.ts +6 -7
- package/build/credentials/context.d.ts +8 -4
- package/build/credentials/context.js +8 -23
- package/build/credentials/ios/IosCredentialsProvider.js +11 -6
- package/build/credentials/ios/actions/AppleTeamFormatting.d.ts +2 -0
- package/build/credentials/ios/actions/AppleTeamFormatting.js +7 -0
- package/build/credentials/ios/actions/AppleTeamUtils.d.ts +1 -2
- package/build/credentials/ios/actions/AppleTeamUtils.js +1 -5
- package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +3 -4
- package/build/credentials/ios/actions/AscApiKeyUtils.js +2 -2
- package/build/credentials/ios/actions/AssignAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/AssignPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/BuildCredentialsUtils.d.ts +3 -3
- package/build/credentials/ios/actions/BuildCredentialsUtils.js +8 -12
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/CreateAscApiKey.d.ts +2 -3
- package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +2 -2
- package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/CreatePushKey.d.ts +2 -3
- package/build/credentials/ios/actions/DeviceUtils.d.ts +0 -1
- package/build/credentials/ios/actions/DeviceUtils.js +3 -19
- package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +3 -4
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +2 -2
- package/build/credentials/ios/actions/PushKeyUtils.d.ts +2 -3
- package/build/credentials/ios/actions/PushKeyUtils.js +2 -2
- package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +2 -3
- package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -4
- package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/RemovePushKey.d.ts +2 -3
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.d.ts +1 -1
- package/build/credentials/ios/api/GraphqlClient.d.ts +9 -15
- package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.d.ts +2 -3
- package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.js +3 -1
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +3 -3
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +20 -6
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +8 -7
- package/build/credentials/ios/api/graphql/types/AppLookupParams.d.ts +7 -0
- package/build/credentials/ios/api/graphql/types/AppLookupParams.js +2 -0
- package/build/credentials/ios/types.d.ts +2 -3
- package/build/credentials/ios/utils/printCredentials.d.ts +1 -1
- package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +1 -1
- package/build/credentials/manager/HelperActions.d.ts +4 -1
- package/build/credentials/manager/ManageAndroid.js +4 -14
- package/build/credentials/manager/ManageIos.js +12 -15
- package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +1 -1
- package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -3
- package/build/credentials/manager/SelectPlatform.d.ts +5 -1
- package/build/credentials/manager/SelectPlatform.js +5 -3
- package/build/devices/actions/create/action.d.ts +2 -3
- package/build/devices/context.d.ts +3 -5
- package/build/devices/context.js +2 -11
- package/build/devices/manager.d.ts +4 -5
- package/build/devices/manager.js +9 -16
- package/build/devices/queries.d.ts +21 -0
- package/build/devices/queries.js +121 -0
- package/build/devices/utils/errors.d.ts +3 -0
- package/build/devices/utils/errors.js +9 -0
- package/build/devices/utils/formatDevice.d.ts +3 -3
- package/build/devices/utils/formatDevice.js +8 -3
- package/build/graphql/generated.d.ts +1101 -191
- package/build/graphql/generated.js +13 -2
- package/build/graphql/mutations/EnvironmentSecretMutation.d.ts +3 -1
- package/build/graphql/queries/AppQuery.d.ts +1 -0
- package/build/graphql/queries/AppQuery.js +19 -0
- package/build/graphql/queries/BranchQuery.d.ts +5 -6
- package/build/graphql/queries/BranchQuery.js +44 -3
- package/build/graphql/queries/BuildQuery.d.ts +2 -20
- package/build/graphql/queries/BuildQuery.js +2 -2
- package/build/graphql/queries/ChannelQuery.d.ts +5 -2
- package/build/graphql/queries/ChannelQuery.js +45 -19
- package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +5 -3
- package/build/graphql/queries/EnvironmentSecretsQuery.js +14 -28
- package/build/graphql/queries/UpdateQuery.d.ts +4 -6
- package/build/graphql/queries/UpdateQuery.js +59 -50
- package/build/graphql/queries/UserQuery.js +8 -1
- package/build/graphql/types/Account.d.ts +1 -0
- package/build/graphql/types/Account.js +17 -0
- package/build/graphql/types/App.js +7 -0
- package/build/graphql/types/EnvironmentSecret.d.ts +7 -0
- package/build/graphql/types/EnvironmentSecret.js +16 -1
- package/build/graphql/types/Update.d.ts +1 -0
- package/build/graphql/types/Update.js +30 -0
- package/build/graphql/types/UpdateBranch.js +4 -15
- package/build/metadata/context.d.ts +1 -1
- package/build/metadata/context.js +7 -9
- package/build/project/android/applicationId.d.ts +2 -1
- package/build/project/android/applicationId.js +7 -7
- package/build/project/android/versions.js +1 -1
- package/build/project/applicationIdentifier.d.ts +2 -1
- package/build/project/applicationIdentifier.js +2 -2
- package/build/project/expoConfig.d.ts +3 -3
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.d.ts +22 -0
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +93 -0
- package/build/project/ios/bundleIdentifier.d.ts +2 -1
- package/build/project/ios/bundleIdentifier.js +7 -7
- package/build/project/ios/scheme.d.ts +1 -1
- package/build/project/projectUtils.d.ts +4 -31
- package/build/project/projectUtils.js +13 -123
- package/build/project/remoteVersionSource.d.ts +2 -2
- package/build/project/remoteVersionSource.js +8 -7
- package/build/submit/android/ServiceAccountSource.js +1 -2
- package/build/submit/context.d.ts +3 -1
- package/build/submit/context.js +12 -14
- package/build/submit/ios/CredentialsServiceSource.js +1 -2
- package/build/submit/utils/builds.js +3 -1
- package/build/update/android/UpdatesModule.d.ts +1 -1
- package/build/update/android/UpdatesModule.js +2 -3
- package/build/update/ios/UpdatesModule.d.ts +1 -1
- package/build/update/ios/UpdatesModule.js +2 -3
- package/build/update/queries.d.ts +16 -1
- package/build/update/queries.js +96 -30
- package/build/update/utils.d.ts +21 -8
- package/build/update/utils.js +75 -14
- package/build/user/actions.d.ts +2 -8
- package/build/user/actions.js +4 -63
- package/build/utils/profiles.d.ts +3 -3
- package/build/utils/profiles.js +6 -5
- package/build/vcs/clients/git.d.ts +1 -1
- package/build/vcs/clients/git.js +1 -1
- package/build/vcs/vcs.d.ts +1 -1
- package/build/webhooks/input.d.ts +2 -1
- package/build/webhooks/input.js +10 -1
- package/oclif.manifest.json +1 -1
- package/package.json +4 -4
- package/build/project/ensureProjectExists.d.ts +0 -21
- package/build/project/ensureProjectExists.js +0 -88
- package/build/user/Account.d.ts +0 -3
- package/build/user/Account.js +0 -7
|
@@ -3,6 +3,12 @@ export default class ChannelList extends EasCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
limit: any;
|
|
8
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
9
|
+
};
|
|
10
|
+
static contextDefinition: {
|
|
11
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
6
12
|
};
|
|
7
13
|
runAsync(): Promise<void>;
|
|
8
14
|
}
|
|
@@ -1,93 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
5
|
-
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
5
|
+
const queries_1 = require("../../channel/queries");
|
|
6
6
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
10
|
-
const projectUtils_1 = require("../../project/projectUtils");
|
|
11
|
-
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
7
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
8
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
12
9
|
const json_1 = require("../../utils/json");
|
|
13
|
-
const view_1 = require("./view");
|
|
14
|
-
const CHANNEL_LIMIT = 10000;
|
|
15
|
-
async function getAllUpdateChannelForAppAsync({ appId, }) {
|
|
16
|
-
return await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
17
|
-
.query((0, graphql_tag_1.default) `
|
|
18
|
-
query GetAllChannelsForApp($appId: String!, $offset: Int!, $limit: Int!) {
|
|
19
|
-
app {
|
|
20
|
-
byId(appId: $appId) {
|
|
21
|
-
id
|
|
22
|
-
updateChannels(offset: $offset, limit: $limit) {
|
|
23
|
-
id
|
|
24
|
-
name
|
|
25
|
-
branchMapping
|
|
26
|
-
updateBranches(offset: 0, limit: $limit) {
|
|
27
|
-
id
|
|
28
|
-
name
|
|
29
|
-
updates(offset: 0, limit: 10) {
|
|
30
|
-
id
|
|
31
|
-
group
|
|
32
|
-
message
|
|
33
|
-
runtimeVersion
|
|
34
|
-
createdAt
|
|
35
|
-
platform
|
|
36
|
-
actor {
|
|
37
|
-
id
|
|
38
|
-
... on User {
|
|
39
|
-
username
|
|
40
|
-
}
|
|
41
|
-
... on Robot {
|
|
42
|
-
firstName
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
`, { appId, offset: 0, limit: CHANNEL_LIMIT }, { additionalTypenames: ['UpdateChannel', 'UpdateBranch', 'Update'] })
|
|
52
|
-
.toPromise());
|
|
53
|
-
}
|
|
54
10
|
class ChannelList extends EasCommand_1.default {
|
|
55
11
|
async runAsync() {
|
|
56
|
-
|
|
57
|
-
const
|
|
12
|
+
const { flags } = await this.parse(ChannelList);
|
|
13
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
14
|
+
const { json: jsonFlag, 'non-interactive': nonInteractive } = flags;
|
|
15
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(ChannelList, {
|
|
16
|
+
nonInteractive,
|
|
17
|
+
});
|
|
58
18
|
if (jsonFlag) {
|
|
59
19
|
(0, json_1.enableJsonOutput)();
|
|
60
20
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const getAllUpdateChannelForAppResult = await getAllUpdateChannelForAppAsync({
|
|
65
|
-
appId: projectId,
|
|
21
|
+
await (0, queries_1.listAndRenderChannelsOnAppAsync)({
|
|
22
|
+
projectId,
|
|
23
|
+
paginatedQueryOptions,
|
|
66
24
|
});
|
|
67
|
-
const channels = (_a = getAllUpdateChannelForAppResult.app) === null || _a === void 0 ? void 0 : _a.byId.updateChannels;
|
|
68
|
-
if (!channels) {
|
|
69
|
-
throw new Error(`Could not find channels on project with id ${projectId}`);
|
|
70
|
-
}
|
|
71
|
-
if (jsonFlag) {
|
|
72
|
-
(0, json_1.printJsonOnlyOutput)(channels);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
for (const channel of channels) {
|
|
76
|
-
log_1.default.addNewLineIfNone();
|
|
77
|
-
log_1.default.log((0, formatFields_1.default)([
|
|
78
|
-
{ label: 'Name', value: channel.name },
|
|
79
|
-
{ label: 'ID', value: channel.id },
|
|
80
|
-
]));
|
|
81
|
-
(0, view_1.logChannelDetails)(channel);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
25
|
}
|
|
85
26
|
}
|
|
86
27
|
exports.default = ChannelList;
|
|
28
|
+
_a = ChannelList;
|
|
87
29
|
ChannelList.description = 'list all channels';
|
|
88
30
|
ChannelList.flags = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
31
|
+
...pagination_1.EasPaginatedQueryFlags,
|
|
32
|
+
limit: (0, pagination_1.getLimitFlagWithCustomValues)({ defaultTo: 10, limit: queries_1.CHANNELS_LIMIT }),
|
|
33
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
34
|
+
};
|
|
35
|
+
ChannelList.contextDefinition = {
|
|
36
|
+
..._a.ContextOptions.ProjectConfig,
|
|
93
37
|
};
|
|
@@ -8,10 +8,14 @@ export default class ChannelRollout extends EasCommand {
|
|
|
8
8
|
description: string;
|
|
9
9
|
}[];
|
|
10
10
|
static flags: {
|
|
11
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
13
|
branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
14
|
percent: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
13
15
|
end: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
|
|
16
|
+
};
|
|
17
|
+
static contextDefinition: {
|
|
18
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
15
19
|
};
|
|
16
20
|
runAsync(): Promise<void>;
|
|
17
21
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const utils_1 = require("../../channel/utils");
|
|
6
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
9
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
10
|
const BranchQuery_1 = require("../../graphql/queries/BranchQuery");
|
|
8
11
|
const ChannelQuery_1 = require("../../graphql/queries/ChannelQuery");
|
|
9
12
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
11
13
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
12
14
|
const prompts_1 = require("../../prompts");
|
|
13
15
|
const json_1 = require("../../utils/json");
|
|
14
16
|
const edit_1 = require("./edit");
|
|
15
|
-
const view_1 = require("./view");
|
|
16
17
|
async function promptForRolloutPercentAsync({ promptMessage, }) {
|
|
17
18
|
const { name: rolloutPercent } = await (0, prompts_1.promptAsync)({
|
|
18
19
|
type: 'text',
|
|
@@ -32,7 +33,7 @@ async function promptForRolloutPercentAsync({ promptMessage, }) {
|
|
|
32
33
|
return rolloutPercent;
|
|
33
34
|
}
|
|
34
35
|
function getRolloutInfo(channel) {
|
|
35
|
-
const { branchMapping } = (0,
|
|
36
|
+
const { branchMapping } = (0, utils_1.getBranchMapping)(channel.branchMapping);
|
|
36
37
|
const [newBranchId, oldBranchId] = branchMapping.data.map(d => d.branchId);
|
|
37
38
|
const newBranch = channel.updateBranches.filter(branch => branch.id === newBranchId)[0];
|
|
38
39
|
const oldBranch = channel.updateBranches.filter(branch => branch.id === oldBranchId)[0];
|
|
@@ -42,21 +43,18 @@ function getRolloutInfo(channel) {
|
|
|
42
43
|
const currentPercent = 100 * branchMapping.data[0].branchMappingLogic.operand;
|
|
43
44
|
return { newBranch, oldBranch, currentPercent };
|
|
44
45
|
}
|
|
45
|
-
async function startRolloutAsync({ channelName, branchName, percent,
|
|
46
|
+
async function startRolloutAsync({ channelName, branchName, percent, projectId, displayName, currentBranchMapping, channel, nonInteractive, }) {
|
|
46
47
|
const branch = await BranchQuery_1.BranchQuery.getBranchByNameAsync({
|
|
47
48
|
appId: projectId,
|
|
48
49
|
name: branchName,
|
|
49
50
|
});
|
|
50
|
-
if (!branch) {
|
|
51
|
-
throw new Error(`Could not find a branch named "${branchName}". Check which branches exist on this project with ${chalk_1.default.bold('eas branch:list')}.`);
|
|
52
|
-
}
|
|
53
51
|
const oldBranchId = currentBranchMapping.data[0].branchId;
|
|
54
52
|
if (branch.id === oldBranchId) {
|
|
55
53
|
throw new Error(`channel "${channelName}" is already pointing at branch "${branchName}". Rollouts must be done with distinct branches.`);
|
|
56
54
|
}
|
|
57
55
|
if (percent == null) {
|
|
58
|
-
if (
|
|
59
|
-
throw new Error('You must specify a percent with the --percent flag when initiating a rollout with the --
|
|
56
|
+
if (nonInteractive) {
|
|
57
|
+
throw new Error('You must specify a percent with the --percent flag when initiating a rollout with the --non-interactive flag.');
|
|
60
58
|
}
|
|
61
59
|
const promptMessage = `What percent of users should be directed to the branch "${branchName}"?`;
|
|
62
60
|
percent = await promptForRolloutPercentAsync({ promptMessage });
|
|
@@ -81,15 +79,15 @@ async function startRolloutAsync({ channelName, branchName, percent, jsonFlag, p
|
|
|
81
79
|
});
|
|
82
80
|
const oldBranch = channel.updateBranches.filter(branch => branch.id === oldBranchId)[0];
|
|
83
81
|
if (!oldBranch) {
|
|
84
|
-
throw new Error(`Branch mapping is missing its only branch for channel "${channelName}" on app "${
|
|
82
|
+
throw new Error(`Branch mapping is missing its only branch for channel "${channelName}" on app "${displayName}"`);
|
|
85
83
|
}
|
|
86
84
|
const logMessage = `️Started a rollout of branch ${chalk_1.default.bold(branchName)} onto channel ${chalk_1.default.bold(channelName)}! ${chalk_1.default.bold(percent)}% of users will be directed to branch ${chalk_1.default.bold(branchName)}, ${chalk_1.default.bold(100 - percent)}% to branch ${chalk_1.default.bold(oldBranch.name)}.`;
|
|
87
85
|
return { newChannelInfo, logMessage };
|
|
88
86
|
}
|
|
89
|
-
async function editRolloutAsync({ channelName, percent,
|
|
87
|
+
async function editRolloutAsync({ channelName, percent, nonInteractive, currentBranchMapping, channel, }) {
|
|
90
88
|
const { newBranch, oldBranch, currentPercent } = getRolloutInfo(channel);
|
|
91
89
|
if (percent == null) {
|
|
92
|
-
if (
|
|
90
|
+
if (nonInteractive) {
|
|
93
91
|
throw new Error('A rollout is already in progress. If you wish to modify it you must use specify the new rollout percentage with the --percent flag.');
|
|
94
92
|
}
|
|
95
93
|
const promptMessage = `Currently ${currentPercent}% of all users are routed to branch ${newBranch.name} and ${100 - currentPercent}% of all users are routed to branch ${oldBranch.name}. What percent of users should be directed to the branch ${newBranch.name}?`;
|
|
@@ -104,7 +102,7 @@ async function editRolloutAsync({ channelName, percent, jsonFlag, currentBranchM
|
|
|
104
102
|
const logMessage = `️Rollout of branch ${chalk_1.default.bold(newBranch.name)} onto channel ${chalk_1.default.bold(channelName)} updated from ${chalk_1.default.bold(currentPercent)}% to ${chalk_1.default.bold(percent)}%. ${chalk_1.default.bold(percent)}% of users will be directed to branch ${chalk_1.default.bold(newBranch.name)}, ${chalk_1.default.bold(100 - percent)}% to branch ${chalk_1.default.bold(oldBranch.name)}.`;
|
|
105
103
|
return { newChannelInfo, logMessage };
|
|
106
104
|
}
|
|
107
|
-
async function endRolloutAsync({ channelName, branchName,
|
|
105
|
+
async function endRolloutAsync({ channelName, branchName, nonInteractive, projectId, channel, }) {
|
|
108
106
|
// end rollout
|
|
109
107
|
const { newBranch, oldBranch, currentPercent } = getRolloutInfo(channel);
|
|
110
108
|
let endOnNewBranch;
|
|
@@ -113,9 +111,6 @@ async function endRolloutAsync({ channelName, branchName, jsonFlag, projectId, c
|
|
|
113
111
|
appId: projectId,
|
|
114
112
|
name: branchName,
|
|
115
113
|
});
|
|
116
|
-
if (!branch) {
|
|
117
|
-
throw new Error(`Could not find a branch named "${branchName}". Check which branches exist on this project with ${chalk_1.default.bold('eas branch:list')}.`);
|
|
118
|
-
}
|
|
119
114
|
switch (branch.id) {
|
|
120
115
|
case newBranch.id:
|
|
121
116
|
endOnNewBranch = true;
|
|
@@ -128,8 +123,8 @@ async function endRolloutAsync({ channelName, branchName, jsonFlag, projectId, c
|
|
|
128
123
|
}
|
|
129
124
|
}
|
|
130
125
|
else {
|
|
131
|
-
if (
|
|
132
|
-
throw new Error('Branch name must be specified with the --branch flag when both the --end and --
|
|
126
|
+
if (nonInteractive) {
|
|
127
|
+
throw new Error('Branch name must be specified with the --branch flag when both the --end and --non-interactive flag are true.');
|
|
133
128
|
}
|
|
134
129
|
endOnNewBranch = await (0, prompts_1.selectAsync)('Ending the rollout will send all traffic to a single branch. Which one should that be?', [
|
|
135
130
|
{
|
|
@@ -163,22 +158,22 @@ async function endRolloutAsync({ channelName, branchName, jsonFlag, projectId, c
|
|
|
163
158
|
}
|
|
164
159
|
class ChannelRollout extends EasCommand_1.default {
|
|
165
160
|
async runAsync() {
|
|
166
|
-
const { args: { channel: channelName }, flags: { json: jsonFlag, end: endFlag, branch: branchName, percent }, } = await this.parse(ChannelRollout);
|
|
161
|
+
const { args: { channel: channelName }, flags: { json: jsonFlag, end: endFlag, branch: branchName, percent, 'non-interactive': nonInteractive, }, } = await this.parse(ChannelRollout);
|
|
162
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(ChannelRollout, {
|
|
163
|
+
nonInteractive,
|
|
164
|
+
});
|
|
167
165
|
if (jsonFlag) {
|
|
168
166
|
(0, json_1.enableJsonOutput)();
|
|
169
167
|
}
|
|
170
|
-
const
|
|
171
|
-
const
|
|
172
|
-
const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
|
|
173
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
174
|
-
const channel = await ChannelQuery_1.ChannelQuery.getUpdateChannelByNameForAppAsync({
|
|
168
|
+
const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
|
|
169
|
+
const channel = await ChannelQuery_1.ChannelQuery.viewUpdateChannelAsync({
|
|
175
170
|
appId: projectId,
|
|
176
171
|
channelName: channelName,
|
|
177
172
|
});
|
|
178
173
|
if (!channel) {
|
|
179
174
|
throw new Error(`Could not find a channel named "${channelName}". Check which channels exist on this project with ${chalk_1.default.bold('eas channel:list')}.`);
|
|
180
175
|
}
|
|
181
|
-
const { branchMapping: currentBranchMapping, isRollout } = (0,
|
|
176
|
+
const { branchMapping: currentBranchMapping, isRollout } = (0, utils_1.getBranchMapping)(channel.branchMapping);
|
|
182
177
|
if (currentBranchMapping.data.length === 0) {
|
|
183
178
|
throw new Error('The channel is not pointing at any branches.');
|
|
184
179
|
}
|
|
@@ -200,11 +195,11 @@ class ChannelRollout extends EasCommand_1.default {
|
|
|
200
195
|
if (!isRollout) {
|
|
201
196
|
rolloutMutationResult = await startRolloutAsync({
|
|
202
197
|
channelName,
|
|
203
|
-
branchName: branchName !== null && branchName !== void 0 ? branchName : (await promptForBranchNameAsync(channelName)),
|
|
198
|
+
branchName: branchName !== null && branchName !== void 0 ? branchName : (await promptForBranchNameAsync(channelName, nonInteractive)),
|
|
204
199
|
percent,
|
|
205
|
-
|
|
200
|
+
nonInteractive,
|
|
206
201
|
projectId,
|
|
207
|
-
|
|
202
|
+
displayName: projectDisplayName,
|
|
208
203
|
currentBranchMapping,
|
|
209
204
|
channel,
|
|
210
205
|
});
|
|
@@ -213,7 +208,7 @@ class ChannelRollout extends EasCommand_1.default {
|
|
|
213
208
|
rolloutMutationResult = await endRolloutAsync({
|
|
214
209
|
channelName,
|
|
215
210
|
branchName,
|
|
216
|
-
|
|
211
|
+
nonInteractive,
|
|
217
212
|
projectId,
|
|
218
213
|
channel,
|
|
219
214
|
});
|
|
@@ -222,7 +217,7 @@ class ChannelRollout extends EasCommand_1.default {
|
|
|
222
217
|
rolloutMutationResult = await editRolloutAsync({
|
|
223
218
|
channelName,
|
|
224
219
|
percent,
|
|
225
|
-
|
|
220
|
+
nonInteractive,
|
|
226
221
|
currentBranchMapping,
|
|
227
222
|
channel,
|
|
228
223
|
});
|
|
@@ -240,6 +235,7 @@ class ChannelRollout extends EasCommand_1.default {
|
|
|
240
235
|
}
|
|
241
236
|
}
|
|
242
237
|
exports.default = ChannelRollout;
|
|
238
|
+
_a = ChannelRollout;
|
|
243
239
|
ChannelRollout.hidden = true;
|
|
244
240
|
ChannelRollout.description = 'Rollout a new branch out to a channel incrementally.';
|
|
245
241
|
ChannelRollout.args = [
|
|
@@ -262,12 +258,15 @@ ChannelRollout.flags = {
|
|
|
262
258
|
description: 'end the rollout',
|
|
263
259
|
default: false,
|
|
264
260
|
}),
|
|
265
|
-
|
|
266
|
-
description: 'print output as a JSON object with the new channel ID, name and branch mapping',
|
|
267
|
-
default: false,
|
|
268
|
-
}),
|
|
261
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
269
262
|
};
|
|
270
|
-
|
|
263
|
+
ChannelRollout.contextDefinition = {
|
|
264
|
+
..._a.ContextOptions.ProjectConfig,
|
|
265
|
+
};
|
|
266
|
+
async function promptForBranchNameAsync(channelName, nonInteractive) {
|
|
267
|
+
if (nonInteractive) {
|
|
268
|
+
throw new Error('Must supply branch flag in non-interactive mode');
|
|
269
|
+
}
|
|
271
270
|
const { name } = await (0, prompts_1.promptAsync)({
|
|
272
271
|
type: 'text',
|
|
273
272
|
name: 'name',
|
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import { FormatUpdateParameter } from '../../update/utils';
|
|
3
|
-
export declare type BranchMapping = {
|
|
4
|
-
version: number;
|
|
5
|
-
data: {
|
|
6
|
-
branchId: string;
|
|
7
|
-
branchMappingLogic: {
|
|
8
|
-
operand: number;
|
|
9
|
-
clientKey: string;
|
|
10
|
-
branchMappingOperator: string;
|
|
11
|
-
} & string;
|
|
12
|
-
}[];
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Get the branch mapping and determine whether it is a rollout.
|
|
16
|
-
* Ensure that the branch mapping is properly formatted.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getBranchMapping(branchMappingString?: string): {
|
|
19
|
-
branchMapping: BranchMapping;
|
|
20
|
-
isRollout: boolean;
|
|
21
|
-
rolloutPercent?: number;
|
|
22
|
-
};
|
|
23
|
-
export declare function logChannelDetails(channel: {
|
|
24
|
-
branchMapping: string;
|
|
25
|
-
updateBranches: {
|
|
26
|
-
updates: (FormatUpdateParameter & {
|
|
27
|
-
runtimeVersion: string;
|
|
28
|
-
group: string;
|
|
29
|
-
platform: string;
|
|
30
|
-
})[];
|
|
31
|
-
name: string;
|
|
32
|
-
id: string;
|
|
33
|
-
}[];
|
|
34
|
-
}): void;
|
|
35
2
|
export default class ChannelView extends EasCommand {
|
|
36
3
|
static description: string;
|
|
37
4
|
static args: {
|
|
@@ -40,7 +7,13 @@ export default class ChannelView extends EasCommand {
|
|
|
40
7
|
description: string;
|
|
41
8
|
}[];
|
|
42
9
|
static flags: {
|
|
10
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
11
|
+
limit: any;
|
|
43
12
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
static contextDefinition: {
|
|
16
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
44
17
|
};
|
|
45
18
|
runAsync(): Promise<void>;
|
|
46
19
|
}
|
|
@@ -1,152 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logChannelDetails = exports.getBranchMapping = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@oclif/core");
|
|
6
5
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
7
|
-
const
|
|
8
|
-
const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
|
|
6
|
+
const queries_1 = require("../../channel/queries");
|
|
9
7
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
13
|
-
const projectUtils_1 = require("../../project/projectUtils");
|
|
14
|
-
const prompts_1 = require("../../prompts");
|
|
15
|
-
const utils_1 = require("../../update/utils");
|
|
16
|
-
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
8
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
9
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
17
10
|
const json_1 = require("../../utils/json");
|
|
18
|
-
/**
|
|
19
|
-
* Get the branch mapping and determine whether it is a rollout.
|
|
20
|
-
* Ensure that the branch mapping is properly formatted.
|
|
21
|
-
*/
|
|
22
|
-
function getBranchMapping(branchMappingString) {
|
|
23
|
-
if (!branchMappingString) {
|
|
24
|
-
throw new Error('Missing branch mapping.');
|
|
25
|
-
}
|
|
26
|
-
let branchMapping;
|
|
27
|
-
try {
|
|
28
|
-
branchMapping = JSON.parse(branchMappingString);
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
throw new Error(`Could not parse branchMapping string into a JSON: "${branchMappingString}"`);
|
|
32
|
-
}
|
|
33
|
-
(0, assert_1.default)(branchMapping, 'Branch Mapping must be defined.');
|
|
34
|
-
if (branchMapping.version !== 0) {
|
|
35
|
-
throw new Error('Branch mapping must be version 0.');
|
|
36
|
-
}
|
|
37
|
-
const isRollout = branchMapping.data.length === 2;
|
|
38
|
-
const rolloutPercent = branchMapping.data[0].branchMappingLogic.operand;
|
|
39
|
-
switch (branchMapping.data.length) {
|
|
40
|
-
case 0:
|
|
41
|
-
break;
|
|
42
|
-
case 1:
|
|
43
|
-
if (branchMapping.data[0].branchMappingLogic !== 'true') {
|
|
44
|
-
throw new Error('Branch mapping logic for a single branch must be "true"');
|
|
45
|
-
}
|
|
46
|
-
break;
|
|
47
|
-
case 2:
|
|
48
|
-
if (branchMapping.data[0].branchMappingLogic.clientKey !== 'rolloutToken') {
|
|
49
|
-
throw new Error('Client key of initial branch mapping must be "rolloutToken"');
|
|
50
|
-
}
|
|
51
|
-
if (branchMapping.data[0].branchMappingLogic.branchMappingOperator !== 'hash_lt') {
|
|
52
|
-
throw new Error('Branch mapping operator of initial branch mapping must be "hash_lt"');
|
|
53
|
-
}
|
|
54
|
-
if (rolloutPercent == null) {
|
|
55
|
-
throw new Error('Branch mapping is missing a "rolloutPercent"');
|
|
56
|
-
}
|
|
57
|
-
if (branchMapping.data[1].branchMappingLogic !== 'true') {
|
|
58
|
-
throw new Error('Branch mapping logic for a the second branch of a rollout must be "true"');
|
|
59
|
-
}
|
|
60
|
-
break;
|
|
61
|
-
default:
|
|
62
|
-
throw new Error('Branch mapping data must have length less than or equal to 2.');
|
|
63
|
-
}
|
|
64
|
-
return { branchMapping, isRollout, rolloutPercent };
|
|
65
|
-
}
|
|
66
|
-
exports.getBranchMapping = getBranchMapping;
|
|
67
|
-
function logChannelDetails(channel) {
|
|
68
|
-
var _a, _b, _c;
|
|
69
|
-
const { branchMapping, isRollout, rolloutPercent } = getBranchMapping(channel.branchMapping);
|
|
70
|
-
const table = new cli_table3_1.default({
|
|
71
|
-
head: ['branch', ...(isRollout ? ['rollout percent'] : []), ...utils_1.UPDATE_COLUMNS],
|
|
72
|
-
wordWrap: true,
|
|
73
|
-
});
|
|
74
|
-
for (const index in branchMapping.data) {
|
|
75
|
-
if (parseInt(index, 10) > 1) {
|
|
76
|
-
throw new Error('Branch Mapping data must have length less than or equal to 2.');
|
|
77
|
-
}
|
|
78
|
-
const { branchId } = branchMapping.data[index];
|
|
79
|
-
const branch = channel.updateBranches.filter(branch => branch.id === branchId)[0];
|
|
80
|
-
if (!branch) {
|
|
81
|
-
throw new Error('Branch mapping is pointing at a missing branch.');
|
|
82
|
-
}
|
|
83
|
-
const update = branch.updates[0];
|
|
84
|
-
table.push([
|
|
85
|
-
branch.name,
|
|
86
|
-
...(isRollout
|
|
87
|
-
? [
|
|
88
|
-
parseInt(index, 10) === 0
|
|
89
|
-
? `${rolloutPercent * 100}%`
|
|
90
|
-
: `${(1 - rolloutPercent) * 100}%`,
|
|
91
|
-
]
|
|
92
|
-
: []),
|
|
93
|
-
(0, utils_1.formatUpdate)(update),
|
|
94
|
-
(_a = update === null || update === void 0 ? void 0 : update.runtimeVersion) !== null && _a !== void 0 ? _a : 'N/A',
|
|
95
|
-
(_b = update === null || update === void 0 ? void 0 : update.group) !== null && _b !== void 0 ? _b : 'N/A',
|
|
96
|
-
(0, utils_1.getPlatformsForGroup)({
|
|
97
|
-
updates: branch.updates,
|
|
98
|
-
group: (_c = branch.updates[0]) === null || _c === void 0 ? void 0 : _c.group,
|
|
99
|
-
}),
|
|
100
|
-
]);
|
|
101
|
-
}
|
|
102
|
-
log_1.default.log(table.toString());
|
|
103
|
-
}
|
|
104
|
-
exports.logChannelDetails = logChannelDetails;
|
|
105
11
|
class ChannelView extends EasCommand_1.default {
|
|
106
12
|
async runAsync() {
|
|
107
|
-
let { args: { name: channelName }, flags
|
|
13
|
+
let { args: { name: channelName }, flags, } = await this.parse(ChannelView);
|
|
14
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
15
|
+
const { json: jsonFlag, 'non-interactive': nonInteractive } = flags;
|
|
16
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(ChannelView, {
|
|
17
|
+
nonInteractive,
|
|
18
|
+
});
|
|
108
19
|
if (jsonFlag) {
|
|
109
20
|
(0, json_1.enableJsonOutput)();
|
|
110
21
|
}
|
|
111
|
-
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
112
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
113
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
114
22
|
if (!channelName) {
|
|
115
23
|
const validationMessage = 'A channel name is required to view a specific channel.';
|
|
116
|
-
if (
|
|
24
|
+
if (nonInteractive) {
|
|
117
25
|
throw new Error(validationMessage);
|
|
118
26
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
27
|
+
const selectedUpdateChannel = await (0, queries_1.selectChannelOnAppAsync)({
|
|
28
|
+
projectId,
|
|
29
|
+
selectionPromptTitle: 'Select a channel to view',
|
|
30
|
+
paginatedQueryOptions: {
|
|
31
|
+
json: jsonFlag,
|
|
32
|
+
nonInteractive,
|
|
33
|
+
offset: 0,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
channelName = selectedUpdateChannel.name;
|
|
37
|
+
(0, assert_1.default)(channelName, `A channel must be selected.`);
|
|
125
38
|
}
|
|
126
|
-
|
|
127
|
-
|
|
39
|
+
await (0, queries_1.listAndRenderBranchesAndUpdatesOnChannelAsync)({
|
|
40
|
+
projectId,
|
|
128
41
|
channelName,
|
|
42
|
+
paginatedQueryOptions,
|
|
129
43
|
});
|
|
130
|
-
if (!channel) {
|
|
131
|
-
throw new Error(`Could not find a channel with name: ${channelName}`);
|
|
132
|
-
}
|
|
133
|
-
if (jsonFlag) {
|
|
134
|
-
(0, json_1.printJsonOnlyOutput)(channel);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
log_1.default.addNewLineIfNone();
|
|
138
|
-
log_1.default.log(chalk_1.default.bold('Channel:'));
|
|
139
|
-
log_1.default.log((0, formatFields_1.default)([
|
|
140
|
-
{ label: 'Name', value: channel.name },
|
|
141
|
-
{ label: 'ID', value: channel.id },
|
|
142
|
-
]));
|
|
143
|
-
log_1.default.addNewLineIfNone();
|
|
144
|
-
log_1.default.log((0, chalk_1.default) `{bold Branches pointed at this channel and their most recent update group:}`);
|
|
145
|
-
logChannelDetails(channel);
|
|
146
|
-
}
|
|
147
44
|
}
|
|
148
45
|
}
|
|
149
46
|
exports.default = ChannelView;
|
|
47
|
+
_a = ChannelView;
|
|
150
48
|
ChannelView.description = 'view a channel';
|
|
151
49
|
ChannelView.args = [
|
|
152
50
|
{
|
|
@@ -156,8 +54,9 @@ ChannelView.args = [
|
|
|
156
54
|
},
|
|
157
55
|
];
|
|
158
56
|
ChannelView.flags = {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
57
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
58
|
+
...pagination_1.EasPaginatedQueryFlags,
|
|
59
|
+
};
|
|
60
|
+
ChannelView.contextDefinition = {
|
|
61
|
+
..._a.ContextOptions.ProjectConfig,
|
|
163
62
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { Platform } from '@expo/eas-build-job';
|
|
1
2
|
import EasCommand from '../commandUtils/EasCommand';
|
|
2
3
|
export default class Config extends EasCommand {
|
|
3
4
|
static description: string;
|
|
4
5
|
static flags: {
|
|
5
|
-
platform: import("@oclif/core/lib/interfaces").OptionFlag<
|
|
6
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<Platform>;
|
|
6
7
|
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
static contextDefinition: {
|
|
10
|
+
projectDir: import("../commandUtils/context/ProjectDirContextField").default;
|
|
11
|
+
getDynamicProjectConfigAsync: import("../commandUtils/context/DynamicProjectConfigContextField").DynamicProjectConfigContextField;
|
|
12
|
+
};
|
|
9
13
|
runAsync(): Promise<void>;
|
|
10
14
|
}
|