eas-cli 12.5.2 → 12.5.4

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 +60 -60
  2. package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +1 -1
  3. package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.d.ts +1 -1
  4. package/build/commandUtils/context/PrivateProjectConfigContextField.d.ts +1 -1
  5. package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +1 -1
  6. package/build/commandUtils/flags.d.ts +2 -2
  7. package/build/commandUtils/flags.js +1 -6
  8. package/build/commands/env/create.d.ts +3 -2
  9. package/build/commands/env/create.js +43 -7
  10. package/build/commands/env/get.js +11 -13
  11. package/build/commands/env/link.js +3 -0
  12. package/build/commands/env/list.d.ts +1 -0
  13. package/build/commands/env/list.js +21 -7
  14. package/build/commands/env/pull.js +1 -1
  15. package/build/commands/env/push.d.ts +1 -1
  16. package/build/commands/env/push.js +80 -74
  17. package/build/commands/env/update.d.ts +4 -2
  18. package/build/commands/env/update.js +88 -22
  19. package/build/eas-update/utils.d.ts +1 -1
  20. package/build/graphql/generated.d.ts +16 -0
  21. package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +1 -1
  22. package/build/graphql/queries/EnvironmentVariablesQuery.d.ts +15 -8
  23. package/build/graphql/queries/EnvironmentVariablesQuery.js +25 -14
  24. package/build/graphql/types/EnvironmentVariable.js +1 -0
  25. package/build/graphql/types/EnvironmentVariableWithSecret.d.ts +1 -0
  26. package/build/graphql/types/EnvironmentVariableWithSecret.js +18 -0
  27. package/build/metadata/download.d.ts +1 -1
  28. package/build/metadata/upload.d.ts +1 -1
  29. package/build/prompts.d.ts +1 -0
  30. package/build/prompts.js +2 -0
  31. package/build/update/configure.d.ts +1 -1
  32. package/build/utils/expoCli.d.ts +1 -1
  33. package/build/utils/prompts.d.ts +5 -2
  34. package/build/utils/prompts.js +55 -12
  35. package/build/utils/variableUtils.d.ts +3 -1
  36. package/build/utils/variableUtils.js +34 -3
  37. package/oclif.manifest.json +36 -8
  38. package/package.json +3 -4
@@ -5,6 +5,8 @@ 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 fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
9
+ const path_1 = tslib_1.__importDefault(require("path"));
8
10
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
9
11
  const flags_1 = require("../../commandUtils/flags");
10
12
  const generated_1 = require("../../graphql/generated");
@@ -18,7 +20,7 @@ const variableUtils_1 = require("../../utils/variableUtils");
18
20
  class EnvironmentVariableUpdate extends EasCommand_1.default {
19
21
  async runAsync() {
20
22
  const { flags } = await this.parse(_a);
21
- let { name, value, scope, 'variable-name': currentName, 'variable-environment': currentEnvironment, 'non-interactive': nonInteractive, environment: environments, visibility, } = this.validateFlags(flags);
23
+ const { name, value: rawValue, scope, 'variable-name': currentName, 'variable-environment': currentEnvironment, 'non-interactive': nonInteractive, environment: environments, type, visibility, } = this.validateFlags(flags);
22
24
  const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
23
25
  nonInteractive,
24
26
  });
@@ -46,7 +48,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
46
48
  });
47
49
  }
48
50
  if (existingVariables.length === 0) {
49
- throw new Error(`Variable with name ${currentName} ${currentEnvironment ? `in environment ${currentEnvironment}` : ''} does not exist ${suffix}.`);
51
+ throw new Error(`Variable with name ${currentName} ${currentEnvironment ? `in environment ${currentEnvironment.toLocaleLowerCase()}` : ''} does not exist ${suffix}.`);
50
52
  }
