eas-cli 12.6.0 → 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 (143) hide show
  1. package/README.md +63 -63
  2. package/build/build/evaluateConfigWithEnvVarsAsync.js +27 -11
  3. package/build/commandUtils/EasCommand.d.ts +36 -5
  4. package/build/commandUtils/EasCommand.js +27 -2
  5. package/build/commandUtils/context/ContextField.d.ts +5 -0
  6. package/build/commandUtils/context/DynamicLoggedInContextField.d.ts +14 -0
  7. package/build/commandUtils/context/DynamicLoggedInContextField.js +25 -0
  8. package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +2 -2
  9. package/build/commandUtils/context/DynamicProjectConfigContextField.js +40 -2
  10. package/build/commandUtils/context/LoggedInContextField.d.ts +7 -7
  11. package/build/commandUtils/context/LoggedInContextField.js +2 -1
  12. package/build/commandUtils/context/MaybeLoggedInContextField.d.ts +9 -7
  13. package/build/commandUtils/context/MaybeLoggedInContextField.js +1 -0
  14. package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.d.ts +1 -1
  15. package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.js +17 -2
  16. package/build/commandUtils/context/PrivateProjectConfigContextField.d.ts +1 -1
  17. package/build/commandUtils/context/PrivateProjectConfigContextField.js +17 -2
  18. package/build/commandUtils/context/ProjectIdContextField.d.ts +4 -0
  19. package/build/commandUtils/context/ProjectIdContextField.js +19 -0
  20. package/build/commandUtils/context/ServerSideEnvironmentVariablesContextField.d.ts +6 -0
  21. package/build/commandUtils/context/ServerSideEnvironmentVariablesContextField.js +36 -0
  22. package/build/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.d.ts +7 -0
  23. package/build/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.js +42 -0
  24. package/build/commands/account/view.d.ts +0 -1
  25. package/build/commands/account/view.js +2 -3
  26. package/build/commands/branch/create.d.ts +1 -1
  27. package/build/commands/branch/create.js +2 -2
  28. package/build/commands/branch/delete.d.ts +1 -1
  29. package/build/commands/branch/delete.js +2 -2
  30. package/build/commands/branch/list.d.ts +1 -1
  31. package/build/commands/branch/list.js +2 -2
  32. package/build/commands/branch/rename.d.ts +1 -1
  33. package/build/commands/branch/rename.js +2 -2
  34. package/build/commands/branch/view.d.ts +1 -1
  35. package/build/commands/branch/view.js +2 -2
  36. package/build/commands/build/cancel.d.ts +1 -1
  37. package/build/commands/build/cancel.js +2 -2
  38. package/build/commands/build/configure.js +1 -0
  39. package/build/commands/build/delete.d.ts +1 -1
  40. package/build/commands/build/delete.js +2 -2
  41. package/build/commands/build/index.js +1 -0
  42. package/build/commands/build/inspect.js +1 -0
  43. package/build/commands/build/internal.js +1 -0
  44. package/build/commands/build/list.d.ts +1 -1
  45. package/build/commands/build/list.js +2 -2
  46. package/build/commands/build/resign.js +1 -0
  47. package/build/commands/build/run.d.ts +1 -2
  48. package/build/commands/build/run.js +2 -3
  49. package/build/commands/build/version/get.js +1 -0
  50. package/build/commands/build/version/set.js +1 -0
  51. package/build/commands/build/version/sync.js +1 -0
  52. package/build/commands/build/view.d.ts +1 -1
  53. package/build/commands/build/view.js +2 -2
  54. package/build/commands/channel/create.d.ts +1 -1
  55. package/build/commands/channel/create.js +2 -2
  56. package/build/commands/channel/delete.d.ts +1 -1
  57. package/build/commands/channel/delete.js +2 -2
  58. package/build/commands/channel/edit.d.ts +1 -1
  59. package/build/commands/channel/edit.js +2 -2
  60. package/build/commands/channel/list.d.ts +1 -1
  61. package/build/commands/channel/list.js +2 -2
  62. package/build/commands/channel/pause.d.ts +1 -1
  63. package/build/commands/channel/pause.js +2 -2
  64. package/build/commands/channel/resume.d.ts +1 -1
  65. package/build/commands/channel/resume.js +2 -2
  66. package/build/commands/channel/rollout.js +1 -0
  67. package/build/commands/channel/view.d.ts +1 -1
  68. package/build/commands/channel/view.js +2 -2
  69. package/build/commands/config.d.ts +1 -1
  70. package/build/commands/config.js +4 -7
  71. package/build/commands/credentials/configure-build.js +1 -0
  72. package/build/commands/credentials/index.d.ts +1 -1
  73. package/build/commands/credentials/index.js +2 -1
  74. package/build/commands/device/create.d.ts +1 -1
  75. package/build/commands/device/create.js +2 -1
  76. package/build/commands/device/delete.d.ts +1 -1
  77. package/build/commands/device/delete.js +2 -2
  78. package/build/commands/device/list.d.ts +1 -1
  79. package/build/commands/device/list.js +2 -2
  80. package/build/commands/device/rename.d.ts +1 -1
  81. package/build/commands/device/rename.js +2 -2
  82. package/build/commands/device/view.d.ts +1 -1
  83. package/build/commands/device/view.js +2 -2
  84. package/build/commands/env/create.d.ts +1 -1
  85. package/build/commands/env/create.js +8 -3
  86. package/build/commands/env/delete.d.ts +1 -1
  87. package/build/commands/env/delete.js +2 -2
  88. package/build/commands/env/exec.d.ts +1 -1
  89. package/build/commands/env/exec.js +2 -2
  90. package/build/commands/env/get.d.ts +1 -1
  91. package/build/commands/env/get.js +2 -2
  92. package/build/commands/env/link.d.ts +1 -1
  93. package/build/commands/env/link.js +2 -2
  94. package/build/commands/env/list.d.ts +1 -1
  95. package/build/commands/env/list.js +2 -2
  96. package/build/commands/env/pull.d.ts +2 -1
  97. package/build/commands/env/pull.js +22 -8
  98. package/build/commands/env/push.d.ts +1 -1
  99. package/build/commands/env/push.js +13 -2
  100. package/build/commands/env/unlink.d.ts +1 -1
  101. package/build/commands/env/unlink.js +2 -2
  102. package/build/commands/env/update.d.ts +1 -1
  103. package/build/commands/env/update.js +8 -6
  104. package/build/commands/metadata/pull.js +1 -0
  105. package/build/commands/metadata/push.js +1 -0
  106. package/build/commands/open.js +1 -0
  107. package/build/commands/project/info.d.ts +1 -1
  108. package/build/commands/project/info.js +2 -2
  109. package/build/commands/secret/create.d.ts +1 -1
  110. package/build/commands/secret/create.js +2 -2
  111. package/build/commands/secret/delete.d.ts +1 -1
  112. package/build/commands/secret/delete.js +2 -2
  113. package/build/commands/secret/list.d.ts +1 -1
  114. package/build/commands/secret/list.js +2 -2
  115. package/build/commands/secret/push.d.ts +1 -1
  116. package/build/commands/secret/push.js +2 -2
  117. package/build/commands/submit/internal.js +1 -0
  118. package/build/commands/submit.js +1 -0
  119. package/build/commands/update/configure.js +1 -0
  120. package/build/commands/update/edit.d.ts +1 -1
  121. package/build/commands/update/edit.js +2 -2
  122. package/build/commands/update/index.d.ts +2 -0
  123. package/build/commands/update/index.js +29 -3
  124. package/build/commands/update/list.d.ts +1 -1
  125. package/build/commands/update/list.js +2 -2
  126. package/build/commands/update/republish.js +1 -0
  127. package/build/commands/update/roll-back-to-embedded.js +1 -0
  128. package/build/commands/webhook/create.d.ts +1 -1
  129. package/build/commands/webhook/create.js +2 -2
  130. package/build/commands/webhook/delete.d.ts +1 -1
  131. package/build/commands/webhook/delete.js +2 -2
  132. package/build/commands/webhook/list.d.ts +1 -1
  133. package/build/commands/webhook/list.js +2 -2
  134. package/build/commands/worker/alias.js +1 -0
  135. package/build/commands/worker/deploy.js +1 -1
  136. package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +1 -0
  137. package/build/project/publish.d.ts +2 -1
  138. package/build/project/publish.js +10 -4
  139. package/build/user/SessionManager.d.ts +1 -1
  140. package/build/utils/expoCli.d.ts +2 -1
  141. package/build/utils/expoCli.js +5 -1
  142. package/oclif.manifest.json +99 -85
  143. package/package.json +2 -2
