@salesforce/plugin-org 5.1.5 → 5.2.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.
package/README.md CHANGED
@@ -110,6 +110,7 @@ the [SandboxNuts](https://github.com/salesforcecli/plugin-org/actions/workflows/
110
110
  - [`sf org list metadata`](#sf-org-list-metadata)
111
111
  - [`sf org list metadata-types`](#sf-org-list-metadata-types)
112
112
  - [`sf org open`](#sf-org-open)
113
+ - [`sf org open agent`](#sf-org-open-agent)
113
114
  - [`sf org refresh sandbox`](#sf-org-refresh-sandbox)
114
115
  - [`sf org resume sandbox`](#sf-org-resume-sandbox)
115
116
  - [`sf org resume scratch`](#sf-org-resume-scratch)
@@ -241,7 +242,7 @@ FLAG DESCRIPTIONS
241
242
  You can specify either --source-sandbox-name or --source-id when cloning an existing sandbox, but not both.
242
243
  ```
243
244
 
244
- _See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/create/sandbox.ts)_
245
+ _See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/create/sandbox.ts)_
245
246
 
246
247
  ## `sf org create scratch`
247
248
 
@@ -395,7 +396,7 @@ FLAG DESCRIPTIONS
395
396
  Omit this flag to have Salesforce generate a unique username for your org.
396
397
  ```
397
398
 
398
- _See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/create/scratch.ts)_
399
+ _See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/create/scratch.ts)_
399
400
 
400
401
  ## `sf org delete sandbox`
401
402
 
@@ -441,7 +442,7 @@ EXAMPLES
441
442
  $ sf org delete sandbox --target-org my-sandbox --no-prompt
442
443
  ```
443
444
 
444
- _See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/delete/sandbox.ts)_
445
+ _See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/delete/sandbox.ts)_
445
446
 
446
447
  ## `sf org delete scratch`
447
448
 
@@ -485,7 +486,7 @@ EXAMPLES
485
486
  $ sf org delete scratch --target-org my-scratch-org --no-prompt
486
487
  ```
487
488
 
488
- _See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/delete/scratch.ts)_
489
+ _See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/delete/scratch.ts)_
489
490
 
490
491
  ## `sf org disable tracking`
491
492
 
@@ -524,7 +525,7 @@ EXAMPLES
524
525
  $ sf org disable tracking
525
526
  ```
526
527
 
527
- _See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/disable/tracking.ts)_
528
+ _See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/disable/tracking.ts)_
528
529
 
529
530
  ## `sf org display`
530
531
 
@@ -569,7 +570,7 @@ EXAMPLES
569
570
  $ sf org display --target-org TestOrg1 --verbose
570
571
  ```
571
572
 
572
- _See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/display.ts)_
573
+ _See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/display.ts)_
573
574
 
574
575
  ## `sf org enable tracking`
575
576
 
@@ -611,7 +612,7 @@ EXAMPLES
611
612
  $ sf org enable tracking
612
613
  ```
613
614
 
614
- _See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/enable/tracking.ts)_
615
+ _See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/enable/tracking.ts)_
615
616
 
616
617
  ## `sf org list`
617
618
 
@@ -650,7 +651,7 @@ EXAMPLES
650
651
  $ sf org list --clean
651
652
  ```
652
653
 
653
- _See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/list.ts)_
654
+ _See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/list.ts)_
654
655
 
655
656
  ## `sf org list metadata`
656
657
 
@@ -717,7 +718,7 @@ FLAG DESCRIPTIONS
717
718
  Examples of metadata types that use folders are Dashboard, Document, EmailTemplate, and Report.
718
719
  ```
719
720
 
720
- _See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/list/metadata.ts)_
721
+ _See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/list/metadata.ts)_
721
722
 
722
723
  ## `sf org list metadata-types`
723
724
 
@@ -772,7 +773,7 @@ FLAG DESCRIPTIONS
772
773
  Override the api version used for api requests made by this command
773
774
  ```
774
775
 
775
- _See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/list/metadata-types.ts)_
776
+ _See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/list/metadata-types.ts)_
776
777
 
777
778
  ## `sf org open`
778
779
 
@@ -848,7 +849,58 @@ EXAMPLES
848
849
  $ sf org open --source-file force-app/main/default/bots/Coral_Cloud_Agent/Coral_Cloud_Agent.bot-meta.xml
