eas-cli 12.5.4 → 12.6.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 (147) hide show
  1. package/README.md +131 -60
  2. package/build/build/evaluateConfigWithEnvVarsAsync.js +27 -11
  3. package/build/channel/queries.js +12 -3
  4. package/build/commandUtils/EasCommand.d.ts +36 -5
  5. package/build/commandUtils/EasCommand.js +27 -2
  6. package/build/commandUtils/context/ContextField.d.ts +5 -0
  7. package/build/commandUtils/context/DynamicLoggedInContextField.d.ts +14 -0
  8. package/build/commandUtils/context/DynamicLoggedInContextField.js +25 -0
  9. package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +2 -2
  10. package/build/commandUtils/context/DynamicProjectConfigContextField.js +40 -2
  11. package/build/commandUtils/context/LoggedInContextField.d.ts +7 -7
  12. package/build/commandUtils/context/LoggedInContextField.js +2 -1
  13. package/build/commandUtils/context/MaybeLoggedInContextField.d.ts +9 -7
  14. package/build/commandUtils/context/MaybeLoggedInContextField.js +1 -0
  15. package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.d.ts +1 -1
  16. package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.js +17 -2
  17. package/build/commandUtils/context/PrivateProjectConfigContextField.d.ts +1 -1
  18. package/build/commandUtils/context/PrivateProjectConfigContextField.js +17 -2
  19. package/build/commandUtils/context/ProjectIdContextField.d.ts +4 -0
  20. package/build/commandUtils/context/ProjectIdContextField.js +19 -0
  21. package/build/commandUtils/context/ServerSideEnvironmentVariablesContextField.d.ts +6 -0
  22. package/build/commandUtils/context/ServerSideEnvironmentVariablesContextField.js +36 -0
  23. package/build/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.d.ts +7 -0
  24. package/build/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.js +42 -0
  25. package/build/commands/account/view.d.ts +0 -1
  26. package/build/commands/account/view.js +2 -3
  27. package/build/commands/branch/create.d.ts +1 -1
  28. package/build/commands/branch/create.js +2 -2
  29. package/build/commands/branch/delete.d.ts +1 -1
  30. package/build/commands/branch/delete.js +2 -2
  31. package/build/commands/branch/list.d.ts +1 -1
  32. package/build/commands/branch/list.js +2 -2
  33. package/build/commands/branch/rename.d.ts +1 -1
  34. package/build/commands/branch/rename.js +2 -2
  35. package/build/commands/branch/view.d.ts +1 -1
  36. package/build/commands/branch/view.js +2 -2
  37. package/build/commands/build/cancel.d.ts +1 -1
  38. package/build/commands/build/cancel.js +2 -2
  39. package/build/commands/build/configure.js +1 -0
  40. package/build/commands/build/delete.d.ts +1 -1
  41. package/build/commands/build/delete.js +2 -2
  42. package/build/commands/build/index.js +1 -0
  43. package/build/commands/build/inspect.js +1 -0
  44. package/build/commands/build/internal.js +1 -0
  45. package/build/commands/build/list.d.ts +1 -1
  46. package/build/commands/build/list.js +2 -2
  47. package/build/commands/build/resign.js +1 -0
  48. package/build/commands/build/run.d.ts +1 -2
  49. package/build/commands/build/run.js +2 -3
  50. package/build/commands/build/version/get.js +1 -0
  51. package/build/commands/build/version/set.js +1 -0
  52. package/build/commands/build/version/sync.js +1 -0
  53. package/build/commands/build/view.d.ts +1 -1
  54. package/build/commands/build/view.js +2 -2
  55. package/build/commands/channel/create.d.ts +1 -1
  56. package/build/commands/channel/create.js +2 -2
  57. package/build/commands/channel/delete.d.ts +1 -1
  58. package/build/commands/channel/delete.js +2 -2
  59. package/build/commands/channel/edit.d.ts +1 -1
  60. package/build/commands/channel/edit.js +2 -2
  61. package/build/commands/channel/list.d.ts +1 -1
  62. package/build/commands/channel/list.js +2 -2
  63. package/build/commands/channel/pause.d.ts +22 -0
  64. package/build/commands/channel/pause.js +90 -0
  65. package/build/commands/channel/resume.d.ts +22 -0
  66. package/build/commands/channel/resume.js +90 -0
  67. package/build/commands/channel/rollout.js +1 -0
  68. package/build/commands/channel/view.d.ts +1 -1
  69. package/build/commands/channel/view.js +2 -2
  70. package/build/commands/config.d.ts +1 -1
  71. package/build/commands/config.js +4 -7
  72. package/build/commands/credentials/configure-build.js +1 -0
  73. package/build/commands/credentials/index.d.ts +1 -1
  74. package/build/commands/credentials/index.js +2 -1
  75. package/build/commands/device/create.d.ts +1 -1
  76. package/build/commands/device/create.js +2 -1
  77. package/build/commands/device/delete.d.ts +1 -1
  78. package/build/commands/device/delete.js +2 -2
  79. package/build/commands/device/list.d.ts +1 -1
  80. package/build/commands/device/list.js +2 -2
  81. package/build/commands/device/rename.d.ts +1 -1
  82. package/build/commands/device/rename.js +2 -2
  83. package/build/commands/device/view.d.ts +1 -1
  84. package/build/commands/device/view.js +2 -2
  85. package/build/commands/env/create.d.ts +1 -1
  86. package/build/commands/env/create.js +8 -3
  87. package/build/commands/env/delete.d.ts +1 -1
  88. package/build/commands/env/delete.js +2 -2
  89. package/build/commands/env/exec.d.ts +1 -1
  90. package/build/commands/env/exec.js +2 -2
  91. package/build/commands/env/get.d.ts +1 -1
  92. package/build/commands/env/get.js +2 -2
  93. package/build/commands/env/link.d.ts +1 -1
  94. package/build/commands/env/link.js +2 -2
  95. package/build/commands/env/list.d.ts +1 -1
  96. package/build/commands/env/list.js +2 -2
  97. package/build/commands/env/pull.d.ts +2 -1
  98. package/build/commands/env/pull.js +22 -8
  99. package/build/commands/env/push.d.ts +1 -2
  100. package/build/commands/env/push.js +21 -10
  101. package/build/commands/env/unlink.d.ts +1 -1
  102. package/build/commands/env/unlink.js +2 -2
  103. package/build/commands/env/update.d.ts +1 -1
  104. package/build/commands/env/update.js +8 -6
  105. package/build/commands/metadata/pull.js +1 -0
  106. package/build/commands/metadata/push.js +1 -0
  107. package/build/commands/open.js +1 -0
  108. package/build/commands/project/info.d.ts +1 -1
  109. package/build/commands/project/info.js +2 -2
  110. package/build/commands/secret/create.d.ts +1 -1
  111. package/build/commands/secret/create.js +2 -2
  112. package/build/commands/secret/delete.d.ts +1 -1
  113. package/build/commands/secret/delete.js +2 -2
  114. package/build/commands/secret/list.d.ts +1 -1
  115. package/build/commands/secret/list.js +2 -2
  116. package/build/commands/secret/push.d.ts +1 -1
  117. package/build/commands/secret/push.js +2 -2
  118. package/build/commands/submit/internal.js +1 -0
  119. package/build/commands/submit.js +1 -0
  120. package/build/commands/update/configure.js +1 -0
  121. package/build/commands/update/edit.d.ts +2 -2
  122. package/build/commands/update/edit.js +41 -4
  123. package/build/commands/update/index.d.ts +2 -0
  124. package/build/commands/update/index.js +29 -3
  125. package/build/commands/update/list.d.ts +1 -1
  126. package/build/commands/update/list.js +2 -2
  127. package/build/commands/update/republish.js +1 -0
  128. package/build/commands/update/roll-back-to-embedded.js +1 -0
  129. package/build/commands/webhook/create.d.ts +1 -1
  130. package/build/commands/webhook/create.js +2 -2
  131. package/build/commands/webhook/delete.d.ts +1 -1
  132. package/build/commands/webhook/delete.js +2 -2
  133. package/build/commands/webhook/list.d.ts +1 -1
  134. package/build/commands/webhook/list.js +2 -2
  135. package/build/commands/worker/alias.js +1 -0
  136. package/build/commands/worker/deploy.js +1 -1
  137. package/build/graphql/generated.d.ts +147 -19
  138. package/build/graphql/generated.js +19 -2
  139. package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +1 -0
  140. package/build/graphql/queries/ChannelQuery.js +2 -0
  141. package/build/project/publish.d.ts +2 -1
  142. package/build/project/publish.js +10 -4
  143. package/build/user/SessionManager.d.ts +1 -1
  144. package/build/utils/expoCli.d.ts +2 -1
  145. package/build/utils/expoCli.js +5 -1
  146. package/oclif.manifest.json +187 -82
  147. package/package.json +2 -2