51
53
  else if (existingVariables.length > 1) {
52
54
  selectedVariable = await (0, prompts_1.selectAsync)('Select variable', existingVariables.map(variable => ({
@@ -58,6 +60,47 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
58
60
  selectedVariable = existingVariables[0];
59
61
  }
60
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, {
64
+ name,
65
+ value: rawValue,
66
+ environment: environments,
67
+ visibility,
68
+ 'non-interactive': nonInteractive,
69
+ type,
70
+ });
71
+ const variable = await EnvironmentVariableMutation_1.EnvironmentVariableMutation.updateAsync(graphqlClient, {
72
+ id: selectedVariable.id,
73
+ name: newName,
74
+ value: newValue,
75
+ environments: newEnvironments,
76
+ type: newType,
77
+ visibility: newVisibility,
78
+ });
79
+ if (!variable) {
80
+ throw new Error(`Could not update variable with name ${name} ${suffix}`);
81
+ }
82
+ log_1.default.withTick(`Updated variable ${chalk_1.default.bold(selectedVariable.name)} ${suffix}.`);
83
+ }
84
+ validateFlags(flags) {
85
+ if (flags['non-interactive']) {
86
+ if (!flags['variable-name']) {
87
+ throw new Error('Current name is required in non-interactive mode. Run the command with --variable-name flag.');
88
+ }
89
+ if (flags['type'] && !flags['value']) {
90
+ throw new Error('Value is required when type is set. Run the command with --value flag.');
91
+ }
92
+ }
93
+ return flags;
94
+ }
95
+ async promptForMissingFlagsAsync(selectedVariable, { name, value, environment: environments, visibility, 'non-interactive': nonInteractive, type, ...rest }) {
96
+ let newType;
97
+ let newVisibility;
98
+ if (type === 'file') {
99
+ newType = generated_1.EnvironmentSecretType.FileBase64;
100
+ }
101
+ else if (type === 'string') {
102
+ newType = generated_1.EnvironmentSecretType.String;
103
+ }
61
104
  if (!nonInteractive) {
62
105
  if (!name) {
63
106
  name = await (0, prompts_2.promptVariableNameAsync)(nonInteractive, selectedVariable.name);
@@ -65,46 +108,65 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
65
108
  name = undefined;
66
109
  }
67
110
  }
111
+ if (!type && !value && !nonInteractive) {
112
+ newType = await (0, prompts_2.promptVariableTypeAsync)(nonInteractive, selectedVariable.type);
113
+ if (!newType || newType === selectedVariable.type) {
114
+ newType = undefined;
115
+ }
116
+ }
68
117
  if (!value) {
69
118
  value = await (0, prompts_2.promptVariableValueAsync)({
70
119
  nonInteractive,
71
120
  required: false,
72
- initial: selectedVariable.value,
121
+ filePath: (newType ?? selectedVariable.type) === generated_1.EnvironmentSecretType.FileBase64,
122
+ initial: (newType ?? selectedVariable.type) === generated_1.EnvironmentSecretType.FileBase64
123
+ ? undefined
124
+ : selectedVariable.value,
73
125
  });
74
- if (!value || value.length === 0) {
126
+ if (!value || value.length === 0 || value === selectedVariable.value) {
75
127
  value = undefined;
76
128
  }
77
129
  }
130
+ let environmentFilePath;
131
+ if ((newType ?? selectedVariable.type) === generated_1.EnvironmentSecretType.FileBase64 && value) {
132
+ environmentFilePath = path_1.default.resolve(value);
133
+ if (!(await fs_extra_1.default.pathExists(environmentFilePath))) {
134
+ throw new Error(`File "${value}" does not exist`);
135
+ }
136
+ }
137
+ value = environmentFilePath ? await fs_extra_1.default.readFile(environmentFilePath, 'base64') : value;
78
138
  if (!environments || environments.length === 0) {
79
139
  environments = await (0, prompts_2.promptVariableEnvironmentAsync)({
80
140
  nonInteractive,
81
141
  multiple: true,
82
142
  selectedEnvironments: selectedVariable.environments ?? [],
83
143
  });
144
+ if (!environments ||
145
+ environments.length === 0 ||
146
+ environments === selectedVariable.environments) {
147
+ environments = undefined;
148
+ }
84
149
  }
85
150
  if (!visibility) {
86
- visibility = await (0, prompts_2.promptVariableVisibilityAsync)(nonInteractive, selectedVariable.visibility);
151
+ newVisibility = await (0, prompts_2.promptVariableVisibilityAsync)(nonInteractive, selectedVariable.visibility);
152
+ if (!newVisibility || newVisibility === selectedVariable.visibility) {
153
+ newVisibility = undefined;
154
+ }
87
155
  }
88
156
  }
89
- const variable = await EnvironmentVariableMutation_1.EnvironmentVariableMutation.updateAsync(graphqlClient, {
90
- id: selectedVariable.id,
157
+ if (visibility) {
158
+ newVisibility = (0, prompts_2.parseVisibility)(visibility);
159
+ }
160
+ return {
91
161
  name,
92
162
  value,
93
- environments,
94
- visibility,
95
- });
96
- if (!variable) {
97
- throw new Error(`Could not update variable with name ${name} ${suffix}`);
98
- }
99
- log_1.default.withTick(`Updated variable ${chalk_1.default.bold(selectedVariable.name)} ${suffix}.`);
100
- }
101
- validateFlags(flags) {
102
- if (flags['non-interactive']) {
103
- if (!flags['variable-name']) {
104
- throw new Error('Current name is required in non-interactive mode. Run the command with --variable-name flag.');
105
- }
106
- }
107
- return flags;
163
+ environment: environments,
164
+ visibility: newVisibility,
165
+ scope: rest.scope ?? generated_1.EnvironmentVariableScope.Project,
166
+ 'non-interactive': nonInteractive,
167
+ type: newType,
168
+ ...rest,
169
+ };
108
170
  }
109
171
  }
110
172
  _a = EnvironmentVariableUpdate;
@@ -124,6 +186,10 @@ EnvironmentVariableUpdate.flags = {
124
186
  value: core_1.Flags.string({
125
187
  description: 'New value or the variable',
126
188
  }),
189
+ type: core_1.Flags.enum({
190
+ description: 'The type of variable',
191
+ options: ['string', 'file'],
192
+ }),
127
193
  ...flags_1.EASVariableVisibilityFlag,
128
194
  ...flags_1.EASVariableScopeFlag,
129
195
  ...flags_1.EASMultiEnvironmentFlag,
@@ -1,4 +1,4 @@
1
- import { ExpoConfig } from '@expo/config-types';
1
+ import { ExpoConfig } from '@expo/config';
2
2
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
3
3
  import { Client } from '../vcs/vcs';
4
4
  export type EASUpdateContext = {
@@ -10822,6 +10822,7 @@ export type LinkSharedEnvironmentVariableMutation = {
10822
10822
  updatedAt: any;
10823
10823
  scope: EnvironmentVariableScope;
10824
10824
  visibility?: EnvironmentVariableVisibility | null;
10825
+ type: EnvironmentSecretType;
10825
10826
  };
10826
10827
  };
10827
10828
  };
@@ -10844,6 +10845,7 @@ export type UnlinkSharedEnvironmentVariableMutation = {
10844
10845
  updatedAt: any;
10845
10846
  scope: EnvironmentVariableScope;
10846
10847
  visibility?: EnvironmentVariableVisibility | null;
10848
+ type: EnvironmentSecretType;
10847
10849
  };
10848
10850
  };