849
850
  ```
850
851
 
851
- _See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/open.ts)_
852
+ _See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/open.ts)_
853
+
854
+ ## `sf org open agent`
855
+
856
+ Open an agent in your org's Agent Builder UI in a browser.
857
+
858
+ ```
859
+ USAGE
860
+ $ sf org open agent -o <value> -n <value> [--json] [--flags-dir <value>] [--api-version <value>] [--private | -r |
861
+ -b chrome|edge|firefox]
862
+
863
+ FLAGS
864
+ -b, --browser=<option> Browser where the org opens.
865
+ <options: chrome|edge|firefox>
866
+ -n, --name=<value> (required) API name, also known as developer name, of the agent you want to open in the
867
+ org's Agent Builder UI.
868
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
869
+ configuration variable is already set.
870
+ -r, --url-only Display navigation URL, but don’t launch browser.
871
+ --api-version=<value> Override the api version used for api requests made by this command
872
+ --private Open the org in the default browser using private (incognito) mode.
873
+
874
+ GLOBAL FLAGS
875
+ --flags-dir=<value> Import flag values from a directory.
876
+ --json Format output as json.
877
+
878
+ DESCRIPTION
879
+ Open an agent in your org's Agent Builder UI in a browser.
880
+
881
+ Use the --name flag to open an agent using its API name in the Agent Builder UI of your org. To find the agent's API
882
+ name, go to Setup in your org and navigate to the agent's details page.
883
+
884
+ To generate the URL but not launch it in your browser, specify --url-only.
885
+
886
+ To open Agent Builder in a specific browser, use the --browser flag. Supported browsers are "chrome", "edge", and
887
+ "firefox". If you don't specify --browser, the org opens in your default browser.
888
+
889
+ EXAMPLES
890
+ Open the agent with API name Coral_Cloud_Agent in your default org using your default browser:
891
+
892
+ $ sf org open agent --name Coral_Cloud_Agent
893
+
894
+ Open the agent in an incognito window of your default browser:
895
+
896
+ $ sf org open agent --private --name Coral_Cloud_Agent:
897
+
898
+ Open the agent in an org with alias MyTestOrg1 using the Firefox browser:
899
+
900
+ $ sf org open agent --target-org MyTestOrg1 --browser firefox --name Coral_Cloud_Agent
901
+ ```
902
+
903
+ _See code: [src/commands/org/open/agent.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/open/agent.ts)_
852
904
 
853
905
  ## `sf org refresh sandbox`
854
906
 
@@ -925,7 +977,7 @@ FLAG DESCRIPTIONS
925
977
  By default, a sandbox auto-activates after a refresh. Use this flag to control sandbox activation manually.
926
978
  ```
927
979
 
928
- _See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/refresh/sandbox.ts)_
980
+ _See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/refresh/sandbox.ts)_
929
981
 
930
982
  ## `sf org resume sandbox`
931
983
 
@@ -988,7 +1040,7 @@ FLAG DESCRIPTIONS
988
1040
  returns the job ID. To resume checking the sandbox creation, rerun this command.
989
1041
  ```
990
1042
 
991
- _See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/resume/sandbox.ts)_
1043
+ _See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/resume/sandbox.ts)_
992
1044
 
993
1045
  ## `sf org resume scratch`
994
1046
 
@@ -1035,6 +1087,6 @@ FLAG DESCRIPTIONS
1035
1087
  The job ID is valid for 24 hours after you start the scratch org creation.
1036
1088
  ```
1037
1089
 
1038
- _See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.1.5/src/commands/org/resume/scratch.ts)_
1090
+ _See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/5.2.0/src/commands/org/resume/scratch.ts)_
1039
1091
 
1040
1092
  <!-- commandsstop -->
