@simplysf/simply-cicd-core 0.10.0 → 0.10.1
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/lib/build/devHubs.d.ts +9 -1
- package/lib/build/devHubs.js +20 -2
- package/lib/build/devHubs.js.map +1 -1
- package/lib/resolveOrg.d.ts +3 -1
- package/lib/resolveOrg.js +9 -3
- package/lib/resolveOrg.js.map +1 -1
- package/package.json +2 -2
package/lib/build/devHubs.d.ts
CHANGED
|
@@ -8,5 +8,13 @@ export type ResolvedDevHub = {
|
|
|
8
8
|
/** Only present when the Dev Hub was JWT-authenticated. */
|
|
9
9
|
privateKeyFile?: string;
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Resolves multiple Dev Hub aliases in parallel. Each must already be authenticated.
|
|
13
|
+
*
|
|
14
|
+
* A blank entry is skipped with a warning rather than failing the run: it's what an unset CI
|
|
15
|
+
* variable produces (`--dev-hub "$BACKUP_DEVHUB"`), and the remaining Dev Hubs can still be used.
|
|
16
|
+
*
|
|
17
|
+
* @throws {SfError} `NoDevHubGivenError` if every entry is blank; `NamedOrgNotFoundError` if no
|
|
18
|
+
* auth exists for an alias or username.
|
|
19
|
+
*/
|
|
12
20
|
export declare function resolveDevHubs(aliases: string[]): Promise<ResolvedDevHub[]>;
|
package/lib/build/devHubs.js
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { SfError } from '@salesforce/core';
|
|
17
|
+
import { logger } from '../logger.js';
|
|
16
18
|
import { resolveAuthInfo } from '../resolveOrg.js';
|
|
17
19
|
/**
|
|
18
20
|
* Resolves a Dev Hub alias or username to its already-authenticated config. `simply-cicd` never
|
|
@@ -35,8 +37,24 @@ async function resolveDevHub(alias) {
|
|
|
35
37
|
privateKeyFile: fields.privateKey,
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Resolves multiple Dev Hub aliases in parallel. Each must already be authenticated.
|
|
42
|
+
*
|
|
43
|
+
* A blank entry is skipped with a warning rather than failing the run: it's what an unset CI
|
|
44
|
+
* variable produces (`--dev-hub "$BACKUP_DEVHUB"`), and the remaining Dev Hubs can still be used.
|
|
45
|
+
*
|
|
46
|
+
* @throws {SfError} `NoDevHubGivenError` if every entry is blank; `NamedOrgNotFoundError` if no
|
|
47
|
+
* auth exists for an alias or username.
|
|
48
|
+
*/
|
|
39
49
|
export async function resolveDevHubs(aliases) {
|
|
40
|
-
|
|
50
|
+
const given = aliases.map((alias) => alias.trim()).filter((alias) => alias.length > 0);
|
|
51
|
+
const blanks = aliases.length - given.length;
|
|
52
|
+
if (blanks > 0) {
|
|
53
|
+
logger.warn(`Ignoring ${blanks} empty --dev-hub value${blanks === 1 ? '' : 's'} (an unset CI variable passed as --dev-hub?).`);
|
|
54
|
+
if (given.length === 0) {
|
|
55
|
+
throw new SfError('Every --dev-hub value is empty. Pass the alias or username of an authenticated Dev Hub, and check that the CI variable it comes from is set in this job.', 'NoDevHubGivenError');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return Promise.all(given.map(resolveDevHub));
|
|
41
59
|
}
|
|
42
60
|
//# sourceMappingURL=devHubs.js.map
|
package/lib/build/devHubs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devHubs.js","sourceRoot":"","sources":["../../src/build/devHubs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAanD;;;;;;;;;GASG;AACH,KAAK,UAAU,aAAa,CAAC,KAAa;IACxC,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;IAEpC,OAA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C;QACf,MAAM,CAAC,IAAI,CACT,YAAY,MAAM,yBAAyB,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,+CAA+C,CAClH,CAAC;QACF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,OAAO,CACf,0JAA0J,EAC1J,oBAAoB,CACrB,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
package/lib/resolveOrg.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export declare function resolveOrg(aliasOrUsername?: string, options?: ResolveOr
|
|
|
20
20
|
* The saved auth for an alias or username, without connecting to the org. `AuthInfo.create` only
|
|
21
21
|
* accepts a username, so an alias is resolved to its username first.
|
|
22
22
|
*
|
|
23
|
-
* @throws {SfError} `NamedOrgNotFoundError` if no auth exists for the alias/username
|
|
23
|
+
* @throws {SfError} `NamedOrgNotFoundError` if no auth exists for the alias/username;
|
|
24
|
+
* `NoUsernameFoundError` if it's blank (rather than `AuthInfo.create`'s unhelpful
|
|
25
|
+
* `AuthInfoCreationError`).
|
|
24
26
|
*/
|
|
25
27
|
export declare function resolveAuthInfo(aliasOrUsername: string): Promise<AuthInfo>;
|
package/lib/resolveOrg.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { AuthInfo, ConfigAggregator, Org, StateAggregator } from '@salesforce/core';
|
|
16
|
+
import { AuthInfo, ConfigAggregator, Org, SfError, StateAggregator } from '@salesforce/core';
|
|
17
17
|
/**
|
|
18
18
|
* The authenticated org that an `--alias`/`--target-org`-style value names, resolved the way `sf`
|
|
19
19
|
* resolves `--target-org`: an alias or the username of an existing auth, with a blank value meaning
|
|
@@ -39,10 +39,16 @@ export async function resolveOrg(aliasOrUsername, options = {}) {
|
|
|
39
39
|
* The saved auth for an alias or username, without connecting to the org. `AuthInfo.create` only
|
|
40
40
|
* accepts a username, so an alias is resolved to its username first.
|
|
41
41
|
*
|
|
42
|
-
* @throws {SfError} `NamedOrgNotFoundError` if no auth exists for the alias/username
|
|
42
|
+
* @throws {SfError} `NamedOrgNotFoundError` if no auth exists for the alias/username;
|
|
43
|
+
* `NoUsernameFoundError` if it's blank (rather than `AuthInfo.create`'s unhelpful
|
|
44
|
+
* `AuthInfoCreationError`).
|
|
43
45
|
*/
|
|
44
46
|
export async function resolveAuthInfo(aliasOrUsername) {
|
|
47
|
+
const name = aliasOrUsername.trim();
|
|
48
|
+
if (!name) {
|
|
49
|
+
throw new SfError('No org alias or username was given (it was empty).', 'NoUsernameFoundError');
|
|
50
|
+
}
|
|
45
51
|
const stateAggregator = await StateAggregator.getInstance();
|
|
46
|
-
return AuthInfo.create({ username: stateAggregator.aliases.resolveUsername(
|
|
52
|
+
return AuthInfo.create({ username: stateAggregator.aliases.resolveUsername(name) });
|
|
47
53
|
}
|
|
48
54
|
//# sourceMappingURL=resolveOrg.js.map
|
package/lib/resolveOrg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveOrg.js","sourceRoot":"","sources":["../src/resolveOrg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"resolveOrg.js","sourceRoot":"","sources":["../src/resolveOrg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAO7F;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,eAAwB,EAAE,UAA6B,EAAE;IACxF,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,IAAI,GAAG,eAAe,EAAE,IAAI,EAAE,CAAC;IACrC,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACpE,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,eAAuB;IAC3D,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,EAAE,CAAC;IACpC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,OAAO,CAAC,oDAAoD,EAAE,sBAAsB,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,eAAe,GAAG,MAAM,eAAe,CAAC,WAAW,EAAE,CAAC;IAC5D,OAAO,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysf/simply-cicd-core",
|
|
3
3
|
"description": "The library layer behind @simplysf/simply-cicd: build/deploy/notify pipeline stages, sfdx-dependabot, ALM issue linking (Jira, GitLab Issues) and VCS API clients (GitHub, GitLab) — published separately for direct consumption (e.g. a bot or script) without the CLI framework",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.1",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply-plugins-core",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply-plugins-core/issues",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"output": []
|
|
143
143
|
}
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "6628627030fcc8994b4ec95272a0a824d3f3bc58"
|
|
146
146
|
}
|