diff --git a/docs/manual/docs/cmd/cli/cli-consent.md b/docs/manual/docs/cmd/cli/cli-consent.md index b20cd8cece0..d37409fa825 100644 --- a/docs/manual/docs/cmd/cli/cli-consent.md +++ b/docs/manual/docs/cmd/cli/cli-consent.md @@ -8,12 +8,6 @@ Consent additional permissions for the Azure AD application used by the Office 3 cli consent [options] ``` -## Alias - -```sh -consent [options] -``` - ## Options Option|Description diff --git a/docs/manual/docs/cmd/spo/site/site-remove.md b/docs/manual/docs/cmd/spo/site/site-remove.md index 86b440c5327..a31b5e789be 100644 --- a/docs/manual/docs/cmd/spo/site/site-remove.md +++ b/docs/manual/docs/cmd/spo/site/site-remove.md @@ -8,12 +8,6 @@ Removes the specified site spo site remove [options] ``` -## Alias - -```sh -spo site classic remove -``` - ## Options Option|Description diff --git a/docs/manual/docs/user-guide/connecting-office-365.md b/docs/manual/docs/user-guide/connecting-office-365.md index 1ed543b8f3b..c80e7de320a 100644 --- a/docs/manual/docs/user-guide/connecting-office-365.md +++ b/docs/manual/docs/user-guide/connecting-office-365.md @@ -130,7 +130,7 @@ Office 365 CLI uses the _PnP Office 365 Management Shell_ Azure AD application t To re-consent the _PnP Office 365 Management Shell_ application in your Azure AD, in the command line execute: ```sh -o365 --reconsent +o365 cli reconsent ``` Office 365 CLI will provide you with a URL that you should open in the web browser and sign in with your organizational account. After authenticating, Azure AD will prompt you to approve the new set of permissions. Once you approved the permissions, you will be redirected to an empty page. You can now use all commands in the Office 365 CLI. diff --git a/src/index.ts b/src/index.ts index b2075b28613..cdaec271c6c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,11 +3,9 @@ import * as fs from 'fs'; import * as path from 'path'; import * as updateNotifier from 'update-notifier'; -import config from './config'; import Command from './Command'; import appInsights from './appInsights'; import Utils from './Utils'; -import { autocomplete } from './autocomplete'; const packageJSON = require('../package.json'); const vorpal: Vorpal = require('./vorpal-init'); @@ -102,27 +100,6 @@ appInsights.trackEvent({ updateNotifier({ pkg: packageJSON }).notify({ defer: false }); fs.realpath(__dirname, (err: NodeJS.ErrnoException | null, resolvedPath: string): void => { - if (process.argv.indexOf('--completion:clink:generate') > -1) { - loadAllCommands(resolvedPath); - console.log(autocomplete.getClinkCompletion(vorpal)); - process.exit(); - } - if (process.argv.indexOf('--completion:sh:generate') > -1) { - loadAllCommands(resolvedPath); - autocomplete.generateShCompletion(vorpal); - process.exit(); - } - if (process.argv.indexOf('--completion:sh:setup') > -1) { - loadAllCommands(resolvedPath); - autocomplete.generateShCompletion(vorpal); - autocomplete.setupShCompletion(); - process.exit(); - } - if (process.argv.indexOf('--reconsent') > -1) { - console.log(`To reconsent the PnP Office 365 Management Shell Azure AD application navigate in your web browser to https://login.microsoftonline.com/${config.tenant}/oauth2/authorize?client_id=${config.cliAadAppId}&response_type=code&prompt=admin_consent`); - process.exit(); - } - // disable linux-normalizing args to support JSON and XML values vorpal.isCommandArgKeyPairNormalized = false; diff --git a/src/o365/cli/commands/cli-consent.spec.ts b/src/o365/cli/commands/cli-consent.spec.ts index 41705d9bbc7..ea9000c5bf4 100644 --- a/src/o365/cli/commands/cli-consent.spec.ts +++ b/src/o365/cli/commands/cli-consent.spec.ts @@ -1,5 +1,4 @@ import commands from '../commands'; -import globalCommands from '../../commands/commands'; import Command, { CommandOption, CommandValidate } from '../../../Command'; import * as sinon from 'sinon'; import appInsights from '../../../appInsights'; @@ -57,16 +56,6 @@ describe(commands.CONSENT, () => { assert.notEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.equal((alias && alias.indexOf(globalCommands.CONSENT) > -1), true); - }); - it('shows consent URL for yammer permissions for the default multi-tenant app', (done) => { cmdInstance.action = command.action(); cmdInstance.action({ options: { service: 'yammer' } }, () => { diff --git a/src/o365/cli/commands/cli-consent.ts b/src/o365/cli/commands/cli-consent.ts index d2ae65f471f..29148d5631b 100644 --- a/src/o365/cli/commands/cli-consent.ts +++ b/src/o365/cli/commands/cli-consent.ts @@ -1,5 +1,4 @@ import commands from '../commands'; -import globalCommands from '../../commands/commands'; import GlobalOptions from '../../../GlobalOptions'; import Command, { CommandOption, @@ -27,10 +26,6 @@ class CliConsentCommand extends Command { return 'Consent additional permissions for the Azure AD application used by the Office 365 CLI'; } - public alias(): string[] | undefined { - return [globalCommands.CONSENT]; - } - public getTelemetryProperties(args: CommandArgs): any { const telemetryProps: any = super.getTelemetryProperties(args); telemetryProps.service = args.options.service; @@ -38,8 +33,6 @@ class CliConsentCommand extends Command { } public commandAction(cmd: CommandInstance, args: CommandArgs, cb: (err?: any) => void): void { - this.showDeprecationWarning(cmd, globalCommands.CONSENT, commands.CONSENT); - let scope = ''; switch (args.options.service) { case 'yammer': diff --git a/src/o365/commands/commands.ts b/src/o365/commands/commands.ts index cd0ade10bef..41ad5d0d62c 100644 --- a/src/o365/commands/commands.ts +++ b/src/o365/commands/commands.ts @@ -1,5 +1,4 @@ export default { - CONSENT: `consent`, LOGIN: `login`, LOGOUT: `logout`, STATUS: `status` diff --git a/src/o365/spo/commands.ts b/src/o365/spo/commands.ts index f23fdeebe6e..1ed3dac10db 100644 --- a/src/o365/spo/commands.ts +++ b/src/o365/spo/commands.ts @@ -155,7 +155,6 @@ export default { SITE_APPCATALOG_REMOVE: `${prefix} site appcatalog remove`, SITE_CLASSIC_ADD: `${prefix} site classic add`, SITE_CLASSIC_LIST: `${prefix} site classic list`, - SITE_CLASSIC_REMOVE: `${prefix} site classic remove`, SITE_CLASSIC_SET: `${prefix} site classic set`, SITE_COMMSITE_ENABLE: `${prefix} site commsite enable`, SITE_GET: `${prefix} site get`, diff --git a/src/o365/spo/commands/site/site-remove.spec.ts b/src/o365/spo/commands/site/site-remove.spec.ts index 6b69915778b..396649717d6 100644 --- a/src/o365/spo/commands/site/site-remove.spec.ts +++ b/src/o365/spo/commands/site/site-remove.spec.ts @@ -79,11 +79,6 @@ describe(commands.SITE_REMOVE, () => { assert.notEqual(command.description, null); }); - it('defines correct alias', () => { - const alias = command.alias(); - assert.equal((alias && alias.indexOf(commands.SITE_CLASSIC_REMOVE) > -1), true); - }); - it('aborts removing site when prompt not confirmed', (done) => { cmdInstance.prompt = (options: any, cb: (result: { continue: boolean }) => void) => { cb({ continue: false }); diff --git a/src/o365/spo/commands/site/site-remove.ts b/src/o365/spo/commands/site/site-remove.ts index bd4ca605dfc..cd9c38c3775 100644 --- a/src/o365/spo/commands/site/site-remove.ts +++ b/src/o365/spo/commands/site/site-remove.ts @@ -36,10 +36,6 @@ class SpoSiteRemoveCommand extends SpoCommand { return 'Removes the specified site'; } - public alias(): string[] | undefined { - return [commands.SITE_CLASSIC_REMOVE]; - } - public getTelemetryProperties(args: CommandArgs): any { const telemetryProps: any = super.getTelemetryProperties(args); telemetryProps.skipRecycleBin = (!(!args.options.skipRecycleBin)).toString(); @@ -50,8 +46,6 @@ class SpoSiteRemoveCommand extends SpoCommand { } public commandAction(cmd: CommandInstance, args: CommandArgs, cb: () => void): void { - this.showDeprecationWarning(cmd, commands.SITE_CLASSIC_REMOVE, commands.SITE_REMOVE); - const removeSite = (): void => { this.dots = '';