@salesforce/plugin-auth 2.8.26 → 3.0.2

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 (35) hide show
  1. package/README.md +67 -67
  2. package/lib/authBaseCommand.d.ts +0 -2
  3. package/lib/authBaseCommand.js +9 -25
  4. package/lib/authBaseCommand.js.map +1 -1
  5. package/lib/commands/org/list/auth.d.ts +1 -1
  6. package/lib/commands/org/list/auth.js +16 -17
  7. package/lib/commands/org/list/auth.js.map +1 -1
  8. package/lib/commands/org/login/access-token.d.ts +5 -5
  9. package/lib/commands/org/login/access-token.js +62 -62
  10. package/lib/commands/org/login/access-token.js.map +1 -1
  11. package/lib/commands/org/login/device.d.ts +10 -10
  12. package/lib/commands/org/login/device.js +59 -60
  13. package/lib/commands/org/login/device.js.map +1 -1
  14. package/lib/commands/org/login/jwt.d.ts +8 -8
  15. package/lib/commands/org/login/jwt.js +78 -81
  16. package/lib/commands/org/login/jwt.js.map +1 -1
  17. package/lib/commands/org/login/sfdx-url.d.ts +7 -7
  18. package/lib/commands/org/login/sfdx-url.js +59 -58
  19. package/lib/commands/org/login/sfdx-url.js.map +1 -1
  20. package/lib/commands/org/login/web.d.ts +7 -7
  21. package/lib/commands/org/login/web.js +81 -81
  22. package/lib/commands/org/login/web.js.map +1 -1
  23. package/lib/commands/org/logout.d.ts +3 -3
  24. package/lib/commands/org/logout.js +48 -49
  25. package/lib/commands/org/logout.js.map +1 -1
  26. package/lib/common.js +13 -15
  27. package/lib/common.js.map +1 -1
  28. package/lib/index.d.ts +1 -1
  29. package/lib/index.js +1 -2
  30. package/lib/index.js.map +1 -1
  31. package/messages/accesstoken.store.md +5 -0
  32. package/messages/messages.md +0 -5
  33. package/oclif.lock +7839 -0
  34. package/oclif.manifest.json +665 -329
  35. package/package.json +32 -50
package/README.md CHANGED
@@ -70,21 +70,21 @@ sfdx plugins
70
70
 
71
71
  <!-- commands -->
72
72
 
