@simplysf/simply-package 1.0.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.
@@ -0,0 +1,113 @@
1
+ /*
2
+ * Copyright (c) 2024, Clay Chipps; Copyright (c) 2024, Salesforce.com, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
8
+ import { Messages, Logger } from '@salesforce/core';
9
+ import { Package, PackageVersion, } from '@salesforce/packaging';
10
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
11
+ const messages = Messages.loadMessages('@simplysf/simply-package', 'simply.package.version.cleanup');
12
+ export default class PackageVersionCleanup extends SfCommand {
13
+ static summary = messages.getMessage('summary');
14
+ static description = messages.getMessage('description');
15
+ static examples = messages.getMessages('examples');
16
+ // This is annoying, but the underlying Salesforce Packaging API expects you to be in a project context
17
+ // https://github.com/forcedotcom/packaging/blob/49e2f0b76a8d206369bf99906d02f6c54d89247d/src/package/package.ts#L144
18
+ static requiresProject = true;
19
+ static flags = {
20
+ 'api-version': Flags.orgApiVersion(),
21
+ matcher: Flags.string({
22
+ summary: messages.getMessage('flags.matcher.summary'),
23
+ description: messages.getMessage('flags.matcher.description'),
24
+ char: 's',
25
+ required: true,
26
+ }),
27
+ package: Flags.string({
28
+ summary: messages.getMessage('flags.package.summary'),
29
+ description: messages.getMessage('flags.package.description'),
30
+ char: 'p',
31
+ required: true,
32
+ }),
33
+ 'target-dev-hub': Flags.requiredHub(),
34
+ };
35
+ async run() {
36
+ const log = await Logger.child(this.ctor.name);
37
+ const { flags } = await this.parse(PackageVersionCleanup);
38
+ // Create a connection to the org
39
+ const connection = flags['target-dev-hub']?.getConnection(flags['api-version']);
40
+ if (!connection) {
41
+ throw messages.createError('errors.connectionFailed');
42
+ }
43
+ const project = this.project;
44
+ const matcher = flags.matcher;
45
+ const matcherRegex = new RegExp(/^\d+\.\d+\.\d+$/);
46
+ const matcherValid = matcherRegex.test(matcher);
47
+ if (!matcherValid) {
48
+ throw messages.createError('errors.matcherFormatMismatch');
49
+ }
50
+ const matcherSplit = matcher.split('.');
51
+ const majorMatcher = matcherSplit.at(0);
52
+ const minorMatcher = matcherSplit.at(1);
53
+ const patchMatcher = matcherSplit.at(2);
54
+ log.info(`Major Matcher ${majorMatcher} Minor Matcher ${minorMatcher} Patch Matcher ${patchMatcher}`);
55
+ const packageVersionListOptions = {
56
+ concise: false,
57
+ createdLastDays: undefined,
58
+ modifiedLastDays: undefined,
59
+ orderBy: 'MajorVersion, MinorVersion, PatchVersion, BuildNumber',
60
+ packages: [flags.package],
61
+ isReleased: false,
62
+ verbose: true,
63
+ };
64
+ this.spinner.start('Analyzing which package versions to delete...');
65
+ const packageVersions = await Package.listVersions(connection, project, packageVersionListOptions);
66
+ const targetVersions = packageVersions.filter((packageVersion) => packageVersion.IsReleased === false &&
67
+ packageVersion.MajorVersion.toString() === majorMatcher &&
68
+ packageVersion.MinorVersion.toString() === minorMatcher &&
69
+ packageVersion.PatchVersion.toString() === patchMatcher);
70
+ const packageVersionDeletePromiseRequests = [];
71
+ targetVersions.forEach((targetVersion) => {
72
+ const packageVersionOptions = {
73
+ connection,
74
+ project,
75
+ idOrAlias: targetVersion.SubscriberPackageVersionId,
76
+ };
77
+ packageVersionDeletePromiseRequests.push(new PackageVersion(packageVersionOptions).delete());
78
+ });
79
+ const results = [];
80
+ this.spinner.stop();
81
+ this.spinner.start('Deleting the package versions...');
82
+ const promiseResults = await Promise.allSettled(packageVersionDeletePromiseRequests);
83
+ promiseResults.forEach((promiseResult, index) => {
84
+ switch (promiseResult.status) {
85
+ case 'fulfilled':
86
+ results.push({
87
+ Success: promiseResult?.value?.success,
88
+ SubscriberPackageVersionId: targetVersions[index].SubscriberPackageVersionId,
89
+ });
90
+ break;
91
+ case 'rejected':
92
+ results.push({
93
+ Success: false,
94
+ Error: promiseResult.reason,
95
+ SubscriberPackageVersionId: targetVersions[index].SubscriberPackageVersionId,
96
+ });
97
+ break;
98
+ }
99
+ });
100
+ this.spinner.stop();
101
+ this.displayDeletionResults(results);
102
+ return results;
103
+ }
104
+ displayDeletionResults(packageCleanupResults) {
105
+ this.styledHeader('Package Version Cleanup Results');
106
+ this.table(packageCleanupResults, {
107
+ SubscriberPackageVersionId: { header: 'PACKAGE VERSION ID' },
108
+ Success: { header: 'SUCCESS' },
109
+ Error: { header: 'ERROR' },
110
+ });
111
+ }
112
+ }
113
+ //# sourceMappingURL=cleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../../../src/commands/simply/package/version/cleanup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,OAAO,EAEP,cAAc,GAGf,MAAM,uBAAuB,CAAC;AAE/B,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,gCAAgC,CAAC,CAAC;AAQrG,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,SAAwC;IAClF,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACnE,uGAAuG;IACvG,qHAAqH;IAC9G,MAAM,CAAU,eAAe,GAAG,IAAI,CAAC;IAEvC,MAAM,CAAU,KAAK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E;YAChC,0BAA0B,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE;YAC5D,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;YAC9B,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE;SAC3B,CAAC,CAAC;IACL,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Connection } from '@salesforce/core';
2
+ import { InstalledPackages, PackagingSObjects } from '@salesforce/packaging';
3
+ type PackageInstallRequest = PackagingSObjects.PackageInstallRequest;
4
+ export declare const PACKAGE_ID_PREFIX = "0Ho";
5
+ export declare const PACKAGE_VERSION_ID_PREFIX = "04t";
6
+ export declare const isPackageId: (inputToEvaluate: string) => boolean;
7
+ export declare const isPackageVersionId: (inputToEvaluate: string) => boolean;
8
+ export declare const isPackageVersionInstalled: (installedPackages: InstalledPackages[], subscriberPackageVersionId: string) => boolean;
9
+ export declare const reducePackageInstallRequestErrors: (request: PackageInstallRequest) => string;
10
+ export declare const resolvePackageVersionId: (packageId: string, versionNumber: string, branch: string, connection: Connection) => Promise<string>;
11
+ export {};
@@ -0,0 +1,71 @@
1
+ /*
2
+ * Copyright (c) 2024, Clay Chipps; Copyright (c) 2024, Salesforce.com, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { SfError } from '@salesforce/core';
8
+ export const PACKAGE_ID_PREFIX = '0Ho';
9
+ export const PACKAGE_VERSION_ID_PREFIX = '04t';
10
+ export const isPackageId = (inputToEvaluate) => inputToEvaluate ? inputToEvaluate.startsWith(PACKAGE_ID_PREFIX) : false;
11
+ export const isPackageVersionId = (inputToEvaluate) => inputToEvaluate ? inputToEvaluate.startsWith(PACKAGE_VERSION_ID_PREFIX) : false;
12
+ export const isPackageVersionInstalled = (installedPackages, subscriberPackageVersionId) => {
13
+ const matchedPackaged = installedPackages.find((installedPackage) => installedPackage?.SubscriberPackageVersion?.Id === subscriberPackageVersionId);
14
+ return matchedPackaged ? true : false;
15
+ };
16
+ export const reducePackageInstallRequestErrors = (request) => {
17
+ let errorMessage = '<empty>';
18
+ const errors = request?.Errors?.errors;
19
+ if (errors?.length) {
20
+ errorMessage = 'Installation errors: ';
21
+ for (let i = 0; i < errors.length; i++) {
22
+ errorMessage += `\n${i + 1}) ${errors[i].message}`;
23
+ }
24
+ }
25
+ return errorMessage;
26
+ };
27
+ export const resolvePackageVersionId = async (packageId, versionNumber, branch, connection) => {
28
+ if (isPackageVersionId(packageId)) {
29
+ return packageId;
30
+ }
31
+ if (!isPackageId(packageId)) {
32
+ throw new SfError('The Package2Id provided is not a valid Package2Id');
33
+ }
34
+ // Strip out the "-LATEST" string as it won't be needed in the query.
35
+ const versionWorking = versionNumber.toUpperCase().replace('-LATEST', '').replace('.LATEST', '');
36
+ // Split the remaining "Major.Minor.Patch.BuildNumber" version number out to its individual integers.
37
+ const versionParts = versionWorking.split('.');
38
+ // Assemble the query needed
39
+ let query = 'SELECT SubscriberPackageVersionId, IsPasswordProtected, IsReleased ';
40
+ query += 'FROM Package2Version ';
41
+ query += `WHERE Package2Id='${packageId}' AND MajorVersion=${versionParts[0]} AND IsDeprecated = FALSE `;
42
+ // If Minor Version isn't set to LATEST, look for the exact Minor Version
43
+ if (versionParts[1]) {
44
+ query += `AND MinorVersion=${versionParts[1]} `;
45
+ }
46
+ // If Patch Version isn't set to LATEST, look for the exact Patch Version
47
+ if (versionParts[2]) {
48
+ query += `AND PatchVersion=${versionParts[2]} `;
49
+ }
50
+ // If Build Number isn't set to LATEST, look for the exact Package Version
51
+ if (versionParts[3]) {
52
+ query += `AND BuildNumber=${versionParts[3]} `;
53
+ }
54
+ // If Branch is specified, use it to filter
55
+ if (branch) {
56
+ query += `AND Branch='${branch.trim()}' `;
57
+ }
58
+ else {
59
+ query += 'AND Branch=NULL ';
60
+ }
61
+ // if the query is looking for a "LATEST", "Non-pinned" version, then we need
62
+ // to sort the result list in such a manner to that the latest version will
63
+ // be the first record in the result set.
64
+ query += 'ORDER BY MajorVersion DESC, MinorVersion DESC, PatchVersion DESC, BuildNumber DESC LIMIT 1';
65
+ const resultPackageVersionRecord = await connection.tooling.query(query);
66
+ if (resultPackageVersionRecord?.records?.length === 0) {
67
+ throw new SfError(`Unable to find SubscriberPackageVersionId for dependent package ${packageId}`);
68
+ }
69
+ return resultPackageVersionRecord.records[0]['SubscriberPackageVersionId'];
70
+ };
71
+ //# sourceMappingURL=packageUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageUtils.js","sourceRoot":"","sources":["../../src/common/packageUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAc,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AACvC,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,eAAuB,EAAW,EAAE,CAC9D,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,eAAuB,EAAW,EAAE,CACrE,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAElF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,iBAAsC,EACtC,0BAAkC,EACzB,EAAE;IACX,MAAM,eAAe,GAAG,iBAAiB,CAAC,IAAI,CAC5C,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,EAAE,wBAAwB,EAAE,EAAE,KAAK,0BAA0B,CACpG,CAAC;IAEF,OAAO,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,CAAC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,CAAC,CAAC,EAAE,CAAC;QACpB,KAAK,IAAI,oBAAoB,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;IAClD,CAAC;IAED,yEAAyE;IACzE,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,KAAK,IAAI,oBAAoB,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;IAClD,CAAC;IAED,0EAA0E;IAC1E,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,KAAK,IAAI,mBAAmB,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;IACjD,CAAC;IAED,2CAA2C;IAC3C,IAAI,MAAM,EAAE,CAAC;QACX,KAAK,IAAI,eAAe,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;IAC5C,CAAC;SAAM,CAAC;QACN,KAAK,IAAI,kBAAkB,CAAC;IAC9B,CAAC;IAED,6EAA6E;IAC7E,4EAA4E;IAC5E,0CAA0C;IAC1C,KAAK,IAAI,4FAA4F,CAAC;IAEtG,MAAM,0BAA0B,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEzE,IAAI,0BAA0B,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,OAAO,CAAC,mEAAmE,SAAS,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,OAAO,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAW,CAAC;AACvF,CAAC,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare const _default: {};
2
+ export default _default;
package/lib/index.js ADDED
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2024, Clay Chipps; Copyright (c) 2024, Salesforce.com, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ export default {};
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAe,EAAE,CAAC"}
@@ -0,0 +1,151 @@
1
+ # summary
2
+
3
+ Install package dependencies for a Salesforce project.
4
+
5
+ # description
6
+
7
+ Installs all specified package dependencies in a Salesforce DX project using the sfdx-project.json definition.
8
+
9
+ # flags.branch.summary
10
+
11
+ Package branch to consider when specifiying a Package/VersionNumber combination
12
+
13
+ # flags.branch.description
14
+
15
+ For dependencies specified by Package/VersionNumber combination, you can specify the branch group of builds to work from by entering the branch build name. If not specified, the builds from NULL branch will be considered.
16
+
17
+ # flags.apex-compile.summary
18
+
19
+ Compile all Apex in the org and package, or only Apex in the package; unlocked packages only.
20
+
21
+ # flags.apex-compile.description
22
+
23
+ Applies to unlocked packages only. Specifies whether to compile all Apex in the org and package, or only the Apex in the package.
24
+
25
+ For package installs into production orgs, or any org that has Apex Compile on Deploy enabled, the platform compiles all Apex in the org after the package install or upgrade operation completes.
26
+
27
+ This approach assures that package installs and upgrades don’t impact the performance of an org, and is done even if --apex-compile package is specified.
28
+
29
+ # flags.install-type.summary
30
+
31
+ Install all packages or only deltas.
32
+
33
+ # flags.install-type.description
34
+
35
+ If 'All' is specified, then all packages specified in package dependencies are installed, regardless of if the version already is installed in the org. If 'Delta' is specified, then only packages that differ from what is installed in the org will be installed.
36
+
37
+ # flags.installation-key.summary
38
+
39
+ Installation key for key-protected packages
40
+
41
+ # flags.installation-key.description
42
+
43
+ Installation key for key-protected packages in the key:value format of SubscriberPackageVersionId:Key
44
+
45
+ # flags.no-prompt.summary
46
+
47
+ Don't prompt for confirmation.
48
+
49
+ # flags.no-prompt.description
50
+
51
+ Allows the following without an explicit confirmation response: 1) Remote Site Settings and Content Security Policy websites to send or receive data, and 2) --upgrade-type Delete to proceed.
52
+
53
+ # flags.publish-wait.summary
54
+
55
+ Maximum number of minutes to wait for the Subscriber Package Version ID to become available in the target org before canceling the install request.
56
+
57
+ # flags.security-type.summary
58
+
59
+ Security access type for the installed package. (deprecation notice: The default --security-type value will change from AllUsers to AdminsOnly in v47.0 or later.)
60
+
61
+ # flags.skip-handlers.summary
62
+
63
+ Skip install handlers (available handlers: FeatureEnforcement).
64
+
65
+ # flags.skip-handlers.description
66
+
67
+ Allows the installer of a package to optionally skip install handlers in order to decrease overall installation time (available handlers: FeatureEnforcement).
68
+
69
+ # flags.target-dev-hub.summary
70
+
71
+ Username or alias of the Dev Hub org.
72
+
73
+ # flags.upgrade-type.summary
74
+
75
+ Upgrade type for the package installation; available only for unlocked packages.
76
+
77
+ # flags.upgrade-type.description
78
+
79
+ For package upgrades, specifies whether to mark all removed components as deprecated (DeprecateOnly), to delete removed components that can be safely deleted and deprecate the others (Mixed), or to delete all removed components, except for custom objects and custom fields, that don't have dependencies (Delete). The default is Mixed. Can specify DeprecateOnly or Delete only for unlocked package upgrades.
80
+
81
+ # flags.wait.summary
82
+
83
+ Number of minutes to wait for installation status.
84
+
85
+ # examples
86
+
87
+ - <%= config.bin %> <%= command.id %> --target-org myTargetOrg --target-dev-hub myTargetDevHub
88
+
89
+ - <%= config.bin %> <%= command.id %> --target-org myTargetOrg --target-dev-hub myTargetDevHub --installation-key "MyPackage1Alias:MyPackage1Key"
90
+
91
+ - <%= config.bin %> <%= command.id %> --target-org myTargetOrg --target-dev-hub myTargetDevHub --installation-key "MyPackage1Alias:MyPackage1Key" --installation-key "MyPackage2Alias:MyPackage2Key"
92
+
93
+ # error.apiVersionTooLow
94
+
95
+ This command is supported only on API versions 36.0 and higher.
96
+
97
+ # error.installationKeyFormat
98
+
99
+ Installation Key should have the key:value format of SubscriberPackageVersionId:Key.
100
+
101
+ You can use an alias in place of the SubscriberPackageVersionId.
102
+
103
+ # error.invalidPackage2Id
104
+
105
+ Unable to determine a valid Package2Id for %s.
106
+
107
+ # error.invalidSubscriberPackageVersionId
108
+
109
+ Unable to determine a valid SubscriberPackageVersionId for %s.
110
+
111
+ # error.packageInstall
112
+
113
+ Encountered errors installing the package! %s
114
+
115
+ # error.packageInstallInProgress
116
+
117
+ The package install is still In-Progress, so subsuequent dependencies cannot be installed yet. You can query the status using %s package install report -i %s -o %s.
118
+
119
+ # error.packageInstallPollingTimeout
120
+
121
+ Polling timeout exceeded
122
+
123
+ # error.targetDevHubConnectionFailed
124
+
125
+ Unable to establish connection to the org.
126
+
127
+ # error.targetDevHubMissing
128
+
129
+ This command requires a DevHub to be specified if providing a Package2Id and VersionNumber instead of a SubscriberPackageVersionId.
130
+
131
+ # error.targetOrgConnectionFailed
132
+
133
+ Unable to establish connection to the org.
134
+
135
+ # info.canceledPackageInstall
136
+
137
+ We canceled this package installation per your request.
138
+
139
+ # prompt.enableRss
140
+
141
+ This package might send or receive data from these third-party websites:
142
+
143
+ [%s]
144
+
145
+ Grant access (y/n)?
146
+
147
+ # prompt.upgradeType
148
+
149
+ The Delete upgrade type permanently deletes metadata types that have been removed from the package. Deleted metadata can’t be recovered. We don't delete custom objects and custom fields. Instead, we deprecate them.
150
+
151
+ Do you want to continue? (y/n)
@@ -0,0 +1,39 @@
1
+ # summary
2
+
3
+ Cleanup package versions.
4
+
5
+ # description
6
+
7
+ Delete package versions for a given package provided a MAJOR.MINOR.PATCH matcher. Does not delete released pacakge versions.
8
+
9
+ # flags.package.summary
10
+
11
+ Package Id
12
+
13
+ # flags.package.description
14
+
15
+ The 0Ht Package Id that you wish to cleanup versions for.
16
+
17
+ # flags.matcher.summary
18
+
19
+ MAJOR.MINOR.PATCH
20
+
21
+ # flags.matcher.description
22
+
23
+ The MAJOR.MINOR.PATCH matcher that should be used to find package versions to delete.
24
+
25
+ # examples
26
+
27
+ - <%= config.bin %> <%= command.id %> --package 0Hoxx00000000CqCAI --matcher 2.10.0 --target-dev-hub myDevHub
28
+
29
+ # errors.connectionFailed
30
+
31
+ Unable to establish connection to the org.
32
+
33
+ # errors.matcherFormatMismatch
34
+
35
+ The matcher must be in the format of MAJOR.MINOR.PATCH.
36
+
37
+ # errors.deletionJob
38
+
39
+ There was an unexpected error performing the deletion job.