10849
10851
  };
@@ -10865,6 +10867,7 @@ export type CreateEnvironmentVariableForAccountMutation = {
10865
10867
  updatedAt: any;
10866
10868
  scope: EnvironmentVariableScope;
10867
10869
  visibility?: EnvironmentVariableVisibility | null;
10870
+ type: EnvironmentSecretType;
10868
10871
  };
10869
10872
  };
10870
10873
  };
@@ -10886,6 +10889,7 @@ export type CreateEnvironmentVariableForAppMutation = {
10886
10889
  updatedAt: any;
10887
10890
  scope: EnvironmentVariableScope;
10888
10891
  visibility?: EnvironmentVariableVisibility | null;
10892
+ type: EnvironmentSecretType;
10889
10893
  };
10890
10894
  };
10891
10895
  };
@@ -10906,6 +10910,7 @@ export type UpdateEnvironmentVariableMutation = {
10906
10910
  updatedAt: any;
10907
10911
  scope: EnvironmentVariableScope;
10908
10912
  visibility?: EnvironmentVariableVisibility | null;
10913
+ type: EnvironmentSecretType;
10909
10914
  };
10910
10915
  };
10911
10916
  };
@@ -12100,6 +12105,7 @@ export type EnvironmentVariablesIncludingSensitiveByAppIdQueryVariables = Exact<
12100
12105
  appId: Scalars['String']['input'];
