@salesforce/plugin-org 5.9.19 → 5.9.21
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/README.md +15 -15
- package/lib/commands/org/open/agent.js +1 -1
- package/lib/commands/org/open/agent.js.map +1 -1
- package/lib/commands/org/open.d.ts +2 -1
- package/lib/commands/org/open.js +11 -35
- package/lib/commands/org/open.js.map +1 -1
- package/lib/shared/orgOpenCommandBase.js +12 -44
- package/lib/shared/orgOpenCommandBase.js.map +1 -1
- package/lib/shared/orgOpenUtils.d.ts +3 -5
- package/lib/shared/orgOpenUtils.js +9 -26
- package/lib/shared/orgOpenUtils.js.map +1 -1
- package/messages/messages.md +1 -5
- package/oclif.manifest.json +381 -381
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -247,7 +247,7 @@ FLAG DESCRIPTIONS
|
|
|
247
247
|
You can specify either --source-sandbox-name or --source-id when cloning an existing sandbox, but not both.
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
_See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
250
|
+
_See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/create/sandbox.ts)_
|
|
251
251
|
|
|
252
252
|
## `sf org create scratch`
|
|
253
253
|
|
|
@@ -429,7 +429,7 @@ FLAG DESCRIPTIONS
|
|
|
429
429
|
Omit this flag to have Salesforce generate a unique username for your org.
|
|
430
430
|
```
|
|
431
431
|
|
|
432
|
-
_See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
432
|
+
_See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/create/scratch.ts)_
|
|
433
433
|
|
|
434
434
|
## `sf org delete sandbox`
|
|
435
435
|
|
|
@@ -475,7 +475,7 @@ EXAMPLES
|
|
|
475
475
|
$ sf org delete sandbox --target-org my-sandbox --no-prompt
|
|
476
476
|
```
|
|
477
477
|
|
|
478
|
-
_See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
478
|
+
_See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/delete/sandbox.ts)_
|
|
479
479
|
|
|
480
480
|
## `sf org delete scratch`
|
|
481
481
|
|
|
@@ -519,7 +519,7 @@ EXAMPLES
|
|
|
519
519
|
$ sf org delete scratch --target-org my-scratch-org --no-prompt
|
|
520
520
|
```
|
|
521
521
|
|
|
522
|
-
_See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
522
|
+
_See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/delete/scratch.ts)_
|
|
523
523
|
|
|
524
524
|
## `sf org disable tracking`
|
|
525
525
|
|
|
@@ -558,7 +558,7 @@ EXAMPLES
|
|
|
558
558
|
$ sf org disable tracking
|
|
559
559
|
```
|
|
560
560
|
|
|
561
|
-
_See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
561
|
+
_See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/disable/tracking.ts)_
|
|
562
562
|
|
|
563
563
|
## `sf org display`
|
|
564
564
|
|
|
@@ -603,7 +603,7 @@ EXAMPLES
|
|
|
603
603
|
$ sf org display --target-org TestOrg1 --verbose
|
|
604
604
|
```
|
|
605
605
|
|
|
606
|
-
_See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
606
|
+
_See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/display.ts)_
|
|
607
607
|
|
|
608
608
|
## `sf org enable tracking`
|
|
609
609
|
|
|
@@ -645,7 +645,7 @@ EXAMPLES
|
|
|
645
645
|
$ sf org enable tracking
|
|
646
646
|
```
|
|
647
647
|
|
|
648
|
-
_See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
648
|
+
_See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/enable/tracking.ts)_
|
|
649
649
|
|
|
650
650
|
## `sf org list`
|
|
651
651
|
|
|
@@ -684,7 +684,7 @@ EXAMPLES
|
|
|
684
684
|
$ sf org list --clean
|
|
685
685
|
```
|
|
686
686
|
|
|
687
|
-
_See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
687
|
+
_See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/list.ts)_
|
|
688
688
|
|
|
689
689
|
## `sf org list metadata`
|
|
690
690
|
|
|
@@ -751,7 +751,7 @@ FLAG DESCRIPTIONS
|
|
|
751
751
|
Examples of metadata types that use folders are Dashboard, Document, EmailTemplate, and Report.
|
|
752
752
|
```
|
|
753
753
|
|
|
754
|
-
_See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
754
|
+
_See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/list/metadata.ts)_
|
|
755
755
|
|
|
756
756
|
## `sf org list metadata-types`
|
|
757
757
|
|
|
@@ -806,7 +806,7 @@ FLAG DESCRIPTIONS
|
|
|
806
806
|
Override the api version used for api requests made by this command
|
|
807
807
|
```
|
|
808
808
|
|
|
809
|
-
_See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
809
|
+
_See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/list/metadata-types.ts)_
|
|
810
810
|
|
|
811
811
|
## `sf org open`
|
|
812
812
|
|
|
@@ -882,7 +882,7 @@ EXAMPLES
|
|
|
882
882
|
$ sf org open --source-file force-app/main/default/bots/Coral_Cloud_Agent/Coral_Cloud_Agent.bot-meta.xml
|
|
883
883
|
```
|
|
884
884
|
|
|
885
|
-
_See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
885
|
+
_See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/open.ts)_
|
|
886
886
|
|
|
887
887
|
## `sf org open agent`
|
|
888
888
|
|
|
@@ -933,7 +933,7 @@ EXAMPLES
|
|
|
933
933
|
$ sf org open agent --target-org MyTestOrg1 --browser firefox --api-name Coral_Cloud_Agent
|
|
934
934
|
```
|
|
935
935
|
|
|
936
|
-
_See code: [src/commands/org/open/agent.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
936
|
+
_See code: [src/commands/org/open/agent.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/open/agent.ts)_
|
|
937
937
|
|
|
938
938
|
## `sf org refresh sandbox`
|
|
939
939
|
|
|
@@ -1036,7 +1036,7 @@ FLAG DESCRIPTIONS
|
|
|
1036
1036
|
You can specify either --source-sandbox-name or --source-id when refreshing an existing sandbox, but not both.
|
|
1037
1037
|
```
|
|
1038
1038
|
|
|
1039
|
-
_See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
1039
|
+
_See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/refresh/sandbox.ts)_
|
|
1040
1040
|
|
|
1041
1041
|
## `sf org resume sandbox`
|
|
1042
1042
|
|
|
@@ -1099,7 +1099,7 @@ FLAG DESCRIPTIONS
|
|
|
1099
1099
|
returns the job ID. To resume checking the sandbox creation, rerun this command.
|
|
1100
1100
|
```
|
|
1101
1101
|
|
|
1102
|
-
_See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
1102
|
+
_See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/resume/sandbox.ts)_
|
|
1103
1103
|
|
|
1104
1104
|
## `sf org resume scratch`
|
|
1105
1105
|
|
|
@@ -1152,6 +1152,6 @@ FLAG DESCRIPTIONS
|
|
|
1152
1152
|
returns the job ID. To resume checking the scratch creation, rerun this command.
|
|
1153
1153
|
```
|
|
1154
1154
|
|
|
1155
|
-
_See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.
|
|
1155
|
+
_See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.9.21/src/commands/org/resume/scratch.ts)_
|
|
1156
1156
|
|
|
1157
1157
|
<!-- commandsstop -->
|
|
@@ -45,7 +45,7 @@ export class OrgOpenAgent extends OrgOpenCommandBase {
|
|
|
45
45
|
this.org = flags['target-org'];
|
|
46
46
|
this.connection = this.org.getConnection(flags['api-version']);
|
|
47
47
|
const [frontDoorUrl, retUrl] = await Promise.all([
|
|
48
|
-
buildFrontdoorUrl(this.org
|
|
48
|
+
buildFrontdoorUrl(this.org),
|
|
49
49
|
buildRetUrl(this.connection, flags['api-name']),
|
|
50
50
|
]);
|
|
51
51
|
return this.openOrgUI(flags, frontDoorUrl, encodeURIComponent(retUrl));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../../src/commands/org/open/agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAc,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAA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AAiB,CAAC,IAAI,CAAC,GAAG,CAAC;YAC3B,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;SAChD,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,CAAC;;AAGH,gEAAgE;AAChE,MAAM,WAAW,GAAG,KAAK,EAAE,IAAgB,EAAE,OAAe,EAAmB,EAAE;IAC/E,MAAM,KAAK,GAAG,qDAAqD,OAAO,GAAG,CAAC;IAC9E,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAiB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACvE,OAAO,0DAA0D,KAAK,EAAE,CAAC;AAC3E,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Org } from '@salesforce/core';
|
|
1
2
|
import { OrgOpenCommandBase } from '../../shared/orgOpenCommandBase.js';
|
|
2
3
|
import { type OrgOpenOutput } from '../../shared/orgTypes.js';
|
|
3
4
|
export declare class OrgOpenCommand extends OrgOpenCommandBase<OrgOpenOutput> {
|
|
@@ -7,7 +8,7 @@ export declare class OrgOpenCommand extends OrgOpenCommandBase<OrgOpenOutput> {
|
|
|
7
8
|
static readonly aliases: string[];
|
|
8
9
|
static deprecateAliases: boolean;
|
|
9
10
|
static readonly flags: {
|
|
10
|
-
'target-org': import("@oclif/core/interfaces").OptionFlag<
|
|
11
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
private: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
browser: import("@oclif/core/interfaces").OptionFlag<"chrome" | "firefox" | "edge" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
package/lib/commands/org/open.js
CHANGED
|
@@ -4,16 +4,13 @@
|
|
|
4
4
|
* Licensed under the BSD 3-Clause license.
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
import path from 'node:path';
|
|
8
7
|
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, requiredOrgFlagWithDeprecations, } from '@salesforce/sf-plugins-core';
|
|
9
8
|
import { Messages } from '@salesforce/core';
|
|
10
9
|
import { MetadataResolver } from '@salesforce/source-deploy-retrieve';
|
|
11
|
-
import { env } from '@salesforce/kit';
|
|
12
10
|
import { buildFrontdoorUrl } from '../../shared/orgOpenUtils.js';
|
|
13
11
|
import { OrgOpenCommandBase } from '../../shared/orgOpenCommandBase.js';
|
|
14
12
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
15
13
|
const messages = Messages.loadMessages('@salesforce/plugin-org', 'open');
|
|
16
|
-
const sharedMessages = Messages.loadMessages('@salesforce/plugin-org', 'messages');
|
|
17
14
|
export class OrgOpenCommand extends OrgOpenCommandBase {
|
|
18
15
|
static summary = messages.getMessage('summary');
|
|
19
16
|
static description = messages.getMessage('description');
|
|
@@ -57,55 +54,34 @@ export class OrgOpenCommand extends OrgOpenCommandBase {
|
|
|
57
54
|
}),
|
|
58
55
|
};
|
|
59
56
|
async run() {
|
|
60
|
-
this.warn(sharedMessages.getMessage('BehaviorChangeWarning'));
|
|
61
57
|
const { flags } = await this.parse(OrgOpenCommand);
|
|
62
58
|
this.org = flags['target-org'];
|
|
63
59
|
this.connection = this.org.getConnection(flags['api-version']);
|
|
64
|
-
const singleUseEnvVar = env.getBoolean('SF_SINGLE_USE_ORG_OPEN_URL');
|
|
65
|
-
const singleUseMode = singleUseEnvVar ? singleUseEnvVar : !(flags['url-only'] || this.jsonEnabled());
|
|
66
60
|
const [frontDoorUrl, retUrl] = await Promise.all([
|
|
67
|
-
buildFrontdoorUrl(this.org
|
|
68
|
-
flags['source-file'] ? generateFileUrl(flags['source-file'], this.
|
|
61
|
+
buildFrontdoorUrl(this.org),
|
|
62
|
+
flags['source-file'] ? generateFileUrl(flags['source-file'], this.org) : flags.path,
|
|
69
63
|
]);
|
|
70
64
|
return this.openOrgUI(flags, frontDoorUrl, retUrl);
|
|
71
65
|
}
|
|
72
66
|
}
|
|
73
|
-
const generateFileUrl = async (file,
|
|
67
|
+
const generateFileUrl = async (file, org) => {
|
|
74
68
|
try {
|
|
75
69
|
const metadataResolver = new MetadataResolver();
|
|
76
70
|
const components = metadataResolver.getComponentsFromPath(file);
|
|
77
71
|
const typeName = components[0]?.type?.name;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return `AiCopilot/copilotStudio.app#/copilot/builder?copilotId=${await botFileNameToId(conn, file)}`;
|
|
81
|
-
case 'ApexPage':
|
|
82
|
-
return `/apex/${path.basename(file).replace('.page-meta.xml', '').replace('.page', '')}`;
|
|
83
|
-
case 'Flow':
|
|
84
|
-
return `/builder_platform_interaction/flowBuilder.app?flowId=${await flowFileNameToId(conn, file)}`;
|
|
85
|
-
case 'FlexiPage':
|
|
86
|
-
return `/visualEditor/appBuilder.app?pageId=${await flexiPageFilenameToId(conn, file)}`;
|
|
87
|
-
default:
|
|
88
|
-
return 'lightning/setup/FlexiPageList/home';
|
|
72
|
+
if (!typeName) {
|
|
73
|
+
throw new Error(`Unable to determine metadata type for file: ${file}`);
|
|
89
74
|
}
|
|
75
|
+
return await org.getMetadataUIURL(typeName, file);
|
|
90
76
|
}
|
|
91
77
|
catch (error) {
|
|
92
|
-
if (error instanceof Error &&
|
|
78
|
+
if (error instanceof Error &&
|
|
79
|
+
(error.message.includes('FlowIdNotFound') ||
|
|
80
|
+
error.message.includes('CustomObjectIdNotFound') ||
|
|
81
|
+
error.message.includes('ApexClassIdNotFound'))) {
|
|
93
82
|
throw error;
|
|
94
83
|
}
|
|
95
|
-
return '
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const botFileNameToId = async (conn, filePath) => (await conn.singleRecordQuery(`SELECT id FROM BotDefinition WHERE DeveloperName='${path.basename(filePath, '.bot-meta.xml')}'`)).Id;
|
|
99
|
-
/** query flexipage via toolingPAI to get its ID (starts with 0M0) */
|
|
100
|
-
const flexiPageFilenameToId = async (conn, filePath) => (await conn.singleRecordQuery(`SELECT id FROM flexipage WHERE DeveloperName='${path.basename(filePath, '.flexipage-meta.xml')}'`, { tooling: true })).Id;
|
|
101
|
-
/** query the rest API to turn a flow's filepath into a FlowId (starts with 301) */
|
|
102
|
-
const flowFileNameToId = async (conn, filePath) => {
|
|
103
|
-
try {
|
|
104
|
-
const flow = await conn.singleRecordQuery(`SELECT DurableId FROM FlowVersionView WHERE FlowDefinitionView.ApiName = '${path.basename(filePath, '.flow-meta.xml')}' ORDER BY VersionNumber DESC LIMIT 1`);
|
|
105
|
-
return flow.DurableId;
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
throw messages.createError('FlowIdNotFound', [filePath]);
|
|
84
|
+
return '';
|
|
109
85
|
}
|
|
110
86
|
};
|
|
111
87
|
//# sourceMappingURL=open.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../../src/commands/org/open.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../../src/commands/org/open.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,EACL,QAAQ,EACR,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oC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C,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;;AAGH,MAAM,eAAe,GAAG,KAAK,EAAE,IAAY,EAAE,GAAQ,EAAmB,EAAE;IACxE,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAChD,MAAM,UAAU,GAAG,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;QAE3C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,+CAA+C,IAAI,EAAE,CAAC,CAAC;QACzE,CAAC;QAED,OAAO,MAAM,GAAG,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IACE,KAAK,YAAY,KAAK;YACtB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBACvC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC;gBAChD,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,EAChD,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -4,16 +4,12 @@
|
|
|
4
4
|
* Licensed under the BSD 3-Clause license.
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
8
|
-
import fs from 'node:fs';
|
|
9
|
-
import { platform, tmpdir } from 'node:os';
|
|
10
|
-
import { execSync } from 'node:child_process';
|
|
11
|
-
import isWsl from 'is-wsl';
|
|
7
|
+
import { platform } from 'node:os';
|
|
12
8
|
import { apps } from 'open';
|
|
13
9
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
14
10
|
import { Messages, SfdcUrl, SfError } from '@salesforce/core';
|
|
15
|
-
import { env
|
|
16
|
-
import utils, {
|
|
11
|
+
import { env } from '@salesforce/kit';
|
|
12
|
+
import utils, { handleDomainError } from './orgOpenUtils.js';
|
|
17
13
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
18
14
|
const messages = Messages.loadMessages('@salesforce/plugin-org', 'open');
|
|
19
15
|
export class OrgOpenCommandBase extends SfCommand {
|
|
@@ -29,8 +25,8 @@ export class OrgOpenCommandBase extends SfCommand {
|
|
|
29
25
|
const output = { orgId, url, username };
|
|
30
26
|
// NOTE: Deliberate use of `||` here since getBoolean() defaults to false, and we need to consider both env vars.
|
|
31
27
|
const containerMode = env.getBoolean('SF_CONTAINER_MODE') || env.getBoolean('SFDX_CONTAINER_MODE');
|
|
32
|
-
// security warning only for --
|
|
33
|
-
if (flags['url-only'] ||
|
|
28
|
+
// security warning only for --url-only OR containerMode
|
|
29
|
+
if (flags['url-only'] || containerMode) {
|
|
34
30
|
const sharedMessages = Messages.loadMessages('@salesforce/plugin-org', 'messages');
|
|
35
31
|
this.warn(sharedMessages.getMessage('SecurityWarning'));
|
|
36
32
|
this.log('');
|
|
@@ -56,41 +52,13 @@ export class OrgOpenCommandBase extends SfCommand {
|
|
|
56
52
|
catch (err) {
|
|
57
53
|
handleDomainError(err, url, env);
|
|
58
54
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
flags.path ? decodeURIComponent(flags.path) : retUrl));
|
|
67
|
-
const filePathUrl = isWsl
|
|
68
|
-
? 'file:///' + execSync(`wslpath -m ${tempFilePath}`).toString().trim()
|
|
69
|
-
: `file:///${tempFilePath}`;
|
|
70
|
-
const cp = await utils.openUrl(filePathUrl, {
|
|
71
|
-
...(flags.browser ? { app: { name: apps[flags.browser] } } : {}),
|
|
72
|
-
...(flags.private ? { newInstance: platform() === 'darwin', app: { name: apps.browserPrivate } } : {}),
|
|
73
|
-
});
|
|
74
|
-
cp.on('error', (err) => {
|
|
75
|
-
fileCleanup(tempFilePath);
|
|
76
|
-
throw SfError.wrap(err);
|
|
77
|
-
});
|
|
78
|
-
// so we don't delete the file while the browser is still using it
|
|
79
|
-
// open returns when the CP is spawned, but there's not way to know if the browser is still using the file
|
|
80
|
-
await sleep(platform() === 'win32' || isWsl ? 7000 : 5000);
|
|
81
|
-
fileCleanup(tempFilePath);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
// it means we generated a one-time use frontdoor url
|
|
85
|
-
// so the workaround to create a local html file is not needed
|
|
86
|
-
const cp = await utils.openUrl(url, {
|
|
87
|
-
...(flags.browser ? { app: { name: apps[flags.browser] } } : {}),
|
|
88
|
-
...(flags.private ? { newInstance: platform() === 'darwin', app: { name: apps.browserPrivate } } : {}),
|
|
89
|
-
});
|
|
90
|
-
cp.on('error', (err) => {
|
|
91
|
-
throw SfError.wrap(err);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
55
|
+
const cp = await utils.openUrl(url, {
|
|
56
|
+
...(flags.browser ? { app: { name: apps[flags.browser] } } : {}),
|
|
57
|
+
...(flags.private ? { newInstance: platform() === 'darwin', app: { name: apps.browserPrivate } } : {}),
|
|
58
|
+
});
|
|
59
|
+
cp.on('error', (err) => {
|
|
60
|
+
throw SfError.wrap(err);
|
|
61
|
+
});
|
|
94
62
|
return output;
|
|
95
63
|
}
|
|
96
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orgOpenCommandBase.js","sourceRoot":"","sources":["../../src/shared/orgOpenCommandBase.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"orgOpenCommandBase.js","sourceRoot":"","sources":["../../src/shared/orgOpenCommandBase.ts"],"names":[],"mappings":"AAAA;;;;;GAKG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CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;YAClC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvG,CAAC,CAAC;QACH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACrB,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChildProcess } from 'node:child_process';
|
|
2
2
|
import { Options } from 'open';
|
|
3
|
-
import {
|
|
3
|
+
import { Org } from '@salesforce/core';
|
|
4
4
|
import { Env } from '@salesforce/kit';
|
|
5
5
|
export declare const openUrl: (url: string, options: Options) => Promise<ChildProcess>;
|
|
6
6
|
export declare const fileCleanup: (tempFilePath: string) => void;
|
|
@@ -8,17 +8,15 @@ export declare const fileCleanup: (tempFilePath: string) => void;
|
|
|
8
8
|
* This method generates and returns a frontdoor url for the given org.
|
|
9
9
|
*
|
|
10
10
|
* @param org org for which we generate the frontdoor url.
|
|
11
|
-
* @param conn the Connection for the given Org.
|
|
12
|
-
* @param singleUseUrl if true returns a single-use url frontdoor url.
|
|
13
11
|
*/
|
|
14
|
-
export declare const buildFrontdoorUrl: (org: Org
|
|
12
|
+
export declare const buildFrontdoorUrl: (org: Org) => Promise<string>;
|
|
15
13
|
export declare const handleDomainError: (err: unknown, url: string, env: Env) => string;
|
|
16
14
|
/** builds the html file that does an automatic post to the frontdoor url */
|
|
17
15
|
export declare const getFileContents: (authToken: string, instanceUrl: string, retUrl?: string) => string;
|
|
18
16
|
declare const _default: {
|
|
19
17
|
openUrl: (url: string, options: Options) => Promise<ChildProcess>;
|
|
20
18
|
fileCleanup: (tempFilePath: string) => void;
|
|
21
|
-
buildFrontdoorUrl: (org: Org
|
|
19
|
+
buildFrontdoorUrl: (org: Org) => Promise<string>;
|
|
22
20
|
handleDomainError: (err: unknown, url: string, env: Env) => string;
|
|
23
21
|
getFileContents: (authToken: string, instanceUrl: string, retUrl?: string) => string;
|
|
24
22
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { rmSync } from 'node:fs';
|
|
8
8
|
import open from 'open';
|
|
9
|
-
import { Logger, Messages,
|
|
9
|
+
import { Logger, Messages, SfError } from '@salesforce/core';
|
|
10
10
|
import { Duration } from '@salesforce/kit';
|
|
11
11
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
12
|
const messages = Messages.loadMessages('@salesforce/plugin-org', 'open');
|
|
@@ -17,33 +17,16 @@ export const fileCleanup = (tempFilePath) => rmSync(tempFilePath, { force: true,
|
|
|
17
17
|
* This method generates and returns a frontdoor url for the given org.
|
|
18
18
|
*
|
|
19
19
|
* @param org org for which we generate the frontdoor url.
|
|
20
|
-
* @param conn the Connection for the given Org.
|
|
21
|
-
* @param singleUseUrl if true returns a single-use url frontdoor url.
|
|
22
20
|
*/
|
|
23
|
-
export const buildFrontdoorUrl = async (org
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (!accessToken) {
|
|
27
|
-
throw new SfError('NoAccessToken', 'NoAccessToken');
|
|
21
|
+
export const buildFrontdoorUrl = async (org) => {
|
|
22
|
+
try {
|
|
23
|
+
return await org.getFrontDoorUrl();
|
|
28
24
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
throw new SfError(sharedMessages.getMessage('SingleAccessFrontdoorError')).setData(response);
|
|
35
|
-
}
|
|
36
|
-
catch (e) {
|
|
37
|
-
if (e instanceof SfError)
|
|
38
|
-
throw e;
|
|
39
|
-
const err = e;
|
|
40
|
-
throw new SfError(sharedMessages.getMessage('SingleAccessFrontdoorError'), err.message);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
// TODO: remove this code path once the org open behavior changes on August 2025 (see W-17661469)
|
|
45
|
-
const instanceUrlClean = org.getField(Org.Fields.INSTANCE_URL).replace(/\/$/, '');
|
|
46
|
-
return `${instanceUrlClean}/secur/frontdoor.jsp?sid=${accessToken}`;
|
|
25
|
+
catch (e) {
|
|
26
|
+
if (e instanceof SfError)
|
|
27
|
+
throw e;
|
|
28
|
+
const err = e;
|
|
29
|
+
throw new SfError(sharedMessages.getMessage('SingleAccessFrontdoorError'), err.message);
|
|
47
30
|
}
|
|
48
31
|
};
|
|
49
32
|
export const handleDomainError = (err, url, env) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orgOpenUtils.js","sourceRoot":"","sources":["../../src/shared/orgOpenUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,IAAiB,MAAM,MAAM,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"orgOpenUtils.js","sourceRoot":"","sources":["../../src/shared/orgOpenUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,IAAiB,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAO,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO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IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACjD,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;YAChD,CAAC;YACD,MAAM,MAAM,GAAG,WAAW,IAAI,sBAAsB,CAAC;YACrD,MAAM,kBAAkB,GAAG,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;YACvG,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxE,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAChD,MAAM,CAAC,KAAK,CAAC,uBAAuB,MAAM,UAAU,OAAO,CAAC,OAAO,UAAU,CAAC,CAAC;YAC/E,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,MAAM,GAAG,CAAC;AACZ,CAAC,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAiB,EACjB,WAAmB;AACnB,oGAAoG;AACpG,MAAM,GAAG,oCAAoC,EACrC,EAAE,CAAC;;;kCAGqB,WAAW;+CACE,SAAS;kDACN,MAAM;;;QAGhD,CAAC;AAET,eAAe;IACb,OAAO;IACP,WAAW;IACX,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;CAChB,CAAC"}
|
package/messages/messages.md
CHANGED
|
@@ -4,10 +4,6 @@ This command will expose sensitive information that allows for subsequent activi
|
|
|
4
4
|
Sharing this information is equivalent to logging someone in under the current credential, resulting in unintended access and escalation of privilege.
|
|
5
5
|
For additional information, please review the authorization section of the https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm.
|
|
6
6
|
|
|
7
|
-
# BehaviorChangeWarning
|
|
8
|
-
|
|
9
|
-
Starting in August 2025, this command will generate single-use URLs when you specify either the --json or --url-only (-r) flag. These URLs can be used only one time; subsequent use won't allow you to log in to the org.
|
|
10
|
-
|
|
11
7
|
# SingleAccessFrontdoorError
|
|
12
8
|
|
|
13
|
-
Failed to generate a
|
|
9
|
+
Failed to generate a frontdoor URL.
|