eas-cli 16.13.4 → 16.14.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.
Files changed (38) hide show
  1. package/README.md +107 -79
  2. package/build/commands/env/create.d.ts +0 -1
  3. package/build/commands/env/create.js +1 -28
  4. package/build/commands/update/delete.js +2 -20
  5. package/build/commands/update/republish.js +2 -139
  6. package/build/commands/update/revert-update-rollout.d.ts +24 -0
  7. package/build/commands/update/revert-update-rollout.js +264 -0
  8. package/build/commands/update/roll-back-to-embedded.d.ts +0 -2
  9. package/build/commands/update/roll-back-to-embedded.js +13 -133
  10. package/build/credentials/ios/actions/AppleTeamUtils.js +1 -1
  11. package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.js +1 -1
  12. package/build/credentials/ios/api/GraphqlClient.d.ts +1 -1
  13. package/build/credentials/ios/api/GraphqlClient.js +14 -8
  14. package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.d.ts +3 -5
  15. package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.js +22 -6
  16. package/build/devices/manager.js +2 -15
  17. package/build/graphql/generated.d.ts +107 -137
  18. package/build/graphql/generated.js +15 -3
  19. package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +0 -2
  20. package/build/graphql/mutations/EnvironmentVariableMutation.js +0 -48
  21. package/build/graphql/types/Update.js +1 -0
  22. package/build/project/publish.js +1 -0
  23. package/build/update/delete.d.ts +5 -0
  24. package/build/update/delete.js +24 -0
  25. package/build/update/queries.d.ts +13 -1
  26. package/build/update/queries.js +62 -1
  27. package/build/update/republish.d.ts +27 -0
  28. package/build/update/republish.js +242 -1
  29. package/build/update/roll-back-to-embedded.d.ts +18 -0
  30. package/build/update/roll-back-to-embedded.js +119 -0
  31. package/build/user/fetchUser.js +15 -13
  32. package/build/utils/statuspageService.js +1 -0
  33. package/oclif.manifest.json +78 -114
  34. package/package.json +3 -2
  35. package/build/commands/env/link.d.ts +0 -23
  36. package/build/commands/env/link.js +0 -128
  37. package/build/commands/env/unlink.d.ts +0 -22
  38. package/build/commands/env/unlink.js +0 -117
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "16.13.4",
2
+ "version": "16.14.1",
3
3
  "commands": {
4
4
  "analytics": {
5
5
  "id": "analytics",
@@ -2283,13 +2283,6 @@
2283
2283
  "description": "Text value or the variable",
2284
2284
  "multiple": false
2285
2285
  },
2286
- "link": {
2287
- "name": "link",
2288
- "type": "boolean",
2289
- "description": "Link account-wide variable to the current project",
2290
- "hidden": true,
2291
- "allowNo": false
2292
- },
2293
2286
  "force": {
2294
2287
  "name": "force",
2295
2288
  "type": "boolean",
@@ -2524,65 +2517,6 @@
2524
2517
  "loggedIn": {}
2525
2518
  }
2526
2519
  },
2527
- "env:link": {
2528
- "id": "env:link",
2529
- "description": "link an account-wide environment variable to the current project",
2530
- "strict": true,
2531
- "pluginName": "eas-cli",
2532
- "pluginAlias": "eas-cli",
2533
- "pluginType": "core",
2534
- "hidden": true,
2535
- "aliases": [],
2536
- "flags": {
2537
- "variable-name": {
2538
- "name": "variable-name",
2539
- "type": "option",
2540
- "description": "Name of the variable",
2541
- "multiple": false
2542
- },
2543
- "variable-environment": {
2544
- "name": "variable-environment",
2545
- "type": "option",
2546
- "description": "Current environment of the variable to link",
2547
- "helpValue": "(development|preview|production)",
2548
- "multiple": false,
2549
- "options": [
2550
- "development",
2551
- "preview",
2552
- "production"
2553
- ]
2554
- },
2555
- "environment": {
2556
- "name": "environment",
2557
- "type": "option",
2558
- "description": "Environment variable's environment",
2559
- "helpValue": "(development|preview|production)",
2560
- "multiple": true,
2561
- "options": [
2562
- "development",
2563
- "preview",
2564
- "production"
2565
- ]
2566
- },
2567
- "non-interactive": {
2568
- "name": "non-interactive",
2569
- "type": "boolean",
2570
- "description": "Run the command in non-interactive mode.",
2571
- "allowNo": false
2572
- }
2573
- },
2574
- "args": {
2575
- "environment": {
2576
- "name": "environment",
2577
- "description": "Environment to pull variables from. One of 'production', 'preview', or 'development'.",
2578
- "required": false
2579
- }
2580
- },
2581
- "contextDefinition": {
2582
- "projectId": {},
2583
- "loggedIn": {}
2584
- }
2585
- },
2586
2520
  "env:list": {
2587
2521
  "id": "env:list",
2588
2522
  "description": "list environment variables for the current project or account",
@@ -2742,53 +2676,6 @@
2742
2676
  "loggedIn": {}
2743
2677
  }