73
- - [`sfdx org:list:auth`](#sfdx-orglistauth)
74
- - [`sfdx org:login:access-token`](#sfdx-orgloginaccess-token)
75
- - [`sfdx org:login:device`](#sfdx-orglogindevice)
76
- - [`sfdx org:login:jwt`](#sfdx-orgloginjwt)
77
- - [`sfdx org:login:sfdx-url`](#sfdx-orgloginsfdx-url)
78
- - [`sfdx org:login:web`](#sfdx-orgloginweb)
79
- - [`sfdx org:logout`](#sfdx-orglogout)
73
+ - [`sf org list auth`](#sf-org-list-auth)
74
+ - [`sf org login access-token`](#sf-org-login-access-token)
75
+ - [`sf org login device`](#sf-org-login-device)
76
+ - [`sf org login jwt`](#sf-org-login-jwt)
77
+ - [`sf org login sfdx-url`](#sf-org-login-sfdx-url)
78
+ - [`sf org login web`](#sf-org-login-web)
79
+ - [`sf org logout`](#sf-org-logout)
80
80
 
81
- ## `sfdx org:list:auth`
81
+ ## `sf org list auth`
82
82
 
83
83
  List authorization information about the orgs you created or logged into.
84
84
 
85
85
  ```
86
86
  USAGE
87
- $ sfdx org:list:auth [--json]
87
+ $ sf org list auth [--json]
88
88
 
89
89
  GLOBAL FLAGS
90
90
  --json Format output as json.
@@ -98,24 +98,24 @@ DESCRIPTION
98
98
  connection status, use the "org list" command.
99
99
 
100
100
  ALIASES
101
- $ sfdx force:auth:list
102
- $ sfdx auth:list
101
+ $ sf force auth list
102
+ $ sf auth list
103
103
 
104
104
  EXAMPLES
105
105
  List local authorization information about your orgs:
106
106
 
107
- $ sfdx org:list:auth
107
+ $ sf org list auth
108
108
  ```
109
109
 
110
- _See code: [src/commands/org/list/auth.ts](https://github.com/salesforcecli/plugin-auth/blob/2.8.26/src/commands/org/list/auth.ts)_
110
+ _See code: [src/commands/org/list/auth.ts](https://github.com/salesforcecli/plugin-auth/blob/3.0.2/src/commands/org/list/auth.ts)_
111
111
 
112
- ## `sfdx org:login:access-token`
112
+ ## `sf org login access-token`
113
113
 
114
114
  Authorize an org using an existing Salesforce access token.
115
115
 
116
116
  ```
117
117
  USAGE
118
- $ sfdx org:login:access-token -r <value> [--json] [-d] [-s] [-a <value>] [-p]
118
+ $ sf org login access-token -r <value> [--json] [-d] [-s] [-a <value>] [-p]
119
119
 
120
120
  FLAGS
121
121
  -a, --alias=<value> Alias for the org.
@@ -137,18 +137,18 @@ DESCRIPTION
137
137
  command with the --no-prompt parameter.
138
138
 
139
139
  ALIASES
140
- $ sfdx force:auth:accesstoken:store
141
- $ sfdx auth:accesstoken:store
140
+ $ sf force auth accesstoken store
141
+ $ sf auth accesstoken store
142
142
 
143
143
  EXAMPLES
144
144
  Authorize an org on https://mycompany.my.salesforce.com; the command prompts you for the access token:
145
145
 
146
- $ sfdx org:login:access-token --instance-url https://mycompany.my.salesforce.com
146
+ $ sf org login access-token --instance-url https://mycompany.my.salesforce.com
147
147
 
148
148
  Authorize the org without being prompted; you must have previously set the SFDX_ACCESS_TOKEN environment variable to
149
149
  the access token:
150
150
 
151
- $ sfdx org:login:access-token --instance-url https://dev-hub.my.salesforce.com --no-prompt
151
+ $ sf org login access-token --instance-url https://dev-hub.my.salesforce.com --no-prompt
152
152
 
153
153
  FLAG DESCRIPTIONS
154
154
  -r, --instance-url=<value> URL of the instance that the org lives on.
@@ -160,15 +160,15 @@ FLAG DESCRIPTIONS
160
160
  To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
161
161
  ```
162
162
 
163
- _See code: [src/commands/org/login/access-token.ts](https://github.com/salesforcecli/plugin-auth/blob/2.8.26/src/commands/org/login/access-token.ts)_
163
+ _See code: [src/commands/org/login/access-token.ts](https://github.com/salesforcecli/plugin-auth/blob/3.0.2/src/commands/org/login/access-token.ts)_
164
164
 
165
- ## `sfdx org:login:device`
165
+ ## `sf org login device`
166
166
 
167
167
  Authorize an org using a device code.
168
168
 
169
169
  ```
170
170
  USAGE
171
- $ sfdx org:login:device [--json] [-i <value>] [-r <value>] [-d] [-s] [-a <value>]
171
+ $ sf org login device [--json] [-i <value>] [-r <value>] [-d] [-s] [-a <value>]
172
172
 
173
173
  FLAGS
174
174
  -a, --alias=<value> Alias for the org.
@@ -193,21 +193,21 @@ DESCRIPTION
193
193
  close the browser window.
194
194
 
195
195
  ALIASES
196
- $ sfdx force:auth:device:login
197
- $ sfdx auth:device:login
196
+ $ sf force auth device login
197
+ $ sf auth device login
198
198
 
199
199
  EXAMPLES
200
200
  Authorize an org using a device code, give the org the alias TestOrg1, and set it as your default Dev Hub org:
201
201
 
202
- $ sfdx org:login:device --set-default-dev-hub --alias TestOrg1
202
+ $ sf org login device --set-default-dev-hub --alias TestOrg1
203
203
 
204
204
  Authorize an org in which you've created a custom connected app with the specified client ID (consumer key):
205
205
 
206
- $ sfdx org:login:device --client-id <OAuth client id>
206
+ $ sf org login device --client-id <OAuth client id>
207
207
 
208
208
  Authorize a sandbox org with the specified instance URL:
209
209
 
210
- $ sfdx org:login:device --instance-url https://MyDomainName--SandboxName.sandbox.my.salesforce.com
210
+ $ sf org login device --instance-url https://MyDomainName--SandboxName.sandbox.my.salesforce.com
211
211
 
212
212
  FLAG DESCRIPTIONS
213
213
  -r, --instance-url=<value> URL of the instance that the org lives on.
@@ -219,15 +219,15 @@ FLAG DESCRIPTIONS
219
219
  To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
220
220
  ```
221
221
 
222
- _See code: [src/commands/org/login/device.ts](https://github.com/salesforcecli/plugin-auth/blob/2.8.26/src/commands/org/login/device.ts)_
222
+ _See code: [src/commands/org/login/device.ts](https://github.com/salesforcecli/plugin-auth/blob/3.0.2/src/commands/org/login/device.ts)_
223
223
 
224
- ## `sfdx org:login:jwt`
224
+ ## `sf org login jwt`
225
225
 
226
226
  Log in to a Salesforce org using a JSON web token (JWT).
227
227
 
228
228
  ```
229
229
  USAGE
230
- $ sfdx org:login:jwt -o <value> -f <value> -i <value> [--json] [-r <value>] [-d] [-s] [-a <value>]
230
+ $ sf org login jwt -o <value> -f <value> -i <value> [--json] [-r <value>] [-d] [-s] [-a <value>]
231
231
 
232
232
  FLAGS
233
233
  -a, --alias=<value> Alias for the org.
@@ -271,30 +271,30 @@ DESCRIPTION
271
271
  --set-default for your default scratch org or sandbox, or --set-default-dev-hub for your default Dev Hub.
272
272
 
273
273
  ALIASES
274
- $ sfdx force:auth:jwt:grant
275
- $ sfdx auth:jwt:grant
274
+ $ sf force auth jwt grant
275
+ $ sf auth jwt grant
276
276
 
277
277
  EXAMPLES
278
278
  Log into an org with username jdoe@example.org and on the default instance URL (https://login.salesforce.org). The
279
279
  private key is stored in the file /Users/jdoe/JWT/server.key and the command uses the connected app with consumer
280
280
  key (client id) 04580y4051234051.
281
281
 
282
- $ sfdx org:login:jwt --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id \
282
+ $ sf org login jwt --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id \
283
283
  04580y4051234051
284
284
 
285
285
  Set the org as the default and give it an alias:
286
286
 
287
- $ sfdx org:login:jwt --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id \
287
+ $ sf org login jwt --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id \
288
288
  04580y4051234051 --alias ci-org --set-default
289
289
 
290
290
  Set the org as the default Dev Hub and give it an alias:
291
291
 
292
- $ sfdx org:login:jwt --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id \
292
+ $ sf org login jwt --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id \
293
293
  04580y4051234051 --alias ci-dev-hub --set-default-dev-hub
294
294
 
295
295
  Log in to a sandbox using URL https://MyDomainName--SandboxName.sandbox.my.salesforce.com:
296
296
 
297
- $ sfdx org:login:jwt --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id \
297
+ $ sf org login jwt --username jdoe@example.org --jwt-key-file /Users/jdoe/JWT/server.key --client-id \
298
298
  04580y4051234051 --alias ci-org --set-default --instance-url \
299
299
  https://MyDomainName--SandboxName.sandbox.my.salesforce.com
300
300
 
@@ -308,15 +308,15 @@ FLAG DESCRIPTIONS
308
308
  To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
309
309
  ```
310
310
 
311
- _See code: [src/commands/org/login/jwt.ts](https://github.com/salesforcecli/plugin-auth/blob/2.8.26/src/commands/org/login/jwt.ts)_
311
+ _See code: [src/commands/org/login/jwt.ts](https://github.com/salesforcecli/plugin-auth/blob/3.0.2/src/commands/org/login/jwt.ts)_
312
312
 
313
- ## `sfdx org:login:sfdx-url`
313
+ ## `sf org login sfdx-url`
314
314
 
315
315
  Authorize an org using a Salesforce DX authorization URL stored in a file.
316
316
 
317
317
  ```
318
318
  USAGE
319
- $ sfdx org:login:sfdx-url -f <value> [--json] [-d] [-s] [-a <value>]
319
+ $ sf org login sfdx-url -f <value> [--json] [-d] [-s] [-a <value>]
320
320
 
321
321
  FLAGS
322
322
  -a, --alias=<value> Alias for the org.
@@ -335,46 +335,46 @@ DESCRIPTION
335
335
  protocol, and not "http" or "https". Also, the "instanceUrl" inside the SFDX authorization URL doesn't include the
336
336
  protocol ("https://").
337
337
 
338
- You have three options when creating the authorization file. The easiest option is to redirect the output of the "sfdx
338
+ You have three options when creating the authorization file. The easiest option is to redirect the output of the "sf
339
339
  org display --verbose --json" command into a file. For example, using an org with alias my-org that you've already
340
340
  authorized:
341
341
 
342
- $ sfdx org display --target-org my-org --verbose --json > authFile.json
342
+ $ sf org display --target-org my-org --verbose --json > authFile.json
343
343
 
344
344
  The resulting JSON file contains the URL in the "sfdxAuthUrl" property of the "result" object. You can then reference
345
345
  the file when running this command:
346
346
 
347
- $ sfdx org:login:sfdx-url --sfdx-url-file authFile.json
347
+ $ sf org login sfdx-url --sfdx-url-file authFile.json
348
348
 
349
- NOTE: The "sfdx org display --verbose" command displays the refresh token only for orgs authorized with the web server
349
+ NOTE: The "sf org display --verbose" command displays the refresh token only for orgs authorized with the web server
350
350
  flow, and not the JWT bearer flow.
351
351
 
352
352
  You can also create a JSON file that has a top-level property named sfdxAuthUrl whose value is the authorization URL.
353
353
  Finally, you can create a normal text file that includes just the URL and nothing else.
354
354
 
355
355
  ALIASES
356
- $ sfdx force:auth:sfdxurl:store
357
- $ sfdx auth:sfdxurl:store
356
+ $ sf force auth sfdxurl store
357
+ $ sf auth sfdxurl store
358
358
 
359
359
  EXAMPLES
360
360
  Authorize an org using the SFDX authorization URL in the files/authFile.json file:
361
361
 
362
- $ sfdx org:login:sfdx-url --sfdx-url-file files/authFile.json
362
+ $ sf org login sfdx-url --sfdx-url-file files/authFile.json
363
363
 
364
364
  Similar to previous example, but set the org as your default and give it an alias MyDefaultOrg:
365
365
 
366
- $ sfdx org:login:sfdx-url --sfdx-url-file files/authFile.json --set-default --alias MyDefaultOrg
366
+ $ sf org login sfdx-url --sfdx-url-file files/authFile.json --set-default --alias MyDefaultOrg
367
367
  ```
368
368
 
369
- _See code: [src/commands/org/login/sfdx-url.ts](https://github.com/salesforcecli/plugin-auth/blob/2.8.26/src/commands/org/login/sfdx-url.ts)_
369
+ _See code: [src/commands/org/login/sfdx-url.ts](https://github.com/salesforcecli/plugin-auth/blob/3.0.2/src/commands/org/login/sfdx-url.ts)_
370
370
 
371
- ## `sfdx org:login:web`
371
+ ## `sf org login web`
372
372
 
373
373
  Log in to a Salesforce org using the web server flow.
374
374
 
375
375
  ```
376
376
  USAGE
377
- $ sfdx org:login:web [--json] [-b chrome|edge|firefox] [-i <value>] [-r <value>] [-d] [-s] [-a <value>]
377
+ $ sf org login web [--json] [-b chrome|edge|firefox] [-i <value>] [-r <value>] [-d] [-s] [-a <value>]
378
378
 
379
379
  FLAGS
380
380
  -a, --alias=<value> Alias for the org.
@@ -409,31 +409,31 @@ DESCRIPTION
409
409
  consumer key with the --client-id flag.
410
410
 
411
411
  ALIASES
412
- $ sfdx force:auth:web:login
413
- $ sfdx auth:web:login
412
+ $ sf force auth web login
413
+ $ sf auth web login
414
414
 
415
415
  EXAMPLES
416
416
  Run the command with no flags to open the default Salesforce login page (https://login.salesforce.com):
417
417
 
418
- $ sfdx org:login:web
418
+ $ sf org login web
419
419
 
420
420
  Log in to your Dev Hub, set it as your default Dev Hub, and set an alias that you reference later when you create a
421
421
  scratch org:
422
422
 
423
- $ sfdx org:login:web --set-default-dev-hub --alias dev-hub
423
+ $ sf org login web --set-default-dev-hub --alias dev-hub
424
424
 
425
425
  Log in to a sandbox and set it as your default org:
426
426
 
427
- $ sfdx org:login:web --instance-url https://MyDomainName--SandboxName.sandbox.my.salesforce.com --set-default
427
+ $ sf org login web --instance-url https://MyDomainName--SandboxName.sandbox.my.salesforce.com --set-default
428
428
 
429
429
  Use --browser to specify a specific browser, such as Google Chrome:
430
430
 
431
- $ sfdx org:login:web --instance-url https://MyDomainName--SandboxName.sandbox.my.salesforce.com --set-default \
431
+ $ sf org login web --instance-url https://MyDomainName--SandboxName.sandbox.my.salesforce.com --set-default \
432
432
  --browser chrome
433
433
 
434
434
  Use your own connected app by specifying its consumer key (also called client ID):
435
435
 
436
- $ sfdx org:login:web --instance-url https://MyDomainName--SandboxName.sandbox.my.salesforce.com --set-default \
436
+ $ sf org login web --instance-url https://MyDomainName--SandboxName.sandbox.my.salesforce.com --set-default \
437
437
  --browser chrome --client-id 04580y4051234051
438
438
 
439
439
  FLAG DESCRIPTIONS
@@ -451,15 +451,15 @@ FLAG DESCRIPTIONS
451
451
  To specify a sandbox, set --instance-url to https://MyDomainName--SandboxName.sandbox.my.salesforce.com.
452
452
  ```
453
453
 
454
- _See code: [src/commands/org/login/web.ts](https://github.com/salesforcecli/plugin-auth/blob/2.8.26/src/commands/org/login/web.ts)_
454
+ _See code: [src/commands/org/login/web.ts](https://github.com/salesforcecli/plugin-auth/blob/3.0.2/src/commands/org/login/web.ts)_
455
455
 
456
- ## `sfdx org:logout`
456
+ ## `sf org logout`
457
457
 
458
458
  Log out of a Salesforce org.
459
459
 
460
460
  ```
461
461
  USAGE
462
- $ sfdx org:logout [--json] [-a | -o <value>] [-p]
462
+ $ sf org logout [--json] [-a | -o <value>] [-p]
463
463
 
464
464
  FLAGS
465
465
  -a, --all Include all authenticated orgs.
@@ -485,25 +485,25 @@ DESCRIPTION
485
485
  again, either through the CLI or the Salesforce UI.
486
486
 
487
487
  ALIASES
488
- $ sfdx force:auth:logout
489
- $ sfdx auth:logout
488
+ $ sf force auth logout
489
+ $ sf auth logout
490
490
 
491
491
  EXAMPLES
492
492
  Interactively select the orgs to log out of:
493
493
 
494
- $ sfdx org:logout
494
+ $ sf org logout
495
495
 
496
496
  Log out of the org with username me@my.org:
497
497
 
498
- $ sfdx org:logout --target-org me@my.org
498
+ $ sf org logout --target-org me@my.org
499
499
 
500
500
  Log out of all orgs after confirmation:
501
501
 
502
- $ sfdx org:logout --all
502
+ $ sf org logout --all
503
503
 
504
504
  Logout of the org with alias my-scratch and don't prompt for confirmation:
505
505
 
506
- $ sfdx org:logout --target-org my-scratch --no-prompt
506
+ $ sf org logout --target-org my-scratch --no-prompt
507
507
 
508
508
  FLAG DESCRIPTIONS
509
509
  -a, --all Include all authenticated orgs.
@@ -511,6 +511,6 @@ FLAG DESCRIPTIONS
511
511
  All orgs includes Dev Hubs, sandboxes, DE orgs, and expired, deleted, and unknown-status scratch orgs.
512
512
  ```
513
513
 
514
- _See code: [src/commands/org/logout.ts](https://github.com/salesforcecli/plugin-auth/blob/2.8.26/src/commands/org/logout.ts)_
514
+ _See code: [src/commands/org/logout.ts](https://github.com/salesforcecli/plugin-auth/blob/3.0.2/src/commands/org/logout.ts)_
515
515
 
516
516
  <!-- commandsstop -->
@@ -4,8 +4,6 @@ export declare abstract class AuthBaseCommand<T> extends SfCommand<T> {
4
4
  constructor(argv: string[], config: Config);
5
5
  protected askForHiddenResponse(messageKey: string, disableMasking?: boolean): Promise<string>;
6
6
  protected shouldExitCommand(noPrompt?: boolean, message?: string): Promise<boolean>;
7
- protected shouldRunCommand(noPrompt?: boolean, message?: string, defaultAnswer?: boolean): Promise<boolean>;
8
7
  protected askForClientSecret(disableMasking?: boolean): Promise<string>;
9
8
  protected askForAccessToken(disableMasking?: boolean): Promise<string>;
10
- protected askOverwriteAuthFile(username: string): Promise<boolean>;
11
9
  }
@@ -1,21 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthBaseCommand = void 0;
4
1
  /*
5
2
  * Copyright (c) 2020, salesforce.com, inc.
6
3
  * All rights reserved.
7
4
  * Licensed under the BSD 3-Clause license.
8
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
6
  */
10
- const core_1 = require("@salesforce/core");
11
- const chalk = require("chalk");
12
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
13
- core_1.Messages.importMessagesDirectory(__dirname);
14
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-auth', 'messages');
7
+ import { dirname } from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+ import { Messages, Global, Mode } from '@salesforce/core';
10
+ import chalk from 'chalk';
11
+ import { SfCommand } from '@salesforce/sf-plugins-core';
12
+ Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
13
+ const messages = Messages.loadMessages('@salesforce/plugin-auth', 'messages');
15
14
  function dimMessage(message) {
16
15
  return chalk.dim(message);
17
16
  }
18
- class AuthBaseCommand extends sf_plugins_core_1.SfCommand {
17
+ export class AuthBaseCommand extends SfCommand {
19
18
  constructor(argv, config) {
20
19
  super(argv, config);
21
20
  }
@@ -30,7 +29,7 @@ class AuthBaseCommand extends sf_plugins_core_1.SfCommand {
30
29
  return hidden.response;
31
30
  }
32
31
  async shouldExitCommand(noPrompt, message) {
33
- if (noPrompt || core_1.Global.getEnvironmentMode() !== core_1.Mode.DEMO) {
32
+ if (Boolean(noPrompt) || Global.getEnvironmentMode() !== Mode.DEMO) {
34
33
  return false;
35
34
  }
36
35
  else {
@@ -39,26 +38,11 @@ class AuthBaseCommand extends sf_plugins_core_1.SfCommand {
39
38
  return !answer;
40
39
  }
41
40
  }
42
- async shouldRunCommand(noPrompt, message, defaultAnswer = true) {
43
- if (noPrompt || core_1.Global.getEnvironmentMode() === core_1.Mode.DEMO) {
44
- return true;
45
- }
46
- else {
47
- const msg = dimMessage(message ?? messages.getMessage('warnAuth', [this.config.bin]));
48
- const answer = await this.confirm(msg, 10000, defaultAnswer);
49
- return answer;
50
- }
51
- }
52
41
  async askForClientSecret(disableMasking = false) {
53
42
  return this.askForHiddenResponse('clientSecretStdin', disableMasking);
54
43
  }
55
44
  async askForAccessToken(disableMasking = false) {
56
45
  return this.askForHiddenResponse('accessTokenStdin', disableMasking);
57
46
  }
58
- async askOverwriteAuthFile(username) {
59
- const yN = await this.confirm(messages.getMessage('overwriteAccessTokenAuthUserFile', [username]));
60
- return yN;
61
- }
62
47
  }
63
- exports.AuthBaseCommand = AuthBaseCommand;
64
48
  //# sourceMappingURL=authBaseCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authBaseCommand.js","sourceRoot":"","sources":["../src/authBaseCommand.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAA0D;AAC1D,+BAA+B;AAC/B,iEAAwD;AAGxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAC;AAE9E,SAAS,UAAU,CAAC,OAAe;IACjC,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED,MAAsB,eAAmB,SAAQ,2BAAY;IAC3D,YAAmB,IAAc,EAAE,MAAc;QAC/C,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtB,CAAC;IAES,KAAK,CAAC,oBAAoB,CAAC,UAAkB,EAAE,cAAc,GAAG,KAAK;QAC7E,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;QACxD,MAAM,MAAM,GAAyB,MAAM,IAAI,CAAC,MAAM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F"}
@@ -11,7 +11,7 @@ export default class ListAuth extends SfCommand<AuthListResults> {
11
11
  static readonly deprecateAliases = true;
12
12
  static readonly aliases: string[];
13
13
  static readonly flags: {
14
- loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ loglevel: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
15
  };
16
16
  run(): Promise<AuthListResults>;
17
17
  }
@@ -1,20 +1,28 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2020, salesforce.com, inc.
4
3
  * All rights reserved.
5
4
  * Licensed under the BSD 3-Clause license.
6
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
6
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
10
- const core_1 = require("@salesforce/core");
11
- core_1.Messages.importMessagesDirectory(__dirname);
12
- const messages = core_1.Messages.loadMessages('@salesforce/plugin-auth', 'list');
13
- class ListAuth extends sf_plugins_core_1.SfCommand {
7
+ import { dirname } from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+ import { loglevel, SfCommand } from '@salesforce/sf-plugins-core';
10
+ import { AuthInfo, Messages } from '@salesforce/core';
11
+ Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12
+ const messages = Messages.loadMessages('@salesforce/plugin-auth', 'list');
13
+ export default class ListAuth extends SfCommand {
14
+ static summary = messages.getMessage('summary');
15
+ static description = messages.getMessage('description');
16
+ static examples = messages.getMessages('examples');
17
+ static deprecateAliases = true;
18
+ static aliases = ['force:auth:list', 'auth:list'];
19
+ static flags = {
20
+ loglevel,
21
+ };
14
22
  async run() {
15
23
  await this.parse(ListAuth);
16
24
  try {
17
- const auths = await core_1.AuthInfo.listAllAuthorizations();
25
+ const auths = await AuthInfo.listAllAuthorizations();
18
26
  if (auths.length === 0) {
19
27
  this.log(messages.getMessage('noResultsFound'));
20
28
  return [];
@@ -45,13 +53,4 @@ class ListAuth extends sf_plugins_core_1.SfCommand {
45
53
  }
46
54
  }
47
55
  }
48
- ListAuth.summary = messages.getMessage('summary');
49
- ListAuth.description = messages.getMessage('description');
50
- ListAuth.examples = messages.getMessages('examples');
51
- ListAuth.deprecateAliases = true;
52
- ListAuth.aliases = ['force:auth:list', 'auth:list'];
53
- ListAuth.flags = {
54
- loglevel: sf_plugins_core_1.loglevel,
55
- };
56
- exports.default = ListAuth;
57
56
  //# sourceMappingURL=auth.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/commands/org/list/auth.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iEAAkE;AAClE,2CAAwE;AAGxE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;AAE1E,MAAqB,QAAS,SAAQ,2BAA0B;IAWvD,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI;YACF,MAAM,KAAK,GAAG,MAAM,eAAQ,CAAC,qBAAqB,EAAE,CAAC;YACrD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;gBAChD,OAAO,EAAE,CAAC;aACX;YACD,MAAM,WAAW,GAAoB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAsB,EAAE,EAAE;gBACxE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;gBAClC,oEAAoE;gBACpE,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,C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QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;YAChD,OAAO,EAAE,CAAC;SACX;IACH,CAAC"}
@@ -1,7 +1,7 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import { AuthFields } from '@salesforce/core';
3
3
  import { Interfaces } from '@oclif/core';
4
- import { AuthBaseCommand } from '../../../authBaseCommand';
4
+ import { AuthBaseCommand } from '../../../authBaseCommand.js';
5
5
  export default class LoginAccessToken extends AuthBaseCommand<AuthFields> {
6
6
  static readonly summary: string;
7
7
  static readonly description: string;
@@ -9,12 +9,12 @@ export default class LoginAccessToken extends AuthBaseCommand<AuthFields> {
9
9
  static readonly deprecateAliases = true;
10
10
  static aliases: string[];
11
11
  static readonly flags: {
12
- 'instance-url': Interfaces.OptionFlag<import("url").URL, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
+ 'instance-url': Interfaces.OptionFlag<import("url").URL, Interfaces.CustomOptions>;
13
13
  'set-default-dev-hub': Interfaces.BooleanFlag<boolean>;
14
14
  'set-default': Interfaces.BooleanFlag<boolean>;
15
- alias: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ alias: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
16
16
  'no-prompt': Interfaces.BooleanFlag<boolean>;
17
- loglevel: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
17
+ loglevel: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
18
18
  };
19
19
  private flags;
20
20
  run(): Promise<AuthFields>;