@salesforce/core 3.4.5 → 3.6.2
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/CHANGELOG.md +28 -2
- package/lib/config/config.js +18 -9
- package/lib/config/configAggregator.d.ts +0 -6
- package/lib/config/configAggregator.js +10 -20
- package/lib/config/envVars.d.ts +81 -0
- package/lib/config/envVars.js +368 -0
- package/lib/crypto/crypto.js +24 -5
- package/lib/exported.d.ts +3 -2
- package/lib/exported.js +6 -1
- package/lib/messages.js +1 -1
- package/lib/org/authRemover.d.ts +2 -1
- package/lib/org/authRemover.js +11 -2
- package/lib/org/orgConfigProperties.js +6 -2
- package/lib/util/cache.d.ts +11 -0
- package/lib/util/cache.js +70 -0
- package/messages/config.md +44 -0
- package/messages/envVars.md +239 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [3.
|
|
5
|
+
### [3.6.2](https://github.com/forcedotcom/sfdx-core/compare/v3.6.1...v3.6.2) (2021-09-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* improve time to build auths for many orgs @W-9914839@ ([#478](https://github.com/forcedotcom/sfdx-core/issues/478)) ([c788541](https://github.com/forcedotcom/sfdx-core/commit/c7885415d59994b28552227f0b84dcee5d3ec7cf))
|
|
11
|
+
|
|
12
|
+
### [3.6.1](https://github.com/forcedotcom/sfdx-core/compare/v3.6.0...v3.6.1) (2021-09-13)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* remove tokens associated with org ([#477](https://github.com/forcedotcom/sfdx-core/issues/477)) ([5034fa2](https://github.com/forcedotcom/sfdx-core/commit/5034fa2d4c52d347c00499e137a71366e4feba7f))
|
|
6
18
|
|
|
19
|
+
## [3.6.0](https://github.com/forcedotcom/sfdx-core/compare/v3.5.0...v3.6.0) (2021-09-10)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* add help section helper ([#474](https://github.com/forcedotcom/sfdx-core/issues/474)) ([b34c2d7](https://github.com/forcedotcom/sfdx-core/commit/b34c2d7a442aed2cf091fd394a7c3656287d1dbf))
|
|
25
|
+
|
|
26
|
+
## [3.5.0](https://github.com/forcedotcom/sfdx-core/compare/v3.4.5...v3.5.0) (2021-09-09)
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
- expose well known env vars as part of core ([#473](https://github.com/forcedotcom/sfdx-core/issues/473)) ([11c3f53](https://github.com/forcedotcom/sfdx-core/commit/11c3f53f964459072826274e6ebb33d4a9ecb990))
|
|
31
|
+
|
|
32
|
+
### [3.4.5](https://github.com/forcedotcom/sfdx-core/compare/v3.4.4...v3.4.5) (2021-09-03)
|
|
7
33
|
|
|
8
34
|
### Bug Fixes
|
|
9
35
|
|
|
10
|
-
|
|
36
|
+
- provide the correct options to SfdxConfig ([fa2117e](https://github.com/forcedotcom/sfdx-core/commit/fa2117e12d7a903f26067bdcf35d7ec9c142101e))
|
|
11
37
|
|
|
12
38
|
### [3.4.4](https://github.com/forcedotcom/sfdx-core/compare/v3.4.3...v3.4.4) (2021-09-03)
|
|
13
39
|
|
package/lib/config/config.js
CHANGED
|
@@ -30,6 +30,15 @@ const messages = messages_1.Messages.load('@salesforce/core', 'config', [
|
|
|
30
30
|
'invalidNumberConfigValue',
|
|
31
31
|
'invalidWrite',
|
|
32
32
|
'unknownConfigKey',
|
|
33
|
+
'defaultUsername',
|
|
34
|
+
'defaultDevHubUsername',
|
|
35
|
+
'isvDebuggerSid',
|
|
36
|
+
'isvDebuggerUrl',
|
|
37
|
+
'apiVersion',
|
|
38
|
+
'disableTelemetry',
|
|
39
|
+
'maxQueryLimit',
|
|
40
|
+
'restDeploy',
|
|
41
|
+
'instanceUrl',
|
|
33
42
|
]);
|
|
34
43
|
const log = logger_1.Logger.childFromRoot('core:config');
|
|
35
44
|
const SFDX_CONFIG_FILE_NAME = 'sfdx-config.json';
|
|
@@ -76,7 +85,7 @@ var SfdxPropertyKeys;
|
|
|
76
85
|
exports.SFDX_ALLOWED_PROPERTIES = [
|
|
77
86
|
{
|
|
78
87
|
key: SfdxPropertyKeys.INSTANCE_URL,
|
|
79
|
-
description:
|
|
88
|
+
description: messages.getMessage(SfdxPropertyKeys.INSTANCE_URL),
|
|
80
89
|
input: {
|
|
81
90
|
// If a value is provided validate it otherwise no value is unset.
|
|
82
91
|
validator: (value) => {
|
|
@@ -93,7 +102,7 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
93
102
|
},
|
|
94
103
|
{
|
|
95
104
|
key: SfdxPropertyKeys.API_VERSION,
|
|
96
|
-
description:
|
|
105
|
+
description: messages.getMessage(SfdxPropertyKeys.API_VERSION),
|
|
97
106
|
hidden: true,
|
|
98
107
|
input: {
|
|
99
108
|
// If a value is provided validate it otherwise no value is unset.
|
|
@@ -105,17 +114,17 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
105
114
|
key: SfdxPropertyKeys.DEFAULT_DEV_HUB_USERNAME,
|
|
106
115
|
newKey: orgConfigProperties_1.OrgConfigProperties.TARGET_DEV_HUB,
|
|
107
116
|
deprecated: true,
|
|
108
|
-
description: '',
|
|
117
|
+
description: messages.getMessage('defaultDevHubUsername'),
|
|
109
118
|
},
|
|
110
119
|
{
|
|
111
120
|
key: SfdxPropertyKeys.DEFAULT_USERNAME,
|
|
112
121
|
newKey: orgConfigProperties_1.OrgConfigProperties.TARGET_ORG,
|
|
113
122
|
deprecated: true,
|
|
114
|
-
description: '',
|
|
123
|
+
description: messages.getMessage('defaultUsername'),
|
|
115
124
|
},
|
|
116
125
|
{
|
|
117
126
|
key: SfdxPropertyKeys.ISV_DEBUGGER_SID,
|
|
118
|
-
description:
|
|
127
|
+
description: messages.getMessage(SfdxPropertyKeys.ISV_DEBUGGER_SID),
|
|
119
128
|
encrypted: true,
|
|
120
129
|
input: {
|
|
121
130
|
// If a value is provided validate it otherwise no value is unset.
|
|
@@ -125,7 +134,7 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
125
134
|
},
|
|
126
135
|
{
|
|
127
136
|
key: SfdxPropertyKeys.ISV_DEBUGGER_URL,
|
|
128
|
-
description:
|
|
137
|
+
description: messages.getMessage(SfdxPropertyKeys.ISV_DEBUGGER_URL),
|
|
129
138
|
input: {
|
|
130
139
|
// If a value is provided validate it otherwise no value is unset.
|
|
131
140
|
validator: (value) => value == null || ts_types_1.isString(value),
|
|
@@ -134,7 +143,7 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
134
143
|
},
|
|
135
144
|
{
|
|
136
145
|
key: SfdxPropertyKeys.DISABLE_TELEMETRY,
|
|
137
|
-
description:
|
|
146
|
+
description: messages.getMessage(SfdxPropertyKeys.DISABLE_TELEMETRY),
|
|
138
147
|
input: {
|
|
139
148
|
validator: (value) => value == null || ['true', 'false'].includes(value.toString()),
|
|
140
149
|
failedMessage: messages.getMessage('invalidBooleanConfigValue'),
|
|
@@ -143,7 +152,7 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
143
152
|
// This should be brought in by a plugin, but there isn't a way to do that right now.
|
|
144
153
|
{
|
|
145
154
|
key: SfdxPropertyKeys.REST_DEPLOY,
|
|
146
|
-
description:
|
|
155
|
+
description: messages.getMessage(SfdxPropertyKeys.REST_DEPLOY),
|
|
147
156
|
hidden: true,
|
|
148
157
|
input: {
|
|
149
158
|
validator: (value) => value != null && ['true', 'false'].includes(value.toString()),
|
|
@@ -152,7 +161,7 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
152
161
|
},
|
|
153
162
|
{
|
|
154
163
|
key: SfdxPropertyKeys.MAX_QUERY_LIMIT,
|
|
155
|
-
description:
|
|
164
|
+
description: messages.getMessage(SfdxPropertyKeys.MAX_QUERY_LIMIT),
|
|
156
165
|
input: {
|
|
157
166
|
// the bit shift will remove the negative bit, and any decimal numbers
|
|
158
167
|
// then the parseFloat will handle converting it to a number from a string
|
|
@@ -189,12 +189,6 @@ export declare class ConfigAggregator extends AsyncOptionalCreatable<JsonMap> {
|
|
|
189
189
|
* @param properties The properties to set.
|
|
190
190
|
*/
|
|
191
191
|
private setAllowedProperties;
|
|
192
|
-
/**
|
|
193
|
-
* Sets the env variables.
|
|
194
|
-
*
|
|
195
|
-
* @param envVars The env variables to set.
|
|
196
|
-
*/
|
|
197
|
-
private setEnvVars;
|
|
198
192
|
}
|
|
199
193
|
export declare namespace ConfigAggregator {
|
|
200
194
|
/**
|
|
@@ -9,11 +9,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.ConfigAggregator = void 0;
|
|
10
10
|
const kit_1 = require("@salesforce/kit");
|
|
11
11
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
12
|
+
const change_case_1 = require("change-case");
|
|
12
13
|
const messages_1 = require("../messages");
|
|
14
|
+
const envVars_1 = require("./envVars");
|
|
13
15
|
const config_1 = require("./config");
|
|
14
16
|
messages_1.Messages.importMessagesDirectory(__dirname);
|
|
15
17
|
const messages = messages_1.Messages.load('@salesforce/core', 'config', ['unknownConfigKey', 'deprecatedConfigKey']);
|
|
16
|
-
const propertyToEnvName = (property) =>
|
|
18
|
+
const propertyToEnvName = (property, prefix = 'SFDX_') => `${prefix || ''}${change_case_1.snakeCase(property).toUpperCase()}`;
|
|
17
19
|
/**
|
|
18
20
|
* Aggregate global and local project config files, as well as environment variables for
|
|
19
21
|
* `sfdx-config.json`. The resolution happens in the following bottom-up order:
|
|
@@ -186,7 +188,7 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
|
|
|
186
188
|
* @param key The key of the property.
|
|
187
189
|
*/
|
|
188
190
|
getPath(key) {
|
|
189
|
-
if (this.envVars
|
|
191
|
+
if (this.envVars.getString(key) != null) {
|
|
190
192
|
return `$${propertyToEnvName(key)}`;
|
|
191
193
|
}
|
|
192
194
|
if (this.localConfig && this.localConfig.getContents()[key] != null) {
|
|
@@ -236,7 +238,7 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
|
|
|
236
238
|
* Get the config properties that are environment variables.
|
|
237
239
|
*/
|
|
238
240
|
getEnvVars() {
|
|
239
|
-
return
|
|
241
|
+
return this.envVars.asMap();
|
|
240
242
|
}
|
|
241
243
|
/**
|
|
242
244
|
* Re-read all property configurations from disk.
|
|
@@ -270,14 +272,10 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
|
|
|
270
272
|
this.resolveProperties(this.globalConfig.readSync(), this.localConfig && this.localConfig.readSync());
|
|
271
273
|
}
|
|
272
274
|
resolveProperties(globalConfig, localConfig) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
obj[property.key] = val;
|
|
278
|
-
}
|
|
279
|
-
return obj;
|
|
280
|
-
}, accumulator));
|
|
275
|
+
this.envVars = new envVars_1.EnvVars();
|
|
276
|
+
for (const property of this.getAllowedProperties()) {
|
|
277
|
+
this.envVars.setPropertyFromEnv(property.key);
|
|
278
|
+
}
|
|
281
279
|
// Global config must be read first so it is on the left hand of the
|
|
282
280
|
// object assign and is overwritten by the local config.
|
|
283
281
|
const configs = [globalConfig];
|
|
@@ -285,7 +283,7 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
|
|
|
285
283
|
if (localConfig) {
|
|
286
284
|
configs.push(localConfig);
|
|
287
285
|
}
|
|
288
|
-
configs.push(this.envVars);
|
|
286
|
+
configs.push(this.envVars.asDictionary());
|
|
289
287
|
const json = {};
|
|
290
288
|
const reduced = configs.filter(ts_types_1.isJsonMap).reduce((acc, el) => kit_1.merge(acc, el), json);
|
|
291
289
|
return reduced;
|
|
@@ -304,14 +302,6 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
|
|
|
304
302
|
setAllowedProperties(properties) {
|
|
305
303
|
this.allowedProperties = properties;
|
|
306
304
|
}
|
|
307
|
-
/**
|
|
308
|
-
* Sets the env variables.
|
|
309
|
-
*
|
|
310
|
-
* @param envVars The env variables to set.
|
|
311
|
-
*/
|
|
312
|
-
setEnvVars(envVars) {
|
|
313
|
-
this.envVars = envVars;
|
|
314
|
-
}
|
|
315
305
|
}
|
|
316
306
|
exports.ConfigAggregator = ConfigAggregator;
|
|
317
307
|
ConfigAggregator.encrypted = true;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Dictionary, Nullable } from '@salesforce/ts-types';
|
|
2
|
+
import { Env } from '@salesforce/kit';
|
|
3
|
+
export declare enum EnvironmentVariable {
|
|
4
|
+
'FORCE_OPEN_URL' = "FORCE_OPEN_URL",
|
|
5
|
+
'FORCE_SHOW_SPINNER' = "FORCE_SHOW_SPINNER",
|
|
6
|
+
'FORCE_SPINNER_DELAY' = "FORCE_SPINNER_DELAY",
|
|
7
|
+
'HTTP_PROXY' = "HTTP_PROXY",
|
|
8
|
+
'HTTPS_PROXY' = "HTTPS_PROXY",
|
|
9
|
+
'NODE_EXTRA_CA_CERTS' = "NODE_EXTRA_CA_CERTS",
|
|
10
|
+
'NODE_TLS_REJECT_UNAUTHORIZED' = "NODE_TLS_REJECT_UNAUTHORIZED",
|
|
11
|
+
'SFDX_ACCESS_TOKEN' = "SFDX_ACCESS_TOKEN",
|
|
12
|
+
'SFDX_API_VERSION' = "SFDX_API_VERSION",
|
|
13
|
+
'SFDX_AUDIENCE_URL' = "SFDX_AUDIENCE_URL",
|
|
14
|
+
'SFDX_CODE_COVERAGE_REQUIREMENT' = "SFDX_CODE_COVERAGE_REQUIREMENT",
|
|
15
|
+
'SFDX_CONTENT_TYPE' = "SFDX_CONTENT_TYPE",
|
|
16
|
+
'SFDX_DEFAULTDEVHUBUSERNAME' = "SFDX_DEFAULTDEVHUBUSERNAME",
|
|
17
|
+
'SFDX_DEFAULTUSERNAME' = "SFDX_DEFAULTUSERNAME",
|
|
18
|
+
'SFDX_DISABLE_AUTOUPDATE' = "SFDX_DISABLE_AUTOUPDATE",
|
|
19
|
+
'SFDX_AUTOUPDATE_DISABLE' = "SFDX_AUTOUPDATE_DISABLE",
|
|
20
|
+
'SFDX_DISABLE_SOURCE_MEMBER_POLLING' = "SFDX_DISABLE_SOURCE_MEMBER_POLLING",
|
|
21
|
+
'SFDX_DISABLE_TELEMETRY' = "SFDX_DISABLE_TELEMETRY",
|
|
22
|
+
'SFDX_DNS_TIMEOUT' = "SFDX_DNS_TIMEOUT",
|
|
23
|
+
'SFDX_DOMAIN_RETRY' = "SFDX_DOMAIN_RETRY",
|
|
24
|
+
'SFDX_IMPROVED_CODE_COVERAGE' = "SFDX_IMPROVED_CODE_COVERAGE",
|
|
25
|
+
'SFDX_INSTANCE_URL' = "SFDX_INSTANCE_URL",
|
|
26
|
+
'SFDX_JSON_TO_STDOUT' = "SFDX_JSON_TO_STDOUT",
|
|
27
|
+
'SFDX_LOG_LEVEL' = "SFDX_LOG_LEVEL",
|
|
28
|
+
'SFDX_MAX_QUERY_LIMIT' = "SFDX_MAX_QUERY_LIMIT",
|
|
29
|
+
'SFDX_MDAPI_TEMP_DIR' = "SFDX_MDAPI_TEMP_DIR",
|
|
30
|
+
'SFDX_NPM_REGISTRY' = "SFDX_NPM_REGISTRY",
|
|
31
|
+
'SFDX_PRECOMPILE_ENABLE' = "SFDX_PRECOMPILE_ENABLE",
|
|
32
|
+
'SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE' = "SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE",
|
|
33
|
+
'SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE' = "SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE",
|
|
34
|
+
'SFDX_REST_DEPLOY' = "SFDX_REST_DEPLOY",
|
|
35
|
+
'SFDX_SOURCE_MEMBER_POLLING_TIMEOUT' = "SFDX_SOURCE_MEMBER_POLLING_TIMEOUT",
|
|
36
|
+
'SFDX_USE_GENERIC_UNIX_KEYCHAIN' = "SFDX_USE_GENERIC_UNIX_KEYCHAIN",
|
|
37
|
+
'SFDX_USE_PROGRESS_BAR' = "SFDX_USE_PROGRESS_BAR",
|
|
38
|
+
'SF_TARGET_ORG' = "SF_TARGET_ORG",
|
|
39
|
+
'SF_TARGET_DEV_HUB' = "SF_TARGET_DEV_HUB",
|
|
40
|
+
'SF_ACCESS_TOKEN' = "SF_ACCESS_TOKEN",
|
|
41
|
+
'SF_API_VERSION' = "SF_API_VERSION",
|
|
42
|
+
'SF_AUDIENCE_URL' = "SF_AUDIENCE_URL",
|
|
43
|
+
'SF_CODE_COVERAGE_REQUIREMENT' = "SF_CODE_COVERAGE_REQUIREMENT",
|
|
44
|
+
'SF_CONTENT_TYPE' = "SF_CONTENT_TYPE",
|
|
45
|
+
'SF_DISABLE_AUTOUPDATE' = "SF_DISABLE_AUTOUPDATE",
|
|
46
|
+
'SF_AUTOUPDATE_DISABLE' = "SF_AUTOUPDATE_DISABLE",
|
|
47
|
+
'SF_DISABLE_SOURCE_MEMBER_POLLING' = "SF_DISABLE_SOURCE_MEMBER_POLLING",
|
|
48
|
+
'SF_DISABLE_TELEMETRY' = "SF_DISABLE_TELEMETRY",
|
|
49
|
+
'SF_DNS_TIMEOUT' = "SF_DNS_TIMEOUT",
|
|
50
|
+
'SF_DOMAIN_RETRY' = "SF_DOMAIN_RETRY",
|
|
51
|
+
'SF_IMPROVED_CODE_COVERAGE' = "SF_IMPROVED_CODE_COVERAGE",
|
|
52
|
+
'SF_INSTANCE_URL' = "SF_INSTANCE_URL",
|
|
53
|
+
'SF_JSON_TO_STDOUT' = "SF_JSON_TO_STDOUT",
|
|
54
|
+
'SF_LOG_LEVEL' = "SF_LOG_LEVEL",
|
|
55
|
+
'SF_MAX_QUERY_LIMIT' = "SF_MAX_QUERY_LIMIT",
|
|
56
|
+
'SF_MDAPI_TEMP_DIR' = "SF_MDAPI_TEMP_DIR",
|
|
57
|
+
'SF_NPM_REGISTRY' = "SF_NPM_REGISTRY",
|
|
58
|
+
'SF_PRECOMPILE_ENABLE' = "SF_PRECOMPILE_ENABLE",
|
|
59
|
+
'SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE' = "SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE",
|
|
60
|
+
'SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE' = "SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE",
|
|
61
|
+
'SF_SOURCE_MEMBER_POLLING_TIMEOUT' = "SF_SOURCE_MEMBER_POLLING_TIMEOUT",
|
|
62
|
+
'SF_USE_GENERIC_UNIX_KEYCHAIN' = "SF_USE_GENERIC_UNIX_KEYCHAIN",
|
|
63
|
+
'SF_USE_PROGRESS_BAR' = "SF_USE_PROGRESS_BAR"
|
|
64
|
+
}
|
|
65
|
+
declare type EnvMetaData = {
|
|
66
|
+
description: string;
|
|
67
|
+
synonymOf: Nullable<string>;
|
|
68
|
+
};
|
|
69
|
+
declare type EnvType = {
|
|
70
|
+
[key in EnvironmentVariable]: EnvMetaData;
|
|
71
|
+
};
|
|
72
|
+
export declare const SUPPORTED_ENV_VARS: EnvType;
|
|
73
|
+
export declare class EnvVars extends Env {
|
|
74
|
+
constructor();
|
|
75
|
+
propertyToEnvName(property: string, prefix?: string): string;
|
|
76
|
+
setPropertyFromEnv(property: string, prefix?: string): void;
|
|
77
|
+
asDictionary(): Dictionary<string>;
|
|
78
|
+
asMap(): Map<string, string>;
|
|
79
|
+
private resolve;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnvVars = exports.SUPPORTED_ENV_VARS = exports.EnvironmentVariable = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const change_case_1 = require("change-case");
|
|
12
|
+
const kit_1 = require("@salesforce/kit");
|
|
13
|
+
const messages_1 = require("../messages");
|
|
14
|
+
const global_1 = require("../global");
|
|
15
|
+
messages_1.Messages.importMessagesDirectory(path_1.join(__dirname));
|
|
16
|
+
const messages = messages_1.Messages.loadMessages('@salesforce/core', 'envVars');
|
|
17
|
+
var EnvironmentVariable;
|
|
18
|
+
(function (EnvironmentVariable) {
|
|
19
|
+
EnvironmentVariable["FORCE_OPEN_URL"] = "FORCE_OPEN_URL";
|
|
20
|
+
EnvironmentVariable["FORCE_SHOW_SPINNER"] = "FORCE_SHOW_SPINNER";
|
|
21
|
+
EnvironmentVariable["FORCE_SPINNER_DELAY"] = "FORCE_SPINNER_DELAY";
|
|
22
|
+
EnvironmentVariable["HTTP_PROXY"] = "HTTP_PROXY";
|
|
23
|
+
EnvironmentVariable["HTTPS_PROXY"] = "HTTPS_PROXY";
|
|
24
|
+
EnvironmentVariable["NODE_EXTRA_CA_CERTS"] = "NODE_EXTRA_CA_CERTS";
|
|
25
|
+
EnvironmentVariable["NODE_TLS_REJECT_UNAUTHORIZED"] = "NODE_TLS_REJECT_UNAUTHORIZED";
|
|
26
|
+
EnvironmentVariable["SFDX_ACCESS_TOKEN"] = "SFDX_ACCESS_TOKEN";
|
|
27
|
+
EnvironmentVariable["SFDX_API_VERSION"] = "SFDX_API_VERSION";
|
|
28
|
+
EnvironmentVariable["SFDX_AUDIENCE_URL"] = "SFDX_AUDIENCE_URL";
|
|
29
|
+
EnvironmentVariable["SFDX_CODE_COVERAGE_REQUIREMENT"] = "SFDX_CODE_COVERAGE_REQUIREMENT";
|
|
30
|
+
EnvironmentVariable["SFDX_CONTENT_TYPE"] = "SFDX_CONTENT_TYPE";
|
|
31
|
+
EnvironmentVariable["SFDX_DEFAULTDEVHUBUSERNAME"] = "SFDX_DEFAULTDEVHUBUSERNAME";
|
|
32
|
+
EnvironmentVariable["SFDX_DEFAULTUSERNAME"] = "SFDX_DEFAULTUSERNAME";
|
|
33
|
+
EnvironmentVariable["SFDX_DISABLE_AUTOUPDATE"] = "SFDX_DISABLE_AUTOUPDATE";
|
|
34
|
+
EnvironmentVariable["SFDX_AUTOUPDATE_DISABLE"] = "SFDX_AUTOUPDATE_DISABLE";
|
|
35
|
+
EnvironmentVariable["SFDX_DISABLE_SOURCE_MEMBER_POLLING"] = "SFDX_DISABLE_SOURCE_MEMBER_POLLING";
|
|
36
|
+
EnvironmentVariable["SFDX_DISABLE_TELEMETRY"] = "SFDX_DISABLE_TELEMETRY";
|
|
37
|
+
EnvironmentVariable["SFDX_DNS_TIMEOUT"] = "SFDX_DNS_TIMEOUT";
|
|
38
|
+
EnvironmentVariable["SFDX_DOMAIN_RETRY"] = "SFDX_DOMAIN_RETRY";
|
|
39
|
+
EnvironmentVariable["SFDX_IMPROVED_CODE_COVERAGE"] = "SFDX_IMPROVED_CODE_COVERAGE";
|
|
40
|
+
EnvironmentVariable["SFDX_INSTANCE_URL"] = "SFDX_INSTANCE_URL";
|
|
41
|
+
EnvironmentVariable["SFDX_JSON_TO_STDOUT"] = "SFDX_JSON_TO_STDOUT";
|
|
42
|
+
EnvironmentVariable["SFDX_LOG_LEVEL"] = "SFDX_LOG_LEVEL";
|
|
43
|
+
EnvironmentVariable["SFDX_MAX_QUERY_LIMIT"] = "SFDX_MAX_QUERY_LIMIT";
|
|
44
|
+
EnvironmentVariable["SFDX_MDAPI_TEMP_DIR"] = "SFDX_MDAPI_TEMP_DIR";
|
|
45
|
+
EnvironmentVariable["SFDX_NPM_REGISTRY"] = "SFDX_NPM_REGISTRY";
|
|
46
|
+
EnvironmentVariable["SFDX_PRECOMPILE_ENABLE"] = "SFDX_PRECOMPILE_ENABLE";
|
|
47
|
+
EnvironmentVariable["SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE"] = "SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE";
|
|
48
|
+
EnvironmentVariable["SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE"] = "SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE";
|
|
49
|
+
EnvironmentVariable["SFDX_REST_DEPLOY"] = "SFDX_REST_DEPLOY";
|
|
50
|
+
EnvironmentVariable["SFDX_SOURCE_MEMBER_POLLING_TIMEOUT"] = "SFDX_SOURCE_MEMBER_POLLING_TIMEOUT";
|
|
51
|
+
EnvironmentVariable["SFDX_USE_GENERIC_UNIX_KEYCHAIN"] = "SFDX_USE_GENERIC_UNIX_KEYCHAIN";
|
|
52
|
+
EnvironmentVariable["SFDX_USE_PROGRESS_BAR"] = "SFDX_USE_PROGRESS_BAR";
|
|
53
|
+
EnvironmentVariable["SF_TARGET_ORG"] = "SF_TARGET_ORG";
|
|
54
|
+
EnvironmentVariable["SF_TARGET_DEV_HUB"] = "SF_TARGET_DEV_HUB";
|
|
55
|
+
EnvironmentVariable["SF_ACCESS_TOKEN"] = "SF_ACCESS_TOKEN";
|
|
56
|
+
EnvironmentVariable["SF_API_VERSION"] = "SF_API_VERSION";
|
|
57
|
+
EnvironmentVariable["SF_AUDIENCE_URL"] = "SF_AUDIENCE_URL";
|
|
58
|
+
EnvironmentVariable["SF_CODE_COVERAGE_REQUIREMENT"] = "SF_CODE_COVERAGE_REQUIREMENT";
|
|
59
|
+
EnvironmentVariable["SF_CONTENT_TYPE"] = "SF_CONTENT_TYPE";
|
|
60
|
+
EnvironmentVariable["SF_DISABLE_AUTOUPDATE"] = "SF_DISABLE_AUTOUPDATE";
|
|
61
|
+
EnvironmentVariable["SF_AUTOUPDATE_DISABLE"] = "SF_AUTOUPDATE_DISABLE";
|
|
62
|
+
EnvironmentVariable["SF_DISABLE_SOURCE_MEMBER_POLLING"] = "SF_DISABLE_SOURCE_MEMBER_POLLING";
|
|
63
|
+
EnvironmentVariable["SF_DISABLE_TELEMETRY"] = "SF_DISABLE_TELEMETRY";
|
|
64
|
+
EnvironmentVariable["SF_DNS_TIMEOUT"] = "SF_DNS_TIMEOUT";
|
|
65
|
+
EnvironmentVariable["SF_DOMAIN_RETRY"] = "SF_DOMAIN_RETRY";
|
|
66
|
+
EnvironmentVariable["SF_IMPROVED_CODE_COVERAGE"] = "SF_IMPROVED_CODE_COVERAGE";
|
|
67
|
+
EnvironmentVariable["SF_INSTANCE_URL"] = "SF_INSTANCE_URL";
|
|
68
|
+
EnvironmentVariable["SF_JSON_TO_STDOUT"] = "SF_JSON_TO_STDOUT";
|
|
69
|
+
EnvironmentVariable["SF_LOG_LEVEL"] = "SF_LOG_LEVEL";
|
|
70
|
+
EnvironmentVariable["SF_MAX_QUERY_LIMIT"] = "SF_MAX_QUERY_LIMIT";
|
|
71
|
+
EnvironmentVariable["SF_MDAPI_TEMP_DIR"] = "SF_MDAPI_TEMP_DIR";
|
|
72
|
+
EnvironmentVariable["SF_NPM_REGISTRY"] = "SF_NPM_REGISTRY";
|
|
73
|
+
EnvironmentVariable["SF_PRECOMPILE_ENABLE"] = "SF_PRECOMPILE_ENABLE";
|
|
74
|
+
EnvironmentVariable["SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE"] = "SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE";
|
|
75
|
+
EnvironmentVariable["SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE"] = "SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE";
|
|
76
|
+
EnvironmentVariable["SF_SOURCE_MEMBER_POLLING_TIMEOUT"] = "SF_SOURCE_MEMBER_POLLING_TIMEOUT";
|
|
77
|
+
EnvironmentVariable["SF_USE_GENERIC_UNIX_KEYCHAIN"] = "SF_USE_GENERIC_UNIX_KEYCHAIN";
|
|
78
|
+
EnvironmentVariable["SF_USE_PROGRESS_BAR"] = "SF_USE_PROGRESS_BAR";
|
|
79
|
+
})(EnvironmentVariable = exports.EnvironmentVariable || (exports.EnvironmentVariable = {}));
|
|
80
|
+
const getMessage = (environmentVariable) => messages.getMessage(change_case_1.camelCase(environmentVariable));
|
|
81
|
+
exports.SUPPORTED_ENV_VARS = {
|
|
82
|
+
[EnvironmentVariable.FORCE_SHOW_SPINNER]: {
|
|
83
|
+
description: getMessage(EnvironmentVariable.FORCE_SHOW_SPINNER),
|
|
84
|
+
synonymOf: null,
|
|
85
|
+
},
|
|
86
|
+
[EnvironmentVariable.FORCE_SPINNER_DELAY]: {
|
|
87
|
+
description: getMessage(EnvironmentVariable.FORCE_SPINNER_DELAY),
|
|
88
|
+
synonymOf: null,
|
|
89
|
+
},
|
|
90
|
+
[EnvironmentVariable.FORCE_OPEN_URL]: {
|
|
91
|
+
description: getMessage(EnvironmentVariable.FORCE_OPEN_URL),
|
|
92
|
+
synonymOf: null,
|
|
93
|
+
},
|
|
94
|
+
[EnvironmentVariable.HTTP_PROXY]: {
|
|
95
|
+
description: getMessage(EnvironmentVariable.HTTP_PROXY),
|
|
96
|
+
synonymOf: null,
|
|
97
|
+
},
|
|
98
|
+
[EnvironmentVariable.HTTPS_PROXY]: {
|
|
99
|
+
description: getMessage(EnvironmentVariable.HTTPS_PROXY),
|
|
100
|
+
synonymOf: null,
|
|
101
|
+
},
|
|
102
|
+
[EnvironmentVariable.NODE_EXTRA_CA_CERTS]: {
|
|
103
|
+
description: getMessage(EnvironmentVariable.NODE_EXTRA_CA_CERTS),
|
|
104
|
+
synonymOf: null,
|
|
105
|
+
},
|
|
106
|
+
[EnvironmentVariable.NODE_TLS_REJECT_UNAUTHORIZED]: {
|
|
107
|
+
description: getMessage(EnvironmentVariable.NODE_TLS_REJECT_UNAUTHORIZED),
|
|
108
|
+
synonymOf: null,
|
|
109
|
+
},
|
|
110
|
+
// sfdx vars
|
|
111
|
+
[EnvironmentVariable.SFDX_ACCESS_TOKEN]: {
|
|
112
|
+
description: getMessage(EnvironmentVariable.SFDX_ACCESS_TOKEN),
|
|
113
|
+
synonymOf: EnvironmentVariable.SF_ACCESS_TOKEN,
|
|
114
|
+
},
|
|
115
|
+
[EnvironmentVariable.SFDX_API_VERSION]: {
|
|
116
|
+
description: getMessage(EnvironmentVariable.SFDX_API_VERSION),
|
|
117
|
+
synonymOf: EnvironmentVariable.SF_API_VERSION,
|
|
118
|
+
},
|
|
119
|
+
[EnvironmentVariable.SFDX_AUDIENCE_URL]: {
|
|
120
|
+
description: getMessage(EnvironmentVariable.SFDX_AUDIENCE_URL),
|
|
121
|
+
synonymOf: EnvironmentVariable.SF_AUDIENCE_URL,
|
|
122
|
+
},
|
|
123
|
+
[EnvironmentVariable.SFDX_CODE_COVERAGE_REQUIREMENT]: {
|
|
124
|
+
description: getMessage(EnvironmentVariable.SFDX_CODE_COVERAGE_REQUIREMENT),
|
|
125
|
+
synonymOf: EnvironmentVariable.SF_CODE_COVERAGE_REQUIREMENT,
|
|
126
|
+
},
|
|
127
|
+
[EnvironmentVariable.SFDX_CONTENT_TYPE]: {
|
|
128
|
+
description: getMessage(EnvironmentVariable.SFDX_CONTENT_TYPE),
|
|
129
|
+
synonymOf: EnvironmentVariable.SF_CONTENT_TYPE,
|
|
130
|
+
},
|
|
131
|
+
[EnvironmentVariable.SFDX_DEFAULTDEVHUBUSERNAME]: {
|
|
132
|
+
description: getMessage(EnvironmentVariable.SFDX_DEFAULTDEVHUBUSERNAME),
|
|
133
|
+
synonymOf: EnvironmentVariable.SF_TARGET_DEV_HUB,
|
|
134
|
+
},
|
|
135
|
+
[EnvironmentVariable.SFDX_DEFAULTUSERNAME]: {
|
|
136
|
+
description: getMessage(EnvironmentVariable.SFDX_DEFAULTUSERNAME),
|
|
137
|
+
synonymOf: EnvironmentVariable.SF_TARGET_ORG,
|
|
138
|
+
},
|
|
139
|
+
[EnvironmentVariable.SFDX_DISABLE_AUTOUPDATE]: {
|
|
140
|
+
description: getMessage(EnvironmentVariable.SFDX_DISABLE_AUTOUPDATE),
|
|
141
|
+
synonymOf: EnvironmentVariable.SF_DISABLE_AUTOUPDATE,
|
|
142
|
+
},
|
|
143
|
+
[EnvironmentVariable.SFDX_AUTOUPDATE_DISABLE]: {
|
|
144
|
+
description: getMessage(EnvironmentVariable.SFDX_AUTOUPDATE_DISABLE),
|
|
145
|
+
synonymOf: EnvironmentVariable.SF_AUTOUPDATE_DISABLE,
|
|
146
|
+
},
|
|
147
|
+
[EnvironmentVariable.SFDX_DISABLE_SOURCE_MEMBER_POLLING]: {
|
|
148
|
+
description: getMessage(EnvironmentVariable.SFDX_DISABLE_SOURCE_MEMBER_POLLING),
|
|
149
|
+
synonymOf: EnvironmentVariable.SF_DISABLE_SOURCE_MEMBER_POLLING,
|
|
150
|
+
},
|
|
151
|
+
[EnvironmentVariable.SFDX_DISABLE_TELEMETRY]: {
|
|
152
|
+
description: getMessage(EnvironmentVariable.SFDX_DISABLE_TELEMETRY),
|
|
153
|
+
synonymOf: EnvironmentVariable.SF_DISABLE_TELEMETRY,
|
|
154
|
+
},
|
|
155
|
+
[EnvironmentVariable.SFDX_DNS_TIMEOUT]: {
|
|
156
|
+
description: getMessage(EnvironmentVariable.SFDX_DNS_TIMEOUT),
|
|
157
|
+
synonymOf: EnvironmentVariable.SF_DNS_TIMEOUT,
|
|
158
|
+
},
|
|
159
|
+
[EnvironmentVariable.SFDX_DOMAIN_RETRY]: {
|
|
160
|
+
description: getMessage(EnvironmentVariable.SFDX_DOMAIN_RETRY),
|
|
161
|
+
synonymOf: EnvironmentVariable.SF_DOMAIN_RETRY,
|
|
162
|
+
},
|
|
163
|
+
[EnvironmentVariable.SFDX_IMPROVED_CODE_COVERAGE]: {
|
|
164
|
+
description: getMessage(EnvironmentVariable.SFDX_IMPROVED_CODE_COVERAGE),
|
|
165
|
+
synonymOf: EnvironmentVariable.SF_IMPROVED_CODE_COVERAGE,
|
|
166
|
+
},
|
|
167
|
+
[EnvironmentVariable.SFDX_INSTANCE_URL]: {
|
|
168
|
+
description: getMessage(EnvironmentVariable.SFDX_INSTANCE_URL),
|
|
169
|
+
synonymOf: EnvironmentVariable.SF_INSTANCE_URL,
|
|
170
|
+
},
|
|
171
|
+
[EnvironmentVariable.SFDX_JSON_TO_STDOUT]: {
|
|
172
|
+
description: getMessage(EnvironmentVariable.SFDX_JSON_TO_STDOUT),
|
|
173
|
+
synonymOf: EnvironmentVariable.SF_JSON_TO_STDOUT,
|
|
174
|
+
},
|
|
175
|
+
[EnvironmentVariable.SFDX_LOG_LEVEL]: {
|
|
176
|
+
description: getMessage(EnvironmentVariable.SFDX_LOG_LEVEL),
|
|
177
|
+
synonymOf: EnvironmentVariable.SF_LOG_LEVEL,
|
|
178
|
+
},
|
|
179
|
+
[EnvironmentVariable.SFDX_MAX_QUERY_LIMIT]: {
|
|
180
|
+
description: getMessage(EnvironmentVariable.SFDX_MAX_QUERY_LIMIT),
|
|
181
|
+
synonymOf: EnvironmentVariable.SF_MAX_QUERY_LIMIT,
|
|
182
|
+
},
|
|
183
|
+
[EnvironmentVariable.SFDX_MDAPI_TEMP_DIR]: {
|
|
184
|
+
description: getMessage(EnvironmentVariable.SFDX_MDAPI_TEMP_DIR),
|
|
185
|
+
synonymOf: EnvironmentVariable.SF_MDAPI_TEMP_DIR,
|
|
186
|
+
},
|
|
187
|
+
[EnvironmentVariable.SFDX_NPM_REGISTRY]: {
|
|
188
|
+
description: getMessage(EnvironmentVariable.SFDX_NPM_REGISTRY),
|
|
189
|
+
synonymOf: EnvironmentVariable.SF_NPM_REGISTRY,
|
|
190
|
+
},
|
|
191
|
+
[EnvironmentVariable.SFDX_PRECOMPILE_ENABLE]: {
|
|
192
|
+
description: getMessage(EnvironmentVariable.SFDX_PRECOMPILE_ENABLE),
|
|
193
|
+
synonymOf: EnvironmentVariable.SF_PRECOMPILE_ENABLE,
|
|
194
|
+
},
|
|
195
|
+
[EnvironmentVariable.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE]: {
|
|
196
|
+
description: getMessage(EnvironmentVariable.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE),
|
|
197
|
+
synonymOf: EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE,
|
|
198
|
+
},
|
|
199
|
+
[EnvironmentVariable.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE]: {
|
|
200
|
+
description: messages.getMessage(change_case_1.camelCase(EnvironmentVariable.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE)),
|
|
201
|
+
synonymOf: EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE,
|
|
202
|
+
},
|
|
203
|
+
[EnvironmentVariable.SFDX_REST_DEPLOY]: {
|
|
204
|
+
description: getMessage(EnvironmentVariable.SFDX_REST_DEPLOY),
|
|
205
|
+
synonymOf: null,
|
|
206
|
+
},
|
|
207
|
+
[EnvironmentVariable.SFDX_SOURCE_MEMBER_POLLING_TIMEOUT]: {
|
|
208
|
+
description: getMessage(EnvironmentVariable.SFDX_SOURCE_MEMBER_POLLING_TIMEOUT),
|
|
209
|
+
synonymOf: EnvironmentVariable.SF_SOURCE_MEMBER_POLLING_TIMEOUT,
|
|
210
|
+
},
|
|
211
|
+
[EnvironmentVariable.SFDX_USE_GENERIC_UNIX_KEYCHAIN]: {
|
|
212
|
+
description: getMessage(EnvironmentVariable.SFDX_USE_GENERIC_UNIX_KEYCHAIN),
|
|
213
|
+
synonymOf: EnvironmentVariable.SF_USE_GENERIC_UNIX_KEYCHAIN,
|
|
214
|
+
},
|
|
215
|
+
[EnvironmentVariable.SFDX_USE_PROGRESS_BAR]: {
|
|
216
|
+
description: getMessage(EnvironmentVariable.SFDX_USE_PROGRESS_BAR),
|
|
217
|
+
synonymOf: EnvironmentVariable.SF_USE_PROGRESS_BAR,
|
|
218
|
+
},
|
|
219
|
+
[EnvironmentVariable.SF_TARGET_ORG]: {
|
|
220
|
+
description: getMessage(EnvironmentVariable.SF_TARGET_ORG),
|
|
221
|
+
synonymOf: null,
|
|
222
|
+
},
|
|
223
|
+
[EnvironmentVariable.SF_TARGET_DEV_HUB]: {
|
|
224
|
+
description: getMessage(EnvironmentVariable.SF_TARGET_DEV_HUB),
|
|
225
|
+
synonymOf: null,
|
|
226
|
+
},
|
|
227
|
+
// sf vars
|
|
228
|
+
[EnvironmentVariable.SF_ACCESS_TOKEN]: {
|
|
229
|
+
description: getMessage(EnvironmentVariable.SF_ACCESS_TOKEN),
|
|
230
|
+
synonymOf: null,
|
|
231
|
+
},
|
|
232
|
+
[EnvironmentVariable.SF_API_VERSION]: {
|
|
233
|
+
description: getMessage(EnvironmentVariable.SF_API_VERSION),
|
|
234
|
+
synonymOf: null,
|
|
235
|
+
},
|
|
236
|
+
[EnvironmentVariable.SF_AUDIENCE_URL]: {
|
|
237
|
+
description: getMessage(EnvironmentVariable.SF_AUDIENCE_URL),
|
|
238
|
+
synonymOf: null,
|
|
239
|
+
},
|
|
240
|
+
[EnvironmentVariable.SF_CODE_COVERAGE_REQUIREMENT]: {
|
|
241
|
+
description: getMessage(EnvironmentVariable.SF_CODE_COVERAGE_REQUIREMENT),
|
|
242
|
+
synonymOf: null,
|
|
243
|
+
},
|
|
244
|
+
[EnvironmentVariable.SF_CONTENT_TYPE]: {
|
|
245
|
+
description: getMessage(EnvironmentVariable.SF_CONTENT_TYPE),
|
|
246
|
+
synonymOf: null,
|
|
247
|
+
},
|
|
248
|
+
[EnvironmentVariable.SF_DISABLE_AUTOUPDATE]: {
|
|
249
|
+
description: getMessage(EnvironmentVariable.SF_DISABLE_AUTOUPDATE),
|
|
250
|
+
synonymOf: null,
|
|
251
|
+
},
|
|
252
|
+
[EnvironmentVariable.SF_AUTOUPDATE_DISABLE]: {
|
|
253
|
+
description: getMessage(EnvironmentVariable.SF_AUTOUPDATE_DISABLE),
|
|
254
|
+
synonymOf: null,
|
|
255
|
+
},
|
|
256
|
+
[EnvironmentVariable.SF_DISABLE_SOURCE_MEMBER_POLLING]: {
|
|
257
|
+
description: getMessage(EnvironmentVariable.SF_DISABLE_SOURCE_MEMBER_POLLING),
|
|
258
|
+
synonymOf: null,
|
|
259
|
+
},
|
|
260
|
+
[EnvironmentVariable.SF_DISABLE_TELEMETRY]: {
|
|
261
|
+
description: getMessage(EnvironmentVariable.SF_DISABLE_TELEMETRY),
|
|
262
|
+
synonymOf: null,
|
|
263
|
+
},
|
|
264
|
+
[EnvironmentVariable.SF_DNS_TIMEOUT]: {
|
|
265
|
+
description: getMessage(EnvironmentVariable.SF_DNS_TIMEOUT),
|
|
266
|
+
synonymOf: null,
|
|
267
|
+
},
|
|
268
|
+
[EnvironmentVariable.SF_DOMAIN_RETRY]: {
|
|
269
|
+
description: getMessage(EnvironmentVariable.SF_DOMAIN_RETRY),
|
|
270
|
+
synonymOf: null,
|
|
271
|
+
},
|
|
272
|
+
[EnvironmentVariable.SF_IMPROVED_CODE_COVERAGE]: {
|
|
273
|
+
description: getMessage(EnvironmentVariable.SF_IMPROVED_CODE_COVERAGE),
|
|
274
|
+
synonymOf: null,
|
|
275
|
+
},
|
|
276
|
+
[EnvironmentVariable.SF_INSTANCE_URL]: {
|
|
277
|
+
description: getMessage(EnvironmentVariable.SF_INSTANCE_URL),
|
|
278
|
+
synonymOf: null,
|
|
279
|
+
},
|
|
280
|
+
[EnvironmentVariable.SF_JSON_TO_STDOUT]: {
|
|
281
|
+
description: getMessage(EnvironmentVariable.SF_JSON_TO_STDOUT),
|
|
282
|
+
synonymOf: null,
|
|
283
|
+
},
|
|
284
|
+
[EnvironmentVariable.SF_LOG_LEVEL]: {
|
|
285
|
+
description: getMessage(EnvironmentVariable.SF_LOG_LEVEL),
|
|
286
|
+
synonymOf: null,
|
|
287
|
+
},
|
|
288
|
+
[EnvironmentVariable.SF_MAX_QUERY_LIMIT]: {
|
|
289
|
+
description: getMessage(EnvironmentVariable.SF_MAX_QUERY_LIMIT),
|
|
290
|
+
synonymOf: null,
|
|
291
|
+
},
|
|
292
|
+
[EnvironmentVariable.SF_MDAPI_TEMP_DIR]: {
|
|
293
|
+
description: getMessage(EnvironmentVariable.SF_MDAPI_TEMP_DIR),
|
|
294
|
+
synonymOf: null,
|
|
295
|
+
},
|
|
296
|
+
[EnvironmentVariable.SF_NPM_REGISTRY]: {
|
|
297
|
+
description: getMessage(EnvironmentVariable.SF_NPM_REGISTRY),
|
|
298
|
+
synonymOf: null,
|
|
299
|
+
},
|
|
300
|
+
[EnvironmentVariable.SF_PRECOMPILE_ENABLE]: {
|
|
301
|
+
description: getMessage(EnvironmentVariable.SF_PRECOMPILE_ENABLE),
|
|
302
|
+
synonymOf: null,
|
|
303
|
+
},
|
|
304
|
+
[EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE]: {
|
|
305
|
+
description: getMessage(EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE),
|
|
306
|
+
synonymOf: null,
|
|
307
|
+
},
|
|
308
|
+
[EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE]: {
|
|
309
|
+
description: messages.getMessage(change_case_1.camelCase(EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE)),
|
|
310
|
+
synonymOf: null,
|
|
311
|
+
},
|
|
312
|
+
[EnvironmentVariable.SF_SOURCE_MEMBER_POLLING_TIMEOUT]: {
|
|
313
|
+
description: getMessage(EnvironmentVariable.SF_SOURCE_MEMBER_POLLING_TIMEOUT),
|
|
314
|
+
synonymOf: null,
|
|
315
|
+
},
|
|
316
|
+
[EnvironmentVariable.SF_USE_GENERIC_UNIX_KEYCHAIN]: {
|
|
317
|
+
description: getMessage(EnvironmentVariable.SF_USE_GENERIC_UNIX_KEYCHAIN),
|
|
318
|
+
synonymOf: null,
|
|
319
|
+
},
|
|
320
|
+
[EnvironmentVariable.SF_USE_PROGRESS_BAR]: {
|
|
321
|
+
description: getMessage(EnvironmentVariable.SF_USE_PROGRESS_BAR),
|
|
322
|
+
synonymOf: null,
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
class EnvVars extends kit_1.Env {
|
|
326
|
+
constructor() {
|
|
327
|
+
super();
|
|
328
|
+
this.resolve();
|
|
329
|
+
}
|
|
330
|
+
propertyToEnvName(property, prefix = 'SFDX_') {
|
|
331
|
+
return `${prefix || ''}${change_case_1.snakeCase(property).toUpperCase()}`;
|
|
332
|
+
}
|
|
333
|
+
setPropertyFromEnv(property, prefix = 'SFDX_') {
|
|
334
|
+
const envName = this.propertyToEnvName(property, prefix);
|
|
335
|
+
const value = this.getString(envName);
|
|
336
|
+
if (value) {
|
|
337
|
+
this.setString(property, value);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
asDictionary() {
|
|
341
|
+
return this.entries().reduce((accumulator, [key, value]) => {
|
|
342
|
+
accumulator[key] = value;
|
|
343
|
+
return accumulator;
|
|
344
|
+
}, {});
|
|
345
|
+
}
|
|
346
|
+
asMap() {
|
|
347
|
+
return this.entries().reduce((accumulator, [key, value]) => {
|
|
348
|
+
accumulator.set(key, value);
|
|
349
|
+
return accumulator;
|
|
350
|
+
}, new Map());
|
|
351
|
+
}
|
|
352
|
+
resolve() {
|
|
353
|
+
this.entries().forEach(([key, value]) => {
|
|
354
|
+
if (exports.SUPPORTED_ENV_VARS[key]) {
|
|
355
|
+
// cross populate value to synonym if synonym exists
|
|
356
|
+
if (exports.SUPPORTED_ENV_VARS[key].synonymOf) {
|
|
357
|
+
const synonym = exports.SUPPORTED_ENV_VARS[key].synonymOf;
|
|
358
|
+
// set synonym only if it is in the map and running in interoperability mode
|
|
359
|
+
if (synonym && global_1.Global.SFDX_INTEROPERABILITY) {
|
|
360
|
+
this.setString(synonym, value);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
exports.EnvVars = EnvVars;
|
|
368
|
+
//# sourceMappingURL=envVars.js.map
|
package/lib/crypto/crypto.js
CHANGED
|
@@ -15,6 +15,7 @@ const ts_types_1 = require("@salesforce/ts-types");
|
|
|
15
15
|
const kit_1 = require("@salesforce/kit");
|
|
16
16
|
const logger_1 = require("../logger");
|
|
17
17
|
const messages_1 = require("../messages");
|
|
18
|
+
const cache_1 = require("../util/cache");
|
|
18
19
|
const keyChain_1 = require("./keyChain");
|
|
19
20
|
const secureBuffer_1 = require("./secureBuffer");
|
|
20
21
|
const TAG_DELIMITER = ':';
|
|
@@ -31,6 +32,11 @@ const messages = messages_1.Messages.load('@salesforce/core', 'encryption', [
|
|
|
31
32
|
'authDecryptError',
|
|
32
33
|
'macKeychainOutOfSync',
|
|
33
34
|
]);
|
|
35
|
+
const makeSecureBuffer = (password) => {
|
|
36
|
+
const newSb = new secureBuffer_1.SecureBuffer();
|
|
37
|
+
newSb.consume(Buffer.from(ts_types_1.ensure(password), 'utf8'));
|
|
38
|
+
return newSb;
|
|
39
|
+
};
|
|
34
40
|
/**
|
|
35
41
|
* osxKeyChain promise wrapper.
|
|
36
42
|
*/
|
|
@@ -43,11 +49,24 @@ const keychainPromises = {
|
|
|
43
49
|
* @param account The keychain account name.
|
|
44
50
|
*/
|
|
45
51
|
getPassword(_keychain, service, account) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
const sb = cache_1.Cache.get(`${service}:${account}`);
|
|
53
|
+
if (!sb) {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
return _keychain.getPassword({ service, account }, (err, password) => {
|
|
56
|
+
if (err)
|
|
57
|
+
return reject(err);
|
|
58
|
+
cache_1.Cache.set(`${service}:${account}`, makeSecureBuffer(password));
|
|
59
|
+
return resolve({ username: account, password: ts_types_1.ensure(password) });
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const pw = sb.value((buffer) => buffer.toString('utf8'));
|
|
65
|
+
cache_1.Cache.set(`${service}:${account}`, makeSecureBuffer(pw));
|
|
66
|
+
return new Promise((resolve) => {
|
|
67
|
+
return resolve({ username: account, password: ts_types_1.ensure(pw) });
|
|
68
|
+
});
|
|
69
|
+
}
|
|
51
70
|
},
|
|
52
71
|
/**
|
|
53
72
|
* Sets a generic password item in OSX keychain.
|
package/lib/exported.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { OAuth2Options } from 'jsforce';
|
|
2
2
|
export { ConfigFile } from './config/configFile';
|
|
3
|
+
export { EnvironmentVariable, SUPPORTED_ENV_VARS } from './config/envVars';
|
|
3
4
|
export { BaseConfigStore, ConfigContents, ConfigEntry, ConfigStore, ConfigValue } from './config/configStore';
|
|
4
5
|
export { GlobalInfo, SfEntry, SfInfo, SfInfoKeys, SfOrg, SfOrgs, SfToken, SfTokens } from './globalInfo';
|
|
5
6
|
export { DeviceOauthService, DeviceCodeResponse, DeviceCodePollingResponse } from './deviceOauthService';
|
|
6
7
|
export { OrgUsersConfig } from './config/orgUsersConfig';
|
|
7
|
-
export { ConfigPropertyMeta, ConfigPropertyMetaInput, Config, SfdxPropertyKeys } from './config/config';
|
|
8
|
+
export { ConfigPropertyMeta, ConfigPropertyMetaInput, Config, SfdxPropertyKeys, SFDX_ALLOWED_PROPERTIES, } from './config/config';
|
|
8
9
|
export { ConfigInfo, ConfigAggregator } from './config/configAggregator';
|
|
9
10
|
export { AuthFields, AuthInfo, OAuth2WithVerifier, OrgAuthorization } from './org/authInfo';
|
|
10
11
|
export { AuthRemover } from './org/authRemover';
|
|
@@ -17,7 +18,7 @@ export { getJwtAudienceUrl } from './util/getJwtAudienceUrl';
|
|
|
17
18
|
export { Fields, FieldValue, LoggerLevel, LoggerLevelValue, LogLine, LoggerOptions, LoggerStream, Logger, } from './logger';
|
|
18
19
|
export { Messages } from './messages';
|
|
19
20
|
export { Org } from './org/org';
|
|
20
|
-
export { OrgConfigProperties } from './org/orgConfigProperties';
|
|
21
|
+
export { OrgConfigProperties, ORG_CONFIG_ALLOWED_PROPERTIES } from './org/orgConfigProperties';
|
|
21
22
|
export { PackageDir, NamedPackageDir, PackageDirDependency, SfdxProject, SfdxProjectJson } from './sfdxProject';
|
|
22
23
|
export { SchemaPrinter } from './schema/printer';
|
|
23
24
|
export { SchemaValidator } from './schema/validator';
|
package/lib/exported.js
CHANGED
|
@@ -16,11 +16,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.PermissionSetAssignment = exports.User = exports.REQUIRED_FIELDS = exports.DefaultUserFields = exports.MyDomainResolver = exports.StreamingClient = exports.CometClient = exports.PollingClient = exports.SfdxError = exports.SchemaValidator = exports.SchemaPrinter = exports.SfdxProjectJson = exports.SfdxProject = exports.OrgConfigProperties = exports.Org = exports.Messages = exports.Logger = exports.LoggerLevel = exports.getJwtAudienceUrl = exports.SfdcUrl = exports.WebOAuthServer = exports.Lifecycle = exports.Global = exports.Mode = exports.SFDX_HTTP_HEADERS = exports.Connection = exports.AuthRemover = exports.OAuth2WithVerifier = exports.AuthInfo = exports.ConfigAggregator = exports.SfdxPropertyKeys = exports.Config = exports.OrgUsersConfig = exports.DeviceOauthService = exports.SfInfoKeys = exports.GlobalInfo = exports.BaseConfigStore = exports.ConfigFile = void 0;
|
|
19
|
+
exports.PermissionSetAssignment = exports.User = exports.REQUIRED_FIELDS = exports.DefaultUserFields = exports.MyDomainResolver = exports.StreamingClient = exports.CometClient = exports.PollingClient = exports.SfdxError = exports.SchemaValidator = exports.SchemaPrinter = exports.SfdxProjectJson = exports.SfdxProject = exports.ORG_CONFIG_ALLOWED_PROPERTIES = exports.OrgConfigProperties = exports.Org = exports.Messages = exports.Logger = exports.LoggerLevel = exports.getJwtAudienceUrl = exports.SfdcUrl = exports.WebOAuthServer = exports.Lifecycle = exports.Global = exports.Mode = exports.SFDX_HTTP_HEADERS = exports.Connection = exports.AuthRemover = exports.OAuth2WithVerifier = exports.AuthInfo = exports.ConfigAggregator = exports.SFDX_ALLOWED_PROPERTIES = exports.SfdxPropertyKeys = exports.Config = exports.OrgUsersConfig = exports.DeviceOauthService = exports.SfInfoKeys = exports.GlobalInfo = exports.BaseConfigStore = exports.SUPPORTED_ENV_VARS = exports.EnvironmentVariable = exports.ConfigFile = void 0;
|
|
20
20
|
const messages_1 = require("./messages");
|
|
21
21
|
messages_1.Messages.importMessagesDirectory(__dirname);
|
|
22
22
|
var configFile_1 = require("./config/configFile");
|
|
23
23
|
Object.defineProperty(exports, "ConfigFile", { enumerable: true, get: function () { return configFile_1.ConfigFile; } });
|
|
24
|
+
var envVars_1 = require("./config/envVars");
|
|
25
|
+
Object.defineProperty(exports, "EnvironmentVariable", { enumerable: true, get: function () { return envVars_1.EnvironmentVariable; } });
|
|
26
|
+
Object.defineProperty(exports, "SUPPORTED_ENV_VARS", { enumerable: true, get: function () { return envVars_1.SUPPORTED_ENV_VARS; } });
|
|
24
27
|
var configStore_1 = require("./config/configStore");
|
|
25
28
|
Object.defineProperty(exports, "BaseConfigStore", { enumerable: true, get: function () { return configStore_1.BaseConfigStore; } });
|
|
26
29
|
var globalInfo_1 = require("./globalInfo");
|
|
@@ -33,6 +36,7 @@ Object.defineProperty(exports, "OrgUsersConfig", { enumerable: true, get: functi
|
|
|
33
36
|
var config_1 = require("./config/config");
|
|
34
37
|
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
|
|
35
38
|
Object.defineProperty(exports, "SfdxPropertyKeys", { enumerable: true, get: function () { return config_1.SfdxPropertyKeys; } });
|
|
39
|
+
Object.defineProperty(exports, "SFDX_ALLOWED_PROPERTIES", { enumerable: true, get: function () { return config_1.SFDX_ALLOWED_PROPERTIES; } });
|
|
36
40
|
var configAggregator_1 = require("./config/configAggregator");
|
|
37
41
|
Object.defineProperty(exports, "ConfigAggregator", { enumerable: true, get: function () { return configAggregator_1.ConfigAggregator; } });
|
|
38
42
|
var authInfo_1 = require("./org/authInfo");
|
|
@@ -63,6 +67,7 @@ var org_1 = require("./org/org");
|
|
|
63
67
|
Object.defineProperty(exports, "Org", { enumerable: true, get: function () { return org_1.Org; } });
|
|
64
68
|
var orgConfigProperties_1 = require("./org/orgConfigProperties");
|
|
65
69
|
Object.defineProperty(exports, "OrgConfigProperties", { enumerable: true, get: function () { return orgConfigProperties_1.OrgConfigProperties; } });
|
|
70
|
+
Object.defineProperty(exports, "ORG_CONFIG_ALLOWED_PROPERTIES", { enumerable: true, get: function () { return orgConfigProperties_1.ORG_CONFIG_ALLOWED_PROPERTIES; } });
|
|
66
71
|
var sfdxProject_1 = require("./sfdxProject");
|
|
67
72
|
Object.defineProperty(exports, "SfdxProject", { enumerable: true, get: function () { return sfdxProject_1.SfdxProject; } });
|
|
68
73
|
Object.defineProperty(exports, "SfdxProjectJson", { enumerable: true, get: function () { return sfdxProject_1.SfdxProjectJson; } });
|
package/lib/messages.js
CHANGED
|
@@ -368,7 +368,7 @@ class Messages {
|
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
if (messages) {
|
|
371
|
-
// Type
|
|
371
|
+
// Type guard on key length, but do a runtime check.
|
|
372
372
|
if (!keys || keys.length === 0) {
|
|
373
373
|
throw new kit_1.NamedError('MissingKeysError', 'Can not load messages without providing the message keys that will be used.');
|
|
374
374
|
}
|
package/lib/org/authRemover.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare class AuthRemover extends AsyncOptionalCreatable {
|
|
|
47
47
|
*/
|
|
48
48
|
findAuth(usernameOrAlias?: string): Promise<SfOrg>;
|
|
49
49
|
/**
|
|
50
|
-
* Finds all
|
|
50
|
+
* Finds all org authorizations in the global info file (.sf/sf.json)
|
|
51
51
|
*
|
|
52
52
|
* @returns {SfOrgs}
|
|
53
53
|
*/
|
|
@@ -83,4 +83,5 @@ export declare class AuthRemover extends AsyncOptionalCreatable {
|
|
|
83
83
|
* @param username username that you want to remove from aliases
|
|
84
84
|
*/
|
|
85
85
|
private unsetAliases;
|
|
86
|
+
private unsetTokens;
|
|
86
87
|
}
|
package/lib/org/authRemover.js
CHANGED
|
@@ -50,6 +50,7 @@ class AuthRemover extends kit_1.AsyncOptionalCreatable {
|
|
|
50
50
|
this.logger.debug(`Removing authorization for user ${username}`);
|
|
51
51
|
await this.unsetConfigValues(username);
|
|
52
52
|
await this.unsetAliases(username);
|
|
53
|
+
this.unsetTokens(username);
|
|
53
54
|
this.globalInfo.orgs.unset(username);
|
|
54
55
|
await this.globalInfo.write();
|
|
55
56
|
}
|
|
@@ -80,7 +81,7 @@ class AuthRemover extends kit_1.AsyncOptionalCreatable {
|
|
|
80
81
|
return auth;
|
|
81
82
|
}
|
|
82
83
|
/**
|
|
83
|
-
* Finds all
|
|
84
|
+
* Finds all org authorizations in the global info file (.sf/sf.json)
|
|
84
85
|
*
|
|
85
86
|
* @returns {SfOrgs}
|
|
86
87
|
*/
|
|
@@ -162,7 +163,15 @@ class AuthRemover extends kit_1.AsyncOptionalCreatable {
|
|
|
162
163
|
return;
|
|
163
164
|
this.logger.debug(`Found these aliases to remove: ${existingAliases}`);
|
|
164
165
|
existingAliases.forEach((alias) => this.globalInfo.aliases.unset(alias));
|
|
165
|
-
|
|
166
|
+
}
|
|
167
|
+
unsetTokens(username) {
|
|
168
|
+
this.logger.debug(`Clearing tokens for username: ${username}`);
|
|
169
|
+
const tokens = this.globalInfo.tokens.getAll();
|
|
170
|
+
for (const [key, token] of Object.entries(tokens)) {
|
|
171
|
+
if (token.user === username) {
|
|
172
|
+
this.globalInfo.tokens.unset(key);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
166
175
|
}
|
|
167
176
|
}
|
|
168
177
|
exports.AuthRemover = AuthRemover;
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ORG_CONFIG_ALLOWED_PROPERTIES = exports.OrgConfigProperties = void 0;
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const messages_1 = require("../messages");
|
|
12
|
+
messages_1.Messages.importMessagesDirectory(path_1.join(__dirname));
|
|
13
|
+
const messages = messages_1.Messages.load('@salesforce/core', 'config', ['targetOrg', 'targetDevHub']);
|
|
10
14
|
var OrgConfigProperties;
|
|
11
15
|
(function (OrgConfigProperties) {
|
|
12
16
|
OrgConfigProperties["TARGET_ORG"] = "target-org";
|
|
@@ -15,11 +19,11 @@ var OrgConfigProperties;
|
|
|
15
19
|
exports.ORG_CONFIG_ALLOWED_PROPERTIES = [
|
|
16
20
|
{
|
|
17
21
|
key: OrgConfigProperties.TARGET_ORG,
|
|
18
|
-
description:
|
|
22
|
+
description: messages.getMessage('targetOrg'),
|
|
19
23
|
},
|
|
20
24
|
{
|
|
21
25
|
key: OrgConfigProperties.TARGET_DEV_HUB,
|
|
22
|
-
description:
|
|
26
|
+
description: messages.getMessage('targetDevHub'),
|
|
23
27
|
},
|
|
24
28
|
];
|
|
25
29
|
//# sourceMappingURL=orgConfigProperties.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class Cache extends Map {
|
|
2
|
+
#private;
|
|
3
|
+
private constructor();
|
|
4
|
+
static instance(): Cache;
|
|
5
|
+
static set<V>(key: string, value: V): void;
|
|
6
|
+
static get<V>(key: string): V | undefined;
|
|
7
|
+
static disable(): void;
|
|
8
|
+
static enable(): void;
|
|
9
|
+
static get hits(): number;
|
|
10
|
+
static get lookups(): number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _a, _Cache_instance, _Cache_enabled, _Cache_hits, _Cache_lookups;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.Cache = void 0;
|
|
16
|
+
/*
|
|
17
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
18
|
+
* All rights reserved.
|
|
19
|
+
* Licensed under the BSD 3-Clause license.
|
|
20
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
21
|
+
*/
|
|
22
|
+
class Cache extends Map {
|
|
23
|
+
/* eslint-enable @typescript-eslint/explicit-member-accessibility */
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
_Cache_hits.set(this, void 0);
|
|
27
|
+
_Cache_lookups.set(this, void 0);
|
|
28
|
+
__classPrivateFieldSet(this, _Cache_hits, 0, "f");
|
|
29
|
+
__classPrivateFieldSet(this, _Cache_lookups, 0, "f");
|
|
30
|
+
}
|
|
31
|
+
static instance() {
|
|
32
|
+
if (!__classPrivateFieldGet(Cache, _a, "f", _Cache_instance)) {
|
|
33
|
+
__classPrivateFieldSet(Cache, _a, true, "f", _Cache_enabled);
|
|
34
|
+
__classPrivateFieldSet(Cache, _a, new Cache(), "f", _Cache_instance);
|
|
35
|
+
}
|
|
36
|
+
return __classPrivateFieldGet(Cache, _a, "f", _Cache_instance);
|
|
37
|
+
}
|
|
38
|
+
static set(key, value) {
|
|
39
|
+
if (__classPrivateFieldGet(Cache, _a, "f", _Cache_enabled)) {
|
|
40
|
+
Cache.instance().set(key, value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
static get(key) {
|
|
44
|
+
var _b, _c;
|
|
45
|
+
if (!__classPrivateFieldGet(Cache, _a, "f", _Cache_enabled)) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
__classPrivateFieldSet(_b = Cache.instance(), _Cache_lookups, +__classPrivateFieldGet(_b, _Cache_lookups, "f") + 1, "f");
|
|
49
|
+
__classPrivateFieldSet(_c = Cache.instance(), _Cache_hits, __classPrivateFieldGet(_c, _Cache_hits, "f") + (Cache.instance().has(key) ? 1 : 0), "f");
|
|
50
|
+
return __classPrivateFieldGet(Cache, _a, "f", _Cache_instance).get(key);
|
|
51
|
+
}
|
|
52
|
+
static disable() {
|
|
53
|
+
__classPrivateFieldSet(Cache, _a, false, "f", _Cache_enabled);
|
|
54
|
+
}
|
|
55
|
+
static enable() {
|
|
56
|
+
__classPrivateFieldSet(Cache, _a, true, "f", _Cache_enabled);
|
|
57
|
+
}
|
|
58
|
+
static get hits() {
|
|
59
|
+
return __classPrivateFieldGet(Cache.instance(), _Cache_hits, "f");
|
|
60
|
+
}
|
|
61
|
+
static get lookups() {
|
|
62
|
+
return __classPrivateFieldGet(Cache.instance(), _Cache_lookups, "f");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Cache = Cache;
|
|
66
|
+
_a = Cache, _Cache_hits = new WeakMap(), _Cache_lookups = new WeakMap();
|
|
67
|
+
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
|
68
|
+
_Cache_instance = { value: void 0 };
|
|
69
|
+
_Cache_enabled = { value: true };
|
|
70
|
+
//# sourceMappingURL=cache.js.map
|
package/messages/config.md
CHANGED
|
@@ -70,3 +70,47 @@ In sfdx-project.json, indicate only one package directory (path) as the default.
|
|
|
70
70
|
# singleNonDefaultPackage
|
|
71
71
|
|
|
72
72
|
The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.
|
|
73
|
+
|
|
74
|
+
# targetOrg
|
|
75
|
+
|
|
76
|
+
The target to be used for any command communicating with an org.
|
|
77
|
+
|
|
78
|
+
# targetDevHub
|
|
79
|
+
|
|
80
|
+
The target to be used for any command communicating with a dev hub org.
|
|
81
|
+
|
|
82
|
+
# defaultUsername
|
|
83
|
+
|
|
84
|
+
Default username to use for a given command
|
|
85
|
+
|
|
86
|
+
# defaultDevHubUsername
|
|
87
|
+
|
|
88
|
+
Default dev hub org
|
|
89
|
+
|
|
90
|
+
# isvDebuggerSid
|
|
91
|
+
|
|
92
|
+
ISV debugger SID
|
|
93
|
+
|
|
94
|
+
# isvDebuggerUrl
|
|
95
|
+
|
|
96
|
+
ISV debugger URL
|
|
97
|
+
|
|
98
|
+
# apiVersion
|
|
99
|
+
|
|
100
|
+
API version to use when making requests to app server
|
|
101
|
+
|
|
102
|
+
# disableTelemetry
|
|
103
|
+
|
|
104
|
+
Disable telemetry
|
|
105
|
+
|
|
106
|
+
# maxQueryLimit
|
|
107
|
+
|
|
108
|
+
Maximum rows to return for a SOQL query.
|
|
109
|
+
|
|
110
|
+
# restDeploy
|
|
111
|
+
|
|
112
|
+
Boolean that enables deploy via REST API.
|
|
113
|
+
|
|
114
|
+
# instanceUrl
|
|
115
|
+
|
|
116
|
+
Instance URL to use for a command.
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# forceOpenUrl
|
|
2
|
+
|
|
3
|
+
Specifies the web page that opens in your browser when you run force:org:open. For example, to open Lightning Experience, set to lightning.
|
|
4
|
+
|
|
5
|
+
# forceShowSpinner
|
|
6
|
+
|
|
7
|
+
Set to true to show a spinner animation on the command line when running asynchronous CLI commands. Default is false.
|
|
8
|
+
|
|
9
|
+
# forceSpinnerDelay
|
|
10
|
+
|
|
11
|
+
Specifies the speed of the spinner in milliseconds. Default is 60.
|
|
12
|
+
|
|
13
|
+
# httpProxy
|
|
14
|
+
|
|
15
|
+
Set this variable to your http proxy server if behind a corporate firewall
|
|
16
|
+
|
|
17
|
+
# httpsProxy
|
|
18
|
+
|
|
19
|
+
Set this variable to your https proxy server if behind a corporate firewall
|
|
20
|
+
|
|
21
|
+
# nodeExtraCaCerts
|
|
22
|
+
|
|
23
|
+
Installs your self-signed certificate. Indicate the fully qualified path to the certificate file name. Then run sfdx update.
|
|
24
|
+
|
|
25
|
+
# nodeTlsRejectUnauthorized
|
|
26
|
+
|
|
27
|
+
Indicate 0 to allow Node.js to use the self-signed certificate in the certificate chain.
|
|
28
|
+
|
|
29
|
+
# sfdxAccessToken
|
|
30
|
+
|
|
31
|
+
Specifies an access token when using the auth:accesstoken:store command.
|
|
32
|
+
|
|
33
|
+
# sfdxApiVersion
|
|
34
|
+
|
|
35
|
+
The API version for a specific project or all projects.
|
|
36
|
+
|
|
37
|
+
# sfdxAudienceUrl
|
|
38
|
+
|
|
39
|
+
Overrides the aud (audience) field used for JWT authentication so that it matches the expected value of the authorization server URL for the org you’re logging into.
|
|
40
|
+
|
|
41
|
+
# sfdxCodeCoverageRequirement
|
|
42
|
+
|
|
43
|
+
Specifies the code coverage percentages that are displayed in green when you run force:apex:test:run or force:apex:test:report with the --codecoverage parameter.
|
|
44
|
+
|
|
45
|
+
# sfdxContentType
|
|
46
|
+
|
|
47
|
+
When set to JSON, specifies that all CLI commands output results in JSON format.
|
|
48
|
+
|
|
49
|
+
# sfdxDefaultdevhubusername
|
|
50
|
+
|
|
51
|
+
Specifies the username of your default Dev Hub org so you don’t have to use the --targetdevhubusername CLI parameter. Overrides the value of the defaultdevhubusername runtime configuration value.
|
|
52
|
+
|
|
53
|
+
# sfdxDefaultusername
|
|
54
|
+
|
|
55
|
+
Specifies the username of your default org so you don’t have to use the --targetusername CLI parameter. Overrides the value of the defaultusername runtime configuration value.
|
|
56
|
+
|
|
57
|
+
# sfdxDisableAutoupdate
|
|
58
|
+
|
|
59
|
+
Set to true to disable the auto-update feature of the CLI.
|
|
60
|
+
|
|
61
|
+
# sfdxAutoupdateDisable
|
|
62
|
+
|
|
63
|
+
Set to true to disable the auto-update feature of the CLI.
|
|
64
|
+
|
|
65
|
+
# sfdxDisableSourceMemberPolling
|
|
66
|
+
|
|
67
|
+
Set to true to disable polling of your org’s SourceMember object when you run the force:source:push|pull commands.
|
|
68
|
+
|
|
69
|
+
# sfdxDisableTelemetry
|
|
70
|
+
|
|
71
|
+
Set to true to disable the CLI from collecting usage information, user environment information, and crash reports.
|
|
72
|
+
|
|
73
|
+
# sfdxDnsTimeout
|
|
74
|
+
|
|
75
|
+
Specifies the number of seconds that the force:org:\* commands wait for a response when checking whether an org is connected. If the commands don’t receive a response in that time, they time out. Default value is 3.
|
|
76
|
+
|
|
77
|
+
# sfdxDomainRetry
|
|
78
|
+
|
|
79
|
+
Specifies the time, in seconds, that the CLI waits for the Lightning Experience custom domain to resolve and become available in a newly created scratch org.
|
|
80
|
+
|
|
81
|
+
# sfdxImprovedCodeCoverage
|
|
82
|
+
|
|
83
|
+
Scopes Apex test results to the classes entered during a test run when running force:apex:test:run and force:apex:test:report. Set to true to improve code coverage.
|
|
84
|
+
|
|
85
|
+
# sfdxInstanceUrl
|
|
86
|
+
|
|
87
|
+
The URL of the Salesforce instance that is hosting your org.
|
|
88
|
+
|
|
89
|
+
# sfdxJsonToStdout
|
|
90
|
+
|
|
91
|
+
Sends messages when Salesforce CLI commands fail to stdout instead of stderr.
|
|
92
|
+
|
|
93
|
+
# sfdxLogLevel
|
|
94
|
+
|
|
95
|
+
Sets the level of messages that the CLI writes to the log file.
|
|
96
|
+
|
|
97
|
+
# sfdxMaxQueryLimit
|
|
98
|
+
|
|
99
|
+
The maximum number of Salesforce records returned by a CLI command. Default value is 10,000.
|
|
100
|
+
|
|
101
|
+
# sfdxMdapiTempDir
|
|
102
|
+
|
|
103
|
+
Places the files (in metadata format) in the specified directory when you run some CLI commands, such as force:source:<name>.
|
|
104
|
+
|
|
105
|
+
# sfdxNpmRegistry
|
|
106
|
+
|
|
107
|
+
Sets the URL to a private npm server, where all packages that you publish are private.
|
|
108
|
+
|
|
109
|
+
# sfdxPrecompileEnable
|
|
110
|
+
|
|
111
|
+
Set to true to enable Apex pre-compile before the tests are run. Default is false.
|
|
112
|
+
|
|
113
|
+
# sfdxProjectAutoupdateDisableForPackageCreate
|
|
114
|
+
|
|
115
|
+
For force:package:create, disables automatic updates to the sfdx-project.json file.
|
|
116
|
+
|
|
117
|
+
# sfdxProjectAutoupdateDisableForPackageVersionCreate
|
|
118
|
+
|
|
119
|
+
For force:package:version:create, disables automatic updates to the sfdx-project.json file.
|
|
120
|
+
|
|
121
|
+
# sfdxRestDeploy
|
|
122
|
+
|
|
123
|
+
Set to true to make Salesforce CLI use the Metadata REST API for deployments. By default, the CLI uses SOAP.
|
|
124
|
+
|
|
125
|
+
# sfdxSourceMemberPollingTimeout
|
|
126
|
+
|
|
127
|
+
Set to the number of seconds you want the force:source:push command to keep polling the SourceMember object before the command times out.
|
|
128
|
+
|
|
129
|
+
# sfdxUseGenericUnixKeychain
|
|
130
|
+
|
|
131
|
+
(Linux and macOS only) Set to true if you want to use the generic UNIX keychain instead of the Linux libsecret library or macOS keychain.
|
|
132
|
+
|
|
133
|
+
# sfdxUseProgressBar
|
|
134
|
+
|
|
135
|
+
For force:mdapi:deploy, force:source:deploy, and force:source:push, set to false to disable the progress bar.
|
|
136
|
+
|
|
137
|
+
# sfTargetOrg
|
|
138
|
+
|
|
139
|
+
Specifies the username of your default target org you don’t have to use the --target-org CLI parameter. Overrides the value of the target-org runtime configuration value.
|
|
140
|
+
|
|
141
|
+
# sfTargetDevHub
|
|
142
|
+
|
|
143
|
+
Specifies the username of your default Dev Hub org so you don’t have to use the --target-dev-hub CLI parameter. Overrides the value of the target-dev-hub runtime configuration value.
|
|
144
|
+
|
|
145
|
+
# sfAccessToken
|
|
146
|
+
|
|
147
|
+
Specifies an access token when using the login accesstoken command.
|
|
148
|
+
|
|
149
|
+
# sfApiVersion
|
|
150
|
+
|
|
151
|
+
The API version for a specific environment or all environments.
|
|
152
|
+
|
|
153
|
+
# sfAudienceUrl
|
|
154
|
+
|
|
155
|
+
Overrides the aud (audience) field used for JWT authentication so that it matches the expected value of the authorization server URL for the org you’re logging into.
|
|
156
|
+
|
|
157
|
+
# sfCodeCoverageRequirement
|
|
158
|
+
|
|
159
|
+
Specifies the code coverage percentages that are displayed in green when you run force:apex:test:run or force:apex:test:report with the --codecoverage parameter.
|
|
160
|
+
|
|
161
|
+
# sfContentType
|
|
162
|
+
|
|
163
|
+
When set to JSON, specifies that all CLI commands output results in JSON format.
|
|
164
|
+
|
|
165
|
+
# sfDisableAutoupdate
|
|
166
|
+
|
|
167
|
+
Set to true to disable the auto-update feature of the CLI.
|
|
168
|
+
|
|
169
|
+
# sfAutoupdateDisable
|
|
170
|
+
|
|
171
|
+
Set to true to disable the auto-update feature of the CLI.
|
|
172
|
+
|
|
173
|
+
# sfDisableSourceMemberPolling
|
|
174
|
+
|
|
175
|
+
Set to true to disable polling of your org’s SourceMember object when you run the force:source:push|pull commands.
|
|
176
|
+
|
|
177
|
+
# sfDisableTelemetry
|
|
178
|
+
|
|
179
|
+
Set to true to disable the CLI from collecting usage information, user environment information, and crash reports.
|
|
180
|
+
|
|
181
|
+
# sfDnsTimeout
|
|
182
|
+
|
|
183
|
+
Specifies the number of seconds that the force:org:\* commands wait for a response when checking whether an org is connected. If the commands don’t receive a response in that time, they time out. Default value is 3.
|
|
184
|
+
|
|
185
|
+
# sfDomainRetry
|
|
186
|
+
|
|
187
|
+
Specifies the time, in seconds, that the CLI waits for the Lightning Experience custom domain to resolve and become available in a newly created scratch org.
|
|
188
|
+
|
|
189
|
+
# sfImprovedCodeCoverage
|
|
190
|
+
|
|
191
|
+
Specifies the time, in seconds, that the CLI waits for the Lightning Experience custom domain to resolve and become available in a newly created scratch org.
|
|
192
|
+
|
|
193
|
+
# sfInstanceUrl
|
|
194
|
+
|
|
195
|
+
The URL of the Salesforce instance that is hosting your org.
|
|
196
|
+
|
|
197
|
+
# sfJsonToStdout
|
|
198
|
+
|
|
199
|
+
Sends messages when Salesforce CLI commands fail to stdout instead of stderr.
|
|
200
|
+
|
|
201
|
+
# sfLogLevel
|
|
202
|
+
|
|
203
|
+
Sets the level of messages that the CLI writes to the log file.
|
|
204
|
+
|
|
205
|
+
# sfMaxQueryLimit
|
|
206
|
+
|
|
207
|
+
The maximum number of Salesforce records returned by a CLI command. Default value is 10,000.
|
|
208
|
+
|
|
209
|
+
# sfMdapiTempDir
|
|
210
|
+
|
|
211
|
+
Places the files (in metadata format) in the specified directory when you run some CLI commands, such as force:source:<name>.
|
|
212
|
+
|
|
213
|
+
# sfNpmRegistry
|
|
214
|
+
|
|
215
|
+
Sets the URL to a private npm server, where all packages that you publish are private.
|
|
216
|
+
|
|
217
|
+
# sfPrecompileEnable
|
|
218
|
+
|
|
219
|
+
Set to true to enable Apex pre-compile before the tests are run. Default is false.
|
|
220
|
+
|
|
221
|
+
# sfProjectAutoupdateDisableForPackageCreate
|
|
222
|
+
|
|
223
|
+
For force:package:create, disables automatic updates to the sfdx-project.json file.
|
|
224
|
+
|
|
225
|
+
# sfProjectAutoupdateDisableForPackageVersionCreate
|
|
226
|
+
|
|
227
|
+
For force:package:create, disables automatic updates to the sfdx-project.json file.
|
|
228
|
+
|
|
229
|
+
# sfSourceMemberPollingTimeout
|
|
230
|
+
|
|
231
|
+
Set to the number of seconds you want the force:source:push command to keep polling the SourceMember object before the command times out.
|
|
232
|
+
|
|
233
|
+
# sfUseGenericUnixKeychain
|
|
234
|
+
|
|
235
|
+
(Linux and macOS only) Set to true if you want to use the generic UNIX keychain instead of the Linux libsecret library or macOS keychain.
|
|
236
|
+
|
|
237
|
+
# sfUseProgressBar
|
|
238
|
+
|
|
239
|
+
For force:mdapi:deploy, force:source:deploy, and force:source:push, set to false to disable the progress bar.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.2",
|
|
4
4
|
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@types/graceful-fs": "^4.1.5",
|
|
47
47
|
"@types/jsforce": "^1.9.29",
|
|
48
48
|
"@types/mkdirp": "^1.0.1",
|
|
49
|
+
"change-case": "^4.1.2",
|
|
49
50
|
"debug": "^3.1.0",
|
|
50
51
|
"graceful-fs": "^4.2.4",
|
|
51
52
|
"jsen": "0.6.6",
|