@@ -17,7 +17,7 @@ const variableUtils_1 = require("../../utils/variableUtils");
17
17
  class EnvironmentVariableLink extends EasCommand_1.default {
18
18
  async runAsync() {
19
19
  let { flags: { 'variable-name': name, 'variable-environment': currentEnvironment, 'non-interactive': nonInteractive, environment: environments, }, } = await this.parse(_a);
20
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
20
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
21
21
  nonInteractive,
22
22
  });
23
23
  const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
@@ -95,7 +95,7 @@ EnvironmentVariableLink.flags = {
95
95
  ...flags_1.EASNonInteractiveFlag,
96
96
  };
97
97
  EnvironmentVariableLink.contextDefinition = {
98
- ..._a.ContextOptions.ProjectConfig,
98
+ ..._a.ContextOptions.ProjectId,
99
99
  ..._a.ContextOptions.LoggedIn,
100
100
  };
101
101
  exports.default = EnvironmentVariableLink;
@@ -5,7 +5,7 @@ export default class EnvironmentValueList extends EasCommand {
5
5
  static hidden: boolean;
6
6
  static contextDefinition: {
7
7
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
8
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
8
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
9
9
  };
10
10
  static flags: {
11
11
  environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment[] | undefined>;
@@ -41,7 +41,7 @@ async function getVariablesForScopeAsync(graphqlClient, { scope, includingSensit
41
41
  class EnvironmentValueList extends EasCommand_1.default {
42
42
  async runAsync() {
43
43
  let { flags: { environment: environments, format, scope, 'include-sensitive': includeSensitive, 'include-file-content': includeFileContent, 'non-interactive': nonInteractive, }, } = await this.parse(_a);
44
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
44
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
45
45
  nonInteractive: true,
46
46
  });
47
47
  if (!environments) {
@@ -84,7 +84,7 @@ _a = EnvironmentValueList;
84
84
  EnvironmentValueList.description = 'list environment variables for the current project';
85
85
  EnvironmentValueList.hidden = true;
86
86
  EnvironmentValueList.contextDefinition = {
87
- ..._a.ContextOptions.ProjectConfig,
87
+ ..._a.ContextOptions.ProjectId,
88
88
  ..._a.ContextOptions.LoggedIn,
89
89
  };
90
90
  EnvironmentValueList.flags = {
@@ -3,8 +3,9 @@ export default class EnvironmentVariablePull extends EasCommand {
3
3
  static description: string;
4
4
  static hidden: boolean;
5
5
  static contextDefinition: {
6
+ projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
6
7
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
7
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
8
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
8
9
  };
9
10
  static flags: {
10
11
  path: import("@oclif/core/lib/interfaces").OptionFlag<string>;
@@ -4,8 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const tslib_1 = require("tslib");
5
5
  const core_1 = require("@oclif/core");
6
6
  const fs = tslib_1.__importStar(require("fs-extra"));
7
+ const path_1 = tslib_1.__importDefault(require("path"));
7
8
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
8
9
  const flags_1 = require("../../commandUtils/flags");
10
+ const generated_1 = require("../../graphql/generated");
9
11
  const EnvironmentVariablesQuery_1 = require("../../graphql/queries/EnvironmentVariablesQuery");
10
12
  const log_1 = tslib_1.__importDefault(require("../../log"));
11
13
  const prompts_1 = require("../../prompts");
@@ -16,13 +18,14 @@ class EnvironmentVariablePull extends EasCommand_1.default {
16
18
  if (!environment) {
17
19
  environment = await (0, prompts_2.promptVariableEnvironmentAsync)({ nonInteractive });
18
20
  }
19
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
21
+ const { projectId, loggedIn: { graphqlClient }, projectDir, } = await this.getContextAsync(_a, {
20
22
  nonInteractive,
21
23
  });
22
24
  targetPath = targetPath ?? '.env.local';
23
25
  const environmentVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdWithSensitiveAsync(graphqlClient, {
24
26
  appId: projectId,
25
27
  environment,
28
+ includeFileContent: true,
26
29
  });
27
30
  if (!nonInteractive && (await fs.exists(targetPath))) {
28
31
  const result = await (0, prompts_1.confirmAsync)({
@@ -34,15 +37,25 @@ class EnvironmentVariablePull extends EasCommand_1.default {
34
37
  }
35
38
  }
36
39
  const filePrefix = `# Environment: ${environment.toLocaleLowerCase()}\n\n`;
37
- const envFileContent = environmentVariables
38
- .map((variable) => {
39
- if (variable.value === null) {
40
+ const isFileVariablePresent = environmentVariables.some(v => {
41
+ return v.type === generated_1.EnvironmentSecretType.FileBase64 && v.valueWithFileContent;
42
+ });
43
+ const envDir = path_1.default.join(projectDir, '.eas', '.env');
44
+ if (isFileVariablePresent) {
45
+ await fs.mkdir(envDir, { recursive: true });
46
+ }
47
+ const envFileContentLines = await Promise.all(environmentVariables.map(async (variable) => {
48
+ if (variable.visibility === generated_1.EnvironmentVariableVisibility.Secret) {
40
49
  return `# ${variable.name}=***** (secret variables are not available for reading)`;
41
50
  }
51
+ if (variable.type === generated_1.EnvironmentSecretType.FileBase64 && variable.valueWithFileContent) {
52
+ const filePath = path_1.default.join(envDir, variable.name);
53
+ await fs.writeFile(filePath, variable.valueWithFileContent, 'base64');
54
+ return `${variable.name}=${filePath}`;
55
+ }
42
56
  return `${variable.name}=${variable.value}`;
43
- })
44
- .join('\n');
45
- await fs.writeFile(targetPath, filePrefix + envFileContent);
57
+ }));
58
+ await fs.writeFile(targetPath, filePrefix + envFileContentLines.join('\n'));
46
59
  const secretEnvVariables = environmentVariables.filter((variable) => variable.value === null);
47
60
  if (secretEnvVariables.length > 0) {
48
61
  log_1.default.warn(`The eas env:pull command tried to pull environment variables with "secret" visibility. The variables with "secret" visibility are not available for reading, therefore thet were marked as "*****" in the generated .env file. Provide values for these manually in ${targetPath} if needed. Skipped variables: ${secretEnvVariables
@@ -57,8 +70,9 @@ _a = EnvironmentVariablePull;
57
70
  EnvironmentVariablePull.description = 'pull env file';
58
71
  EnvironmentVariablePull.hidden = true;
59
72
  EnvironmentVariablePull.contextDefinition = {
60
- ..._a.ContextOptions.ProjectConfig,
73
+ ..._a.ContextOptions.ProjectId,
61
74
  ..._a.ContextOptions.LoggedIn,
75
+ ..._a.ContextOptions.ProjectDir,
62
76
  };
63
77
  EnvironmentVariablePull.flags = {
64
78
  ...flags_1.EASEnvironmentFlag,
@@ -5,7 +5,7 @@ export default class EnvironmentVariablePush extends EasCommand {
5
5
  static hidden: boolean;
6
6
  static contextDefinition: {
7
7
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
8
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
8
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
9
9
  };
10
10
  static flags: {
11
11
  path: import("@oclif/core/lib/interfaces").OptionFlag<string>;
@@ -13,5 +13,4 @@ export default class EnvironmentVariablePush extends EasCommand {
13
13
  };
14
14
  runAsync(): Promise<void>;
15
15
  private parseEnvFileAsync;
16
- private validateFlags;
17
16
  }
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const core_1 = require("@oclif/core");
6
6
  const dotenv_1 = tslib_1.__importDefault(require("dotenv"));
7
7
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
8
+ const path_1 = tslib_1.__importDefault(require("path"));
8
9
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
9
10
  const flags_1 = require("../../commandUtils/flags");
10
11
  const generated_1 = require("../../graphql/generated");
@@ -12,13 +13,19 @@ const EnvironmentVariableMutation_1 = require("../../graphql/mutations/Environme
12
13
  const EnvironmentVariablesQuery_1 = require("../../graphql/queries/EnvironmentVariablesQuery");
13
14
  const log_1 = tslib_1.__importDefault(require("../../log"));
14
15
  const prompts_1 = require("../../prompts");
16
+ const prompts_2 = require("../../utils/prompts");
15
17
  class EnvironmentVariablePush extends EasCommand_1.default {
16
18
  async runAsync() {
17
- const { flags } = await this.parse(_a);
18
- const { environment: environments, path: envPath } = this.validateFlags(flags);
19
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
19
+ let { flags: { environment: environments, path: envPath }, } = await this.parse(_a);
20
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
20
21
  nonInteractive: false,
21
22
  });
23
+ if (!environments) {
24
+ environments = await (0, prompts_2.promptVariableEnvironmentAsync)({
25
+ nonInteractive: false,
26
+ multiple: true,
27
+ });
28
+ }
22
29
  const updateVariables = await this.parseEnvFileAsync(envPath, environments);
23
30
  const variableNames = Object.keys(updateVariables);
24
31
  for (const environment of environments) {
@@ -118,7 +125,17 @@ class EnvironmentVariablePush extends EasCommand_1.default {
118
125
  }
119
126
  const pushInput = {};
120
127
  const variables = dotenv_1.default.parse(await fs_extra_1.default.readFile(envPath, 'utf8'));
128
+ const hasFileVariables = Object.values(variables).some(value => value.includes(path_1.default.join('.eas', '.env')));
129
+ if (hasFileVariables) {
130
+ log_1.default.warn('File variables are not supported in this command.');
131
+ }
121
132
  for (const [name, value] of Object.entries(variables)) {
133
+ // Skip file variables
134
+ const fileVariablePath = path_1.default.join('.eas', '.env', name);
135
+ if (value.endsWith(fileVariablePath)) {
136
+ log_1.default.warn(`Skipping file variable ${name}`);
137
+ continue;
138
+ }
122
139
  pushInput[name] = {
123
140
  name,
124
141
  value,
@@ -130,18 +147,12 @@ class EnvironmentVariablePush extends EasCommand_1.default {
130
147
  }
131
148
  return pushInput;
132
149
  }
133
- validateFlags(flags) {
134
- if (!flags.environment || flags.environment.length === 0) {
135
- throw new Error('Please provide an environment to push the env file to.');
136
- }
137
- return { ...flags, environment: flags.environment };
138
- }
139
150
  }
140
151
  _a = EnvironmentVariablePush;
141
152
  EnvironmentVariablePush.description = 'push env file';
142
153
  EnvironmentVariablePush.hidden = true;
143
154
  EnvironmentVariablePush.contextDefinition = {
144
- ..._a.ContextOptions.ProjectConfig,
155
+ ..._a.ContextOptions.ProjectId,
145
156
  ..._a.ContextOptions.LoggedIn,
146
157
  };
147
158
  EnvironmentVariablePush.flags = {
@@ -10,7 +10,7 @@ export default class EnvironmentVariableUnlink extends EasCommand {
10
10
  };
11
11
  static contextDefinition: {
12
12
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
13
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
13
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
14
14
  };
15
15
  runAsync(): Promise<void>;
16
16
  }
@@ -17,7 +17,7 @@ const variableUtils_1 = require("../../utils/variableUtils");
17
17
  class EnvironmentVariableUnlink extends EasCommand_1.default {
18
18
  async runAsync() {
19
19
  let { flags: { 'variable-name': name, 'non-interactive': nonInteractive, environment: unlinkEnvironments, }, } = await this.parse(_a);
20
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
20
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
21
21
  nonInteractive,
22
22
  });
23
23
  const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
@@ -86,7 +86,7 @@ EnvironmentVariableUnlink.flags = {
86
86
  ...flags_1.EASNonInteractiveFlag,
87
87
  };
88
88
  EnvironmentVariableUnlink.contextDefinition = {
89
- ..._a.ContextOptions.ProjectConfig,
89
+ ..._a.ContextOptions.ProjectId,
90
90
  ..._a.ContextOptions.LoggedIn,
91
91
  };
92
92
  exports.default = EnvironmentVariableUnlink;
@@ -17,7 +17,7 @@ export default class EnvironmentVariableUpdate extends EasCommand {
17
17
  static contextDefinition: {
18
18
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
19
19
  analytics: import("../../commandUtils/context/AnalyticsContextField").default;
20
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
20
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
21
21
  };
22
22
  runAsync(): Promise<void>;
23
23
  private validateFlags;
@@ -21,7 +21,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
21
21
  async runAsync() {
22
22
  const { flags } = await this.parse(_a);
23
23
  const { name, value: rawValue, scope, 'variable-name': currentName, 'variable-environment': currentEnvironment, 'non-interactive': nonInteractive, environment: environments, type, visibility, } = this.validateFlags(flags);
24
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
24
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
25
25
  nonInteractive,
26
26
  });
27
27
  const [projectDisplayName, ownerAccount] = await Promise.all([
@@ -60,7 +60,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
60
60
  selectedVariable = existingVariables[0];
61
61
  }
62
62
  (0, assert_1.default)(selectedVariable, 'Variable must be selected');
63
- const { name: newName, value: newValue, environment: newEnvironments, visibility: newVisibility, type: newType, } = await this.promptForMissingFlagsAsync(selectedVariable, {
63
+ const { name: newName, value: newValue, environment: newEnvironments, visibility: newVisibility, type: newType, fileName, } = await this.promptForMissingFlagsAsync(selectedVariable, {
64
64
  name,
65
65
  value: rawValue,
66
66
  environment: environments,
@@ -75,6 +75,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
75
75
  environments: newEnvironments,
76
76
  type: newType,
77
77
  visibility: newVisibility,
78
+ fileName: newValue ? fileName : undefined,
78
79
  });
79
80
  if (!variable) {
80
81
  throw new Error(`Could not update variable with name ${name} ${suffix}`);
@@ -95,6 +96,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
95
96
  async promptForMissingFlagsAsync(selectedVariable, { name, value, environment: environments, visibility, 'non-interactive': nonInteractive, type, ...rest }) {
96
97
  let newType;
97
98
  let newVisibility;
99
+ let fileName;
98
100
  if (type === 'file') {
99
101
  newType = generated_1.EnvironmentSecretType.FileBase64;
100
102
  }
@@ -110,9 +112,6 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
110
112
  }
111
113
  if (!type && !value && !nonInteractive) {
112
114
  newType = await (0, prompts_2.promptVariableTypeAsync)(nonInteractive, selectedVariable.type);
113
- if (!newType || newType === selectedVariable.type) {
114
- newType = undefined;
115
- }
116
115
  }
117
116
  if (!value) {
118
117
  value = await (0, prompts_2.promptVariableValueAsync)({
@@ -125,6 +124,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
125
124
  });
126
125
  if (!value || value.length === 0 || value === selectedVariable.value) {
127
126
  value = undefined;
127
+ newType = undefined;
128
128
  }
129
129
  }
130
130
  let environmentFilePath;
@@ -133,6 +133,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
133
133
  if (!(await fs_extra_1.default.pathExists(environmentFilePath))) {
134
134
  throw new Error(`File "${value}" does not exist`);
135
135
  }
136
+ fileName = path_1.default.basename(environmentFilePath);
136
137
  }
137
138
  value = environmentFilePath ? await fs_extra_1.default.readFile(environmentFilePath, 'base64') : value;
138
139
  if (!environments || environments.length === 0) {
@@ -165,6 +166,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
165
166
  scope: rest.scope ?? generated_1.EnvironmentVariableScope.Project,
166
167
  'non-interactive': nonInteractive,
167
168
  type: newType,
169
+ fileName,
168
170
  ...rest,
169
171
  };
170
172
  }
@@ -196,7 +198,7 @@ EnvironmentVariableUpdate.flags = {
196
198
  ...flags_1.EASNonInteractiveFlag,
197
199
  };
198
200
  EnvironmentVariableUpdate.contextDefinition = {
199
- ..._a.ContextOptions.ProjectConfig,
201
+ ..._a.ContextOptions.ProjectId,
200
202
  ..._a.ContextOptions.Analytics,
201
203
  ..._a.ContextOptions.LoggedIn,
202
204
  };
@@ -20,6 +20,7 @@ class MetadataPull extends EasCommand_1.default {
20
20
  const { flags } = await this.parse(_a);
21
21
  const { loggedIn: { actor, graphqlClient }, privateProjectConfig: { exp, projectId, projectDir }, analytics, vcsClient, } = await this.getContextAsync(_a, {
22
22
  nonInteractive: false,
23
+ withServerSideEnvironment: null,
23
24
  });
24
25
  // this command is interactive (all nonInteractive flags passed to utility functions are false)
25
26
  await (0, configure_1.ensureProjectConfiguredAsync)({ projectDir, nonInteractive: false, vcsClient });
@@ -18,6 +18,7 @@ class MetadataPush extends EasCommand_1.default {
18
18
  const { flags } = await this.parse(_a);
19
19
  const { loggedIn: { actor, graphqlClient }, privateProjectConfig: { exp, projectId, projectDir }, analytics, vcsClient, } = await this.getContextAsync(_a, {
20
20
  nonInteractive: false,
21
+ withServerSideEnvironment: null,
21
22
  });
22
23
  // this command is interactive (all nonInteractive flags passed to utility functions are false)
23
24
  await (0, configure_1.ensureProjectConfiguredAsync)({ projectDir, nonInteractive: false, vcsClient });
@@ -12,6 +12,7 @@ class Open extends EasCommand_1.default {
12
12
  // this command is interactive by nature (only really run by humans in a terminal)
13
13
  const { privateProjectConfig: { projectId, exp }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
14
14
  nonInteractive: false,
15
+ withServerSideEnvironment: null,
15
16
  });
16
17
  const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
17
18
  const projectName = exp.slug;
@@ -3,7 +3,7 @@ export default class ProjectInfo extends EasCommand {
3
3
  static description: string;
4
4
  static contextDefinition: {
5
5
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
6
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
6
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
7
7
  };
8
8
  runAsync(): Promise<void>;
9
9
  }
@@ -24,7 +24,7 @@ async function projectInfoByIdAsync(graphqlClient, appId) {
24
24
  }
25
25
  class ProjectInfo extends EasCommand_1.default {
26
26
  async runAsync() {
27
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
27
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
28
28
  nonInteractive: true,
29
29
  });
30
30
  const { app } = await projectInfoByIdAsync(graphqlClient, projectId);
@@ -41,7 +41,7 @@ class ProjectInfo extends EasCommand_1.default {
41
41
  _a = ProjectInfo;
42
42
  ProjectInfo.description = 'information about the current project';
43
43
  ProjectInfo.contextDefinition = {
44
- ..._a.ContextOptions.ProjectConfig,
44
+ ..._a.ContextOptions.ProjectId,
45
45
  ..._a.ContextOptions.LoggedIn,
46
46
  };
47
47
  exports.default = ProjectInfo;
@@ -13,7 +13,7 @@ export default class EnvironmentSecretCreate extends EasCommand {
13
13
  };
14
14
  static contextDefinition: {
15
15
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
16
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
16
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
17
17
  };
18
18
  runAsync(): Promise<void>;
19
19
  }
@@ -18,7 +18,7 @@ const prompts_1 = require("../../prompts");
18
18
  class EnvironmentSecretCreate extends EasCommand_1.default {
19
19
  async runAsync() {
20
20
  let { flags: { name, value: secretValue, scope, force, type: secretType, 'non-interactive': nonInteractive, }, } = await this.parse(_a);
21
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
21
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
22
22
  nonInteractive,
23
23
  });
24
24
  const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
@@ -179,7 +179,7 @@ EnvironmentSecretCreate.flags = {
179
179
  ...flags_1.EASNonInteractiveFlag,
180
180
  };
181
181
  EnvironmentSecretCreate.contextDefinition = {
182
- ..._a.ContextOptions.ProjectConfig,
182
+ ..._a.ContextOptions.ProjectId,
183
183
  ..._a.ContextOptions.LoggedIn,
184
184
  };
185
185
  exports.default = EnvironmentSecretCreate;
@@ -7,7 +7,7 @@ export default class EnvironmentSecretDelete extends EasCommand {
7
7
  };
8
8
  static contextDefinition: {
9
9
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
10
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
10
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
11
11
  };
12
12
  runAsync(): Promise<void>;
13
13
  }
@@ -12,7 +12,7 @@ const prompts_1 = require("../../prompts");
12
12
  class EnvironmentSecretDelete extends EasCommand_1.default {
13
13
  async runAsync() {
14
14
  let { flags: { id, 'non-interactive': nonInteractive }, } = await this.parse(_a);
15
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
15
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
16
16
  nonInteractive,
17
17
  });
18
18
  let secret;
@@ -63,7 +63,7 @@ EnvironmentSecretDelete.flags = {
63
63
  ...flags_1.EASNonInteractiveFlag,
64
64
  };
65
65
  EnvironmentSecretDelete.contextDefinition = {
66
- ..._a.ContextOptions.ProjectConfig,
66
+ ..._a.ContextOptions.ProjectId,
67
67
  ..._a.ContextOptions.LoggedIn,
68
68
  };
69
69
  exports.default = EnvironmentSecretDelete;
@@ -3,7 +3,7 @@ export default class EnvironmentSecretList extends EasCommand {
3
3
  static description: string;
4
4
  static contextDefinition: {
5
5
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
6
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
6
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
7
7
  };
8
8
  runAsync(): Promise<void>;
9
9
  }
@@ -10,7 +10,7 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
10
10
  const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
11
11
  class EnvironmentSecretList extends EasCommand_1.default {
12
12
  async runAsync() {
13
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
13
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
14
14
  nonInteractive: true,
15
15
  });
16
16
  const secrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.allAsync(graphqlClient, projectId);
@@ -21,7 +21,7 @@ class EnvironmentSecretList extends EasCommand_1.default {
21
21
  _a = EnvironmentSecretList;
22
22
  EnvironmentSecretList.description = 'list environment secrets available for your current app';
23
23
  EnvironmentSecretList.contextDefinition = {
24
- ..._a.ContextOptions.ProjectConfig,
24
+ ..._a.ContextOptions.ProjectId,
25
25
  ..._a.ContextOptions.LoggedIn,
26
26
  };
27
27
  exports.default = EnvironmentSecretList;
@@ -10,7 +10,7 @@ export default class EnvironmentSecretPush extends EasCommand {
10
10
  };
11
11
  static contextDefinition: {
12
12
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
13
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
13
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
14
14
  };
15
15
  runAsync(): Promise<void>;
16
16
  }
@@ -20,7 +20,7 @@ const intersection_1 = tslib_1.__importDefault(require("../../utils/expodash/int
20
20
  class EnvironmentSecretPush extends EasCommand_1.default {
21
21
  async runAsync() {
22
22
  const { flags: { scope, force, 'env-file': maybeEnvFilePath, 'non-interactive': nonInteractive }, } = await this.parse(_a);
23
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
23
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
24
24
  nonInteractive,
25
25
  });
26
26
  const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
@@ -62,7 +62,7 @@ EnvironmentSecretPush.flags = {
62
62
  ...flags_1.EASNonInteractiveFlag,
63
63
  };
64
64
  EnvironmentSecretPush.contextDefinition = {
65
- ..._a.ContextOptions.ProjectConfig,
65
+ ..._a.ContextOptions.ProjectId,
66
66
  ..._a.ContextOptions.LoggedIn,
67
67
  };
68
68
  exports.default = EnvironmentSecretPush;
@@ -29,6 +29,7 @@ class SubmitInternal extends EasCommand_1.default {
29
29
  const { loggedIn: { actor, graphqlClient }, privateProjectConfig: { exp, projectId, projectDir }, analytics, vcsClient, } = await this.getContextAsync(_a, {
30
30
  nonInteractive: true,
31
31
  vcsClientOverride: new gitNoCommit_1.default(),
32
+ withServerSideEnvironment: null,
32
33
  });
33
34
  const submissionProfile = await eas_json_1.EasJsonUtils.getSubmitProfileAsync(eas_json_1.EasJsonAccessor.fromProjectPath(projectDir), flags.platform, flags.profile);
34
35
  const ctx = await (0, context_1.createSubmissionContextAsync)({
@@ -20,6 +20,7 @@ class Submit extends EasCommand_1.default {
20
20
  const { flags: rawFlags } = await this.parse(_a);
21
21
  const { loggedIn: { actor, graphqlClient }, privateProjectConfig: { exp, projectId, projectDir }, analytics, vcsClient, } = await this.getContextAsync(_a, {
22
22
  nonInteractive: false,
23
+ withServerSideEnvironment: null,
23
24
  });
24
25
  const flags = this.sanitizeFlags(rawFlags);
25
26
  await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)(graphqlClient, [generated_1.StatuspageServiceName.EasSubmit]);
@@ -15,6 +15,7 @@ class UpdateConfigure extends EasCommand_1.default {
15
15
  const platform = flags.platform;
16
16
  const { privateProjectConfig: { projectId, exp, projectDir }, vcsClient, } = await this.getContextAsync(_a, {
17
17
  nonInteractive: flags['non-interactive'],
18
+ withServerSideEnvironment: null,
18
19
  });
19
20
  log_1.default.log('💡 The following process will configure your project to use EAS Update. These changes only apply to your local project files and you can safely revert them at any time.');
20
21
  await vcsClient.ensureRepoExistsAsync();
@@ -1,19 +1,19 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class UpdateEdit extends EasCommand {
3
3
  static description: string;
4
- static hidden: boolean;
5
4
  static args: {
6
5
  name: string;
7
- required: boolean;
8
6
  description: string;
9
7
  }[];
10
8
  static flags: {
11
9
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
10
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
11
  'rollout-percentage': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
12
+ branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
14
13
  };
15
14
  static contextDefinition: {
16
15
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
16
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
17
17
  };
18
18
  runAsync(): Promise<void>;
19
19
  }
@@ -5,21 +5,56 @@ const tslib_1 = require("tslib");
5
5
  const core_1 = require("@oclif/core");
6
6
  const assert_1 = tslib_1.__importDefault(require("assert"));
7
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
+ const queries_1 = require("../../branch/queries");
8
9
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
9
10
  const flags_1 = require("../../commandUtils/flags");
10
11
  const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
11
12
  const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
12
13
  const log_1 = tslib_1.__importDefault(require("../../log"));
13
14
  const prompts_1 = require("../../prompts");
15
+ const queries_2 = require("../../update/queries");
14
16
  const utils_1 = require("../../update/utils");
15
17
  const json_1 = require("../../utils/json");
16
18
  class UpdateEdit extends EasCommand_1.default {
17
19
  async runAsync() {
18
- const { args: { groupId }, flags: { 'rollout-percentage': rolloutPercentage, json: jsonFlag, 'non-interactive': nonInteractive, }, } = await this.parse(_a);
19
- const { loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, { nonInteractive });
20
+ const { args: { groupId: maybeGroupId }, flags: { 'rollout-percentage': rolloutPercentage, json: jsonFlag, 'non-interactive': nonInteractive, branch: branchFlag, }, } = await this.parse(_a);
21
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, { nonInteractive });
20
22
  if (jsonFlag) {
21
23
  (0, json_1.enableJsonOutput)();
22
24
  }
25
+ let groupId = maybeGroupId;
26
+ if (!groupId) {
27
+ let branch = branchFlag;
28
+ if (!branch) {
29
+ const validationMessage = 'Branch name may not be empty.';
30
+ if (nonInteractive) {
31
+ throw new Error(validationMessage);
32
+ }
33
+ const selectedBranch = await (0, queries_1.selectBranchOnAppAsync)(graphqlClient, {
34
+ projectId,
35
+ promptTitle: 'On which branch would you like search for an update to edit?',
36
+ displayTextForListItem: updateBranch => ({
37
+ title: updateBranch.name,
38
+ }),
39
+ paginatedQueryOptions: {
40
+ json: jsonFlag,
41
+ nonInteractive,
42
+ offset: 0,
43
+ },
44
+ });
45
+ branch = selectedBranch.name;
46
+ }
47
+ const selectedUpdateGroup = await (0, queries_2.selectUpdateGroupOnBranchAsync)(graphqlClient, {
48
+ projectId,
49
+ branchName: branch,
50
+ paginatedQueryOptions: {
51
+ json: jsonFlag,
52
+ nonInteractive,
53
+ offset: 0,
54
+ },
55
+ });
56
+ groupId = selectedUpdateGroup[0].group;
57
+ }
23
58
  const proposedUpdatesToEdit = (await UpdateQuery_1.UpdateQuery.viewUpdateGroupAsync(graphqlClient, { groupId })).map(u => ({ updateId: u.id, rolloutPercentage: u.rolloutPercentage }));
24
59
  const updatesToEdit = proposedUpdatesToEdit.filter((u) => u.rolloutPercentage !== null && u.rolloutPercentage !== undefined);
25
60
  if (updatesToEdit.length === 0) {
@@ -79,11 +114,9 @@ class UpdateEdit extends EasCommand_1.default {
79
114
  }
80
115
  _a = UpdateEdit;
81
116
  UpdateEdit.description = 'edit all the updates in an update group';
82
- UpdateEdit.hidden = true;
83
117
  UpdateEdit.args = [
84
118
  {
85
119
  name: 'groupId',
86
- required: true,
87
120
  description: 'The ID of an update group to edit.',
88
121
  },
89
122
  ];
@@ -94,9 +127,13 @@ UpdateEdit.flags = {
94
127
  min: 0,
95
128
  max: 100,
96
129
  }),
130
+ branch: core_1.Flags.string({
131
+ description: 'Branch for which to list updates to select from',
132
+ }),
97
133
  ...flags_1.EasNonInteractiveAndJsonFlags,
98
134
  };
99
135
  UpdateEdit.contextDefinition = {
136
+ ..._a.ContextOptions.ProjectId,
100
137
  ..._a.ContextOptions.LoggedIn,
101
138
  };
102
139
  exports.default = UpdateEdit;