@salesforce/core 3.16.1 → 3.18.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/org/connection.d.ts +0 -9
- package/lib/org/connection.js +0 -2
- package/lib/org/org.d.ts +34 -0
- package/lib/org/org.js +64 -0
- package/messages/org.md +8 -0
- package/package.json +2 -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.18.0](https://github.com/forcedotcom/sfdx-core/compare/v3.17.0...v3.18.0) (2022-05-12)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- bump jsforce for metadata rest api ([#583](https://github.com/forcedotcom/sfdx-core/issues/583)) ([6addcfd](https://github.com/forcedotcom/sfdx-core/commit/6addcfd9b2bd480974f6c965b4d04c610a38f2db))
|
|
10
|
+
|
|
11
|
+
## [3.17.0](https://github.com/forcedotcom/sfdx-core/compare/v3.16.2...v3.17.0) (2022-05-12)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- sandboxStatus for v3 ([#571](https://github.com/forcedotcom/sfdx-core/issues/571)) ([60a004b](https://github.com/forcedotcom/sfdx-core/commit/60a004b663d918ec8b37d6ded7ddf12ce112b7f8))
|
|
16
|
+
|
|
17
|
+
### [3.16.2](https://github.com/forcedotcom/sfdx-core/compare/v3.16.1...v3.16.2) (2022-05-11)
|
|
18
|
+
|
|
5
19
|
### [3.16.1](https://github.com/forcedotcom/sfdx-core/compare/v3.16.0...v3.16.1) (2022-05-11)
|
|
6
20
|
|
|
7
21
|
### Bug Fixes
|
package/lib/org/connection.d.ts
CHANGED
|
@@ -20,15 +20,6 @@ export declare type DeployOptionsWithRest = Partial<DeployOptions> & {
|
|
|
20
20
|
};
|
|
21
21
|
export interface Tooling<S extends Schema = Schema> extends JSForceTooling<S> {
|
|
22
22
|
_logger: any;
|
|
23
|
-
/**
|
|
24
|
-
* Executes a query and auto-fetches (i.e., "queryMore") all results. This is especially
|
|
25
|
-
* useful with large query result sizes, such as over 2000 records. The default maximum
|
|
26
|
-
* fetch size is 10,000 records. Modify this via the options argument.
|
|
27
|
-
*
|
|
28
|
-
* @param soql The SOQL string.
|
|
29
|
-
* @param options The query options. NOTE: the autoFetch option will always be true.
|
|
30
|
-
*/
|
|
31
|
-
autoFetchQuery<T extends Schema = S>(soql: string, options?: QueryOptions): Promise<QueryResult<T>>;
|
|
32
23
|
}
|
|
33
24
|
/**
|
|
34
25
|
* Handles connections and requests to Salesforce Orgs.
|
package/lib/org/connection.js
CHANGED
|
@@ -58,8 +58,6 @@ class Connection extends jsforce_1.Connection {
|
|
|
58
58
|
*/
|
|
59
59
|
constructor(options) {
|
|
60
60
|
super(options.connectionOptions || {});
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
62
|
-
this.tooling.autoFetchQuery = Connection.prototype.autoFetchQuery;
|
|
63
61
|
this.options = options;
|
|
64
62
|
this.username = options.authInfo.getUsername();
|
|
65
63
|
}
|
package/lib/org/org.d.ts
CHANGED
|
@@ -140,6 +140,17 @@ export declare class Org extends AsyncOptionalCreatable<Org.Options> {
|
|
|
140
140
|
* @returns {ScratchOrgCreateResult}
|
|
141
141
|
*/
|
|
142
142
|
scratchOrgCreate(options: ScratchOrgRequest): Promise<ScratchOrgCreateResult>;
|
|
143
|
+
/**
|
|
144
|
+
* Reports sandbox org creation status. If the org is ready, authenticates to the org.
|
|
145
|
+
*
|
|
146
|
+
* @param {sandboxname} string the sandbox name
|
|
147
|
+
* @param options Wait: The amount of time to wait before timing out, Interval: The time interval between polling
|
|
148
|
+
* @returns {SandboxProcessObject} the sandbox process object
|
|
149
|
+
*/
|
|
150
|
+
sandboxStatus(sandboxname: string, options: {
|
|
151
|
+
wait?: Duration;
|
|
152
|
+
interval?: Duration;
|
|
153
|
+
}): Promise<SandboxProcessObject>;
|
|
143
154
|
/**
|
|
144
155
|
* Clean all data files in the org's data path. Usually <workspace>/.sfdx/orgs/<username>.
|
|
145
156
|
*
|
|
@@ -348,6 +359,29 @@ export declare class Org extends AsyncOptionalCreatable<Org.Options> {
|
|
|
348
359
|
* **Throws** *{@link SfError}{ name: 'NotSupportedError' }* Throws an unsupported error.
|
|
349
360
|
*/
|
|
350
361
|
protected getDefaultOptions(): Org.Options;
|
|
362
|
+
/**
|
|
363
|
+
* Gets the sandboxProcessObject and then polls for it to complete.
|
|
364
|
+
*
|
|
365
|
+
* @param sandboxProcessName sanbox process name
|
|
366
|
+
* @param options { wait?: Duration; interval?: Duration }
|
|
367
|
+
* @returns {SandboxProcessObject} The SandboxProcessObject for the sandbox
|
|
368
|
+
*/
|
|
369
|
+
private authWithRetriesByName;
|
|
370
|
+
/**
|
|
371
|
+
* Polls the sandbox org for the sandboxProcessObject.
|
|
372
|
+
*
|
|
373
|
+
* @param sandboxProcessObj: The in-progress sandbox signup request
|
|
374
|
+
* @param options { wait?: Duration; interval?: Duration }
|
|
375
|
+
* @returns {SandboxProcessObject}
|
|
376
|
+
*/
|
|
377
|
+
private authWithRetries;
|
|
378
|
+
/**
|
|
379
|
+
* Query the sandbox for the SandboxProcessObject by sandbox name
|
|
380
|
+
*
|
|
381
|
+
* @param sandboxName The name of the sandbox to query
|
|
382
|
+
* @returns {SandboxProcessObject} The SandboxProcessObject for the sandbox
|
|
383
|
+
*/
|
|
384
|
+
private queryLatestSandboxProcessBySandboxName;
|
|
351
385
|
private queryProduction;
|
|
352
386
|
private destroySandbox;
|
|
353
387
|
private destroyScratchOrg;
|
package/lib/org/org.js
CHANGED
|
@@ -41,6 +41,8 @@ const messages = messages_1.Messages.load('@salesforce/core', 'org', [
|
|
|
41
41
|
'scratchOrgNotFound',
|
|
42
42
|
'AuthInfoOrgIdUndefined',
|
|
43
43
|
'sandboxCreateNotComplete',
|
|
44
|
+
'SandboxProcessNotFoundBySandboxName',
|
|
45
|
+
'MultiSandboxProcessNotFoundBySandboxName',
|
|
44
46
|
]);
|
|
45
47
|
var OrgTypes;
|
|
46
48
|
(function (OrgTypes) {
|
|
@@ -192,6 +194,16 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
192
194
|
async scratchOrgCreate(options) {
|
|
193
195
|
return (0, scratchOrgCreate_1.scratchOrgCreate)({ ...options, hubOrg: this });
|
|
194
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Reports sandbox org creation status. If the org is ready, authenticates to the org.
|
|
199
|
+
*
|
|
200
|
+
* @param {sandboxname} string the sandbox name
|
|
201
|
+
* @param options Wait: The amount of time to wait before timing out, Interval: The time interval between polling
|
|
202
|
+
* @returns {SandboxProcessObject} the sandbox process object
|
|
203
|
+
*/
|
|
204
|
+
async sandboxStatus(sandboxname, options) {
|
|
205
|
+
return this.authWithRetriesByName(sandboxname, options);
|
|
206
|
+
}
|
|
195
207
|
/**
|
|
196
208
|
* Clean all data files in the org's data path. Usually <workspace>/.sfdx/orgs/<username>.
|
|
197
209
|
*
|
|
@@ -710,6 +722,58 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
710
722
|
getDefaultOptions() {
|
|
711
723
|
throw new sfError_1.SfError('Not Supported', 'NotSupportedError');
|
|
712
724
|
}
|
|
725
|
+
/**
|
|
726
|
+
* Gets the sandboxProcessObject and then polls for it to complete.
|
|
727
|
+
*
|
|
728
|
+
* @param sandboxProcessName sanbox process name
|
|
729
|
+
* @param options { wait?: Duration; interval?: Duration }
|
|
730
|
+
* @returns {SandboxProcessObject} The SandboxProcessObject for the sandbox
|
|
731
|
+
*/
|
|
732
|
+
async authWithRetriesByName(sandboxProcessName, options) {
|
|
733
|
+
return this.authWithRetries(await this.queryLatestSandboxProcessBySandboxName(sandboxProcessName), options);
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Polls the sandbox org for the sandboxProcessObject.
|
|
737
|
+
*
|
|
738
|
+
* @param sandboxProcessObj: The in-progress sandbox signup request
|
|
739
|
+
* @param options { wait?: Duration; interval?: Duration }
|
|
740
|
+
* @returns {SandboxProcessObject}
|
|
741
|
+
*/
|
|
742
|
+
async authWithRetries(sandboxProcessObj, options = {
|
|
743
|
+
wait: kit_1.Duration.minutes(0),
|
|
744
|
+
interval: kit_1.Duration.seconds(30),
|
|
745
|
+
}) {
|
|
746
|
+
const [wait, pollInterval] = this.validateWaitOptions(options);
|
|
747
|
+
this.logger.debug(`AuthWithRetries sandboxProcessObj ${sandboxProcessObj}, max wait time of ${wait.minutes} minutes`);
|
|
748
|
+
return this.pollStatusAndAuth({
|
|
749
|
+
sandboxProcessObj,
|
|
750
|
+
wait,
|
|
751
|
+
pollInterval,
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Query the sandbox for the SandboxProcessObject by sandbox name
|
|
756
|
+
*
|
|
757
|
+
* @param sandboxName The name of the sandbox to query
|
|
758
|
+
* @returns {SandboxProcessObject} The SandboxProcessObject for the sandbox
|
|
759
|
+
*/
|
|
760
|
+
async queryLatestSandboxProcessBySandboxName(sandboxNameIn) {
|
|
761
|
+
var _a;
|
|
762
|
+
const { tooling } = this.getConnection();
|
|
763
|
+
this.logger.debug('QueryLatestSandboxProcessBySandboxName called with SandboxName: %s ', sandboxNameIn);
|
|
764
|
+
const queryStr = `SELECT Id, Status, SandboxName, SandboxInfoId, LicenseType, CreatedDate, CopyProgress, SandboxOrganization, SourceId, Description, EndDate FROM SandboxProcess WHERE SandboxName='${sandboxNameIn}' AND Status != 'D' ORDER BY CreatedDate DESC LIMIT 1`;
|
|
765
|
+
const queryResult = await tooling.query(queryStr);
|
|
766
|
+
this.logger.debug('Return from calling queryToolingApi: %s ', queryResult);
|
|
767
|
+
if (((_a = queryResult === null || queryResult === void 0 ? void 0 : queryResult.records) === null || _a === void 0 ? void 0 : _a.length) === 1) {
|
|
768
|
+
return queryResult.records[0];
|
|
769
|
+
}
|
|
770
|
+
else if (queryResult.records && queryResult.records.length > 1) {
|
|
771
|
+
throw messages.createError('MultiSandboxProcessNotFoundBySandboxName', [sandboxNameIn]);
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
throw messages.createError('SandboxProcessNotFoundBySandboxName', [sandboxNameIn]);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
713
777
|
async queryProduction(org, field, value) {
|
|
714
778
|
return org.connection.singleRecordQuery(`SELECT SandboxInfoId FROM SandboxProcess WHERE ${field} ='${value}' AND Status NOT IN ('D', 'E')`, { tooling: true });
|
|
715
779
|
}
|
package/messages/org.md
CHANGED
|
@@ -53,3 +53,11 @@ AuthInfo orgId is undefined.
|
|
|
53
53
|
# sandboxCreateNotComplete
|
|
54
54
|
|
|
55
55
|
The sandbox creation has not completed.
|
|
56
|
+
|
|
57
|
+
# SandboxProcessNotFoundBySandboxName
|
|
58
|
+
|
|
59
|
+
We can't find a SandboxProcess with the SandboxName %s.
|
|
60
|
+
|
|
61
|
+
# MultiSandboxProcessNotFoundBySandboxName
|
|
62
|
+
|
|
63
|
+
We found more than one SandboxProcess with the SandboxName %s.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.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",
|
|
@@ -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": "2.0.0-beta.
|
|
52
|
+
"jsforce": "2.0.0-beta.9",
|
|
53
53
|
"jsonwebtoken": "8.5.1",
|
|
54
54
|
"mkdirp": "1.0.4",
|
|
55
55
|
"ts-retry-promise": "^0.6.0"
|