@salesforce/core 2.31.1 → 2.33.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 +33 -0
- package/LICENSE.txt +1 -1
- package/lib/connection.js +3 -2
- package/lib/exported.d.ts +3 -1
- package/lib/exported.js +5 -1
- package/lib/org.d.ts +99 -1
- package/lib/org.js +215 -1
- package/lib/scratchOrgCreate.d.ts +43 -0
- package/lib/scratchOrgCreate.js +135 -0
- package/lib/scratchOrgErrorCodes.d.ts +4 -0
- package/lib/scratchOrgErrorCodes.js +53 -0
- package/lib/scratchOrgFeatureDeprecation.d.ts +26 -0
- package/lib/scratchOrgFeatureDeprecation.js +106 -0
- package/lib/scratchOrgInfoApi.d.ts +94 -0
- package/lib/scratchOrgInfoApi.js +331 -0
- package/lib/scratchOrgInfoGenerator.d.ts +62 -0
- package/lib/scratchOrgInfoGenerator.js +226 -0
- package/lib/scratchOrgSettingsGenerator.d.ts +56 -0
- package/lib/scratchOrgSettingsGenerator.js +208 -0
- package/lib/status/streamingClient.d.ts +0 -1
- package/lib/status/streamingClient.js +6 -14
- package/lib/util/jsonXmlTools.d.ts +14 -0
- package/lib/util/jsonXmlTools.js +41 -0
- package/lib/util/mapKeys.d.ts +14 -0
- package/lib/util/mapKeys.js +48 -0
- package/lib/util/zipWriter.d.ts +14 -0
- package/lib/util/zipWriter.js +68 -0
- package/lib/webOAuthServer.js +1 -1
- package/messages/org.json +4 -1
- package/messages/scratchOrgCreate.json +4 -0
- package/messages/scratchOrgErrorCodes.json +27 -0
- package/messages/scratchOrgFeatureDeprecation.json +5 -0
- package/messages/scratchOrgInfoApi.json +5 -0
- package/messages/scratchOrgInfoGenerator.json +7 -0
- package/package.json +10 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { pipeline as cbPipeline, Readable, Writable } from 'stream';
|
|
3
|
+
export declare const pipeline: typeof cbPipeline.__promisify__;
|
|
4
|
+
export declare class ZipWriter extends Writable {
|
|
5
|
+
private rootDestination?;
|
|
6
|
+
private zip;
|
|
7
|
+
private buffers;
|
|
8
|
+
constructor(rootDestination?: string | undefined);
|
|
9
|
+
addToZip(contents: string | Readable | Buffer, path: string): void;
|
|
10
|
+
finalize(): Promise<void>;
|
|
11
|
+
private getOutputStream;
|
|
12
|
+
private getInputBuffer;
|
|
13
|
+
get buffer(): Buffer;
|
|
14
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ZipWriter = exports.pipeline = void 0;
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const stream_1 = require("stream");
|
|
12
|
+
const util_1 = require("util");
|
|
13
|
+
const archiver_1 = require("archiver");
|
|
14
|
+
exports.pipeline = util_1.promisify(stream_1.pipeline);
|
|
15
|
+
class ZipWriter extends stream_1.Writable {
|
|
16
|
+
constructor(rootDestination) {
|
|
17
|
+
super({ objectMode: true });
|
|
18
|
+
this.rootDestination = rootDestination;
|
|
19
|
+
// compression-/speed+ (0)<---(3)---------->(9) compression+/speed-
|
|
20
|
+
// 3 appears to be a decent balance of compression and speed. It felt like
|
|
21
|
+
// higher values = diminishing returns on compression and made conversion slower
|
|
22
|
+
this.zip = archiver_1.create('zip', { zlib: { level: 3 } });
|
|
23
|
+
this.buffers = [];
|
|
24
|
+
void exports.pipeline(this.zip, this.getOutputStream());
|
|
25
|
+
}
|
|
26
|
+
addToZip(contents, path) {
|
|
27
|
+
this.zip.append(contents, { name: path });
|
|
28
|
+
}
|
|
29
|
+
async finalize() {
|
|
30
|
+
await this.zip.finalize();
|
|
31
|
+
await this.getInputBuffer();
|
|
32
|
+
}
|
|
33
|
+
getOutputStream() {
|
|
34
|
+
if (this.rootDestination) {
|
|
35
|
+
return fs_1.createWriteStream(this.rootDestination);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const bufferWritable = new stream_1.Writable();
|
|
39
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
40
|
+
bufferWritable._write = (chunk, encoding, cb) => {
|
|
41
|
+
this.buffers.push(chunk);
|
|
42
|
+
cb();
|
|
43
|
+
};
|
|
44
|
+
return bufferWritable;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async getInputBuffer() {
|
|
48
|
+
if (this.rootDestination) {
|
|
49
|
+
const inputStream = fs_1.createReadStream(this.rootDestination);
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
inputStream.on('data', (chunk) => {
|
|
52
|
+
this.buffers.push(chunk);
|
|
53
|
+
});
|
|
54
|
+
inputStream.once('end', () => {
|
|
55
|
+
return resolve();
|
|
56
|
+
});
|
|
57
|
+
inputStream.once('error', (error) => {
|
|
58
|
+
return reject(error);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
get buffer() {
|
|
64
|
+
return Buffer.concat(this.buffers);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.ZipWriter = ZipWriter;
|
|
68
|
+
//# sourceMappingURL=zipWriter.js.map
|
package/lib/webOAuthServer.js
CHANGED
|
@@ -135,7 +135,7 @@ class WebOAuthServer extends kit_1.AsyncCreatable {
|
|
|
135
135
|
async executeOauthRequest() {
|
|
136
136
|
return new Promise((resolve, reject) => {
|
|
137
137
|
this.logger.debug('Starting web auth flow');
|
|
138
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises, @typescript-eslint/no-explicit-any
|
|
139
139
|
this.webServer.server.on('request', async (request, response) => {
|
|
140
140
|
const url = url_1.parse(request.url);
|
|
141
141
|
this.logger.debug(`processing request for uri: ${url.pathname}`);
|
package/messages/org.json
CHANGED
|
@@ -6,5 +6,8 @@
|
|
|
6
6
|
"InsufficientAccessToDelete": "You do not have the appropriate permissions to delete a scratch org. Please contact your Salesforce admin.",
|
|
7
7
|
"ScratchOrgNotFound": "Attempting to delete an expired or deleted org",
|
|
8
8
|
"SandboxDeleteFailed": "The sandbox org deletion failed with a result of %s.",
|
|
9
|
-
"SandboxNotFound": "We can't find a SandboxProcess for the sandbox org %s."
|
|
9
|
+
"SandboxNotFound": "We can't find a SandboxProcess for the sandbox org %s.",
|
|
10
|
+
"SandboxInfoCreateFailed": "The sandbox org creation failed with a result of %s.",
|
|
11
|
+
"MissingAuthUsername": "The sandbox %s does not have an authorized username.",
|
|
12
|
+
"OrgPollingTimeout": "Sandbox status is %s; timed out waiting for completion."
|
|
10
13
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
{
|
|
2
|
+
"unsupportedSnapshotOrgCreateOptions": "Org snapshots don’t support one or more options you specified: %s",
|
|
3
|
+
"SourceStatusResetFailure": "Successfully created org with ID: %s and name: %s. Unfortunately, source tracking isn’t working as expected. If you run force:source:status, the results may be incorrect. Try again by creating another scratch org."
|
|
4
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"signupFailed": "The request to create a scratch org failed with error code: %s.",
|
|
3
|
+
"signupFailedUnknown": "An unknown server error occurred. Please try again. If you still see this error, contact Salesforce support for assistance. Include the information from 'sfdx force:data:record:get -s ScratchOrgInfo -i %s -u %s'.",
|
|
4
|
+
"signupFailedAction": "See https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_signuprequest.htm for information on error code %s.",
|
|
5
|
+
"signupUnexpected": "The request to create a scratch org returned an unexpected status",
|
|
6
|
+
"INVALID_ID_FIELD": "Provide a valid template ID, in the format 0TTxxxxxxxxxxxx.",
|
|
7
|
+
"T-0002": "We couldn’t find a template or snapshot with the ID or name specified in the scratch org definition. If you’re sure the ID is correct, contact Salesforce Support.",
|
|
8
|
+
"T-0003": "The template specified in the scratch org definition is unapproved. Contact Salesforce Support to request template approval.",
|
|
9
|
+
"T-0004": "The Trialforce Source Organization (TSO) for the template doesn’t exist or has expired.",
|
|
10
|
+
"S-1006": "Provide a valid email address in your scratch org definition or your %s file.",
|
|
11
|
+
"S-2006": "Provide a valid country code in your scratch org definition or your %s file.",
|
|
12
|
+
"S-1017": "Specify a namespace that’s used by a release org associated with your Dev Hub org.",
|
|
13
|
+
"S-1018": "Provide a valid My Domain value. This value can’t include double hyphens, end in a hyphen, include restricted words, or be more than 40 characters long.",
|
|
14
|
+
"S-1019": "The My Domain value you chose is already in use.",
|
|
15
|
+
"S-1026": "Provide a valid namespace value. This value must begin with a letter. It can’t include consecutive underscores, end in an underscore, be more than 15 characters long, or be a restricted or reserved namespace. Only alphanumeric characters and underscores are allowed.",
|
|
16
|
+
"S-9999": "A fatal signup error occurred. Please try again. If you still see this error, contact Salesforce Support for assistance.",
|
|
17
|
+
"SH-0001": "Can’t create scratch org. Contact the source org admin to add your Dev Hub org ID to Setup > Org Shape. Then try again.",
|
|
18
|
+
"SH-0002": "Can’t create scratch org. No org shape exists for the specified sourceOrg. Create an org shape and try again.",
|
|
19
|
+
"SH-0003": "Can’t create scratch org from org shape. The org shape version is outdated. Recreate the org shape and try again.",
|
|
20
|
+
"C-1007": "The username provided to the org:create command is already in use. Run 'force:org:list --clean' to remove stale org authentications or create the org with a different username.",
|
|
21
|
+
"C-1015": "We encountered a problem while registering your My Domain value with the DNS provider. Please try again.",
|
|
22
|
+
"C-1016": "We encountered a problem while attempting to configure and approve the Connected App for your org. Verify the Connected App configuration with your Salesforce admin.",
|
|
23
|
+
"C-1017": "Provide a valid namespace prefix. This value must begin with a letter. It can’t include consecutive underscores, end in an underscore, be more than 15 characters long, or be a restricted or reserved namespace. Only alphanumeric characters and underscores are allowed.",
|
|
24
|
+
"C-1020": "We couldn't find a template with the ID specified in the scratch org definition. If you’re sure the ID is correct, contact Salesforce Support.",
|
|
25
|
+
"C-1027": "The template specified in the Scratch Definition isn’t supported. Specify a generic edition (such as Developer or Enterprise), or specify a template ID.",
|
|
26
|
+
"C-9999": "A fatal signup error occurred. Please try again. If you still see this error, contact Salesforce Support for assistance."
|
|
27
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"quantifiedFeatureWithoutQuantityWarning": "The feature %s will be deprecated in a future release. It's been replaced by %s:<value>, which requires you to specify a quantity.",
|
|
3
|
+
"mappedFeatureWarning": "The feature %s has been deprecated. It has been replaced with %s in this scratch org create request.",
|
|
4
|
+
"deprecatedFeatureWarning": "The feature %s has been deprecated. It has been removed from the list of requested features."
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"signupFieldsMissing": "Required fields are missing for org creation: [%s]",
|
|
3
|
+
"signupDuplicateSettingsSpecified": "You cannot use 'settings' and `'orgPreferences' in your scratch definition file, please specify one or the other.",
|
|
4
|
+
"deprecatedPrefFormat": "We've deprecated OrgPreferences. Update the scratch org definition file to replace OrgPreferences with their corresponding settings."
|
|
5
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errorpackage2AncestorIdsKeyNotSupported": "The package2AncestorIds key is no longer supported in a scratch org definition. Ancestors defined in sfdx-project.json will be included in the scratch org.",
|
|
3
|
+
"errorInvalidAncestorVersionFormat": "The ancestor versionNumber must be in the format major.minor.patch but the value found is %s",
|
|
4
|
+
"errorNoMatchingAncestor": "The ancestorId for ancestorVersion %s can't be found. Package ID %s.",
|
|
5
|
+
"errorAncestorNotReleased": "The ancestor package version [%s] specified in the sfdx-project.json file may exist hasn’t been promoted and released. Release the ancestor package version before specifying it as the ancestor in a new package or patch version.",
|
|
6
|
+
"errorAncestorIdVersionMismatch": "The ancestorVersion in sfdx-project.json is not the version expected for the ancestorId you supplied. ancestorVersion %s. ancestorID %s."
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.33.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",
|
|
@@ -35,29 +35,32 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@salesforce/bunyan": "^2.0.0",
|
|
38
|
-
"@salesforce/kit": "^1.5.
|
|
38
|
+
"@salesforce/kit": "^1.5.17",
|
|
39
39
|
"@salesforce/schemas": "^1.0.1",
|
|
40
|
-
"@salesforce/ts-types": "^1.5.
|
|
40
|
+
"@salesforce/ts-types": "^1.5.20",
|
|
41
41
|
"@types/graceful-fs": "^4.1.5",
|
|
42
|
-
"@types/jsforce": "^1.9.35",
|
|
43
42
|
"@types/mkdirp": "^1.0.1",
|
|
43
|
+
"archiver": "^5.3.0",
|
|
44
44
|
"debug": "^3.1.0",
|
|
45
|
+
"faye": "^1.4.0",
|
|
45
46
|
"graceful-fs": "^4.2.4",
|
|
47
|
+
"js2xmlparser": "^4.0.1",
|
|
46
48
|
"jsen": "0.6.6",
|
|
47
49
|
"jsforce": "^1.11.0",
|
|
48
50
|
"jsonwebtoken": "8.5.0",
|
|
49
51
|
"mkdirp": "1.0.4",
|
|
50
52
|
"semver": "^7.3.5",
|
|
51
|
-
"sfdx-faye": "^1.0.9",
|
|
52
53
|
"ts-retry-promise": "^0.6.0"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@salesforce/dev-config": "^2.1.
|
|
56
|
+
"@salesforce/dev-config": "^2.1.3",
|
|
56
57
|
"@salesforce/dev-scripts": "^1.0.2",
|
|
57
58
|
"@salesforce/prettier-config": "^0.0.2",
|
|
58
|
-
"@salesforce/ts-sinon": "
|
|
59
|
+
"@salesforce/ts-sinon": "1.3.21",
|
|
60
|
+
"@types/archiver": "^5.1.1",
|
|
59
61
|
"@types/debug": "0.0.30",
|
|
60
62
|
"@types/jsen": "0.0.19",
|
|
63
|
+
"@types/jsforce": "^1.9.38",
|
|
61
64
|
"@types/jsonwebtoken": "8.3.2",
|
|
62
65
|
"@types/semver": "^7.3.9",
|
|
63
66
|
"@types/shelljs": "0.7.8",
|