diff --git a/docs/docs/about/release-notes.mdx b/docs/docs/about/release-notes.mdx index 914f7bc4e52..1ce210d0569 100644 --- a/docs/docs/about/release-notes.mdx +++ b/docs/docs/about/release-notes.mdx @@ -3259,7 +3259,7 @@ sidebar_position: 4 **SharePoint Online:** - [spo apppage add](../cmd/spo/apppage/apppage-add.mdx) - creates a single-part app page [#874](https://github.com/pnp/cli-microsoft365/issues/874) -- [spo homesite remove](../cmd/spo/homesite/homesite-remove.mdx) - removes the current Home Site [#1002](https://github.com/pnp/cli-microsoft365/issues/1002) +- [spo homesite remove](../cmd/spo/tenant/tenant-homesite-remove.mdx) - removes the current Home Site [#1002](https://github.com/pnp/cli-microsoft365/issues/1002) - [spo orgassetslibrary list](../cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx) - lists all libraries that are assigned as org asset library [#1041](https://github.com/pnp/cli-microsoft365/issues/1041) - [spo get](../cmd/spo/spo-get.mdx) - gets the context URL for the root SharePoint site collection and SharePoint tenant admin site [#1071](https://github.com/pnp/cli-microsoft365/issues/1071) - [spo set](../cmd/spo/spo-set.mdx) - sets the URL of the root SharePoint site collection for use in SPO commands [#1070](https://github.com/pnp/cli-microsoft365/issues/1070) @@ -3305,8 +3305,8 @@ sidebar_position: 4 **SharePoint Online:** -- [spo homesite get](../cmd/spo/homesite/homesite-get.mdx) - gets information about the Home Site [#1000](https://github.com/pnp/cli-microsoft365/issues/1000) -- [spo homesite set](../cmd/spo/homesite/homesite-set.mdx) - sets the specified site as the Home Site [#1001](https://github.com/pnp/cli-microsoft365/issues/1001) +- [spo homesite get](../cmd/spo/tenant/tenant-homesite-get.mdx) - gets information about the Home Site [#1000](https://github.com/pnp/cli-microsoft365/issues/1000) +- [spo homesite set](../cmd/spo/tenant/tenant-homesite-set.mdx) - sets the specified site as the Home Site [#1001](https://github.com/pnp/cli-microsoft365/issues/1001) - [spo listitem isrecord](../cmd/spo/listitem/listitem-isrecord.mdx) - checks if the specified list item is a record [#771](https://github.com/pnp/cli-microsoft365/issues/771) **Microsoft Graph:** diff --git a/docs/docs/cmd/spo/homesite/homesite-get.mdx b/docs/docs/cmd/spo/tenant/tenant-homesite-get.mdx similarity index 93% rename from docs/docs/cmd/spo/homesite/homesite-get.mdx rename to docs/docs/cmd/spo/tenant/tenant-homesite-get.mdx index 07aa272912c..97f47521c4d 100644 --- a/docs/docs/cmd/spo/homesite/homesite-get.mdx +++ b/docs/docs/cmd/spo/tenant/tenant-homesite-get.mdx @@ -2,12 +2,18 @@ import Global from '/docs/cmd/_global.mdx'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# spo homesite get +# spo tenant homesite get Gets information about the Home Site ## Usage +```sh +m365 spo tenant homesite get [options] +``` + +## Alias + ```sh m365 spo homesite get [options] ``` @@ -21,7 +27,7 @@ m365 spo homesite get [options] Get information about the Home Site. ```sh -m365 spo homesite get +m365 spo tenant homesite get ``` ## Response @@ -62,7 +68,7 @@ m365 spo homesite get ```md - # spo homesite get + # spo tenant homesite get Date: 2/20/2023 diff --git a/docs/docs/cmd/spo/homesite/homesite-remove.mdx b/docs/docs/cmd/spo/tenant/tenant-homesite-remove.mdx similarity index 93% rename from docs/docs/cmd/spo/homesite/homesite-remove.mdx rename to docs/docs/cmd/spo/tenant/tenant-homesite-remove.mdx index 083c45a96dd..f7db8e5cc52 100644 --- a/docs/docs/cmd/spo/homesite/homesite-remove.mdx +++ b/docs/docs/cmd/spo/tenant/tenant-homesite-remove.mdx @@ -2,12 +2,18 @@ import Global from '/docs/cmd/_global.mdx'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# spo homesite remove +# spo tenant homesite remove Removes the current Home Site ## Usage +```sh +m365 spo tenant homesite remove [options] +``` + +## Alias + ```sh m365 spo homesite remove [options] ``` @@ -34,7 +40,7 @@ To use this command you must be either **SharePoint Administrator** or **Global Removes the current Home Site without confirmation. ```sh -m365 spo homesite remove --force +m365 spo tenant homesite remove --force ``` ## Response diff --git a/docs/docs/cmd/spo/homesite/homesite-set.mdx b/docs/docs/cmd/spo/tenant/tenant-homesite-set.mdx similarity index 89% rename from docs/docs/cmd/spo/homesite/homesite-set.mdx rename to docs/docs/cmd/spo/tenant/tenant-homesite-set.mdx index 50f721f6be9..1cc0c264979 100644 --- a/docs/docs/cmd/spo/homesite/homesite-set.mdx +++ b/docs/docs/cmd/spo/tenant/tenant-homesite-set.mdx @@ -2,12 +2,18 @@ import Global from '/docs/cmd/_global.mdx'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# spo homesite set +# spo tenant homesite set Sets the specified site as the Home Site ## Usage +```sh +m365 spo tenant homesite set [options] +``` + +## Alias + ```sh m365 spo homesite set [options] ``` @@ -37,19 +43,19 @@ To use this command you must be a Global or SharePoint administrator. Set the specified site as the Home Site. ```sh -m365 spo homesite set --siteUrl https://contoso.sharepoint.com/sites/comms +m365 spo tenant homesite set --siteUrl https://contoso.sharepoint.com/sites/comms ``` Sets the Home site to the provided site collection url and sets the Viva Connections landing experience to the SharePoint home site ```sh -m365 spo homesite set --siteUrl https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart true +m365 spo tenant homesite set --siteUrl https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart true ``` Sets the Home site to the provided site collection url and sets the Viva Connections landing experience to the default experience ```sh -m365 spo homesite set --siteUrl https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart false +m365 spo tenant homesite set --siteUrl https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart false ``` ## Response diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 20ad17932b7..9ebba3874b9 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -53,6 +53,9 @@ const config: Config = { if (routePath.includes('/entra')) { return [routePath.replace('/entra', '/aad')]; } + if (routePath.includes('/spo/tenant/tenant-homesite-')) { + return [routePath.replace('/spo/tenant/tenant-homesite-', '/spo/homesite/homesite-')]; + } return []; } diff --git a/docs/src/config/sidebars.ts b/docs/src/config/sidebars.ts index 68fa5ec4249..925ac9be5ba 100644 --- a/docs/src/config/sidebars.ts +++ b/docs/src/config/sidebars.ts @@ -2732,25 +2732,6 @@ const sidebars: SidebarsConfig = { } ] }, - { - homesite: [ - { - type: 'doc', - label: 'homesite get', - id: 'cmd/spo/homesite/homesite-get' - }, - { - type: 'doc', - label: 'homesite remove', - id: 'cmd/spo/homesite/homesite-remove' - }, - { - type: 'doc', - label: 'homesite set', - id: 'cmd/spo/homesite/homesite-set' - } - ] - }, { hubsite: [ { @@ -3766,11 +3747,26 @@ const sidebars: SidebarsConfig = { label: 'tenant commandset set', id: 'cmd/spo/tenant/tenant-commandset-set' }, + { + type: 'doc', + label: 'tenant homesite get', + id: 'cmd/spo/tenant/tenant-homesite-get' + }, { type: 'doc', label: 'tenant homesite list', id: 'cmd/spo/tenant/tenant-homesite-list' }, + { + type: 'doc', + label: 'tenant homesite remove', + id: 'cmd/spo/tenant/tenant-homesite-remove' + }, + { + type: 'doc', + label: 'tenant homesite set', + id: 'cmd/spo/tenant/tenant-homesite-set' + }, { type: 'doc', label: 'tenant recyclebinitem list', diff --git a/src/m365/spo/commands.ts b/src/m365/spo/commands.ts index f17b2edca20..e307c4cb4f5 100644 --- a/src/m365/spo/commands.ts +++ b/src/m365/spo/commands.ts @@ -117,9 +117,6 @@ export default { GROUP_MEMBER_REMOVE: `${prefix} group member remove`, HIDEDEFAULTTHEMES_GET: `${prefix} hidedefaultthemes get`, HIDEDEFAULTTHEMES_SET: `${prefix} hidedefaultthemes set`, - HOMESITE_GET: `${prefix} homesite get`, - HOMESITE_REMOVE: `${prefix} homesite remove`, - HOMESITE_SET: `${prefix} homesite set`, HUBSITE_CONNECT: `${prefix} hubsite connect`, HUBSITE_DATA_GET: `${prefix} hubsite data get`, HUBSITE_DISCONNECT: `${prefix} hubsite disconnect`, @@ -318,7 +315,10 @@ export default { TENANT_COMMANDSET_LIST: `${prefix} tenant commandset list`, TENANT_COMMANDSET_REMOVE: `${prefix} tenant commandset remove`, TENANT_COMMANDSET_SET: `${prefix} tenant commandset set`, + TENANT_HOMESITE_GET: `${prefix} tenant homesite get`, TENANT_HOMESITE_LIST: `${prefix} tenant homesite list`, + TENANT_HOMESITE_REMOVE: `${prefix} tenant homesite remove`, + TENANT_HOMESITE_SET: `${prefix} tenant homesite set`, TENANT_RECYCLEBINITEM_LIST: `${prefix} tenant recyclebinitem list`, TENANT_RECYCLEBINITEM_REMOVE: `${prefix} tenant recyclebinitem remove`, TENANT_RECYCLEBINITEM_RESTORE: `${prefix} tenant recyclebinitem restore`, diff --git a/src/m365/spo/commands/homesite/homesite-get.spec.ts b/src/m365/spo/commands/tenant/tenant-homesite-get.spec.ts similarity index 92% rename from src/m365/spo/commands/homesite/homesite-get.spec.ts rename to src/m365/spo/commands/tenant/tenant-homesite-get.spec.ts index 73c2dc042ba..8b30a49aa0f 100644 --- a/src/m365/spo/commands/homesite/homesite-get.spec.ts +++ b/src/m365/spo/commands/tenant/tenant-homesite-get.spec.ts @@ -9,9 +9,9 @@ import { pid } from '../../../../utils/pid.js'; import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; -import command from './homesite-get.js'; +import command from './tenant-homesite-get.js'; -describe(commands.HOMESITE_GET, () => { +describe(commands.TENANT_HOMESITE_GET, () => { let log: any[]; let logger: Logger; let loggerLogSpy: sinon.SinonSpy; @@ -54,13 +54,17 @@ describe(commands.HOMESITE_GET, () => { }); it('has correct name', () => { - assert.strictEqual(command.name, commands.HOMESITE_GET); + assert.strictEqual(command.name, commands.TENANT_HOMESITE_GET); }); it('has a description', () => { assert.notStrictEqual(command.description, null); }); + it('defines correct alias', () => { + assert.deepStrictEqual(command.alias(), ['spo homesite get']); + }); + it('gets information about the Home Site', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === 'https://contoso.sharepoint.com/_api/SP.SPHSite/Details') { diff --git a/src/m365/spo/commands/homesite/homesite-get.ts b/src/m365/spo/commands/tenant/tenant-homesite-get.ts similarity index 76% rename from src/m365/spo/commands/homesite/homesite-get.ts rename to src/m365/spo/commands/tenant/tenant-homesite-get.ts index 9fe92123664..7a14a9261d0 100644 --- a/src/m365/spo/commands/homesite/homesite-get.ts +++ b/src/m365/spo/commands/tenant/tenant-homesite-get.ts @@ -4,16 +4,21 @@ import { spo } from '../../../../utils/spo.js'; import SpoCommand from '../../../base/SpoCommand.js'; import commands from '../../commands.js'; -class SpoHomeSiteGetCommand extends SpoCommand { +class SpoTenantHomeSiteGetCommand extends SpoCommand { public get name(): string { - return commands.HOMESITE_GET; + return commands.TENANT_HOMESITE_GET; } public get description(): string { return 'Gets information about the Home Site'; } + public alias(): string[] { + return ['spo homesite get']; + } + public async commandAction(logger: Logger): Promise { + await this.showDeprecationWarning(logger, this.alias()[0], this.getCommandName()); try { const spoUrl = await spo.getSpoUrl(logger, this.debug); const requestOptions: CliRequestOptions = { @@ -35,4 +40,4 @@ class SpoHomeSiteGetCommand extends SpoCommand { } } -export default new SpoHomeSiteGetCommand(); \ No newline at end of file +export default new SpoTenantHomeSiteGetCommand(); \ No newline at end of file diff --git a/src/m365/spo/commands/homesite/homesite-remove.spec.ts b/src/m365/spo/commands/tenant/tenant-homesite-remove.spec.ts similarity index 96% rename from src/m365/spo/commands/homesite/homesite-remove.spec.ts rename to src/m365/spo/commands/tenant/tenant-homesite-remove.spec.ts index 3dee71c684b..a77d91861fd 100644 --- a/src/m365/spo/commands/homesite/homesite-remove.spec.ts +++ b/src/m365/spo/commands/tenant/tenant-homesite-remove.spec.ts @@ -12,9 +12,9 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import { spo } from '../../../../utils/spo.js'; import commands from '../../commands.js'; -import command from './homesite-remove.js'; +import command from './tenant-homesite-remove.js'; -describe(commands.HOMESITE_REMOVE, () => { +describe(commands.TENANT_HOMESITE_REMOVE, () => { let log: any[]; let logger: Logger; let promptIssued: boolean = false; @@ -69,13 +69,17 @@ describe(commands.HOMESITE_REMOVE, () => { }); it('has correct name', () => { - assert.strictEqual(command.name, commands.HOMESITE_REMOVE); + assert.strictEqual(command.name, commands.TENANT_HOMESITE_REMOVE); }); it('has a description', () => { assert.notStrictEqual(command.description, null); }); + it('defines correct alias', () => { + assert.deepStrictEqual(command.alias(), ['spo homesite remove']); + }); + it('prompts before removing the Home Site when force option is not passed', async () => { await command.action(logger, { options: { debug: true } } as any); diff --git a/src/m365/spo/commands/homesite/homesite-remove.ts b/src/m365/spo/commands/tenant/tenant-homesite-remove.ts similarity index 88% rename from src/m365/spo/commands/homesite/homesite-remove.ts rename to src/m365/spo/commands/tenant/tenant-homesite-remove.ts index 7f2108a12a0..4f8e9a67f08 100644 --- a/src/m365/spo/commands/homesite/homesite-remove.ts +++ b/src/m365/spo/commands/tenant/tenant-homesite-remove.ts @@ -15,15 +15,19 @@ interface Options extends GlobalOptions { force?: boolean; } -class SpoHomeSiteRemoveCommand extends SpoCommand { +class SpoTenantHomeSiteRemoveCommand extends SpoCommand { public get name(): string { - return commands.HOMESITE_REMOVE; + return commands.TENANT_HOMESITE_REMOVE; } public get description(): string { return 'Removes the current Home Site'; } + public alias(): string[] { + return ['spo homesite remove']; + } + constructor() { super(); @@ -34,7 +38,7 @@ class SpoHomeSiteRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - force: args.options.force || false + force: !!args.options.force }); }); } @@ -48,6 +52,7 @@ class SpoHomeSiteRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { + await this.showDeprecationWarning(logger, this.alias()[0], this.getCommandName()); const removeHomeSite: () => Promise = async (): Promise => { try { @@ -92,4 +97,4 @@ class SpoHomeSiteRemoveCommand extends SpoCommand { } } -export default new SpoHomeSiteRemoveCommand(); \ No newline at end of file +export default new SpoTenantHomeSiteRemoveCommand(); \ No newline at end of file diff --git a/src/m365/spo/commands/homesite/homesite-set.spec.ts b/src/m365/spo/commands/tenant/tenant-homesite-set.spec.ts similarity index 94% rename from src/m365/spo/commands/homesite/homesite-set.spec.ts rename to src/m365/spo/commands/tenant/tenant-homesite-set.spec.ts index 8c5224b3a59..c3fe6c818cf 100644 --- a/src/m365/spo/commands/homesite/homesite-set.spec.ts +++ b/src/m365/spo/commands/tenant/tenant-homesite-set.spec.ts @@ -11,9 +11,9 @@ import { pid } from '../../../../utils/pid.js'; import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; -import command from './homesite-set.js'; +import command from './tenant-homesite-set.js'; -describe(commands.HOMESITE_SET, () => { +describe(commands.TENANT_HOMESITE_SET, () => { let log: any[]; let logger: Logger; let commandInfo: CommandInfo; @@ -79,13 +79,17 @@ describe(commands.HOMESITE_SET, () => { }); it('has correct name', () => { - assert.strictEqual(command.name, commands.HOMESITE_SET); + assert.strictEqual(command.name, commands.TENANT_HOMESITE_SET); }); it('has a description', () => { assert.notStrictEqual(command.description, null); }); + it('defines correct alias', () => { + assert.deepStrictEqual(command.alias(), ['spo homesite set']); + }); + it('sets the specified site as the Home Site', async () => { const requestBody = { sphSiteUrl: siteUrl }; const postRequestStub = sinon.stub(request, 'post').callsFake(async (opts) => { diff --git a/src/m365/spo/commands/homesite/homesite-set.ts b/src/m365/spo/commands/tenant/tenant-homesite-set.ts similarity index 90% rename from src/m365/spo/commands/homesite/homesite-set.ts rename to src/m365/spo/commands/tenant/tenant-homesite-set.ts index 384a4560fb2..6c8992c2005 100644 --- a/src/m365/spo/commands/homesite/homesite-set.ts +++ b/src/m365/spo/commands/tenant/tenant-homesite-set.ts @@ -15,15 +15,19 @@ interface Options extends GlobalOptions { vivaConnectionsDefaultStart?: boolean; } -class SpoHomeSiteSetCommand extends SpoCommand { +class SpoTenantHomeSiteSetCommand extends SpoCommand { public get name(): string { - return commands.HOMESITE_SET; + return commands.TENANT_HOMESITE_SET; } public get description(): string { return 'Sets the specified site as the Home Site'; } + public alias(): string[] { + return ['spo homesite set']; + } + constructor() { super(); this.#initTelemetry(); @@ -63,6 +67,7 @@ class SpoHomeSiteSetCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { + await this.showDeprecationWarning(logger, this.alias()[0], this.getCommandName()); try { if (this.verbose) { await logger.logToStderr(`Setting the SharePoint home site to: ${args.options.siteUrl}...`); @@ -99,4 +104,4 @@ class SpoHomeSiteSetCommand extends SpoCommand { } } -export default new SpoHomeSiteSetCommand(); \ No newline at end of file +export default new SpoTenantHomeSiteSetCommand(); \ No newline at end of file