12101
12106
  filterNames?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
12102
12107
  environment?: InputMaybe<EnvironmentVariableEnvironment>;
12108
+ includeFileContent: Scalars['Boolean']['input'];
12103
12109
  }>;
12104
12110
  export type EnvironmentVariablesIncludingSensitiveByAppIdQuery = {
12105
12111
  __typename?: 'RootQuery';
@@ -12114,6 +12120,7 @@ export type EnvironmentVariablesIncludingSensitiveByAppIdQuery = {
12114
12120
  name: string;
12115
12121
  value?: string | null;
12116
12122
  environments?: Array<EnvironmentVariableEnvironment> | null;
12123
+ valueWithFileContent?: string | null;
12117
12124
  }>;
12118
12125
  };
12119
12126
  };
@@ -12122,6 +12129,7 @@ export type EnvironmentVariablesByAppIdQueryVariables = Exact<{
12122
12129
  appId: Scalars['String']['input'];
12123
12130
  filterNames?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
12124
12131
  environment?: InputMaybe<EnvironmentVariableEnvironment>;
12132
+ includeFileContent: Scalars['Boolean']['input'];
12125
12133
  }>;
12126
12134
  export type EnvironmentVariablesByAppIdQuery = {
12127
12135
  __typename?: 'RootQuery';
@@ -12141,6 +12149,8 @@ export type EnvironmentVariablesByAppIdQuery = {
12141
12149
  updatedAt: any;
12142
12150
  scope: EnvironmentVariableScope;
12143
12151
  visibility?: EnvironmentVariableVisibility | null;
12152
+ type: EnvironmentSecretType;
12153
+ valueWithFileContent?: string | null;
12144
12154
  }>;
12145
12155
  };
12146
12156
  };
@@ -12149,6 +12159,7 @@ export type EnvironmentVariablesSharedQueryVariables = Exact<{
12149
12159
  appId: Scalars['String']['input'];
12150
12160
  filterNames?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
12151
12161
  environment?: InputMaybe<EnvironmentVariableEnvironment>;
12162
+ includeFileContent: Scalars['Boolean']['input'];
12152
12163
  }>;
12153
12164
  export type EnvironmentVariablesSharedQuery = {
12154
12165
  __typename?: 'RootQuery';
@@ -12171,6 +12182,8 @@ export type EnvironmentVariablesSharedQuery = {
12171
12182
  updatedAt: any;
12172
12183
  scope: EnvironmentVariableScope;
12173
12184
  visibility?: EnvironmentVariableVisibility | null;
12185
+ type: EnvironmentSecretType;
12186
+ valueWithFileContent?: string | null;
12174
12187
  }>;
12175
12188
  };
12176
12189
  };
@@ -12180,6 +12193,7 @@ export type EnvironmentVariablesSharedWithSensitiveQueryVariables = Exact<{
12180
12193
  appId: Scalars['String']['input'];
12181
12194
  filterNames?: InputMaybe<Array<Scalars['String']['input']> | Scalars['String']['input']>;
12182
12195
  environment?: InputMaybe<EnvironmentVariableEnvironment>;
12196
+ includeFileContent: Scalars['Boolean']['input'];
12183
12197
  }>;