@@ -9,7 +9,6 @@ const core_1 = require("@oclif/core");
9
9
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
10
  const evaluateConfigWithEnvVarsAsync_1 = require("../build/evaluateConfigWithEnvVarsAsync");
11
11
  const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand"));
12
- const createGraphqlClient_1 = require("../commandUtils/context/contextUtils/createGraphqlClient");
13
12
  const flags_1 = require("../commandUtils/flags");
14
13
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
15
14
  const log_1 = tslib_1.__importDefault(require("../log"));
@@ -23,8 +22,9 @@ class Config extends EasCommand_1.default {
23
22
  (0, json_1.enableJsonOutput)();
24
23
  }
25
24
  const { platform: maybePlatform, profile: maybeProfile, 'non-interactive': nonInteractive, } = flags;
26
- const { getDynamicPublicProjectConfigAsync, projectDir, sessionManager } = await this.getContextAsync(_a, {
25
+ const { getDynamicPublicProjectConfigAsync, projectDir, getDynamicLoggedInAsync } = await this.getContextAsync(_a, {
27
26
  nonInteractive,
27
+ withServerSideEnvironment: null,
28
28
  });
29
29
  const accessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
30
30
  const profileName = maybeProfile ??
@@ -57,10 +57,7 @@ class Config extends EasCommand_1.default {
57
57
  }
58
58
  }
59
59
  else {
60
- const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({
61
- nonInteractive,
62
- });
63
- const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
60
+ const { graphqlClient } = await getDynamicLoggedInAsync();
64
61
  const { exp: appConfig } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
65
62
  buildProfile: profile,
66
63
  buildProfileName: profileName,
@@ -105,6 +102,6 @@ Config.flags = {
105
102
  Config.contextDefinition = {
106
103
  ..._a.ContextOptions.DynamicProjectConfig,
107
104
  ..._a.ContextOptions.ProjectDir,
108
- ..._a.ContextOptions.SessionManagment,
105
+ ..._a.ContextOptions.DynamicLoggedIn,
109
106
  };
110
107
  exports.default = Config;
@@ -13,6 +13,7 @@ class InitializeBuildCredentials extends EasCommand_1.default {
13
13
  const { flags } = await this.parse(_a);
14
14
  const { loggedIn: { actor, graphqlClient }, privateProjectConfig, getDynamicPrivateProjectConfigAsync, analytics, vcsClient, } = await this.getContextAsync(_a, {
15
15
  nonInteractive: false,
16
+ withServerSideEnvironment: null,
16
17
  });
17
18
  const platform = await (0, platform_1.selectPlatformAsync)(flags.platform);
18
19
  const buildProfile = flags.profile ??
@@ -9,7 +9,7 @@ export default class Credentials extends EasCommand {
9
9
  analytics: import("../../commandUtils/context/AnalyticsContextField").default;
10
10
  getDynamicPublicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
11
11
  getDynamicPrivateProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
12
- privateProjectConfig: import("../../commandUtils/context/OptionalPrivateProjectConfigContextField").OptionalPrivateProjectConfigContextField;
12
+ optionalPrivateProjectConfig: import("../../commandUtils/context/OptionalPrivateProjectConfigContextField").OptionalPrivateProjectConfigContextField;
13
13
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
14
14
  };
15
15
  runAsync(): Promise<void>;
@@ -8,8 +8,9 @@ const SelectPlatform_1 = require("../../credentials/manager/SelectPlatform");
8
8
  class Credentials extends EasCommand_1.default {
9
9
  async runAsync() {
10
10
  const { flags } = await this.parse(_a);
11
- const { loggedIn: { actor, graphqlClient }, privateProjectConfig, getDynamicPrivateProjectConfigAsync, analytics, vcsClient, } = await this.getContextAsync(_a, {
11
+ const { loggedIn: { actor, graphqlClient }, optionalPrivateProjectConfig: privateProjectConfig, getDynamicPrivateProjectConfigAsync, analytics, vcsClient, } = await this.getContextAsync(_a, {
12
12
  nonInteractive: false,
13
+ withServerSideEnvironment: null,
13
14
  });
14
15
  await new SelectPlatform_1.SelectPlatform(actor, graphqlClient, vcsClient, analytics, privateProjectConfig ?? null, getDynamicPrivateProjectConfigAsync, flags.platform).runAsync();
15
16
  }
@@ -2,7 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class DeviceCreate extends EasCommand {
3
3
  static description: string;
4
4
  static contextDefinition: {
5
- privateProjectConfig: import("../../commandUtils/context/OptionalPrivateProjectConfigContextField").OptionalPrivateProjectConfigContextField;
5
+ optionalPrivateProjectConfig: import("../../commandUtils/context/OptionalPrivateProjectConfigContextField").OptionalPrivateProjectConfigContextField;
6
6
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
7
7
  };
8
8
  runAsync(): Promise<void>;
@@ -9,8 +9,9 @@ const manager_1 = tslib_1.__importDefault(require("../../devices/manager"));
9
9
  class DeviceCreate extends EasCommand_1.default {
10
10
  async runAsync() {
11
11
  // this command is interactive by design
12
- const { loggedIn: { actor, graphqlClient }, privateProjectConfig, } = await this.getContextAsync(_a, {
12
+ const { loggedIn: { actor, graphqlClient }, optionalPrivateProjectConfig: privateProjectConfig, } = await this.getContextAsync(_a, {
13
13
  nonInteractive: false,
14
+ withServerSideEnvironment: null,
14
15
  });
15
16
  const ctx = await (0, context_1.createContextAsync)({
16
17
  appStore: new AppStoreApi_1.default(),
@@ -13,7 +13,7 @@ export default class DeviceDelete 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
  shouldDisableDeviceOnAppleAsync({ nonInteractive, }: PaginatedQueryOptions): Promise<boolean>;
@@ -23,7 +23,7 @@ class DeviceDelete extends EasCommand_1.default {
23
23
  const { flags } = await this.parse(_a);
24
24
  const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
25
25
  let { 'apple-team-id': appleTeamIdentifier, udid } = flags;
26
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
26
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
27
27
  nonInteractive: paginatedQueryOptions.nonInteractive,
28
28
  });
29
29
  const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
@@ -131,7 +131,7 @@ DeviceDelete.flags = {
131
131
  ...flags_1.EasNonInteractiveAndJsonFlags,
132
132
  };
133
133
  DeviceDelete.contextDefinition = {
134
- ..._a.ContextOptions.ProjectConfig,
134
+ ..._a.ContextOptions.ProjectId,
135
135
  ..._a.ContextOptions.LoggedIn,
136
136
  };
137
137
  exports.default = DeviceDelete;
@@ -10,7 +10,7 @@ export default class BuildList 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
  }
@@ -14,7 +14,7 @@ class BuildList extends EasCommand_1.default {
14
14
  async runAsync() {
15
15
  const { flags } = await this.parse(_a);
16
16
  const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
17
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
17
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
18
18
  nonInteractive: paginatedQueryOptions.nonInteractive,
19
19
  });
20
20
  let appleTeamIdentifier = flags['apple-team-id'];
@@ -56,7 +56,7 @@ BuildList.flags = {
56
56
  ...flags_1.EasNonInteractiveAndJsonFlags,
57
57
  };
58
58
  BuildList.contextDefinition = {
59
- ..._a.ContextOptions.ProjectConfig,
59
+ ..._a.ContextOptions.ProjectId,
60
60
  ..._a.ContextOptions.LoggedIn,
61
61
  };
62
62
  exports.default = BuildList;
@@ -14,7 +14,7 @@ export default class DeviceRename extends EasCommand {
14
14
  };
15
15
  static contextDefinition: {
16
16
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
17
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
17
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
18
18
  };
19
19
  runAsync(): Promise<void>;
20
20
  promptForNewDeviceNameAsync(initial: Maybe<string> | undefined): Promise<string | undefined>;
@@ -23,7 +23,7 @@ class DeviceRename extends EasCommand_1.default {
23
23
  const { flags } = await this.parse(_a);
24
24
  const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
25
25
  let { 'apple-team-id': appleTeamIdentifier, udid, name } = flags;
26
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
26
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
27
27
  nonInteractive: paginatedQueryOptions.nonInteractive,
28
28
  });
29
29
  const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
@@ -121,7 +121,7 @@ DeviceRename.flags = {
121
121
  ...flags_1.EasNonInteractiveAndJsonFlags,
122
122
  };
123
123
  DeviceRename.contextDefinition = {
124
- ..._a.ContextOptions.ProjectConfig,
124
+ ..._a.ContextOptions.ProjectId,
125
125
  ..._a.ContextOptions.LoggedIn,
126
126
  };
127
127
  exports.default = DeviceRename;
@@ -6,7 +6,7 @@ export default class DeviceView extends EasCommand {
6
6
  }[];
7
7
  static contextDefinition: {
8
8
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
9
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
9
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
10
10
  };
11
11
  runAsync(): Promise<void>;
12
12
  }
@@ -22,7 +22,7 @@ If you are not sure what is the UDID of the device you are looking for, run:
22
22
  `);
23
23
  throw new Error('Device UDID is missing');
24
24
  }
25
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
25
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
26
26
  nonInteractive: true,
27
27
  });
28
28
  const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
@@ -47,7 +47,7 @@ _a = DeviceView;
47
47
  DeviceView.description = 'view a device for your project';
48
48
  DeviceView.args = [{ name: 'UDID' }];
49
49
  DeviceView.contextDefinition = {
50
- ..._a.ContextOptions.ProjectConfig,
50
+ ..._a.ContextOptions.ProjectId,
51
51
  ..._a.ContextOptions.LoggedIn,
52
52
  };
53
53
  exports.default = DeviceView;
@@ -17,7 +17,7 @@ export default class EnvironmentVariableCreate 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 promptForOverwriteAsync;
@@ -20,8 +20,8 @@ class EnvironmentVariableCreate extends EasCommand_1.default {
20
20
  async runAsync() {
21
21
  const { flags } = await this.parse(_a);
22
22
  const validatedFlags = this.validateFlags(flags);
23
- const { name, value, scope, 'non-interactive': nonInteractive, environment: environments, visibility, link, force, type, } = await this.promptForMissingFlagsAsync(validatedFlags);
24
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
23
+ const { name, value, scope, 'non-interactive': nonInteractive, environment: environments, visibility, link, force, type, fileName, } = await this.promptForMissingFlagsAsync(validatedFlags);
24
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
25
25
  nonInteractive,
26
26
  });
27
27
  const [projectDisplayName, ownerAccount] = await Promise.all([
@@ -66,6 +66,7 @@ class EnvironmentVariableCreate extends EasCommand_1.default {
66
66
  visibility,
67
67
  environments,
68
68
  type,
69
+ fileName,
69
70
  })
70
71
  : await EnvironmentVariableMutation_1.EnvironmentVariableMutation.createForAppAsync(graphqlClient, {
71
72
  name,
@@ -73,6 +74,7 @@ class EnvironmentVariableCreate extends EasCommand_1.default {
73
74
  environments,
74
75
  visibility,
75
76
  type: type ?? generated_1.EnvironmentSecretType.String,
77
+ fileName,
76
78
  }, projectId);
77
79
  if (!variable) {
78
80
  throw new Error(`Could not create variable with name ${name} on project ${projectDisplayName}`);
@@ -163,11 +165,13 @@ class EnvironmentVariableCreate extends EasCommand_1.default {
163
165
  });
164
166
  }
165
167
  let environmentFilePath;
168
+ let fileName;
166
169
  if (newType === generated_1.EnvironmentSecretType.FileBase64) {
167
170
  environmentFilePath = path_1.default.resolve(value);
168
171
  if (!(await fs_extra_1.default.pathExists(environmentFilePath))) {
169
172
  throw new Error(`File "${value}" does not exist`);
170
173
  }
174
+ fileName = path_1.default.basename(environmentFilePath);
171
175
  }
172
176
  value = environmentFilePath ? await fs_extra_1.default.readFile(environmentFilePath, 'base64') : value;
173
177
  if (!environment) {
@@ -187,6 +191,7 @@ class EnvironmentVariableCreate extends EasCommand_1.default {
187
191
  scope: rest.scope ?? generated_1.EnvironmentVariableScope.Project,
188
192
  'non-interactive': nonInteractive,
189
193
  type: newType,
194
+ fileName,
190
195
  ...rest,
191
196
  };
192
197
  }
@@ -230,7 +235,7 @@ EnvironmentVariableCreate.flags = {
230
235
  ...flags_1.EASNonInteractiveFlag,
231
236
  };
232
237
  EnvironmentVariableCreate.contextDefinition = {
233
- ..._a.ContextOptions.ProjectConfig,
238
+ ..._a.ContextOptions.ProjectId,
234
239
  ..._a.ContextOptions.Analytics,
235
240
  ..._a.ContextOptions.LoggedIn,
236
241
  };
@@ -11,7 +11,7 @@ export default class EnvironmentVariableDelete extends EasCommand {
11
11
  };
12
12
  static contextDefinition: {
13
13
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
14
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
14
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
15
15
  };
16
16
  runAsync(): Promise<void>;
17
17
  private validateFlags;
@@ -17,7 +17,7 @@ class EnvironmentVariableDelete extends EasCommand_1.default {
17
17
  async runAsync() {
18
18
  const { flags } = await this.parse(_a);
19
19
  const { 'variable-name': name, 'variable-environment': environment, 'non-interactive': nonInteractive, scope, } = this.validateFlags(flags);
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 variables = scope === generated_1.EnvironmentVariableScope.Project
@@ -100,7 +100,7 @@ EnvironmentVariableDelete.flags = {
100
100
  ...flags_1.EASNonInteractiveFlag,
101
101
  };
102
102
  EnvironmentVariableDelete.contextDefinition = {
103
- ..._a.ContextOptions.ProjectConfig,
103
+ ..._a.ContextOptions.ProjectId,
104
104
  ..._a.ContextOptions.LoggedIn,
105
105
  };
106
106
  exports.default = EnvironmentVariableDelete;
@@ -5,7 +5,7 @@ export default class EnvExec 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
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -13,7 +13,7 @@ class EnvExec extends EasCommand_1.default {
13
13
  async runAsync() {
14
14
  const { flags, args: { BASH_COMMAND: command }, } = await this.parse(_a);
15
15
  const parsedFlags = this.sanitizeFlags(flags);
16
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
16
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
17
17
  nonInteractive: parsedFlags.nonInteractive,
18
18
  });
19
19
  const environment = parsedFlags.environment ??
@@ -108,7 +108,7 @@ _a = EnvExec;
108
108
  EnvExec.description = 'execute a bash command with environment variables from the selected environment';
109
109
  EnvExec.hidden = true;
110
110
  EnvExec.contextDefinition = {
111
- ..._a.ContextOptions.ProjectConfig,
111
+ ..._a.ContextOptions.ProjectId,
112
112
  ..._a.ContextOptions.LoggedIn,
113
113
  };
114
114
  EnvExec.flags = {
@@ -5,7 +5,7 @@ export default class EnvironmentVariableGet 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
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -15,7 +15,7 @@ class EnvironmentVariableGet extends EasCommand_1.default {
15
15
  async runAsync() {
16
16
  const { flags } = await this.parse(_a);
17
17
  let { 'variable-environment': environment, 'variable-name': name, 'non-interactive': nonInteractive, format, scope, } = this.validateFlags(flags);
18
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
18
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
19
19
  nonInteractive,
20
20
  });
21
21
  if (!name) {
@@ -72,7 +72,7 @@ _a = EnvironmentVariableGet;
72
72
  EnvironmentVariableGet.description = 'get environment variable';
73
73
  EnvironmentVariableGet.hidden = true;
74
74
  EnvironmentVariableGet.contextDefinition = {
75
- ..._a.ContextOptions.ProjectConfig,
75
+ ..._a.ContextOptions.ProjectId,
76
76
  ..._a.ContextOptions.LoggedIn,
77
77
  };
78
78
  EnvironmentVariableGet.flags = {
@@ -11,7 +11,7 @@ export default class EnvironmentVariableLink extends EasCommand {
11
11
  };
12
12
  static contextDefinition: {
13
13
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
14
- privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
14
+ projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
15
15
  };
16
16
  runAsync(): Promise<void>;
17
17
  }
@@ -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>;
@@ -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");
@@ -16,7 +17,7 @@ const prompts_2 = require("../../utils/prompts");
16
17
  class EnvironmentVariablePush extends EasCommand_1.default {
17
18
  async runAsync() {
18
19
  let { flags: { environment: environments, path: envPath }, } = await this.parse(_a);
19
- const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
20
+ const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
20
21
  nonInteractive: false,
21
22
  });
22
23
  if (!environments) {
@@ -124,7 +125,17 @@ class EnvironmentVariablePush extends EasCommand_1.default {
124
125
  }
125
126
  const pushInput = {};
126
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
+ }
127
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
+ }
128
139
  pushInput[name] = {
129
140
  name,
130
141
  value,
@@ -141,7 +152,7 @@ _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;