2744
2678
  },
2745
- "env:unlink": {
2746
- "id": "env:unlink",
2747
- "description": "unlink an account-wide environment variable from the current project",
2748
- "strict": true,
2749
- "pluginName": "eas-cli",
2750
- "pluginAlias": "eas-cli",
2751
- "pluginType": "core",
2752
- "hidden": true,
2753
- "aliases": [],
2754
- "flags": {
2755
- "variable-name": {
2756
- "name": "variable-name",
2757
- "type": "option",
2758
- "description": "Name of the variable",
2759
- "multiple": false
2760
- },
2761
- "environment": {
2762
- "name": "environment",
2763
- "type": "option",
2764
- "description": "Environment variable's environment",
2765
- "helpValue": "(development|preview|production)",
2766
- "multiple": true,
2767
- "options": [
2768
- "development",
2769
- "preview",
2770
- "production"
2771
- ]
2772
- },
2773
- "non-interactive": {
2774
- "name": "non-interactive",
2775
- "type": "boolean",
2776
- "description": "Run the command in non-interactive mode.",
2777
- "allowNo": false
2778
- }
2779
- },
2780
- "args": {
2781
- "environment": {
2782
- "name": "environment",
2783
- "description": "Environment to unlink the variable from. One of 'production', 'preview', or 'development'.",
2784
- "required": false
2785
- }
2786
- },
2787
- "contextDefinition": {
2788
- "projectId": {},
2789
- "loggedIn": {}
2790
- }
2791
- },
2792
2679
  "env:update": {
2793
2680
  "id": "env:update",
2794
2681
  "description": "update an environment variable on the current project or account",
@@ -3855,6 +3742,83 @@
3855
3742
  "privateProjectConfig": {}
3856
3743
  }
3857
3744
  },