12184
12198
  export type EnvironmentVariablesSharedWithSensitiveQuery = {
12185
12199
  __typename?: 'RootQuery';
@@ -12197,6 +12211,7 @@ export type EnvironmentVariablesSharedWithSensitiveQuery = {
12197
12211
  name: string;
12198
12212
  value?: string | null;
12199
12213
  environments?: Array<EnvironmentVariableEnvironment> | null;
12214
+ valueWithFileContent?: string | null;
12200
12215
  }>;
12201
12216
  };
12202
12217
  };
@@ -13062,6 +13077,7 @@ export type EnvironmentVariableFragment = {
13062
13077
  updatedAt: any;
13063
13078
  scope: EnvironmentVariableScope;
13064
13079
  visibility?: EnvironmentVariableVisibility | null;
13080
+ type: EnvironmentSecretType;
13065
13081
  };
13066
13082
  export type RuntimeFragment = {
13067
13083
  __typename?: 'Runtime';
@@ -10,7 +10,7 @@ type CreateVariableArgs = {
10
10
  export type EnvironmentVariablePushInput = {
11
11
  name: string;
12
12
  value: string;
13
- environment: string;
13
+ environments: EnvironmentVariableEnvironment[];
14
14
  visibility: EnvironmentVariableVisibility;
15
15
  overwrite?: boolean;
16
16
  };
@@ -3,26 +3,33 @@ import { EnvironmentVariableEnvironment, EnvironmentVariableFragment } from '../
3
3
  type EnvironmentVariableWithLinkedEnvironments = EnvironmentVariableFragment & {
4
4
  linkedEnvironments?: EnvironmentVariableEnvironment[] | null;
5
5
  };
6
+ export type EnvironmentVariableWithFileContent = EnvironmentVariableFragment & {
7
+ valueWithFileContent?: string | null | undefined;
8
+ };
6
9
  export declare const EnvironmentVariablesQuery: {
7
- byAppIdWithSensitiveAsync(graphqlClient: ExpoGraphqlClient, { appId, environment, filterNames, }: {
10
+ byAppIdWithSensitiveAsync(graphqlClient: ExpoGraphqlClient, { appId, environment, filterNames, includeFileContent, }: {
8
11
  appId: string;
9
12
  environment?: EnvironmentVariableEnvironment | undefined;
10
13
  filterNames?: string[] | undefined;
11
- }): Promise<EnvironmentVariableFragment[]>;
12
- byAppIdAsync(graphqlClient: ExpoGraphqlClient, { appId, environment, filterNames, }: {
14
+ includeFileContent?: boolean | undefined;
15
+ }): Promise<EnvironmentVariableWithFileContent[]>;
16
+ byAppIdAsync(graphqlClient: ExpoGraphqlClient, { appId, environment, filterNames, includeFileContent, }: {
13
17
  appId: string;
14
18
  environment?: EnvironmentVariableEnvironment | undefined;
15
19
  filterNames?: string[] | undefined;
16
- }): Promise<EnvironmentVariableWithLinkedEnvironments[]>;
17
- sharedAsync(graphqlClient: ExpoGraphqlClient, { appId, filterNames, environment, }: {
20
+ includeFileContent?: boolean | undefined;
21
+ }): Promise<(EnvironmentVariableWithFileContent & EnvironmentVariableWithLinkedEnvironments)[]>;
22
+ sharedAsync(graphqlClient: ExpoGraphqlClient, { appId, filterNames, environment, includeFileContent, }: {
18
23
  appId: string;
19
24
  filterNames?: string[] | undefined;
20
25
  environment?: EnvironmentVariableEnvironment | undefined;
21
- }): Promise<EnvironmentVariableWithLinkedEnvironments[]>;
22
- sharedWithSensitiveAsync(graphqlClient: ExpoGraphqlClient, { appId, filterNames, environment, }: {
26
+ includeFileContent?: boolean | undefined;
27
+ }): Promise<(EnvironmentVariableWithFileContent & EnvironmentVariableWithLinkedEnvironments)[]>;
28
+ sharedWithSensitiveAsync(graphqlClient: ExpoGraphqlClient, { appId, filterNames, environment, includeFileContent, }: {
23
29
  appId: string;
24
30
  filterNames?: string[] | undefined;
25
31
  environment?: EnvironmentVariableEnvironment | undefined;
26
- }): Promise<EnvironmentVariableFragment[]>;
32
+ includeFileContent?: boolean | undefined;
33
+ }): Promise<EnvironmentVariableWithFileContent[]>;
27
34
  };
28
35
  export {};
@@ -6,14 +6,16 @@ const graphql_1 = require("graphql");
6
6
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
7
  const client_1 = require("../client");
8
8
  const EnvironmentVariable_1 = require("../types/EnvironmentVariable");
9
+ const EnvironmentVariableWithSecret_1 = require("../types/EnvironmentVariableWithSecret");
9
10
  exports.EnvironmentVariablesQuery = {
10
- async byAppIdWithSensitiveAsync(graphqlClient, { appId, environment, filterNames, }) {
11
+ async byAppIdWithSensitiveAsync(graphqlClient, { appId, environment, filterNames, includeFileContent = false, }) {
11
12
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
12
13
  .query((0, graphql_tag_1.default) `
13
14
  query EnvironmentVariablesIncludingSensitiveByAppId(
14
15
  $appId: String!
15
16
  $filterNames: [String!]
16
17
  $environment: EnvironmentVariableEnvironment
18
+ $includeFileContent: Boolean!
17
19
  ) {
18
20
  app {
19
21
  byId(appId: $appId) {
@@ -23,24 +25,26 @@ exports.EnvironmentVariablesQuery = {
23
25
  environment: $environment
24
26
  ) {
25
27
  id
26
- name
27
- value
28
- environments
28
+ ...EnvironmentVariableWithSecretFragment
29
+ valueWithFileContent: value(includeFileContent: $includeFileContent)
30
+ @include(if: $includeFileContent)
29
31
  }
30
32
  }
31
33
  }
32
34
  }
33
- `, { appId, filterNames, environment }, { additionalTypenames: ['EnvironmentVariableWithSecret'] })
35
+ ${(0, graphql_1.print)(EnvironmentVariableWithSecret_1.EnvironmentVariableWithSecretFragmentNode)}
36
+ `, { appId, filterNames, environment, includeFileContent }, { additionalTypenames: ['EnvironmentVariableWithSecret'] })
34
37
  .toPromise());
35
38
  return data.app?.byId.environmentVariablesIncludingSensitive ?? [];
36
39
  },
37
- async byAppIdAsync(graphqlClient, { appId, environment, filterNames, }) {
40
+ async byAppIdAsync(graphqlClient, { appId, environment, filterNames, includeFileContent = false, }) {
38
41
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
39
42
  .query((0, graphql_tag_1.default) `
40
43
  query EnvironmentVariablesByAppId(
41
44
  $appId: String!
42
45
  $filterNames: [String!]
43
46
  $environment: EnvironmentVariableEnvironment
47
+ $includeFileContent: Boolean!
44
48
  ) {
45
49
  app {
46
50
  byId(appId: $appId) {
@@ -49,22 +53,25 @@ exports.EnvironmentVariablesQuery = {
49
53
  id
50
54
  linkedEnvironments(appId: $appId)
51
55
  ...EnvironmentVariableFragment
56
+ valueWithFileContent: value(includeFileContent: $includeFileContent)
57
+ @include(if: $includeFileContent)
52
58
  }
53
59
  }
54
60
  }
55
61
  }
56
62
  ${(0, graphql_1.print)(EnvironmentVariable_1.EnvironmentVariableFragmentNode)}
57
- `, { appId, filterNames, environment }, { additionalTypenames: ['EnvironmentVariable'] })
63
+ `, { appId, filterNames, environment, includeFileContent }, { additionalTypenames: ['EnvironmentVariable'] })
58
64
  .toPromise());
59
65
  return data.app?.byId.environmentVariables ?? [];
60
66
  },
61
- async sharedAsync(graphqlClient, { appId, filterNames, environment, }) {
67
+ async sharedAsync(graphqlClient, { appId, filterNames, environment, includeFileContent = false, }) {
62
68
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
63
69
  .query((0, graphql_tag_1.default) `
64
70
  query EnvironmentVariablesShared(
65
71
  $appId: String!
66
72
  $filterNames: [String!]
67
73
  $environment: EnvironmentVariableEnvironment
74
+ $includeFileContent: Boolean!
68
75
  ) {
69
76
  app {
70
77
  byId(appId: $appId) {
@@ -75,23 +82,26 @@ exports.EnvironmentVariablesQuery = {
75
82
  id
76
83
  linkedEnvironments(appId: $appId)
77
84
  ...EnvironmentVariableFragment
85
+ valueWithFileContent: value(includeFileContent: $includeFileContent)
86
+ @include(if: $includeFileContent)
78
87
  }
79
88
  }
80
89
  }
81
90
  }
82
91
  }
83
92
  ${(0, graphql_1.print)(EnvironmentVariable_1.EnvironmentVariableFragmentNode)}
84
- `, { appId, filterNames, environment }, { additionalTypenames: ['EnvironmentVariable'] })
93
+ `, { appId, filterNames, environment, includeFileContent }, { additionalTypenames: ['EnvironmentVariable'] })
85
94
  .toPromise());
86
95
  return data.app?.byId.ownerAccount.environmentVariables ?? [];
87
96
  },
88
- async sharedWithSensitiveAsync(graphqlClient, { appId, filterNames, environment, }) {
97
+ async sharedWithSensitiveAsync(graphqlClient, { appId, filterNames, environment, includeFileContent = false, }) {
89
98
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
90
99
  .query((0, graphql_tag_1.default) `
91
100
  query EnvironmentVariablesSharedWithSensitive(
92
101
  $appId: String!
93
102
  $filterNames: [String!]
94
103
  $environment: EnvironmentVariableEnvironment
104
+ $includeFileContent: Boolean!
95
105
  ) {
96
106
  app {
97
107
  byId(appId: $appId) {
@@ -103,15 +113,16 @@ exports.EnvironmentVariablesQuery = {
103
113
  environment: $environment
104
114
  ) {
105
115
  id
106
- name
107
- value
108
- environments
116
+ ...EnvironmentVariableWithSecretFragment
117
+ valueWithFileContent: value(includeFileContent: $includeFileContent)
118
+ @include(if: $includeFileContent)
109
119
  }
110
120
  }
111
121
  }
112
122
  }
113
123
  }
114
- `, { appId, filterNames, environment }, { additionalTypenames: ['EnvironmentVariableWithSecret'] })
124
+ ${(0, graphql_1.print)(EnvironmentVariableWithSecret_1.EnvironmentVariableWithSecretFragmentNode)}
125
+ `, { appId, filterNames, environment, includeFileContent }, { additionalTypenames: ['EnvironmentVariableWithSecret'] })
115
126
  .toPromise());
116
127
  return data.app?.byId.ownerAccount.environmentVariablesIncludingSensitive ?? [];
117
128
  },