@@ -0,0 +1,17 @@
1
+ import { OrgOpenCommandBase } from '../../../shared/orgOpenCommandBase.js';
2
+ import { type OrgOpenOutput } from '../../../shared/orgTypes.js';
3
+ export declare class OrgOpenAgent extends OrgOpenCommandBase<OrgOpenOutput> {
4
+ static readonly summary: string;
5
+ static readonly description: string;
6
+ static readonly examples: string[];
7
+ static readonly state = "beta";
8
+ static readonly flags: {
9
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ private: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ browser: import("@oclif/core/interfaces").OptionFlag<"chrome" | "firefox" | "edge" | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ 'url-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<OrgOpenOutput>;
17
+ }
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Copyright (c) 2020, 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 { Flags } from '@salesforce/sf-plugins-core';
8
+ import { Messages } from '@salesforce/core';
9
+ import { buildFrontdoorUrl } from '../../../shared/orgOpenUtils.js';
10
+ import { OrgOpenCommandBase } from '../../../shared/orgOpenCommandBase.js';
11
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
12
+ const messages = Messages.loadMessages('@salesforce/plugin-org', 'open.agent');
13
+ export class OrgOpenAgent extends OrgOpenCommandBase {
14
+ static summary = messages.getMessage('summary');
15
+ static description = messages.getMessage('description');
16
+ static examples = messages.getMessages('examples');
17
+ static state = 'beta';
18
+ static flags = {
19
+ ...OrgOpenCommandBase.flags,
20
+ 'target-org': Flags.requiredOrg(),
21
+ 'api-version': Flags.orgApiVersion(),
22
+ name: Flags.string({
23
+ char: 'n',
24
+ summary: messages.getMessage('flags.name.summary'),
25
+ required: true,
26
+ }),
27
+ private: Flags.boolean({
28
+ summary: messages.getMessage('flags.private.summary'),
29
+ exclusive: ['url-only', 'browser'],
30
+ }),
31
+ browser: Flags.option({
32
+ char: 'b',
33
+ summary: messages.getMessage('flags.browser.summary'),
34
+ options: ['chrome', 'edge', 'firefox'], // These are ones supported by "open" package
35
+ exclusive: ['url-only', 'private'],
36
+ })(),
37
+ 'url-only': Flags.boolean({
38
+ char: 'r',
39
+ summary: messages.getMessage('flags.url-only.summary'),
40
+ aliases: ['urlonly'],
41
+ deprecateAliases: true,
42
+ }),
43
+ };
44
+ async run() {
45
+ const { flags } = await this.parse(OrgOpenAgent);
46
+ this.org = flags['target-org'];
47
+ this.connection = this.org.getConnection(flags['api-version']);
48
+ const [frontDoorUrl, retUrl] = await Promise.all([
49
+ buildFrontdoorUrl(this.org, this.connection),
50
+ buildRetUrl(this.connection, flags.name),
51
+ ]);
52
+ return this.openOrgUI(flags, frontDoorUrl, retUrl);
53
+ }
54
+ }
55
+ // Build the URL part to the Agent Builder given a Bot API name.
56
+ const buildRetUrl = async (conn, botName) => {
57
+ const query = `SELECT id FROM BotDefinition WHERE DeveloperName='${botName}'`;
58
+ const botId = (await conn.singleRecordQuery(query)).Id;
59
+ return `AiCopilot/copilotStudio.app#/copilot/builder?copilotId=${botId}`;
60
+ };
61
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +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,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,YAAY,CAAC,CAAC;AAE/E,MAAM,OAAO,YAAa,SAAQ,kBAAiC;IAC1D,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,C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AC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAE/D,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC/C,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC;YAC5C,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC;SACzC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IACrD,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,16 +1,16 @@
1
- import { SfCommand } from '@salesforce/sf-plugins-core';
2
- import { Org } from '@salesforce/core';
3
- export declare class OrgOpenCommand extends SfCommand<OrgOpenOutput> {
1
+ import { OrgOpenCommandBase } from '../../shared/orgOpenCommandBase.js';
2
+ import { type OrgOpenOutput } from '../../shared/orgTypes.js';
3
+ export declare class OrgOpenCommand extends OrgOpenCommandBase<OrgOpenOutput> {
4
4
  static readonly summary: string;
5
5
  static readonly description: string;
6
6
  static readonly examples: string[];
7
7
  static readonly aliases: string[];
8
8
  static deprecateAliases: boolean;
9
9
  static readonly flags: {
10
- 'target-org': import("@oclif/core/interfaces").OptionFlag<Org, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
11
11
  'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
12
  private: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- browser: import("@oclif/core/interfaces").OptionFlag<"chrome" | "edge" | "firefox" | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ browser: import("@oclif/core/interfaces").OptionFlag<"chrome" | "firefox" | "edge" | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
14
  path: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
15
  'url-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
16
  loglevel: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -18,8 +18,3 @@ export declare class OrgOpenCommand extends SfCommand<OrgOpenOutput> {
18
18
  };
19
19
  run(): Promise<OrgOpenOutput>;
20
20
  }
21
- export type OrgOpenOutput = {
22
- url: string;
23
- username: string;
24
- orgId: string;
25
- };
@@ -5,25 +5,21 @@
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
7
  import path from 'node:path';
8
- import { platform, tmpdir } from 'node:os';
9
- import fs from 'node:fs';
10
- import { execSync } from 'node:child_process';
11
- import { Flags, loglevel, orgApiVersionFlagWithDeprecations, requiredOrgFlagWithDeprecations, SfCommand, } from '@salesforce/sf-plugins-core';
12
- import isWsl from 'is-wsl';
13
- import { Logger, Messages, Org, SfdcUrl, SfError } from '@salesforce/core';
14
- import { Duration, Env, sleep } from '@salesforce/kit';
8
+ import { Flags, loglevel, orgApiVersionFlagWithDeprecations, requiredOrgFlagWithDeprecations, } from '@salesforce/sf-plugins-core';
9
+ import { Messages } from '@salesforce/core';
15
10
  import { MetadataResolver } from '@salesforce/source-deploy-retrieve';
16
- import { apps } from 'open';
17
- import utils from '../../shared/utils.js';
11
+ import { buildFrontdoorUrl } from '../../shared/orgOpenUtils.js';
12
+ import { OrgOpenCommandBase } from '../../shared/orgOpenCommandBase.js';
18
13
  Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
19
14
  const messages = Messages.loadMessages('@salesforce/plugin-org', 'open');
20
- export class OrgOpenCommand extends SfCommand {
15
+ export class OrgOpenCommand extends OrgOpenCommandBase {
21
16
  static summary = messages.getMessage('summary');
22
17
  static description = messages.getMessage('description');
23
18
  static examples = messages.getMessages('examples');
24
19
  static aliases = ['force:org:open', 'force:source:open'];
25
20
  static deprecateAliases = true;
26
21
  static flags = {
22
+ ...OrgOpenCommandBase.flags,
27
23
  'target-org': requiredOrgFlagWithDeprecations,
28
24
  'api-version': orgApiVersionFlagWithDeprecations,
29
25
  private: Flags.boolean({
@@ -60,80 +56,15 @@ export class OrgOpenCommand extends SfCommand {
60
56
  };
61
57
  async run() {
62
58
  const { flags } = await this.parse(OrgOpenCommand);
63
- const conn = flags['target-org'].getConnection(flags['api-version']);
64
- const env = new Env();
59
+ this.org = flags['target-org'];
60
+ this.connection = this.org.getConnection(flags['api-version']);
65
61
  const [frontDoorUrl, retUrl] = await Promise.all([
66
- buildFrontdoorUrl(flags['target-org'], conn),
67
- flags['source-file'] ? generateFileUrl(flags['source-file'], conn) : flags.path,
62
+ buildFrontdoorUrl(this.org, this.connection),
63
+ flags['source-file'] ? generateFileUrl(flags['source-file'], this.connection) : flags.path,
68
64
  ]);
69
- const url = `${frontDoorUrl}${retUrl ? `&retURL=${retUrl}` : ''}`;
70
- const orgId = flags['target-org'].getOrgId();
71
- // TODO: better typings in sfdx-core for orgs read from auth files
72
- const username = flags['target-org'].getUsername();
73
- const output = { orgId, url, username };
74
- // NOTE: Deliberate use of `||` here since getBoolean() defaults to false, and we need to consider both env vars.
75
- const containerMode = env.getBoolean('SF_CONTAINER_MODE') || env.getBoolean('SFDX_CONTAINER_MODE');
76
- // security warning only for --json OR --url-only OR containerMode
77
- if (flags['url-only'] || Boolean(flags.json) || containerMode) {
78
- const sharedMessages = Messages.loadMessages('@salesforce/plugin-org', 'messages');
79
- this.warn(sharedMessages.getMessage('SecurityWarning'));
80
- this.log('');
81
- }
82
- if (containerMode) {
83
- // instruct the user that they need to paste the URL into the browser
84
- this.styledHeader('Action Required!');
85
- this.log(messages.getMessage('containerAction', [orgId, url]));
86
- return output;
87
- }
88
- if (flags['url-only']) {
89
- // this includes the URL
90
- this.logSuccess(messages.getMessage('humanSuccess', [orgId, username, url]));
91
- return output;
92
- }
93
- this.logSuccess(messages.getMessage('humanSuccessNoUrl', [orgId, username]));
94
- // we actually need to open the org
95
- try {
96
- this.spinner.start(messages.getMessage('domainWaiting'));
97
- await new SfdcUrl(url).checkLightningDomain();
98
- this.spinner.stop();
99
- }
100
- catch (err) {
101
- handleDomainError(err, url, env);
102
- }
103
- // create a local html file that contains the POST stuff.
104
- const tempFilePath = path.join(tmpdir(), `org-open-${new Date().valueOf()}.html`);
105
- await fs.promises.writeFile(tempFilePath, getFileContents(conn.accessToken, conn.instanceUrl,
106
- // the path flag is URI-encoded in its `parse` func.
107
- // For the form redirect to work we need it decoded.
108
- flags.path ? decodeURIComponent(flags.path) : retUrl));
109
- const filePathUrl = isWsl
110
- ? 'file:///' + execSync(`wslpath -m ${tempFilePath}`).toString().trim()
111
- : `file:///${tempFilePath}`;
112
- const cp = await utils.openUrl(filePathUrl, {
113
- ...(flags.browser ? { app: { name: apps[flags.browser] } } : {}),
114
- ...(flags.private ? { newInstance: platform() === 'darwin', app: { name: apps.browserPrivate } } : {}),
115
- });
116
- cp.on('error', (err) => {
117
- fileCleanup(tempFilePath);
118
- throw SfError.wrap(err);
119
- });
120
- // so we don't delete the file while the browser is still using it
121
- // open returns when the CP is spawned, but there's not way to know if the browser is still using the file
122
- await sleep(platform() === 'win32' || isWsl ? 7000 : 5000);
123
- fileCleanup(tempFilePath);
124
- return output;
65
+ return this.openOrgUI(flags, frontDoorUrl, retUrl);
125
66
  }
126
67
  }
127
- const fileCleanup = (tempFilePath) => fs.rmSync(tempFilePath, { force: true, maxRetries: 3, recursive: true });
128
- const buildFrontdoorUrl = async (org, conn) => {
129
- await org.refreshAuth(); // we need a live accessToken for the frontdoor url
130
- const accessToken = conn.accessToken;
131
- if (!accessToken) {
132
- throw new SfError('NoAccessToken', 'NoAccessToken');
133
- }
134
- const instanceUrlClean = org.getField(Org.Fields.INSTANCE_URL).replace(/\/$/, '');
135
- return `${instanceUrlClean}/secur/frontdoor.jsp?sid=${accessToken}`;
136
- };
137
68
  const generateFileUrl = async (file, conn) => {
138
69
  try {
139
70
  const metadataResolver = new MetadataResolver();
@@ -172,34 +103,4 @@ const flowFileNameToId = async (conn, filePath) => {
172
103
  throw messages.createError('FlowIdNotFound', [filePath]);
173
104
  }
174
105
  };
175
- /** builds the html file that does an automatic post to the frontdoor url */
176
- const getFileContents = (authToken, instanceUrl,
177
- // we have to defalt this to get to Setup only on the POST version. GET goes to Setup automatically
178
- retUrl = '/lightning/setup/SetupOneHome/home') => `
179
- <html>
180
- <body onload="document.body.firstElementChild.submit()">
181
- <form method="POST" action="${instanceUrl}/secur/frontdoor.jsp">
182
- <input type="hidden" name="sid" value="${authToken}" />
183
- <input type="hidden" name="retURL" value="${retUrl}" />
184
- </form>
185
- </body>
186
- </html>`;
187
- const handleDomainError = (err, url, env) => {
188
- if (err instanceof Error) {
189
- if (err.message.includes('timeout')) {
190
- const host = /https?:\/\/([^.]*)/.exec(url)?.[1];
191
- if (!host) {
192
- throw new SfError('InvalidUrl', 'InvalidUrl');
193
- }
194
- const domain = `https://${host}.lightning.force.com`;
195
- const domainRetryTimeout = env.getNumber('SF_DOMAIN_RETRY') ?? env.getNumber('SFDX_DOMAIN_RETRY', 240);
196
- const timeout = new Duration(domainRetryTimeout, Duration.Unit.SECONDS);
197
- const logger = Logger.childFromRoot('org:open');
198
- logger.debug(`Did not find IP for ${domain} after ${timeout.seconds} seconds`);
199
- throw new SfError(messages.getMessage('domainTimeoutError'), 'domainTimeoutError');
200
- }
201
- throw SfError.wrap(err);
202
-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mB,EAAE;IACrF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,iBAAiB,CACvC,6EAA6E,IAAI,CAAC,QAAQ,CACxF,QAAQ,EACR,gBAAgB,CACjB,uCAAuC,CACzC,CAAC;QACF,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,QAAQ,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ import { Connection, Org } from '@salesforce/core';
3
+ import { type OrgOpenOutput } from './orgTypes.js';
4
+ type OrgOpenFlags = {
5
+ 'url-only': boolean;
6
+ browser?: 'chrome' | 'firefox' | 'edge';
7
+ path?: string;
8
+ private: boolean;
9
+ };
10
+ export declare abstract class OrgOpenCommandBase<T> extends SfCommand<T> {
11
+ static enableJsonFlag: boolean;
12
+ protected org: Org;
13
+ protected connection: Connection;
14
+ protected openOrgUI(flags: OrgOpenFlags, frontDoorUrl: string, retUrl?: string): Promise<OrgOpenOutput>;
15
+ }
16
+ export {};
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Copyright (c) 2020, 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 path from 'node:path';
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';
12
+ import { apps } from 'open';
13
+ import { SfCommand } from '@salesforce/sf-plugins-core';
14
+ import { Messages, SfdcUrl, SfError } from '@salesforce/core';
15
+ import { env, sleep } from '@salesforce/kit';
16
+ import utils, { fileCleanup, getFileContents, handleDomainError } from './orgOpenUtils.js';
17
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
18
+ const messages = Messages.loadMessages('@salesforce/plugin-org', 'open');
19
+ export class OrgOpenCommandBase extends SfCommand {
20
+ static enableJsonFlag = true;
21
+ // Set by concrete classes in `run()`
22
+ org;
23
+ connection;
24
+ async openOrgUI(flags, frontDoorUrl, retUrl) {
25
+ const orgId = this.org.getOrgId();
26
+ const url = `${frontDoorUrl}${retUrl ? `&retURL=${retUrl}` : ''}`;
27
+ // TODO: better typings in sfdx-core for orgs read from auth files
28
+ const username = this.org.getUsername();
29
+ const output = { orgId, url, username };
30
+ // NOTE: Deliberate use of `||` here since getBoolean() defaults to false, and we need to consider both env vars.
31
+ const containerMode = env.getBoolean('SF_CONTAINER_MODE') || env.getBoolean('SFDX_CONTAINER_MODE');
32
+ // security warning only for --json OR --url-only OR containerMode
33
+ if (flags['url-only'] || this.jsonEnabled() || containerMode) {
34
+ const sharedMessages = Messages.loadMessages('@salesforce/plugin-org', 'messages');
35
+ this.warn(sharedMessages.getMessage('SecurityWarning'));
36
+ this.log('');
37
+ }
38
+ if (containerMode) {
39
+ // instruct the user that they need to paste the URL into the browser
40
+ this.styledHeader('Action Required!');
41
+ this.log(messages.getMessage('containerAction', [orgId, url]));
42
+ return output;
43
+ }
44
+ if (flags['url-only']) {
45
+ // this includes the URL
46
+ this.logSuccess(messages.getMessage('humanSuccess', [orgId, username, url]));
47
+ return output;
48
+ }
49
+ this.logSuccess(messages.getMessage('humanSuccessNoUrl', [orgId, username]));
50
+ // we actually need to open the org
51
+ try {
52
+ this.spinner.start(messages.getMessage('domainWaiting'));
53
+ await new SfdcUrl(url).checkLightningDomain();
54
+ this.spinner.stop();
55
+ }
56
+ catch (err) {
57
+ handleDomainError(err, url, env);
58
+ }
59
+ // create a local html file that contains the POST stuff.
60
+ const tempFilePath = path.join(tmpdir(), `org-open-${new Date().valueOf()}.html`);
61
+ await fs.promises.writeFile(tempFilePath, getFileContents(this.connection.accessToken, this.connection.instanceUrl,
62
+ // the path flag is URI-encoded in its `parse` func.
63
+ // For the form redirect to work we need it decoded.
64
+ flags.path ? decodeURIComponent(flags.path) : retUrl));
65
+ const filePathUrl = isWsl
66
+ ? 'file:///' + execSync(`wslpath -m ${tempFilePath}`).toString().trim()
67
+ : `file:///${tempFilePath}`;
68
+ const cp = await utils.openUrl(filePathUrl, {
69
+ ...(flags.browser ? { app: { name: apps[flags.browser] } } : {}),
70
+ ...(flags.private ? { newInstance: platform() === 'darwin', app: { name: apps.browserPrivate } } : {}),
71
+ });
72
+ cp.on('error', (err) => {
73
+ fileCleanup(tempFilePath);
74
+ throw SfError.wrap(err);
75
+ });
76
+ // so we don't delete the file while the browser is still using it
77
+ // open returns when the CP is spawned, but there's not way to know if the browser is still using the file
78
+ await sleep(platform() === 'win32' || isWsl ? 7000 : 5000);
79
+ fileCleanup(tempFilePath);
80
+ return output;
81
+ }
82
+ }
83
+ //# sourceMappingURL=orgOpenCommandBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orgOpenCommandBase.js","sourceRoot":"","sources":["../../src/shared/orgOpenCommandBase.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAc,QAAQ,EAAO,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB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4
+ import { Env } from '@salesforce/kit';
5
+ export declare const openUrl: (url: string, options: Options) => Promise<ChildProcess>;
6
+ export declare const fileCleanup: (tempFilePath: string) => void;
7
+ export declare const buildFrontdoorUrl: (org: Org, conn: Connection) => Promise<string>;
8
+ export declare const handleDomainError: (err: unknown, url: string, env: Env) => string;
9
+ /** builds the html file that does an automatic post to the frontdoor url */
10
+ export declare const getFileContents: (authToken: string, instanceUrl: string, retUrl?: string) => string;
11
+ declare const _default: {
12
+ openUrl: (url: string, options: Options) => Promise<ChildProcess>;
13
+ fileCleanup: (tempFilePath: string) => void;
14
+ buildFrontdoorUrl: (org: Org, conn: Connection) => Promise<string>;
15
+ handleDomainError: (err: unknown, url: string, env: Env) => string;
16
+ getFileContents: (authToken: string, instanceUrl: string, retUrl?: string) => string;
17
+ };
18
+ export default _default;
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Copyright (c) 2020, 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 { rmSync } from 'node:fs';
8
+ import open from 'open';
9
+ import { Logger, Messages, Org, SfError } from '@salesforce/core';
10
+ import { Duration } from '@salesforce/kit';
11
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
12
+ const messages = Messages.loadMessages('@salesforce/plugin-org', 'open');
13
+ export const openUrl = async (url, options) => open(url, options);
14
+ export const fileCleanup = (tempFilePath) => rmSync(tempFilePath, { force: true, maxRetries: 3, recursive: true });
15
+ export const buildFrontdoorUrl = async (org, conn) => {
16
+ await org.refreshAuth(); // we need a live accessToken for the frontdoor url
17
+ const accessToken = conn.accessToken;
18
+ if (!accessToken) {
19
+ throw new SfError('NoAccessToken', 'NoAccessToken');
20
+ }
21
+ const instanceUrlClean = org.getField(Org.Fields.INSTANCE_URL).replace(/\/$/, '');
22
+ return `${instanceUrlClean}/secur/frontdoor.jsp?sid=${accessToken}`;
23
+ };
24
+ export const handleDomainError = (err, url, env) => {
25
+ if (err instanceof Error) {
26
+ if (err.message.includes('timeout')) {
27
+ const host = /https?:\/\/([^.]*)/.exec(url)?.[1];
28
+ if (!host) {
29
+ throw new SfError('InvalidUrl', 'InvalidUrl');
30
+ }
31
+ const domain = `https://${host}.lightning.force.com`;
32
+ const domainRetryTimeout = env.getNumber('SF_DOMAIN_RETRY') ?? env.getNumber('SFDX_DOMAIN_RETRY', 240);
33
+ const timeout = new Duration(domainRetryTimeout, Duration.Unit.SECONDS);
34
+ const logger = Logger.childFromRoot('org:open');
35
+ logger.debug(`Did not find IP for ${domain} after ${timeout.seconds} seconds`);
36
+ throw new SfError(messages.getMessage('domainTimeoutError'), 'domainTimeoutError');
37
+ }
38
+ throw SfError.wrap(err);
39
+ }
40
+ throw err;
41
+ };
42
+ /** builds the html file that does an automatic post to the frontdoor url */
43
+ export const getFileContents = (authToken, instanceUrl,
44
+ // we have to defalt this to get to Setup only on the POST version. GET goes to Setup automatically
45
+ retUrl = '/lightning/setup/SetupOneHome/home') => `
46
+ <html>
47
+ <body onload="document.body.firstElementChild.submit()">
48
+ <form method="POST" action="${instanceUrl}/secur/frontdoor.jsp">
49
+ <input type="hidden" name="sid" value="${authToken}" />
50
+ <input type="hidden" name="retURL" value="${retUrl}" />
51
+ </form>
52
+ </body>
53
+ </html>`;
54
+ export default {
55
+ openUrl,
56
+ fileCleanup,
57
+ buildFrontdoorUrl,
58
+ handleDomainError,
59
+ getFileContents,
60
+ };
61
+ //# sourceMappingURL=orgOpenUtils.js.map
@@ -0,0 +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,EAAc,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EA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;
12
12
  sfdxAuthUrl?: string;
13
13
  };
14
+ export type OrgOpenOutput = {
15
+ url: string;
16
+ username: string;
17
+ orgId: string;
18
+ };
14
19
  /** Convenience type for the fields that are in the auth file
15
20
  *
16
21
  * core's AuthFields has everything as optional.
@@ -1 +1 @@
1
- {"version":3,"file":"orgTypes.js","sourceRoot":"","sources":["../../src/shared/orgTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8FH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,oDAA8B,CAAA;IAC9B,yCAAmB,CAAA;IACnB,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B"}
1
+ {"version":3,"file":"orgTypes.js","sourceRoot":"","sources":["../../src/shared/orgTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoGH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,oDAA8B,CAAA;IAC9B,yCAAmB,CAAA;IACnB,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B"}
@@ -1,11 +1,7 @@
1
- import { ChildProcess } from 'node:child_process';
2
- import { Options } from 'open';
3
1
  export declare const getAliasByUsername: (username: string) => Promise<string | undefined>;
4
- export declare const openUrl: (url: string, options: Options) => Promise<ChildProcess>;
5
2
  export declare const lowerToUpper: (object: Record<string, unknown>) => Record<string, unknown>;
6
3
  declare const _default: {
7
4
  getAliasByUsername: (username: string) => Promise<string | undefined>;
8
- openUrl: (url: string, options: Options) => Promise<ChildProcess>;
9
5
  lowerToUpper: (object: Record<string, unknown>) => Record<string, unknown>;
10
6
  };
11
7
  export default _default;
@@ -1,20 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2020, 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
+ */
1
7
  import { upperFirst } from '@salesforce/kit';
2
8
  import { StateAggregator } from '@salesforce/core';
3
- import open from 'open';
4
9
  export const getAliasByUsername = async (username) => {
5
10
  const stateAggregator = await StateAggregator.getInstance();
6
11
  const keys = stateAggregator.aliases.getAll(username);
7
12
  // use the most recently added alias for that username
8
13
  return keys?.length ? keys[keys.length - 1] : undefined;
9
14
  };
10
- export const openUrl = async (url, options) => open(url, options);
11
15
  export const lowerToUpper = (object) =>
12
16
  // the API has keys defined in capital camel case, while the definition schema has them as lower camel case
13
17
  // we need to convert lower camel case to upper before merging options so they will override properly
14
18
  Object.fromEntries(Object.entries(object).map(([key, value]) => [upperFirst(key), value]));
15
19
  export default {
16
20
  getAliasByUsername,
17
- openUrl,
18
21
  lowerToUpper,
19
22
  };
20
23
  export const isDefined = (value) => value !== undefined && value !== null;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/shared/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,IAAiB,MAAM,MAAM,CAAC;AAErC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,QAAgB,EAA+B,EAAE;IACxF,MAAM,eAAe,GAAG,MAAM,eAAe,CAAC,WAAW,EAAE,CAAC;IAC5D,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtD,sDAAsD;IACtD,OAAO,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,GAAW,EAAE,OAAgB,EAAyB,EAAE,CAAC,IAAI,CAAC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GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAE7F,eAAe;IACb,kBAAkB;IAClB,YAAY;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,KAA2B,EAAc,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC"}
@@ -0,0 +1,41 @@
1
+ # summary
2
+
3
+ Open an agent in your org's Agent Builder UI in a browser.
4
+
5
+ # description
6
+
7
+ Use the --name flag to open an agent using its API name in the Agent Builder UI of your org. To find the agent's API name, go to Setup in your org and navigate to the agent's details page.
8
+
9
+ To generate the URL but not launch it in your browser, specify --url-only.
10
+
11
+ To open Agent Builder in a specific browser, use the --browser flag. Supported browsers are "chrome", "edge", and "firefox". If you don't specify --browser, the org opens in your default browser.
12
+
13
+ # examples
14
+
15
+ - Open the agent with API name Coral_Cloud_Agent in your default org using your default browser:
16
+
17
+ $ <%= config.bin %> <%= command.id %> --name Coral_Cloud_Agent
18
+
19
+ - Open the agent in an incognito window of your default browser:
20
+
21
+ $ <%= config.bin %> <%= command.id %> --private --name Coral_Cloud_Agent:
22
+
23
+ - Open the agent in an org with alias MyTestOrg1 using the Firefox browser:
24
+
25
+ $ <%= config.bin %> <%= command.id %> --target-org MyTestOrg1 --browser firefox --name Coral_Cloud_Agent
26
+
27
+ # flags.name.summary
28
+
29
+ API name, also known as developer name, of the agent you want to open in the org's Agent Builder UI.
30
+
31
+ # flags.private.summary
32
+
33
+ Open the org in the default browser using private (incognito) mode.
34
+
35
+ # flags.browser.summary
36
+
37
+ Browser where the org opens.
38
+
39
+ # flags.url-only.summary
40
+
41
+ Display navigation URL, but don’t launch browser.
@@ -1378,6 +1378,124 @@
1378
1378
  "metadata:list:org"
1379
1379
  ]
1380
1380
  },
1381
+ "org:open:agent": {
1382
+ "aliases": [],
1383
+ "args": {},
1384
+ "description": "Use the --name flag to open an agent using its API name in the Agent Builder UI of your org. To find the agent's API name, go to Setup in your org and navigate to the agent's details page.\n\nTo generate the URL but not launch it in your browser, specify --url-only.\n\nTo open Agent Builder in a specific browser, use the --browser flag. Supported browsers are \"chrome\", \"edge\", and \"firefox\". If you don't specify --browser, the org opens in your default browser.",
1385
+ "examples": [
1386
+ "Open the agent with API name Coral_Cloud_Agent in your default org using your default browser:\n$ <%= config.bin %> <%= command.id %> --name Coral_Cloud_Agent",
1387
+ "Open the agent in an incognito window of your default browser:\n$ <%= config.bin %> <%= command.id %> --private --name Coral_Cloud_Agent:",
1388
+ "Open the agent in an org with alias MyTestOrg1 using the Firefox browser:\n$ <%= config.bin %> <%= command.id %> --target-org MyTestOrg1 --browser firefox --name Coral_Cloud_Agent"
1389
+ ],
1390
+ "flags": {
1391
+ "json": {
1392
+ "description": "Format output as json.",
1393
+ "helpGroup": "GLOBAL",
1394
+ "name": "json",
1395
+ "allowNo": false,
1396
+ "type": "boolean"
1397
+ },
1398
+ "flags-dir": {
1399
+ "helpGroup": "GLOBAL",
1400
+ "name": "flags-dir",
1401
+ "summary": "Import flag values from a directory.",
1402
+ "hasDynamicHelp": false,
1403
+ "multiple": false,
1404
+ "type": "option"
1405
+ },
1406
+ "target-org": {
1407
+ "char": "o",
1408
+ "name": "target-org",
1409
+ "noCacheDefault": true,
1410
+ "required": true,
1411
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1412
+ "hasDynamicHelp": true,
1413
+ "multiple": false,
1414
+ "type": "option"
1415
+ },
1416
+ "api-version": {
1417
+ "description": "Override the api version used for api requests made by this command",
1418
+ "name": "api-version",
1419
+ "hasDynamicHelp": false,
1420
+ "multiple": false,
1421
+ "type": "option"
1422
+ },
1423
+ "name": {
1424
+ "char": "n",
1425
+ "name": "name",
1426
+ "required": true,
1427
+ "summary": "API name, also known as developer name, of the agent you want to open in the org's Agent Builder UI.",
1428
+ "hasDynamicHelp": false,
1429
+ "multiple": false,
1430
+ "type": "option"
1431
+ },
1432
+ "private": {
1433
+ "exclusive": [
1434
+ "url-only",
1435
+ "browser"
1436
+ ],
1437
+ "name": "private",
1438
+ "summary": "Open the org in the default browser using private (incognito) mode.",
1439
+ "allowNo": false,
1440
+ "type": "boolean"
1441
+ },
1442
+ "browser": {
1443
+ "char": "b",
1444
+ "exclusive": [
1445
+ "url-only",
1446
+ "private"
1447
+ ],
1448
+ "name": "browser",
1449
+ "summary": "Browser where the org opens.",
1450
+ "hasDynamicHelp": false,
1451
+ "multiple": false,
1452
+ "options": [
1453
+ "chrome",
1454
+ "edge",
1455
+ "firefox"
1456
+ ],
1457
+ "type": "option"
1458
+ },
1459
+ "url-only": {
1460
+ "aliases": [
1461
+ "urlonly"
1462
+ ],
1463
+ "char": "r",
1464
+ "deprecateAliases": true,
1465
+ "name": "url-only",
1466
+ "summary": "Display navigation URL, but don’t launch browser.",
1467
+ "allowNo": false,
1468
+ "type": "boolean"
1469
+ }
1470
+ },
1471
+ "hasDynamicHelp": true,
1472
+ "hiddenAliases": [],
1473
+ "id": "org:open:agent",
1474
+ "pluginAlias": "@salesforce/plugin-org",
1475
+ "pluginName": "@salesforce/plugin-org",
1476
+ "pluginType": "core",
1477
+ "state": "beta",
1478
+ "strict": true,
1479
+ "summary": "Open an agent in your org's Agent Builder UI in a browser.",
1480
+ "enableJsonFlag": true,
1481
+ "isESM": true,
1482
+ "relativePath": [
1483
+ "lib",
1484
+ "commands",
1485
+ "org",
1486
+ "open",
1487
+ "agent.js"
1488
+ ],
1489
+ "aliasPermutations": [],
1490
+ "permutations": [
1491
+ "org:open:agent",
1492
+ "open:org:agent",
1493
+ "open:agent:org",
1494
+ "org:agent:open",
1495
+ "agent:org:open",
1496
+ "agent:open:org"
1497
+ ]
1498
+ },
1381
1499
  "org:refresh:sandbox": {
1382
1500
  "aliases": [],
1383
1501
  "args": {},
@@ -1698,5 +1816,5 @@
1698
1816
  ]
1699
1817
  }
1700
1818
  },
1701
- "version": "5.1.5"
1819
+ "version": "5.2.0"
1702
1820
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-org",
3
3
  "description": "Commands to interact with Salesforce orgs",
4
- "version": "5.1.5",
4
+ "version": "5.2.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
@@ -24,7 +24,7 @@
24
24
  "@salesforce/dev-scripts": "^10.2.10",
25
25
  "@salesforce/plugin-command-reference": "^3.1.31",
26
26
  "@salesforce/ts-sinon": "^1.4.29",
27
- "eslint-plugin-sf-plugin": "^1.20.8",
27
+ "eslint-plugin-sf-plugin": "^1.20.12",
28
28
  "moment": "^2.30.1",
29
29
  "oclif": "^4.15.22",
30
30
  "ts-node": "^10.9.2",
@@ -227,7 +227,7 @@
227
227
  "exports": "./lib/index.js",
228
228
  "type": "module",
229
229
  "sfdx": {
230
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/5.1.5.crt",
231
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/5.1.5.sig"
230
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/5.2.0.crt",
231
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/5.2.0.sig"
232
232
  }
233
233
  }