3745
+ "update:revert-update-rollout": {
3746
+ "id": "update:revert-update-rollout",
3747
+ "description": "revert a rollout update for a project",
3748
+ "strict": true,
3749
+ "pluginName": "eas-cli",
3750
+ "pluginAlias": "eas-cli",
3751
+ "pluginType": "core",
3752
+ "aliases": [],
3753
+ "flags": {
3754
+ "channel": {
3755
+ "name": "channel",
3756
+ "type": "option",
3757
+ "description": "Channel name to select an update group to revert the rollout update from",
3758
+ "multiple": false,
3759
+ "exclusive": [
3760
+ "branch",
3761
+ "group"
3762
+ ]
3763
+ },
3764
+ "branch": {
3765
+ "name": "branch",
3766
+ "type": "option",
3767
+ "description": "Branch name to select an update group to revert the rollout update from",
3768
+ "multiple": false,
3769
+ "exclusive": [
3770
+ "channel",
3771
+ "group"
3772
+ ]
3773
+ },
3774
+ "group": {
3775
+ "name": "group",
3776
+ "type": "option",
3777
+ "description": "Rollout update group ID to revert",
3778
+ "multiple": false,
3779
+ "exclusive": [
3780
+ "branch",
3781
+ "channel"
3782
+ ]
3783
+ },
3784
+ "message": {
3785
+ "name": "message",
3786
+ "type": "option",
3787
+ "char": "m",
3788
+ "description": "Short message describing the revert",
3789
+ "required": false,
3790
+ "multiple": false
3791
+ },
3792
+ "private-key-path": {
3793
+ "name": "private-key-path",
3794
+ "type": "option",
3795
+ "description": "File containing the PEM-encoded private key corresponding to the certificate in expo-updates' configuration. Defaults to a file named \"private-key.pem\" in the certificate's directory. Only relevant if you are using code signing: https://docs.expo.dev/eas-update/code-signing/",
3796
+ "required": false,
3797
+ "multiple": false
3798
+ },
3799
+ "json": {
3800
+ "name": "json",
3801
+ "type": "boolean",
3802
+ "description": "Enable JSON output, non-JSON messages will be printed to stderr.",
3803
+ "allowNo": false,
3804
+ "dependsOn": [
3805
+ "non-interactive"
3806
+ ]
3807
+ },
3808
+ "non-interactive": {
3809
+ "name": "non-interactive",
3810
+ "type": "boolean",
3811
+ "description": "Run the command in non-interactive mode.",
3812
+ "allowNo": false
3813
+ }
3814
+ },
3815
+ "args": {},
3816
+ "contextDefinition": {
3817
+ "loggedIn": {},
3818
+ "privateProjectConfig": {},
3819
+ "vcsClient": {}
3820
+ }
3821
+ },
3858
3822
  "update:roll-back-to-embedded": {
3859
3823
  "id": "update:roll-back-to-embedded",
3860
3824
  "description": "roll back to the embedded update",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eas-cli",
3
3
  "description": "EAS command line tool",
4
- "version": "16.13.4",
4
+ "version": "16.14.1",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bin": {
7
7
  "eas": "./bin/run"
@@ -234,11 +234,12 @@
234
234
  "test": "jest",
235
235
  "version": "yarn oclif readme && node scripts/patch-readme && git add README.md",
236
236
  "generate-graphql-code": "graphql-codegen --config graphql-codegen.yml",
237
+ "verify-graphql-code": "./scripts/verify-graphql.sh",
237
238
  "clean": "rimraf dist build tmp node_modules yarn-error.log"
238
239
  },
239
240
  "volta": {
240
241
  "node": "20.11.0",
241
242
  "yarn": "1.22.21"
242
243
  },
243
- "gitHead": "8ec3c52be8e1ec356810526a36968d28ae90a0ae"
244
+ "gitHead": "2502b843f8f75322d0d9b87476efc9bc975631ba"
244
245
  }
