@salesforce/plugin-org 2.2.23 → 2.2.25

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.
Files changed (103) hide show
  1. package/README.md +4 -0
  2. package/lib/commands/force/org/clone.d.ts +21 -9
  3. package/lib/commands/force/org/clone.js +50 -82
  4. package/lib/commands/force/org/clone.js.map +1 -1
  5. package/lib/commands/force/org/create.d.ts +27 -12
  6. package/lib/commands/force/org/create.js +85 -105
  7. package/lib/commands/force/org/create.js.map +1 -1
  8. package/lib/commands/force/org/delete.d.ts +14 -7
  9. package/lib/commands/force/org/delete.js +26 -16
  10. package/lib/commands/force/org/delete.js.map +1 -1
  11. package/lib/commands/force/org/status.d.ts +18 -6
  12. package/lib/commands/force/org/status.js +43 -37
  13. package/lib/commands/force/org/status.js.map +1 -1
  14. package/lib/commands/org/create/sandbox.d.ts +40 -0
  15. package/lib/commands/org/create/sandbox.js +244 -0
  16. package/lib/commands/org/create/sandbox.js.map +1 -0
  17. package/lib/commands/org/create/scratch.d.ts +30 -0
  18. package/lib/commands/org/create/scratch.js +183 -0
  19. package/lib/commands/org/create/scratch.js.map +1 -0
  20. package/lib/commands/org/delete/sandbox.d.ts +18 -0
  21. package/lib/commands/org/delete/sandbox.js +59 -0
  22. package/lib/commands/org/delete/sandbox.js.map +1 -0
  23. package/lib/commands/org/delete/scratch.d.ts +18 -0
  24. package/lib/commands/org/delete/scratch.js +52 -0
  25. package/lib/commands/org/delete/scratch.js.map +1 -0
  26. package/lib/commands/org/display.d.ts +20 -0
  27. package/lib/commands/{force/org → org}/display.js +38 -27
  28. package/lib/commands/org/display.js.map +1 -0
  29. package/lib/commands/org/list.d.ts +26 -0
  30. package/lib/commands/org/list.js +192 -0
  31. package/lib/commands/org/list.js.map +1 -0
  32. package/lib/commands/org/open.d.ts +25 -0
  33. package/lib/commands/{force/org → org}/open.js +47 -33
  34. package/lib/commands/org/open.js.map +1 -0
  35. package/lib/commands/org/resume/sandbox.d.ts +26 -0
  36. package/lib/commands/org/resume/sandbox.js +199 -0
  37. package/lib/commands/org/resume/sandbox.js.map +1 -0
  38. package/lib/commands/org/resume/scratch.d.ts +14 -0
  39. package/lib/commands/org/resume/scratch.js +61 -0
  40. package/lib/commands/org/resume/scratch.js.map +1 -0
  41. package/lib/shared/orgHighlighter.d.ts +2 -2
  42. package/lib/shared/orgHighlighter.js +7 -5
  43. package/lib/shared/orgHighlighter.js.map +1 -1
  44. package/lib/shared/orgHooks.d.ts +24 -0
  45. package/lib/shared/orgHooks.js +9 -0
  46. package/lib/shared/orgHooks.js.map +1 -0
  47. package/lib/shared/orgListUtil.d.ts +15 -25
  48. package/lib/shared/orgListUtil.js +71 -81
  49. package/lib/shared/orgListUtil.js.map +1 -1
  50. package/lib/shared/orgTypes.d.ts +39 -11
  51. package/lib/shared/sandboxCommandBase.d.ts +33 -0
  52. package/lib/shared/sandboxCommandBase.js +168 -0
  53. package/lib/shared/sandboxCommandBase.js.map +1 -0
  54. package/lib/shared/sandboxProgress.d.ts +28 -0
  55. package/lib/shared/sandboxProgress.js +104 -0
  56. package/lib/shared/sandboxProgress.js.map +1 -0
  57. package/lib/shared/sandboxReporter.d.ts +1 -1
  58. package/lib/shared/sandboxRequest.d.ts +9 -0
  59. package/lib/shared/sandboxRequest.js +58 -0
  60. package/lib/shared/sandboxRequest.js.map +1 -0
  61. package/lib/shared/scratchOrgOutput.d.ts +9 -0
  62. package/lib/shared/scratchOrgOutput.js +47 -0
  63. package/lib/shared/scratchOrgOutput.js.map +1 -0
  64. package/lib/shared/stagedProgress.d.ts +33 -0
  65. package/lib/shared/stagedProgress.js +98 -0
  66. package/lib/shared/stagedProgress.js.map +1 -0
  67. package/lib/shared/timeUtils.d.ts +10 -0
  68. package/lib/shared/timeUtils.js +37 -0
  69. package/lib/shared/timeUtils.js.map +1 -0
  70. package/lib/shared/utils.d.ts +1 -1
  71. package/lib/shared/utils.js.map +1 -1
  72. package/messages/clone.md +67 -0
  73. package/messages/create.md +125 -0
  74. package/messages/create.sandbox.md +123 -0
  75. package/messages/create_scratch.md +109 -0
  76. package/messages/delete.md +47 -0
  77. package/messages/delete_sandbox.md +46 -0
  78. package/messages/delete_scratch.md +42 -0
  79. package/messages/display.md +33 -0
  80. package/messages/list.md +65 -0
  81. package/messages/messages.md +81 -0
  82. package/messages/open.md +63 -0
  83. package/messages/resume.sandbox.md +71 -0
  84. package/messages/resume_scratch.md +41 -0
  85. package/messages/sandboxbase.md +17 -0
  86. package/messages/status.md +33 -0
  87. package/oclif.manifest.json +1194 -1
  88. package/package.json +138 -28
  89. package/lib/commands/force/org/display.d.ts +0 -11
  90. package/lib/commands/force/org/display.js.map +0 -1
  91. package/lib/commands/force/org/list.d.ts +0 -15
  92. package/lib/commands/force/org/list.js +0 -191
  93. package/lib/commands/force/org/list.js.map +0 -1
  94. package/lib/commands/force/org/open.d.ts +0 -15
  95. package/lib/commands/force/org/open.js.map +0 -1
  96. package/messages/clone.json +0 -24
  97. package/messages/create.json +0 -37
  98. package/messages/delete.json +0 -13
  99. package/messages/display.json +0 -11
  100. package/messages/list.json +0 -19
  101. package/messages/messages.json +0 -24
  102. package/messages/open.json +0 -19
  103. package/messages/status.json +0 -13
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2020, 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
+ const node_assert_1 = require("node:assert");
10
+ const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
11
+ const core_1 = require("@salesforce/core");
12
+ const scratchOrgOutput_1 = require("../../../shared/scratchOrgOutput");
13
+ core_1.Messages.importMessagesDirectory(__dirname);
14
+ const messages = core_1.Messages.loadMessages('@salesforce/plugin-org', 'resume_scratch');
15
+ class EnvResumeScratch extends sf_plugins_core_1.SfCommand {
16
+ async run() {
17
+ const { flags } = await this.parse(EnvResumeScratch);
18
+ const cache = await core_1.ScratchOrgCache.create();
19
+ const lifecycle = core_1.Lifecycle.getInstance();
20
+ const jobId = flags['use-most-recent'] ? cache.getLatestKey() : flags['job-id'];
21
+ if (!jobId && flags['use-most-recent'])
22
+ throw messages.createError('error.NoRecentJobId');
23
+ // oclif doesn't know that the exactlyOne flag will ensure that one of these is set, and there we definitely have a jobID.
24
+ (0, node_assert_1.strict)(jobId);
25
+ const { hubBaseUrl } = cache.get(jobId);
26
+ let lastStatus;
27
+ lifecycle.on(core_1.scratchOrgLifecycleEventName, async (data) => {
28
+ lastStatus = (0, scratchOrgOutput_1.buildStatus)(data, hubBaseUrl);
29
+ this.spinner.status = lastStatus;
30
+ return Promise.resolve();
31
+ });
32
+ this.log();
33
+ this.spinner.start('Creating Scratch Org');
34
+ const { username, scratchOrgInfo, authFields, warnings } = await (0, core_1.scratchOrgResume)(jobId);
35
+ this.spinner.stop(lastStatus);
36
+ this.log();
37
+ this.logSuccess(messages.getMessage('success'));
38
+ return { username, scratchOrgInfo, authFields, warnings, orgId: scratchOrgInfo?.Id };
39
+ }
40
+ }
41
+ exports.default = EnvResumeScratch;
42
+ EnvResumeScratch.summary = messages.getMessage('summary');
43
+ EnvResumeScratch.description = messages.getMessage('description');
44
+ EnvResumeScratch.examples = messages.getMessages('examples');
45
+ EnvResumeScratch.aliases = ['env:resume:scratch'];
46
+ EnvResumeScratch.deprecateAliases = true;
47
+ EnvResumeScratch.flags = {
48
+ 'job-id': sf_plugins_core_1.Flags.salesforceId({
49
+ char: 'i',
50
+ summary: messages.getMessage('flags.job-id.summary'),
51
+ description: messages.getMessage('flags.job-id.description'),
52
+ exactlyOne: ['use-most-recent', 'job-id'],
53
+ startsWith: '2SR',
54
+ }),
55
+ 'use-most-recent': sf_plugins_core_1.Flags.boolean({
56
+ char: 'r',
57
+ summary: messages.getMessage('flags.use-most-recent.summary'),
58
+ exactlyOne: ['use-most-recent', 'job-id'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B,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC;QAC7D,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;KAC1C,CAAC;CACH,CAAC"}
@@ -1,3 +1,3 @@
1
- import { ExtendedAuthFields } from './orgTypes';
1
+ import { ExtendedAuthFields, FullyPopulatedScratchOrgFields } from './orgTypes';
2
2
  export declare const getStyledValue: (key: string, value: string) => string;
3
- export declare const getStyledObject: (objectToStyle: ExtendedAuthFields) => ExtendedAuthFields;
3
+ export declare const getStyledObject: (objectToStyle: ExtendedAuthFields | FullyPopulatedScratchOrgFields | Record<string, string>) => Record<string, string>;
@@ -25,12 +25,14 @@ const styledProperties = new Map([
25
25
  ],
26
26
  ]);
27
27
  const getStyledValue = (key, value) => {
28
- if (!value || !styledProperties.has(key)) {
28
+ if (!value)
29
29
  return value;
30
- }
31
- return styledProperties.get(key).has(value)
32
- ? styledProperties.get(key).get(value)(value)
33
- : styledProperties.get(key).get('else')(value);
30
+ const prop = styledProperties.get(key);
31
+ if (!prop)
32
+ return value;
33
+ // I'm not sure how to type the inner Map so that it knows else is definitely there
34
+ const chalkMethod = prop.get(value) ?? prop.get('else');
35
+ return chalkMethod(value);
34
36
  };
35
37
  exports.getStyledValue = getStyledValue;
36
38
  const getStyledObject = (objectToStyle) => {
@@ -1 +1 @@
1
- {"version":3,"file":"orgHighlighter.js","sourceRoot":"","sources":["../../src/shared/orgHighlighter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,+BAA+B;AAG/B,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B;QACE,QAAQ;QACR,IAAI,GAAG,CAAC;YACN,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC;YACvB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;SACpB,CAAC;KACH;IACD;QACE,iBAAiB;QACjB,IAAI,GAAG,CAAC;YACN,CAAC,WAAW,E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K,CAAC,KAAK,CAAC;YACvB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;SACpB,CAAC;KACH;IACD;QACE,iBAAiB;QACjB,IAAI,GAAG,CAAC;YACN,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC;YAC1B,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;SACpB,CAAC;KACH;CACF,CAAC,CAAC;AAEI,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,KAAa,EAAU,EAAE;IACnE,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAExB,mFAAmF;IACnF,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAK,IAAI,CAAC,GAAG,CAAC,MAAM,CAAiB,CAAC;IACzE,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB;AAEK,MAAM,eAAe,GAAG,CAC7B,aAA2F,EACnE,EAAE;IAC1B,MAAM,YAAY,GAAG,EAAE,GAAG,aAAa,EAAE,CAAC;IAC1C,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAA,sBAAc,EAAC,GAAG,EAAE,KAAe,CAAC,CAAC,CAAC,CAChG,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
@@ -0,0 +1,24 @@
1
+ import { Optional } from '@salesforce/ts-types';
2
+ import { AuthFields } from '@salesforce/core';
3
+ import { Command, Hook, Hooks } from '@oclif/core/lib/interfaces';
4
+ type HookOpts<T> = {
5
+ options: {
6
+ Command: Command.Class;
7
+ argv: string[];
8
+ commandId: string;
9
+ };
10
+ return: Optional<T>;
11
+ };
12
+ export type OrgCreateResult = Pick<AuthFields, 'accessToken' | 'clientId' | 'created' | 'createdOrgInstance' | 'devHubUsername' | 'expirationDate' | 'instanceUrl' | 'loginUrl' | 'orgId' | 'username'>;
13
+ type PostOrgCreateOpts = HookOpts<OrgCreateResult>;
14
+ /**
15
+ * Extends OCLIF's Hooks interface to add types for hooks that run on org commands
16
+ */
17
+ export interface OrgHooks extends Hooks {
18
+ postorgcreate: PostOrgCreateOpts;
19
+ }
20
+ export type OrgHook<T> = (this: Hook.Context, options: T extends keyof Hooks ? OrgHooks[T] : T) => any;
21
+ export declare namespace OrgHook {
22
+ type PostOrgCreate = Hook<OrgHooks['postorgcreate']>;
23
+ }
24
+ export {};
@@ -0,0 +1,9 @@
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
+ //# sourceMappingURL=orgHooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orgHooks.js","sourceRoot":"","sources":["../../src/shared/orgHooks.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
@@ -1,17 +1,17 @@
1
- import { AuthInfo, AuthFields, Logger } from '@salesforce/core';
2
- import { Dictionary, JsonMap } from '@salesforce/ts-types';
1
+ import { AuthInfo, Logger } from '@salesforce/core';
2
+ import { Dictionary } from '@salesforce/ts-types';
3
3
  import { Record } from 'jsforce';
4
- import { ScratchOrgInfoSObject, ExtendedAuthFields } from './orgTypes';
4
+ import { ScratchOrgInfoSObject, ExtendedAuthFields, ExtendedAuthFieldsScratch, FullyPopulatedScratchOrgFields } from './orgTypes';
5
5
  type OrgGroups = {
6
6
  nonScratchOrgs: ExtendedAuthFields[];
7
- scratchOrgs: ExtendedAuthFields[];
7
+ scratchOrgs: ExtendedAuthFieldsScratch[];
8
8
  };
9
- type ExtendedScratchOrgInfo = ScratchOrgInfoSObject & {
9
+ type OrgGroupsFullyPopulated = {
10
+ nonScratchOrgs: ExtendedAuthFields[];
11
+ scratchOrgs: FullyPopulatedScratchOrgFields[];
12
+ };
13
+ type ExtendedScratchOrgInfo = Record & ScratchOrgInfoSObject & {
10
14
  devHubOrgId: string;
11
- attributes: {
12
- type: string;
13
- url: string;
14
- };
15
15
  };
16
16
  export declare class OrgListUtil {
17
17
  private static logger;
@@ -24,14 +24,14 @@ export declare class OrgListUtil {
24
24
  * @param {string[]|null} userFilenames- an array of strings that are validated against the server.
25
25
  * @param {object} flags - the result of this.flags on an sfdx command
26
26
  */
27
- static readLocallyValidatedMetaConfigsGroupedByOrgType(userFilenames: string[], flags: Dictionary<string | boolean>): Promise<OrgGroups>;
27
+ static readLocallyValidatedMetaConfigsGroupedByOrgType(userFilenames: string[], flags: Dictionary<string | boolean>): Promise<OrgGroupsFullyPopulated>;
28
28
  /**
29
29
  * Organizes the scratchOrgs by DevHub to optimize calls to retrieveScratchOrgInfoFromDevHub(), then calls reduceScratchOrgInfo()
30
30
  *
31
31
  * @param {ExtendedAuthFields[]} scratchOrgs- an array of strings that are validated against the server.
32
32
  * @returns the same scratch org list, but with updated information from the server.
33
33
  */
34
- static processScratchOrgs(scratchOrgs: ExtendedAuthFields[]): Promise<ExtendedAuthFields[]>;
34
+ static processScratchOrgs(scratchOrgs: ExtendedAuthFieldsScratch[]): Promise<FullyPopulatedScratchOrgFields[]>;
35
35
  /**
36
36
  * Used to retrieve authInfo of the auth files
37
37
  *
@@ -47,18 +47,8 @@ export declare class OrgListUtil {
47
47
  * @private
48
48
  */
49
49
  static groupOrgs(authInfos: AuthInfo[]): Promise<OrgGroups>;
50
- /**
51
- * Helper utility to remove sensitive information from a scratch org auth config. By default refreshTokens and client secrets are removed.
52
- *
53
- * @param {*} config - scratch org auth object.
54
- * @param {string[]} properties - properties to exclude ex ['refreshToken', 'clientSecret']
55
- * @returns the config less the sensitive information.
56
- */
57
- static removeRestrictedInfoFromConfig(config: AuthFields, properties?: string[]): AuthFields;
58
- /** Identify the default orgs */
59
- static identifyDefaultOrgs(orgInfo: ExtendedAuthFields, config: JsonMap): void;
60
- static retrieveScratchOrgInfoFromDevHub(devHubUsername: string, orgIdsToQuery: string[]): Promise<Array<Partial<Record> & ExtendedScratchOrgInfo>>;
61
- static reduceScratchOrgInfo(updatedContents: Array<Partial<Record> & ExtendedScratchOrgInfo>, orgs: ExtendedAuthFields[]): Promise<ExtendedAuthFields[]>;
50
+ static retrieveScratchOrgInfoFromDevHub(devHubUsername: string, orgIdsToQuery: string[]): Promise<ExtendedScratchOrgInfo[]>;
51
+ static reduceScratchOrgInfo(updatedContents: Array<Partial<Record> & ExtendedScratchOrgInfo>, orgs: ExtendedAuthFieldsScratch[]): Promise<FullyPopulatedScratchOrgFields[]>;
62
52
  /**
63
53
  * Asks the org if it's a devHub. Because the dev hub setting can't be deactivated, only ask orgs that aren't already stored as hubs.
64
54
  * This has a number of side effects, including updating the AuthInfo files and
@@ -73,7 +63,7 @@ export declare class OrgListUtil {
73
63
  * @param username The username used when the org was authenticated
74
64
  * @returns {Promise.<string>}
75
65
  */
76
- static determineConnectedStatusForNonScratchOrg(username: string): Promise<string>;
66
+ static determineConnectedStatusForNonScratchOrg(username: string): Promise<string | undefined>;
77
67
  }
78
- export declare const identifyActiveOrgByStatus: (org: ExtendedAuthFields) => boolean;
68
+ export declare const identifyActiveOrgByStatus: (org: FullyPopulatedScratchOrgFields) => boolean;
79
69
  export {};
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.identifyActiveOrgByStatus = exports.OrgListUtil = void 0;
4
2
  /*
5
3
  * Copyright (c) 2020, salesforce.com, inc.
6
4
  * All rights reserved.
7
5
  * Licensed under the BSD 3-Clause license.
8
6
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
7
  */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.identifyActiveOrgByStatus = exports.OrgListUtil = void 0;
10
10
  const path_1 = require("path");
11
11
  const fs = require("fs/promises");
12
12
  const core_1 = require("@salesforce/core");
13
+ const ts_types_1 = require("@salesforce/ts-types");
13
14
  const lib_1 = require("@salesforce/kit/lib");
14
15
  const utils_1 = require("./utils");
15
16
  class OrgListUtil {
@@ -33,7 +34,7 @@ class OrgListUtil {
33
34
  // parallelize two very independent operations
34
35
  const [nonScratchOrgs, scratchOrgs] = await Promise.all([
35
36
  Promise.all(orgs.nonScratchOrgs.map(async (fields) => {
36
- if (!flags.skipconnectionstatus) {
37
+ if (!flags.skipconnectionstatus && fields.username) {
37
38
  // skip completely if we're skipping the connection
38
39
  fields.connectedStatus = await OrgListUtil.determineConnectedStatusForNonScratchOrg(fields.username);
39
40
  if (!fields.isDevHub && fields.connectedStatus === 'Connected') {
@@ -57,13 +58,11 @@ class OrgListUtil {
57
58
  * @returns the same scratch org list, but with updated information from the server.
58
59
  */
59
60
  static async processScratchOrgs(scratchOrgs) {
60
- const orgIdsGroupedByDevHub = scratchOrgs
61
- .filter((fields) => fields.devHubUsername)
62
- .reduce((accum, fields) => {
63
- accum[fields.devHubUsername] = [...(accum[fields.devHubUsername] ?? []), core_1.sfdc.trimTo15(fields.orgId)];
64
- return accum;
65
- }, {});
66
- const updatedContents = (await Promise.all(Object.entries(orgIdsGroupedByDevHub).map(async ([devHubUsername, orgIds]) => OrgListUtil.retrieveScratchOrgInfoFromDevHub(devHubUsername, orgIds)))).reduce((accumulator, iterator) => [...accumulator, ...iterator], []);
61
+ const orgIdsGroupedByDevHub = new Map();
62
+ scratchOrgs.forEach((fields) => {
63
+ orgIdsGroupedByDevHub.set(fields.devHubUsername, (orgIdsGroupedByDevHub.get(fields.devHubUsername) ?? []).concat([(0, core_1.trimTo15)(fields.orgId)]));
64
+ });
65
+ const updatedContents = (await Promise.all(Array.from(orgIdsGroupedByDevHub).map(([devHubUsername, orgIds]) => OrgListUtil.retrieveScratchOrgInfoFromDevHub(devHubUsername, orgIds)))).reduce((accumulator, iterator) => [...accumulator, ...iterator], []);
67
66
  return OrgListUtil.reduceScratchOrgInfo(updatedContents, scratchOrgs);
68
67
  }
69
68
  /**
@@ -104,7 +103,7 @@ class OrgListUtil {
104
103
  logger.warn(err.message);
105
104
  }
106
105
  }));
107
- return allAuths.filter((auth) => !!auth);
106
+ return allAuths.filter((ts_types_1.isObject));
108
107
  }
109
108
  /**
110
109
  * Helper to group orgs by {scratchOrg, nonScratchOrgs}
@@ -115,58 +114,33 @@ class OrgListUtil {
115
114
  * @private
116
115
  */
117
116
  static async groupOrgs(authInfos) {
118
- const output = {
119
- scratchOrgs: [],
120
- nonScratchOrgs: [],
121
- };
122
- const config = (await core_1.SfdxConfigAggregator.create()).getConfig();
123
- for (const authInfo of authInfos) {
117
+ const configAggregator = await core_1.SfdxConfigAggregator.create();
118
+ const results = await Promise.all(authInfos.map(async (authInfo) => {
119
+ // for (const authInfo of authInfos) {
124
120
  let currentValue;
125
121
  try {
126
- currentValue = OrgListUtil.removeRestrictedInfoFromConfig(authInfo.getFields(true));
122
+ // we're going to assert that these have a username/orgId because they came from the auth files
123
+ currentValue = removeRestrictedInfoFromConfig(authInfo.getFields(true));
127
124
  }
128
125
  catch (error) {
129
- // eslint-disable-next-line no-await-in-loop
130
126
  const logger = await OrgListUtil.retrieveLogger();
131
127
  logger.warn(`Error decrypting ${authInfo.getUsername()}`);
132
- currentValue = OrgListUtil.removeRestrictedInfoFromConfig(authInfo.getFields());
128
+ currentValue = removeRestrictedInfoFromConfig(authInfo.getFields());
133
129
  }
134
- // eslint-disable-next-line no-await-in-loop
135
130
  const [alias, lastUsed] = await Promise.all([
136
131
  (0, utils_1.getAliasByUsername)(currentValue.username),
137
132
  fs.stat((0, path_1.join)(core_1.Global.SFDX_DIR, `${currentValue.username}.json`)),
138
133
  ]);
139
- currentValue.alias = alias;
140
- currentValue.lastUsed = lastUsed.atime;
141
- OrgListUtil.identifyDefaultOrgs(currentValue, config);
142
- if (currentValue.devHubUsername) {
143
- output.scratchOrgs.push(currentValue);
144
- }
145
- else {
146
- output.nonScratchOrgs.push(currentValue);
147
- }
148
- }
149
- return output;
150
- }
151
- /**
152
- * Helper utility to remove sensitive information from a scratch org auth config. By default refreshTokens and client secrets are removed.
153
- *
154
- * @param {*} config - scratch org auth object.
155
- * @param {string[]} properties - properties to exclude ex ['refreshToken', 'clientSecret']
156
- * @returns the config less the sensitive information.
157
- */
158
- static removeRestrictedInfoFromConfig(config, properties = ['refreshToken', 'clientSecret']) {
159
- return (0, lib_1.omit)(config, properties);
160
- }
161
- /** Identify the default orgs */
162
- static identifyDefaultOrgs(orgInfo, config) {
163
- if (config['target-org'] && (orgInfo.username === config['target-org'] || orgInfo.alias === config['target-org'])) {
164
- orgInfo.isDefaultUsername = true;
165
- }
166
- else if (config['target-dev-hub'] &&
167
- (orgInfo.username === config['target-dev-hub'] || orgInfo.alias === config['target-dev-hub'])) {
168
- orgInfo.isDefaultDevHubUsername = true;
169
- }
134
+ return {
135
+ ...identifyDefaultOrgs({ ...currentValue, alias }, configAggregator),
136
+ lastUsed: lastUsed.atime,
137
+ alias,
138
+ };
139
+ }));
140
+ return {
141
+ scratchOrgs: results.filter((result) => 'expirationDate' in result),
142
+ nonScratchOrgs: results.filter((result) => !('expirationDate' in result)),
143
+ };
170
144
  }
171
145
  static async retrieveScratchOrgInfoFromDevHub(devHubUsername, orgIdsToQuery) {
172
146
  const fields = [
@@ -197,35 +171,33 @@ class OrgListUtil {
197
171
  }
198
172
  }
199
173
  static async reduceScratchOrgInfo(updatedContents, orgs) {
200
- // Reduce the information to key value pairs with signupUsername as key
201
- const contentMap = updatedContents.reduce((map, scratchOrgInfo) => {
202
- if (scratchOrgInfo) {
203
- map[scratchOrgInfo.SignupUsername] = scratchOrgInfo;
204
- }
205
- return map;
206
- }, {});
207
- for (const scratchOrgInfo of orgs) {
208
- const updatedOrgInfo = contentMap[scratchOrgInfo.username];
209
- if (updatedOrgInfo) {
210
- scratchOrgInfo.signupUsername = updatedOrgInfo.SignupUsername;
211
- scratchOrgInfo.createdBy = updatedOrgInfo.CreatedBy.Username;
212
- scratchOrgInfo.createdDate = updatedOrgInfo.CreatedDate;
213
- scratchOrgInfo.devHubOrgId = updatedOrgInfo.devHubOrgId;
214
- scratchOrgInfo.attributes = updatedOrgInfo.attributes;
215
- scratchOrgInfo.orgName = updatedOrgInfo.OrgName;
216
- scratchOrgInfo.edition = updatedOrgInfo.Edition;
217
- scratchOrgInfo.status = updatedOrgInfo.Status;
218
- scratchOrgInfo.expirationDate = updatedOrgInfo.ExpirationDate;
219
- scratchOrgInfo.isExpired = updatedOrgInfo.Status === 'Deleted';
220
- scratchOrgInfo.namespace = updatedOrgInfo.Namespace;
221
- }
222
- else {
223
- // eslint-disable-next-line no-await-in-loop
224
- const logger = await OrgListUtil.retrieveLogger();
225
- logger.warn(`Can't find ${scratchOrgInfo.username} in the updated contents`);
226
- }
174
+ const contentMap = new Map(updatedContents.map((org) => [org.SignupUsername, org]));
175
+ const results = orgs.map((scratchOrgInfo) => {
176
+ const updatedOrgInfo = contentMap.get(scratchOrgInfo.username);
177
+ return updatedOrgInfo
178
+ ? {
179
+ ...scratchOrgInfo,
180
+ signupUsername: updatedOrgInfo.SignupUsername,
181
+ createdBy: updatedOrgInfo.CreatedBy.Username,
182
+ createdDate: updatedOrgInfo.CreatedDate,
183
+ devHubOrgId: updatedOrgInfo.devHubOrgId,
184
+ devHubId: updatedOrgInfo.devHubOrgId,
185
+ attributes: updatedOrgInfo.attributes,
186
+ orgName: updatedOrgInfo.OrgName,
187
+ edition: updatedOrgInfo.Edition,
188
+ status: updatedOrgInfo.Status,
189
+ expirationDate: updatedOrgInfo.ExpirationDate,
190
+ isExpired: updatedOrgInfo.Status === 'Deleted',
191
+ namespace: updatedOrgInfo.Namespace,
192
+ }
193
+ : `Can't find ${scratchOrgInfo.username} in the updated contents`;
194
+ });
195
+ const warnings = results.filter((result) => typeof result === 'string');
196
+ if (warnings.length) {
197
+ const logger = await OrgListUtil.retrieveLogger();
198
+ warnings.forEach((warning) => logger.warn(warning));
227
199
  }
228
- return orgs;
200
+ return results.filter((result) => typeof result !== 'string');
229
201
  }
230
202
  /**
231
203
  * Asks the org if it's a devHub. Because the dev hub setting can't be deactivated, only ask orgs that aren't already stored as hubs.
@@ -278,6 +250,24 @@ class OrgListUtil {
278
250
  }
279
251
  }
280
252
  exports.OrgListUtil = OrgListUtil;
281
- const identifyActiveOrgByStatus = (org) => org.status === 'Active';
253
+ const identifyActiveOrgByStatus = (org) => 'status' in org && org.status === 'Active';
282
254
  exports.identifyActiveOrgByStatus = identifyActiveOrgByStatus;
255
+ /** Identify the default orgs */
256
+ const identifyDefaultOrgs = (orgInfo, config) => {
257
+ // remove undefined, since the config might also be undefined
258
+ const possibleDefaults = [orgInfo.alias, orgInfo.username].filter(Boolean);
259
+ return {
260
+ ...orgInfo,
261
+ isDefaultDevHubUsername: possibleDefaults.includes(config.getPropertyValue(core_1.OrgConfigProperties.TARGET_DEV_HUB)),
262
+ isDefaultUsername: possibleDefaults.includes(config.getPropertyValue(core_1.OrgConfigProperties.TARGET_ORG)),
263
+ };
264
+ };
265
+ /**
266
+ * Helper utility to remove sensitive information from a scratch org auth config. By default refreshTokens and client secrets are removed.
267
+ *
268
+ * @param {*} config - scratch org auth object.
269
+ * @param {string[]} properties - properties to exclude ex ['refreshToken', 'clientSecret']
270
+ * @returns the config less the sensitive information.
271
+ */
272
+ const removeRestrictedInfoFromConfig = (config, properties = ['refreshToken', 'clientSecret']) => (0, lib_1.omit)(config, properties);
283
273
  //# sourceMappingURL=orgListUtil.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orgListUtil.js","sourceRoot":"","sources":["../../src/shared/orgListUtil.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,+BAAsC;AACtC,kCAAk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/ts-types';
3
- export interface OrgDisplayReturn extends Partial<ScratchOrgFields> {
3
+ export type OrgDisplayReturn = Partial<ScratchOrgFields> & {
4
4
  username: string;
5
5
  id: string;
6
6
  accessToken: string;
@@ -10,14 +10,29 @@ export interface OrgDisplayReturn extends Partial<ScratchOrgFields> {
10
10
  password?: string;
11
11
  connectedStatus?: string;
12
12
  sfdxAuthUrl?: string;
13
- }
14
- export interface ExtendedAuthFields extends AuthFields, OrgListFields, Partial<ScratchOrgFields> {
15
- signupUsername?: string;
13
+ };
14
+ /** Convenience type for the fields that are in the auth file
15
+ *
16
+ * core's AuthFields has everything as optional.
17
+ *
18
+ * In this case, we have a username because these come from auth files */
19
+ export type AuthFieldsFromFS = Omit<AuthFields, 'expirationDate'> & {
20
+ username: string;
21
+ orgId: string;
22
+ accessToken: string;
23
+ instanceUrl: string;
24
+ clientId: string;
25
+ string: string;
26
+ };
27
+ export type ExtendedAuthFields = AuthFieldsFromFS & OrgListFields;
28
+ export type ExtendedAuthFieldsScratch = ExtendedAuthFields & {
29
+ expirationDate: string;
30
+ devHubUsername: string;
16
31
  devHubOrgId?: string;
17
- isExpired?: boolean;
18
- connectedStatus?: string;
19
- attributes?: Dictionary<unknown>;
20
- }
32
+ };
33
+ export type FullyPopulatedScratchOrgFields = ScratchOrgFields & ExtendedAuthFieldsScratch & {
34
+ isExpired: boolean;
35
+ };
21
36
  export interface ScratchOrgInfoSObject {
22
37
  Id: string;
23
38
  CreatedDate: string;
@@ -28,23 +43,36 @@ export interface ScratchOrgInfoSObject {
28
43
  };
29
44
  Edition: string;
30
45
  Namespace?: string;
31
- OrgName?: string;
46
+ OrgName: string;
32
47
  SignupUsername: string;
33
48
  }
49
+ /** fields in the */
34
50
  export interface ScratchOrgFields {
35
51
  createdBy: string;
36
52
  createdDate: string;
37
53
  expirationDate: string;
38
54
  orgName: string;
39
55
  status: string;
40
- devHubId?: string;
56
+ devHubId: string;
41
57
  edition?: string;
42
58
  namespace?: string;
43
59
  snapshot?: string;
44
60
  lastUsed?: Date;
61
+ signupUsername: string;
45
62
  }
46
63
  export interface OrgListFields {
64
+ connectedStatus?: string;
47
65
  isDefaultUsername?: boolean;
48
66
  isDefaultDevHubUsername?: boolean;
49
67
  defaultMarker?: '(D)' | '(U)';
68
+ attributes?: Dictionary<unknown>;
69
+ lastUsed?: Date;
70
+ }
71
+ /** If the scratch org is resumed, but doesn't get very far in the process, it won't have much information on it */
72
+ export interface ScratchCreateResponse {
73
+ username?: string;
74
+ scratchOrgInfo?: ScratchOrgInfo;
75
+ authFields?: AuthFields;
76
+ warnings: string[];
77
+ orgId?: string;
50
78
  }
@@ -0,0 +1,33 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { Config } from '@oclif/core';
3
+ import { Lifecycle, Org, ResultEvent, SandboxProcessObject, SandboxRequestCache, SandboxRequestCacheEntry, SandboxUserAuthResponse, StatusEvent } from '@salesforce/core';
4
+ import { SandboxProgress } from './sandboxProgress';
5
+ import { State } from './stagedProgress';
6
+ export declare abstract class SandboxCommandBase<T> extends SfCommand<T> {
7
+ protected sandboxProgress: SandboxProgress;
8
+ protected latestSandboxProgressObj?: SandboxProcessObject;
9
+ protected sandboxAuth?: SandboxUserAuthResponse;
10
+ protected prodOrg?: Org;
11
+ protected pollingTimeOut: boolean;
12
+ protected sandboxRequestConfig: SandboxRequestCache;
13
+ protected sandboxRequestData: SandboxRequestCacheEntry | undefined;
14
+ constructor(argv: string[], config: Config);
15
+ protected getSandboxRequestConfig(): Promise<SandboxRequestCache>;
16
+ protected calculateTrackingSetting(tracking?: boolean): Promise<boolean>;
17
+ protected registerLifecycleListeners(lifecycle: Lifecycle, options: {
18
+ isAsync: boolean;
19
+ alias?: string;
20
+ setDefault: boolean;
21
+ prodOrg?: Org;
22
+ tracksSource?: boolean;
23
+ }): void;
24
+ protected reportResults(results: ResultEvent): void;
25
+ protected updateProgress(event: StatusEvent | (Omit<ResultEvent, 'sandboxRes'> & {
26
+ sandboxRes?: ResultEvent['sandboxRes'];
27
+ }), isAsync: boolean): void;
28
+ protected updateStage(stage: string | undefined, state: State): void;
29
+ protected updateSandboxRequestData(): void;
30
+ protected saveSandboxProgressConfig(): void;
31
+ private removeSandboxProgressConfig;
32
+ protected abstract getCheckSandboxStatusParams(): string[];
33
+ }