@salesforce/core 3.18.2 → 3.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/lib/org/org.d.ts +11 -0
- package/lib/org/org.js +20 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.3](https://github.com/forcedotcom/sfdx-core/compare/v3.18.2...v3.18.3) (2022-05-20)
|
|
6
|
+
|
|
5
7
|
### [3.18.2](https://github.com/forcedotcom/sfdx-core/compare/v3.18.1...v3.18.2) (2022-05-17)
|
|
6
8
|
|
|
7
9
|
### Bug Fixes
|
package/lib/org/org.d.ts
CHANGED
|
@@ -119,6 +119,17 @@ export declare class Org extends AsyncOptionalCreatable<Org.Options> {
|
|
|
119
119
|
interval?: Duration;
|
|
120
120
|
async?: boolean;
|
|
121
121
|
}): Promise<SandboxProcessObject>;
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @param sandboxReq SandboxRequest options to create the sandbox with
|
|
125
|
+
* @param sandboxName
|
|
126
|
+
* @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
|
|
127
|
+
* @returns {SandboxProcessObject} the newly created sandbox process object
|
|
128
|
+
*/
|
|
129
|
+
cloneSandbox(sandboxReq: SandboxRequest, sandboxName: string, options: {
|
|
130
|
+
wait?: Duration;
|
|
131
|
+
interval?: Duration;
|
|
132
|
+
}): Promise<SandboxProcessObject>;
|
|
122
133
|
/**
|
|
123
134
|
* resume a sandbox creation from a production org
|
|
124
135
|
* 'this' needs to be a production org with sandbox licenses available
|
package/lib/org/org.js
CHANGED
|
@@ -104,14 +104,14 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
104
104
|
async: false,
|
|
105
105
|
interval: kit_1.Duration.seconds(30),
|
|
106
106
|
}) {
|
|
107
|
-
this.logger.debug(
|
|
107
|
+
this.logger.debug(`CreateSandbox called with SandboxRequest: ${sandboxReq}`);
|
|
108
108
|
const createResult = await this.connection.tooling.create('SandboxInfo', sandboxReq);
|
|
109
|
-
this.logger.debug(
|
|
109
|
+
this.logger.debug(`Return from calling tooling.create: ${createResult}`);
|
|
110
110
|
if (Array.isArray(createResult) || !createResult.success) {
|
|
111
111
|
throw messages.createError('sandboxInfoCreateFailed', [JSON.stringify(createResult)]);
|
|
112
112
|
}
|
|
113
113
|
const sandboxCreationProgress = await this.querySandboxProcessBySandboxInfoId(createResult.id);
|
|
114
|
-
this.logger.debug(
|
|
114
|
+
this.logger.debug(`Return from calling singleRecordQuery with tooling: ${sandboxCreationProgress}`);
|
|
115
115
|
const isAsync = !!options.async;
|
|
116
116
|
if (isAsync) {
|
|
117
117
|
// The user didn't want us to poll, so simply return the status
|
|
@@ -119,13 +119,25 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
119
119
|
return sandboxCreationProgress;
|
|
120
120
|
}
|
|
121
121
|
const [wait, pollInterval] = this.validateWaitOptions(options);
|
|
122
|
-
this.logger.debug(`create - pollStatusAndAuth sandboxProcessObj, max wait time of ${wait.minutes} minutes
|
|
122
|
+
this.logger.debug(`create - pollStatusAndAuth sandboxProcessObj ${sandboxCreationProgress}, max wait time of ${wait.minutes} minutes`);
|
|
123
123
|
return this.pollStatusAndAuth({
|
|
124
124
|
sandboxProcessObj: sandboxCreationProgress,
|
|
125
125
|
wait,
|
|
126
126
|
pollInterval,
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @param sandboxReq SandboxRequest options to create the sandbox with
|
|
132
|
+
* @param sandboxName
|
|
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
|
+
* @returns {SandboxProcessObject} the newly created sandbox process object
|
|
135
|
+
*/
|
|
136
|
+
async cloneSandbox(sandboxReq, sandboxName, options) {
|
|
137
|
+
sandboxReq.SourceId = (await this.querySandboxProcessBySandboxName(sandboxName)).Id;
|
|
138
|
+
this.logger.debug('Clone sandbox sourceId %s', sandboxReq.SourceId);
|
|
139
|
+
return this.createSandbox(sandboxReq, options);
|
|
140
|
+
}
|
|
129
141
|
/**
|
|
130
142
|
* resume a sandbox creation from a production org
|
|
131
143
|
* 'this' needs to be a production org with sandbox licenses available
|
|
@@ -140,7 +152,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
140
152
|
interval: kit_1.Duration.seconds(30),
|
|
141
153
|
}) {
|
|
142
154
|
var _a;
|
|
143
|
-
this.logger.debug(
|
|
155
|
+
this.logger.debug(`ResumeSandbox called with ResumeSandboxRequest: ${resumeSandboxRequest}`);
|
|
144
156
|
let sandboxCreationProgress;
|
|
145
157
|
// seed the sandboxCreationProgress via the resumeSandboxRequest options
|
|
146
158
|
if (resumeSandboxRequest.SandboxName) {
|
|
@@ -154,7 +166,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
154
166
|
(_a = resumeSandboxRequest.SandboxName) !== null && _a !== void 0 ? _a : resumeSandboxRequest.SandboxProcessObjId,
|
|
155
167
|
]);
|
|
156
168
|
}
|
|
157
|
-
this.logger.debug(
|
|
169
|
+
this.logger.debug(`Return from calling singleRecordQuery with tooling: ${sandboxCreationProgress}`);
|
|
158
170
|
await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_RESUME, sandboxCreationProgress);
|
|
159
171
|
const [wait, pollInterval] = this.validateWaitOptions(options);
|
|
160
172
|
// if wait is 0, return the sandboxCreationProgress immediately
|
|
@@ -165,7 +177,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
165
177
|
if (sandboxInfo) {
|
|
166
178
|
await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_AUTH, sandboxInfo);
|
|
167
179
|
try {
|
|
168
|
-
this.logger.debug(
|
|
180
|
+
this.logger.debug(`sandbox signup complete with ${sandboxInfo}`);
|
|
169
181
|
await this.writeSandboxAuthFile(sandboxCreationProgress, sandboxInfo);
|
|
170
182
|
return sandboxCreationProgress;
|
|
171
183
|
}
|
|
@@ -177,7 +189,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
177
189
|
await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_ASYNC_RESULT, sandboxCreationProgress);
|
|
178
190
|
throw messages.createError('sandboxCreateNotComplete');
|
|
179
191
|
}
|
|
180
|
-
this.logger.debug(`resume - pollStatusAndAuth sandboxProcessObj, max wait time of ${wait.minutes} minutes
|
|
192
|
+
this.logger.debug(`resume - pollStatusAndAuth sandboxProcessObj ${sandboxCreationProgress}, max wait time of ${wait.minutes} minutes`);
|
|
181
193
|
return this.pollStatusAndAuth({
|
|
182
194
|
sandboxProcessObj: sandboxCreationProgress,
|
|
183
195
|
wait,
|