@@ -13,5 +13,6 @@ exports.EnvironmentVariableFragmentNode = (0, graphql_tag_1.default) `
13
13
  updatedAt
14
14
  scope
15
15
  visibility
16
+ type
16
17
  }
17
18
  `;
@@ -0,0 +1 @@
1
+ export declare const EnvironmentVariableWithSecretFragmentNode: import("graphql").DocumentNode;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnvironmentVariableWithSecretFragmentNode = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
+ exports.EnvironmentVariableWithSecretFragmentNode = (0, graphql_tag_1.default) `
7
+ fragment EnvironmentVariableWithSecretFragment on EnvironmentVariableWithSecret {
8
+ id
9
+ name
10
+ value
11
+ environments
12
+ createdAt
13
+ updatedAt
14
+ scope
15
+ visibility
16
+ type
17
+ }
18
+ `;
@@ -1,4 +1,4 @@
1
- import { ExpoConfig } from '@expo/config-types';
1
+ import { ExpoConfig } from '@expo/config';
2
2
  import { SubmitProfile } from '@expo/eas-json';
3
3
  import { Analytics } from '../analytics/AnalyticsManager';
4
4
  import { CredentialsContext } from '../credentials/context';
@@ -1,4 +1,4 @@
1
- import { ExpoConfig } from '@expo/config-types';
1
+ import { ExpoConfig } from '@expo/config';
2
2
  import { SubmitProfile } from '@expo/eas-json';
