@salesforce/core 3.23.9 → 3.24.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 +24 -0
- package/lib/org/org.d.ts +4 -3
- package/lib/org/org.js +10 -10
- package/lib/org/scratchOrgCreate.d.ts +1 -1
- package/lib/org/scratchOrgCreate.js +0 -5
- package/lib/org/scratchOrgErrorCodes.js +7 -3
- package/messages/scratchOrgCreate.md +0 -20
- package/messages/scratchOrgErrorCodes.md +16 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
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.24.2](https://github.com/forcedotcom/sfdx-core/compare/v3.24.1...v3.24.2) (2022-07-26)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- use correct field for clone requests ([#623](https://github.com/forcedotcom/sfdx-core/issues/623)) ([2372f03](https://github.com/forcedotcom/sfdx-core/commit/2372f0364b87a7ac498c8d7ef637a9b5fdc725ea))
|
|
10
|
+
|
|
11
|
+
### [3.24.1](https://github.com/forcedotcom/sfdx-core/compare/v3.24.0...v3.24.1) (2022-07-21)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- bump jsforce ([#622](https://github.com/forcedotcom/sfdx-core/issues/622)) ([c7b53b7](https://github.com/forcedotcom/sfdx-core/commit/c7b53b73977012f81e029a15f39c3fb35bc1041d))
|
|
16
|
+
|
|
17
|
+
## [3.24.0](https://github.com/forcedotcom/sfdx-core/compare/v3.23.9...v3.24.0) (2022-07-14)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
- org.scratchOrgCreate uses all options except hub ([045a7aa](https://github.com/forcedotcom/sfdx-core/commit/045a7aa56c97323aa8b3191c4879cd1b43f0cfb1))
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
- align messages/files ([5a5f04d](https://github.com/forcedotcom/sfdx-core/commit/5a5f04d3ea8ffb30fdbbfe2c83824ec56a56ec34))
|
|
26
|
+
- load messages by name ([7c3a2d9](https://github.com/forcedotcom/sfdx-core/commit/7c3a2d9d84f9553bb9cf1bc369b49ca46100484e))
|
|
27
|
+
- use named messages always ([2bb25a9](https://github.com/forcedotcom/sfdx-core/commit/2bb25a9c24fcb7146e363783ea81bc3708060a18))
|
|
28
|
+
|
|
5
29
|
### [3.23.9](https://github.com/forcedotcom/sfdx-core/compare/v3.23.8...v3.23.9) (2022-07-14)
|
|
6
30
|
|
|
7
31
|
### [3.23.8](https://github.com/forcedotcom/sfdx-core/compare/v3.23.7...v3.23.8) (2022-07-13)
|
package/lib/org/org.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export declare type SandboxProcessObject = {
|
|
|
61
61
|
export declare type SandboxRequest = {
|
|
62
62
|
SandboxName: string;
|
|
63
63
|
LicenseType?: string;
|
|
64
|
+
/** Should match a SandboxInfoId, not a SandboxProcessId */
|
|
64
65
|
SourceId?: string;
|
|
65
66
|
Description?: string;
|
|
66
67
|
};
|
|
@@ -68,7 +69,7 @@ export declare type ResumeSandboxRequest = {
|
|
|
68
69
|
SandboxName?: string;
|
|
69
70
|
SandboxProcessObjId?: string;
|
|
70
71
|
};
|
|
71
|
-
export declare type ScratchOrgRequest =
|
|
72
|
+
export declare type ScratchOrgRequest = Omit<ScratchOrgCreateOptions, 'hubOrg'>;
|
|
72
73
|
export declare type SandboxFields = {
|
|
73
74
|
sandboxOrgId: string;
|
|
74
75
|
prodOrgUsername: string;
|
|
@@ -129,11 +130,11 @@ export declare class Org extends AsyncOptionalCreatable<Org.Options> {
|
|
|
129
130
|
/**
|
|
130
131
|
*
|
|
131
132
|
* @param sandboxReq SandboxRequest options to create the sandbox with
|
|
132
|
-
* @param
|
|
133
|
+
* @param sourceSandboxName the name of the sandbox that your new sandbox will be based on
|
|
133
134
|
* @param options Wait: The amount of time to wait before timing out, defaults to 0, Interval: The time interval between polling defaults to 30 seconds
|
|
134
135
|
* @returns {SandboxProcessObject} the newly created sandbox process object
|
|
135
136
|
*/
|
|
136
|
-
cloneSandbox(sandboxReq: SandboxRequest,
|
|
137
|
+
cloneSandbox(sandboxReq: SandboxRequest, sourceSandboxName: string, options: {
|
|
137
138
|
wait?: Duration;
|
|
138
139
|
interval?: Duration;
|
|
139
140
|
}): Promise<SandboxProcessObject>;
|
package/lib/org/org.js
CHANGED
|
@@ -129,12 +129,12 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
129
129
|
/**
|
|
130
130
|
*
|
|
131
131
|
* @param sandboxReq SandboxRequest options to create the sandbox with
|
|
132
|
-
* @param
|
|
132
|
+
* @param sourceSandboxName the name of the sandbox that your new sandbox will be based on
|
|
133
133
|
* @param options Wait: The amount of time to wait before timing out, defaults to 0, Interval: The time interval between polling defaults to 30 seconds
|
|
134
134
|
* @returns {SandboxProcessObject} the newly created sandbox process object
|
|
135
135
|
*/
|
|
136
|
-
async cloneSandbox(sandboxReq,
|
|
137
|
-
sandboxReq.SourceId = (await this.querySandboxProcessBySandboxName(
|
|
136
|
+
async cloneSandbox(sandboxReq, sourceSandboxName, options) {
|
|
137
|
+
sandboxReq.SourceId = (await this.querySandboxProcessBySandboxName(sourceSandboxName)).SandboxInfoId;
|
|
138
138
|
this.logger.debug('Clone sandbox sourceId %s', sandboxReq.SourceId);
|
|
139
139
|
return this.createSandbox(sandboxReq, options);
|
|
140
140
|
}
|
|
@@ -242,7 +242,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
242
242
|
* @ignore
|
|
243
243
|
*/
|
|
244
244
|
async retrieveOrgUsersConfig() {
|
|
245
|
-
return
|
|
245
|
+
return orgUsersConfig_1.OrgUsersConfig.create(orgUsersConfig_1.OrgUsersConfig.getOptions(this.getOrgId()));
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
248
248
|
* Cleans up all org related artifacts including users, sandbox config(if a sandbox and auth file.
|
|
@@ -269,7 +269,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
269
269
|
*
|
|
270
270
|
*/
|
|
271
271
|
async isSandbox() {
|
|
272
|
-
return
|
|
272
|
+
return (await stateAggregator_1.StateAggregator.getInstance()).sandboxes.hasFile(this.getOrgId());
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
275
|
* Check that this org is a scratch org by asking the dev hub if it knows about it.
|
|
@@ -636,7 +636,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
636
636
|
* results in a warning.
|
|
637
637
|
*/
|
|
638
638
|
async retrieveMaxApiVersion() {
|
|
639
|
-
return
|
|
639
|
+
return this.getConnection().retrieveMaxApiVersion();
|
|
640
640
|
}
|
|
641
641
|
/**
|
|
642
642
|
* Returns the admin username used to create the org.
|
|
@@ -707,7 +707,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
707
707
|
* @private
|
|
708
708
|
*/
|
|
709
709
|
async querySandboxProcessBySandboxName(name) {
|
|
710
|
-
return
|
|
710
|
+
return this.querySandboxProcess(`SandboxName='${name}'`);
|
|
711
711
|
}
|
|
712
712
|
/**
|
|
713
713
|
* query SandboxProcess via SandboxInfoId
|
|
@@ -716,7 +716,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
716
716
|
* @private
|
|
717
717
|
*/
|
|
718
718
|
async querySandboxProcessBySandboxInfoId(id) {
|
|
719
|
-
return
|
|
719
|
+
return this.querySandboxProcess(`SandboxInfoId='${id}'`);
|
|
720
720
|
}
|
|
721
721
|
/**
|
|
722
722
|
* query SandboxProcess via Id
|
|
@@ -725,7 +725,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
725
725
|
* @private
|
|
726
726
|
*/
|
|
727
727
|
async querySandboxProcessById(id) {
|
|
728
|
-
return
|
|
728
|
+
return this.querySandboxProcess(`Id='${id}'`);
|
|
729
729
|
}
|
|
730
730
|
/**
|
|
731
731
|
* Initialize async components.
|
|
@@ -1098,7 +1098,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
1098
1098
|
*/
|
|
1099
1099
|
async querySandboxProcess(where) {
|
|
1100
1100
|
const queryStr = `SELECT Id, Status, SandboxName, SandboxInfoId, LicenseType, CreatedDate, CopyProgress, SandboxOrganization, SourceId, Description, EndDate FROM SandboxProcess WHERE ${where} AND Status != 'D'`;
|
|
1101
|
-
return
|
|
1101
|
+
return this.connection.singleRecordQuery(queryStr, {
|
|
1102
1102
|
tooling: true,
|
|
1103
1103
|
});
|
|
1104
1104
|
}
|
|
@@ -47,7 +47,7 @@ export interface ScratchOrgCreateOptions {
|
|
|
47
47
|
alias?: string;
|
|
48
48
|
/** after complete, set the org as the default */
|
|
49
49
|
setDefault?: boolean;
|
|
50
|
-
/** do not use source tracking for this org */
|
|
50
|
+
/** if false, do not use source tracking for this scratch org */
|
|
51
51
|
tracksSource?: boolean;
|
|
52
52
|
}
|
|
53
53
|
export declare const scratchOrgResume: (jobId: string) => Promise<ScratchOrgCreateResult>;
|
|
@@ -27,13 +27,8 @@ const messages = messages_1.Messages.load('@salesforce/core', 'scratchOrgCreate'
|
|
|
27
27
|
'DurationDaysValidationMaxError',
|
|
28
28
|
'DurationDaysValidationMinError',
|
|
29
29
|
'RetryNotIntError',
|
|
30
|
-
'WaitValidationMaxError',
|
|
31
30
|
'DurationDaysNotIntError',
|
|
32
|
-
'NoScratchOrgInfoError',
|
|
33
|
-
'ScratchOrgDeletedError',
|
|
34
|
-
'StillInProgressError',
|
|
35
31
|
'CacheMissError',
|
|
36
|
-
'action.StillInProgress',
|
|
37
32
|
]);
|
|
38
33
|
exports.DEFAULT_STREAM_TIMEOUT_MINUTES = 6;
|
|
39
34
|
const validateDuration = (durationDays) => {
|
|
@@ -20,6 +20,10 @@ const namedMessages = messages_1.Messages.load('@salesforce/core', 'scratchOrgEr
|
|
|
20
20
|
'SignupFailedUnknownError',
|
|
21
21
|
'SignupFailedError',
|
|
22
22
|
'SignupUnexpectedError',
|
|
23
|
+
'StillInProgressError',
|
|
24
|
+
'action.StillInProgress',
|
|
25
|
+
'ScratchOrgDeletedError',
|
|
26
|
+
'NoScratchOrgInfoError',
|
|
23
27
|
]);
|
|
24
28
|
// getMessage will throw when the code isn't found
|
|
25
29
|
// and we don't know whether a given code takes arguments or not
|
|
@@ -43,12 +47,12 @@ const validateScratchOrgInfoForResume = async ({ jobId, scratchOrgInfo, cache, h
|
|
|
43
47
|
cache.unset(jobId);
|
|
44
48
|
await cache.write();
|
|
45
49
|
throw scratchOrgInfo.Status === 'Deleted'
|
|
46
|
-
?
|
|
47
|
-
:
|
|
50
|
+
? namedMessages.createError('ScratchOrgDeletedError')
|
|
51
|
+
: namedMessages.createError('NoScratchOrgInfoError');
|
|
48
52
|
}
|
|
49
53
|
if (['New', 'Creating'].includes(scratchOrgInfo.Status)) {
|
|
50
54
|
// 2. scratchOrgInfo exists, still isn't finished. Stays in cache for future attempts
|
|
51
|
-
throw
|
|
55
|
+
throw namedMessages.createError('StillInProgressError', [scratchOrgInfo.Status], ['action.StillInProgress']);
|
|
52
56
|
}
|
|
53
57
|
return (0, exports.checkScratchOrgInfoForErrors)(scratchOrgInfo, hubUsername);
|
|
54
58
|
};
|
|
@@ -18,26 +18,6 @@ Expected 'durationDays' to be an integer number.
|
|
|
18
18
|
|
|
19
19
|
Expected 'retry' to be an integer number.
|
|
20
20
|
|
|
21
|
-
# WaitValidationMaxError
|
|
22
|
-
|
|
23
|
-
Expected 'wait' greater than or equal to %s but received %s.
|
|
24
|
-
|
|
25
|
-
# NoScratchOrgInfoError
|
|
26
|
-
|
|
27
|
-
No ScratchOrgInfo object found in the Dev Hub you specified. Check that the ID and the Dev Hub are correct.
|
|
28
|
-
|
|
29
|
-
# ScratchOrgDeletedError
|
|
30
|
-
|
|
31
|
-
That scratch org has been deleted, so you can't connect to it anymore.
|
|
32
|
-
|
|
33
21
|
# CacheMissError
|
|
34
22
|
|
|
35
23
|
The ScratchOrgInfoId %s was not found in the cache.
|
|
36
|
-
|
|
37
|
-
# StillInProgressError
|
|
38
|
-
|
|
39
|
-
The scratch org is not ready yet (Status = %).
|
|
40
|
-
|
|
41
|
-
# action.StillInProgress
|
|
42
|
-
|
|
43
|
-
Wait for a few minutes, and then try the <%= config.bin %> <%= command.id %> command again
|
|
@@ -14,6 +14,22 @@ See https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_ob
|
|
|
14
14
|
|
|
15
15
|
The request to create a scratch org returned an unexpected status
|
|
16
16
|
|
|
17
|
+
# StillInProgressError
|
|
18
|
+
|
|
19
|
+
The scratch org is not ready yet (Status = %).
|
|
20
|
+
|
|
21
|
+
# action.StillInProgress
|
|
22
|
+
|
|
23
|
+
Wait for a few minutes, and then try the <%= config.bin %> <%= command.id %> command again
|
|
24
|
+
|
|
25
|
+
# NoScratchOrgInfoError
|
|
26
|
+
|
|
27
|
+
No ScratchOrgInfo object found in the Dev Hub you specified. Check that the ID and the Dev Hub are correct.
|
|
28
|
+
|
|
29
|
+
# ScratchOrgDeletedError
|
|
30
|
+
|
|
31
|
+
That scratch org has been deleted, so you can't connect to it anymore.
|
|
32
|
+
|
|
17
33
|
# INVALID_ID_FIELD
|
|
18
34
|
|
|
19
35
|
Provide a valid template ID, in the format 0TTxxxxxxxxxxxx.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.24.2",
|
|
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",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"form-data": "^4.0.0",
|
|
50
50
|
"graceful-fs": "^4.2.9",
|
|
51
51
|
"js2xmlparser": "^4.0.1",
|
|
52
|
-
"jsforce": "beta",
|
|
52
|
+
"jsforce": "^2.0.0-beta.16",
|
|
53
53
|
"jsonwebtoken": "8.5.1",
|
|
54
54
|
"mkdirp": "1.0.4",
|
|
55
55
|
"ts-retry-promise": "^0.6.0"
|