@salesforce/core 3.10.1 → 3.12.0
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 +14 -0
- package/lib/config/config.d.ts +65 -13
- package/lib/config/config.js +52 -4
- package/lib/config/envVars.d.ts +3 -3
- package/lib/config/envVars.js +12 -12
- package/lib/exported.d.ts +1 -1
- package/lib/exported.js +4 -2
- package/lib/org/authInfo.d.ts +13 -0
- package/lib/org/authInfo.js +56 -0
- package/lib/org/orgConfigProperties.d.ts +64 -3
- package/lib/org/orgConfigProperties.js +106 -3
- package/lib/testSetup.js +2 -2
- package/messages/config.md +30 -6
- package/messages/envVars.md +3 -3
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.12.0](https://github.com/forcedotcom/sfdx-core/compare/v3.11.1...v3.12.0) (2022-04-04)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- move common authinfo utils to core ([01b8cf3](https://github.com/forcedotcom/sfdx-core/commit/01b8cf3fa38162380da5ce15f6dee1d2a5d2d72d))
|
|
10
|
+
|
|
11
|
+
### [3.11.1](https://github.com/forcedotcom/sfdx-core/compare/v3.11.0...v3.11.1) (2022-04-01)
|
|
12
|
+
|
|
13
|
+
## [3.11.0](https://github.com/forcedotcom/sfdx-core/compare/v3.10.1...v3.11.0) (2022-03-30)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- normalize config vars for sf ([#543](https://github.com/forcedotcom/sfdx-core/issues/543)) ([93f3cbe](https://github.com/forcedotcom/sfdx-core/commit/93f3cbe90103fa159f21f532ffc173931037651c))
|
|
18
|
+
|
|
5
19
|
### [3.10.1](https://github.com/forcedotcom/sfdx-core/compare/v3.10.0...v3.10.1) (2022-03-24)
|
|
6
20
|
|
|
7
21
|
### Bug Fixes
|
package/lib/config/config.d.ts
CHANGED
|
@@ -51,6 +51,20 @@ export interface ConfigPropertyMetaInput {
|
|
|
51
51
|
*/
|
|
52
52
|
failedMessage: string | ((value: ConfigValue) => string);
|
|
53
53
|
}
|
|
54
|
+
export declare enum SfConfigProperties {
|
|
55
|
+
/**
|
|
56
|
+
* Disables telemetry reporting
|
|
57
|
+
*/
|
|
58
|
+
DISABLE_TELEMETRY = "disable-telemetry"
|
|
59
|
+
}
|
|
60
|
+
export declare const SF_ALLOWED_PROPERTIES: {
|
|
61
|
+
key: SfConfigProperties;
|
|
62
|
+
description: string;
|
|
63
|
+
input: {
|
|
64
|
+
validator: (value: ConfigValue) => boolean;
|
|
65
|
+
failedMessage: string;
|
|
66
|
+
};
|
|
67
|
+
}[];
|
|
54
68
|
export declare enum SfdxPropertyKeys {
|
|
55
69
|
/**
|
|
56
70
|
* Username associated with the default dev hub org.
|
|
@@ -68,74 +82,112 @@ export declare enum SfdxPropertyKeys {
|
|
|
68
82
|
DEFAULT_USERNAME = "defaultusername",
|
|
69
83
|
/**
|
|
70
84
|
* The sid for the debugger configuration.
|
|
85
|
+
*
|
|
86
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_ISV_DEBUGGER_SID in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
71
87
|
*/
|
|
72
88
|
ISV_DEBUGGER_SID = "isvDebuggerSid",
|
|
73
89
|
/**
|
|
74
90
|
* The url for the debugger configuration.
|
|
91
|
+
*
|
|
92
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_ISV_DEBUGGER_URL in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
75
93
|
*/
|
|
76
94
|
ISV_DEBUGGER_URL = "isvDebuggerUrl",
|
|
77
95
|
/**
|
|
78
96
|
* The api version
|
|
97
|
+
*
|
|
98
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_API_VERSION in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
79
99
|
*/
|
|
80
100
|
API_VERSION = "apiVersion",
|
|
81
101
|
/**
|
|
82
102
|
* Disables telemetry reporting
|
|
103
|
+
*
|
|
104
|
+
* @deprecated Replaced by SfPropertyKeys.DISABLE_TELEMETRY in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
83
105
|
*/
|
|
84
106
|
DISABLE_TELEMETRY = "disableTelemetry",
|
|
85
107
|
/**
|
|
86
108
|
* Custom templates repo or local location.
|
|
109
|
+
*
|
|
110
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
87
111
|
*/
|
|
88
112
|
CUSTOM_ORG_METADATA_TEMPLATES = "customOrgMetadataTemplates",
|
|
89
113
|
/**
|
|
90
114
|
* allows users to override the 10,000 result query limit
|
|
115
|
+
*
|
|
116
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_MAX_QUERY_LIMIT in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
91
117
|
*/
|
|
92
118
|
MAX_QUERY_LIMIT = "maxQueryLimit",
|
|
93
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated
|
|
121
|
+
*/
|
|
94
122
|
REST_DEPLOY = "restDeploy",
|
|
95
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_INSTANCE_URL in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
125
|
+
*/
|
|
96
126
|
INSTANCE_URL = "instanceUrl"
|
|
97
127
|
}
|
|
98
128
|
export declare const SFDX_ALLOWED_PROPERTIES: ({
|
|
99
129
|
key: SfdxPropertyKeys;
|
|
100
130
|
description: string;
|
|
131
|
+
newKey: OrgConfigProperties;
|
|
132
|
+
deprecated: boolean;
|
|
101
133
|
input: {
|
|
102
134
|
validator: (value: ConfigValue) => boolean;
|
|
103
135
|
failedMessage: string;
|
|
104
136
|
};
|
|
137
|
+
encrypted?: undefined;
|
|
105
138
|
hidden?: undefined;
|
|
106
|
-
|
|
107
|
-
|
|
139
|
+
} | {
|
|
140
|
+
key: SfdxPropertyKeys;
|
|
141
|
+
newKey: OrgConfigProperties;
|
|
142
|
+
deprecated: boolean;
|
|
143
|
+
description: string;
|
|
144
|
+
input?: undefined;
|
|
108
145
|
encrypted?: undefined;
|
|
146
|
+
hidden?: undefined;
|
|
109
147
|
} | {
|
|
110
148
|
key: SfdxPropertyKeys;
|
|
149
|
+
newKey: OrgConfigProperties;
|
|
150
|
+
deprecated: boolean;
|
|
111
151
|
description: string;
|
|
112
|
-
|
|
152
|
+
encrypted: boolean;
|
|
113
153
|
input: {
|
|
114
154
|
validator: (value: ConfigValue) => boolean;
|
|
115
155
|
failedMessage: string;
|
|
116
156
|
};
|
|
117
|
-
|
|
118
|
-
deprecated?: undefined;
|
|
119
|
-
encrypted?: undefined;
|
|
157
|
+
hidden?: undefined;
|
|
120
158
|
} | {
|
|
121
159
|
key: SfdxPropertyKeys;
|
|
122
|
-
newKey:
|
|
160
|
+
newKey: SfConfigProperties;
|
|
123
161
|
deprecated: boolean;
|
|
124
162
|
description: string;
|
|
125
|
-
input
|
|
163
|
+
input: {
|
|
164
|
+
validator: (value: ConfigValue) => boolean;
|
|
165
|
+
failedMessage: string;
|
|
166
|
+
};
|
|
167
|
+
encrypted?: undefined;
|
|
126
168
|
hidden?: undefined;
|
|
169
|
+
} | {
|
|
170
|
+
key: SfdxPropertyKeys;
|
|
171
|
+
description: string;
|
|
172
|
+
hidden: boolean;
|
|
173
|
+
newKey: string;
|
|
174
|
+
deprecated: boolean;
|
|
175
|
+
input: {
|
|
176
|
+
validator: (value: ConfigValue) => boolean;
|
|
177
|
+
failedMessage: string;
|
|
178
|
+
};
|
|
127
179
|
encrypted?: undefined;
|
|
128
180
|
} | {
|
|
129
181
|
key: SfdxPropertyKeys;
|
|
130
182
|
description: string;
|
|
131
|
-
|
|
183
|
+
hidden: boolean;
|
|
184
|
+
newKey: OrgConfigProperties;
|
|
132
185
|
input: {
|
|
133
186
|
validator: (value: ConfigValue) => boolean;
|
|
134
187
|
failedMessage: string;
|
|
135
188
|
};
|
|
136
|
-
hidden?: undefined;
|
|
137
|
-
newKey?: undefined;
|
|
138
189
|
deprecated?: undefined;
|
|
190
|
+
encrypted?: undefined;
|
|
139
191
|
})[];
|
|
140
192
|
export declare const SfProperty: {
|
|
141
193
|
[index: string]: ConfigPropertyMeta;
|
package/lib/config/config.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Config = exports.SfProperty = exports.SFDX_ALLOWED_PROPERTIES = exports.SfdxPropertyKeys = void 0;
|
|
9
|
+
exports.Config = exports.SfProperty = exports.SFDX_ALLOWED_PROPERTIES = exports.SfdxPropertyKeys = exports.SF_ALLOWED_PROPERTIES = exports.SfConfigProperties = void 0;
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const fs = require("fs");
|
|
12
12
|
const kit_1 = require("@salesforce/kit");
|
|
@@ -40,10 +40,28 @@ const messages = messages_1.Messages.load('@salesforce/core', 'config', [
|
|
|
40
40
|
'maxQueryLimit',
|
|
41
41
|
'restDeploy',
|
|
42
42
|
'instanceUrl',
|
|
43
|
+
'disable-telemetry',
|
|
43
44
|
]);
|
|
44
45
|
const log = logger_1.Logger.childFromRoot('core:config');
|
|
45
46
|
const SFDX_CONFIG_FILE_NAME = 'sfdx-config.json';
|
|
46
47
|
const CONFIG_FILE_NAME = 'config.json';
|
|
48
|
+
var SfConfigProperties;
|
|
49
|
+
(function (SfConfigProperties) {
|
|
50
|
+
/**
|
|
51
|
+
* Disables telemetry reporting
|
|
52
|
+
*/
|
|
53
|
+
SfConfigProperties["DISABLE_TELEMETRY"] = "disable-telemetry";
|
|
54
|
+
})(SfConfigProperties = exports.SfConfigProperties || (exports.SfConfigProperties = {}));
|
|
55
|
+
exports.SF_ALLOWED_PROPERTIES = [
|
|
56
|
+
{
|
|
57
|
+
key: SfConfigProperties.DISABLE_TELEMETRY,
|
|
58
|
+
description: messages.getMessage(SfConfigProperties.DISABLE_TELEMETRY),
|
|
59
|
+
input: {
|
|
60
|
+
validator: (value) => value == null || ['true', 'false'].includes(value.toString()),
|
|
61
|
+
failedMessage: messages.getMessage('invalidBooleanConfigValue'),
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
];
|
|
47
65
|
var SfdxPropertyKeys;
|
|
48
66
|
(function (SfdxPropertyKeys) {
|
|
49
67
|
/**
|
|
@@ -62,37 +80,55 @@ var SfdxPropertyKeys;
|
|
|
62
80
|
SfdxPropertyKeys["DEFAULT_USERNAME"] = "defaultusername";
|
|
63
81
|
/**
|
|
64
82
|
* The sid for the debugger configuration.
|
|
83
|
+
*
|
|
84
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_ISV_DEBUGGER_SID in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
65
85
|
*/
|
|
66
86
|
SfdxPropertyKeys["ISV_DEBUGGER_SID"] = "isvDebuggerSid";
|
|
67
87
|
/**
|
|
68
88
|
* The url for the debugger configuration.
|
|
89
|
+
*
|
|
90
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_ISV_DEBUGGER_URL in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
69
91
|
*/
|
|
70
92
|
SfdxPropertyKeys["ISV_DEBUGGER_URL"] = "isvDebuggerUrl";
|
|
71
93
|
/**
|
|
72
94
|
* The api version
|
|
95
|
+
*
|
|
96
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_API_VERSION in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
73
97
|
*/
|
|
74
98
|
SfdxPropertyKeys["API_VERSION"] = "apiVersion";
|
|
75
99
|
/**
|
|
76
100
|
* Disables telemetry reporting
|
|
101
|
+
*
|
|
102
|
+
* @deprecated Replaced by SfPropertyKeys.DISABLE_TELEMETRY in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
77
103
|
*/
|
|
78
104
|
SfdxPropertyKeys["DISABLE_TELEMETRY"] = "disableTelemetry";
|
|
79
105
|
/**
|
|
80
106
|
* Custom templates repo or local location.
|
|
107
|
+
*
|
|
108
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
81
109
|
*/
|
|
82
110
|
SfdxPropertyKeys["CUSTOM_ORG_METADATA_TEMPLATES"] = "customOrgMetadataTemplates";
|
|
83
111
|
/**
|
|
84
112
|
* allows users to override the 10,000 result query limit
|
|
113
|
+
*
|
|
114
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_MAX_QUERY_LIMIT in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
85
115
|
*/
|
|
86
116
|
SfdxPropertyKeys["MAX_QUERY_LIMIT"] = "maxQueryLimit";
|
|
87
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated
|
|
119
|
+
*/
|
|
88
120
|
SfdxPropertyKeys["REST_DEPLOY"] = "restDeploy";
|
|
89
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated Replaced by OrgConfigProperties.ORG_INSTANCE_URL in v3 {@link https://github.com/forcedotcom/sfdx-core/blob/v3/MIGRATING_V2-V3.md#config}
|
|
123
|
+
*/
|
|
90
124
|
SfdxPropertyKeys["INSTANCE_URL"] = "instanceUrl";
|
|
91
125
|
})(SfdxPropertyKeys = exports.SfdxPropertyKeys || (exports.SfdxPropertyKeys = {}));
|
|
92
126
|
exports.SFDX_ALLOWED_PROPERTIES = [
|
|
93
127
|
{
|
|
94
128
|
key: SfdxPropertyKeys.INSTANCE_URL,
|
|
95
129
|
description: messages.getMessage(SfdxPropertyKeys.INSTANCE_URL),
|
|
130
|
+
newKey: orgConfigProperties_1.OrgConfigProperties.ORG_INSTANCE_URL,
|
|
131
|
+
deprecated: true,
|
|
96
132
|
input: {
|
|
97
133
|
// If a value is provided validate it otherwise no value is unset.
|
|
98
134
|
validator: (value) => {
|
|
@@ -109,6 +145,8 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
109
145
|
},
|
|
110
146
|
{
|
|
111
147
|
key: SfdxPropertyKeys.API_VERSION,
|
|
148
|
+
newKey: orgConfigProperties_1.OrgConfigProperties.ORG_API_VERSION,
|
|
149
|
+
deprecated: true,
|
|
112
150
|
description: messages.getMessage(SfdxPropertyKeys.API_VERSION),
|
|
113
151
|
hidden: true,
|
|
114
152
|
input: {
|
|
@@ -133,6 +171,8 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
133
171
|
},
|
|
134
172
|
{
|
|
135
173
|
key: SfdxPropertyKeys.ISV_DEBUGGER_SID,
|
|
174
|
+
newKey: orgConfigProperties_1.OrgConfigProperties.ORG_ISV_DEBUGGER_SID,
|
|
175
|
+
deprecated: true,
|
|
136
176
|
description: messages.getMessage(SfdxPropertyKeys.ISV_DEBUGGER_SID),
|
|
137
177
|
encrypted: true,
|
|
138
178
|
input: {
|
|
@@ -143,6 +183,8 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
143
183
|
},
|
|
144
184
|
{
|
|
145
185
|
key: SfdxPropertyKeys.ISV_DEBUGGER_URL,
|
|
186
|
+
newKey: orgConfigProperties_1.OrgConfigProperties.ORG_ISV_DEBUGGER_URL,
|
|
187
|
+
deprecated: true,
|
|
146
188
|
description: messages.getMessage(SfdxPropertyKeys.ISV_DEBUGGER_URL),
|
|
147
189
|
input: {
|
|
148
190
|
// If a value is provided validate it otherwise no value is unset.
|
|
@@ -152,17 +194,20 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
152
194
|
},
|
|
153
195
|
{
|
|
154
196
|
key: SfdxPropertyKeys.DISABLE_TELEMETRY,
|
|
197
|
+
newKey: SfConfigProperties.DISABLE_TELEMETRY,
|
|
198
|
+
deprecated: true,
|
|
155
199
|
description: messages.getMessage(SfdxPropertyKeys.DISABLE_TELEMETRY),
|
|
156
200
|
input: {
|
|
157
201
|
validator: (value) => value == null || ['true', 'false'].includes(value.toString()),
|
|
158
202
|
failedMessage: messages.getMessage('invalidBooleanConfigValue'),
|
|
159
203
|
},
|
|
160
204
|
},
|
|
161
|
-
// This should be brought in by a plugin, but there isn't a way to do that right now.
|
|
162
205
|
{
|
|
163
206
|
key: SfdxPropertyKeys.REST_DEPLOY,
|
|
164
207
|
description: messages.getMessage(SfdxPropertyKeys.REST_DEPLOY),
|
|
165
208
|
hidden: true,
|
|
209
|
+
newKey: 'org-metadata-rest-deploy',
|
|
210
|
+
deprecated: true,
|
|
166
211
|
input: {
|
|
167
212
|
validator: (value) => value != null && ['true', 'false'].includes(value.toString()),
|
|
168
213
|
failedMessage: messages.getMessage('invalidBooleanConfigValue'),
|
|
@@ -171,6 +216,8 @@ exports.SFDX_ALLOWED_PROPERTIES = [
|
|
|
171
216
|
{
|
|
172
217
|
key: SfdxPropertyKeys.MAX_QUERY_LIMIT,
|
|
173
218
|
description: messages.getMessage(SfdxPropertyKeys.MAX_QUERY_LIMIT),
|
|
219
|
+
hidden: true,
|
|
220
|
+
newKey: orgConfigProperties_1.OrgConfigProperties.ORG_MAX_QUERY_LIMIT,
|
|
174
221
|
input: {
|
|
175
222
|
// the bit shift will remove the negative bit, and any decimal numbers
|
|
176
223
|
// then the parseFloat will handle converting it to a number from a string
|
|
@@ -420,6 +467,7 @@ class Config extends configFile_1.ConfigFile {
|
|
|
420
467
|
exports.Config = Config;
|
|
421
468
|
Config.allowedProperties = [
|
|
422
469
|
...exports.SFDX_ALLOWED_PROPERTIES,
|
|
470
|
+
...exports.SF_ALLOWED_PROPERTIES,
|
|
423
471
|
...orgConfigProperties_1.ORG_CONFIG_ALLOWED_PROPERTIES,
|
|
424
472
|
];
|
|
425
473
|
class SfdxConfig {
|
package/lib/config/envVars.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare enum EnvironmentVariable {
|
|
|
46
46
|
'SF_TARGET_ORG' = "SF_TARGET_ORG",
|
|
47
47
|
'SF_TARGET_DEV_HUB' = "SF_TARGET_DEV_HUB",
|
|
48
48
|
'SF_ACCESS_TOKEN' = "SF_ACCESS_TOKEN",
|
|
49
|
-
'
|
|
49
|
+
'SF_ORG_API_VERSION' = "SF_ORG_API_VERSION",
|
|
50
50
|
'SF_AUDIENCE_URL' = "SF_AUDIENCE_URL",
|
|
51
51
|
'SF_CODE_COVERAGE_REQUIREMENT' = "SF_CODE_COVERAGE_REQUIREMENT",
|
|
52
52
|
'SF_CONTENT_TYPE' = "SF_CONTENT_TYPE",
|
|
@@ -57,12 +57,12 @@ export declare enum EnvironmentVariable {
|
|
|
57
57
|
'SF_DNS_TIMEOUT' = "SF_DNS_TIMEOUT",
|
|
58
58
|
'SF_DOMAIN_RETRY' = "SF_DOMAIN_RETRY",
|
|
59
59
|
'SF_IMPROVED_CODE_COVERAGE' = "SF_IMPROVED_CODE_COVERAGE",
|
|
60
|
-
'
|
|
60
|
+
'SF_ORG_INSTANCE_URL' = "SF_ORG_INSTANCE_URL",
|
|
61
61
|
'SF_JSON_TO_STDOUT' = "SF_JSON_TO_STDOUT",
|
|
62
62
|
'SF_LOG_LEVEL' = "SF_LOG_LEVEL",
|
|
63
63
|
'SF_LOG_ROTATION_COUNT' = "SF_LOG_ROTATION_COUNT",
|
|
64
64
|
'SF_LOG_ROTATION_PERIOD' = "SF_LOG_ROTATION_PERIOD",
|
|
65
|
-
'
|
|
65
|
+
'SF_ORG_MAX_QUERY_LIMIT' = "SF_ORG_MAX_QUERY_LIMIT",
|
|
66
66
|
'SF_MDAPI_TEMP_DIR' = "SF_MDAPI_TEMP_DIR",
|
|
67
67
|
'SF_NPM_REGISTRY' = "SF_NPM_REGISTRY",
|
|
68
68
|
'SF_PRECOMPILE_ENABLE' = "SF_PRECOMPILE_ENABLE",
|
package/lib/config/envVars.js
CHANGED
|
@@ -60,7 +60,7 @@ var EnvironmentVariable;
|
|
|
60
60
|
EnvironmentVariable["SF_TARGET_ORG"] = "SF_TARGET_ORG";
|
|
61
61
|
EnvironmentVariable["SF_TARGET_DEV_HUB"] = "SF_TARGET_DEV_HUB";
|
|
62
62
|
EnvironmentVariable["SF_ACCESS_TOKEN"] = "SF_ACCESS_TOKEN";
|
|
63
|
-
EnvironmentVariable["
|
|
63
|
+
EnvironmentVariable["SF_ORG_API_VERSION"] = "SF_ORG_API_VERSION";
|
|
64
64
|
EnvironmentVariable["SF_AUDIENCE_URL"] = "SF_AUDIENCE_URL";
|
|
65
65
|
EnvironmentVariable["SF_CODE_COVERAGE_REQUIREMENT"] = "SF_CODE_COVERAGE_REQUIREMENT";
|
|
66
66
|
EnvironmentVariable["SF_CONTENT_TYPE"] = "SF_CONTENT_TYPE";
|
|
@@ -71,12 +71,12 @@ var EnvironmentVariable;
|
|
|
71
71
|
EnvironmentVariable["SF_DNS_TIMEOUT"] = "SF_DNS_TIMEOUT";
|
|
72
72
|
EnvironmentVariable["SF_DOMAIN_RETRY"] = "SF_DOMAIN_RETRY";
|
|
73
73
|
EnvironmentVariable["SF_IMPROVED_CODE_COVERAGE"] = "SF_IMPROVED_CODE_COVERAGE";
|
|
74
|
-
EnvironmentVariable["
|
|
74
|
+
EnvironmentVariable["SF_ORG_INSTANCE_URL"] = "SF_ORG_INSTANCE_URL";
|
|
75
75
|
EnvironmentVariable["SF_JSON_TO_STDOUT"] = "SF_JSON_TO_STDOUT";
|
|
76
76
|
EnvironmentVariable["SF_LOG_LEVEL"] = "SF_LOG_LEVEL";
|
|
77
77
|
EnvironmentVariable["SF_LOG_ROTATION_COUNT"] = "SF_LOG_ROTATION_COUNT";
|
|
78
78
|
EnvironmentVariable["SF_LOG_ROTATION_PERIOD"] = "SF_LOG_ROTATION_PERIOD";
|
|
79
|
-
EnvironmentVariable["
|
|
79
|
+
EnvironmentVariable["SF_ORG_MAX_QUERY_LIMIT"] = "SF_ORG_MAX_QUERY_LIMIT";
|
|
80
80
|
EnvironmentVariable["SF_MDAPI_TEMP_DIR"] = "SF_MDAPI_TEMP_DIR";
|
|
81
81
|
EnvironmentVariable["SF_NPM_REGISTRY"] = "SF_NPM_REGISTRY";
|
|
82
82
|
EnvironmentVariable["SF_PRECOMPILE_ENABLE"] = "SF_PRECOMPILE_ENABLE";
|
|
@@ -128,7 +128,7 @@ exports.SUPPORTED_ENV_VARS = {
|
|
|
128
128
|
},
|
|
129
129
|
[EnvironmentVariable.SFDX_API_VERSION]: {
|
|
130
130
|
description: getMessage(EnvironmentVariable.SFDX_API_VERSION),
|
|
131
|
-
synonymOf: EnvironmentVariable.
|
|
131
|
+
synonymOf: EnvironmentVariable.SF_ORG_API_VERSION,
|
|
132
132
|
},
|
|
133
133
|
[EnvironmentVariable.SFDX_AUDIENCE_URL]: {
|
|
134
134
|
description: getMessage(EnvironmentVariable.SFDX_AUDIENCE_URL),
|
|
@@ -180,7 +180,7 @@ exports.SUPPORTED_ENV_VARS = {
|
|
|
180
180
|
},
|
|
181
181
|
[EnvironmentVariable.SFDX_INSTANCE_URL]: {
|
|
182
182
|
description: getMessage(EnvironmentVariable.SFDX_INSTANCE_URL),
|
|
183
|
-
synonymOf: EnvironmentVariable.
|
|
183
|
+
synonymOf: EnvironmentVariable.SF_ORG_INSTANCE_URL,
|
|
184
184
|
},
|
|
185
185
|
[EnvironmentVariable.SFDX_JSON_TO_STDOUT]: {
|
|
186
186
|
description: getMessage(EnvironmentVariable.SFDX_JSON_TO_STDOUT),
|
|
@@ -200,7 +200,7 @@ exports.SUPPORTED_ENV_VARS = {
|
|
|
200
200
|
},
|
|
201
201
|
[EnvironmentVariable.SFDX_MAX_QUERY_LIMIT]: {
|
|
202
202
|
description: getMessage(EnvironmentVariable.SFDX_MAX_QUERY_LIMIT),
|
|
203
|
-
synonymOf: EnvironmentVariable.
|
|
203
|
+
synonymOf: EnvironmentVariable.SF_ORG_MAX_QUERY_LIMIT,
|
|
204
204
|
},
|
|
205
205
|
[EnvironmentVariable.SFDX_MDAPI_TEMP_DIR]: {
|
|
206
206
|
description: getMessage(EnvironmentVariable.SFDX_MDAPI_TEMP_DIR),
|
|
@@ -271,8 +271,8 @@ exports.SUPPORTED_ENV_VARS = {
|
|
|
271
271
|
description: getMessage(EnvironmentVariable.SF_ACCESS_TOKEN),
|
|
272
272
|
synonymOf: null,
|
|
273
273
|
},
|
|
274
|
-
[EnvironmentVariable.
|
|
275
|
-
description: getMessage(EnvironmentVariable.
|
|
274
|
+
[EnvironmentVariable.SF_ORG_API_VERSION]: {
|
|
275
|
+
description: getMessage(EnvironmentVariable.SF_ORG_API_VERSION),
|
|
276
276
|
synonymOf: null,
|
|
277
277
|
},
|
|
278
278
|
[EnvironmentVariable.SF_AUDIENCE_URL]: {
|
|
@@ -315,8 +315,8 @@ exports.SUPPORTED_ENV_VARS = {
|
|
|
315
315
|
description: getMessage(EnvironmentVariable.SF_IMPROVED_CODE_COVERAGE),
|
|
316
316
|
synonymOf: null,
|
|
317
317
|
},
|
|
318
|
-
[EnvironmentVariable.
|
|
319
|
-
description: getMessage(EnvironmentVariable.
|
|
318
|
+
[EnvironmentVariable.SF_ORG_INSTANCE_URL]: {
|
|
319
|
+
description: getMessage(EnvironmentVariable.SF_ORG_INSTANCE_URL),
|
|
320
320
|
synonymOf: null,
|
|
321
321
|
},
|
|
322
322
|
[EnvironmentVariable.SF_JSON_TO_STDOUT]: {
|
|
@@ -335,8 +335,8 @@ exports.SUPPORTED_ENV_VARS = {
|
|
|
335
335
|
description: getMessage(EnvironmentVariable.SF_LOG_ROTATION_PERIOD),
|
|
336
336
|
synonymOf: null,
|
|
337
337
|
},
|
|
338
|
-
[EnvironmentVariable.
|
|
339
|
-
description: getMessage(EnvironmentVariable.
|
|
338
|
+
[EnvironmentVariable.SF_ORG_MAX_QUERY_LIMIT]: {
|
|
339
|
+
description: getMessage(EnvironmentVariable.SF_ORG_MAX_QUERY_LIMIT),
|
|
340
340
|
synonymOf: null,
|
|
341
341
|
},
|
|
342
342
|
[EnvironmentVariable.SF_MDAPI_TEMP_DIR]: {
|
package/lib/exported.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { BaseConfigStore, ConfigContents, ConfigEntry, ConfigStore, ConfigValue
|
|
|
6
6
|
export { GlobalInfo, SfEntry, SfInfo, SfInfoKeys, SfOrg, SfOrgs, SfToken, SfTokens } from './globalInfo';
|
|
7
7
|
export { DeviceOauthService, DeviceCodeResponse, DeviceCodePollingResponse } from './deviceOauthService';
|
|
8
8
|
export { OrgUsersConfig } from './config/orgUsersConfig';
|
|
9
|
-
export { ConfigPropertyMeta, ConfigPropertyMetaInput, Config, SfdxPropertyKeys, SFDX_ALLOWED_PROPERTIES, } from './config/config';
|
|
9
|
+
export { ConfigPropertyMeta, ConfigPropertyMetaInput, Config, SfdxPropertyKeys, SfConfigProperties, SFDX_ALLOWED_PROPERTIES, SF_ALLOWED_PROPERTIES, } from './config/config';
|
|
10
10
|
export { ConfigInfo, ConfigAggregator } from './config/configAggregator';
|
|
11
11
|
export { AuthFields, AuthInfo, AuthSideEffects, OrgAuthorization } from './org/authInfo';
|
|
12
12
|
export { AuthRemover } from './org/authRemover';
|
package/lib/exported.js
CHANGED
|
@@ -16,8 +16,8 @@ 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.
|
|
20
|
-
exports.scratchOrgLifecycleStages = exports.scratchOrgLifecycleEventName = void 0;
|
|
19
|
+
exports.User = exports.REQUIRED_FIELDS = exports.DefaultUserFields = exports.MyDomainResolver = exports.StreamingClient = exports.CometClient = exports.PollingClient = exports.SfdxError = exports.SfError = exports.SchemaValidator = exports.SchemaPrinter = exports.SfdxProjectJson = exports.SfdxProject = exports.SfProjectJson = exports.SfProject = exports.ORG_CONFIG_ALLOWED_PROPERTIES = exports.OrgConfigProperties = exports.OrgTypes = exports.SandboxEvents = 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.AuthInfo = exports.ConfigAggregator = exports.SF_ALLOWED_PROPERTIES = exports.SFDX_ALLOWED_PROPERTIES = exports.SfConfigProperties = exports.SfdxPropertyKeys = exports.Config = exports.OrgUsersConfig = exports.DeviceOauthService = exports.SfInfoKeys = exports.GlobalInfo = exports.BaseConfigStore = exports.EnvVars = exports.SUPPORTED_ENV_VARS = exports.EnvironmentVariable = exports.envVars = exports.TTLConfig = exports.ConfigFile = void 0;
|
|
20
|
+
exports.scratchOrgLifecycleStages = exports.scratchOrgLifecycleEventName = exports.scratchOrgCreate = exports.PermissionSetAssignment = void 0;
|
|
21
21
|
const messages_1 = require("./messages");
|
|
22
22
|
messages_1.Messages.importMessagesDirectory(__dirname);
|
|
23
23
|
var configFile_1 = require("./config/configFile");
|
|
@@ -41,7 +41,9 @@ Object.defineProperty(exports, "OrgUsersConfig", { enumerable: true, get: functi
|
|
|
41
41
|
var config_1 = require("./config/config");
|
|
42
42
|
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
|
|
43
43
|
Object.defineProperty(exports, "SfdxPropertyKeys", { enumerable: true, get: function () { return config_1.SfdxPropertyKeys; } });
|
|
44
|
+
Object.defineProperty(exports, "SfConfigProperties", { enumerable: true, get: function () { return config_1.SfConfigProperties; } });
|
|
44
45
|
Object.defineProperty(exports, "SFDX_ALLOWED_PROPERTIES", { enumerable: true, get: function () { return config_1.SFDX_ALLOWED_PROPERTIES; } });
|
|
46
|
+
Object.defineProperty(exports, "SF_ALLOWED_PROPERTIES", { enumerable: true, get: function () { return config_1.SF_ALLOWED_PROPERTIES; } });
|
|
45
47
|
var configAggregator_1 = require("./config/configAggregator");
|
|
46
48
|
Object.defineProperty(exports, "ConfigAggregator", { enumerable: true, get: function () { return configAggregator_1.ConfigAggregator; } });
|
|
47
49
|
var authInfo_1 = require("./org/authInfo");
|
package/lib/org/authInfo.d.ts
CHANGED
|
@@ -171,6 +171,19 @@ export declare class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
|
|
|
171
171
|
* @param sfdxAuthUrl
|
|
172
172
|
*/
|
|
173
173
|
static parseSfdxAuthUrl(sfdxAuthUrl: string): Pick<AuthFields, 'clientId' | 'clientSecret' | 'refreshToken' | 'loginUrl'>;
|
|
174
|
+
/**
|
|
175
|
+
* Given a set of decrypted fields and an authInfo, determine if the org belongs to an available
|
|
176
|
+
* dev hub.
|
|
177
|
+
*
|
|
178
|
+
* @param fields
|
|
179
|
+
* @param orgAuthInfo
|
|
180
|
+
*/
|
|
181
|
+
static identifyPossibleScratchOrgs(fields: AuthFields, orgAuthInfo: AuthInfo): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Find all dev hubs available in the local environment.
|
|
184
|
+
*/
|
|
185
|
+
static getDevHubAuthInfos(): Promise<OrgAuthorization[]>;
|
|
186
|
+
private static queryScratchOrg;
|
|
174
187
|
/**
|
|
175
188
|
* Get the username.
|
|
176
189
|
*/
|
package/lib/org/authInfo.js
CHANGED
|
@@ -26,6 +26,7 @@ const messages_1 = require("../messages");
|
|
|
26
26
|
const sfdcUrl_1 = require("../util/sfdcUrl");
|
|
27
27
|
const connection_1 = require("./connection");
|
|
28
28
|
const orgConfigProperties_1 = require("./orgConfigProperties");
|
|
29
|
+
const org_1 = require("./org");
|
|
29
30
|
messages_1.Messages.importMessagesDirectory(__dirname);
|
|
30
31
|
const messages = messages_1.Messages.load('@salesforce/core', 'core', [
|
|
31
32
|
'authInfoCreationError',
|
|
@@ -246,6 +247,61 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
|
|
|
246
247
|
loginUrl: `https://${loginUrl}`,
|
|
247
248
|
};
|
|
248
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Given a set of decrypted fields and an authInfo, determine if the org belongs to an available
|
|
252
|
+
* dev hub.
|
|
253
|
+
*
|
|
254
|
+
* @param fields
|
|
255
|
+
* @param orgAuthInfo
|
|
256
|
+
*/
|
|
257
|
+
static async identifyPossibleScratchOrgs(fields, orgAuthInfo) {
|
|
258
|
+
// fields property is passed in because the consumers of this method have performed the decrypt.
|
|
259
|
+
// This is so we don't have to call authInfo.getFields(true) and decrypt again OR accidentally save an
|
|
260
|
+
// authInfo before it is necessary.
|
|
261
|
+
const logger = await logger_1.Logger.child('Common', { tag: 'identifyPossibleScratchOrgs' });
|
|
262
|
+
// return if we already know the hub org we know it is a devhub or prod-like or no orgId present
|
|
263
|
+
if (fields.isDevHub || fields.devHubUsername || !fields.orgId)
|
|
264
|
+
return;
|
|
265
|
+
logger.debug('getting devHubs');
|
|
266
|
+
// TODO: return if url is not sandbox-like to avoid constantly asking about production orgs
|
|
267
|
+
// TODO: someday we make this easier by asking the org if it is a scratch org
|
|
268
|
+
const hubAuthInfos = await AuthInfo.getDevHubAuthInfos();
|
|
269
|
+
logger.debug(`found ${hubAuthInfos.length} DevHubs`);
|
|
270
|
+
if (hubAuthInfos.length === 0)
|
|
271
|
+
return;
|
|
272
|
+
// ask all those orgs if they know this orgId
|
|
273
|
+
await Promise.all(hubAuthInfos.map(async (hubAuthInfo) => {
|
|
274
|
+
try {
|
|
275
|
+
const data = await AuthInfo.queryScratchOrg(hubAuthInfo.username, fields.orgId);
|
|
276
|
+
if (data.totalSize > 0) {
|
|
277
|
+
// if any return a result
|
|
278
|
+
logger.debug(`found orgId ${fields.orgId} in devhub ${hubAuthInfo.username}`);
|
|
279
|
+
try {
|
|
280
|
+
await orgAuthInfo.save({ ...fields, devHubUsername: hubAuthInfo.username });
|
|
281
|
+
logger.debug(`set ${hubAuthInfo.username} as devhub for scratch org ${orgAuthInfo.getUsername()}`);
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
logger.debug(`error updating auth file for ${orgAuthInfo.getUsername()}`, error);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
logger.error(`Error connecting to devhub ${hubAuthInfo.username}`, error);
|
|
290
|
+
}
|
|
291
|
+
}));
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Find all dev hubs available in the local environment.
|
|
295
|
+
*/
|
|
296
|
+
static async getDevHubAuthInfos() {
|
|
297
|
+
return (await AuthInfo.listAllAuthorizations()).filter((possibleHub) => possibleHub === null || possibleHub === void 0 ? void 0 : possibleHub.isDevHub);
|
|
298
|
+
}
|
|
299
|
+
static async queryScratchOrg(devHubUsername, scratchOrgId) {
|
|
300
|
+
const devHubOrg = await org_1.Org.create({ aliasOrUsername: devHubUsername });
|
|
301
|
+
const conn = devHubOrg.getConnection();
|
|
302
|
+
const data = await conn.query(`select Id from ScratchOrgInfo where ScratchOrg = '${sfdc_1.sfdc.trimTo15(scratchOrgId)}'`);
|
|
303
|
+
return data;
|
|
304
|
+
}
|
|
249
305
|
/**
|
|
250
306
|
* Get the username.
|
|
251
307
|
*/
|
|
@@ -1,8 +1,69 @@
|
|
|
1
|
+
import { ConfigValue } from '../config/configStore';
|
|
1
2
|
export declare enum OrgConfigProperties {
|
|
3
|
+
/**
|
|
4
|
+
* Username associate with the default org.
|
|
5
|
+
*/
|
|
2
6
|
TARGET_ORG = "target-org",
|
|
3
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Username associated with the default dev hub org.
|
|
9
|
+
*/
|
|
10
|
+
TARGET_DEV_HUB = "target-dev-hub",
|
|
11
|
+
/**
|
|
12
|
+
* The api version
|
|
13
|
+
*/
|
|
14
|
+
ORG_API_VERSION = "org-api-version",
|
|
15
|
+
/**
|
|
16
|
+
* Custom templates repo or local location.
|
|
17
|
+
*/
|
|
18
|
+
ORG_CUSTOM_METADATA_TEMPLATES = "org-custom-metadata-templates",
|
|
19
|
+
/**
|
|
20
|
+
* Allows users to override the 10,000 result query limit.
|
|
21
|
+
*/
|
|
22
|
+
ORG_MAX_QUERY_LIMIT = "org-max-query-limit",
|
|
23
|
+
/**
|
|
24
|
+
* The instance url of the org.
|
|
25
|
+
*/
|
|
26
|
+
ORG_INSTANCE_URL = "org-instance-url",
|
|
27
|
+
/**
|
|
28
|
+
* The sid for the debugger configuration.
|
|
29
|
+
*/
|
|
30
|
+
ORG_ISV_DEBUGGER_SID = "org-isv-debugger-sid",
|
|
31
|
+
/**
|
|
32
|
+
* The url for the debugger configuration.
|
|
33
|
+
*/
|
|
34
|
+
ORG_ISV_DEBUGGER_URL = "org-isv-debugger-url"
|
|
4
35
|
}
|
|
5
|
-
export declare const ORG_CONFIG_ALLOWED_PROPERTIES: {
|
|
36
|
+
export declare const ORG_CONFIG_ALLOWED_PROPERTIES: ({
|
|
6
37
|
key: OrgConfigProperties;
|
|
7
38
|
description: string;
|
|
8
|
-
|
|
39
|
+
input?: undefined;
|
|
40
|
+
hidden?: undefined;
|
|
41
|
+
encrypted?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
key: OrgConfigProperties;
|
|
44
|
+
description: string;
|
|
45
|
+
input: {
|
|
46
|
+
validator: (value: ConfigValue) => boolean;
|
|
47
|
+
failedMessage: string;
|
|
48
|
+
};
|
|
49
|
+
hidden?: undefined;
|
|
50
|
+
encrypted?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
key: OrgConfigProperties;
|
|
53
|
+
description: string;
|
|
54
|
+
hidden: boolean;
|
|
55
|
+
input: {
|
|
56
|
+
validator: (value: ConfigValue) => boolean;
|
|
57
|
+
failedMessage: string;
|
|
58
|
+
};
|
|
59
|
+
encrypted?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
key: OrgConfigProperties;
|
|
62
|
+
description: string;
|
|
63
|
+
encrypted: boolean;
|
|
64
|
+
input: {
|
|
65
|
+
validator: (value: ConfigValue) => boolean;
|
|
66
|
+
failedMessage: string;
|
|
67
|
+
};
|
|
68
|
+
hidden?: undefined;
|
|
69
|
+
})[];
|
|
@@ -8,22 +8,125 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ORG_CONFIG_ALLOWED_PROPERTIES = exports.OrgConfigProperties = void 0;
|
|
10
10
|
const path_1 = require("path");
|
|
11
|
+
const ts_types_1 = require("@salesforce/ts-types");
|
|
11
12
|
const messages_1 = require("../messages");
|
|
13
|
+
const sfdcUrl_1 = require("../util/sfdcUrl");
|
|
14
|
+
const sfdc_1 = require("../util/sfdc");
|
|
12
15
|
messages_1.Messages.importMessagesDirectory((0, path_1.join)(__dirname));
|
|
13
|
-
const messages = messages_1.Messages.load('@salesforce/core', 'config', [
|
|
16
|
+
const messages = messages_1.Messages.load('@salesforce/core', 'config', [
|
|
17
|
+
'invalidApiVersion',
|
|
18
|
+
'invalidBooleanConfigValue',
|
|
19
|
+
'invalidInstanceUrl',
|
|
20
|
+
'invalidIsvDebuggerSid',
|
|
21
|
+
'invalidIsvDebuggerUrl',
|
|
22
|
+
'invalidNumberConfigValue',
|
|
23
|
+
'org-api-version',
|
|
24
|
+
'org-instance-url',
|
|
25
|
+
'org-isv-debugger-sid',
|
|
26
|
+
'org-isv-debugger-url',
|
|
27
|
+
'org-max-query-limit',
|
|
28
|
+
'target-dev-hub',
|
|
29
|
+
'target-org',
|
|
30
|
+
]);
|
|
14
31
|
var OrgConfigProperties;
|
|
15
32
|
(function (OrgConfigProperties) {
|
|
33
|
+
/**
|
|
34
|
+
* Username associate with the default org.
|
|
35
|
+
*/
|
|
16
36
|
OrgConfigProperties["TARGET_ORG"] = "target-org";
|
|
37
|
+
/**
|
|
38
|
+
* Username associated with the default dev hub org.
|
|
39
|
+
*/
|
|
17
40
|
OrgConfigProperties["TARGET_DEV_HUB"] = "target-dev-hub";
|
|
41
|
+
/**
|
|
42
|
+
* The api version
|
|
43
|
+
*/
|
|
44
|
+
OrgConfigProperties["ORG_API_VERSION"] = "org-api-version";
|
|
45
|
+
/**
|
|
46
|
+
* Custom templates repo or local location.
|
|
47
|
+
*/
|
|
48
|
+
OrgConfigProperties["ORG_CUSTOM_METADATA_TEMPLATES"] = "org-custom-metadata-templates";
|
|
49
|
+
/**
|
|
50
|
+
* Allows users to override the 10,000 result query limit.
|
|
51
|
+
*/
|
|
52
|
+
OrgConfigProperties["ORG_MAX_QUERY_LIMIT"] = "org-max-query-limit";
|
|
53
|
+
/**
|
|
54
|
+
* The instance url of the org.
|
|
55
|
+
*/
|
|
56
|
+
OrgConfigProperties["ORG_INSTANCE_URL"] = "org-instance-url";
|
|
57
|
+
/**
|
|
58
|
+
* The sid for the debugger configuration.
|
|
59
|
+
*/
|
|
60
|
+
OrgConfigProperties["ORG_ISV_DEBUGGER_SID"] = "org-isv-debugger-sid";
|
|
61
|
+
/**
|
|
62
|
+
* The url for the debugger configuration.
|
|
63
|
+
*/
|
|
64
|
+
OrgConfigProperties["ORG_ISV_DEBUGGER_URL"] = "org-isv-debugger-url";
|
|
18
65
|
})(OrgConfigProperties = exports.OrgConfigProperties || (exports.OrgConfigProperties = {}));
|
|
19
66
|
exports.ORG_CONFIG_ALLOWED_PROPERTIES = [
|
|
20
67
|
{
|
|
21
68
|
key: OrgConfigProperties.TARGET_ORG,
|
|
22
|
-
description: messages.getMessage(
|
|
69
|
+
description: messages.getMessage(OrgConfigProperties.TARGET_ORG),
|
|
23
70
|
},
|
|
24
71
|
{
|
|
25
72
|
key: OrgConfigProperties.TARGET_DEV_HUB,
|
|
26
|
-
description: messages.getMessage(
|
|
73
|
+
description: messages.getMessage(OrgConfigProperties.TARGET_DEV_HUB),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: OrgConfigProperties.ORG_INSTANCE_URL,
|
|
77
|
+
description: messages.getMessage(OrgConfigProperties.ORG_INSTANCE_URL),
|
|
78
|
+
input: {
|
|
79
|
+
// If a value is provided validate it otherwise no value is unset.
|
|
80
|
+
validator: (value) => {
|
|
81
|
+
if (value == null)
|
|
82
|
+
return true;
|
|
83
|
+
// validate if the value is a string and is a valid url and is either a salesforce domain
|
|
84
|
+
// or an internal url.
|
|
85
|
+
return ((0, ts_types_1.isString)(value) &&
|
|
86
|
+
sfdcUrl_1.SfdcUrl.isValidUrl(value) &&
|
|
87
|
+
(new sfdcUrl_1.SfdcUrl(value).isSalesforceDomain() || new sfdcUrl_1.SfdcUrl(value).isInternalUrl()));
|
|
88
|
+
},
|
|
89
|
+
failedMessage: messages.getMessage('invalidInstanceUrl'),
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: OrgConfigProperties.ORG_API_VERSION,
|
|
94
|
+
description: messages.getMessage(OrgConfigProperties.ORG_API_VERSION),
|
|
95
|
+
hidden: true,
|
|
96
|
+
input: {
|
|
97
|
+
// If a value is provided validate it otherwise no value is unset.
|
|
98
|
+
validator: (value) => value == null || ((0, ts_types_1.isString)(value) && sfdc_1.sfdc.validateApiVersion(value)),
|
|
99
|
+
failedMessage: messages.getMessage('invalidApiVersion'),
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: OrgConfigProperties.ORG_ISV_DEBUGGER_SID,
|
|
104
|
+
description: messages.getMessage(OrgConfigProperties.ORG_ISV_DEBUGGER_SID),
|
|
105
|
+
encrypted: true,
|
|
106
|
+
input: {
|
|
107
|
+
// If a value is provided validate it otherwise no value is unset.
|
|
108
|
+
validator: (value) => value == null || (0, ts_types_1.isString)(value),
|
|
109
|
+
failedMessage: messages.getMessage('invalidIsvDebuggerSid'),
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: OrgConfigProperties.ORG_ISV_DEBUGGER_URL,
|
|
114
|
+
description: messages.getMessage(OrgConfigProperties.ORG_ISV_DEBUGGER_URL),
|
|
115
|
+
input: {
|
|
116
|
+
// If a value is provided validate it otherwise no value is unset.
|
|
117
|
+
validator: (value) => value == null || (0, ts_types_1.isString)(value),
|
|
118
|
+
failedMessage: messages.getMessage('invalidIsvDebuggerUrl'),
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
key: OrgConfigProperties.ORG_MAX_QUERY_LIMIT,
|
|
123
|
+
description: messages.getMessage(OrgConfigProperties.ORG_MAX_QUERY_LIMIT),
|
|
124
|
+
input: {
|
|
125
|
+
// the bit shift will remove the negative bit, and any decimal numbers
|
|
126
|
+
// then the parseFloat will handle converting it to a number from a string
|
|
127
|
+
validator: (value) => value >>> 0 === parseFloat(value) && value > 0,
|
|
128
|
+
failedMessage: messages.getMessage('invalidNumberConfigValue'),
|
|
129
|
+
},
|
|
27
130
|
},
|
|
28
131
|
];
|
|
29
132
|
//# sourceMappingURL=orgConfigProperties.js.map
|
package/lib/testSetup.js
CHANGED
|
@@ -480,8 +480,8 @@ class MockTestOrgData {
|
|
|
480
480
|
this.userId = `user_id_${this.testId}`;
|
|
481
481
|
this.orgId = `${this.testId}`;
|
|
482
482
|
this.username = (options === null || options === void 0 ? void 0 : options.username) || `admin_${this.testId}@gb.org`;
|
|
483
|
-
this.loginUrl = `
|
|
484
|
-
this.instanceUrl = `
|
|
483
|
+
this.loginUrl = `https://login.${this.testId}.salesforce.com`;
|
|
484
|
+
this.instanceUrl = `https://instance.${this.testId}.salesforce.com`;
|
|
485
485
|
this.clientId = `${this.testId}/client_id`;
|
|
486
486
|
this.clientSecret = `${this.testId}/client_secret`;
|
|
487
487
|
this.authcode = `${this.testId}/authcode`;
|
package/messages/config.md
CHANGED
|
@@ -75,11 +75,11 @@ In sfdx-project.json, indicate only one package directory (path) as the default.
|
|
|
75
75
|
|
|
76
76
|
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.
|
|
77
77
|
|
|
78
|
-
#
|
|
78
|
+
# target-org
|
|
79
79
|
|
|
80
80
|
Username or alias of the org that all commands run against by default. (sf only)
|
|
81
81
|
|
|
82
|
-
#
|
|
82
|
+
# target-dev-hub
|
|
83
83
|
|
|
84
84
|
Username or alias of your default Dev Hub org. (sf only)
|
|
85
85
|
|
|
@@ -93,28 +93,52 @@ Username or alias of your default Dev Hub org. (sfdx only)
|
|
|
93
93
|
|
|
94
94
|
# isvDebuggerSid
|
|
95
95
|
|
|
96
|
-
ISV debugger SID
|
|
96
|
+
ISV debugger SID (sfdx only)
|
|
97
97
|
|
|
98
98
|
# isvDebuggerUrl
|
|
99
99
|
|
|
100
|
-
ISV debugger URL
|
|
100
|
+
ISV debugger URL (sfdx only)
|
|
101
|
+
|
|
102
|
+
# org-isv-debugger-sid
|
|
103
|
+
|
|
104
|
+
ISV debugger SID.
|
|
105
|
+
|
|
106
|
+
# org-isv-debugger-url
|
|
107
|
+
|
|
108
|
+
ISV debugger URL.
|
|
101
109
|
|
|
102
110
|
# apiVersion
|
|
103
111
|
|
|
112
|
+
API version of your project. Default: API version of your Dev Hub org. (sfdx only)
|
|
113
|
+
|
|
114
|
+
# org-api-version
|
|
115
|
+
|
|
104
116
|
API version of your project. Default: API version of your Dev Hub org.
|
|
105
117
|
|
|
106
118
|
# disableTelemetry
|
|
107
119
|
|
|
108
|
-
Disables the collection of usage and user environment information, etc. Default:
|
|
120
|
+
Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)
|
|
121
|
+
|
|
122
|
+
# disable-telemetry
|
|
123
|
+
|
|
124
|
+
Disables the collection of usage and user environment information, etc. Default: false.
|
|
109
125
|
|
|
110
126
|
# maxQueryLimit
|
|
111
127
|
|
|
128
|
+
Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)
|
|
129
|
+
|
|
130
|
+
# org-max-query-limit
|
|
131
|
+
|
|
112
132
|
Maximum number of Salesforce records returned by a CLI command. Default: 10,000.
|
|
113
133
|
|
|
114
134
|
# restDeploy
|
|
115
135
|
|
|
116
|
-
Whether deployments use the Metadata REST API (true) or SOAP API (false, default value).
|
|
136
|
+
Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)
|
|
117
137
|
|
|
118
138
|
# instanceUrl
|
|
119
139
|
|
|
140
|
+
URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)
|
|
141
|
+
|
|
142
|
+
# org-instance-url
|
|
143
|
+
|
|
120
144
|
URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com.
|
package/messages/envVars.md
CHANGED
|
@@ -174,7 +174,7 @@ Username or alias of your default Dev Hub org. Overrides the target-dev-hub conf
|
|
|
174
174
|
|
|
175
175
|
Specifies an access token when using a login command that uses access tokens.
|
|
176
176
|
|
|
177
|
-
#
|
|
177
|
+
# sfOrgApiVersion
|
|
178
178
|
|
|
179
179
|
API version for a specific project or all projects. Default value is the API version of your Dev Hub. Overrides the apiVersion configuration variable.
|
|
180
180
|
|
|
@@ -218,7 +218,7 @@ Time, in seconds, that Salesforce CLI waits for the Lightning Experience custom
|
|
|
218
218
|
|
|
219
219
|
Set to true to scope Apex test results to the classes entered during a test run when running the Apex test commands.
|
|
220
220
|
|
|
221
|
-
#
|
|
221
|
+
# sfOrgInstanceUrl
|
|
222
222
|
|
|
223
223
|
URL of the Salesforce instance that is hosting your org. Default value is https://login.salesforce.com. Overrides the instanceUrl configuration variable.
|
|
224
224
|
|
|
@@ -238,7 +238,7 @@ The default rotation period for logs. Example '1d' will rotate logs daily (at mi
|
|
|
238
238
|
|
|
239
239
|
The number of backup rotated log files to keep. Example: '3' will have the base sf.log file, and the past 3 (period) log files.
|
|
240
240
|
|
|
241
|
-
#
|
|
241
|
+
# sfOrgMaxQueryLimit
|
|
242
242
|
|
|
243
243
|
Maximum number of Salesforce records returned by a CLI command. Default value is 10,000. Overrides the maxQueryLimit configuration variable.
|
|
244
244
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"!lib/**/*.map"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@oclif/core": "^1.5.1",
|
|
38
37
|
"@salesforce/bunyan": "^2.0.0",
|
|
39
38
|
"@salesforce/kit": "^1.5.34",
|
|
40
39
|
"@salesforce/schemas": "^1.1.0",
|