eas-cli 10.2.4 → 11.0.1
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 +63 -65
- package/build/branch/actions/SelectBranch.d.ts +1 -1
- package/build/branch/actions/SelectBranch.js +2 -2
- package/build/branch/queries.js +3 -1
- package/build/build/android/build.js +1 -1
- package/build/build/android/version.js +1 -1
- package/build/build/build.js +21 -10
- package/build/build/context.d.ts +1 -0
- package/build/build/createContext.d.ts +2 -1
- package/build/build/createContext.js +6 -3
- package/build/build/evaluateConfigWithEnvVarsAsync.d.ts +16 -0
- package/build/build/evaluateConfigWithEnvVarsAsync.js +44 -0
- package/build/build/ios/build.js +4 -4
- package/build/build/local.d.ts +1 -1
- package/build/build/local.js +2 -1
- package/build/build/queries.js +3 -1
- package/build/build/runBuildAndSubmit.d.ts +2 -0
- package/build/build/runBuildAndSubmit.js +14 -7
- package/build/build/utils/printBuildInfo.js +6 -2
- package/build/build/validate.js +2 -2
- package/build/channel/actions/SelectChannel.d.ts +1 -1
- package/build/channel/actions/SelectChannel.js +2 -2
- package/build/channel/queries.js +6 -2
- package/build/commandUtils/EasCommand.js +2 -2
- package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -1
- package/build/commandUtils/flags.d.ts +3 -0
- package/build/commandUtils/flags.js +15 -1
- package/build/commandUtils/gating/FeatureGating.js +6 -2
- package/build/commands/analytics.js +1 -1
- package/build/commands/build/index.d.ts +4 -1
- package/build/commands/build/index.js +3 -0
- package/build/commands/build/resign.d.ts +4 -1
- package/build/commands/build/resign.js +12 -3
- package/build/commands/build/version/get.d.ts +1 -0
- package/build/commands/build/version/get.js +9 -2
- package/build/commands/build/version/set.d.ts +1 -0
- package/build/commands/build/version/set.js +11 -1
- package/build/commands/build/version/sync.d.ts +1 -0
- package/build/commands/build/version/sync.js +13 -5
- package/build/commands/config.d.ts +2 -0
- package/build/commands/config.js +17 -5
- package/build/commands/device/delete.js +1 -1
- package/build/commands/device/rename.js +1 -1
- package/build/commands/env/create.js +7 -2
- package/build/commands/env/delete.js +5 -2
- package/build/commands/env/get.js +12 -4
- package/build/commands/env/link.js +3 -1
- package/build/commands/env/list.d.ts +4 -2
- package/build/commands/env/list.js +31 -4
- package/build/commands/env/pull.d.ts +15 -0
- package/build/commands/env/pull.js +64 -0
- package/build/commands/env/push.d.ts +17 -0
- package/build/commands/env/push.js +148 -0
- package/build/commands/env/unlink.js +4 -1
- package/build/commands/env/update.js +7 -2
- package/build/commands/metadata/lint.js +4 -2
- package/build/commands/project/onboarding.js +1 -1
- package/build/commands/update/edit.d.ts +19 -0
- package/build/commands/update/edit.js +102 -0
- package/build/commands/update/index.d.ts +1 -2
- package/build/commands/update/index.js +53 -25
- package/build/commands/update/list.js +6 -3
- package/build/commands/update/roll-back-to-embedded.js +1 -1
- package/build/credentials/android/AndroidCredentialsProvider.d.ts +2 -2
- package/build/credentials/android/actions/AssignFcm.d.ts +1 -1
- package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForFcmV1.d.ts +1 -1
- package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForSubmissions.d.ts +1 -1
- package/build/credentials/android/actions/CreateFcm.d.ts +1 -1
- package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +1 -1
- package/build/credentials/android/actions/CreateKeystore.d.ts +1 -1
- package/build/credentials/android/actions/DownloadKeystore.d.ts +2 -2
- package/build/credentials/android/actions/RemoveFcm.d.ts +1 -1
- package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +2 -2
- package/build/credentials/android/actions/RemoveKeystore.d.ts +1 -1
- package/build/credentials/android/actions/SetUpBuildCredentials.d.ts +1 -1
- package/build/credentials/android/actions/SetUpBuildCredentialsFromCredentialsJson.d.ts +1 -1
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.d.ts +1 -1
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.d.ts +1 -1
- package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +1 -1
- package/build/credentials/android/api/GraphqlClient.js +3 -3
- package/build/credentials/context.d.ts +2 -2
- package/build/credentials/context.js +1 -1
- package/build/credentials/ios/IosCredentialsProvider.d.ts +2 -2
- package/build/credentials/ios/IosCredentialsProvider.js +1 -1
- package/build/credentials/ios/actions/AscApiKeyUtils.js +1 -1
- 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/ConfigureProvisioningProfile.d.ts +4 -4
- package/build/credentials/ios/actions/CreateAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +1 -1
- package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +3 -3
- package/build/credentials/ios/actions/CreatePushKey.d.ts +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +5 -5
- package/build/credentials/ios/actions/ProvisioningProfileUtils.js +1 -1
- package/build/credentials/ios/actions/PushKeyUtils.js +2 -2
- package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +2 -2
- package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -3
- package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +2 -2
- package/build/credentials/ios/actions/RemovePushKey.d.ts +2 -2
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +2 -2
- package/build/credentials/ios/actions/SetUpBuildCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpBuildCredentialsFromCredentialsJson.d.ts +3 -3
- package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +2 -2
- package/build/credentials/ios/actions/SetUpDistributionCertificate.js +1 -1
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +3 -3
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/SetUpPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.d.ts +3 -3
- package/build/credentials/ios/actions/UpdateCredentialsJson.d.ts +3 -3
- package/build/credentials/ios/api/GraphqlClient.js +4 -4
- package/build/credentials/ios/appstore/AppStoreApi.js +4 -4
- package/build/credentials/ios/appstore/authenticate.js +1 -1
- package/build/credentials/ios/appstore/bundleId.js +1 -1
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
- package/build/credentials/ios/appstore/ensureAppExists.js +1 -1
- package/build/credentials/ios/appstore/keychain.js +8 -6
- package/build/credentials/ios/appstore/provisioningProfile.js +1 -1
- package/build/credentials/ios/appstore/pushKey.js +1 -1
- package/build/credentials/ios/appstore/resolveCredentials.js +2 -2
- package/build/credentials/ios/credentials.js +1 -1
- package/build/credentials/ios/utils/convertHTMLToASCII.js +1 -1
- package/build/credentials/ios/validators/validateProvisioningProfile.js +2 -4
- package/build/credentials/manager/CheckBuildProfileFlagAgainstEasJson.d.ts +3 -3
- package/build/credentials/manager/CreateAndroidBuildCredentials.d.ts +1 -1
- package/build/credentials/manager/ManageAndroid.js +2 -1
- package/build/credentials/manager/ManageIos.js +3 -2
- package/build/credentials/manager/SelectAndroidBuildCredentials.d.ts +2 -2
- package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -2
- package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.d.ts +1 -1
- package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.js +1 -1
- package/build/credentials/manager/SelectPlatform.js +3 -2
- package/build/credentials/manager/SetDefaultAndroidKeystore.d.ts +1 -1
- package/build/credentials/manager/SetUpAndroidBuildCredentials.d.ts +1 -1
- package/build/credentials/manager/SetUpBuildCredentialsCommandAction.js +3 -2
- package/build/credentials/manager/SetUpIosBuildCredentials.d.ts +1 -1
- package/build/devices/actions/create/action.d.ts +4 -4
- package/build/devices/actions/create/registrationUrlMethod.js +3 -1
- package/build/devices/manager.d.ts +4 -4
- package/build/devices/queries.js +3 -1
- package/build/easMultiselect.js +6 -2
- package/build/graphql/generated.d.ts +342 -33
- package/build/graphql/generated.js +52 -2
- package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +1 -0
- package/build/graphql/mutations/EnvironmentVariableMutation.js +20 -0
- package/build/graphql/mutations/PublishMutation.d.ts +1 -0
- package/build/graphql/mutations/PublishMutation.js +16 -0
- package/build/graphql/queries/BranchQuery.d.ts +7 -1
- package/build/graphql/queries/BranchQuery.js +42 -0
- package/build/graphql/queries/EnvironmentVariablesQuery.d.ts +16 -7
- package/build/graphql/queries/EnvironmentVariablesQuery.js +29 -6
- package/build/graphql/types/Update.js +4 -0
- package/build/metadata/apple/config/reader.js +1 -1
- package/build/metadata/apple/tasks/age-rating.js +1 -1
- package/build/metadata/apple/tasks/app-review-detail.js +2 -1
- package/build/metadata/apple/tasks/app-version.d.ts +1 -1
- package/build/metadata/config/resolve.js +2 -1
- package/build/metadata/errors.js +2 -1
- package/build/metadata/utils/log.js +1 -1
- package/build/metadata/utils/retry.js +1 -1
- package/build/onboarding/runCommand.js +1 -1
- package/build/ora.js +12 -4
- package/build/project/android/applicationId.js +1 -1
- package/build/project/applicationIdentifier.d.ts +3 -2
- package/build/project/applicationIdentifier.js +2 -2
- package/build/project/expoConfig.js +2 -2
- package/build/project/ios/entitlements.js +1 -1
- package/build/project/publish.d.ts +31 -18
- package/build/project/publish.js +61 -37
- package/build/project/resolveRuntimeVersionAsync.d.ts +4 -1
- package/build/project/resolveRuntimeVersionAsync.js +9 -3
- package/build/rollout/actions/CreateRollout.d.ts +2 -2
- package/build/rollout/actions/EditRollout.d.ts +2 -2
- package/build/rollout/actions/EndRollout.d.ts +2 -2
- package/build/rollout/actions/ManageRollout.d.ts +2 -2
- package/build/rollout/actions/NonInteractiveRollout.d.ts +1 -1
- package/build/rollout/actions/RolloutMainMenu.d.ts +1 -1
- package/build/rollout/actions/SelectRuntime.d.ts +3 -3
- package/build/run/android/adb.js +1 -1
- package/build/run/ios/simctl.js +1 -1
- package/build/run/ios/systemRequirements.js +1 -1
- package/build/submit/ArchiveSource.js +15 -15
- package/build/submit/BaseSubmitter.js +2 -2
- package/build/submit/submit.js +1 -1
- package/build/update/android/UpdatesModule.js +1 -1
- package/build/update/configure.d.ts +1 -1
- package/build/update/queries.js +8 -3
- package/build/update/republish.js +2 -1
- package/build/update/utils.d.ts +1 -0
- package/build/update/utils.js +7 -0
- package/build/user/expoSsoLauncher.js +1 -1
- package/build/utils/download.js +2 -2
- package/build/utils/filterAsync.js +1 -1
- package/build/utils/image.js +2 -2
- package/build/utils/progress.js +1 -1
- package/build/utils/promise.js +1 -1
- package/build/utils/queries.js +2 -2
- package/build/vcs/clients/git.d.ts +1 -1
- package/build/vcs/local.d.ts +1 -1
- package/oclif.manifest.json +218 -22
- package/package.json +14 -14
|
@@ -9,6 +9,7 @@ const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
|
9
9
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
10
|
const _1 = require(".");
|
|
11
11
|
const build_1 = require("../../build/build");
|
|
12
|
+
const evaluateConfigWithEnvVarsAsync_1 = require("../../build/evaluateConfigWithEnvVarsAsync");
|
|
12
13
|
const credentials_1 = require("../../build/ios/credentials");
|
|
13
14
|
const prepareJob_1 = require("../../build/ios/prepareJob");
|
|
14
15
|
const queries_1 = require("../../build/queries");
|
|
@@ -52,7 +53,13 @@ class BuildResign extends EasCommand_1.default {
|
|
|
52
53
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
53
54
|
const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
|
54
55
|
const buildProfile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, flags.targetProfile ?? 'production');
|
|
55
|
-
const { exp, projectId } = await
|
|
56
|
+
const { exp, projectId, env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
|
|
57
|
+
flags,
|
|
58
|
+
buildProfile,
|
|
59
|
+
graphqlClient,
|
|
60
|
+
getProjectConfig: getDynamicPrivateProjectConfigAsync,
|
|
61
|
+
opts: { env: buildProfile.env },
|
|
62
|
+
});
|
|
56
63
|
const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
|
|
57
64
|
const build = await this.ensureBuildSelectedAsync({
|
|
58
65
|
graphqlClient,
|
|
@@ -70,7 +77,7 @@ class BuildResign extends EasCommand_1.default {
|
|
|
70
77
|
user: actor,
|
|
71
78
|
graphqlClient,
|
|
72
79
|
analytics,
|
|
73
|
-
env
|
|
80
|
+
env,
|
|
74
81
|
easJsonCliConfig,
|
|
75
82
|
vcsClient,
|
|
76
83
|
});
|
|
@@ -87,7 +94,7 @@ class BuildResign extends EasCommand_1.default {
|
|
|
87
94
|
projectDir,
|
|
88
95
|
exp,
|
|
89
96
|
xcodeBuildContext,
|
|
90
|
-
env
|
|
97
|
+
env,
|
|
91
98
|
vcsClient,
|
|
92
99
|
});
|
|
93
100
|
const credentialsResult = await (0, credentials_1.ensureIosCredentialsForBuildResignAsync)(credentialsCtx, targets, buildProfile);
|
|
@@ -144,6 +151,7 @@ class BuildResign extends EasCommand_1.default {
|
|
|
144
151
|
targetProfile: flags['target-profile'],
|
|
145
152
|
maybeBuildId: flags.id,
|
|
146
153
|
wait: flags.wait,
|
|
154
|
+
environment: flags.environment,
|
|
147
155
|
};
|
|
148
156
|
}
|
|
149
157
|
async ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset, buildProfile, }, maybeBuild) {
|
|
@@ -215,6 +223,7 @@ BuildResign.flags = {
|
|
|
215
223
|
}),
|
|
216
224
|
...pagination_1.EasPaginatedQueryFlags,
|
|
217
225
|
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
226
|
+
...flags_1.EASEnvironmentFlagHidden,
|
|
218
227
|
};
|
|
219
228
|
BuildResign.contextDefinition = {
|
|
220
229
|
..._a.ContextOptions.LoggedIn,
|
|
@@ -4,6 +4,7 @@ export default class BuildVersionGetView extends EasCommand {
|
|
|
4
4
|
static flags: {
|
|
5
5
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
6
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../../../graphql/generated").EnvironmentVariableEnvironment | undefined>;
|
|
7
8
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
9
|
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
10
|
};
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const eas_json_1 = require("@expo/eas-json");
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const evaluateConfigWithEnvVarsAsync_1 = require("../../../build/evaluateConfigWithEnvVarsAsync");
|
|
8
9
|
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
9
10
|
const flags_1 = require("../../../commandUtils/flags");
|
|
10
11
|
const AppVersionQuery_1 = require("../../../graphql/queries/AppVersionQuery");
|
|
@@ -42,8 +43,12 @@ class BuildVersionGetView extends EasCommand_1.default {
|
|
|
42
43
|
});
|
|
43
44
|
const results = {};
|
|
44
45
|
for (const { profile, platform } of buildProfiles) {
|
|
45
|
-
const { exp, projectId } = await
|
|
46
|
-
|
|
46
|
+
const { exp, projectId, env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
|
|
47
|
+
flags,
|
|
48
|
+
buildProfile: profile,
|
|
49
|
+
graphqlClient,
|
|
50
|
+
getProjectConfig: getDynamicPrivateProjectConfigAsync,
|
|
51
|
+
opts: { env: profile.env },
|
|
47
52
|
});
|
|
48
53
|
(0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(exp, platform);
|
|
49
54
|
const applicationIdentifier = await (0, applicationIdentifier_1.getApplicationIdentifierAsync)({
|
|
@@ -55,6 +60,7 @@ class BuildVersionGetView extends EasCommand_1.default {
|
|
|
55
60
|
platform,
|
|
56
61
|
vcsClient,
|
|
57
62
|
nonInteractive: flags['non-interactive'],
|
|
63
|
+
env,
|
|
58
64
|
});
|
|
59
65
|
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(graphqlClient, projectId, (0, AppPlatform_1.toAppPlatform)(platform), applicationIdentifier);
|
|
60
66
|
if (remoteVersions?.buildVersion) {
|
|
@@ -97,6 +103,7 @@ BuildVersionGetView.flags = {
|
|
|
97
103
|
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
98
104
|
helpValue: 'PROFILE_NAME',
|
|
99
105
|
}),
|
|
106
|
+
...flags_1.EASEnvironmentFlagHidden,
|
|
100
107
|
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
101
108
|
};
|
|
102
109
|
BuildVersionGetView.contextDefinition = {
|
|
@@ -2,6 +2,7 @@ import EasCommand from '../../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class BuildVersionSetView extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../../../graphql/generated").EnvironmentVariableEnvironment | undefined>;
|
|
5
6
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
7
|
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
8
|
};
|
|
@@ -7,7 +7,9 @@ const eas_build_job_1 = require("@expo/eas-build-job");
|
|
|
7
7
|
const eas_json_1 = require("@expo/eas-json");
|
|
8
8
|
const core_1 = require("@oclif/core");
|
|
9
9
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const evaluateConfigWithEnvVarsAsync_1 = require("../../../build/evaluateConfigWithEnvVarsAsync");
|
|
10
11
|
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
12
|
+
const flags_1 = require("../../../commandUtils/flags");
|
|
11
13
|
const AppVersionMutation_1 = require("../../../graphql/mutations/AppVersionMutation");
|
|
12
14
|
const AppVersionQuery_1 = require("../../../graphql/queries/AppVersionQuery");
|
|
13
15
|
const AppPlatform_1 = require("../../../graphql/types/AppPlatform");
|
|
@@ -29,7 +31,13 @@ class BuildVersionSetView extends EasCommand_1.default {
|
|
|
29
31
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
30
32
|
await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(easJsonAccessor, { nonInteractive: false });
|
|
31
33
|
const profile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, flags.profile ?? undefined);
|
|
32
|
-
const { exp, projectId } = await
|
|
34
|
+
const { exp, projectId, env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
|
|
35
|
+
flags,
|
|
36
|
+
buildProfile: profile,
|
|
37
|
+
graphqlClient,
|
|
38
|
+
getProjectConfig: getDynamicPrivateProjectConfigAsync,
|
|
39
|
+
opts: { env: profile.env },
|
|
40
|
+
});
|
|
33
41
|
const displayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
|
|
34
42
|
(0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(exp, platform);
|
|
35
43
|
const applicationIdentifier = await (0, applicationIdentifier_1.getApplicationIdentifierAsync)({
|
|
@@ -41,6 +49,7 @@ class BuildVersionSetView extends EasCommand_1.default {
|
|
|
41
49
|
platform,
|
|
42
50
|
vcsClient,
|
|
43
51
|
nonInteractive: false,
|
|
52
|
+
env,
|
|
44
53
|
});
|
|
45
54
|
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(graphqlClient, projectId, (0, AppPlatform_1.toAppPlatform)(platform), applicationIdentifier);
|
|
46
55
|
const currentStateMessage = remoteVersions?.buildVersion
|
|
@@ -80,6 +89,7 @@ BuildVersionSetView.flags = {
|
|
|
80
89
|
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
81
90
|
helpValue: 'PROFILE_NAME',
|
|
82
91
|
}),
|
|
92
|
+
...flags_1.EASEnvironmentFlagHidden,
|
|
83
93
|
};
|
|
84
94
|
BuildVersionSetView.contextDefinition = {
|
|
85
95
|
..._a.ContextOptions.LoggedIn,
|
|
@@ -2,6 +2,7 @@ import EasCommand from '../../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class BuildVersionSyncView extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../../../graphql/generated").EnvironmentVariableEnvironment | undefined>;
|
|
5
6
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
7
|
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
8
|
};
|
|
@@ -7,8 +7,10 @@ const eas_json_1 = require("@expo/eas-json");
|
|
|
7
7
|
const core_1 = require("@oclif/core");
|
|
8
8
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
9
|
const version_1 = require("../../../build/android/version");
|
|
10
|
+
const evaluateConfigWithEnvVarsAsync_1 = require("../../../build/evaluateConfigWithEnvVarsAsync");
|
|
10
11
|
const version_2 = require("../../../build/ios/version");
|
|
11
12
|
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
13
|
+
const flags_1 = require("../../../commandUtils/flags");
|
|
12
14
|
const AppVersionQuery_1 = require("../../../graphql/queries/AppVersionQuery");
|
|
13
15
|
const AppPlatform_1 = require("../../../graphql/types/AppPlatform");
|
|
14
16
|
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
@@ -40,8 +42,12 @@ class BuildVersionSyncView extends EasCommand_1.default {
|
|
|
40
42
|
projectDir,
|
|
41
43
|
});
|
|
42
44
|
for (const profileInfo of buildProfiles) {
|
|
43
|
-
const { exp, projectId } = await
|
|
44
|
-
|
|
45
|
+
const { exp, projectId, env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
|
|
46
|
+
flags,
|
|
47
|
+
buildProfile: profileInfo.profile,
|
|
48
|
+
graphqlClient,
|
|
49
|
+
getProjectConfig: getDynamicPrivateProjectConfigAsync,
|
|
50
|
+
opts: { env: profileInfo.profile.env },
|
|
45
51
|
});
|
|
46
52
|
(0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(exp, profileInfo.platform);
|
|
47
53
|
const platformDisplayName = platform_1.appPlatformDisplayNames[(0, AppPlatform_1.toAppPlatform)(profileInfo.platform)];
|
|
@@ -54,6 +60,7 @@ class BuildVersionSyncView extends EasCommand_1.default {
|
|
|
54
60
|
platform: profileInfo.platform,
|
|
55
61
|
vcsClient,
|
|
56
62
|
nonInteractive: false,
|
|
63
|
+
env,
|
|
57
64
|
});
|
|
58
65
|
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(graphqlClient, projectId, (0, AppPlatform_1.toAppPlatform)(profileInfo.platform), applicationIdentifier);
|
|
59
66
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, profileInfo.platform, vcsClient);
|
|
@@ -66,7 +73,7 @@ class BuildVersionSyncView extends EasCommand_1.default {
|
|
|
66
73
|
continue;
|
|
67
74
|
}
|
|
68
75
|
if (profileInfo.platform === eas_build_job_1.Platform.ANDROID) {
|
|
69
|
-
this.syncAndroidAsync({
|
|
76
|
+
await this.syncAndroidAsync({
|
|
70
77
|
projectDir,
|
|
71
78
|
exp,
|
|
72
79
|
profile: profileInfo.profile,
|
|
@@ -76,7 +83,7 @@ class BuildVersionSyncView extends EasCommand_1.default {
|
|
|
76
83
|
});
|
|
77
84
|
}
|
|
78
85
|
else {
|
|
79
|
-
this.syncIosAsync({
|
|
86
|
+
await this.syncIosAsync({
|
|
80
87
|
projectDir,
|
|
81
88
|
exp,
|
|
82
89
|
profile: profileInfo.profile,
|
|
@@ -114,7 +121,7 @@ class BuildVersionSyncView extends EasCommand_1.default {
|
|
|
114
121
|
}
|
|
115
122
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
116
123
|
const buildGradle = await (0, gradleUtils_1.getAppBuildGradleAsync)(projectDir);
|
|
117
|
-
const isMultiFlavor = buildGradle.android?.productFlavors
|
|
124
|
+
const isMultiFlavor = buildGradle.android?.productFlavors ?? buildGradle.android?.flavorDimensions;
|
|
118
125
|
if (isMultiFlavor) {
|
|
119
126
|
throw new Error("Versions in native code can't be automatically synced in multi-flavor Android projects. If you are using EAS Build with app version source set to remote, the correct values will be injected at the build time.");
|
|
120
127
|
}
|
|
@@ -134,6 +141,7 @@ BuildVersionSyncView.flags = {
|
|
|
134
141
|
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
135
142
|
helpValue: 'PROFILE_NAME',
|
|
136
143
|
}),
|
|
144
|
+
...flags_1.EASEnvironmentFlagHidden,
|
|
137
145
|
};
|
|
138
146
|
BuildVersionSyncView.contextDefinition = {
|
|
139
147
|
..._a.ContextOptions.LoggedIn,
|
|
@@ -5,11 +5,13 @@ export default class Config extends EasCommand {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../graphql/generated").EnvironmentVariableEnvironment | undefined>;
|
|
8
9
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<Platform | undefined>;
|
|
9
10
|
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
11
|
'eas-json-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
static contextDefinition: {
|
|
14
|
+
sessionManager: import("../commandUtils/context/SessionManagementContextField").default;
|
|
13
15
|
projectDir: import("../commandUtils/context/ProjectDirContextField").default;
|
|
14
16
|
getDynamicPublicProjectConfigAsync: import("../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
|
|
15
17
|
getDynamicPrivateProjectConfigAsync: import("../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
|
package/build/commands/config.js
CHANGED
|
@@ -7,7 +7,9 @@ const eas_build_job_1 = require("@expo/eas-build-job");
|
|
|
7
7
|
const eas_json_1 = require("@expo/eas-json");
|
|
8
8
|
const core_1 = require("@oclif/core");
|
|
9
9
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const evaluateConfigWithEnvVarsAsync_1 = require("../build/evaluateConfigWithEnvVarsAsync");
|
|
10
11
|
const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand"));
|
|
12
|
+
const createGraphqlClient_1 = require("../commandUtils/context/contextUtils/createGraphqlClient");
|
|
11
13
|
const flags_1 = require("../commandUtils/flags");
|
|
12
14
|
const AppPlatform_1 = require("../graphql/types/AppPlatform");
|
|
13
15
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
@@ -20,9 +22,9 @@ class Config extends EasCommand_1.default {
|
|
|
20
22
|
if (flags.json) {
|
|
21
23
|
(0, json_1.enableJsonOutput)();
|
|
22
24
|
}
|
|
23
|
-
const { platform: maybePlatform, profile: maybeProfile } = flags;
|
|
24
|
-
const { getDynamicPublicProjectConfigAsync, projectDir } = await this.getContextAsync(_a, {
|
|
25
|
-
nonInteractive
|
|
25
|
+
const { platform: maybePlatform, profile: maybeProfile, 'non-interactive': nonInteractive, } = flags;
|
|
26
|
+
const { getDynamicPublicProjectConfigAsync, projectDir, sessionManager } = await this.getContextAsync(_a, {
|
|
27
|
+
nonInteractive,
|
|
26
28
|
});
|
|
27
29
|
const accessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
28
30
|
const profileName = maybeProfile ??
|
|
@@ -55,8 +57,16 @@ class Config extends EasCommand_1.default {
|
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
else {
|
|
58
|
-
const {
|
|
59
|
-
|
|
60
|
+
const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
61
|
+
nonInteractive,
|
|
62
|
+
});
|
|
63
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
64
|
+
const { exp: appConfig } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
|
|
65
|
+
flags,
|
|
66
|
+
buildProfile: profile,
|
|
67
|
+
graphqlClient,
|
|
68
|
+
getProjectConfig: getDynamicPublicProjectConfigAsync,
|
|
69
|
+
opts: { env: profile.env },
|
|
60
70
|
});
|
|
61
71
|
if (flags.json) {
|
|
62
72
|
(0, json_1.printJsonOnlyOutput)({ buildProfile: profile, appConfig });
|
|
@@ -90,10 +100,12 @@ Config.flags = {
|
|
|
90
100
|
'eas-json-only': core_1.Flags.boolean({
|
|
91
101
|
hidden: true,
|
|
92
102
|
}),
|
|
103
|
+
...flags_1.EASEnvironmentFlagHidden,
|
|
93
104
|
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
94
105
|
};
|
|
95
106
|
Config.contextDefinition = {
|
|
96
107
|
..._a.ContextOptions.DynamicProjectConfig,
|
|
97
108
|
..._a.ContextOptions.ProjectDir,
|
|
109
|
+
..._a.ContextOptions.SessionManagment,
|
|
98
110
|
};
|
|
99
111
|
exports.default = Config;
|
|
@@ -117,7 +117,7 @@ class DeviceDelete extends EasCommand_1.default {
|
|
|
117
117
|
log_1.default.addNewLineIfNone();
|
|
118
118
|
log_1.default.log((0, formatDevice_1.default)(device, {
|
|
119
119
|
appleTeamName,
|
|
120
|
-
appleTeamIdentifier
|
|
120
|
+
appleTeamIdentifier,
|
|
121
121
|
}));
|
|
122
122
|
log_1.default.newLine();
|
|
123
123
|
}
|
|
@@ -106,7 +106,7 @@ class DeviceRename extends EasCommand_1.default {
|
|
|
106
106
|
log_1.default.addNewLineIfNone();
|
|
107
107
|
log_1.default.log((0, formatDevice_1.default)(device, {
|
|
108
108
|
appleTeamName,
|
|
109
|
-
appleTeamIdentifier
|
|
109
|
+
appleTeamIdentifier,
|
|
110
110
|
}));
|
|
111
111
|
log_1.default.newLine();
|
|
112
112
|
}
|
|
@@ -39,7 +39,10 @@ class EnvironmentVariableCreate extends EasCommand_1.default {
|
|
|
39
39
|
if (!environment) {
|
|
40
40
|
environment = await (0, prompts_2.promptVariableEnvironmentAsync)(nonInteractive);
|
|
41
41
|
}
|
|
42
|
-
const existingVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdAsync(graphqlClient,
|
|
42
|
+
const existingVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdAsync(graphqlClient, {
|
|
43
|
+
appId: projectId,
|
|
44
|
+
environment,
|
|
45
|
+
});
|
|
43
46
|
const existingVariable = existingVariables.find(variable => variable.name === name);
|
|
44
47
|
if (existingVariable) {
|
|
45
48
|
if (existingVariable.scope === generated_1.EnvironmentVariableScope.Shared) {
|
|
@@ -87,7 +90,9 @@ class EnvironmentVariableCreate extends EasCommand_1.default {
|
|
|
87
90
|
log_1.default.withTick(`Created a new variable ${chalk_1.default.bold(name)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
|
|
88
91
|
}
|
|
89
92
|
else if (scope === generated_1.EnvironmentVariableScope.Shared) {
|
|
90
|
-
const sharedVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedAsync(graphqlClient,
|
|
93
|
+
const sharedVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedAsync(graphqlClient, {
|
|
94
|
+
appId: projectId,
|
|
95
|
+
});
|
|
91
96
|
const existingVariable = sharedVariables.find(variable => variable.name === name);
|
|
92
97
|
if (existingVariable) {
|
|
93
98
|
throw new Error(`Shared variable with ${name} name already exists on this account.\n` +
|
|
@@ -25,8 +25,11 @@ class EnvironmentVariableDelete extends EasCommand_1.default {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
const variables = scope === generated_1.EnvironmentVariableScope.Project && environment
|
|
28
|
-
? await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdAsync(graphqlClient,
|
|
29
|
-
|
|
28
|
+
? await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdAsync(graphqlClient, {
|
|
29
|
+
appId: projectId,
|
|
30
|
+
environment,
|
|
31
|
+
})
|
|
32
|
+
: await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedAsync(graphqlClient, { appId: projectId });
|
|
30
33
|
if (!name) {
|
|
31
34
|
({ name } = await (0, prompts_1.promptAsync)({
|
|
32
35
|
type: 'select',
|
|
@@ -78,14 +78,22 @@ async function getVariableAsync(graphqlClient, scope, projectId, name, environme
|
|
|
78
78
|
if (!environment && scope === generated_1.EnvironmentVariableScope.Project) {
|
|
79
79
|
throw new Error('Environment is required.');
|
|
80
80
|
}
|
|
81
|
+
if (!name) {
|
|
82
|
+
throw new Error("Variable name is required. Run the command with '--name VARIABLE_NAME' flag.");
|
|
83
|
+
}
|
|
81
84
|
if (environment && scope === generated_1.EnvironmentVariableScope.Project) {
|
|
82
|
-
const appVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.
|
|
85
|
+
const appVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdWithSensitiveAsync(graphqlClient, {
|
|
86
|
+
appId: projectId,
|
|
87
|
+
environment,
|
|
88
|
+
filterNames: [name],
|
|
89
|
+
});
|
|
83
90
|
return appVariables[0];
|
|
84
91
|
}
|
|
85
92
|
if (scope === generated_1.EnvironmentVariableScope.Shared) {
|
|
86
|
-
const sharedVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
const sharedVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedWithSensitiveAsync(graphqlClient, {
|
|
94
|
+
appId: projectId,
|
|
95
|
+
filterNames: [name],
|
|
96
|
+
});
|
|
89
97
|
return sharedVariables[0];
|
|
90
98
|
}
|
|
91
99
|
return null;
|
|
@@ -19,7 +19,9 @@ class EnvironmentVariableLink extends EasCommand_1.default {
|
|
|
19
19
|
nonInteractive,
|
|
20
20
|
});
|
|
21
21
|
const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
|
|
22
|
-
const variables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedAsync(graphqlClient,
|
|
22
|
+
const variables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedAsync(graphqlClient, {
|
|
23
|
+
appId: projectId,
|
|
24
|
+
});
|
|
23
25
|
if (!name) {
|
|
24
26
|
name = await (0, prompts_1.selectAsync)('Select shared variable', variables.map(variable => ({
|
|
25
27
|
title: variable.name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import { EnvironmentVariableScope } from '../../graphql/generated';
|
|
2
|
+
import { EnvironmentVariableEnvironment, EnvironmentVariableScope } from '../../graphql/generated';
|
|
3
3
|
export default class EnvironmentValueList extends EasCommand {
|
|
4
4
|
static description: string;
|
|
5
5
|
static hidden: boolean;
|
|
@@ -8,9 +8,11 @@ export default class EnvironmentValueList extends EasCommand {
|
|
|
8
8
|
privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
|
|
9
9
|
};
|
|
10
10
|
static flags: {
|
|
11
|
-
environment: import("@oclif/core/lib/interfaces").OptionFlag<
|
|
11
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
|
|
12
12
|
scope: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableScope>;
|
|
13
13
|
format: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
14
|
+
'include-sensitive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
};
|
|
15
16
|
runAsync(): Promise<void>;
|
|
17
|
+
private getVariablesForScopeAsync;
|
|
16
18
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
5
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
7
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
8
|
const flags_1 = require("../../commandUtils/flags");
|
|
@@ -12,16 +13,19 @@ const formatVariable_1 = require("../../utils/formatVariable");
|
|
|
12
13
|
const prompts_1 = require("../../utils/prompts");
|
|
13
14
|
class EnvironmentValueList extends EasCommand_1.default {
|
|
14
15
|
async runAsync() {
|
|
15
|
-
let { flags: { environment, format, scope }, } = await this.parse(_a);
|
|
16
|
+
let { flags: { environment, format, scope, 'include-sensitive': includeSensitive }, } = await this.parse(_a);
|
|
16
17
|
const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
|
|
17
18
|
nonInteractive: true,
|
|
18
19
|
});
|
|
19
20
|
if (scope === generated_1.EnvironmentVariableScope.Project && !environment) {
|
|
20
21
|
environment = await (0, prompts_1.promptVariableEnvironmentAsync)(false);
|
|
21
22
|
}
|
|
22
|
-
const variables =
|
|
23
|
-
|
|
24
|
-
:
|
|
23
|
+
const variables = await this.getVariablesForScopeAsync(graphqlClient, {
|
|
24
|
+
scope,
|
|
25
|
+
includingSensitive: includeSensitive,
|
|
26
|
+
environment,
|
|
27
|
+
projectId,
|
|
28
|
+
});
|
|
25
29
|
if (format === 'short') {
|
|
26
30
|
for (const variable of variables) {
|
|
27
31
|
// TODO: Add Learn more link
|
|
@@ -39,6 +43,25 @@ class EnvironmentValueList extends EasCommand_1.default {
|
|
|
39
43
|
log_1.default.log(variables.map(variable => (0, formatVariable_1.formatVariable)(variable)).join(`\n\n${chalk_1.default.dim('———')}\n\n`));
|
|
40
44
|
}
|
|
41
45
|
}
|
|
46
|
+
async getVariablesForScopeAsync(graphqlClient, { scope, includingSensitive, environment, projectId, }) {
|
|
47
|
+
if (scope === generated_1.EnvironmentVariableScope.Project && environment) {
|
|
48
|
+
if (includingSensitive) {
|
|
49
|
+
return await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdWithSensitiveAsync(graphqlClient, {
|
|
50
|
+
appId: projectId,
|
|
51
|
+
environment,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdAsync(graphqlClient, {
|
|
55
|
+
appId: projectId,
|
|
56
|
+
environment,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return includingSensitive
|
|
60
|
+
? await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedWithSensitiveAsync(graphqlClient, {
|
|
61
|
+
appId: projectId,
|
|
62
|
+
})
|
|
63
|
+
: await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedAsync(graphqlClient, { appId: projectId });
|
|
64
|
+
}
|
|
42
65
|
}
|
|
43
66
|
_a = EnvironmentValueList;
|
|
44
67
|
EnvironmentValueList.description = 'list environment variables for the current project';
|
|
@@ -48,6 +71,10 @@ EnvironmentValueList.contextDefinition = {
|
|
|
48
71
|
..._a.ContextOptions.LoggedIn,
|
|
49
72
|
};
|
|
50
73
|
EnvironmentValueList.flags = {
|
|
74
|
+
'include-sensitive': core_1.Flags.boolean({
|
|
75
|
+
description: 'Display sensitive values in the output',
|
|
76
|
+
default: false,
|
|
77
|
+
}),
|
|
51
78
|
...flags_1.EASVariableFormatFlag,
|
|
52
79
|
...flags_1.EASVariableScopeFlag,
|
|
53
80
|
...flags_1.EASEnvironmentFlag,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export default class EnvironmentValuePull extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static hidden: boolean;
|
|
5
|
+
static contextDefinition: {
|
|
6
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
7
|
+
privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
11
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../../graphql/generated").EnvironmentVariableEnvironment | undefined>;
|
|
13
|
+
};
|
|
14
|
+
runAsync(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
7
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
8
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
9
|
+
const EnvironmentVariablesQuery_1 = require("../../graphql/queries/EnvironmentVariablesQuery");
|
|
10
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
11
|
+
const prompts_1 = require("../../prompts");
|
|
12
|
+
const prompts_2 = require("../../utils/prompts");
|
|
13
|
+
class EnvironmentValuePull extends EasCommand_1.default {
|
|
14
|
+
async runAsync() {
|
|
15
|
+
let { flags: { environment, path: targetPath, 'non-interactive': nonInteractive }, } = await this.parse(_a);
|
|
16
|
+
if (!environment) {
|
|
17
|
+
environment = await (0, prompts_2.promptVariableEnvironmentAsync)(nonInteractive);
|
|
18
|
+
}
|
|
19
|
+
const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
|
|
20
|
+
nonInteractive,
|
|
21
|
+
});
|
|
22
|
+
targetPath = targetPath ?? '.env.local';
|
|
23
|
+
const environmentVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdWithSensitiveAsync(graphqlClient, {
|
|
24
|
+
appId: projectId,
|
|
25
|
+
environment,
|
|
26
|
+
});
|
|
27
|
+
if (!nonInteractive && (await fs.exists(targetPath))) {
|
|
28
|
+
const result = await (0, prompts_1.confirmAsync)({
|
|
29
|
+
message: `File ${targetPath} already exists. Do you want to overwrite it?`,
|
|
30
|
+
});
|
|
31
|
+
if (!result) {
|
|
32
|
+
log_1.default.log('Aborting...');
|
|
33
|
+
throw new Error(`File ${targetPath} already exists.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const filePrefix = `# Environment: ${environment}\n\n`;
|
|
37
|
+
const envFileContent = environmentVariables
|
|
38
|
+
.map((variable) => {
|
|
39
|
+
if (variable.value === null) {
|
|
40
|
+
return `# ${variable.name}=***** (secret variables are not available for reading)`;
|
|
41
|
+
}
|
|
42
|
+
return `${variable.name}=${variable.value}`;
|
|
43
|
+
})
|
|
44
|
+
.join('\n');
|
|
45
|
+
await fs.writeFile(targetPath, filePrefix + envFileContent);
|
|
46
|
+
log_1.default.log(`Pulled environment variables from ${environment} environment to ${targetPath}.`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
_a = EnvironmentValuePull;
|
|
50
|
+
EnvironmentValuePull.description = 'pull env file';
|
|
51
|
+
EnvironmentValuePull.hidden = true;
|
|
52
|
+
EnvironmentValuePull.contextDefinition = {
|
|
53
|
+
..._a.ContextOptions.ProjectConfig,
|
|
54
|
+
..._a.ContextOptions.LoggedIn,
|
|
55
|
+
};
|
|
56
|
+
EnvironmentValuePull.flags = {
|
|
57
|
+
...flags_1.EASEnvironmentFlag,
|
|
58
|
+
...flags_1.EASNonInteractiveFlag,
|
|
59
|
+
path: core_1.Flags.string({
|
|
60
|
+
description: 'Path to the result `.env` file',
|
|
61
|
+
default: '.env.local',
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
exports.default = EnvironmentValuePull;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
import { EnvironmentVariableEnvironment } from '../../graphql/generated';
|
|
3
|
+
export default class EnvironmentVariablePush extends EasCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static hidden: boolean;
|
|
6
|
+
static contextDefinition: {
|
|
7
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
8
|
+
privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
12
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
|
|
13
|
+
};
|
|
14
|
+
runAsync(): Promise<void>;
|
|
15
|
+
private parseEnvFileAsync;
|
|
16
|
+
private validateFlags;
|
|
17
|
+
}
|