3
3
  import { Analytics } from '../analytics/AnalyticsManager';
4
4
  import { CredentialsContext } from '../credentials/context';
@@ -9,6 +9,7 @@ export declare function promptAsync<T extends string = string>(questions: Questi
9
9
  export declare function confirmAsync(question: NamelessQuestion, options?: Options): Promise<boolean>;
10
10
  export declare function selectAsync<T>(message: string, choices: ExpoChoice<T>[], config?: {
11
11
  options?: Options;
12
+ initial?: T;
12
13
  warningMessageForDisabledEntries?: string;
13
14
  }): Promise<T>;
14
15
  /**
package/build/prompts.js CHANGED
@@ -32,9 +32,11 @@ async function confirmAsync(question, options) {
32
32
  }
33
33
  exports.confirmAsync = confirmAsync;
34
34
  async function selectAsync(message, choices, config) {
35
+ const initial = config?.initial ? choices.findIndex(({ value }) => value === config.initial) : 0;
35
36
  const { value } = await promptAsync({
36
37
  message,
37
38
  choices,
39
+ initial,
38
40
  name: 'value',
39
41
  type: 'select',
40
42
  warn: config?.warningMessageForDisabledEntries,
@@ -1,4 +1,4 @@
1
- import { ExpoConfig } from '@expo/config-types';
1
+ import { ExpoConfig } from '@expo/config';
2
2
  import { Env, Workflow } from '@expo/eas-build-job';
3
3
  import { RequestedPlatform } from '../platform';
4
4
  import { Client } from '../vcs/vcs';
@@ -1,4 +1,4 @@
1
- import { ExpoConfig } from '@expo/config-types';
1
+ import { ExpoConfig } from '@expo/config';
2
2
  /**
3
3
  * @returns `true` if the project is SDK +46, has `@expo/cli`, and `EXPO_USE_LOCAL_CLI` is not set to a _false_ value.
4
4
  */
@@ -1,4 +1,6 @@
1
- import { EnvironmentVariableEnvironment, EnvironmentVariableVisibility } from '../graphql/generated';
1
+ import { EnvironmentSecretType, EnvironmentVariableEnvironment, EnvironmentVariableVisibility } from '../graphql/generated';
2
+ export declare function promptVariableTypeAsync(nonInteractive: boolean, initialType?: EnvironmentSecretType): Promise<EnvironmentSecretType>;
3
+ export declare function parseVisibility(stringVisibility: 'plaintext' | 'sensitive' | 'encrypted'): EnvironmentVariableVisibility;
2
4
  export declare function promptVariableVisibilityAsync(nonInteractive: boolean, selectedVisibility?: EnvironmentVariableVisibility | null): Promise<EnvironmentVariableVisibility>;
3
5
  type EnvironmentPromptArgs = {
4
6
  nonInteractive: boolean;
@@ -11,10 +13,11 @@ export declare function promptVariableEnvironmentAsync(input: EnvironmentPromptA
11
13
  export declare function promptVariableEnvironmentAsync(input: EnvironmentPromptArgs & {
12
14
  multiple?: false;
13
15
  }): Promise<EnvironmentVariableEnvironment>;
14
- export declare function promptVariableValueAsync({ nonInteractive, required, hidden, initial, }: {
16
+ export declare function promptVariableValueAsync({ nonInteractive, required, hidden, filePath, initial, }: {
15
17
  nonInteractive: boolean;
16
18
  required?: boolean;
17
19
  initial?: string | null;
20
+ filePath?: boolean;
18
21
  hidden?: boolean;
19
22
  }): Promise<string>;
20
23
  export declare function promptVariableNameAsync(nonInteractive: boolean, initialValue?: string): Promise<string>;