@@ -1,23 +0,0 @@
1
- import EasCommand from '../../commandUtils/EasCommand';
2
- import { EnvironmentVariableEnvironment } from '../../graphql/generated';
3
- export default class EnvLink extends EasCommand {
4
- static description: string;
5
- static hidden: boolean;
6
- static flags: {
7
- 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
- environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment[] | undefined>;
9
- 'variable-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
- 'variable-environment': import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
11
- };
12
- static args: {
13
- name: string;
14
- description: string;
15
- required: boolean;
16
- }[];
17
- static contextDefinition: {
18
- loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
19
- projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
20
- };
21
- runAsync(): Promise<void>;
22
- private validateInputs;
23
- }
@@ -1,128 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
- const flags_1 = require("../../commandUtils/flags");
8
- const generated_1 = require("../../graphql/generated");
9
- const EnvironmentVariableMutation_1 = require("../../graphql/mutations/EnvironmentVariableMutation");
10
- const EnvironmentVariablesQuery_1 = require("../../graphql/queries/EnvironmentVariablesQuery");
11
- const log_1 = tslib_1.__importDefault(require("../../log"));
12
- const projectUtils_1 = require("../../project/projectUtils");
13
- const prompts_1 = require("../../prompts");
14
- const prompts_2 = require("../../utils/prompts");
15
- const variableUtils_1 = require("../../utils/variableUtils");
16
- class EnvLink extends EasCommand_1.default {
17
- static description = 'link an account-wide environment variable to the current project';
18
- // for now we only roll out global account-wide env variables so this should stay hidden
19
- static hidden = true;
20
- static flags = {
21
- 'variable-name': core_1.Flags.string({
22
- description: 'Name of the variable',
23
- }),
24
- 'variable-environment': core_1.Flags.enum({
25
- ...flags_1.EasEnvironmentFlagParameters,
26
- description: 'Current environment of the variable to link',
27
- }),
28
- ...flags_1.EASMultiEnvironmentFlag,
29
- ...flags_1.EASNonInteractiveFlag,
30
- };
31
- static args = [
32
- {
33
- name: 'environment',
34
- description: "Environment to pull variables from. One of 'production', 'preview', or 'development'.",
35
- required: false,
36
- },
37
- ];
38
- static contextDefinition = {
39
- ...this.ContextOptions.ProjectId,
40
- ...this.ContextOptions.LoggedIn,
41
- };
42
- async runAsync() {
43
- const { args, flags } = await this.parse(EnvLink);
44
- let { 'variable-name': name, 'variable-environment': currentEnvironment, 'non-interactive': nonInteractive, environment: environments, } = this.validateInputs(flags, args);
45
- const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(EnvLink, {
46
- nonInteractive,
47
- });
48
- const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
49
- const variables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedAsync(graphqlClient, {
50
- appId: projectId,
51
- environment: currentEnvironment,
52
- filterNames: name ? [name] : undefined,
53
- });
54
- let selectedVariable = variables[0];
55
- if (variables.length > 1) {
56
- if (nonInteractive) {
57
- throw new Error('Multiple variables found, run command with --variable-name and --variable-environment arguments.');
58
- }
59
- selectedVariable = await (0, prompts_1.selectAsync)('Select account-wide variable', variables.map(variable => ({
60
- title: (0, variableUtils_1.formatVariableName)(variable),
61
- value: variable,
62
- })));
63
- }
64
- if (!selectedVariable) {
65
- throw new Error(`Account-wide variable ${name} doesn't exist`);
66
- }
67
- let explicitSelect = false;
68
- if (!nonInteractive && !environments) {
69
- const selectedEnvironments = (selectedVariable.linkedEnvironments ?? []).length > 0
70
- ? selectedVariable.linkedEnvironments
71
- : selectedVariable.environments;
72
- environments = await (0, prompts_2.promptVariableEnvironmentAsync)({
73
- nonInteractive,
74
- multiple: true,
75
- selectedEnvironments: selectedEnvironments ?? [],
76
- });
77
- explicitSelect = true;
78
- }
79
- if (!environments) {
80
- await EnvironmentVariableMutation_1.EnvironmentVariableMutation.linkSharedEnvironmentVariableAsync(graphqlClient, selectedVariable.id, projectId);
81
- log_1.default.withTick(`Linked variable ${chalk_1.default.bold(selectedVariable.name)} to project ${chalk_1.default.bold(projectDisplayName)} in ${selectedVariable.environments?.join(', ').toLocaleLowerCase()}.`);
82
- return;
83
- }
84
- for (const environment of Object.values(generated_1.EnvironmentVariableEnvironment)) {
85
- try {
86
- if (selectedVariable.linkedEnvironments?.includes(environment) ===
87
- environments.includes(environment)) {
88
- if (!explicitSelect && environments.includes(environment)) {
89
- log_1.default.withTick(`Variable ${chalk_1.default.bold(selectedVariable.name)} is already linked to ${environment.toLocaleLowerCase()}.`);
90
- }
91
- continue;
92
- }
93
- if (environments.includes(environment)) {
94
- await EnvironmentVariableMutation_1.EnvironmentVariableMutation.linkSharedEnvironmentVariableAsync(graphqlClient, selectedVariable.id, projectId, environment);
95
- log_1.default.withTick(`Linked variable ${chalk_1.default.bold(selectedVariable.name)} to project ${chalk_1.default.bold(projectDisplayName)} in ${environment.toLocaleLowerCase()}.`);
96
- }
97
- else if (explicitSelect) {
98
- await EnvironmentVariableMutation_1.EnvironmentVariableMutation.unlinkSharedEnvironmentVariableAsync(graphqlClient, selectedVariable.id, projectId, environment);
99
- log_1.default.withTick(`Unlinked variable ${chalk_1.default.bold(selectedVariable.name)} from project ${chalk_1.default.bold(projectDisplayName)} in ${environment.toLocaleLowerCase()}.`);
100
- }
101
- }
102
- catch (err) {
103
- log_1.default.warn(err.message);
104
- }
105
- }
106
- }
107
- validateInputs(flags, { environment }) {
108
- environment = environment?.toUpperCase();
109
- if (environment && !(0, variableUtils_1.isEnvironment)(environment)) {
110
- throw new Error("Invalid environment. Use one of 'production', 'preview', or 'development'.");
111
- }
112
- const environments = flags.environment
113
- ? flags.environment
114
- : environment
115
- ? [environment]
116
- : undefined;
117
- if (flags['non-interactive']) {
118
- if (!flags['variable-name']) {
119
- throw new Error(`Environment variable needs 'name' to be specified when running in non-interactive mode. Run the command with ${chalk_1.default.bold('--variable-name VARIABLE_NAME')} flag to fix the issue`);
120
- }
121
- }
122
- return {
123
- ...flags,
124
- environment: environments,
125
- };
126
- }
127
- }
128
- exports.default = EnvLink;
@@ -1,22 +0,0 @@
1
- import EasCommand from '../../commandUtils/EasCommand';
2
- import { EnvironmentVariableEnvironment } from '../../graphql/generated';
3
- export default class EnvUnlink extends EasCommand {
4
- static description: string;
5
- static hidden: boolean;
6
- static flags: {
7
- 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
- environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment[] | undefined>;
9
- 'variable-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
- };
11
- static contextDefinition: {
12
- loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
13
- projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
14
- };
15
- static args: {
16
- name: string;
17
- description: string;
18
- required: boolean;
19
- }[];
20
- runAsync(): Promise<void>;
21
- private validateInputs;
22
- }
@@ -1,117 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
- const flags_1 = require("../../commandUtils/flags");
8
- const generated_1 = require("../../graphql/generated");
9
- const EnvironmentVariableMutation_1 = require("../../graphql/mutations/EnvironmentVariableMutation");
10
- const EnvironmentVariablesQuery_1 = require("../../graphql/queries/EnvironmentVariablesQuery");
11
- const log_1 = tslib_1.__importDefault(require("../../log"));
12
- const projectUtils_1 = require("../../project/projectUtils");
13
- const prompts_1 = require("../../prompts");
14
- const prompts_2 = require("../../utils/prompts");
15
- const variableUtils_1 = require("../../utils/variableUtils");
16
- class EnvUnlink extends EasCommand_1.default {
17
- static description = 'unlink an account-wide environment variable from the current project';
18
- // for now we only roll out global account-wide env variables so this should stay hidden
19
- static hidden = true;
20
- static flags = {
21
- 'variable-name': core_1.Flags.string({
22
- description: 'Name of the variable',
23
- }),
24
- ...flags_1.EASMultiEnvironmentFlag,
25
- ...flags_1.EASNonInteractiveFlag,
26
- };
27
- static contextDefinition = {
28
- ...this.ContextOptions.ProjectId,
29
- ...this.ContextOptions.LoggedIn,
30
- };
31
- static args = [
32
- {
33
- name: 'environment',
34
- description: "Environment to unlink the variable from. One of 'production', 'preview', or 'development'.",
35
- required: false,
36
- },
37
- ];
38
- async runAsync() {
39
- const { args, flags } = await this.parse(EnvUnlink);
40
- let { 'variable-name': name, 'non-interactive': nonInteractive, environment: unlinkEnvironments, } = this.validateInputs(flags, args);
41
- const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(EnvUnlink, {
42
- nonInteractive,
43
- });
44
- const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
45
- const variables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.sharedAsync(graphqlClient, {
46
- appId: projectId,
47
- filterNames: name ? [name] : undefined,
48
- });
49
- let selectedVariable = variables[0];
50
- if (variables.length > 1) {
51
- if (nonInteractive) {
52
- throw new Error("Multiple variables found, please select one using '--variable-name'");
53
- }
54
- selectedVariable = await (0, prompts_1.selectAsync)('Select account-wide variable', variables.map(variable => ({
55
- title: (0, variableUtils_1.formatVariableName)(variable),
56
- value: variable,
57
- })));
58
- }
59
- if (!selectedVariable) {
60
- throw new Error(`Account-wide variable ${name} doesn't exist`);
61
- }
62
- let explicitSelect = false;
63
- if (!nonInteractive && !unlinkEnvironments) {
64
- const selectedEnvironments = (selectedVariable.linkedEnvironments ?? []).length > 0
65
- ? selectedVariable.linkedEnvironments
66
- : selectedVariable.environments;
67
- const environments = await (0, prompts_2.promptVariableEnvironmentAsync)({
68
- nonInteractive,
69
- multiple: true,
70
- selectedEnvironments: selectedEnvironments ?? [],
71
- });
72
- explicitSelect = true;
73
- unlinkEnvironments = Object.values(generated_1.EnvironmentVariableEnvironment).filter(env => !environments.includes(env));
74
- }
75
- if (!unlinkEnvironments) {
76
- await EnvironmentVariableMutation_1.EnvironmentVariableMutation.unlinkSharedEnvironmentVariableAsync(graphqlClient, selectedVariable.id, projectId);
77
- log_1.default.withTick(`Unlinked variable ${chalk_1.default.bold(selectedVariable.name)} from project ${chalk_1.default.bold(projectDisplayName)} in ${selectedVariable.environments?.join(', ').toLocaleLowerCase()}.`);
78
- return;
79
- }
80
- for (const environment of Object.values(generated_1.EnvironmentVariableEnvironment)) {
81
- if (selectedVariable.linkedEnvironments?.includes(environment) !==
82
- unlinkEnvironments.includes(environment)) {
83
- if (!explicitSelect && unlinkEnvironments.includes(environment)) {
84
- log_1.default.withTick(`Variable ${chalk_1.default.bold(selectedVariable.name)} is already unlinked from ${environment.toLocaleLowerCase()}.`);
85
- }
86
- continue;
87
- }
88
- if (unlinkEnvironments.includes(environment)) {
89
- await EnvironmentVariableMutation_1.EnvironmentVariableMutation.unlinkSharedEnvironmentVariableAsync(graphqlClient, selectedVariable.id, projectId, environment);
90
- log_1.default.withTick(`Unlinked variable ${chalk_1.default.bold(selectedVariable.name)} from project ${chalk_1.default.bold(projectDisplayName)} in ${environment.toLocaleLowerCase()}.`);
91
- }
92
- else if (explicitSelect) {
93
- await EnvironmentVariableMutation_1.EnvironmentVariableMutation.linkSharedEnvironmentVariableAsync(graphqlClient, selectedVariable.id, projectId, environment);
94
- log_1.default.withTick(`Linked variable ${chalk_1.default.bold(selectedVariable.name)} to project ${chalk_1.default.bold(projectDisplayName)} in ${environment.toLocaleLowerCase()}.`);
95
- }
96
- }
97
- }
98
- validateInputs(flags, { environment }) {
99
- if (flags['non-interactive']) {
100
- if (!flags['variable-name']) {
101
- throw new Error('Current name is required in non-interactive mode. Run the command with --variable-name flag.');
102
- }
103
- }
104
- if (environment) {
105
- environment = environment.toUpperCase();
106
- if (!(0, variableUtils_1.isEnvironment)(environment)) {
107
- throw new Error("Invalid environment. Use one of 'production', 'preview', or 'development'.");
108
- }
109
- return {
110
- environment: [environment],
111
- ...flags,
112
- };
113
- }
114
- return flags;
115
- }
116
- }
117
- exports.default = EnvUnlink;