diff --git a/packages/salesforcedx-vscode-core/package.json b/packages/salesforcedx-vscode-core/package.json index 49034d42b9..372b2785dd 100644 --- a/packages/salesforcedx-vscode-core/package.json +++ b/packages/salesforcedx-vscode-core/package.json @@ -353,11 +353,11 @@ "when": "sfdx:project_opened" }, { - "command": "sfdx.force.auth.logout.all", + "command": "sfdx.org.logout.all", "when": "sfdx:project_opened" }, { - "command": "sfdx.force.auth.logout.default", + "command": "sfdx.org.logout.default", "when": "sfdx:project_opened && sfdx:has_default_username" }, { @@ -640,12 +640,12 @@ "title": "%force_auth_access_token_authorize_org_text%" }, { - "command": "sfdx.force.auth.logout.all", - "title": "%force_auth_logout_all_text%" + "command": "sfdx.org.logout.all", + "title": "%org_logout_all_text%" }, { - "command": "sfdx.force.auth.logout.default", - "title": "%force_auth_logout_default_text%" + "command": "sfdx.org.logout.default", + "title": "%org_logout_default_text%" }, { "command": "sfdx.force.open.documentation", diff --git a/packages/salesforcedx-vscode-core/package.nls.ja.json b/packages/salesforcedx-vscode-core/package.nls.ja.json index 0f4bb39d06..48fd200723 100644 --- a/packages/salesforcedx-vscode-core/package.nls.ja.json +++ b/packages/salesforcedx-vscode-core/package.nls.ja.json @@ -3,8 +3,8 @@ "org_login_web_authorize_dev_hub_text": "SFDX: Dev Hub を認証", "org_login_web_authorize_org_text": "SFDX: 組織を認証", "force_auth_access_token_authorize_org_text": "SFDX: Authorize an Org using Session ID", - "force_auth_logout_all_text": "SFDX: すべての認証済み組織からログアウト", - "force_auth_logout_default_text": "SFDX: Log Out from Default Org", + "org_logout_all_text": "SFDX: すべての認証済み組織からログアウト", + "org_logout_default_text": "SFDX: Log Out from Default Org", "force_org_create_default_scratch_org_text": "SFDX: デフォルトのスクラッチ組織を作成...", "org_open_default_scratch_org_text": "SFDX: デフォルトの組織を開く", "force_source_pull_default_org_text": "SFDX: デフォルトのスクラッチ組織からソースをプル", diff --git a/packages/salesforcedx-vscode-core/package.nls.json b/packages/salesforcedx-vscode-core/package.nls.json index 32d674fe91..86403484ec 100644 --- a/packages/salesforcedx-vscode-core/package.nls.json +++ b/packages/salesforcedx-vscode-core/package.nls.json @@ -3,8 +3,8 @@ "org_login_web_authorize_dev_hub_text": "SFDX: Authorize a Dev Hub", "org_login_web_authorize_org_text": "SFDX: Authorize an Org", "force_auth_access_token_authorize_org_text": "SFDX: Authorize an Org using Session ID", - "force_auth_logout_all_text": "SFDX: Log Out from All Authorized Orgs", - "force_auth_logout_default_text": "SFDX: Log Out from Default Org", + "org_logout_all_text": "SFDX: Log Out from All Authorized Orgs", + "org_logout_default_text": "SFDX: Log Out from Default Org", "force_open_documentation_text": "SFDX: Open Documentation", "force_org_create_default_scratch_org_text": "SFDX: Create a Default Scratch Org...", "org_open_default_scratch_org_text": "SFDX: Open Default Org", diff --git a/packages/salesforcedx-vscode-core/src/commands/auth/authParamsGatherer.ts b/packages/salesforcedx-vscode-core/src/commands/auth/authParamsGatherer.ts index 9d17ead01a..ccfe28e60f 100644 --- a/packages/salesforcedx-vscode-core/src/commands/auth/authParamsGatherer.ts +++ b/packages/salesforcedx-vscode-core/src/commands/auth/authParamsGatherer.ts @@ -202,10 +202,10 @@ export class ScratchOrgLogoutParamsGatherer public async gather(): Promise> { const prompt = nls.localize( - 'auth_logout_scratch_prompt', + 'org_logout_scratch_prompt', this.alias || this.username ); - const logoutResponse = nls.localize('auth_logout_scratch_logout'); + const logoutResponse = nls.localize('org_logout_scratch_logout'); const confirm = await vscode.window.showInformationMessage( prompt, diff --git a/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWeb.ts b/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWeb.ts index 5383136bb5..28220e2304 100644 --- a/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWeb.ts +++ b/packages/salesforcedx-vscode-core/src/commands/auth/orgLoginWeb.ts @@ -37,7 +37,7 @@ import { SfdxWorkspaceChecker } from '../util'; import { AuthParams, AuthParamsGatherer } from './authParamsGatherer'; -import { ForceAuthLogoutAll } from './forceAuthLogout'; +import { OrgLogoutAll } from './orgLogout'; export interface DeviceCodeResponse { user_code: string; @@ -228,7 +228,7 @@ export async function promptLogOutForProdOrg() { await new SfdxCommandlet( new SfdxWorkspaceChecker(), new DemoModePromptGatherer(), - ForceAuthLogoutAll.withoutShowingChannel() + OrgLogoutAll.withoutShowingChannel() ).run(); } diff --git a/packages/salesforcedx-vscode-core/src/commands/auth/forceAuthLogout.ts b/packages/salesforcedx-vscode-core/src/commands/auth/orgLogout.ts similarity index 84% rename from packages/salesforcedx-vscode-core/src/commands/auth/forceAuthLogout.ts rename to packages/salesforcedx-vscode-core/src/commands/auth/orgLogout.ts index 19ae04a71e..ba001cf45f 100644 --- a/packages/salesforcedx-vscode-core/src/commands/auth/forceAuthLogout.ts +++ b/packages/salesforcedx-vscode-core/src/commands/auth/orgLogout.ts @@ -28,19 +28,19 @@ import { } from '../util'; import { ScratchOrgLogoutParamsGatherer } from './authParamsGatherer'; -export class ForceAuthLogoutAll extends SfdxCommandletExecutor<{}> { - public static withoutShowingChannel(): ForceAuthLogoutAll { - const instance = new ForceAuthLogoutAll(); +export class OrgLogoutAll extends SfdxCommandletExecutor<{}> { + public static withoutShowingChannel(): OrgLogoutAll { + const instance = new OrgLogoutAll(); instance.showChannelOutput = false; return instance; } public build(data: {}): Command { return new SfdxCommandBuilder() - .withDescription(nls.localize('force_auth_logout_all_text')) - .withArg('force:auth:logout') + .withDescription(nls.localize('org_logout_all_text')) + .withArg('org:logout') .withArg('--all') - .withArg('--noprompt') + .withArg('--no-prompt') .withLogName('force_auth_logout') .build(); } @@ -48,21 +48,21 @@ export class ForceAuthLogoutAll extends SfdxCommandletExecutor<{}> { const workspaceChecker = new SfdxWorkspaceChecker(); const parameterGatherer = new EmptyParametersGatherer(); -const executor = new ForceAuthLogoutAll(); +const executor = new OrgLogoutAll(); const commandlet = new SfdxCommandlet( workspaceChecker, parameterGatherer, executor ); -export async function forceAuthLogoutAll() { +export async function orgLogoutAll() { await commandlet.run(); } -export class AuthLogoutDefault extends LibraryCommandletExecutor { +export class OrgLogoutDefault extends LibraryCommandletExecutor { constructor() { super( - nls.localize('force_auth_logout_default_text'), + nls.localize('org_logout_default_text'), 'force_auth_logout_default', OUTPUT_CHANNEL ); @@ -86,7 +86,7 @@ export class AuthLogoutDefault extends LibraryCommandletExecutor { } } -export async function forceAuthLogoutDefault() { +export async function orgLogoutDefault() { const { username, isScratch, alias, error } = await resolveDefaultUsername(); if (error) { telemetryService.sendException(error.name, error.message); @@ -99,12 +99,12 @@ export async function forceAuthLogoutDefault() { isScratch ? new ScratchOrgLogoutParamsGatherer(username, alias) : new SimpleGatherer(username), - new AuthLogoutDefault() + new OrgLogoutDefault() ); await logoutCommandlet.run(); } else { notificationService.showInformationMessage( - nls.localize('auth_logout_no_default_org') + nls.localize('org_logout_no_default_org') ); } } diff --git a/packages/salesforcedx-vscode-core/src/commands/index.ts b/packages/salesforcedx-vscode-core/src/commands/index.ts index 5e6b3bd6ef..4408865ab5 100644 --- a/packages/salesforcedx-vscode-core/src/commands/index.ts +++ b/packages/salesforcedx-vscode-core/src/commands/index.ts @@ -135,11 +135,7 @@ export { turnOffLogging, ForceStopApexDebugLoggingExecutor } from './forceStopApexDebugLogging'; -export { - forceAuthLogoutAll, - ForceAuthLogoutAll, - forceAuthLogoutDefault -} from './auth/forceAuthLogout'; +export { orgLogoutAll, orgLogoutDefault, OrgLogoutAll } from './auth/orgLogout'; import { DeveloperLogTraceFlag } from '../traceflag/developerLogTraceFlag'; export const developerLogTraceFlag = DeveloperLogTraceFlag.getInstance(); export { forceConfigSet, ForceConfigSetExecutor } from './forceConfigSet'; diff --git a/packages/salesforcedx-vscode-core/src/index.ts b/packages/salesforcedx-vscode-core/src/index.ts index 4711939532..7ca2a9df35 100644 --- a/packages/salesforcedx-vscode-core/src/index.ts +++ b/packages/salesforcedx-vscode-core/src/index.ts @@ -21,8 +21,6 @@ import { forceApexClassCreate, forceApexTriggerCreate, forceAuthAccessToken, - forceAuthLogoutAll, - forceAuthLogoutDefault, forceConfigList, forceConfigSet, forceCreateManifest, @@ -71,6 +69,8 @@ import { orgList, orgLoginWeb, orgLoginWebDevHub, + orgLogoutAll, + orgLogoutDefault, orgOpen, registerFunctionInvokeCodeLensProvider, turnOffLogging, @@ -138,13 +138,13 @@ function registerCommands( 'sfdx.org.login.web.dev.hub', orgLoginWebDevHub ); - const forceAuthLogoutAllCmd = vscode.commands.registerCommand( - 'sfdx.force.auth.logout.all', - forceAuthLogoutAll + const orgLogoutAllCmd = vscode.commands.registerCommand( + 'sfdx.org.logout.all', + orgLogoutAll ); - const forceAuthLogoutDefaultCmd = vscode.commands.registerCommand( - 'sfdx.force.auth.logout.default', - forceAuthLogoutDefault + const orgLogoutDefaultCmd = vscode.commands.registerCommand( + 'sfdx.org.logout.default', + orgLogoutDefault ); const forceOpenDocumentationCmd = vscode.commands.registerCommand( 'sfdx.force.open.documentation', @@ -400,8 +400,6 @@ function registerCommands( return vscode.Disposable.from( forceAuthAccessTokenCmd, - forceAuthLogoutAllCmd, - forceAuthLogoutDefaultCmd, forceDataSoqlQueryInputCmd, forceDataSoqlQuerySelectionCmd, forceDiffFile, diff --git a/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts b/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts index 2279554b6d..8df8d65e1d 100644 --- a/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts +++ b/packages/salesforcedx-vscode-core/src/messages/i18n.ja.ts @@ -208,8 +208,8 @@ export const messages = { 'VS Code のSalesforce 拡張機能をデモモードで実行しています。本番環境に接続するときに確認を求められます。', demo_mode_prompt: 'デモモードまたは共有マシンで、ビジネスまたは本番組織を認証することは推奨されません。認証を続ける場合、組織を使用した後、必ず "SFDX: すべての認証済み組織からログアウト" を実行してください。', - force_auth_logout_all_text: 'SFDX: すべての認証済み組織からログアウト', - force_auth_logout_default_text: 'SFDX: Log Out from Default Org', + org_logout_all_text: 'SFDX: すべての認証済み組織からログアウト', + org_logout_default_text: 'SFDX: Log Out from Default Org', manifest_editor_title_message: 'マニフェストエディタ', REST_API: 'REST API', tooling_API: 'Tooling API', @@ -229,10 +229,10 @@ export const messages = { auth_custom_label: 'カスタム', auth_custom_detail: 'カスタムログイン URL を入力', auth_invalid_url: 'URL は http:// か https:// で始める必要があります。', - auth_logout_scratch_prompt: + org_logout_scratch_prompt: 'Log out of this scratch org?\n\nBefore logging out, ensure that you or someone on your team has a username and password for %s scratch org. Otherwise you might lose all access to this scratch org.', - auth_logout_scratch_logout: 'Logout', - auth_logout_no_default_org: 'No default org to logout from', + org_logout_scratch_logout: 'Logout', + org_logout_no_default_org: 'No default org to logout from', error_fetching_auth_info_text: '保存時のプッシュまたはデプロイ実行中にエラー: デフォルトの組織に接続できませんでした。"SFDX: デフォルトのスクラッチ組織を作成" または "SFDX: 組織を認証" を実行して、保存したソースをプッシュまたはデプロイしてください。もしくは、保存時のプッシュまたはデプロイを無効化するため、VS Code のユーザまたはワークスペース設定で "salesforcedx-vscode-core.push-or-deploy-on-save.enabled" を false に設定してください。', error_no_package_directories_found_on_setup_text: diff --git a/packages/salesforcedx-vscode-core/src/messages/i18n.ts b/packages/salesforcedx-vscode-core/src/messages/i18n.ts index df1557dd62..a95357d93c 100644 --- a/packages/salesforcedx-vscode-core/src/messages/i18n.ts +++ b/packages/salesforcedx-vscode-core/src/messages/i18n.ts @@ -241,8 +241,8 @@ export const messages = { 'You are running Salesforce Extensions for VS Code in demo mode. You will be prompted for confirmation when connecting to production orgs.', demo_mode_prompt: 'Authorizing a business or production org is not recommended on a demo or shared machine. If you continue with the authentication, be sure to run "SFDX: Log Out from All Authorized Orgs" when you\'re done using this org.', - force_auth_logout_all_text: 'SFDX: Log Out from All Authorized Orgs', - force_auth_logout_default_text: 'SFDX: Log Out from Default Org', + org_logout_all_text: 'SFDX: Log Out from All Authorized Orgs', + org_logout_default_text: 'SFDX: Log Out from Default Org', manifest_input_dupe_error: 'Manifest with the name %s already exists. Delete this manifest or use another name.', manifest_input_save_placeholder: @@ -267,10 +267,10 @@ export const messages = { auth_custom_label: 'Custom', auth_custom_detail: 'Enter a custom login URL', auth_invalid_url: 'URL must begin with http:// or https://', - auth_logout_scratch_prompt: + org_logout_scratch_prompt: 'Log out of this scratch org?\n\nBefore logging out, ensure that you or someone on your team has a username and password for %s scratch org. Otherwise you might lose all access to this scratch org.', - auth_logout_scratch_logout: 'Logout', - auth_logout_no_default_org: 'No default org to logout from', + org_logout_scratch_logout: 'Logout', + org_logout_no_default_org: 'No default org to logout from', error_fetching_auth_info_text: 'Error running push or deploy on save: We couldn\'t connect to your default org. Run "SFDX: Create a Default Scratch Org" or "SFDX: Authorize an Org", then push or deploy the source that you just saved. Or, to disable push or deploy on save, set "salesforcedx-vscode-core.push-or-deploy-on-save.enabled" to false in your user or workspace settings for VS Code.', error_no_package_directories_found_on_setup_text: diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/auth/forceAuthLogout.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/auth/orgLogout.test.ts similarity index 89% rename from packages/salesforcedx-vscode-core/test/vscode-integration/commands/auth/forceAuthLogout.test.ts rename to packages/salesforcedx-vscode-core/test/vscode-integration/commands/auth/orgLogout.test.ts index dfd146215c..047308a183 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/auth/forceAuthLogout.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/auth/orgLogout.test.ts @@ -10,10 +10,7 @@ import { notificationService } from '@salesforce/salesforcedx-utils-vscode'; import { expect } from 'chai'; import { createSandbox, SinonSandbox, SinonStub } from 'sinon'; import * as vscode from 'vscode'; -import { - ForceAuthLogoutAll, - forceAuthLogoutDefault -} from '../../../../src/commands'; +import { OrgLogoutAll, orgLogoutDefault } from '../../../../src/commands'; import { SfdxCommandlet } from '../../../../src/commands/util'; import { nls } from '../../../../src/messages'; import { telemetryService } from '../../../../src/telemetry'; @@ -21,13 +18,13 @@ import { OrgAuthInfo } from '../../../../src/util'; describe('Force Auth Logout All', () => { it('Should build the auth logout all command', async () => { - const authLogoutAll = new ForceAuthLogoutAll(); + const authLogoutAll = new OrgLogoutAll(); const authLogoutAllCommand = authLogoutAll.build({}); expect(authLogoutAllCommand.toCommand()).to.equal( - 'sfdx force:auth:logout --all --noprompt' + 'sfdx org:logout --all --no-prompt' ); expect(authLogoutAllCommand.description).to.equal( - nls.localize('force_auth_logout_all_text') + nls.localize('org_logout_all_text') ); }); }); @@ -64,7 +61,7 @@ describe('Force Auth Logout Default', () => { scratchOrgStub.resolves(false); notificationStub.resolves(); - await forceAuthLogoutDefault(); + await orgLogoutDefault(); expect( getUsernameStub.called, @@ -86,7 +83,7 @@ describe('Force Auth Logout Default', () => { scratchOrgStub.resolves(false); notificationStub.resolves(); - await forceAuthLogoutDefault(); + await orgLogoutDefault(); expect( getUsernameStub.called, @@ -104,7 +101,7 @@ describe('Force Auth Logout Default', () => { scratchOrgStub.resolves(false); notificationStub.resolves(); - await forceAuthLogoutDefault(); + await orgLogoutDefault(); expect( getUsernameStub.called, @@ -122,7 +119,7 @@ describe('Force Auth Logout Default', () => { scratchOrgStub.resolves(true); notificationStub.resolves(); - await forceAuthLogoutDefault(); + await orgLogoutDefault(); expect( getUsernameStub.called, @@ -146,7 +143,7 @@ describe('Force Auth Logout Default', () => { inputMessageStub.returns(undefined); commandletStub.restore(); - await forceAuthLogoutDefault(); + await orgLogoutDefault(); expect( sendExceptionStub.called, @@ -161,15 +158,15 @@ describe('Force Auth Logout Default', () => { ); const messageArgs = inputMessageStub.getCall(0).args; expect(messageArgs).to.deep.equal([ - nls.localize('auth_logout_scratch_prompt', username), + nls.localize('org_logout_scratch_prompt', username), { modal: true }, - nls.localize('auth_logout_scratch_logout') + nls.localize('org_logout_scratch_logout') ]); }); it('Should allow logout for a scratch org', async () => { let removedUsername; - const logoutResponse = nls.localize('auth_logout_scratch_logout'); + const logoutResponse = nls.localize('org_logout_scratch_logout'); getUsernameStub.resolves(username); scratchOrgStub.resolves(true); @@ -182,7 +179,7 @@ describe('Force Auth Logout Default', () => { } }); - await forceAuthLogoutDefault(); + await orgLogoutDefault(); expect( sendExceptionStub.called, @@ -203,7 +200,7 @@ describe('Force Auth Logout Default', () => { ); const messageArgs = inputMessageStub.getCall(0).args; expect(messageArgs).to.deep.equal([ - nls.localize('auth_logout_scratch_prompt', username), + nls.localize('org_logout_scratch_prompt', username), { modal: true }, logoutResponse ]);