eas-cli 2.0.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 +8 -1034
- package/build/branch/queries.d.ts +10 -2
- package/build/branch/queries.js +27 -24
- 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/graphql.js +2 -1
- package/build/build/android/prepareJob.js +4 -3
- 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/graphql.js +2 -1
- package/build/build/ios/prepareJob.js +4 -3
- 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 +77 -15
- 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 -129
- 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 +8 -0
- package/build/commands/open.js +42 -0
- 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 +24 -18
- package/build/commands/update/delete.d.ts +1 -0
- package/build/commands/update/delete.js +5 -8
- 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 +4 -2
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +5 -2
- 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 +4 -2
- package/build/credentials/ios/actions/CreateProvisioningProfile.js +3 -2
- 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/ProvisioningProfileUtils.d.ts +2 -1
- package/build/credentials/ios/actions/ProvisioningProfileUtils.js +4 -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 +9 -3
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +30 -18
- package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpBuildCredentials.js +1 -0
- package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +9 -3
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.js +6 -12
- package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +4 -2
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +8 -5
- 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 +3 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +5 -5
- 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/appstore/AppStoreApi.d.ts +7 -4
- package/build/credentials/ios/appstore/AppStoreApi.js +8 -8
- package/build/credentials/ios/appstore/Credentials.types.d.ts +0 -14
- package/build/credentials/ios/appstore/Credentials.types.js +0 -6
- package/build/credentials/ios/appstore/constants.d.ts +1 -0
- package/build/credentials/ios/appstore/constants.js +6 -0
- package/build/credentials/ios/appstore/distributionCertificate.js +1 -1
- package/build/credentials/ios/appstore/provisioningProfile.d.ts +5 -3
- package/build/credentials/ios/appstore/provisioningProfile.js +30 -7
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.d.ts +3 -1
- package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +10 -10
- 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 +3 -2
- package/build/credentials/ios/validators/validateProvisioningProfile.js +6 -4
- package/build/credentials/manager/HelperActions.d.ts +4 -1
- package/build/credentials/manager/ManageAndroid.js +4 -14
- package/build/credentials/manager/ManageIos.js +20 -20
- 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/actions/create/developerPortalMethod.js +2 -2
- 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 +1141 -192
- 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/ios/target.d.ts +7 -0
- package/build/project/ios/target.js +26 -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/project/workflow.js +3 -1
- 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 +5 -2
- package/build/vcs/clients/gitNoCommit.js +2 -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 +6 -5
- 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
package/build/commands/config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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 config_1 = require("@expo/config");
|
|
@@ -10,20 +11,16 @@ const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand
|
|
|
10
11
|
const AppPlatform_1 = require("../graphql/types/AppPlatform");
|
|
11
12
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
12
13
|
const platform_1 = require("../platform");
|
|
13
|
-
const expoConfig_1 = require("../project/expoConfig");
|
|
14
|
-
const projectUtils_1 = require("../project/projectUtils");
|
|
15
14
|
const prompts_1 = require("../prompts");
|
|
16
15
|
class Config extends EasCommand_1.default {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.requiresAuthentication = false;
|
|
20
|
-
}
|
|
21
16
|
async runAsync() {
|
|
22
17
|
const { flags } = await this.parse(Config);
|
|
23
18
|
const { platform: maybePlatform, profile: maybeProfile } = flags;
|
|
24
|
-
const projectDir = await (
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
const { getDynamicProjectConfigAsync, projectDir } = await this.getContextAsync(Config, {
|
|
20
|
+
nonInteractive: false,
|
|
21
|
+
});
|
|
22
|
+
const accessor = new eas_json_1.EasJsonAccessor(projectDir);
|
|
23
|
+
const profileName = maybeProfile !== null && maybeProfile !== void 0 ? maybeProfile : (await (0, prompts_1.selectAsync)('Select build profile', (await eas_json_1.EasJsonUtils.getBuildProfileNamesAsync(accessor)).map(profileName => ({
|
|
27
24
|
title: profileName,
|
|
28
25
|
value: profileName,
|
|
29
26
|
}))));
|
|
@@ -37,8 +34,11 @@ class Config extends EasCommand_1.default {
|
|
|
37
34
|
value: eas_build_job_1.Platform.IOS,
|
|
38
35
|
},
|
|
39
36
|
]));
|
|
40
|
-
const profile = await
|
|
41
|
-
const config =
|
|
37
|
+
const profile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(accessor, platform, profileName);
|
|
38
|
+
const { exp: config } = await getDynamicProjectConfigAsync({
|
|
39
|
+
env: profile.env,
|
|
40
|
+
isPublicConfig: true,
|
|
41
|
+
});
|
|
42
42
|
log_1.default.addNewLineIfNone();
|
|
43
43
|
log_1.default.log(chalk_1.default.bold((0, config_1.getProjectConfigDescription)(projectDir)));
|
|
44
44
|
log_1.default.newLine();
|
|
@@ -53,8 +53,17 @@ class Config extends EasCommand_1.default {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
exports.default = Config;
|
|
56
|
+
_a = Config;
|
|
56
57
|
Config.description = 'display project configuration (app.json + eas.json)';
|
|
57
58
|
Config.flags = {
|
|
58
|
-
platform: core_1.Flags.enum({ char: 'p', options: [
|
|
59
|
-
profile: core_1.Flags.string(
|
|
59
|
+
platform: core_1.Flags.enum({ char: 'p', options: [eas_build_job_1.Platform.ANDROID, eas_build_job_1.Platform.IOS] }),
|
|
60
|
+
profile: core_1.Flags.string({
|
|
61
|
+
char: 'e',
|
|
62
|
+
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
63
|
+
helpValue: 'PROFILE_NAME',
|
|
64
|
+
}),
|
|
65
|
+
};
|
|
66
|
+
Config.contextDefinition = {
|
|
67
|
+
..._a.ContextOptions.DynamicProjectConfig,
|
|
68
|
+
..._a.ContextOptions.ProjectDir,
|
|
60
69
|
};
|
|
@@ -4,5 +4,9 @@ export default class Credentials extends EasCommand {
|
|
|
4
4
|
static flags: {
|
|
5
5
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
6
|
};
|
|
7
|
+
static contextDefinition: {
|
|
8
|
+
projectConfig: import("../commandUtils/context/OptionalProjectConfigContextField").OptionalProjectConfigContextField;
|
|
9
|
+
actor: import("../commandUtils/context/ActorContextField").default;
|
|
10
|
+
};
|
|
7
11
|
runAsync(): Promise<void>;
|
|
8
12
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
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");
|
|
@@ -7,11 +8,19 @@ const SelectPlatform_1 = require("../credentials/manager/SelectPlatform");
|
|
|
7
8
|
class Credentials extends EasCommand_1.default {
|
|
8
9
|
async runAsync() {
|
|
9
10
|
const { flags } = await this.parse(Credentials);
|
|
10
|
-
await
|
|
11
|
+
const { actor, projectConfig } = await this.getContextAsync(Credentials, {
|
|
12
|
+
nonInteractive: false,
|
|
13
|
+
});
|
|
14
|
+
await new SelectPlatform_1.SelectPlatform(actor, projectConfig !== null && projectConfig !== void 0 ? projectConfig : null, flags.platform).runAsync();
|
|
11
15
|
}
|
|
12
16
|
}
|
|
13
17
|
exports.default = Credentials;
|
|
18
|
+
_a = Credentials;
|
|
14
19
|
Credentials.description = 'manage credentials';
|
|
15
20
|
Credentials.flags = {
|
|
16
21
|
platform: core_1.Flags.enum({ char: 'p', options: ['android', 'ios'] }),
|
|
17
22
|
};
|
|
23
|
+
Credentials.contextDefinition = {
|
|
24
|
+
..._a.ContextOptions.LoggedIn,
|
|
25
|
+
..._a.ContextOptions.OptionalProjectConfig,
|
|
26
|
+
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
export default class DeviceCreate extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
|
+
static contextDefinition: {
|
|
5
|
+
projectConfig: import("../../commandUtils/context/OptionalProjectConfigContextField").OptionalProjectConfigContextField;
|
|
6
|
+
actor: import("../../commandUtils/context/ActorContextField").default;
|
|
7
|
+
};
|
|
4
8
|
runAsync(): Promise<void>;
|
|
5
9
|
}
|
|
@@ -1,18 +1,30 @@
|
|
|
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 EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
5
6
|
const AppStoreApi_1 = tslib_1.__importDefault(require("../../credentials/ios/appstore/AppStoreApi"));
|
|
6
7
|
const context_1 = require("../../devices/context");
|
|
7
8
|
const manager_1 = tslib_1.__importDefault(require("../../devices/manager"));
|
|
8
|
-
const actions_1 = require("../../user/actions");
|
|
9
9
|
class DeviceCreate extends EasCommand_1.default {
|
|
10
10
|
async runAsync() {
|
|
11
|
-
|
|
12
|
-
const
|
|
11
|
+
// this command is interactive by design
|
|
12
|
+
const { actor, projectConfig } = await this.getContextAsync(DeviceCreate, {
|
|
13
|
+
nonInteractive: false,
|
|
14
|
+
});
|
|
15
|
+
const ctx = await (0, context_1.createContextAsync)({
|
|
16
|
+
appStore: new AppStoreApi_1.default(),
|
|
17
|
+
user: actor,
|
|
18
|
+
projectId: projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.projectId,
|
|
19
|
+
});
|
|
13
20
|
const manager = new manager_1.default(ctx);
|
|
14
21
|
await manager.createAsync();
|
|
15
22
|
}
|
|
16
23
|
}
|
|
17
24
|
exports.default = DeviceCreate;
|
|
25
|
+
_a = DeviceCreate;
|
|
18
26
|
DeviceCreate.description = 'register new Apple Devices to use for internal distribution';
|
|
27
|
+
DeviceCreate.contextDefinition = {
|
|
28
|
+
..._a.ContextOptions.LoggedIn,
|
|
29
|
+
..._a.ContextOptions.OptionalProjectConfig,
|
|
30
|
+
};
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import {
|
|
2
|
+
import { PaginatedQueryOptions } from '../../commandUtils/pagination';
|
|
3
|
+
import { AppleDeviceQueryResult } from '../../credentials/ios/api/graphql/queries/AppleDeviceQuery';
|
|
3
4
|
import { AppleDevice, Maybe } from '../../graphql/generated';
|
|
4
5
|
export default class DeviceDelete extends EasCommand {
|
|
5
6
|
static description: string;
|
|
6
7
|
static flags: {
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
10
|
'apple-team-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
-
udid: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
11
|
+
udid: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
|
+
};
|
|
13
|
+
static contextDefinition: {
|
|
14
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
9
15
|
};
|
|
10
16
|
runAsync(): Promise<void>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
askForAppleTeamAsync(accountName: string): Promise<string | undefined>;
|
|
17
|
+
shouldDisableDeviceOnAppleAsync({ nonInteractive, }: PaginatedQueryOptions): Promise<boolean>;
|
|
18
|
+
disableDeviceOnAppleAsync(device: AppleDevice | AppleDeviceQueryResult, appleTeamIdentifier: string): Promise<void>;
|
|
19
|
+
shouldRemoveDeviceFromExpoAsync({ nonInteractive, }: PaginatedQueryOptions): Promise<boolean>;
|
|
20
|
+
removeDeviceFromExpoAsync(chosenDevice: AppleDevice | AppleDeviceQueryResult): Promise<void>;
|
|
21
|
+
logChosenDevice(device: AppleDevice | AppleDeviceQueryResult, appleTeamName: Maybe<string> | undefined, appleTeamIdentifier: string, { json }: PaginatedQueryOptions): void;
|
|
17
22
|
}
|
|
@@ -1,181 +1,133 @@
|
|
|
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 apple_utils_1 = require("@expo/apple-utils");
|
|
5
6
|
const core_1 = require("@oclif/core");
|
|
6
7
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
7
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
8
|
-
const
|
|
9
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
10
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
9
11
|
const AppleDeviceMutation_1 = require("../../credentials/ios/api/graphql/mutations/AppleDeviceMutation");
|
|
10
12
|
const AppleDeviceQuery_1 = require("../../credentials/ios/api/graphql/queries/AppleDeviceQuery");
|
|
11
|
-
const AppleTeamQuery_1 = require("../../credentials/ios/api/graphql/queries/AppleTeamQuery");
|
|
12
13
|
const authenticate_1 = require("../../credentials/ios/appstore/authenticate");
|
|
14
|
+
const queries_1 = require("../../devices/queries");
|
|
13
15
|
const formatDevice_1 = tslib_1.__importDefault(require("../../devices/utils/formatDevice"));
|
|
14
16
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
15
17
|
const ora_1 = require("../../ora");
|
|
16
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
17
18
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
18
19
|
const prompts_1 = require("../../prompts");
|
|
20
|
+
const json_1 = require("../../utils/json");
|
|
19
21
|
class DeviceDelete extends EasCommand_1.default {
|
|
20
22
|
async runAsync() {
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
23
|
+
const { flags } = await this.parse(DeviceDelete);
|
|
24
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
25
|
+
let { 'apple-team-id': appleTeamIdentifier, udid } = flags;
|
|
26
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(DeviceDelete, {
|
|
27
|
+
nonInteractive: paginatedQueryOptions.nonInteractive,
|
|
28
|
+
});
|
|
29
|
+
const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId);
|
|
30
|
+
let appleTeamName;
|
|
31
|
+
if (paginatedQueryOptions.json) {
|
|
32
|
+
(0, json_1.enableJsonOutput)();
|
|
33
|
+
}
|
|
25
34
|
if (!appleTeamIdentifier) {
|
|
26
|
-
|
|
35
|
+
const appleTeam = await (0, queries_1.selectAppleTeamOnAccountAsync)({
|
|
36
|
+
accountName: account.name,
|
|
37
|
+
selectionPromptTitle: `What Apple team would you like to list devices for?`,
|
|
38
|
+
paginatedQueryOptions,
|
|
39
|
+
});
|
|
40
|
+
appleTeamIdentifier = appleTeam.appleTeamIdentifier;
|
|
41
|
+
appleTeamName = appleTeam.appleTeamName;
|
|
27
42
|
}
|
|
28
43
|
(0, assert_1.default)(appleTeamIdentifier, 'No team identifier is specified');
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
const chosenDevice = udid
|
|
45
|
+
? await AppleDeviceQuery_1.AppleDeviceQuery.getByDeviceIdentifierAsync(account.name, udid)
|
|
46
|
+
: await (0, queries_1.selectAppleDeviceOnAppleTeamAsync)({
|
|
47
|
+
accountName: account.name,
|
|
48
|
+
appleTeamIdentifier,
|
|
49
|
+
selectionPromptTitle: `Which device would you like to disable?`,
|
|
50
|
+
paginatedQueryOptions,
|
|
51
|
+
});
|
|
52
|
+
this.logChosenDevice(chosenDevice, appleTeamName, appleTeamIdentifier, paginatedQueryOptions);
|
|
53
|
+
if (!(await this.shouldRemoveDeviceFromExpoAsync(paginatedQueryOptions))) {
|
|
38
54
|
return;
|
|
39
55
|
}
|
|
40
|
-
this.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return;
|
|
56
|
+
await this.removeDeviceFromExpoAsync(chosenDevice);
|
|
57
|
+
if (await this.shouldDisableDeviceOnAppleAsync(paginatedQueryOptions)) {
|
|
58
|
+
await this.disableDeviceOnAppleAsync(chosenDevice, appleTeamIdentifier);
|
|
44
59
|
}
|
|
45
|
-
await this.askAndDisableOnAppleAsync(chosenDevices, appleTeamIdentifier);
|
|
46
60
|
}
|
|
47
|
-
async
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return;
|
|
61
|
+
async shouldDisableDeviceOnAppleAsync({ nonInteractive, }) {
|
|
62
|
+
if (!nonInteractive) {
|
|
63
|
+
log_1.default.newLine();
|
|
64
|
+
return await (0, prompts_1.toggleConfirmAsync)({
|
|
65
|
+
message: 'Do you want to disable this device on your Apple account as well?',
|
|
66
|
+
});
|
|
54
67
|
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
async disableDeviceOnAppleAsync(device, appleTeamIdentifier) {
|
|
55
71
|
const ctx = await (0, authenticate_1.authenticateAsync)({ teamId: appleTeamIdentifier });
|
|
56
72
|
const context = (0, authenticate_1.getRequestContext)(ctx);
|
|
57
73
|
log_1.default.addNewLineIfNone();
|
|
58
|
-
const removeAppleSpinner = (0, ora_1.ora)('Disabling
|
|
74
|
+
const removeAppleSpinner = (0, ora_1.ora)('Disabling device on Apple').start();
|
|
59
75
|
try {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
await
|
|
76
|
+
const appleValidatedDevices = await apple_utils_1.Device.getAsync(context);
|
|
77
|
+
const appleValidatedDevice = appleValidatedDevices.find(d => d.id === device.id);
|
|
78
|
+
if (appleValidatedDevice) {
|
|
79
|
+
await appleValidatedDevice.updateAsync({ status: apple_utils_1.DeviceStatus.DISABLED });
|
|
64
80
|
}
|
|
65
|
-
removeAppleSpinner.succeed('Disabled
|
|
81
|
+
removeAppleSpinner.succeed('Disabled device on Apple');
|
|
66
82
|
}
|
|
67
83
|
catch (err) {
|
|
68
84
|
removeAppleSpinner.fail();
|
|
69
85
|
throw err;
|
|
70
86
|
}
|
|
71
87
|
}
|
|
72
|
-
async
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const confirmed = await (0, prompts_1.toggleConfirmAsync)({
|
|
76
|
-
message: 'Are you sure you wish to proceed?',
|
|
77
|
-
});
|
|
78
|
-
if (confirmed) {
|
|
79
|
-
const removalSpinner = (0, ora_1.ora)(`Removing Apple devices on Expo`).start();
|
|
80
|
-
try {
|
|
81
|
-
for (const chosenDevice of chosenDevices) {
|
|
82
|
-
await AppleDeviceMutation_1.AppleDeviceMutation.deleteAppleDeviceAsync(chosenDevice.id);
|
|
83
|
-
}
|
|
84
|
-
removalSpinner.succeed('Removed Apple devices from Expo');
|
|
85
|
-
}
|
|
86
|
-
catch (err) {
|
|
87
|
-
removalSpinner.fail();
|
|
88
|
-
throw err;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return confirmed;
|
|
92
|
-
}
|
|
93
|
-
logChosenDevices(chosenDevices, appleTeamName, appleTeamIdentifier) {
|
|
94
|
-
log_1.default.addNewLineIfNone();
|
|
95
|
-
chosenDevices.forEach(device => {
|
|
96
|
-
log_1.default.log((0, formatDevice_1.default)(device, {
|
|
97
|
-
appleTeamName,
|
|
98
|
-
appleTeamIdentifier: appleTeamIdentifier,
|
|
99
|
-
}));
|
|
88
|
+
async shouldRemoveDeviceFromExpoAsync({ nonInteractive, }) {
|
|
89
|
+
if (!nonInteractive) {
|
|
90
|
+
log_1.default.warn(`You are about to remove the Apple device listed above from your Expo account.`);
|
|
100
91
|
log_1.default.newLine();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
async chooseDevicesToDeleteAsync(appleDevices, udids) {
|
|
104
|
-
let chosenDevices = [];
|
|
105
|
-
log_1.default.newLine();
|
|
106
|
-
if (udids) {
|
|
107
|
-
udids.forEach(udid => {
|
|
108
|
-
const foundDevice = appleDevices.find(device => device.identifier === udid);
|
|
109
|
-
if (foundDevice) {
|
|
110
|
-
chosenDevices.push(foundDevice);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
log_1.default.warn(`No device found with UDID ${udid}.`);
|
|
114
|
-
}
|
|
92
|
+
return await (0, prompts_1.toggleConfirmAsync)({
|
|
93
|
+
message: 'Are you sure you wish to proceed?',
|
|
115
94
|
});
|
|
116
95
|
}
|
|
117
|
-
|
|
118
|
-
log_1.default.addNewLineIfNone();
|
|
119
|
-
chosenDevices = await (0, DeviceUtils_1.chooseDevicesToDeleteAsync)(appleDevices);
|
|
120
|
-
log_1.default.newLine();
|
|
121
|
-
}
|
|
122
|
-
return chosenDevices;
|
|
96
|
+
return true;
|
|
123
97
|
}
|
|
124
|
-
async
|
|
125
|
-
const
|
|
98
|
+
async removeDeviceFromExpoAsync(chosenDevice) {
|
|
99
|
+
const removalSpinner = (0, ora_1.ora)(`Removing Apple device on Expo`).start();
|
|
126
100
|
try {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const { appleTeamName, appleDevices } = result;
|
|
130
|
-
devicesSpinner.succeed(`Found ${appleDevices.length} devices for team ${appleTeamName !== null && appleTeamName !== void 0 ? appleTeamName : appleTeamIdentifier}`);
|
|
131
|
-
return result;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
devicesSpinner.fail(`Couldn't find any devices for the team ${appleTeamIdentifier}`);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
101
|
+
await AppleDeviceMutation_1.AppleDeviceMutation.deleteAppleDeviceAsync(chosenDevice.id);
|
|
102
|
+
removalSpinner.succeed('Removed Apple device from Expo');
|
|
137
103
|
}
|
|
138
|
-
catch (
|
|
139
|
-
|
|
140
|
-
throw
|
|
104
|
+
catch (err) {
|
|
105
|
+
removalSpinner.fail();
|
|
106
|
+
throw err;
|
|
141
107
|
}
|
|
142
108
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const teams = await AppleTeamQuery_1.AppleTeamQuery.getAllForAccountAsync(accountName);
|
|
147
|
-
if (teams.length > 0) {
|
|
148
|
-
teamSpinner.succeed('Fetched the list of teams for the project');
|
|
149
|
-
if (teams.length === 1) {
|
|
150
|
-
return teams[0].appleTeamIdentifier;
|
|
151
|
-
}
|
|
152
|
-
const result = await (0, prompts_1.promptAsync)({
|
|
153
|
-
type: 'select',
|
|
154
|
-
name: 'appleTeamIdentifier',
|
|
155
|
-
message: 'What Apple Team would you like to list devices for?',
|
|
156
|
-
choices: teams.map(team => ({
|
|
157
|
-
title: team.appleTeamName
|
|
158
|
-
? `${team.appleTeamName} (ID: ${team.appleTeamIdentifier})`
|
|
159
|
-
: team.appleTeamIdentifier,
|
|
160
|
-
value: team.appleTeamIdentifier,
|
|
161
|
-
})),
|
|
162
|
-
});
|
|
163
|
-
return result.appleTeamIdentifier;
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
teamSpinner.fail(`Couldn't find any teams for the account ${accountName}`);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
109
|
+
logChosenDevice(device, appleTeamName, appleTeamIdentifier, { json }) {
|
|
110
|
+
if (json) {
|
|
111
|
+
(0, json_1.printJsonOnlyOutput)(device);
|
|
169
112
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
113
|
+
else {
|
|
114
|
+
log_1.default.addNewLineIfNone();
|
|
115
|
+
log_1.default.log((0, formatDevice_1.default)(device, {
|
|
116
|
+
appleTeamName,
|
|
117
|
+
appleTeamIdentifier: appleTeamIdentifier,
|
|
118
|
+
}));
|
|
119
|
+
log_1.default.newLine();
|
|
173
120
|
}
|
|
174
121
|
}
|
|
175
122
|
}
|
|
176
123
|
exports.default = DeviceDelete;
|
|
124
|
+
_a = DeviceDelete;
|
|
177
125
|
DeviceDelete.description = 'remove a registered device from your account';
|
|
178
126
|
DeviceDelete.flags = {
|
|
179
|
-
'apple-team-id': core_1.Flags.string(),
|
|
180
|
-
udid: core_1.Flags.string({
|
|
127
|
+
'apple-team-id': core_1.Flags.string({ description: 'The Apple team ID on which to find the device' }),
|
|
128
|
+
udid: core_1.Flags.string({ description: 'The Apple device ID to disable' }),
|
|
129
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
130
|
+
};
|
|
131
|
+
DeviceDelete.contextDefinition = {
|
|
132
|
+
..._a.ContextOptions.ProjectConfig,
|
|
181
133
|
};
|
|
@@ -2,7 +2,14 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class BuildList extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
8
|
+
limit: any;
|
|
5
9
|
'apple-team-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
10
|
};
|
|
11
|
+
static contextDefinition: {
|
|
12
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
13
|
+
};
|
|
7
14
|
runAsync(): Promise<void>;
|
|
8
15
|
}
|
|
@@ -1,82 +1,61 @@
|
|
|
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 assert_1 = tslib_1.__importDefault(require("assert"));
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
7
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
12
|
-
const ora_1 = require("../../ora");
|
|
13
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
8
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
9
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
10
|
+
const queries_1 = require("../../devices/queries");
|
|
14
11
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
15
|
-
const
|
|
12
|
+
const json_1 = require("../../utils/json");
|
|
16
13
|
class BuildList extends EasCommand_1.default {
|
|
17
14
|
async runAsync() {
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const { flags } = await this.parse(BuildList);
|
|
16
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
17
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(BuildList, {
|
|
18
|
+
nonInteractive: paginatedQueryOptions.nonInteractive,
|
|
19
|
+
});
|
|
20
|
+
let appleTeamIdentifier = flags['apple-team-id'];
|
|
21
|
+
let appleTeamName;
|
|
22
|
+
if (paginatedQueryOptions.json) {
|
|
23
|
+
(0, json_1.enableJsonOutput)();
|
|
24
|
+
}
|
|
25
|
+
const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId);
|
|
26
|
+
// if they don't provide a team id, fetch devices on their account
|
|
23
27
|
if (!appleTeamIdentifier) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
name: 'appleTeamIdentifier',
|
|
36
|
-
message: 'What Apple Team would you like to list devices for?',
|
|
37
|
-
choices: teams.map(team => ({
|
|
38
|
-
title: team.appleTeamName
|
|
39
|
-
? `${team.appleTeamName} (ID: ${team.appleTeamIdentifier})`
|
|
40
|
-
: team.appleTeamIdentifier,
|
|
41
|
-
value: team.appleTeamIdentifier,
|
|
42
|
-
})),
|
|
43
|
-
});
|
|
44
|
-
appleTeamIdentifier = result.appleTeamIdentifier;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
spinner.fail(`Couldn't find any teams for the account ${accountName}`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
spinner.fail(`Something went wrong and we couldn't fetch the list of teams`);
|
|
53
|
-
throw e;
|
|
54
|
-
}
|
|
28
|
+
const selectedAppleTeam = await (0, queries_1.selectAppleTeamOnAccountAsync)({
|
|
29
|
+
accountName: account.name,
|
|
30
|
+
paginatedQueryOptions: {
|
|
31
|
+
...paginatedQueryOptions,
|
|
32
|
+
offset: 0,
|
|
33
|
+
limit: undefined,
|
|
34
|
+
},
|
|
35
|
+
selectionPromptTitle: 'What Apple team would you like to list devices for?',
|
|
36
|
+
});
|
|
37
|
+
appleTeamIdentifier = selectedAppleTeam.appleTeamIdentifier;
|
|
38
|
+
appleTeamName = selectedAppleTeam.appleTeamName;
|
|
55
39
|
}
|
|
56
40
|
(0, assert_1.default)(appleTeamIdentifier, 'No team identifier is specified');
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.join(`\n\n${chalk_1.default.dim('———')}\n\n`);
|
|
66
|
-
log_1.default.log(`\n${list}`);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
spinner.fail(`Couldn't find any devices for the team ${appleTeamIdentifier}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
catch (e) {
|
|
73
|
-
spinner.fail(`Something went wrong and we couldn't fetch the device list`);
|
|
74
|
-
throw e;
|
|
75
|
-
}
|
|
41
|
+
await (0, queries_1.listAndRenderAppleDevicesOnAppleTeamAsync)({
|
|
42
|
+
accountName: account.name,
|
|
43
|
+
appleTeam: {
|
|
44
|
+
appleTeamIdentifier,
|
|
45
|
+
appleTeamName,
|
|
46
|
+
},
|
|
47
|
+
paginatedQueryOptions,
|
|
48
|
+
});
|
|
76
49
|
}
|
|
77
50
|
}
|
|
78
51
|
exports.default = BuildList;
|
|
52
|
+
_a = BuildList;
|
|
79
53
|
BuildList.description = 'list all registered devices for your account';
|
|
80
54
|
BuildList.flags = {
|
|
81
55
|
'apple-team-id': core_1.Flags.string(),
|
|
56
|
+
...pagination_1.EasPaginatedQueryFlags,
|
|
57
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
58
|
+
};
|
|
59
|
+
BuildList.contextDefinition = {
|
|
60
|
+
..._a.ContextOptions.ProjectConfig,
|
|
82
61
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
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 EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
@@ -6,7 +7,6 @@ const AppleDeviceQuery_1 = require("../../credentials/ios/api/graphql/queries/Ap
|
|
|
6
7
|
const formatDevice_1 = tslib_1.__importDefault(require("../../devices/utils/formatDevice"));
|
|
7
8
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
8
9
|
const ora_1 = require("../../ora");
|
|
9
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
10
10
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
11
11
|
class DeviceView extends EasCommand_1.default {
|
|
12
12
|
async runAsync() {
|
|
@@ -22,12 +22,13 @@ If you are not sure what is the UDID of the device you are looking for, run:
|
|
|
22
22
|
`);
|
|
23
23
|
throw new Error('Device UDID is missing');
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(DeviceView, {
|
|
26
|
+
nonInteractive: true,
|
|
27
|
+
});
|
|
28
|
+
const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId);
|
|
28
29
|
const spinner = (0, ora_1.ora)().start(`Fetching device details for ${UDID}…`);
|
|
29
30
|
try {
|
|
30
|
-
const device = await AppleDeviceQuery_1.AppleDeviceQuery.getByDeviceIdentifierAsync(
|
|
31
|
+
const device = await AppleDeviceQuery_1.AppleDeviceQuery.getByDeviceIdentifierAsync(account.name, UDID);
|
|
31
32
|
if (device) {
|
|
32
33
|
spinner.succeed('Fetched device details');
|
|
33
34
|
log_1.default.log(`\n${(0, formatDevice_1.default)(device, device.appleTeam)}`);
|
|
@@ -43,5 +44,9 @@ If you are not sure what is the UDID of the device you are looking for, run:
|
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
exports.default = DeviceView;
|
|
47
|
+
_a = DeviceView;
|
|
46
48
|
DeviceView.description = 'view a device for your project';
|
|
47
49
|
DeviceView.args = [{ name: 'UDID' }];
|
|
50
|
+
DeviceView.contextDefinition = {
|
|
51
|
+
..._a.ContextOptions.ProjectConfig,
|
|
52
|
+
};
|