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.
- package/README.md +60 -60
- package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +1 -1
- package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.d.ts +1 -1
- package/build/commandUtils/context/PrivateProjectConfigContextField.d.ts +1 -1
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +1 -1
- package/build/commandUtils/flags.d.ts +2 -2
- package/build/commandUtils/flags.js +1 -6
- package/build/commands/env/create.d.ts +3 -2
- package/build/commands/env/create.js +43 -7
- package/build/commands/env/get.js +11 -13
- package/build/commands/env/link.js +3 -0
- package/build/commands/env/list.d.ts +1 -0
- package/build/commands/env/list.js +21 -7
- package/build/commands/env/pull.js +1 -1
- package/build/commands/env/push.d.ts +1 -1
- package/build/commands/env/push.js +80 -74
- package/build/commands/env/update.d.ts +4 -2
- package/build/commands/env/update.js +88 -22
- package/build/eas-update/utils.d.ts +1 -1
- package/build/graphql/generated.d.ts +16 -0
- package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +1 -1
- package/build/graphql/queries/EnvironmentVariablesQuery.d.ts +15 -8
- package/build/graphql/queries/EnvironmentVariablesQuery.js +25 -14
- package/build/graphql/types/EnvironmentVariable.js +1 -0
- package/build/graphql/types/EnvironmentVariableWithSecret.d.ts +1 -0
- package/build/graphql/types/EnvironmentVariableWithSecret.js +18 -0
- package/build/metadata/download.d.ts +1 -1
- package/build/metadata/upload.d.ts +1 -1
- package/build/prompts.d.ts +1 -0
- package/build/prompts.js +2 -0
- package/build/update/configure.d.ts +1 -1
- package/build/utils/expoCli.d.ts +1 -1
- package/build/utils/prompts.d.ts +5 -2
- package/build/utils/prompts.js +55 -12
- package/build/utils/variableUtils.d.ts +3 -1
- package/build/utils/variableUtils.js +34 -3
- package/oclif.manifest.json +36 -8
- package/package.json +3 -4
package/build/utils/prompts.js
CHANGED
|
@@ -1,20 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.promptVariableNameAsync = exports.promptVariableValueAsync = exports.promptVariableEnvironmentAsync = exports.promptVariableVisibilityAsync = void 0;
|
|
3
|
+
exports.promptVariableNameAsync = exports.promptVariableValueAsync = exports.promptVariableEnvironmentAsync = exports.promptVariableVisibilityAsync = exports.parseVisibility = exports.promptVariableTypeAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
-
const capitalize_1 = tslib_1.__importDefault(require("./expodash/capitalize"));
|
|
7
6
|
const generated_1 = require("../graphql/generated");
|
|
8
7
|
const prompts_1 = require("../prompts");
|
|
8
|
+
async function promptVariableTypeAsync(nonInteractive, initialType) {
|
|
9
|
+
if (nonInteractive) {
|
|
10
|
+
throw new Error('The `--type` flag must be set when running in `--non-interactive` mode.');
|
|
11
|
+
}
|
|
12
|
+
const options = [
|
|
13
|
+
{
|
|
14
|
+
title: 'String',
|
|
15
|
+
value: generated_1.EnvironmentSecretType.String,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: 'File',
|
|
19
|
+
value: generated_1.EnvironmentSecretType.FileBase64,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
return await (0, prompts_1.selectAsync)('Select the type of variable', options, {
|
|
23
|
+
initial: initialType,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.promptVariableTypeAsync = promptVariableTypeAsync;
|
|
27
|
+
function parseVisibility(stringVisibility) {
|
|
28
|
+
switch (stringVisibility) {
|
|
29
|
+
case 'plaintext':
|
|
30
|
+
return generated_1.EnvironmentVariableVisibility.Public;
|
|
31
|
+
case 'sensitive':
|
|
32
|
+
return generated_1.EnvironmentVariableVisibility.Sensitive;
|
|
33
|
+
case 'encrypted':
|
|
34
|
+
return generated_1.EnvironmentVariableVisibility.Secret;
|
|
35
|
+
default:
|
|
36
|
+
throw new Error(`Invalid visibility: ${stringVisibility}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.parseVisibility = parseVisibility;
|
|
9
40
|
async function promptVariableVisibilityAsync(nonInteractive, selectedVisibility) {
|
|
10
41
|
if (nonInteractive) {
|
|
11
42
|
throw new Error('The `--visibility` flag must be set when running in `--non-interactive` mode.');
|
|
12
43
|
}
|
|
13
|
-
return await (0, prompts_1.selectAsync)('Select visibility:',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
44
|
+
return await (0, prompts_1.selectAsync)('Select visibility:', [
|
|
45
|
+
{
|
|
46
|
+
title: 'Plain text',
|
|
47
|
+
value: generated_1.EnvironmentVariableVisibility.Public,
|
|
48
|
+
selected: selectedVisibility === generated_1.EnvironmentVariableVisibility.Public,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
title: 'Sensitive',
|
|
52
|
+
value: generated_1.EnvironmentVariableVisibility.Sensitive,
|
|
53
|
+
selected: selectedVisibility === generated_1.EnvironmentVariableVisibility.Sensitive,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
title: 'Encrypted',
|
|
57
|
+
value: generated_1.EnvironmentVariableVisibility.Secret,
|
|
58
|
+
selected: selectedVisibility === generated_1.EnvironmentVariableVisibility.Secret,
|
|
59
|
+
},
|
|
60
|
+
]);
|
|
18
61
|
}
|
|
19
62
|
exports.promptVariableVisibilityAsync = promptVariableVisibilityAsync;
|
|
20
63
|
async function promptVariableEnvironmentAsync({ nonInteractive, selectedEnvironments, multiple = false, availableEnvironments, }) {
|
|
@@ -23,7 +66,7 @@ async function promptVariableEnvironmentAsync({ nonInteractive, selectedEnvironm
|
|
|
23
66
|
}
|
|
24
67
|
if (!multiple) {
|
|
25
68
|
return await (0, prompts_1.selectAsync)('Select environment:', (availableEnvironments ?? Object.values(generated_1.EnvironmentVariableEnvironment)).map(environment => ({
|
|
26
|
-
title: environment,
|
|
69
|
+
title: environment.toLocaleLowerCase(),
|
|
27
70
|
value: environment,
|
|
28
71
|
})));
|
|
29
72
|
}
|
|
@@ -32,7 +75,7 @@ async function promptVariableEnvironmentAsync({ nonInteractive, selectedEnvironm
|
|
|
32
75
|
name: 'environments',
|
|
33
76
|
type: 'multiselect',
|
|
34
77
|
choices: Object.values(generated_1.EnvironmentVariableEnvironment).map(environment => ({
|
|
35
|
-
title: environment,
|
|
78
|
+
title: environment.toLocaleLowerCase(),
|
|
36
79
|
value: environment,
|
|
37
80
|
selected: selectedEnvironments?.includes(environment),
|
|
38
81
|
})),
|
|
@@ -40,14 +83,14 @@ async function promptVariableEnvironmentAsync({ nonInteractive, selectedEnvironm
|
|
|
40
83
|
return environments;
|
|
41
84
|
}
|
|
42
85
|
exports.promptVariableEnvironmentAsync = promptVariableEnvironmentAsync;
|
|
43
|
-
async function promptVariableValueAsync({ nonInteractive, required = true, hidden = false, initial, }) {
|
|
86
|
+
async function promptVariableValueAsync({ nonInteractive, required = true, hidden = false, filePath = false, initial, }) {
|
|
44
87
|
if (nonInteractive && required) {
|
|
45
88
|
throw new Error(`Environment variable needs 'value' to be specified when running in non-interactive mode. Run the command with ${chalk_1.default.bold('--value VARIABLE_VALUE')} flag to fix the issue`);
|
|
46
89
|
}
|
|
47
90
|
const { variableValue } = await (0, prompts_1.promptAsync)({
|
|
48
|
-
type: hidden ? 'password' : 'text',
|
|
91
|
+
type: hidden && !filePath ? 'password' : 'text',
|
|
49
92
|
name: 'variableValue',
|
|
50
|
-
message: 'Variable value:',
|
|
93
|
+
message: filePath ? 'File path:' : 'Variable value:',
|
|
51
94
|
initial: initial ?? '',
|
|
52
95
|
validate: variableValue => {
|
|
53
96
|
if (!required) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { EnvironmentVariableEnvironment, EnvironmentVariableFragment } from '../graphql/generated';
|
|
2
|
+
import { EnvironmentVariableWithFileContent } from '../graphql/queries/EnvironmentVariablesQuery';
|
|
2
3
|
export declare function formatVariableName(variable: EnvironmentVariableFragment): string;
|
|
4
|
+
export declare function formatVariableValue(variable: EnvironmentVariableWithFileContent): string;
|
|
3
5
|
export declare function performForEnvironmentsAsync(environments: EnvironmentVariableEnvironment[] | null, fun: (environment: EnvironmentVariableEnvironment | undefined) => Promise<any>): Promise<any[]>;
|
|
4
|
-
export declare function formatVariable(variable:
|
|
6
|
+
export declare function formatVariable(variable: EnvironmentVariableWithFileContent): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatVariable = exports.performForEnvironmentsAsync = exports.formatVariableName = void 0;
|
|
3
|
+
exports.formatVariable = exports.performForEnvironmentsAsync = exports.formatVariableValue = exports.formatVariableName = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const dateformat_1 = tslib_1.__importDefault(require("dateformat"));
|
|
6
6
|
const formatFields_1 = tslib_1.__importDefault(require("./formatFields"));
|
|
@@ -10,9 +10,31 @@ function formatVariableName(variable) {
|
|
|
10
10
|
const scope = variable.scope === generated_1.EnvironmentVariableScope.Project ? 'project' : 'shared';
|
|
11
11
|
const environments = variable.environments?.join(', ') ?? '';
|
|
12
12
|
const updatedAt = variable.updatedAt ? new Date(variable.updatedAt).toLocaleString() : '';
|
|
13
|
-
|
|
13
|
+
const type = variable.type === generated_1.EnvironmentSecretType.FileBase64 ? 'file' : 'string';
|
|
14
|
+
const visibility = variable.visibility;
|
|
15
|
+
return `${name} | ${scope} | ${type} | ${visibility} | ${environments} | Updated at: ${updatedAt}`;
|
|
14
16
|
}
|
|
15
17
|
exports.formatVariableName = formatVariableName;
|
|
18
|
+
function formatVariableValue(variable) {
|
|
19
|
+
// TODO: Add Learn more link
|
|
20
|
+
if (variable.value) {
|
|
21
|
+
return variable.value;
|
|
22
|
+
}
|
|
23
|
+
if (variable.valueWithFileContent) {
|
|
24
|
+
return atob(variable.valueWithFileContent);
|
|
25
|
+
}
|
|
26
|
+
if (variable.visibility === generated_1.EnvironmentVariableVisibility.Sensitive) {
|
|
27
|
+
return '***** (This is a sensitive env variable. To access it, run command with --include-sensitive flag. Learn more.)';
|
|
28
|
+
}
|
|
29
|
+
if (variable.visibility === generated_1.EnvironmentVariableVisibility.Secret) {
|
|
30
|
+
return "***** (This is a secret env variable that can only be accessed on EAS builder and can't be read in any UI. Learn more.)";
|
|
31
|
+
}
|
|
32
|
+
if (variable.type === generated_1.EnvironmentSecretType.FileBase64) {
|
|
33
|
+
return '***** (This is a file env variable. To access it, run command with --include-file-content flag. Learn more.)';
|
|
34
|
+
}
|
|
35
|
+
return '*****';
|
|
36
|
+
}
|
|
37
|
+
exports.formatVariableValue = formatVariableValue;
|
|
16
38
|
async function performForEnvironmentsAsync(environments, fun) {
|
|
17
39
|
const selectedEnvironments = environments ?? [undefined];
|
|
18
40
|
return await Promise.all(selectedEnvironments.map(env => fun(env)));
|
|
@@ -22,8 +44,17 @@ function formatVariable(variable) {
|
|
|
22
44
|
return (0, formatFields_1.default)([
|
|
23
45
|
{ label: 'ID', value: variable.id },
|
|
24
46
|
{ label: 'Name', value: variable.name },
|
|
25
|
-
{ label: 'Value', value: variable
|
|
47
|
+
{ label: 'Value', value: formatVariableValue(variable) },
|
|
26
48
|
{ label: 'Scope', value: variable.scope },
|
|
49
|
+
{ label: 'Visibility', value: variable.visibility ?? '' },
|
|
50
|
+
{
|
|
51
|
+
label: 'Environments',
|
|
52
|
+
value: variable.environments ? variable.environments.join(', ') : '-',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: 'type',
|
|
56
|
+
value: variable.type === generated_1.EnvironmentSecretType.FileBase64 ? 'file' : 'string',
|
|
57
|
+
},
|
|
27
58
|
{ label: 'Created at', value: (0, dateformat_1.default)(variable.createdAt, 'mmm dd HH:MM:ss') },
|
|
28
59
|
{ label: 'Updated at', value: (0, dateformat_1.default)(variable.updatedAt, 'mmm dd HH:MM:ss') },
|
|
29
60
|
]);
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "12.5.
|
|
2
|
+
"version": "12.5.4",
|
|
3
3
|
"commands": {
|
|
4
4
|
"analytics": {
|
|
5
5
|
"id": "analytics",
|
|
@@ -1884,16 +1884,27 @@
|
|
|
1884
1884
|
"description": "Overwrite existing variable",
|
|
1885
1885
|
"allowNo": false
|
|
1886
1886
|
},
|
|
1887
|
+
"type": {
|
|
1888
|
+
"name": "type",
|
|
1889
|
+
"type": "option",
|
|
1890
|
+
"description": "The type of variable",
|
|
1891
|
+
"helpValue": "(string|file)",
|
|
1892
|
+
"multiple": false,
|
|
1893
|
+
"options": [
|
|
1894
|
+
"string",
|
|
1895
|
+
"file"
|
|
1896
|
+
]
|
|
1897
|
+
},
|
|
1887
1898
|
"visibility": {
|
|
1888
1899
|
"name": "visibility",
|
|
1889
1900
|
"type": "option",
|
|
1890
1901
|
"description": "Visibility of the variable",
|
|
1891
|
-
"helpValue": "(
|
|
1902
|
+
"helpValue": "(plaintext|sensitive|encrypted)",
|
|
1892
1903
|
"multiple": false,
|
|
1893
1904
|
"options": [
|
|
1894
|
-
"
|
|
1905
|
+
"plaintext",
|
|
1895
1906
|
"sensitive",
|
|
1896
|
-
"
|
|
1907
|
+
"encrypted"
|
|
1897
1908
|
]
|
|
1898
1909
|
},
|
|
1899
1910
|
"scope": {
|
|
@@ -2162,6 +2173,12 @@
|
|
|
2162
2173
|
"description": "Display sensitive values in the output",
|
|
2163
2174
|
"allowNo": false
|
|
2164
2175
|
},
|
|
2176
|
+
"include-file-content": {
|
|
2177
|
+
"name": "include-file-content",
|
|
2178
|
+
"type": "boolean",
|
|
2179
|
+
"description": "Display files content in the output",
|
|
2180
|
+
"allowNo": false
|
|
2181
|
+
},
|
|
2165
2182
|
"format": {
|
|
2166
2183
|
"name": "format",
|
|
2167
2184
|
"type": "option",
|
|
@@ -2262,7 +2279,7 @@
|
|
|
2262
2279
|
"type": "option",
|
|
2263
2280
|
"description": "Environment variable's environment",
|
|
2264
2281
|
"helpValue": "(development|preview|production)",
|
|
2265
|
-
"multiple":
|
|
2282
|
+
"multiple": true,
|
|
2266
2283
|
"options": [
|
|
2267
2284
|
"development",
|
|
2268
2285
|
"preview",
|
|
@@ -2364,16 +2381,27 @@
|
|
|
2364
2381
|
"description": "New value or the variable",
|
|
2365
2382
|
"multiple": false
|
|
2366
2383
|
},
|
|
2384
|
+
"type": {
|
|
2385
|
+
"name": "type",
|
|
2386
|
+
"type": "option",
|
|
2387
|
+
"description": "The type of variable",
|
|
2388
|
+
"helpValue": "(string|file)",
|
|
2389
|
+
"multiple": false,
|
|
2390
|
+
"options": [
|
|
2391
|
+
"string",
|
|
2392
|
+
"file"
|
|
2393
|
+
]
|
|
2394
|
+
},
|
|
2367
2395
|
"visibility": {
|
|
2368
2396
|
"name": "visibility",
|
|
2369
2397
|
"type": "option",
|
|
2370
2398
|
"description": "Visibility of the variable",
|
|
2371
|
-
"helpValue": "(
|
|
2399
|
+
"helpValue": "(plaintext|sensitive|encrypted)",
|
|
2372
2400
|
"multiple": false,
|
|
2373
2401
|
"options": [
|
|
2374
|
-
"
|
|
2402
|
+
"plaintext",
|
|
2375
2403
|
"sensitive",
|
|
2376
|
-
"
|
|
2404
|
+
"encrypted"
|
|
2377
2405
|
]
|
|
2378
2406
|
},
|
|
2379
2407
|
"scope": {
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eas-cli",
|
|
3
3
|
"description": "EAS command line tool",
|
|
4
|
-
"version": "12.5.
|
|
4
|
+
"version": "12.5.4",
|
|
5
5
|
"author": "Expo <support@expo.dev>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"eas": "./bin/run"
|
|
8
8
|
},
|
|
9
9
|
"bugs": "https://github.com/expo/eas-cli/issues",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@expo/apple-utils": "
|
|
11
|
+
"@expo/apple-utils": "2.0.2",
|
|
12
12
|
"@expo/code-signing-certificates": "0.0.5",
|
|
13
13
|
"@expo/config": "8.5.4",
|
|
14
14
|
"@expo/config-plugins": "7.8.4",
|
|
15
|
-
"@expo/config-types": "50.0.0",
|
|
16
15
|
"@expo/eas-build-job": "1.0.136",
|
|
17
16
|
"@expo/eas-json": "12.5.2",
|
|
18
17
|
"@expo/env": "^0.3.0",
|
|
@@ -228,5 +227,5 @@
|
|
|
228
227
|
"node": "20.11.0",
|
|
229
228
|
"yarn": "1.22.21"
|
|
230
229
|
},
|
|
231
|
-
"gitHead": "
|
|
230
|
+
"gitHead": "d6ec3ae1063cc089194f6bc668745093465364d6"
|
|
232
231
|
}
|