eas-cli 12.5.2 → 12.5.3

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.
@@ -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: EnvironmentVariableFragment): string;
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
- return `${name} | ${scope} | ${environments} | Updated at: ${updatedAt}`;
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.value ?? '(secret)' },
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
  ]);
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "12.5.2",
2
+ "version": "12.5.3",
3
3
  "commands": {
4
4
  "analytics": {
5
5
  "id": "analytics",
@@ -1884,6 +1884,17 @@
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",
@@ -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",
@@ -2364,6 +2381,17 @@
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",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eas-cli",
3
3
  "description": "EAS command line tool",
4
- "version": "12.5.2",
4
+ "version": "12.5.3",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bin": {
7
7
  "eas": "./bin/run"
@@ -228,5 +228,5 @@
228
228
  "node": "20.11.0",
229
229
  "yarn": "1.22.21"
230
230
  },
231
- "gitHead": "6489ddc6adb71c11999f3bb2df848ef1ce2dd136"
231
+ "gitHead": "56444432b91bc60062891526946678da45ed2f2c"
232
232
  }