From a9f1485c2bb37cc4164cc6d5baeb4eec1f138603 Mon Sep 17 00:00:00 2001 From: Nanddeep Nachan Date: Fri, 12 Jul 2024 10:01:07 +0000 Subject: [PATCH 1/7] Remove aad options --- docs/docs/cmd/spo/group/group-member-add.mdx | 22 ++-- .../cmd/spo/group/group-member-remove.mdx | 16 +-- docs/docs/cmd/spo/user/user-ensure.mdx | 7 +- .../commands/group/group-member-add.spec.ts | 103 +++++------------- .../spo/commands/group/group-member-add.ts | 35 +----- .../group/group-member-remove.spec.ts | 75 ------------- .../spo/commands/group/group-member-remove.ts | 28 +---- .../spo/commands/user/user-ensure.spec.ts | 27 ----- src/m365/spo/commands/user/user-ensure.ts | 17 +-- 9 files changed, 47 insertions(+), 283 deletions(-) diff --git a/docs/docs/cmd/spo/group/group-member-add.mdx b/docs/docs/cmd/spo/group/group-member-add.mdx index 090310f31f3..8973044ffc7 100644 --- a/docs/docs/cmd/spo/group/group-member-add.mdx +++ b/docs/docs/cmd/spo/group/group-member-add.mdx @@ -25,32 +25,26 @@ m365 spo group member add [options] : Name of the SharePoint Group to which the user needs to be added. Specify either `groupId` or `groupName`. `--userNames [userNames]` -: User's UPN (user principal name, eg. megan.bowen@contoso.com). If multiple users need to be added, they have to be comma-separated (e.g. megan.bowen@contoso.com,alex.wilber@contoso.com). Specify either `userIds`, `userNames`, `emails`, `aadGroupIds` or `aadGroupNames`. +: User's UPN (user principal name, eg. megan.bowen@contoso.com). If multiple users need to be added, they have to be comma-separated (e.g. megan.bowen@contoso.com,alex.wilber@contoso.com). Specify either `userIds`, `userNames`, `emails`, `entraGroupIds` or `entraGroupNames`. `--emails [emails]` -: User's email (eg. megan.bowen@contoso.com). If multiple users need to be added, they have to be comma-separated (e.g. megan.bowen@contoso.com,alex.wilber@contoso.com). Specify either `userIds`, `userNames`, `emails`, `aadGroupIds` or `aadGroupNames`. +: User's email (eg. megan.bowen@contoso.com). If multiple users need to be added, they have to be comma-separated (e.g. megan.bowen@contoso.com,alex.wilber@contoso.com). Specify either `userIds`, `userNames`, `emails`, `entraGroupIds` or `entraGroupNames`. `--userIds [userIds]` -: The user Id of the user to add as a member. (Id of the site user, for example: 14) If multiple users need to be added, the Ids have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `aadGroupIds` or `aadGroupNames`. +: The user Id of the user to add as a member. (Id of the site user, for example: 14). If multiple users need to be added, the Ids have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `entraGroupIds` or `entraGroupNames`. `--entraGroupIds [entraGroupIds]` -: The object Id of the Entra group to add as a member. If multiple groups need to be added, the Ids have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `aadGroupIds`, `entraGroupIds`, `aadGroupNames`, or `entraGroupNames`. - -`--aadGroupIds [aadGroupIds]` -: (deprecated. Use `entraGroupIds` instead) The object ID of the Microsoft Entra group to add as a member. If multiple groups need to be added, the Ids have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `aadGroupIds`, `entraGroupIds`, `aadGroupNames`, or `entraGroupNames`. +: The object Id of the Entra group to add as a member. If multiple groups need to be added, the Ids have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `entraGroupIds`or `entraGroupNames`. `--entraGroupNames [entraGroupNames]` -: The name of the Entra group to add as a member. If multiple groups need to be added, they have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `aadGroupIds`, `entraGroupIds`, `aadGroupNames`, or `entraGroupNames`. - -`--aadGroupNames [aadGroupNames]` -: (deprecated. Use `entraGroupNames` instead) The name of the Microsoft Entra group to add as a member. If multiple groups need to be added, they have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `aadGroupIds`, `entraGroupIds`, `aadGroupNames`, or `entraGroupNames`. +: The name of the Entra group to add as a member. If multiple groups need to be added, they have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `entraGroupIds` or `entraGroupNames`. ``` ## Remarks -For the `userIds`, `userNames`, `emails`, `aadGroupIds`, `entraGroupIds`, `aadGroupNames`, or `entraGroupNames` options you can specify multiple values by separating them with a comma. If one of the specified entries is not valid, the command will fail with an error message showing the list of invalid values. +For the `userIds`, `userNames`, `emails`, `entraGroupIds`, or `entraGroupNames` options you can specify multiple values by separating them with a comma. If one of the specified entries is not valid, the command will fail with an error message showing the list of invalid values. ## Examples @@ -63,7 +57,7 @@ m365 spo group member add --webUrl https://contoso.sharepoint.com/sites/SiteA -- Add multiple users with the userNames parameter to a SharePoint group with the groupId parameter. ```sh -m365 spo group member add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupId 5 --userNames "Alex.Wilber@contoso.com, Adele.Vance@contoso.com" +m365 spo group member add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupId 5 --userNames "Alex.Wilber@contoso.com,Adele.Vance@contoso.com" ``` Add a user with the emails parameter to a SharePoint group with the groupName parameter. @@ -75,7 +69,7 @@ m365 spo group member add --webUrl https://contoso.sharepoint.com/sites/SiteA -- Add multiple users with the emails parameter to a SharePoint group with the groupName parameter. ```sh -m365 spo group member add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupName "Contoso Site Owners" --emails "Alex.Wilber@contoso.com, Adele.Vance@contoso.com" +m365 spo group member add --webUrl https://contoso.sharepoint.com/sites/SiteA --groupName "Contoso Site Owners" --emails "Alex.Wilber@contoso.com,Adele.Vance@contoso.com" ``` Add a user with the userIds parameter to a SharePoint group with the groupId parameter. diff --git a/docs/docs/cmd/spo/group/group-member-remove.mdx b/docs/docs/cmd/spo/group/group-member-remove.mdx index 4b2adc95922..7ed285b92d8 100644 --- a/docs/docs/cmd/spo/group/group-member-remove.mdx +++ b/docs/docs/cmd/spo/group/group-member-remove.mdx @@ -23,25 +23,19 @@ m365 spo group member remove [options] : Name of the SharePoint group from which user has to be removed. Specify either `groupName` or `groupId`, but not both. `--userName [userName]` -: The UPN (user principal name, eg. megan.bowen@contoso.com) of the user that needs to be removed. Specify either `userName`, `email`, `userId`, `aadGroupId` or `aadGroupName`. +: The UPN (user principal name, eg. megan.bowen@contoso.com) of the user that needs to be removed. Specify either `userName`, `email`, `userId`, `entraGroupId` or `entraGroupName`. `--email [email]` -: The email of the user to remove as a member. Specify either `userName`, `email`, `userId`, `aadGroupId` or `aadGroupName`. +: The email of the user to remove as a member. Specify either `userName`, `email`, `userId`, `entraGroupId` or `entraGroupName`. `--userId [userId]` -: The user Id (Id of the site user, eg. 14) of the user to remove as a member. Specify either `userName`, `email`, `userId`, `aadGroupId` or `aadGroupName`. +: The user Id (Id of the site user, eg. 14) of the user to remove as a member. Specify either `userName`, `email`, `userId`, `entraGroupId` or `entraGroupName`. `--entraGroupId [entraGroupId]` -: The object Id of the Entra group to remove as a member. Specify either `userName`, `email`, `userId`, `aadGroupId`, `entraGroupId`, `aadGroupName`, or `entraGroupName`. - -`--aadGroupId [aadGroupId]` -: (deprecated. Use `entraGroupId` instead) The object ID of the Microsoft Entra group to remove as a member. Specify either `userName`, `email`, `userId`, `aadGroupId`, `entraGroupId`, `aadGroupName`, or `entraGroupName`. +: The object Id of the Entra group to remove as a member. Specify either `userName`, `email`, `userId`, `entraGroupId`, or `entraGroupName`. `--entraGroupName [entraGroupName]` -: The name of the Entra group to remove as a member. Specify either `userName`, `email`, `userId`, `aadGroupId`, `entraGroupId`, `aadGroupName`, or `entraGroupName`. - -`--aadGroupName [aadGroupName]` -: (deprecated. Use `entraGroupName` instead) The name of the Microsoft Entra group to remove as a member. Specify either `userName`, `email`, `userId`, `aadGroupId`, `entraGroupId`, `aadGroupName`, or `entraGroupName`. +: The name of the Entra group to remove as a member. Specify either `userName`, `email`, `userId`, `entraGroupId`, or `entraGroupName`. ``` diff --git a/docs/docs/cmd/spo/user/user-ensure.mdx b/docs/docs/cmd/spo/user/user-ensure.mdx index 077838c0c41..12551b5ef98 100644 --- a/docs/docs/cmd/spo/user/user-ensure.mdx +++ b/docs/docs/cmd/spo/user/user-ensure.mdx @@ -19,13 +19,10 @@ m365 spo user ensure [options] : Absolute URL of the site. `--entraId [--entraId]` -: Id of the user in Entra. Specify either `aadId`, `entraId`, or `userName`. - -`--aadId [--aadId]` -: (deprecated. Use `entraId` instead) Id of the user in Microsoft Entra. Specify either `aadId`, `entraId`, or `userName`. +: Id of the user in Entra. Specify either `entraId` or `userName`. `--userName [userName]` -: User's UPN (user principal name, e.g. john@contoso.com). Specify either `aadId`, `entraId`, or `userName`. +: User's UPN (user principal name, e.g. john@contoso.com). Specify either `entraId` or `userName`. ``` diff --git a/src/m365/spo/commands/group/group-member-add.spec.ts b/src/m365/spo/commands/group/group-member-add.spec.ts index 03b31d42482..c264f73d894 100644 --- a/src/m365/spo/commands/group/group-member-add.spec.ts +++ b/src/m365/spo/commands/group/group-member-add.spec.ts @@ -6,6 +6,7 @@ import { CommandInfo } from '../../../../cli/CommandInfo.js'; import { Logger } from '../../../../cli/Logger.js'; import request from '../../../../request.js'; import { telemetry } from '../../../../telemetry.js'; +import { formatting } from '../../../../utils/formatting.js'; import { pid } from '../../../../utils/pid.js'; import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; @@ -163,7 +164,7 @@ describe(commands.GROUP_MEMBER_ADD, () => { //#region Option values const webUrl = 'https://contoso.sharepoint.com/sites/Marketing'; - const spGroupName = 'Marketing Site Owners'; + const spGroupName = "Contoso Site Owners"; const spGroupId = 3; const spUserIds = userResponses.map(u => u.Id); const userNames = userResponses.map(u => u.UserPrincipalName); @@ -231,7 +232,7 @@ describe(commands.GROUP_MEMBER_ADD, () => { options: { webUrl: "https://contoso.sharepoint.com/sites/SiteA", groupId: 32, - groupName: "Contoso Site Owners", + groupName: spGroupName, userNames: "Alex.Wilber@contoso.com" } }, commandInfo); @@ -284,18 +285,6 @@ describe(commands.GROUP_MEMBER_ADD, () => { assert.notStrictEqual(actual, true); }); - it('fails validation if both emails and aadGroupIds options are passed', async () => { - const actual = await command.validate({ - options: { - webUrl: "https://contoso.sharepoint.com/sites/SiteA", - groupId: 32, - emails: "Alex.Wilber@contoso.com", - aadGroupIds: "56ca9023-3449-4e98-a96a-69e81a6f4983" - } - }, commandInfo); - assert.notStrictEqual(actual, true); - }); - it('fails validation if both userIds and entraGroupNames options are passed', async () => { const actual = await command.validate({ options: { @@ -308,18 +297,6 @@ describe(commands.GROUP_MEMBER_ADD, () => { assert.notStrictEqual(actual, true); }); - it('fails validation if both userIds and aadGroupNames options are passed', async () => { - const actual = await command.validate({ - options: { - webUrl: "https://contoso.sharepoint.com/sites/SiteA", - groupId: 32, - userIds: 5, - aadGroupNames: "Microsoft Entra Group name" - } - }, commandInfo); - assert.notStrictEqual(actual, true); - }); - it('fails validation if both userIds and emails options are passed', async () => { const actual = await command.validate({ options: { @@ -332,7 +309,7 @@ describe(commands.GROUP_MEMBER_ADD, () => { assert.notStrictEqual(actual, true); }); - it('fails validation if userNames, emails, userIds, entraGroupIds, aadGroupIds, entraGroupNames, or aadGroupNames options are not passed', async () => { + it('fails validation if userNames, emails, userIds, entraGroupIds, or entraGroupNames options are not passed', async () => { const actual = await command.validate({ options: { webUrl: "https://contoso.sharepoint.com/sites/SiteA", @@ -372,11 +349,6 @@ describe(commands.GROUP_MEMBER_ADD, () => { assert.notStrictEqual(actual, true); }); - it('fails validation if aadGroupIds is Invalid', async () => { - const actual = await command.validate({ options: { webUrl: "https://contoso.sharepoint.com/sites/SiteA", groupId: 32, aadGroupIds: "56ca9023-3449-4e98-a96a-69e81a6f4983,9" } }, commandInfo); - assert.notStrictEqual(actual, true); - }); - it('passes validation if all the required options are specified', async () => { const actual = await command.validate({ options: { webUrl: "https://contoso.sharepoint.com/sites/SiteA", groupId: 32, userNames: "Alex.Wilber@contoso.com" } }, commandInfo); assert.strictEqual(actual, true); @@ -386,28 +358,6 @@ describe(commands.GROUP_MEMBER_ADD, () => { assert.deepStrictEqual(command.defaultProperties(), ['Title', 'UserPrincipalName']); }); - it('correctly logs deprecation warning for aadGroupIds option', async () => { - const chalk = (await import('chalk')).default; - const loggerErrSpy = sinon.spy(logger, 'logToStderr'); - sinon.stub(request, 'post').resolves(); - - await command.action(logger, { options: { webUrl: webUrl, groupName: spGroupName, aadGroupIds: entraGroupIds[0] } }); - assert.deepStrictEqual(loggerErrSpy.firstCall.firstArg, chalk.yellow(`Option 'aadGroupIds' is deprecated. Please use 'entraGroupIds' instead.`)); - - sinonUtil.restore(loggerErrSpy); - }); - - it('correctly logs deprecation warning for aadGroupNames option', async () => { - const chalk = (await import('chalk')).default; - const loggerErrSpy = sinon.spy(logger, 'logToStderr'); - sinon.stub(request, 'post').resolves(); - - await command.action(logger, { options: { webUrl: webUrl, groupName: spGroupName, aadGroupNames: entraGroupNames[0] } }); - assert.deepStrictEqual(loggerErrSpy.firstCall.firstArg, chalk.yellow(`Option 'aadGroupNames' is deprecated. Please use 'entraGroupNames' instead.`)); - - sinonUtil.restore(loggerErrSpy); - }); - it('correctly logs result when adding users by userNames', async () => { const postStub = sinon.stub(request, 'post').callsFake(async (opts) => { if (opts.url === `${webUrl}/_api/web/SiteGroups/GetById(${spGroupId})/users`) { @@ -428,27 +378,6 @@ describe(commands.GROUP_MEMBER_ADD, () => { assert(loggerLogSpy.calledOnceWithExactly(userResponses)); }); - it('correctly adds users to group by UPNs', async () => { - const postStub = sinon.stub(request, 'post').callsFake(async (opts) => { - if (opts.url === `${webUrl}/_api/web/SiteGroups/GetById(${spGroupId})/users`) { - return userResponses[postStub.callCount - 1]; - } - - throw 'Invalid request: ' + opts.url; - }); - - await command.action(logger, { - options: { - webUrl: webUrl, - groupId: spGroupId, - userNames: userNames.join(',') - } - }); - - assert.deepStrictEqual(postStub.firstCall.args[0].data, { LoginName: 'i:0#.f|membership|adelev@contoso.onmicrosoft.com' }); - assert.deepStrictEqual(postStub.secondCall.args[0].data, { LoginName: 'i:0#.f|membership|johnd@contoso.onmicrosoft.com' }); - }); - it('correctly adds users to group by emails', async () => { const postStub = sinon.stub(request, 'post').callsFake(async (opts) => { if (opts.url === `${webUrl}/_api/web/SiteGroups/GetById(${spGroupId})/users`) { @@ -544,6 +473,28 @@ describe(commands.GROUP_MEMBER_ADD, () => { assert.deepStrictEqual(postStub.secondCall.args[0].data, { LoginName: `c:0t.c|tenant|${entraGroupResponses[1].id}` }); }); + it('correctly adds user to a group by groupName and emails (DEBUG)', async () => { + const postStub = sinon.stub(request, 'post').callsFake(async (opts) => { + if (opts.url === `${webUrl}/_api/web/SiteGroups/GetByName('${formatting.encodeQueryParameter(spGroupName)}')/users`) { + return groupResponses[postStub.callCount - 1]; + } + + throw 'Invalid request: ' + opts.url; + }); + + await command.action(logger, { + options: { + debug: true, + webUrl: webUrl, + groupName: spGroupName, + emails: emails.join(',') + } + }); + + assert.deepStrictEqual(postStub.firstCall.args[0].data, { LoginName: 'i:0#.f|membership|Adele.Vance@contoso.onmicrosoft.com' }); + assert.deepStrictEqual(postStub.secondCall.args[0].data, { LoginName: 'i:0#.f|membership|John.Doe@contoso.onmicrosoft.com' }); + }); + it('correctly adds users to group by entraGroupNames', async () => { const postStub = sinon.stub(request, 'post').callsFake(async (opts) => { if (opts.url === `${webUrl}/_api/web/SiteGroups/GetById(${spGroupId})/users`) { @@ -584,4 +535,4 @@ describe(commands.GROUP_MEMBER_ADD, () => { await assert.rejects(command.action(logger, { options: { webUrl: webUrl, groupId: spGroupId, userNames: userNames.join(',') } }), new CommandError(error.error['odata.error'].message.value)); }); -}); +}); \ No newline at end of file diff --git a/src/m365/spo/commands/group/group-member-add.ts b/src/m365/spo/commands/group/group-member-add.ts index 52779256bd9..fabe2e128ab 100644 --- a/src/m365/spo/commands/group/group-member-add.ts +++ b/src/m365/spo/commands/group/group-member-add.ts @@ -20,9 +20,7 @@ interface Options extends GlobalOptions { emails?: string; userIds?: string; entraGroupIds?: string; - aadGroupIds?: string; entraGroupNames?: string; - aadGroupNames?: string; } class SpoGroupMemberAddCommand extends SpoCommand { @@ -57,9 +55,7 @@ class SpoGroupMemberAddCommand extends SpoCommand { emails: typeof args.options.emails !== 'undefined', userIds: typeof args.options.userIds !== 'undefined', entraGroupIds: typeof args.options.entraGroupIds !== 'undefined', - aadGroupIds: typeof args.options.aadGroupIds !== 'undefined', - entraGroupNames: typeof args.options.entraGroupNames !== 'undefined', - aadGroupNames: typeof args.options.aadGroupNames !== 'undefined' + entraGroupNames: typeof args.options.entraGroupNames !== 'undefined' }); }); } @@ -87,14 +83,8 @@ class SpoGroupMemberAddCommand extends SpoCommand { { option: '--entraGroupIds [entraGroupIds]' }, - { - option: '--aadGroupIds [aadGroupIds]' - }, { option: '--entraGroupNames [entraGroupNames]' - }, - { - option: '--aadGroupNames [aadGroupNames]' } ); } @@ -139,13 +129,6 @@ class SpoGroupMemberAddCommand extends SpoCommand { } } - if (args.options.aadGroupIds) { - const isValidArray = validation.isValidGuidArray(args.options.aadGroupIds); - if (isValidArray !== true) { - return `Option 'aadGroupIds' contains one or more invalid GUIDs: ${isValidArray}.`; - } - } - return true; } ); @@ -154,28 +137,16 @@ class SpoGroupMemberAddCommand extends SpoCommand { #initOptionSets(): void { this.optionSets.push( { options: ['groupId', 'groupName'] }, - { options: ['userNames', 'emails', 'userIds', 'entraGroupIds', 'aadGroupIds', 'entraGroupNames', 'aadGroupNames'] } + { options: ['userNames', 'emails', 'userIds', 'entraGroupIds', 'entraGroupNames'] } ); } #initTypes(): void { - this.types.string.push('webUrl', 'groupName', 'userNames', 'emails', 'userIds', 'entraGroupIds', 'aadGroupIds', 'entraGroupNames', 'aadGroupNames'); + this.types.string.push('webUrl', 'groupName', 'userNames', 'emails', 'userIds', 'entraGroupIds', 'entraGroupNames'); } public async commandAction(logger: Logger, args: CommandArgs): Promise { try { - if (args.options.aadGroupIds) { - args.options.entraGroupIds = args.options.aadGroupIds; - - await this.warn(logger, `Option 'aadGroupIds' is deprecated. Please use 'entraGroupIds' instead.`); - } - - if (args.options.aadGroupNames) { - args.options.entraGroupNames = args.options.aadGroupNames; - - await this.warn(logger, `Option 'aadGroupNames' is deprecated. Please use 'entraGroupNames' instead.`); - } - const loginNames = await this.getLoginNames(logger, args.options); let apiUrl = `${args.options.webUrl}/_api/web/SiteGroups`; diff --git a/src/m365/spo/commands/group/group-member-remove.spec.ts b/src/m365/spo/commands/group/group-member-remove.spec.ts index 84ecd5fa54c..cbccf4c3882 100644 --- a/src/m365/spo/commands/group/group-member-remove.spec.ts +++ b/src/m365/spo/commands/group/group-member-remove.spec.ts @@ -130,40 +130,6 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { assert(postStub.called); }); - it('Removes Microsoft Entra group from SharePoint group using Microsoft Entra Group Name', async () => { - sinonUtil.restore(cli.promptForConfirmation); - sinon.stub(cli, 'promptForConfirmation').resolves(true); - - sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { - if (command === spoGroupMemberListCommand) { - return ({ - stdout: spoGroupMemberListCommandOutput - }); - } - - throw new CommandError('Unknown case'); - }); - - const postStub = sinon.stub(request, 'post').callsFake(async opts => { - if ((opts.url as string).indexOf('/_api/web/sitegroups/GetByName') > -1) { - return UserRemovalJSONResponse; - } - - throw `Invalid request ${JSON.stringify(opts)}`; - }); - - await command.action(logger, { - options: { - debug: true, - webUrl: "https://contoso.sharepoint.com/sites/SiteA", - groupName: "Site A Visitors", - aadGroupName: "Microsoft Entra Security Group" - } - }); - - assert(postStub.called); - }); - it('Removes Entra group from SharePoint group using Entra Group ID - Without Confirmation Prompt', async () => { sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { if (command === spoGroupMemberListCommand) { @@ -194,36 +160,6 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { assert(postStub.called); }); - it('Removes Microsoft Entra group from SharePoint group using Microsoft Entra Group ID - Without Confirmation Prompt', async () => { - sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { - if (command === spoGroupMemberListCommand) { - return ({ - stdout: spoGroupMemberListCommandOutput - }); - } - - throw new CommandError('Unknown case'); - }); - - const postStub = sinon.stub(request, 'post').callsFake(async opts => { - if ((opts.url as string).indexOf('/_api/web/sitegroups/GetByName') > -1) { - return UserRemovalJSONResponse; - } - - throw `Invalid request ${JSON.stringify(opts)}`; - }); - await command.action(logger, { - options: { - debug: true, - webUrl: "https://contoso.sharepoint.com/sites/SiteA", - groupName: "Site A Visitors", - aadGroupId: "5786b8e8-c495-4734-b345-756733960730", - force: true - } - }); - assert(postStub.called); - }); - it('Removes Entra group from SharePoint group using Entra Group ID and SharePoint Group ID', async () => { sinonUtil.restore(cli.promptForConfirmation); sinon.stub(cli, 'promptForConfirmation').resolves(true); @@ -710,15 +646,4 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { }, commandInfo); assert.notStrictEqual(actual, true); }); - - it('fails validation if aadGroupId is not a valid guid.', async () => { - const actual = await command.validate({ - options: { - webUrl: "https://contoso.sharepoint.com/sites/SiteA", - groupId: 3, - aadGroupId: 'Invalid GUID' - } - }, commandInfo); - assert.notStrictEqual(actual, true); - }); }); \ No newline at end of file diff --git a/src/m365/spo/commands/group/group-member-remove.ts b/src/m365/spo/commands/group/group-member-remove.ts index 4ea58a7bc06..420a5b09d83 100644 --- a/src/m365/spo/commands/group/group-member-remove.ts +++ b/src/m365/spo/commands/group/group-member-remove.ts @@ -22,9 +22,7 @@ interface Options extends GlobalOptions { email?: string; userId?: number; entraGroupId?: string; - aadGroupId?: string; entraGroupName?: string; - aadGroupName?: string; force?: boolean; } @@ -55,9 +53,7 @@ class SpoGroupMemberRemoveCommand extends SpoCommand { email: (!(!args.options.email)).toString(), userId: (!(!args.options.userId)).toString(), entraGroupId: (!(!args.options.entraGroupId)).toString(), - aadGroupId: (!(!args.options.groupId)).toString(), entraGroupName: (!(!args.options.entraGroupName)).toString(), - aadGroupName: (!(!args.options.aadGroupName)).toString(), force: (!(!args.options.force)).toString() }); }); @@ -86,15 +82,9 @@ class SpoGroupMemberRemoveCommand extends SpoCommand { { option: '--entraGroupId [entraGroupId]' }, - { - option: '--aadGroupId [aadGroupId]' - }, { option: '--entraGroupName [entraGroupName]' }, - { - option: '--aadGroupName [aadGroupName]' - }, { option: '-f, --force' } @@ -124,10 +114,6 @@ class SpoGroupMemberRemoveCommand extends SpoCommand { return `${args.options.entraGroupId} is not a valid GUID`; } - if (args.options.aadGroupId && !validation.isValidGuid(args.options.aadGroupId as string)) { - return `${args.options.aadGroupId} is not a valid GUID`; - } - return validation.isValidSharePointUrl(args.options.webUrl); } ); @@ -136,7 +122,7 @@ class SpoGroupMemberRemoveCommand extends SpoCommand { #initOptionSets(): void { this.optionSets.push( { options: ['groupName', 'groupId'] }, - { options: ['userName', 'email', 'userId', 'entraGroupId', 'aadGroupId', 'entraGroupName', 'aadGroupName'] } + { options: ['userName', 'email', 'userId', 'entraGroupId', 'entraGroupName'] } ); } @@ -162,18 +148,6 @@ class SpoGroupMemberRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.aadGroupId) { - args.options.entraGroupId = args.options.aadGroupId; - - await this.warn(logger, `Option 'aadGroupId' is deprecated. Please use 'entraGroupId' instead`); - } - - if (args.options.aadGroupName) { - args.options.entraGroupName = args.options.aadGroupName; - - await this.warn(logger, `Option 'aadGroupName' is deprecated. Please use 'entraGroupName' instead`); - } - if (args.options.force) { if (this.debug) { await logger.logToStderr('Confirmation bypassed by entering confirm option. Removing the user from SharePoint Group...'); diff --git a/src/m365/spo/commands/user/user-ensure.spec.ts b/src/m365/spo/commands/user/user-ensure.spec.ts index c9f99d0ded8..9e8382f0723 100644 --- a/src/m365/spo/commands/user/user-ensure.spec.ts +++ b/src/m365/spo/commands/user/user-ensure.spec.ts @@ -116,23 +116,6 @@ describe(commands.USER_ENSURE, () => { assert(loggerLogSpy.calledWith(ensuredUserResponse)); }); - it('ensures user for a specific web by aadId', async () => { - sinon.stub(entraUser, 'getUpnByUserId').callsFake(async () => { - return validUserName; - }); - - sinon.stub(request, 'post').callsFake(async (opts) => { - if (opts.url === `${validWebUrl}/_api/web/ensureuser`) { - return ensuredUserResponse; - } - - throw 'Invalid request'; - }); - - await command.action(logger, { options: { verbose: true, webUrl: validWebUrl, aadId: validEntraId } }); - assert(loggerLogSpy.calledWith(ensuredUserResponse)); - }); - it('throws error message when no user was found with a specific id', async () => { sinon.stub(entraUser, 'getUpnByUserId').callsFake(async (id) => { throw { @@ -186,11 +169,6 @@ describe(commands.USER_ENSURE, () => { assert.notStrictEqual(actual, true); }); - it('fails validation if aadId is not a valid id', async () => { - const actual = await command.validate({ options: { webUrl: validWebUrl, aadId: 'invalid' } }, commandInfo); - assert.notStrictEqual(actual, true); - }); - it('fails validation if userName is not a valid user principal name', async () => { const actual = await command.validate({ options: { webUrl: validWebUrl, userName: 'invalid' } }, commandInfo); assert.notStrictEqual(actual, true); @@ -201,11 +179,6 @@ describe(commands.USER_ENSURE, () => { assert.strictEqual(actual, true); }); - it('passes validation if the url is valid and aadId is a valid id', async () => { - const actual = await command.validate({ options: { webUrl: validWebUrl, aadId: validEntraId } }, commandInfo); - assert.strictEqual(actual, true); - }); - it('passes validation if the url is valid and userName is a valid user principal name', async () => { const actual = await command.validate({ options: { webUrl: validWebUrl, userName: validUserName } }, commandInfo); assert.strictEqual(actual, true); diff --git a/src/m365/spo/commands/user/user-ensure.ts b/src/m365/spo/commands/user/user-ensure.ts index 7a624851303..c4f681d15aa 100644 --- a/src/m365/spo/commands/user/user-ensure.ts +++ b/src/m365/spo/commands/user/user-ensure.ts @@ -13,7 +13,6 @@ interface CommandArgs { interface Options extends GlobalOptions { webUrl: string; entraId?: string; - aadId?: string; userName?: string; } @@ -39,7 +38,6 @@ class SpoUserEnsureCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { entraId: typeof args.options.entraId !== 'undefined', - aadId: typeof args.options.aadId !== 'undefined', userName: typeof args.options.userName !== 'undefined' }); }); @@ -53,9 +51,6 @@ class SpoUserEnsureCommand extends SpoCommand { { option: '--entraId [entraId]' }, - { - option: '--aadId [aadId]' - }, { option: '--userName [userName]' } @@ -74,10 +69,6 @@ class SpoUserEnsureCommand extends SpoCommand { return `${args.options.entraId} is not a valid GUID.`; } - if (args.options.aadId && !validation.isValidGuid(args.options.aadId)) { - return `${args.options.aadId} is not a valid GUID.`; - } - if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) { return `${args.options.userName} is not a valid userName.`; } @@ -88,16 +79,10 @@ class SpoUserEnsureCommand extends SpoCommand { } #initOptionSets(): void { - this.optionSets.push({ options: ['entraId', 'aadId', 'userName'] }); + this.optionSets.push({ options: ['entraId', 'userName'] }); } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.aadId) { - args.options.entraId = args.options.aadId; - - await this.warn(logger, `Option 'aadId' is deprecated. Please use 'entraId' instead`); - } - if (this.verbose) { await logger.logToStderr(`Ensuring user ${args.options.entraId || args.options.userName} at site ${args.options.webUrl}`); } From 319517a748323c3e35969eafc15b79077e5c4506 Mon Sep 17 00:00:00 2001 From: Nanddeep Nachan Date: Wed, 14 Aug 2024 10:20:14 +0000 Subject: [PATCH 2/7] removed aad aliases --- docs/docs/cmd/spo/group/group-member-add.mdx | 2 +- src/m365/entra/aadCommands.ts | 89 ------------------- .../administrativeunit-add.spec.ts | 11 --- .../administrativeunit-add.ts | 7 -- .../administrativeunit-get.spec.ts | 11 --- .../administrativeunit-get.ts | 7 -- .../administrativeunit-list.spec.ts | 11 --- .../administrativeunit-list.ts | 7 -- .../administrativeunit-member-add.spec.ts | 11 --- .../administrativeunit-member-add.ts | 7 -- .../administrativeunit-member-get.spec.ts | 11 --- .../administrativeunit-member-get.ts | 7 -- .../administrativeunit-member-list.spec.ts | 11 --- .../administrativeunit-member-list.ts | 7 -- .../administrativeunit-remove.spec.ts | 11 --- .../administrativeunit-remove.ts | 8 -- src/m365/entra/commands/app/app-add.spec.ts | 11 --- src/m365/entra/commands/app/app-add.ts | 37 ++++++-- src/m365/entra/commands/app/app-get.spec.ts | 11 --- src/m365/entra/commands/app/app-get.ts | 7 -- src/m365/entra/commands/app/app-list.spec.ts | 11 --- src/m365/entra/commands/app/app-list.ts | 7 -- .../commands/app/app-permission-add.spec.ts | 11 --- .../entra/commands/app/app-permission-add.ts | 7 -- .../entra/commands/app/app-remove.spec.ts | 11 --- src/m365/entra/commands/app/app-remove.ts | 7 -- .../entra/commands/app/app-role-add.spec.ts | 11 --- src/m365/entra/commands/app/app-role-add.ts | 7 -- .../entra/commands/app/app-role-list.spec.ts | 11 --- src/m365/entra/commands/app/app-role-list.ts | 7 -- .../commands/app/app-role-remove.spec.ts | 11 --- .../entra/commands/app/app-role-remove.ts | 7 -- src/m365/entra/commands/app/app-set.spec.ts | 11 --- src/m365/entra/commands/app/app-set.ts | 7 -- .../approleassignment-add.spec.ts | 11 --- .../approleassignment-add.ts | 7 -- .../approleassignment-list.spec.ts | 11 --- .../approleassignment-list.ts | 7 -- .../approleassignment-remove.spec.ts | 11 --- .../approleassignment-remove.ts | 7 -- .../enterpriseapp/enterpriseapp-add.spec.ts | 11 --- .../enterpriseapp/enterpriseapp-add.ts | 7 -- .../enterpriseapp/enterpriseapp-get.spec.ts | 11 --- .../enterpriseapp/enterpriseapp-get.ts | 7 -- .../enterpriseapp/enterpriseapp-list.spec.ts | 11 --- .../enterpriseapp/enterpriseapp-list.ts | 7 -- .../entra/commands/group/group-add.spec.ts | 11 --- src/m365/entra/commands/group/group-add.ts | 5 -- .../entra/commands/group/group-get.spec.ts | 11 --- src/m365/entra/commands/group/group-get.ts | 7 -- .../entra/commands/group/group-list.spec.ts | 11 --- src/m365/entra/commands/group/group-list.ts | 7 -- .../commands/group/group-member-list.spec.ts | 10 --- .../entra/commands/group/group-member-list.ts | 1 - .../entra/commands/group/group-remove.spec.ts | 11 --- src/m365/entra/commands/group/group-remove.ts | 7 -- .../groupsetting/groupsetting-add.spec.ts | 11 --- .../commands/groupsetting/groupsetting-add.ts | 7 -- .../groupsetting/groupsetting-get.spec.ts | 11 --- .../commands/groupsetting/groupsetting-get.ts | 7 -- .../groupsetting/groupsetting-list.spec.ts | 11 --- .../groupsetting/groupsetting-list.ts | 7 -- .../groupsetting/groupsetting-remove.spec.ts | 11 --- .../groupsetting/groupsetting-remove.ts | 7 -- .../groupsetting/groupsetting-set.spec.ts | 11 --- .../commands/groupsetting/groupsetting-set.ts | 7 -- .../groupsettingtemplate-get.spec.ts | 11 --- .../groupsettingtemplate-get.ts | 7 -- .../groupsettingtemplate-list.spec.ts | 11 --- .../groupsettingtemplate-list.ts | 7 -- .../commands/license/license-list.spec.ts | 11 --- .../entra/commands/license/license-list.ts | 7 -- .../commands/m365group/m365group-add.spec.ts | 11 --- .../entra/commands/m365group/m365group-add.ts | 7 -- .../m365group-conversation-list.spec.ts | 11 --- .../m365group/m365group-conversation-list.ts | 7 -- .../m365group-conversation-post-list.spec.ts | 18 ++-- .../m365group-conversation-post-list.ts | 7 -- .../commands/m365group/m365group-get.spec.ts | 11 --- .../entra/commands/m365group/m365group-get.ts | 7 -- .../commands/m365group/m365group-list.spec.ts | 11 --- .../commands/m365group/m365group-list.ts | 7 -- .../m365group-recyclebinitem-clear.spec.ts | 11 --- .../m365group-recyclebinitem-clear.ts | 7 -- .../m365group-recyclebinitem-list.spec.ts | 11 --- .../m365group-recyclebinitem-list.ts | 7 -- .../m365group-recyclebinitem-remove.spec.ts | 11 --- .../m365group-recyclebinitem-remove.ts | 7 -- .../m365group-recyclebinitem-restore.spec.ts | 11 --- .../m365group-recyclebinitem-restore.ts | 7 -- .../m365group/m365group-remove.spec.ts | 11 --- .../commands/m365group/m365group-remove.ts | 7 -- .../m365group/m365group-renew.spec.ts | 11 --- .../commands/m365group/m365group-renew.ts | 7 -- .../m365group-report-activitycounts.spec.ts | 11 --- .../m365group-report-activitycounts.ts | 5 -- .../m365group-report-activitydetail.spec.ts | 11 --- .../m365group-report-activitydetail.ts | 5 -- ...365group-report-activityfilecounts.spec.ts | 13 +-- .../m365group-report-activityfilecounts.ts | 5 -- ...65group-report-activitygroupcounts.spec.ts | 13 +-- .../m365group-report-activitygroupcounts.ts | 5 -- .../m365group-report-activitystorage.spec.ts | 13 +-- .../m365group-report-activitystorage.ts | 5 -- .../commands/m365group/m365group-set.spec.ts | 12 ++- .../entra/commands/m365group/m365group-set.ts | 7 -- .../m365group/m365group-teamify.spec.ts | 11 --- .../commands/m365group/m365group-teamify.ts | 7 -- .../m365group/m365group-user-add.spec.ts | 11 --- .../commands/m365group/m365group-user-add.ts | 4 - .../m365group/m365group-user-list.spec.ts | 11 --- .../commands/m365group/m365group-user-list.ts | 7 -- .../m365group/m365group-user-remove.spec.ts | 12 --- .../m365group/m365group-user-remove.ts | 8 -- .../m365group/m365group-user-set.spec.ts | 1 - .../commands/m365group/m365group-user-set.ts | 6 -- .../oauth2grant/oauth2grant-add.spec.ts | 11 --- .../commands/oauth2grant/oauth2grant-add.ts | 7 -- .../oauth2grant/oauth2grant-list.spec.ts | 11 --- .../commands/oauth2grant/oauth2grant-list.ts | 7 -- .../oauth2grant/oauth2grant-remove.spec.ts | 11 --- .../oauth2grant/oauth2grant-remove.ts | 7 -- .../oauth2grant/oauth2grant-set.spec.ts | 11 --- .../commands/oauth2grant/oauth2grant-set.ts | 7 -- .../entra/commands/policy/policy-list.spec.ts | 11 --- src/m365/entra/commands/policy/policy-list.ts | 7 -- .../siteclassification-disable.spec.ts | 11 --- .../siteclassification-disable.ts | 7 -- .../siteclassification-enable.spec.ts | 11 --- .../siteclassification-enable.ts | 7 -- .../siteclassification-get.spec.ts | 11 --- .../siteclassification-get.ts | 7 -- .../siteclassification-set.spec.ts | 11 --- .../siteclassification-set.ts | 7 -- src/m365/entra/commands/user/user-add.spec.ts | 11 --- src/m365/entra/commands/user/user-add.ts | 7 -- src/m365/entra/commands/user/user-get.spec.ts | 21 ++--- src/m365/entra/commands/user/user-get.ts | 7 -- .../commands/user/user-guest-add.spec.ts | 11 --- .../entra/commands/user/user-guest-add.ts | 7 -- .../entra/commands/user/user-hibp.spec.ts | 11 --- src/m365/entra/commands/user/user-hibp.ts | 7 -- .../commands/user/user-license-add.spec.ts | 11 --- .../entra/commands/user/user-license-add.ts | 7 -- .../commands/user/user-license-list.spec.ts | 11 --- .../entra/commands/user/user-license-list.ts | 7 -- .../commands/user/user-license-remove.spec.ts | 11 --- .../commands/user/user-license-remove.ts | 7 -- .../entra/commands/user/user-list.spec.ts | 11 --- src/m365/entra/commands/user/user-list.ts | 7 -- .../user/user-password-validate.spec.ts | 11 --- .../commands/user/user-password-validate.ts | 7 -- .../user/user-recyclebinitem-clear.spec.ts | 11 --- .../user/user-recyclebinitem-clear.ts | 7 -- .../user/user-recyclebinitem-list.spec.ts | 11 --- .../commands/user/user-recyclebinitem-list.ts | 7 -- .../user/user-recyclebinitem-remove.spec.ts | 11 --- .../user/user-recyclebinitem-remove.ts | 7 -- .../user/user-recyclebinitem-restore.spec.ts | 11 --- .../user/user-recyclebinitem-restore.ts | 7 -- .../user-registrationdetails-list.spec.ts | 11 --- .../user/user-registrationdetails-list.ts | 5 -- .../entra/commands/user/user-remove.spec.ts | 11 --- src/m365/entra/commands/user/user-remove.ts | 7 -- src/m365/entra/commands/user/user-set.spec.ts | 11 --- src/m365/entra/commands/user/user-set.ts | 7 -- .../commands/user/user-signin-list.spec.ts | 11 --- .../entra/commands/user/user-signin-list.ts | 7 -- .../group/group-member-remove.spec.ts | 64 +++++++++++++ 169 files changed, 120 insertions(+), 1551 deletions(-) delete mode 100644 src/m365/entra/aadCommands.ts diff --git a/docs/docs/cmd/spo/group/group-member-add.mdx b/docs/docs/cmd/spo/group/group-member-add.mdx index 8973044ffc7..ae521aed3f0 100644 --- a/docs/docs/cmd/spo/group/group-member-add.mdx +++ b/docs/docs/cmd/spo/group/group-member-add.mdx @@ -34,7 +34,7 @@ m365 spo group member add [options] : The user Id of the user to add as a member. (Id of the site user, for example: 14). If multiple users need to be added, the Ids have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `entraGroupIds` or `entraGroupNames`. `--entraGroupIds [entraGroupIds]` -: The object Id of the Entra group to add as a member. If multiple groups need to be added, the Ids have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `entraGroupIds`or `entraGroupNames`. +: The object Id of the Entra group to add as a member. If multiple groups need to be added, the Ids have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `entraGroupIds` or `entraGroupNames`. `--entraGroupNames [entraGroupNames]` : The name of the Entra group to add as a member. If multiple groups need to be added, they have to be comma-separated. Specify either `userIds`, `userNames`, `emails`, `entraGroupIds` or `entraGroupNames`. diff --git a/src/m365/entra/aadCommands.ts b/src/m365/entra/aadCommands.ts deleted file mode 100644 index 3ceff166f60..00000000000 --- a/src/m365/entra/aadCommands.ts +++ /dev/null @@ -1,89 +0,0 @@ -const prefix: string = 'aad'; - -export default { - ADMINISTRATIVEUNIT_ADD: `${prefix} administrativeunit add`, - ADMINISTRATIVEUNIT_GET: `${prefix} administrativeunit get`, - ADMINISTRATIVEUNIT_LIST: `${prefix} administrativeunit list`, - ADMINISTRATIVEUNIT_REMOVE: `${prefix} administrativeunit remove`, - ADMINISTRATIVEUNIT_MEMBER_ADD: `${prefix} administrativeunit member add`, - ADMINISTRATIVEUNIT_MEMBER_GET: `${prefix} administrativeunit member get`, - ADMINISTRATIVEUNIT_MEMBER_LIST: `${prefix} administrativeunit member list`, - ADMINISTRATIVEUNIT_MEMBER_REMOVE: `${prefix} administrativeunit member remove`, - ADMINISTRATIVEUNIT_ROLEASSIGNMENT_ADD: `${prefix} administrativeunit roleassignment add`, - APP_ADD: `${prefix} app add`, - APP_GET: `${prefix} app get`, - APP_LIST: `${prefix} app list`, - APP_REMOVE: `${prefix} app remove`, - APP_SET: `${prefix} app set`, - APP_PERMISSION_ADD: `${prefix} app permission add`, - APP_ROLE_ADD: `${prefix} app role add`, - APP_ROLE_LIST: `${prefix} app role list`, - APP_ROLE_REMOVE: `${prefix} app role remove`, - APPROLEASSIGNMENT_ADD: `${prefix} approleassignment add`, - APPROLEASSIGNMENT_LIST: `${prefix} approleassignment list`, - APPROLEASSIGNMENT_REMOVE: `${prefix} approleassignment remove`, - GROUP_ADD: `${prefix} group add`, - GROUP_GET: `${prefix} group get`, - GROUP_LIST: `${prefix} group list`, - GROUP_REMOVE: `${prefix} group remove`, - GROUP_USER_LIST: `${prefix} group user list`, - GROUPSETTING_ADD: `${prefix} groupsetting add`, - GROUPSETTING_GET: `${prefix} groupsetting get`, - GROUPSETTING_LIST: `${prefix} groupsetting list`, - GROUPSETTING_REMOVE: `${prefix} groupsetting remove`, - GROUPSETTING_SET: `${prefix} groupsetting set`, - GROUPSETTINGTEMPLATE_GET: `${prefix} groupsettingtemplate get`, - GROUPSETTINGTEMPLATE_LIST: `${prefix} groupsettingtemplate list`, - LICENSE_LIST: `${prefix} license list`, - M365GROUP_ADD: `${prefix} m365group add`, - M365GROUP_GET: `${prefix} m365group get`, - M365GROUP_LIST: `${prefix} m365group list`, - M365GROUP_CONVERSATION_LIST: `${prefix} m365group conversation list`, - M365GROUP_CONVERSATION_POST_LIST: `${prefix} m365group conversation post list`, - M365GROUP_RECYCLEBINITEM_CLEAR: `${prefix} m365group recyclebinitem clear`, - M365GROUP_RECYCLEBINITEM_LIST: `${prefix} m365group recyclebinitem list`, - M365GROUP_RECYCLEBINITEM_REMOVE: `${prefix} m365group recyclebinitem remove`, - M365GROUP_RECYCLEBINITEM_RESTORE: `${prefix} m365group recyclebinitem restore`, - M365GROUP_SET: `${prefix} m365group set`, - M365GROUP_TEAMIFY: `${prefix} m365group teamify`, - M365GROUP_REMOVE: `${prefix} m365group remove`, - M365GROUP_RENEW: `${prefix} m365group renew`, - M365GROUP_REPORT_ACTIVITYCOUNTS: `${prefix} m365group report activitycounts`, - M365GROUP_REPORT_ACTIVITYDETAIL: `${prefix} m365group report activitydetail`, - M365GROUP_REPORT_ACTIVITYFILECOUNTS: `${prefix} m365group report activityfilecounts`, - M365GROUP_REPORT_ACTIVITYGROUPCOUNTS: `${prefix} m365group report activitygroupcounts`, - M365GROUP_REPORT_ACTIVITYSTORAGE: `${prefix} m365group report activitystorage`, - M365GROUP_USER_ADD: `${prefix} m365group user add`, - M365GROUP_USER_LIST: `${prefix} m365group user list`, - M365GROUP_USER_REMOVE: `${prefix} m365group user remove`, - M365GROUP_USER_SET: `${prefix} m365group user set`, - OAUTH2GRANT_ADD: `${prefix} oauth2grant add`, - OAUTH2GRANT_LIST: `${prefix} oauth2grant list`, - OAUTH2GRANT_REMOVE: `${prefix} oauth2grant remove`, - OAUTH2GRANT_SET: `${prefix} oauth2grant set`, - POLICY_LIST: `${prefix} policy list`, - SITECLASSIFICATION_DISABLE: `${prefix} siteclassification disable`, - SITECLASSIFICATION_ENABLE: `${prefix} siteclassification enable`, - SITECLASSIFICATION_GET: `${prefix} siteclassification get`, - SITECLASSIFICATION_SET: `${prefix} siteclassification set`, - SP_ADD: `${prefix} sp add`, - SP_GET: `${prefix} sp get`, - SP_LIST: `${prefix} sp list`, - USER_ADD: `${prefix} user add`, - USER_GET: `${prefix} user get`, - USER_GUEST_ADD: `${prefix} user guest add`, - USER_HIBP: `${prefix} user hibp`, - USER_LICENSE_ADD: `${prefix} user license add`, - USER_LICENSE_LIST: `${prefix} user license list`, - USER_LICENSE_REMOVE: `${prefix} user license remove`, - USER_LIST: `${prefix} user list`, - USER_PASSWORD_VALIDATE: `${prefix} user password validate`, - USER_RECYCLEBINITEM_CLEAR: `${prefix} user recyclebinitem clear`, - USER_RECYCLEBINITEM_LIST: `${prefix} user recyclebinitem list`, - USER_RECYCLEBINITEM_REMOVE: `${prefix} user recyclebinitem remove`, - USER_REGISTRATIONDETAILS_LIST: `${prefix} user registrationdetails list`, - USER_REMOVE: `${prefix} user remove`, - USER_RECYCLEBINITEM_RESTORE: `${prefix} user recyclebinitem restore`, - USER_SET: `${prefix} user set`, - USER_SIGNIN_LIST: `${prefix} user signin list` -}; diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-add.spec.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-add.spec.ts index a762d5cac0b..7f3b5c2521e 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-add.spec.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-add.spec.ts @@ -12,7 +12,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import request from '../../../../request.js'; import { Logger } from '../../../../cli/Logger.js'; import { CommandError } from '../../../../Command.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ADMINISTRATIVEUNIT_ADD, () => { const administrativeUnitReponse: any = { @@ -72,16 +71,6 @@ describe(commands.ADMINISTRATIVEUNIT_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.ADMINISTRATIVEUNIT_ADD]); - }); - it('creates an administrative unit with a specific display name', async () => { const postStub = sinon.stub(request, 'post').callsFake(async (opts) => { if (opts.url === 'https://graph.microsoft.com/v1.0/directory/administrativeUnits') { diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-add.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-add.ts index 4a314149dbd..37e60e17884 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-add.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-add.ts @@ -4,7 +4,6 @@ import { Logger } from "../../../../cli/Logger.js"; import request, { CliRequestOptions } from "../../../../request.js"; import GraphCommand from "../../../base/GraphCommand.js"; import commands from "../../commands.js"; -import aadCommands from "../../aadCommands.js"; interface CommandArgs { options: Options; @@ -25,10 +24,6 @@ class EntraAdministrativeUnitAddCommand extends GraphCommand { return 'Creates an administrative unit'; } - public alias(): string[] | undefined { - return [aadCommands.ADMINISTRATIVEUNIT_ADD]; - } - constructor() { super(); @@ -59,8 +54,6 @@ class EntraAdministrativeUnitAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_ADD, commands.ADMINISTRATIVEUNIT_ADD); - const requestOptions: CliRequestOptions = { url: `${this.resource}/v1.0/directory/administrativeUnits`, headers: { diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-get.spec.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-get.spec.ts index d5b26f3fac1..2bee010e9c9 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-get.spec.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-get.spec.ts @@ -13,7 +13,6 @@ import request from '../../../../request.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import { CommandError } from '../../../../Command.js'; import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ADMINISTRATIVEUNIT_GET, () => { let log: string[]; @@ -83,16 +82,6 @@ describe(commands.ADMINISTRATIVEUNIT_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.ADMINISTRATIVEUNIT_GET]); - }); - it('retrieves information about the specified administrative unit by id', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/directory/administrativeUnits/${validId}`) { diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-get.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-get.ts index 930c7015c83..9c3755317c9 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-get.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-get.ts @@ -6,7 +6,6 @@ import request, { CliRequestOptions } from "../../../../request.js"; import GraphCommand from "../../../base/GraphCommand.js"; import commands from "../../commands.js"; import { entraAdministrativeUnit } from "../../../../utils/entraAdministrativeUnit.js"; -import aadCommands from "../../aadCommands.js"; interface CommandArgs { options: Options; @@ -26,10 +25,6 @@ class EntraAdministrativeUnitGetCommand extends GraphCommand { return 'Gets information about a specific administrative unit'; } - public alias(): string[] | undefined { - return [aadCommands.ADMINISTRATIVEUNIT_GET]; - } - constructor() { super(); @@ -81,8 +76,6 @@ class EntraAdministrativeUnitGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_GET, commands.ADMINISTRATIVEUNIT_GET); - let administrativeUnit: AdministrativeUnit; try { diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-list.spec.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-list.spec.ts index f1d18809f7b..c746daa2a22 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-list.spec.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-list.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './administrativeunit-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ADMINISTRATIVEUNIT_LIST, () => { let log: string[]; @@ -60,16 +59,6 @@ describe(commands.ADMINISTRATIVEUNIT_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.ADMINISTRATIVEUNIT_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName', 'visibility']); }); diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-list.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-list.ts index 826bfe432dd..83b84bc1552 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-list.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-list.ts @@ -3,7 +3,6 @@ import { Logger } from '../../../../cli/Logger.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; class EntraAdministrativeUnitListCommand extends GraphCommand { public get name(): string { @@ -14,17 +13,11 @@ class EntraAdministrativeUnitListCommand extends GraphCommand { return 'Retrieves a list of administrative units'; } - public alias(): string[] | undefined { - return [aadCommands.ADMINISTRATIVEUNIT_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'displayName', 'visibility']; } public async commandAction(logger: Logger): Promise { - await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_LIST, commands.ADMINISTRATIVEUNIT_LIST); - try { const results = await odata.getAllItems(`${this.resource}/v1.0/directory/administrativeUnits`); await logger.log(results); diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-member-add.spec.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-member-add.spec.ts index e1f5b89156b..b83234ecdfe 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-member-add.spec.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-member-add.spec.ts @@ -17,7 +17,6 @@ import { entraGroup } from '../../../../utils/entraGroup.js'; import { entraUser } from '../../../../utils/entraUser.js'; import { entraDevice } from '../../../../utils/entraDevice.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ADMINISTRATIVEUNIT_MEMBER_ADD, () => { const administrativeUnitId = 'fc33aa61-cf0e-46b6-9506-f633347202ab'; @@ -83,16 +82,6 @@ describe(commands.ADMINISTRATIVEUNIT_MEMBER_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.ADMINISTRATIVEUNIT_MEMBER_ADD]); - }); - it('passes validation when administrativeUnitId is a valid GUID', async () => { const actual = await command.validate({ options: { administrativeUnitId: administrativeUnitId, userId: '00000000-0000-0000-0000-000000000000' } }, commandInfo); assert.strictEqual(actual, true); diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-member-add.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-member-add.ts index 91107daa660..b9a0bd8d964 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-member-add.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-member-add.ts @@ -8,7 +8,6 @@ import GraphCommand from "../../../base/GraphCommand.js"; import commands from "../../commands.js"; import request, { CliRequestOptions } from "../../../../request.js"; import { entraDevice } from "../../../../utils/entraDevice.js"; -import aadCommands from "../../aadCommands.js"; interface CommandArgs { options: Options; @@ -34,10 +33,6 @@ class EntraAdministrativeUnitMemberAddCommand extends GraphCommand { return 'Adds a member (user, group, device) to an administrative unit'; } - public alias(): string[] | undefined { - return [aadCommands.ADMINISTRATIVEUNIT_MEMBER_ADD]; - } - constructor() { super(); @@ -119,8 +114,6 @@ class EntraAdministrativeUnitMemberAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_MEMBER_ADD, commands.ADMINISTRATIVEUNIT_MEMBER_ADD); - let administrativeUnitId = args.options.administrativeUnitId; let memberType; let memberId; diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-member-get.spec.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-member-get.spec.ts index 2081aa4a876..1fe76b10455 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-member-get.spec.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-member-get.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import { CommandError } from '../../../../Command.js'; import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ADMINISTRATIVEUNIT_MEMBER_GET, () => { const administrativeUnitId = 'fc33aa61-cf0e-46b6-9506-f633347202ab'; @@ -89,16 +88,6 @@ describe(commands.ADMINISTRATIVEUNIT_MEMBER_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.ADMINISTRATIVEUNIT_MEMBER_GET]); - }); - it('passes validation when member id and administrativeUnitId are GUIDs', async () => { const actual = await command.validate({ options: { id: userId, administrativeUnitId: administrativeUnitId } }, commandInfo); assert.strictEqual(actual, true); diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-member-get.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-member-get.ts index 079176990a8..8e03b756c1c 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-member-get.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-member-get.ts @@ -6,7 +6,6 @@ import { Logger } from '../../../../cli/Logger.js'; import { validation } from '../../../../utils/validation.js'; import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js'; import request, { CliRequestOptions } from '../../../../request.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -34,10 +33,6 @@ class EntraAdministrativeUnitMemberGetCommand extends GraphCommand { return 'Retrieve a specific member (user, group, or device) of an administrative unit'; } - public alias(): string[] | undefined { - return [aadCommands.ADMINISTRATIVEUNIT_MEMBER_GET]; - } - constructor() { super(); @@ -95,8 +90,6 @@ class EntraAdministrativeUnitMemberGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_MEMBER_GET, commands.ADMINISTRATIVEUNIT_MEMBER_GET); - let administrativeUnitId = args.options.administrativeUnitId; try { diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-member-list.spec.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-member-list.spec.ts index dde7b23d60e..b62afa68c56 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-member-list.spec.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-member-list.spec.ts @@ -14,7 +14,6 @@ import { settingsNames } from '../../../../settingsNames.js'; import { CommandInfo } from '../../../../cli/CommandInfo.js'; import { cli } from '../../../../cli/cli.js'; import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ADMINISTRATIVEUNIT_MEMBER_LIST, () => { const administrativeUnitId = 'fc33aa61-cf0e-46b6-9506-f633347202ab'; @@ -326,16 +325,6 @@ describe(commands.ADMINISTRATIVEUNIT_MEMBER_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.ADMINISTRATIVEUNIT_MEMBER_LIST]); - }); - it('passes validation when administrativeUnitId is a valid GUID', async () => { const actual = await command.validate({ options: { administrativeUnitId: administrativeUnitId } }, commandInfo); assert.strictEqual(actual, true); diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-member-list.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-member-list.ts index 32bef4536ea..0055e560e47 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-member-list.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-member-list.ts @@ -7,7 +7,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js'; import { validation } from '../../../../utils/validation.js'; import { CliRequestOptions } from '../../../../request.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -35,10 +34,6 @@ class EntraAdministrativeUnitMemberListCommand extends GraphCommand { return 'Retrieves members (users, groups, or devices) of an administrative unit.'; } - public alias(): string[] | undefined { - return [aadCommands.ADMINISTRATIVEUNIT_MEMBER_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'displayName']; } @@ -110,8 +105,6 @@ class EntraAdministrativeUnitMemberListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_MEMBER_LIST, commands.ADMINISTRATIVEUNIT_MEMBER_LIST); - let administrativeUnitId = args.options.administrativeUnitId; try { diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-remove.spec.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-remove.spec.ts index 8b00fe054ff..3aa290db0af 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-remove.spec.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-remove.spec.ts @@ -13,7 +13,6 @@ import { cli } from '../../../../cli/cli.js'; import { CommandInfo } from '../../../../cli/CommandInfo.js'; import command from './administrativeunit-remove.js'; import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ADMINISTRATIVEUNIT_REMOVE, () => { const administrativeUnitId = 'fc33aa61-cf0e-46b6-9506-f633347202ab'; @@ -76,16 +75,6 @@ describe(commands.ADMINISTRATIVEUNIT_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.ADMINISTRATIVEUNIT_REMOVE]); - }); - it('removes the specified administrative unit by id without prompting for confirmation', async () => { const deleteRequestStub = sinon.stub(request, 'delete').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/directory/administrativeUnits/${administrativeUnitId}`) { diff --git a/src/m365/entra/commands/administrativeunit/administrativeunit-remove.ts b/src/m365/entra/commands/administrativeunit/administrativeunit-remove.ts index a46c6638c23..35bb9a277dd 100644 --- a/src/m365/entra/commands/administrativeunit/administrativeunit-remove.ts +++ b/src/m365/entra/commands/administrativeunit/administrativeunit-remove.ts @@ -6,8 +6,6 @@ import request, { CliRequestOptions } from "../../../../request.js"; import GraphCommand from "../../../base/GraphCommand.js"; import commands from "../../commands.js"; import { cli } from "../../../../cli/cli.js"; -import aadCommands from '../../aadCommands.js'; - interface CommandArgs { options: Options; @@ -27,10 +25,6 @@ class EntraAdministrativeUnitRemoveCommand extends GraphCommand { return 'Removes an administrative unit'; } - public alias(): string[] | undefined { - return [aadCommands.ADMINISTRATIVEUNIT_REMOVE]; - } - constructor() { super(); @@ -90,8 +84,6 @@ class EntraAdministrativeUnitRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.ADMINISTRATIVEUNIT_REMOVE, commands.ADMINISTRATIVEUNIT_REMOVE); - const removeAdministrativeUnit = async (): Promise => { try { let administrativeUnitId = args.options.id; diff --git a/src/m365/entra/commands/app/app-add.spec.ts b/src/m365/entra/commands/app/app-add.spec.ts index 9b26f9275e3..cbc0f83a0bf 100644 --- a/src/m365/entra/commands/app/app-add.spec.ts +++ b/src/m365/entra/commands/app/app-add.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-add.js'; import * as mocks from './app-add.mock.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_ADD, () => { @@ -204,16 +203,6 @@ describe(commands.APP_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_ADD, commands.APPREGISTRATION_ADD]); - }); - it('creates Microsoft Entra app reg with just the name', async () => { sinon.stub(request, 'get').rejects('Issues GET request'); sinon.stub(request, 'patch').rejects('Issued PATCH request'); diff --git a/src/m365/entra/commands/app/app-add.ts b/src/m365/entra/commands/app/app-add.ts index 2aa503d9d97..30c977e28f2 100644 --- a/src/m365/entra/commands/app/app-add.ts +++ b/src/m365/entra/commands/app/app-add.ts @@ -8,9 +8,38 @@ import { accessToken } from '../../../../utils/accessToken.js'; import { AppCreationOptions, AppInfo, entraApp } from '../../../../utils/entraApp.js'; import GraphCommand from '../../../base/GraphCommand.js'; import { M365RcJson } from '../../../base/M365RcJson.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; +interface ServicePrincipalInfo { + appId: string; + appRoles: { id: string; value: string; }[]; + id: string; + oauth2PermissionScopes: { id: string; value: string; }[]; + servicePrincipalNames: string[]; +} + +interface RequiredResourceAccess { + resourceAppId: string; + resourceAccess: ResourceAccess[]; +} + +interface ResourceAccess { + id: string; + type: string; +} + +interface AppInfo { + appId: string; + // objectId + id: string; + tenantId: string; + secrets?: { + displayName: string; + value: string; + }[]; + requiredResourceAccess: RequiredResourceAccess[]; +} + interface CommandArgs { options: Options; } @@ -41,10 +70,6 @@ class EntraAppAddCommand extends GraphCommand { return 'Creates new Entra app registration'; } - public alias(): string[] | undefined { - return [aadCommands.APP_ADD, commands.APPREGISTRATION_ADD]; - } - constructor() { super(); @@ -211,8 +236,6 @@ class EntraAppAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_ADD, commands.APP_ADD); - if (!args.options.name && this.manifest) { args.options.name = this.manifest.name; } diff --git a/src/m365/entra/commands/app/app-get.spec.ts b/src/m365/entra/commands/app/app-get.spec.ts index 50a93894b01..5147ec30235 100644 --- a/src/m365/entra/commands/app/app-get.spec.ts +++ b/src/m365/entra/commands/app/app-get.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-get.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_GET, () => { let log: string[]; @@ -71,16 +70,6 @@ describe(commands.APP_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_GET, commands.APPREGISTRATION_GET]); - }); - it('handles error when the app specified with the appId not found', async () => { sinon.stub(request, 'get').callsFake(async opts => { if (opts.url === `https://graph.microsoft.com/v1.0/myorganization/applications?$filter=appId eq '9b1b1e42-794b-4c71-93ac-5ed92488b67f'&$select=id`) { diff --git a/src/m365/entra/commands/app/app-get.ts b/src/m365/entra/commands/app/app-get.ts index 969a5849d0f..d4b9be64cec 100644 --- a/src/m365/entra/commands/app/app-get.ts +++ b/src/m365/entra/commands/app/app-get.ts @@ -9,7 +9,6 @@ import GraphCommand from '../../../base/GraphCommand.js'; import { M365RcJson } from '../../../base/M365RcJson.js'; import commands from '../../commands.js'; import { cli } from '../../../../cli/cli.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -31,10 +30,6 @@ class EntraAppGetCommand extends GraphCommand { return 'Gets an Entra app registration'; } - public alias(): string[] | undefined { - return [aadCommands.APP_GET, commands.APPREGISTRATION_GET]; - } - constructor() { super(); @@ -84,8 +79,6 @@ class EntraAppGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_GET, commands.APP_GET); - try { const appObjectId = await this.getAppObjectId(args); const appInfo = await this.getAppInfo(appObjectId); diff --git a/src/m365/entra/commands/app/app-list.spec.ts b/src/m365/entra/commands/app/app-list.spec.ts index cf858293c48..e94f74a31d0 100644 --- a/src/m365/entra/commands/app/app-list.spec.ts +++ b/src/m365/entra/commands/app/app-list.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_LIST, () => { let log: string[]; @@ -60,16 +59,6 @@ describe(commands.APP_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_LIST, commands.APPREGISTRATION_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['appId', 'id', 'displayName', 'signInAudience']); }); diff --git a/src/m365/entra/commands/app/app-list.ts b/src/m365/entra/commands/app/app-list.ts index dd1c5fd9223..24d920ee920 100644 --- a/src/m365/entra/commands/app/app-list.ts +++ b/src/m365/entra/commands/app/app-list.ts @@ -3,7 +3,6 @@ import { Logger } from '../../../../cli/Logger.js'; import { odata } from "../../../../utils/odata.js"; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; class EntraAppListCommand extends GraphCommand { public get name(): string { @@ -14,17 +13,11 @@ class EntraAppListCommand extends GraphCommand { return 'Retrieves a list of Entra app registrations'; } - public alias(): string[] | undefined { - return [aadCommands.APP_LIST, commands.APPREGISTRATION_LIST]; - } - public defaultProperties(): string[] | undefined { return ['appId', 'id', 'displayName', "signInAudience"]; } public async commandAction(logger: Logger): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_LIST, commands.APP_LIST); - try { const results = await odata.getAllItems(`${this.resource}/v1.0/applications`); await logger.log(results); diff --git a/src/m365/entra/commands/app/app-permission-add.spec.ts b/src/m365/entra/commands/app/app-permission-add.spec.ts index 46ae98ab85e..7967484fe47 100644 --- a/src/m365/entra/commands/app/app-permission-add.spec.ts +++ b/src/m365/entra/commands/app/app-permission-add.spec.ts @@ -15,7 +15,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-permission-add.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_PERMISSION_ADD, () => { const appId = '9c79078b-815e-4a3e-bb80-2aaf2d9e9b3d'; @@ -86,16 +85,6 @@ describe(commands.APP_PERMISSION_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_PERMISSION_ADD, commands.APPREGISTRATION_PERMISSION_ADD]); - }); - it('adds application permissions to app specified by appObjectId without granting admin consent', async () => { sinon.stub(odata, 'getAllItems').callsFake(async (url: string) => { switch (url) { diff --git a/src/m365/entra/commands/app/app-permission-add.ts b/src/m365/entra/commands/app/app-permission-add.ts index 849498fdefc..68820520720 100644 --- a/src/m365/entra/commands/app/app-permission-add.ts +++ b/src/m365/entra/commands/app/app-permission-add.ts @@ -6,7 +6,6 @@ import commands from "../../commands.js"; import request, { CliRequestOptions } from "../../../../request.js"; import { Logger } from "../../../../cli/Logger.js"; import { validation } from "../../../../utils/validation.js"; -import aadCommands from "../../aadCommands.js"; import { formatting } from "../../../../utils/formatting.js"; import { cli } from "../../../../cli/cli.js"; @@ -43,10 +42,6 @@ class EntraAppPermissionAddCommand extends GraphCommand { return 'Adds the specified application and/or delegated permissions to a specified Microsoft Entra app'; } - public alias(): string[] | undefined { - return [aadCommands.APP_PERMISSION_ADD, commands.APPREGISTRATION_PERMISSION_ADD]; - } - constructor() { super(); @@ -105,8 +100,6 @@ class EntraAppPermissionAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_PERMISSION_ADD, commands.APP_PERMISSION_ADD); - try { const appObject = await this.getAppObject(args.options); const servicePrincipals = await this.getServicePrincipals(); diff --git a/src/m365/entra/commands/app/app-remove.spec.ts b/src/m365/entra/commands/app/app-remove.spec.ts index 4f57cd50a6b..5e564df95b4 100644 --- a/src/m365/entra/commands/app/app-remove.spec.ts +++ b/src/m365/entra/commands/app/app-remove.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-remove.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_REMOVE, () => { let log: string[]; @@ -100,16 +99,6 @@ describe(commands.APP_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_REMOVE, commands.APPREGISTRATION_REMOVE]); - }); - it('fails validation if appId and name specified', async () => { sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => { if (settingName === settingsNames.prompt) { diff --git a/src/m365/entra/commands/app/app-remove.ts b/src/m365/entra/commands/app/app-remove.ts index 05987b6d612..e32424318f5 100644 --- a/src/m365/entra/commands/app/app-remove.ts +++ b/src/m365/entra/commands/app/app-remove.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { formatting } from '../../../../utils/formatting.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -28,10 +27,6 @@ class EntraAppRemoveCommand extends GraphCommand { return 'Removes an Entra app registration'; } - public alias(): string[] | undefined { - return [aadCommands.APP_REMOVE, commands.APPREGISTRATION_REMOVE]; - } - constructor() { super(); @@ -82,8 +77,6 @@ class EntraAppRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_REMOVE, commands.APP_REMOVE); - const deleteApp = async (): Promise => { try { const objectId = await this.getObjectId(args, logger); diff --git a/src/m365/entra/commands/app/app-role-add.spec.ts b/src/m365/entra/commands/app/app-role-add.spec.ts index 8754d96f1d7..d9ee59dc53e 100644 --- a/src/m365/entra/commands/app/app-role-add.spec.ts +++ b/src/m365/entra/commands/app/app-role-add.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-role-add.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_ROLE_ADD, () => { let log: string[]; @@ -66,16 +65,6 @@ describe(commands.APP_ROLE_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_ROLE_ADD, commands.APPREGISTRATION_ROLE_ADD]); - }); - it('creates app role for the specified appId, app has no roles', async () => { sinon.stub(request, 'get').callsFake(async opts => { if (opts.url === `https://graph.microsoft.com/v1.0/myorganization/applications?$filter=appId eq 'bc724b77-da87-43a9-b385-6ebaaf969db8'&$select=id`) { diff --git a/src/m365/entra/commands/app/app-role-add.ts b/src/m365/entra/commands/app/app-role-add.ts index e1211b8a714..c9929f8a808 100644 --- a/src/m365/entra/commands/app/app-role-add.ts +++ b/src/m365/entra/commands/app/app-role-add.ts @@ -6,7 +6,6 @@ import { formatting } from '../../../../utils/formatting.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { cli } from '../../../../cli/cli.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -44,10 +43,6 @@ class EntraAppRoleAddCommand extends GraphCommand { return 'Adds role to the specified Entra app registration'; } - public alias(): string[] | undefined { - return [aadCommands.APP_ROLE_ADD, commands.APPREGISTRATION_ROLE_ADD]; - } - constructor() { super(); @@ -112,8 +107,6 @@ class EntraAppRoleAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_ADD, commands.APP_ROLE_ADD); - try { const appId = await this.getAppObjectId(args, logger); const appInfo = await this.getAppInfo(appId, logger); diff --git a/src/m365/entra/commands/app/app-role-list.spec.ts b/src/m365/entra/commands/app/app-role-list.spec.ts index da55924e438..7c8fc10cb2c 100644 --- a/src/m365/entra/commands/app/app-role-list.spec.ts +++ b/src/m365/entra/commands/app/app-role-list.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-role-list.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_ROLE_LIST, () => { let log: string[]; @@ -68,16 +67,6 @@ describe(commands.APP_ROLE_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_ROLE_LIST, commands.APPREGISTRATION_ROLE_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['displayName', 'description', 'id']); }); diff --git a/src/m365/entra/commands/app/app-role-list.ts b/src/m365/entra/commands/app/app-role-list.ts index 594ec364a76..bd2660955cd 100644 --- a/src/m365/entra/commands/app/app-role-list.ts +++ b/src/m365/entra/commands/app/app-role-list.ts @@ -7,7 +7,6 @@ import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { cli } from '../../../../cli/cli.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -28,10 +27,6 @@ class EntraAppRoleListCommand extends GraphCommand { return 'Gets Entra app registration roles'; } - public alias(): string[] | undefined { - return [aadCommands.APP_ROLE_LIST, commands.APPREGISTRATION_ROLE_LIST]; - } - constructor() { super(); @@ -67,8 +62,6 @@ class EntraAppRoleListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_LIST, commands.APP_ROLE_LIST); - try { const objectId = await this.getAppObjectId(args, logger); const appRoles = await odata.getAllItems(`${this.resource}/v1.0/myorganization/applications/${objectId}/appRoles`); diff --git a/src/m365/entra/commands/app/app-role-remove.spec.ts b/src/m365/entra/commands/app/app-role-remove.spec.ts index 649a6f8bb9e..ff93f72ea01 100644 --- a/src/m365/entra/commands/app/app-role-remove.spec.ts +++ b/src/m365/entra/commands/app/app-role-remove.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-role-remove.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_ROLE_REMOVE, () => { let log: string[]; @@ -74,16 +73,6 @@ describe(commands.APP_ROLE_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_ROLE_REMOVE, commands.APPREGISTRATION_ROLE_REMOVE]); - }); - it('deletes an app role when the role is in enabled state and valid appObjectId, role claim and --force option specified', async () => { sinon.stub(request, 'get').callsFake(async opts => { if (opts.url === 'https://graph.microsoft.com/v1.0/myorganization/applications/5b31c38c-2584-42f0-aa47-657fb3a84230?$select=id,appRoles') { diff --git a/src/m365/entra/commands/app/app-role-remove.ts b/src/m365/entra/commands/app/app-role-remove.ts index 258b09bfa86..b8796f2c13f 100644 --- a/src/m365/entra/commands/app/app-role-remove.ts +++ b/src/m365/entra/commands/app/app-role-remove.ts @@ -7,7 +7,6 @@ import { formatting } from "../../../../utils/formatting.js"; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from "../../aadCommands.js"; interface CommandArgs { options: Options; @@ -31,10 +30,6 @@ class EntraAppRoleRemoveCommand extends GraphCommand { return 'Removes role from the specified Entra app registration'; } - public alias(): string[] | undefined { - return [aadCommands.APP_ROLE_REMOVE, commands.APPREGISTRATION_ROLE_REMOVE]; - } - constructor() { super(); @@ -91,8 +86,6 @@ class EntraAppRoleRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_REMOVE, commands.APP_ROLE_REMOVE); - const deleteAppRole = async (): Promise => { try { await this.processAppRoleDelete(logger, args); diff --git a/src/m365/entra/commands/app/app-set.spec.ts b/src/m365/entra/commands/app/app-set.spec.ts index 88612d755f9..3936f23a3d6 100644 --- a/src/m365/entra/commands/app/app-set.spec.ts +++ b/src/m365/entra/commands/app/app-set.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './app-set.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APP_SET, () => { @@ -74,16 +73,6 @@ describe(commands.APP_SET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APP_SET, commands.APPREGISTRATION_SET]); - }); - it('updates uris for the specified appId', async () => { sinon.stub(request, 'get').callsFake(async opts => { if (opts.url === `https://graph.microsoft.com/v1.0/myorganization/applications?$filter=appId eq 'bc724b77-da87-43a9-b385-6ebaaf969db8'&$select=id`) { diff --git a/src/m365/entra/commands/app/app-set.ts b/src/m365/entra/commands/app/app-set.ts index 070f6b9302d..21fcc119f72 100644 --- a/src/m365/entra/commands/app/app-set.ts +++ b/src/m365/entra/commands/app/app-set.ts @@ -7,7 +7,6 @@ import { formatting } from '../../../../utils/formatting.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { cli } from '../../../../cli/cli.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -38,10 +37,6 @@ class EntraAppSetCommand extends GraphCommand { return 'Updates Entra app registration'; } - public alias(): string[] | undefined { - return [aadCommands.APP_SET, commands.APPREGISTRATION_SET]; - } - constructor() { super(); @@ -130,8 +125,6 @@ class EntraAppSetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APP_SET, commands.APP_SET); - try { let objectId = await this.getAppObjectId(args, logger); objectId = await this.configureUri(args, objectId, logger); diff --git a/src/m365/entra/commands/approleassignment/approleassignment-add.spec.ts b/src/m365/entra/commands/approleassignment/approleassignment-add.spec.ts index e0838ad535d..48b06f262e3 100644 --- a/src/m365/entra/commands/approleassignment/approleassignment-add.spec.ts +++ b/src/m365/entra/commands/approleassignment/approleassignment-add.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './approleassignment-add.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APPROLEASSIGNMENT_ADD, () => { let log: string[]; @@ -89,16 +88,6 @@ describe(commands.APPROLEASSIGNMENT_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APPROLEASSIGNMENT_ADD]); - }); - it('sets App Role assignments for service principal with specified appDisplayName', async () => { getRequestStub(); postRequestStub(); diff --git a/src/m365/entra/commands/approleassignment/approleassignment-add.ts b/src/m365/entra/commands/approleassignment/approleassignment-add.ts index c2cae66c315..b48eb8e930b 100644 --- a/src/m365/entra/commands/approleassignment/approleassignment-add.ts +++ b/src/m365/entra/commands/approleassignment/approleassignment-add.ts @@ -8,7 +8,6 @@ import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { ServicePrincipal } from '@microsoft/microsoft-graph-types'; import { cli } from '../../../../cli/cli.js'; -import aadCommands from '../../aadCommands.js'; interface AppRole { objectId: string; @@ -37,10 +36,6 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand { return 'Adds service principal permissions also known as scopes and app role assignments for specified Microsoft Entra application registration'; } - public alias(): string[] | undefined { - return [aadCommands.APPROLEASSIGNMENT_ADD]; - } - constructor() { super(); @@ -102,8 +97,6 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APPROLEASSIGNMENT_ADD, commands.APPROLEASSIGNMENT_ADD); - let objectId: string = ''; let queryFilter: string = ''; if (args.options.appId) { diff --git a/src/m365/entra/commands/approleassignment/approleassignment-list.spec.ts b/src/m365/entra/commands/approleassignment/approleassignment-list.spec.ts index c8227378468..c25ff909230 100644 --- a/src/m365/entra/commands/approleassignment/approleassignment-list.spec.ts +++ b/src/m365/entra/commands/approleassignment/approleassignment-list.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './approleassignment-list.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; class ServicePrincipalAppRoleAssignments { private static AppRoleAssignments: any = { @@ -482,16 +481,6 @@ describe(commands.APPROLEASSIGNMENT_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APPROLEASSIGNMENT_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['resourceDisplayName', 'roleName']); }); diff --git a/src/m365/entra/commands/approleassignment/approleassignment-list.ts b/src/m365/entra/commands/approleassignment/approleassignment-list.ts index 60d702996a8..3d82c94fac6 100644 --- a/src/m365/entra/commands/approleassignment/approleassignment-list.ts +++ b/src/m365/entra/commands/approleassignment/approleassignment-list.ts @@ -6,7 +6,6 @@ import { formatting } from '../../../../utils/formatting.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -27,10 +26,6 @@ class EntraAppRoleAssignmentListCommand extends GraphCommand { return 'Lists app role assignments for the specified application registration'; } - public alias(): string[] | undefined { - return [aadCommands.APPROLEASSIGNMENT_LIST]; - } - constructor() { super(); @@ -89,8 +84,6 @@ class EntraAppRoleAssignmentListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APPROLEASSIGNMENT_LIST, commands.APPROLEASSIGNMENT_LIST); - try { const spAppRoleAssignments = await this.getAppRoleAssignments(args.options); // the role assignment has an appRoleId but no name. To get the name, diff --git a/src/m365/entra/commands/approleassignment/approleassignment-remove.spec.ts b/src/m365/entra/commands/approleassignment/approleassignment-remove.spec.ts index 43c8a605b40..5cbe52b11af 100644 --- a/src/m365/entra/commands/approleassignment/approleassignment-remove.spec.ts +++ b/src/m365/entra/commands/approleassignment/approleassignment-remove.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './approleassignment-remove.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.APPROLEASSIGNMENT_REMOVE, () => { let log: string[]; @@ -92,16 +91,6 @@ describe(commands.APPROLEASSIGNMENT_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.APPROLEASSIGNMENT_REMOVE]); - }); - it('prompts before removing the app role assignment when force option not passed', async () => { await command.action(logger, { options: { appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'SharePoint', scope: 'Sites.Read.All' } }); diff --git a/src/m365/entra/commands/approleassignment/approleassignment-remove.ts b/src/m365/entra/commands/approleassignment/approleassignment-remove.ts index c1619daf51b..eb67e31fcdb 100644 --- a/src/m365/entra/commands/approleassignment/approleassignment-remove.ts +++ b/src/m365/entra/commands/approleassignment/approleassignment-remove.ts @@ -8,7 +8,6 @@ import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { AppRole, AppRoleAssignment, ServicePrincipal } from '@microsoft/microsoft-graph-types'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -32,10 +31,6 @@ class EntraAppRoleAssignmentRemoveCommand extends GraphCommand { return 'Deletes an app role assignment for the specified Entra Application Registration'; } - public alias(): string[] | undefined { - return [aadCommands.APPROLEASSIGNMENT_REMOVE]; - } - constructor() { super(); @@ -101,8 +96,6 @@ class EntraAppRoleAssignmentRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.APPROLEASSIGNMENT_REMOVE, commands.APPROLEASSIGNMENT_REMOVE); - const removeAppRoleAssignment = async (): Promise => { let sp: ServicePrincipal; // get the service principal associated with the appId diff --git a/src/m365/entra/commands/enterpriseapp/enterpriseapp-add.spec.ts b/src/m365/entra/commands/enterpriseapp/enterpriseapp-add.spec.ts index b6810d693cd..009558afa22 100644 --- a/src/m365/entra/commands/enterpriseapp/enterpriseapp-add.spec.ts +++ b/src/m365/entra/commands/enterpriseapp/enterpriseapp-add.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './enterpriseapp-add.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ENTERPRISEAPP_ADD, () => { let log: string[]; @@ -69,16 +68,6 @@ describe(commands.ENTERPRISEAPP_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.SP_ADD, commands.SP_ADD]); - }); - it('fails validation if neither the id, displayName, nor objectId option specified', async () => { sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => { if (settingName === settingsNames.prompt) { diff --git a/src/m365/entra/commands/enterpriseapp/enterpriseapp-add.ts b/src/m365/entra/commands/enterpriseapp/enterpriseapp-add.ts index aa0cdab113e..f732ea1a64a 100644 --- a/src/m365/entra/commands/enterpriseapp/enterpriseapp-add.ts +++ b/src/m365/entra/commands/enterpriseapp/enterpriseapp-add.ts @@ -6,7 +6,6 @@ import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { cli } from '../../../../cli/cli.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -27,10 +26,6 @@ class EntraEnterpriseAppAddCommand extends GraphCommand { return 'Creates an enterprise application (or service principal) for a registered Entra app'; } - public alias(): string[] | undefined { - return [aadCommands.SP_ADD, commands.SP_ADD]; - } - constructor() { super(); @@ -123,8 +118,6 @@ class EntraEnterpriseAppAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.SP_ADD, commands.SP_ADD); - try { const appId = await this.getAppId(args); diff --git a/src/m365/entra/commands/enterpriseapp/enterpriseapp-get.spec.ts b/src/m365/entra/commands/enterpriseapp/enterpriseapp-get.spec.ts index e5664bbfe2a..a95f812c6d5 100644 --- a/src/m365/entra/commands/enterpriseapp/enterpriseapp-get.spec.ts +++ b/src/m365/entra/commands/enterpriseapp/enterpriseapp-get.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './enterpriseapp-get.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ENTERPRISEAPP_GET, () => { let log: string[]; @@ -83,16 +82,6 @@ describe(commands.ENTERPRISEAPP_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.SP_GET, commands.SP_GET]); - }); - it('retrieves information about the specified enterprise application using its display name', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if ((opts.url as string).indexOf(`/v1.0/servicePrincipals?$filter=displayName eq `) > -1) { diff --git a/src/m365/entra/commands/enterpriseapp/enterpriseapp-get.ts b/src/m365/entra/commands/enterpriseapp/enterpriseapp-get.ts index e159fbee368..0fe94b35b4a 100644 --- a/src/m365/entra/commands/enterpriseapp/enterpriseapp-get.ts +++ b/src/m365/entra/commands/enterpriseapp/enterpriseapp-get.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { formatting } from '../../../../utils/formatting.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -27,10 +26,6 @@ class EntraEnterpriseAppGetCommand extends GraphCommand { return 'Gets information about an Enterprise Application'; } - public alias(): string[] | undefined { - return [aadCommands.SP_GET, commands.SP_GET]; - } - constructor() { super(); @@ -123,8 +118,6 @@ class EntraEnterpriseAppGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.SP_GET, commands.SP_GET); - if (this.verbose) { await logger.logToStderr(`Retrieving enterprise application information...`); } diff --git a/src/m365/entra/commands/enterpriseapp/enterpriseapp-list.spec.ts b/src/m365/entra/commands/enterpriseapp/enterpriseapp-list.spec.ts index 60e23ae9db2..5e9355420f9 100644 --- a/src/m365/entra/commands/enterpriseapp/enterpriseapp-list.spec.ts +++ b/src/m365/entra/commands/enterpriseapp/enterpriseapp-list.spec.ts @@ -9,7 +9,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './enterpriseapp-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.ENTERPRISEAPP_LIST, () => { let log: string[]; @@ -135,16 +134,6 @@ describe(commands.ENTERPRISEAPP_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.SP_LIST, commands.SP_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['appId', 'displayName', 'tag']); }); diff --git a/src/m365/entra/commands/enterpriseapp/enterpriseapp-list.ts b/src/m365/entra/commands/enterpriseapp/enterpriseapp-list.ts index a2547c38260..903518dfe78 100644 --- a/src/m365/entra/commands/enterpriseapp/enterpriseapp-list.ts +++ b/src/m365/entra/commands/enterpriseapp/enterpriseapp-list.ts @@ -2,7 +2,6 @@ import { Logger } from '../../../../cli/Logger.js'; import GlobalOptions from '../../../../GlobalOptions.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -27,10 +26,6 @@ class EntraEnterpriseAppListCommand extends GraphCommand { return 'Lists the enterprise applications (or service principals) in Entra ID'; } - public alias(): string[] | undefined { - return [aadCommands.SP_LIST, commands.SP_LIST]; - } - constructor() { super(); @@ -59,8 +54,6 @@ class EntraEnterpriseAppListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.SP_LIST, commands.SP_LIST); - if (this.verbose) { await logger.logToStderr(`Retrieving enterprise application information...`); } diff --git a/src/m365/entra/commands/group/group-add.spec.ts b/src/m365/entra/commands/group/group-add.spec.ts index eee6c612402..47874bc868d 100644 --- a/src/m365/entra/commands/group/group-add.spec.ts +++ b/src/m365/entra/commands/group/group-add.spec.ts @@ -2,7 +2,6 @@ import assert from 'assert'; import sinon from 'sinon'; import auth from '../../../../Auth.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; import { Logger } from '../../../../cli/Logger.js'; import request from '../../../../request.js'; import { telemetry } from '../../../../telemetry.js'; @@ -223,16 +222,6 @@ describe(commands.GROUP_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUP_ADD]); - }); - it('fails validation if the length of displayName is more than 256 characters', async () => { const displayName = 'lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum'; const actual = await command.validate({ options: { displayName: displayName, type: 'security' } }, commandInfo); diff --git a/src/m365/entra/commands/group/group-add.ts b/src/m365/entra/commands/group/group-add.ts index 70130284397..f20abe55d42 100644 --- a/src/m365/entra/commands/group/group-add.ts +++ b/src/m365/entra/commands/group/group-add.ts @@ -2,7 +2,6 @@ import { Group } from '@microsoft/microsoft-graph-types'; import GlobalOptions from '../../../../GlobalOptions.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; import { validation } from '../../../../utils/validation.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { Logger } from '../../../../cli/Logger.js'; @@ -33,10 +32,6 @@ class EntraGroupAddCommand extends GraphCommand { return 'Creates a Microsoft Entra group'; } - public alias(): string[] | undefined { - return [aadCommands.GROUP_ADD]; - } - public allowUnknownOptions(): boolean | undefined { return true; } diff --git a/src/m365/entra/commands/group/group-get.spec.ts b/src/m365/entra/commands/group/group-get.spec.ts index 04b98462b3c..725c6501aaa 100644 --- a/src/m365/entra/commands/group/group-get.spec.ts +++ b/src/m365/entra/commands/group/group-get.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './group-get.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUP_GET, () => { let log: string[]; @@ -94,16 +93,6 @@ describe(commands.GROUP_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUP_GET]); - }); - it('retrieves information about the specified Microsoft Entra Group by id', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groups/${validId}`) { diff --git a/src/m365/entra/commands/group/group-get.ts b/src/m365/entra/commands/group/group-get.ts index fc2df0c0cc6..c642572d3f1 100644 --- a/src/m365/entra/commands/group/group-get.ts +++ b/src/m365/entra/commands/group/group-get.ts @@ -5,7 +5,6 @@ import { entraGroup } from '../../../../utils/entraGroup.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -25,10 +24,6 @@ class EntraGroupGetCommand extends GraphCommand { return 'Gets information about the specified Entra group'; } - public alias(): string[] | undefined { - return [aadCommands.GROUP_GET]; - } - constructor() { super(); @@ -77,8 +72,6 @@ class EntraGroupGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUP_GET, commands.GROUP_GET); - let group: Group; try { diff --git a/src/m365/entra/commands/group/group-list.spec.ts b/src/m365/entra/commands/group/group-list.spec.ts index 5751651aba1..9eec88ca640 100644 --- a/src/m365/entra/commands/group/group-list.spec.ts +++ b/src/m365/entra/commands/group/group-list.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './group-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUP_LIST, () => { let log: string[]; @@ -65,16 +64,6 @@ describe(commands.GROUP_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUP_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName', 'groupType']); }); diff --git a/src/m365/entra/commands/group/group-list.ts b/src/m365/entra/commands/group/group-list.ts index b113840f31f..ca2f1acdad0 100644 --- a/src/m365/entra/commands/group/group-list.ts +++ b/src/m365/entra/commands/group/group-list.ts @@ -6,7 +6,6 @@ import { CliRequestOptions } from '../../../../request.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -31,10 +30,6 @@ class EntraGroupListCommand extends GraphCommand { return 'Lists all groups defined in Entra ID.'; } - public alias(): string[] | undefined { - return [aadCommands.GROUP_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'displayName', 'groupType']; } @@ -77,8 +72,6 @@ class EntraGroupListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUP_LIST, commands.GROUP_LIST); - try { let requestUrl: string = `${this.resource}/v1.0/groups`; let useConsistencyLevelHeader = false; diff --git a/src/m365/entra/commands/group/group-member-list.spec.ts b/src/m365/entra/commands/group/group-member-list.spec.ts index 78eea44d419..708daff7235 100644 --- a/src/m365/entra/commands/group/group-member-list.spec.ts +++ b/src/m365/entra/commands/group/group-member-list.spec.ts @@ -74,16 +74,6 @@ describe(commands.GROUP_MEMBER_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUP_USER_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName', 'userPrincipalName', 'roles']); }); diff --git a/src/m365/entra/commands/group/group-member-list.ts b/src/m365/entra/commands/group/group-member-list.ts index cca4061b1c3..33c61a25a29 100644 --- a/src/m365/entra/commands/group/group-member-list.ts +++ b/src/m365/entra/commands/group/group-member-list.ts @@ -7,7 +7,6 @@ import { odata } from '../../../../utils/odata.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; diff --git a/src/m365/entra/commands/group/group-remove.spec.ts b/src/m365/entra/commands/group/group-remove.spec.ts index aed1f7eea19..5368f945021 100644 --- a/src/m365/entra/commands/group/group-remove.spec.ts +++ b/src/m365/entra/commands/group/group-remove.spec.ts @@ -15,7 +15,6 @@ import { CommandInfo } from '../../../../cli/CommandInfo.js'; import command from './group-remove.js'; import { settingsNames } from '../../../../settingsNames.js'; import { formatting } from '../../../../utils/formatting.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUP_REMOVE, () => { const groupId = '2c1ba4c4-cd9b-4417-832f-92a34bc34b2a'; @@ -73,16 +72,6 @@ describe(commands.GROUP_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUP_REMOVE]); - }); - it('removes the specified group by id without prompting for confirmation', async () => { const deleteRequestStub = sinon.stub(request, 'delete').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groups/${groupId}`) { diff --git a/src/m365/entra/commands/group/group-remove.ts b/src/m365/entra/commands/group/group-remove.ts index 7b05dceb479..3f133610996 100644 --- a/src/m365/entra/commands/group/group-remove.ts +++ b/src/m365/entra/commands/group/group-remove.ts @@ -6,7 +6,6 @@ import commands from '../../commands.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; import { validation } from '../../../../utils/validation.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -27,10 +26,6 @@ class EntraGroupRemoveCommand extends GraphCommand { return 'Removes an Entra group'; } - public alias(): string[] | undefined { - return [aadCommands.GROUP_REMOVE]; - } - constructor() { super(); @@ -90,8 +85,6 @@ class EntraGroupRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUP_REMOVE, commands.GROUP_REMOVE); - const removeGroup = async (): Promise => { if (this.verbose) { await logger.logToStderr(`Removing group ${args.options.id || args.options.displayName}...`); diff --git a/src/m365/entra/commands/groupsetting/groupsetting-add.spec.ts b/src/m365/entra/commands/groupsetting/groupsetting-add.spec.ts index ee66f1901e3..0b9756407d2 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-add.spec.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-add.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './groupsetting-add.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUPSETTING_ADD, () => { let log: string[]; @@ -66,16 +65,6 @@ describe(commands.GROUPSETTING_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUPSETTING_ADD]); - }); - it('adds group setting using default template setting values', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groupSettingTemplates/62375ab9-6b52-47ed-826b-58e47e0e304b`) { diff --git a/src/m365/entra/commands/groupsetting/groupsetting-add.ts b/src/m365/entra/commands/groupsetting/groupsetting-add.ts index 66b7f62c01d..325b8439bfb 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-add.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-add.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -24,10 +23,6 @@ class EntraGroupSettingAddCommand extends GraphCommand { return 'Creates a group setting'; } - public alias(): string[] | undefined { - return [aadCommands.GROUPSETTING_ADD]; - } - constructor() { super(); @@ -60,8 +55,6 @@ class EntraGroupSettingAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUPSETTING_ADD, commands.GROUPSETTING_ADD); - if (this.verbose) { await logger.logToStderr(`Retrieving group setting template with id '${args.options.templateId}'...`); } diff --git a/src/m365/entra/commands/groupsetting/groupsetting-get.spec.ts b/src/m365/entra/commands/groupsetting/groupsetting-get.spec.ts index b032cad31e4..fbc6cdf579d 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-get.spec.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-get.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './groupsetting-get.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUPSETTING_GET, () => { let log: string[]; @@ -64,16 +63,6 @@ describe(commands.GROUPSETTING_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUPSETTING_GET]); - }); - it('retrieves information about the specified Group Setting', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groupSettings/1caf7dcd-7e83-4c3a-94f7-932a1299c844`) { diff --git a/src/m365/entra/commands/groupsetting/groupsetting-get.ts b/src/m365/entra/commands/groupsetting/groupsetting-get.ts index e38a13ce2ac..95305c50ae8 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-get.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-get.ts @@ -3,7 +3,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -23,10 +22,6 @@ class EntraGroupSettingGetCommand extends GraphCommand { return 'Gets information about the particular group setting'; } - public alias(): string[] | undefined { - return [aadCommands.GROUPSETTING_GET]; - } - constructor() { super(); @@ -55,8 +50,6 @@ class EntraGroupSettingGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUPSETTING_GET, commands.GROUPSETTING_GET); - try { const requestOptions: CliRequestOptions = { url: `${this.resource}/v1.0/groupSettings/${args.options.id}`, diff --git a/src/m365/entra/commands/groupsetting/groupsetting-list.spec.ts b/src/m365/entra/commands/groupsetting/groupsetting-list.spec.ts index 6fc1cec91f5..1ddfe94ef5f 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-list.spec.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-list.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './groupsetting-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUPSETTING_LIST, () => { let log: string[]; @@ -61,16 +60,6 @@ describe(commands.GROUPSETTING_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUPSETTING_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName']); }); diff --git a/src/m365/entra/commands/groupsetting/groupsetting-list.ts b/src/m365/entra/commands/groupsetting/groupsetting-list.ts index 47a090d5e7c..eeab4ae3ebd 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-list.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-list.ts @@ -3,7 +3,6 @@ import { Logger } from '../../../../cli/Logger.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; class EntraGroupSettingListCommand extends GraphCommand { public get name(): string { @@ -14,17 +13,11 @@ class EntraGroupSettingListCommand extends GraphCommand { return 'Lists Entra group settings'; } - public alias(): string[] | undefined { - return [aadCommands.GROUPSETTING_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'displayName']; } public async commandAction(logger: Logger): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUPSETTING_LIST, commands.GROUPSETTING_LIST); - try { const groupSettings = await odata.getAllItems(`${this.resource}/v1.0/groupSettings`); await logger.log(groupSettings); diff --git a/src/m365/entra/commands/groupsetting/groupsetting-remove.spec.ts b/src/m365/entra/commands/groupsetting/groupsetting-remove.spec.ts index da66313ff97..7f616096824 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-remove.spec.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-remove.spec.ts @@ -13,7 +13,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './groupsetting-remove.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUPSETTING_REMOVE, () => { let log: string[]; @@ -73,16 +72,6 @@ describe(commands.GROUPSETTING_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUPSETTING_REMOVE]); - }); - it('removes the specified group setting without prompting for confirmation when force option specified', async () => { const deleteRequestStub = sinon.stub(request, 'delete').callsFake(async (opts) => { if (opts.url === 'https://graph.microsoft.com/v1.0/groupSettings/28beab62-7540-4db1-a23f-29a6018a3848') { diff --git a/src/m365/entra/commands/groupsetting/groupsetting-remove.ts b/src/m365/entra/commands/groupsetting/groupsetting-remove.ts index d19453c86e2..7f89a7a3d03 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-remove.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-remove.ts @@ -4,7 +4,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -25,10 +24,6 @@ class EntraGroupSettingRemoveCommand extends GraphCommand { return 'Removes the particular group setting'; } - public alias(): string[] | undefined { - return [aadCommands.GROUPSETTING_REMOVE]; - } - constructor() { super(); @@ -69,8 +64,6 @@ class EntraGroupSettingRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUPSETTING_REMOVE, commands.GROUPSETTING_REMOVE); - const removeGroupSetting = async (): Promise => { if (this.verbose) { await logger.logToStderr(`Removing group setting: ${args.options.id}...`); diff --git a/src/m365/entra/commands/groupsetting/groupsetting-set.spec.ts b/src/m365/entra/commands/groupsetting/groupsetting-set.spec.ts index 2c8fd4eabfd..9383f71552f 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-set.spec.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-set.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './groupsetting-set.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUPSETTING_SET, () => { let log: string[]; @@ -66,16 +65,6 @@ describe(commands.GROUPSETTING_SET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUPSETTING_SET]); - }); - it('updates group setting', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groupSettings/c391b57d-5783-4c53-9236-cefb5c6ef323`) { diff --git a/src/m365/entra/commands/groupsetting/groupsetting-set.ts b/src/m365/entra/commands/groupsetting/groupsetting-set.ts index b192f0132c8..78be6f8c18d 100644 --- a/src/m365/entra/commands/groupsetting/groupsetting-set.ts +++ b/src/m365/entra/commands/groupsetting/groupsetting-set.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -24,10 +23,6 @@ class EntraGroupSettingSetCommand extends GraphCommand { return 'Updates the particular group setting'; } - public alias(): string[] | undefined { - return [aadCommands.GROUPSETTING_SET]; - } - public allowUnknownOptions(): boolean | undefined { return true; } @@ -60,8 +55,6 @@ class EntraGroupSettingSetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUPSETTING_SET, commands.GROUPSETTING_SET); - if (this.verbose) { await logger.logToStderr(`Retrieving group setting with id '${args.options.id}'...`); } diff --git a/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.spec.ts b/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.spec.ts index 02c2dab2b77..bac4967f757 100644 --- a/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.spec.ts +++ b/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './groupsettingtemplate-get.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUPSETTINGTEMPLATE_GET, () => { let log: string[]; @@ -67,16 +66,6 @@ describe(commands.GROUPSETTINGTEMPLATE_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUPSETTINGTEMPLATE_GET]); - }); - it('retrieves group setting template by id', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groupSettingTemplates`) { diff --git a/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.ts b/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.ts index d7f8f624864..13646081cd8 100644 --- a/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.ts +++ b/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.ts @@ -5,7 +5,6 @@ import { odata } from '../../../../utils/odata.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -25,10 +24,6 @@ class EntraGroupSettingTemplateGetCommand extends GraphCommand { return 'Gets information about the specified Entra group settings template'; } - public alias(): string[] | undefined { - return [aadCommands.GROUPSETTINGTEMPLATE_GET]; - } - constructor() { super(); @@ -76,8 +71,6 @@ class EntraGroupSettingTemplateGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUPSETTINGTEMPLATE_GET, commands.GROUPSETTINGTEMPLATE_GET); - try { const templates = await odata.getAllItems(`${this.resource}/v1.0/groupSettingTemplates`); diff --git a/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.spec.ts b/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.spec.ts index fae3e1ef34c..6ae07d80be5 100644 --- a/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.spec.ts +++ b/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './groupsettingtemplate-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUPSETTINGTEMPLATE_LIST, () => { let log: string[]; @@ -61,16 +60,6 @@ describe(commands.GROUPSETTINGTEMPLATE_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.GROUPSETTINGTEMPLATE_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName']); }); diff --git a/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.ts b/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.ts index 3372562e795..301d0654cd6 100644 --- a/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.ts +++ b/src/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.ts @@ -3,7 +3,6 @@ import { Logger } from '../../../../cli/Logger.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; class EntraGroupSettingTemplateListCommand extends GraphCommand { public get name(): string { @@ -14,17 +13,11 @@ class EntraGroupSettingTemplateListCommand extends GraphCommand { return 'Lists Entra group settings templates'; } - public alias(): string[] | undefined { - return [aadCommands.GROUPSETTINGTEMPLATE_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'displayName']; } public async commandAction(logger: Logger): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUPSETTINGTEMPLATE_LIST, commands.GROUPSETTINGTEMPLATE_LIST); - try { const templates = await odata.getAllItems(`${this.resource}/v1.0/groupSettingTemplates`); await logger.log(templates); diff --git a/src/m365/entra/commands/license/license-list.spec.ts b/src/m365/entra/commands/license/license-list.spec.ts index 3352e6afe6a..0209d51c014 100644 --- a/src/m365/entra/commands/license/license-list.spec.ts +++ b/src/m365/entra/commands/license/license-list.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './license-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.LICENSE_LIST, () => { //#region Mocked Responses @@ -110,16 +109,6 @@ describe(commands.LICENSE_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.LICENSE_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'skuId', 'skuPartNumber']); }); diff --git a/src/m365/entra/commands/license/license-list.ts b/src/m365/entra/commands/license/license-list.ts index 15557a9461f..b3bdcc9dfba 100644 --- a/src/m365/entra/commands/license/license-list.ts +++ b/src/m365/entra/commands/license/license-list.ts @@ -1,7 +1,6 @@ import { Logger } from '../../../../cli/Logger.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; class EntraLicenseListCommand extends GraphCommand { @@ -13,17 +12,11 @@ class EntraLicenseListCommand extends GraphCommand { return 'Lists commercial subscriptions that an organization has acquired'; } - public alias(): string[] | undefined { - return [aadCommands.LICENSE_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'skuId', 'skuPartNumber']; } public async commandAction(logger: Logger): Promise { - await this.showDeprecationWarning(logger, aadCommands.LICENSE_LIST, commands.LICENSE_LIST); - if (this.verbose) { await logger.logToStderr(`Retrieving the commercial subscriptions that an organization has acquired`); } diff --git a/src/m365/entra/commands/m365group/m365group-add.spec.ts b/src/m365/entra/commands/m365group/m365group-add.spec.ts index d984ad0309f..de48fd07452 100644 --- a/src/m365/entra/commands/m365group/m365group-add.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-add.spec.ts @@ -13,7 +13,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-add.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_ADD, () => { @@ -121,16 +120,6 @@ describe(commands.M365GROUP_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_ADD]); - }); - it('creates Microsoft 365 Group using basic info', async () => { const postStub = sinon.stub(request, 'post').callsFake(async (opts) => { if (opts.url === 'https://graph.microsoft.com/v1.0/groups') { diff --git a/src/m365/entra/commands/m365group/m365group-add.ts b/src/m365/entra/commands/m365group/m365group-add.ts index 0edb70595ee..8238e6ca1e0 100644 --- a/src/m365/entra/commands/m365group/m365group-add.ts +++ b/src/m365/entra/commands/m365group/m365group-add.ts @@ -8,7 +8,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { formatting } from '../../../../utils/formatting.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -41,10 +40,6 @@ class EntraM365GroupAddCommand extends GraphCommand { return 'Creates a Microsoft 365 Group'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_ADD]; - } - constructor() { super(); @@ -165,8 +160,6 @@ class EntraM365GroupAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_ADD, commands.M365GROUP_ADD); - let group: Group; let ownerIds: string[] = []; let memberIds: string[] = []; diff --git a/src/m365/entra/commands/m365group/m365group-conversation-list.spec.ts b/src/m365/entra/commands/m365group/m365group-conversation-list.spec.ts index 593b3915aa6..c9e5ae6745f 100644 --- a/src/m365/entra/commands/m365group/m365group-conversation-list.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-conversation-list.spec.ts @@ -12,7 +12,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-conversation-list.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; import { cli } from '../../../../cli/cli.js'; describe(commands.M365GROUP_CONVERSATION_LIST, () => { @@ -91,16 +90,6 @@ describe(commands.M365GROUP_CONVERSATION_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_CONVERSATION_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['topic', 'lastDeliveredDateTime', 'id']); }); diff --git a/src/m365/entra/commands/m365group/m365group-conversation-list.ts b/src/m365/entra/commands/m365group/m365group-conversation-list.ts index bd54d2cacd0..813dd35fe37 100644 --- a/src/m365/entra/commands/m365group/m365group-conversation-list.ts +++ b/src/m365/entra/commands/m365group/m365group-conversation-list.ts @@ -6,7 +6,6 @@ import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -25,10 +24,6 @@ class EntraM365GroupConversationListCommand extends GraphCommand { return 'Lists conversations for the specified Microsoft 365 group'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_CONVERSATION_LIST]; - } - public defaultProperties(): string[] | undefined { return ['topic', 'lastDeliveredDateTime', 'id']; } @@ -61,8 +56,6 @@ class EntraM365GroupConversationListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_CONVERSATION_LIST, commands.M365GROUP_CONVERSATION_LIST); - try { const isUnifiedGroup = await entraGroup.isUnifiedGroup(args.options.groupId); diff --git a/src/m365/entra/commands/m365group/m365group-conversation-post-list.spec.ts b/src/m365/entra/commands/m365group/m365group-conversation-post-list.spec.ts index 994f414c56f..1ae642b6c9e 100644 --- a/src/m365/entra/commands/m365group/m365group-conversation-post-list.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-conversation-post-list.spec.ts @@ -14,7 +14,6 @@ import commands from '../../commands.js'; import command from './m365group-conversation-post-list.js'; import { settingsNames } from '../../../../settingsNames.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_CONVERSATION_POST_LIST, () => { let log: string[]; @@ -122,19 +121,10 @@ describe(commands.M365GROUP_CONVERSATION_POST_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_CONVERSATION_POST_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['receivedDateTime', 'id']); }); + it('fails validation if groupId and groupName specified', async () => { sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => { if (settingName === settingsNames.prompt) { @@ -147,6 +137,7 @@ describe(commands.M365GROUP_CONVERSATION_POST_LIST, () => { const actual = await command.validate({ options: { groupId: '1caf7dcd-7e83-4c3a-94f7-932a1299c844', groupName: 'MyGroup', threadId: '123' } }, commandInfo); assert.notStrictEqual(actual, true); }); + it('fails validation if neither groupId nor groupName specified', async () => { sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => { if (settingName === settingsNames.prompt) { @@ -159,10 +150,12 @@ describe(commands.M365GROUP_CONVERSATION_POST_LIST, () => { const actual = await command.validate({ options: { threadId: '123' } }, commandInfo); assert.notStrictEqual(actual, true); }); + it('fails validation if the groupId is not a valid GUID', async () => { const actual = await command.validate({ options: { groupId: 'not-c49b-4fd4-8223-28f0ac3a6402', threadId: '123' } }, commandInfo); assert.notStrictEqual(actual, true); }); + it('passes validation if the groupId is a valid GUID', async () => { const actual = await command.validate({ options: { groupId: '1caf7dcd-7e83-4c3a-94f7-932a1299c844', threadId: '123' } }, commandInfo); assert.strictEqual(actual, true); @@ -187,6 +180,7 @@ describe(commands.M365GROUP_CONVERSATION_POST_LIST, () => { jsonOutput.value )); }); + it('Retrieve posts for the specified conversation threadId of m365 group groupName in the tenant (verbose)', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if ((opts.url as string).indexOf('/groups?$filter=displayName') > -1) { @@ -237,4 +231,4 @@ describe(commands.M365GROUP_CONVERSATION_POST_LIST, () => { await assert.rejects(command.action(logger, { options: { groupId: groupId, threadId: 'AAQkADkwN2Q2NDg1LWQ3ZGYtNDViZi1iNGRiLTVhYjJmN2Q5NDkxZQAQAOnRAfDf71lIvrdK85FAn5E=' } } as any), new CommandError(`Specified group with id '${groupId}' is not a Microsoft 365 group.`)); }); -}); +}); \ No newline at end of file diff --git a/src/m365/entra/commands/m365group/m365group-conversation-post-list.ts b/src/m365/entra/commands/m365group/m365group-conversation-post-list.ts index a6baa453ed8..3e2d7840eac 100644 --- a/src/m365/entra/commands/m365group/m365group-conversation-post-list.ts +++ b/src/m365/entra/commands/m365group/m365group-conversation-post-list.ts @@ -7,7 +7,6 @@ import { odata } from '../../../../utils/odata.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -28,10 +27,6 @@ class EntraM365GroupConversationPostListCommand extends GraphCommand { return 'Lists conversation posts of a Microsoft 365 group'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_CONVERSATION_POST_LIST]; - } - constructor() { super(); @@ -85,8 +80,6 @@ class EntraM365GroupConversationPostListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_CONVERSATION_POST_LIST, commands.M365GROUP_CONVERSATION_POST_LIST); - try { const retrievedgroupId = await this.getGroupId(args); const isUnifiedGroup = await entraGroup.isUnifiedGroup(retrievedgroupId); diff --git a/src/m365/entra/commands/m365group/m365group-get.spec.ts b/src/m365/entra/commands/m365group/m365group-get.spec.ts index fdd501dd2cb..962e5824ade 100644 --- a/src/m365/entra/commands/m365group/m365group-get.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-get.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-get.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_GET, () => { let log: string[]; @@ -66,16 +65,6 @@ describe(commands.M365GROUP_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_GET]); - }); - it('retrieves information about the specified Microsoft 365 Group', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groups/1caf7dcd-7e83-4c3a-94f7-932a1299c844`) { diff --git a/src/m365/entra/commands/m365group/m365group-get.ts b/src/m365/entra/commands/m365group/m365group-get.ts index 9d7611b37b3..6b4dc99bfe6 100644 --- a/src/m365/entra/commands/m365group/m365group-get.ts +++ b/src/m365/entra/commands/m365group/m365group-get.ts @@ -4,7 +4,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; import { GroupExtended } from './GroupExtended.js'; @@ -26,10 +25,6 @@ class EntraM365GroupGetCommand extends GraphCommand { return 'Gets information about the specified Microsoft 365 Group or Microsoft Teams team'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_GET]; - } - constructor() { super(); @@ -61,8 +56,6 @@ class EntraM365GroupGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_GET, commands.M365GROUP_GET); - let group: GroupExtended; try { diff --git a/src/m365/entra/commands/m365group/m365group-list.spec.ts b/src/m365/entra/commands/m365group/m365group-list.spec.ts index 0b6830d0cf1..47d529c2705 100644 --- a/src/m365/entra/commands/m365group/m365group-list.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-list.spec.ts @@ -14,7 +14,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_LIST, () => { let log: string[]; @@ -67,16 +66,6 @@ describe(commands.M365GROUP_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName', 'mailNickname', 'siteUrl']); }); diff --git a/src/m365/entra/commands/m365group/m365group-list.ts b/src/m365/entra/commands/m365group/m365group-list.ts index 00019feb2c1..20a777b1bac 100644 --- a/src/m365/entra/commands/m365group/m365group-list.ts +++ b/src/m365/entra/commands/m365group/m365group-list.ts @@ -4,7 +4,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { formatting } from '../../../../utils/formatting.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; import { GroupExtended } from './GroupExtended.js'; @@ -28,10 +27,6 @@ class EntraM365GroupListCommand extends GraphCommand { return 'Lists Microsoft 365 Groups in the current tenant'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_LIST]; - } - constructor() { super(); @@ -72,8 +67,6 @@ class EntraM365GroupListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_LIST, commands.M365GROUP_LIST); - const groupFilter: string = `?$filter=groupTypes/any(c:c+eq+'Unified')`; const displayNameFilter: string = args.options.displayName ? ` and startswith(DisplayName,'${formatting.encodeQueryParameter(args.options.displayName)}')` : ''; const mailNicknameFilter: string = args.options.mailNickname ? ` and startswith(MailNickname,'${formatting.encodeQueryParameter(args.options.mailNickname)}')` : ''; diff --git a/src/m365/entra/commands/m365group/m365group-recyclebinitem-clear.spec.ts b/src/m365/entra/commands/m365group/m365group-recyclebinitem-clear.spec.ts index 2c563f32899..304e2bab266 100644 --- a/src/m365/entra/commands/m365group/m365group-recyclebinitem-clear.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-recyclebinitem-clear.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-recyclebinitem-clear.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_RECYCLEBINITEM_CLEAR, () => { let log: string[]; @@ -70,16 +69,6 @@ describe(commands.M365GROUP_RECYCLEBINITEM_CLEAR, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_RECYCLEBINITEM_CLEAR]); - }); - it('clears the recycle bin items without prompting for confirmation when --force option specified', async () => { const deleteStub = sinon.stub(request, 'delete').resolves(); diff --git a/src/m365/entra/commands/m365group/m365group-recyclebinitem-clear.ts b/src/m365/entra/commands/m365group/m365group-recyclebinitem-clear.ts index 9829dc99617..6319d1e3139 100644 --- a/src/m365/entra/commands/m365group/m365group-recyclebinitem-clear.ts +++ b/src/m365/entra/commands/m365group/m365group-recyclebinitem-clear.ts @@ -6,7 +6,6 @@ import request from '../../../../request.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -25,10 +24,6 @@ class EntraM365GroupRecycleBinItemClearCommand extends GraphCommand { return 'Clears all M365 Groups from recycle bin.'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_RECYCLEBINITEM_CLEAR]; - } - constructor() { super(); @@ -53,8 +48,6 @@ class EntraM365GroupRecycleBinItemClearCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_RECYCLEBINITEM_CLEAR, commands.M365GROUP_RECYCLEBINITEM_CLEAR); - const clearM365GroupRecycleBinItems = async (): Promise => { try { await this.processRecycleBinItemsClear(); diff --git a/src/m365/entra/commands/m365group/m365group-recyclebinitem-list.spec.ts b/src/m365/entra/commands/m365group/m365group-recyclebinitem-list.spec.ts index d2d24332087..1d1bd2d3a2b 100644 --- a/src/m365/entra/commands/m365group/m365group-recyclebinitem-list.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-recyclebinitem-list.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-recyclebinitem-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_RECYCLEBINITEM_LIST, () => { let log: string[]; @@ -61,16 +60,6 @@ describe(commands.M365GROUP_RECYCLEBINITEM_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_RECYCLEBINITEM_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName', 'mailNickname']); }); diff --git a/src/m365/entra/commands/m365group/m365group-recyclebinitem-list.ts b/src/m365/entra/commands/m365group/m365group-recyclebinitem-list.ts index 93859678918..dde8f5219db 100644 --- a/src/m365/entra/commands/m365group/m365group-recyclebinitem-list.ts +++ b/src/m365/entra/commands/m365group/m365group-recyclebinitem-list.ts @@ -5,7 +5,6 @@ import { formatting } from '../../../../utils/formatting.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -25,10 +24,6 @@ class EntraM365GroupRecycleBinItemListCommand extends GraphCommand { return 'Lists Microsoft 365 Groups deleted in the current tenant'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_RECYCLEBINITEM_LIST]; - } - constructor() { super(); @@ -61,8 +56,6 @@ class EntraM365GroupRecycleBinItemListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_RECYCLEBINITEM_LIST, commands.M365GROUP_RECYCLEBINITEM_LIST); - try { const filter: string = `?$filter=groupTypes/any(c:c+eq+'Unified')`; const displayNameFilter: string = args.options.groupName ? ` and startswith(DisplayName,'${formatting.encodeQueryParameter(args.options.groupName).replace(/'/g, `''`)}')` : ''; diff --git a/src/m365/entra/commands/m365group/m365group-recyclebinitem-remove.spec.ts b/src/m365/entra/commands/m365group/m365group-recyclebinitem-remove.spec.ts index c80a4d41dfe..751661880e4 100644 --- a/src/m365/entra/commands/m365group/m365group-recyclebinitem-remove.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-recyclebinitem-remove.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-recyclebinitem-remove.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_RECYCLEBINITEM_REMOVE, () => { const validGroupId = '00000000-0000-0000-0000-000000000000'; @@ -122,16 +121,6 @@ describe(commands.M365GROUP_RECYCLEBINITEM_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_RECYCLEBINITEM_REMOVE]); - }); - it('fails validation when id is not a valid GUID', async () => { const actual = await command.validate({ options: { diff --git a/src/m365/entra/commands/m365group/m365group-recyclebinitem-remove.ts b/src/m365/entra/commands/m365group/m365group-recyclebinitem-remove.ts index 7751fa9338b..64ac3680379 100644 --- a/src/m365/entra/commands/m365group/m365group-recyclebinitem-remove.ts +++ b/src/m365/entra/commands/m365group/m365group-recyclebinitem-remove.ts @@ -7,7 +7,6 @@ import { formatting } from '../../../../utils/formatting.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -29,10 +28,6 @@ class EntraM365GroupRecycleBinItemRemoveCommand extends GraphCommand { return 'Permanently deletes a Microsoft 365 Group from the recycle bin in the current tenant'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_RECYCLEBINITEM_REMOVE]; - } - constructor() { super(); @@ -87,8 +82,6 @@ class EntraM365GroupRecycleBinItemRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_RECYCLEBINITEM_REMOVE, commands.M365GROUP_RECYCLEBINITEM_REMOVE); - const removeGroup: () => Promise = async (): Promise => { try { const groupId = await this.getGroupId(args.options); diff --git a/src/m365/entra/commands/m365group/m365group-recyclebinitem-restore.spec.ts b/src/m365/entra/commands/m365group/m365group-recyclebinitem-restore.spec.ts index b4165dd0370..4d51190373a 100644 --- a/src/m365/entra/commands/m365group/m365group-recyclebinitem-restore.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-recyclebinitem-restore.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-recyclebinitem-restore.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_RECYCLEBINITEM_RESTORE, () => { const validGroupId = '00000000-0000-0000-0000-000000000000'; @@ -116,16 +115,6 @@ describe(commands.M365GROUP_RECYCLEBINITEM_RESTORE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_RECYCLEBINITEM_RESTORE]); - }); - it('fails validation if the id is not a valid GUID', async () => { const actual = await command.validate({ options: { id: 'abc' } }, commandInfo); assert.notStrictEqual(actual, true); diff --git a/src/m365/entra/commands/m365group/m365group-recyclebinitem-restore.ts b/src/m365/entra/commands/m365group/m365group-recyclebinitem-restore.ts index b30a40716ba..02aec59d3b2 100644 --- a/src/m365/entra/commands/m365group/m365group-recyclebinitem-restore.ts +++ b/src/m365/entra/commands/m365group/m365group-recyclebinitem-restore.ts @@ -7,7 +7,6 @@ import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { cli } from '../../../../cli/cli.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -28,10 +27,6 @@ class EntraM365GroupRecycleBinItemRestoreCommand extends GraphCommand { return 'Restores a deleted Microsoft 365 Group'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_RECYCLEBINITEM_RESTORE]; - } - constructor() { super(); @@ -82,8 +77,6 @@ class EntraM365GroupRecycleBinItemRestoreCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_RECYCLEBINITEM_RESTORE, commands.M365GROUP_RECYCLEBINITEM_RESTORE); - if (this.verbose) { await logger.logToStderr(`Restoring Microsoft 365 Group: ${args.options.id || args.options.displayName || args.options.mailNickname}...`); } diff --git a/src/m365/entra/commands/m365group/m365group-remove.spec.ts b/src/m365/entra/commands/m365group/m365group-remove.spec.ts index a035ded8ede..b2f5cdba427 100644 --- a/src/m365/entra/commands/m365group/m365group-remove.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-remove.spec.ts @@ -15,7 +15,6 @@ import commands from '../../commands.js'; import { spo } from '../../../../utils/spo.js'; import command from './m365group-remove.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_REMOVE, () => { let log: string[]; @@ -160,16 +159,6 @@ describe(commands.M365GROUP_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_REMOVE]); - }); - it('fails validation if the id is not a valid GUID', async () => { const actual = await command.validate({ options: { id: 'abc' } }, commandInfo); assert.notStrictEqual(actual, true); diff --git a/src/m365/entra/commands/m365group/m365group-remove.ts b/src/m365/entra/commands/m365group/m365group-remove.ts index 142c2509617..c6384714180 100644 --- a/src/m365/entra/commands/m365group/m365group-remove.ts +++ b/src/m365/entra/commands/m365group/m365group-remove.ts @@ -10,7 +10,6 @@ import config from '../../../../config.js'; import { formatting } from '../../../../utils/formatting.js'; import { ClientSvcResponse, ClientSvcResponseContents, FormDigestInfo, spo } from '../../../../utils/spo.js'; import { setTimeout } from 'timers/promises'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -34,10 +33,6 @@ class EntraM365GroupRemoveCommand extends GraphCommand { return 'Removes a Microsoft 365 Group'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_REMOVE]; - } - constructor() { super(); @@ -82,8 +77,6 @@ class EntraM365GroupRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_REMOVE, commands.M365GROUP_REMOVE); - const removeGroup = async (): Promise => { if (this.verbose) { await logger.logToStderr(`Removing Microsoft 365 Group: ${args.options.id}...`); diff --git a/src/m365/entra/commands/m365group/m365group-renew.spec.ts b/src/m365/entra/commands/m365group/m365group-renew.spec.ts index 086879d22ff..1eb96a99173 100644 --- a/src/m365/entra/commands/m365group/m365group-renew.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-renew.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-renew.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_RENEW, () => { let log: string[]; @@ -69,16 +68,6 @@ describe(commands.M365GROUP_RENEW, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_RENEW]); - }); - it('renews expiration the specified group', async () => { sinon.stub(request, 'post').callsFake(async (opts) => { if (opts.url === 'https://graph.microsoft.com/v1.0/groups/28beab62-7540-4db1-a23f-29a6018a3848/renew/') { diff --git a/src/m365/entra/commands/m365group/m365group-renew.ts b/src/m365/entra/commands/m365group/m365group-renew.ts index b68cba2940a..aa251b235ca 100644 --- a/src/m365/entra/commands/m365group/m365group-renew.ts +++ b/src/m365/entra/commands/m365group/m365group-renew.ts @@ -4,7 +4,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -24,10 +23,6 @@ class EntraM365GroupRenewCommand extends GraphCommand { return `Renews Microsoft 365 group's expiration`; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_RENEW]; - } - constructor() { super(); @@ -56,8 +51,6 @@ class EntraM365GroupRenewCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_RENEW, commands.M365GROUP_RENEW); - if (this.verbose) { await logger.logToStderr(`Renewing Microsoft 365 group's expiration: ${args.options.id}...`); } diff --git a/src/m365/entra/commands/m365group/m365group-report-activitycounts.spec.ts b/src/m365/entra/commands/m365group/m365group-report-activitycounts.spec.ts index 1dac6316ff0..13c888a4e8a 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activitycounts.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activitycounts.spec.ts @@ -9,7 +9,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-report-activitycounts.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_REPORT_ACTIVITYCOUNTS, () => { let log: string[]; @@ -58,16 +57,6 @@ describe(commands.M365GROUP_REPORT_ACTIVITYCOUNTS, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_REPORT_ACTIVITYCOUNTS]); - }); - it('gets the number of group activities across group workloads for the given period', async () => { const requestStub: sinon.SinonStub = sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/reports/getOffice365GroupsActivityCounts(period='D7')`) { diff --git a/src/m365/entra/commands/m365group/m365group-report-activitycounts.ts b/src/m365/entra/commands/m365group/m365group-report-activitycounts.ts index 63187fe38f7..38f4963420b 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activitycounts.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activitycounts.ts @@ -1,5 +1,4 @@ import PeriodBasedReport from '../../../base/PeriodBasedReport.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; class M365GroupReportActivityCountsCommand extends PeriodBasedReport { @@ -11,10 +10,6 @@ class M365GroupReportActivityCountsCommand extends PeriodBasedReport { return 'Get the number of group activities across group workloads'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_REPORT_ACTIVITYCOUNTS]; - } - public get usageEndpoint(): string { return 'getOffice365GroupsActivityCounts'; } diff --git a/src/m365/entra/commands/m365group/m365group-report-activitydetail.spec.ts b/src/m365/entra/commands/m365group/m365group-report-activitydetail.spec.ts index 6b8e1e04015..2885c2b1e1c 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activitydetail.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activitydetail.spec.ts @@ -9,7 +9,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-report-activitydetail.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_REPORT_ACTIVITYDETAIL, () => { let log: string[]; @@ -58,16 +57,6 @@ describe(commands.M365GROUP_REPORT_ACTIVITYDETAIL, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_REPORT_ACTIVITYDETAIL]); - }); - it('gets details about Microsoft 365 Groups activity by group for the given period', async () => { const requestStub: sinon.SinonStub = sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/reports/getOffice365GroupsActivityDetail(period='D7')`) { diff --git a/src/m365/entra/commands/m365group/m365group-report-activitydetail.ts b/src/m365/entra/commands/m365group/m365group-report-activitydetail.ts index db2b6153024..f1c372b02ae 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activitydetail.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activitydetail.ts @@ -1,5 +1,4 @@ import DateAndPeriodBasedReport from '../../../base/DateAndPeriodBasedReport.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; class M365GroupReportActivityDetailCommand extends DateAndPeriodBasedReport { @@ -11,10 +10,6 @@ class M365GroupReportActivityDetailCommand extends DateAndPeriodBasedReport { return 'Get details about Microsoft 365 Groups activity by group'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_REPORT_ACTIVITYDETAIL]; - } - public get usageEndpoint(): string { return 'getOffice365GroupsActivityDetail'; } diff --git a/src/m365/entra/commands/m365group/m365group-report-activityfilecounts.spec.ts b/src/m365/entra/commands/m365group/m365group-report-activityfilecounts.spec.ts index a0952e60045..7c1c20df5b3 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activityfilecounts.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activityfilecounts.spec.ts @@ -9,7 +9,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-report-activityfilecounts.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_REPORT_ACTIVITYFILECOUNTS, () => { let log: string[]; @@ -58,16 +57,6 @@ describe(commands.M365GROUP_REPORT_ACTIVITYFILECOUNTS, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_REPORT_ACTIVITYFILECOUNTS]); - }); - it('gets the number of group activities across group workloads for the given period', async () => { const requestStub: sinon.SinonStub = sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/reports/getOffice365GroupsActivityFileCounts(period='D7')`) { @@ -83,4 +72,4 @@ describe(commands.M365GROUP_REPORT_ACTIVITYFILECOUNTS, () => { assert.strictEqual(requestStub.lastCall.args[0].url, "https://graph.microsoft.com/v1.0/reports/getOffice365GroupsActivityFileCounts(period='D7')"); assert.strictEqual(requestStub.lastCall.args[0].headers["accept"], 'application/json;odata.metadata=none'); }); -}); +}); \ No newline at end of file diff --git a/src/m365/entra/commands/m365group/m365group-report-activityfilecounts.ts b/src/m365/entra/commands/m365group/m365group-report-activityfilecounts.ts index bd8f4a831e8..bd6ccb27659 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activityfilecounts.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activityfilecounts.ts @@ -1,5 +1,4 @@ import PeriodBasedReport from '../../../base/PeriodBasedReport.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; class M365GroupReportActivityFileCountsCommand extends PeriodBasedReport { @@ -11,10 +10,6 @@ class M365GroupReportActivityFileCountsCommand extends PeriodBasedReport { return 'Get the total number of files and how many of them were active across all group sites associated with an Microsoft 365 Group'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_REPORT_ACTIVITYFILECOUNTS]; - } - public get usageEndpoint(): string { return 'getOffice365GroupsActivityFileCounts'; } diff --git a/src/m365/entra/commands/m365group/m365group-report-activitygroupcounts.spec.ts b/src/m365/entra/commands/m365group/m365group-report-activitygroupcounts.spec.ts index 30f823dce3d..ce6703f8c43 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activitygroupcounts.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activitygroupcounts.spec.ts @@ -9,7 +9,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-report-activitygroupcounts.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_REPORT_ACTIVITYGROUPCOUNTS, () => { let log: string[]; @@ -58,16 +57,6 @@ describe(commands.M365GROUP_REPORT_ACTIVITYGROUPCOUNTS, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_REPORT_ACTIVITYGROUPCOUNTS]); - }); - it('gets the daily total number of groups and how many of them were active based on activities for the given period', async () => { const requestStub: sinon.SinonStub = sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/reports/getOffice365GroupsActivityGroupCounts(period='D7')`) { @@ -85,4 +74,4 @@ describe(commands.M365GROUP_REPORT_ACTIVITYGROUPCOUNTS, () => { assert.strictEqual(requestStub.lastCall.args[0].url, "https://graph.microsoft.com/v1.0/reports/getOffice365GroupsActivityGroupCounts(period='D7')"); assert.strictEqual(requestStub.lastCall.args[0].headers["accept"], 'application/json;odata.metadata=none'); }); -}); +}); \ No newline at end of file diff --git a/src/m365/entra/commands/m365group/m365group-report-activitygroupcounts.ts b/src/m365/entra/commands/m365group/m365group-report-activitygroupcounts.ts index 664b023fdc7..219f4d46a3c 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activitygroupcounts.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activitygroupcounts.ts @@ -1,5 +1,4 @@ import PeriodBasedReport from '../../../base/PeriodBasedReport.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; class M365GroupReportActivityGroupCountsCommand extends PeriodBasedReport { @@ -11,10 +10,6 @@ class M365GroupReportActivityGroupCountsCommand extends PeriodBasedReport { return 'Get the daily total number of groups and how many of them were active based on email conversations, Viva Engage posts, and SharePoint file activities'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_REPORT_ACTIVITYGROUPCOUNTS]; - } - public get usageEndpoint(): string { return 'getOffice365GroupsActivityGroupCounts'; } diff --git a/src/m365/entra/commands/m365group/m365group-report-activitystorage.spec.ts b/src/m365/entra/commands/m365group/m365group-report-activitystorage.spec.ts index c6ba3c19586..144a00803f5 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activitystorage.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activitystorage.spec.ts @@ -9,7 +9,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-report-activitystorage.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_REPORT_ACTIVITYSTORAGE, () => { let log: string[]; @@ -58,16 +57,6 @@ describe(commands.M365GROUP_REPORT_ACTIVITYSTORAGE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_REPORT_ACTIVITYSTORAGE]); - }); - it('get the reports', async () => { const requestStub: sinon.SinonStub = sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/reports/getOffice365GroupsActivityStorage(period='D7')`) { @@ -83,4 +72,4 @@ describe(commands.M365GROUP_REPORT_ACTIVITYSTORAGE, () => { assert.strictEqual(requestStub.lastCall.args[0].url, "https://graph.microsoft.com/v1.0/reports/getOffice365GroupsActivityStorage(period='D7')"); assert.strictEqual(requestStub.lastCall.args[0].headers["accept"], 'application/json;odata.metadata=none'); }); -}); +}); \ No newline at end of file diff --git a/src/m365/entra/commands/m365group/m365group-report-activitystorage.ts b/src/m365/entra/commands/m365group/m365group-report-activitystorage.ts index 442900e5d6d..8d87d227010 100644 --- a/src/m365/entra/commands/m365group/m365group-report-activitystorage.ts +++ b/src/m365/entra/commands/m365group/m365group-report-activitystorage.ts @@ -1,5 +1,4 @@ import PeriodBasedReport from '../../../base/PeriodBasedReport.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; class M365GroupReportActivityStorageCommand extends PeriodBasedReport { @@ -11,10 +10,6 @@ class M365GroupReportActivityStorageCommand extends PeriodBasedReport { return 'Get the total storage used across all group mailboxes and group sites'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_REPORT_ACTIVITYSTORAGE]; - } - public get usageEndpoint(): string { return 'getOffice365GroupsActivityStorage'; } diff --git a/src/m365/entra/commands/m365group/m365group-set.spec.ts b/src/m365/entra/commands/m365group/m365group-set.spec.ts index f41d0376b58..23d5f0526e3 100644 --- a/src/m365/entra/commands/m365group/m365group-set.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-set.spec.ts @@ -15,7 +15,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-set.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; import { accessToken } from '../../../../utils/accessToken.js'; describe(commands.M365GROUP_SET, () => { @@ -119,6 +118,7 @@ describe(commands.M365GROUP_SET, () => { assert.notStrictEqual(command.description, null); }); +<<<<<<< HEAD it('defines alias', () => { const alias = command.alias(); assert.notStrictEqual(typeof alias, 'undefined'); @@ -135,6 +135,16 @@ describe(commands.M365GROUP_SET, () => { const patchStub = sinon.stub(request, 'patch').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groups/${groupId}`) { return; +======= + it('updates Microsoft 365 Group display name', async () => { + sinon.stub(request, 'patch').callsFake(async (opts) => { + if (opts.url === 'https://graph.microsoft.com/v1.0/groups/28beab62-7540-4db1-a23f-29a6018a3848') { + if (JSON.stringify(opts.data) === JSON.stringify({ + displayName: 'My group' + })) { + return; + } +>>>>>>> ef060945e... removed aad aliases } throw 'Invalid request'; diff --git a/src/m365/entra/commands/m365group/m365group-set.ts b/src/m365/entra/commands/m365group/m365group-set.ts index 435a8dd573f..65194e77951 100644 --- a/src/m365/entra/commands/m365group/m365group-set.ts +++ b/src/m365/entra/commands/m365group/m365group-set.ts @@ -9,7 +9,6 @@ import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; import { accessToken } from '../../../../utils/accessToken.js'; import auth from '../../../../Auth.js'; import { entraUser } from '../../../../utils/entraUser.js'; @@ -50,10 +49,6 @@ class EntraM365GroupSetCommand extends GraphCommand { return 'Updates Microsoft 365 Group properties'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_SET]; - } - constructor() { super(); @@ -226,8 +221,6 @@ class EntraM365GroupSetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_SET, commands.M365GROUP_SET); - try { if ((args.options.allowExternalSenders !== undefined || args.options.autoSubscribeNewMembers !== undefined) && accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken)) { throw `Option 'allowExternalSenders' and 'autoSubscribeNewMembers' can only be used when using delegated permissions.`; diff --git a/src/m365/entra/commands/m365group/m365group-teamify.spec.ts b/src/m365/entra/commands/m365group/m365group-teamify.spec.ts index f8c1b22baff..727be4534ed 100644 --- a/src/m365/entra/commands/m365group/m365group-teamify.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-teamify.spec.ts @@ -14,7 +14,6 @@ import commands from '../../commands.js'; import command from './m365group-teamify.js'; import { settingsNames } from '../../../../settingsNames.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_TEAMIFY, () => { let log: string[]; @@ -69,16 +68,6 @@ describe(commands.M365GROUP_TEAMIFY, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_TEAMIFY]); - }); - it('fails validation if both id and mailNickname options are not passed', async () => { sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => { if (settingName === settingsNames.prompt) { diff --git a/src/m365/entra/commands/m365group/m365group-teamify.ts b/src/m365/entra/commands/m365group/m365group-teamify.ts index 2f4a2d8ee7e..de91436791a 100644 --- a/src/m365/entra/commands/m365group/m365group-teamify.ts +++ b/src/m365/entra/commands/m365group/m365group-teamify.ts @@ -6,7 +6,6 @@ import { entraGroup } from '../../../../utils/entraGroup.js'; import { formatting } from '../../../../utils/formatting.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -27,10 +26,6 @@ class EntraM365GroupTeamifyCommand extends GraphCommand { return 'Creates a new Microsoft Teams team under existing Microsoft 365 group'; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_TEAMIFY]; - } - constructor() { super(); @@ -106,8 +101,6 @@ class EntraM365GroupTeamifyCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_TEAMIFY, commands.M365GROUP_TEAMIFY); - try { const groupId = await this.getGroupId(args.options); const isUnifiedGroup = await entraGroup.isUnifiedGroup(groupId); diff --git a/src/m365/entra/commands/m365group/m365group-user-add.spec.ts b/src/m365/entra/commands/m365group/m365group-user-add.spec.ts index 66fa016da6d..3c860f33f93 100644 --- a/src/m365/entra/commands/m365group/m365group-user-add.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-user-add.spec.ts @@ -10,7 +10,6 @@ import { telemetry } from '../../../../telemetry.js'; import { pid } from '../../../../utils/pid.js'; import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; -import teamsCommands from '../../../teams/commands.js'; import commands from '../../commands.js'; import command from './m365group-user-add.js'; import { settingsNames } from '../../../../settingsNames.js'; @@ -75,16 +74,6 @@ describe(commands.M365GROUP_USER_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [teamsCommands.USER_ADD, aadCommands.M365GROUP_USER_ADD]); - }); - it('fails validation if the groupId is not a valid guid.', async () => { const actual = await command.validate({ options: { diff --git a/src/m365/entra/commands/m365group/m365group-user-add.ts b/src/m365/entra/commands/m365group/m365group-user-add.ts index 94320d2847b..7fb4f8acea6 100644 --- a/src/m365/entra/commands/m365group/m365group-user-add.ts +++ b/src/m365/entra/commands/m365group/m365group-user-add.ts @@ -35,10 +35,6 @@ class EntraM365GroupUserAddCommand extends GraphCommand { return 'Adds user to specified Microsoft 365 Group or Microsoft Teams team'; } - public alias(): string[] | undefined { - return [teamsCommands.USER_ADD, aadCommands.M365GROUP_USER_ADD]; - } - constructor() { super(); diff --git a/src/m365/entra/commands/m365group/m365group-user-list.spec.ts b/src/m365/entra/commands/m365group/m365group-user-list.spec.ts index 15f071e272b..73c329c0bf0 100644 --- a/src/m365/entra/commands/m365group/m365group-user-list.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-user-list.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './m365group-user-list.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_USER_LIST, () => { let log: string[]; @@ -67,16 +66,6 @@ describe(commands.M365GROUP_USER_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_USER_LIST]); - }); - it('fails validation if the groupId is not a valid guid.', async () => { const actual = await command.validate({ options: { diff --git a/src/m365/entra/commands/m365group/m365group-user-list.ts b/src/m365/entra/commands/m365group/m365group-user-list.ts index 90de68209ab..237da67859e 100644 --- a/src/m365/entra/commands/m365group/m365group-user-list.ts +++ b/src/m365/entra/commands/m365group/m365group-user-list.ts @@ -7,7 +7,6 @@ import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; import { CliRequestOptions } from '../../../../request.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -34,10 +33,6 @@ class EntraM365GroupUserListCommand extends GraphCommand { return "Lists users for the specified Microsoft 365 group"; } - public alias(): string[] | undefined { - return [aadCommands.M365GROUP_USER_LIST]; - } - constructor() { super(); @@ -107,8 +102,6 @@ class EntraM365GroupUserListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_USER_LIST, commands.M365GROUP_USER_LIST); - try { const groupId = await this.getGroupId(args.options, logger); const isUnifiedGroup = await entraGroup.isUnifiedGroup(groupId); diff --git a/src/m365/entra/commands/m365group/m365group-user-remove.spec.ts b/src/m365/entra/commands/m365group/m365group-user-remove.spec.ts index eec3e1c0fdb..6b2b25dfd02 100644 --- a/src/m365/entra/commands/m365group/m365group-user-remove.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-user-remove.spec.ts @@ -10,12 +10,10 @@ import { telemetry } from '../../../../telemetry.js'; import { pid } from '../../../../utils/pid.js'; import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; -import teamsCommands from '../../../teams/commands.js'; import commands from '../../commands.js'; import command from './m365group-user-remove.js'; import { settingsNames } from '../../../../settingsNames.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_USER_REMOVE, () => { let log: string[]; @@ -76,16 +74,6 @@ describe(commands.M365GROUP_USER_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [teamsCommands.USER_REMOVE, aadCommands.M365GROUP_USER_REMOVE]); - }); - it('fails validation if the groupId is not a valid guid.', async () => { const actual = await command.validate({ options: { diff --git a/src/m365/entra/commands/m365group/m365group-user-remove.ts b/src/m365/entra/commands/m365group/m365group-user-remove.ts index 16e94fa3b77..71d14fd1852 100644 --- a/src/m365/entra/commands/m365group/m365group-user-remove.ts +++ b/src/m365/entra/commands/m365group/m365group-user-remove.ts @@ -6,8 +6,6 @@ import { entraGroup } from '../../../../utils/entraGroup.js'; import { formatting } from '../../../../utils/formatting.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import teamsCommands from '../../../teams/commands.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -34,10 +32,6 @@ class EntraM365GroupUserRemoveCommand extends GraphCommand { return 'Removes the specified user from specified Microsoft 365 Group or Microsoft Teams team'; } - public alias(): string[] | undefined { - return [teamsCommands.USER_REMOVE, aadCommands.M365GROUP_USER_REMOVE]; - } - constructor() { super(); @@ -95,8 +89,6 @@ class EntraM365GroupUserRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_USER_REMOVE, commands.M365GROUP_USER_REMOVE); - const groupId: string = (typeof args.options.groupId !== 'undefined') ? args.options.groupId : args.options.teamId as string; const removeUser = async (): Promise => { diff --git a/src/m365/entra/commands/m365group/m365group-user-set.spec.ts b/src/m365/entra/commands/m365group/m365group-user-set.spec.ts index 89e98303411..6c0b85d2c7d 100644 --- a/src/m365/entra/commands/m365group/m365group-user-set.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-user-set.spec.ts @@ -10,7 +10,6 @@ import { telemetry } from '../../../../telemetry.js'; import { pid } from '../../../../utils/pid.js'; import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; -import teamsCommands from '../../../teams/commands.js'; import commands from '../../commands.js'; import command from './m365group-user-set.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; diff --git a/src/m365/entra/commands/m365group/m365group-user-set.ts b/src/m365/entra/commands/m365group/m365group-user-set.ts index 02a0d62efba..69d0d5fc411 100644 --- a/src/m365/entra/commands/m365group/m365group-user-set.ts +++ b/src/m365/entra/commands/m365group/m365group-user-set.ts @@ -4,7 +4,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import { formatting } from '../../../../utils/formatting.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import teamsCommands from '../../../teams/commands.js'; import commands from '../../commands.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; import { entraUser } from '../../../../utils/entraUser.js'; @@ -36,11 +35,6 @@ class EntraM365GroupUserSetCommand extends GraphCommand { return 'Updates role of the specified user in the specified Microsoft 365 Group or Microsoft Teams team'; } - - public alias(): string[] | undefined { - return [teamsCommands.USER_SET, aadCommands.M365GROUP_USER_SET]; - } - constructor() { super(); diff --git a/src/m365/entra/commands/oauth2grant/oauth2grant-add.spec.ts b/src/m365/entra/commands/oauth2grant/oauth2grant-add.spec.ts index b59e1297026..fdc6fad32bc 100644 --- a/src/m365/entra/commands/oauth2grant/oauth2grant-add.spec.ts +++ b/src/m365/entra/commands/oauth2grant/oauth2grant-add.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './oauth2grant-add.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.OAUTH2GRANT_ADD, () => { let log: string[]; @@ -66,16 +65,6 @@ describe(commands.OAUTH2GRANT_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.OAUTH2GRANT_ADD]); - }); - it('adds OAuth2 permission grant (debug)', async () => { sinon.stub(request, 'post').callsFake(async (opts) => { if ((opts.url as string).indexOf(`/v1.0/oauth2PermissionGrants`) > -1) { diff --git a/src/m365/entra/commands/oauth2grant/oauth2grant-add.ts b/src/m365/entra/commands/oauth2grant/oauth2grant-add.ts index b27b2d844a6..fd2bd08a12a 100644 --- a/src/m365/entra/commands/oauth2grant/oauth2grant-add.ts +++ b/src/m365/entra/commands/oauth2grant/oauth2grant-add.ts @@ -3,7 +3,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -25,10 +24,6 @@ class EntraOAuth2GrantAddCommand extends GraphCommand { return 'Grant the specified service principal OAuth2 permissions to the specified resource'; } - public alias(): string[] | undefined { - return [aadCommands.OAUTH2GRANT_ADD]; - } - constructor() { super(); @@ -67,8 +62,6 @@ class EntraOAuth2GrantAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.OAUTH2GRANT_ADD, commands.OAUTH2GRANT_ADD); - if (this.verbose) { await logger.logToStderr(`Granting the service principal specified permissions...`); } diff --git a/src/m365/entra/commands/oauth2grant/oauth2grant-list.spec.ts b/src/m365/entra/commands/oauth2grant/oauth2grant-list.spec.ts index 35438b19bd1..bd7fbac799d 100644 --- a/src/m365/entra/commands/oauth2grant/oauth2grant-list.spec.ts +++ b/src/m365/entra/commands/oauth2grant/oauth2grant-list.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './oauth2grant-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.OAUTH2GRANT_LIST, () => { let log: string[]; @@ -64,16 +63,6 @@ describe(commands.OAUTH2GRANT_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.OAUTH2GRANT_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['objectId', 'resourceId', 'scope']); }); diff --git a/src/m365/entra/commands/oauth2grant/oauth2grant-list.ts b/src/m365/entra/commands/oauth2grant/oauth2grant-list.ts index 72d44ed625e..3d0edbd7738 100644 --- a/src/m365/entra/commands/oauth2grant/oauth2grant-list.ts +++ b/src/m365/entra/commands/oauth2grant/oauth2grant-list.ts @@ -4,7 +4,6 @@ import { formatting } from '../../../../utils/formatting.js'; import { odata } from '../../../../utils/odata.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -24,10 +23,6 @@ class EntraOAuth2GrantListCommand extends GraphCommand { return 'Lists OAuth2 permission grants for the specified service principal'; } - public alias(): string[] | undefined { - return [aadCommands.OAUTH2GRANT_LIST]; - } - public defaultProperties(): string[] | undefined { return ['objectId', 'resourceId', 'scope']; } @@ -60,8 +55,6 @@ class EntraOAuth2GrantListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.OAUTH2GRANT_LIST, commands.OAUTH2GRANT_LIST); - if (this.verbose) { await logger.logToStderr(`Retrieving list of OAuth grants for the service principal...`); } diff --git a/src/m365/entra/commands/oauth2grant/oauth2grant-remove.spec.ts b/src/m365/entra/commands/oauth2grant/oauth2grant-remove.spec.ts index 60bb2da88c4..d7756cfde97 100644 --- a/src/m365/entra/commands/oauth2grant/oauth2grant-remove.spec.ts +++ b/src/m365/entra/commands/oauth2grant/oauth2grant-remove.spec.ts @@ -11,7 +11,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './oauth2grant-remove.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.OAUTH2GRANT_REMOVE, () => { let log: string[]; @@ -71,16 +70,6 @@ describe(commands.OAUTH2GRANT_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.OAUTH2GRANT_REMOVE]); - }); - it('removes OAuth2 permission grant when prompt confirmed (debug)', async () => { const deleteRequestStub = sinon.stub(request, 'delete').callsFake(async (opts) => { if ((opts.url as string).indexOf(`/v1.0/oauth2PermissionGrants/YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek`) > -1) { diff --git a/src/m365/entra/commands/oauth2grant/oauth2grant-remove.ts b/src/m365/entra/commands/oauth2grant/oauth2grant-remove.ts index b36db4bc7cd..567b8d53b9f 100644 --- a/src/m365/entra/commands/oauth2grant/oauth2grant-remove.ts +++ b/src/m365/entra/commands/oauth2grant/oauth2grant-remove.ts @@ -4,7 +4,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { formatting } from '../../../../utils/formatting.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -24,10 +23,6 @@ class EntraOAuth2GrantRemoveCommand extends GraphCommand { return 'Remove specified service principal OAuth2 permissions'; } - public alias(): string[] | undefined { - return [aadCommands.OAUTH2GRANT_REMOVE]; - } - constructor() { super(); @@ -46,8 +41,6 @@ class EntraOAuth2GrantRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.OAUTH2GRANT_REMOVE, commands.OAUTH2GRANT_REMOVE); - const removeOauth2Grant: () => Promise = async (): Promise => { if (this.verbose) { await logger.logToStderr(`Removing OAuth2 permissions...`); diff --git a/src/m365/entra/commands/oauth2grant/oauth2grant-set.spec.ts b/src/m365/entra/commands/oauth2grant/oauth2grant-set.spec.ts index 57f05a617a8..897c0c64a73 100644 --- a/src/m365/entra/commands/oauth2grant/oauth2grant-set.spec.ts +++ b/src/m365/entra/commands/oauth2grant/oauth2grant-set.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './oauth2grant-set.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.OAUTH2GRANT_SET, () => { let log: string[]; @@ -62,16 +61,6 @@ describe(commands.OAUTH2GRANT_SET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.OAUTH2GRANT_SET]); - }); - it('updates OAuth2 permission grant (debug)', async () => { sinon.stub(request, 'patch').callsFake(async (opts) => { if ((opts.url as string).indexOf(`/v1.0/oauth2PermissionGrants/YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek`) > -1) { diff --git a/src/m365/entra/commands/oauth2grant/oauth2grant-set.ts b/src/m365/entra/commands/oauth2grant/oauth2grant-set.ts index f06fbb66a2d..14c27647eb7 100644 --- a/src/m365/entra/commands/oauth2grant/oauth2grant-set.ts +++ b/src/m365/entra/commands/oauth2grant/oauth2grant-set.ts @@ -3,7 +3,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { formatting } from '../../../../utils/formatting.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -24,10 +23,6 @@ class EntraOAuth2GrantSetCommand extends GraphCommand { return 'Update OAuth2 permissions for the service principal'; } - public alias(): string[] | undefined { - return [aadCommands.OAUTH2GRANT_SET]; - } - constructor() { super(); @@ -46,8 +41,6 @@ class EntraOAuth2GrantSetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.OAUTH2GRANT_SET, commands.OAUTH2GRANT_SET); - if (this.verbose) { await logger.logToStderr(`Updating OAuth2 permissions...`); } diff --git a/src/m365/entra/commands/policy/policy-list.spec.ts b/src/m365/entra/commands/policy/policy-list.spec.ts index 9f9628d1350..b563b4e0657 100644 --- a/src/m365/entra/commands/policy/policy-list.spec.ts +++ b/src/m365/entra/commands/policy/policy-list.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './policy-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.POLICY_LIST, () => { let log: string[]; @@ -65,16 +64,6 @@ describe(commands.POLICY_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.POLICY_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName', 'isOrganizationDefault']); }); diff --git a/src/m365/entra/commands/policy/policy-list.ts b/src/m365/entra/commands/policy/policy-list.ts index 138fb52a536..edd239f17f2 100644 --- a/src/m365/entra/commands/policy/policy-list.ts +++ b/src/m365/entra/commands/policy/policy-list.ts @@ -2,7 +2,6 @@ import { Logger } from '../../../../cli/Logger.js'; import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -34,10 +33,6 @@ class EntraPolicyListCommand extends GraphCommand { return 'Returns policies from Entra ID'; } - public alias(): string[] | undefined { - return [aadCommands.POLICY_LIST]; - } - constructor() { super(); @@ -83,8 +78,6 @@ class EntraPolicyListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.POLICY_LIST, commands.POLICY_LIST); - const policyType: string = args.options.type ? args.options.type.toLowerCase() : 'all'; try { diff --git a/src/m365/entra/commands/siteclassification/siteclassification-disable.spec.ts b/src/m365/entra/commands/siteclassification/siteclassification-disable.spec.ts index 61e16367733..39090557a71 100644 --- a/src/m365/entra/commands/siteclassification/siteclassification-disable.spec.ts +++ b/src/m365/entra/commands/siteclassification/siteclassification-disable.spec.ts @@ -11,7 +11,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './siteclassification-disable.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.SITECLASSIFICATION_DISABLE, () => { let log: string[]; @@ -69,16 +68,6 @@ describe(commands.SITECLASSIFICATION_DISABLE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.SITECLASSIFICATION_DISABLE]); - }); - it('prompts before disabling siteclassification when force option not passed', async () => { await command.action(logger, { options: {} }); diff --git a/src/m365/entra/commands/siteclassification/siteclassification-disable.ts b/src/m365/entra/commands/siteclassification/siteclassification-disable.ts index c2e5432ee34..b34fd79a5c5 100644 --- a/src/m365/entra/commands/siteclassification/siteclassification-disable.ts +++ b/src/m365/entra/commands/siteclassification/siteclassification-disable.ts @@ -5,7 +5,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -24,10 +23,6 @@ class EntraSiteClassificationDisableCommand extends GraphCommand { return 'Disables site classification'; } - public alias(): string[] | undefined { - return [aadCommands.SITECLASSIFICATION_DISABLE]; - } - constructor() { super(); @@ -52,8 +47,6 @@ class EntraSiteClassificationDisableCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.SITECLASSIFICATION_DISABLE, commands.SITECLASSIFICATION_DISABLE); - const disableSiteClassification = async (): Promise => { try { let requestOptions: CliRequestOptions = { diff --git a/src/m365/entra/commands/siteclassification/siteclassification-enable.spec.ts b/src/m365/entra/commands/siteclassification/siteclassification-enable.spec.ts index 9e4c640ba6e..66b385a2ad3 100644 --- a/src/m365/entra/commands/siteclassification/siteclassification-enable.spec.ts +++ b/src/m365/entra/commands/siteclassification/siteclassification-enable.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './siteclassification-enable.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.SITECLASSIFICATION_ENABLE, () => { let log: string[]; @@ -59,16 +58,6 @@ describe(commands.SITECLASSIFICATION_ENABLE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.SITECLASSIFICATION_ENABLE]); - }); - it('handles Microsoft 365 Tenant siteclassification missing DirectorySettingTemplate', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groupSettingTemplates`) { diff --git a/src/m365/entra/commands/siteclassification/siteclassification-enable.ts b/src/m365/entra/commands/siteclassification/siteclassification-enable.ts index 3847528c54c..69afbb7cd57 100644 --- a/src/m365/entra/commands/siteclassification/siteclassification-enable.ts +++ b/src/m365/entra/commands/siteclassification/siteclassification-enable.ts @@ -4,7 +4,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -26,10 +25,6 @@ class EntraSiteClassificationEnableCommand extends GraphCommand { return 'Enables site classification configuration'; } - public alias(): string[] | undefined { - return [aadCommands.SITECLASSIFICATION_ENABLE]; - } - constructor() { super(); @@ -64,8 +59,6 @@ class EntraSiteClassificationEnableCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.SITECLASSIFICATION_ENABLE, commands.SITECLASSIFICATION_ENABLE); - try { let requestOptions: CliRequestOptions = { url: `${this.resource}/v1.0/groupSettingTemplates`, diff --git a/src/m365/entra/commands/siteclassification/siteclassification-get.spec.ts b/src/m365/entra/commands/siteclassification/siteclassification-get.spec.ts index cdc4a5ad3ea..444b2bb304e 100644 --- a/src/m365/entra/commands/siteclassification/siteclassification-get.spec.ts +++ b/src/m365/entra/commands/siteclassification/siteclassification-get.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './siteclassification-get.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.SITECLASSIFICATION_GET, () => { let log: string[]; @@ -60,16 +59,6 @@ describe(commands.SITECLASSIFICATION_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.SITECLASSIFICATION_GET]); - }); - it('handles Microsoft 365 Tenant siteclassification is not enabled', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groupSettings`) { diff --git a/src/m365/entra/commands/siteclassification/siteclassification-get.ts b/src/m365/entra/commands/siteclassification/siteclassification-get.ts index dc3232003ce..ec2e5203799 100644 --- a/src/m365/entra/commands/siteclassification/siteclassification-get.ts +++ b/src/m365/entra/commands/siteclassification/siteclassification-get.ts @@ -4,7 +4,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { SiteClassificationSettings } from './SiteClassificationSettings.js'; -import aadCommands from '../../aadCommands.js'; class EntraSiteClassificationGetCommand extends GraphCommand { public get name(): string { @@ -15,13 +14,7 @@ class EntraSiteClassificationGetCommand extends GraphCommand { return 'Gets site classification configuration'; } - public alias(): string[] | undefined { - return [aadCommands.SITECLASSIFICATION_GET]; - } - public async commandAction(logger: Logger): Promise { - await this.showDeprecationWarning(logger, aadCommands.SITECLASSIFICATION_GET, commands.SITECLASSIFICATION_GET); - try { const requestOptions: CliRequestOptions = { url: `${this.resource}/v1.0/groupSettings`, diff --git a/src/m365/entra/commands/siteclassification/siteclassification-set.spec.ts b/src/m365/entra/commands/siteclassification/siteclassification-set.spec.ts index 59b239434ce..231cec97a2e 100644 --- a/src/m365/entra/commands/siteclassification/siteclassification-set.spec.ts +++ b/src/m365/entra/commands/siteclassification/siteclassification-set.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './siteclassification-set.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.SITECLASSIFICATION_SET, () => { let log: string[]; @@ -63,16 +62,6 @@ describe(commands.SITECLASSIFICATION_SET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.SITECLASSIFICATION_SET]); - }); - it('fails validation if none of the options are specified', async () => { const actual = await command.validate({ options: { diff --git a/src/m365/entra/commands/siteclassification/siteclassification-set.ts b/src/m365/entra/commands/siteclassification/siteclassification-set.ts index 621405ba2d5..d0322a8df28 100644 --- a/src/m365/entra/commands/siteclassification/siteclassification-set.ts +++ b/src/m365/entra/commands/siteclassification/siteclassification-set.ts @@ -4,7 +4,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -26,10 +25,6 @@ class EntraSiteClassificationSetCommand extends GraphCommand { return 'Updates site classification configuration'; } - public alias(): string[] | undefined { - return [aadCommands.SITECLASSIFICATION_SET]; - } - constructor() { super(); @@ -81,8 +76,6 @@ class EntraSiteClassificationSetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.SITECLASSIFICATION_SET, commands.SITECLASSIFICATION_SET); - try { let requestOptions: CliRequestOptions = { url: `${this.resource}/v1.0/groupSettings`, diff --git a/src/m365/entra/commands/user/user-add.spec.ts b/src/m365/entra/commands/user/user-add.spec.ts index 80581d2ac93..ca1bd15add3 100644 --- a/src/m365/entra/commands/user/user-add.spec.ts +++ b/src/m365/entra/commands/user/user-add.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-add.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_ADD, () => { const graphBaseUrl = 'https://graph.microsoft.com/v1.0/users'; @@ -124,16 +123,6 @@ describe(commands.USER_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_ADD]); - }); - it('creates Microsoft Entra user using a preset password but requiring the user to change it the next login', async () => { sinon.stub(request, 'post').callsFake(async (opts) => { if (opts.url === graphBaseUrl) { diff --git a/src/m365/entra/commands/user/user-add.ts b/src/m365/entra/commands/user/user-add.ts index 3f6643e892c..2af1e60bd80 100644 --- a/src/m365/entra/commands/user/user-add.ts +++ b/src/m365/entra/commands/user/user-add.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface ExtendedUser extends User { password: string; @@ -44,10 +43,6 @@ class EntraUserAddCommand extends GraphCommand { return 'Creates a new user'; } - public alias(): string[] | undefined { - return [aadCommands.USER_ADD]; - } - public allowUnknownOptions(): boolean | undefined { return true; } @@ -206,8 +201,6 @@ class EntraUserAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_ADD, commands.USER_ADD); - if (this.verbose) { await logger.logToStderr(`Adding user to AAD with displayName ${args.options.displayName} and userPrincipalName ${args.options.userName}`); } diff --git a/src/m365/entra/commands/user/user-get.spec.ts b/src/m365/entra/commands/user/user-get.spec.ts index 39d1652524e..991de5d6de2 100644 --- a/src/m365/entra/commands/user/user-get.spec.ts +++ b/src/m365/entra/commands/user/user-get.spec.ts @@ -14,7 +14,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-get.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; import { entraUser } from '../../../../utils/entraUser.js'; import { formatting } from '../../../../utils/formatting.js'; @@ -86,16 +85,6 @@ describe(commands.USER_GET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_GET]); - }); - it('retrieves user using id', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/users/${userId}`) { @@ -139,7 +128,7 @@ describe(commands.USER_GET, () => { it('retrieves user using user name', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName) }`) { + if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName)}`) { return resultValue; } @@ -185,7 +174,7 @@ describe(commands.USER_GET, () => { "mail": "john.doe@contoso.onmicrosoft.com" }; sinon.stub(request, 'get').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName) }?$expand=manager($select=displayName,userPrincipalName,id,mail)`) { + if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName)}?$expand=manager($select=displayName,userPrincipalName,id,mail)`) { return resultValueWithManger; } @@ -198,7 +187,7 @@ describe(commands.USER_GET, () => { it('retrieves user using @meusername token', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName) }`) { + if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName)}`) { return resultValue; } @@ -227,7 +216,7 @@ describe(commands.USER_GET, () => { it('retrieves only the specified properties', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName) }?$select=id,mail`) { + if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName)}?$select=id,mail`) { return { "id": "userId", "mail": null }; } @@ -276,7 +265,7 @@ describe(commands.USER_GET, () => { await assert.rejects(command.action(logger, { options: { userName: userName } } as any), new CommandError(`Resource '${userName}' does not exist or one of its queried reference-property objects are not present.`)); }); - + it('fails validation if id or email or userName options are not passed', async () => { sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => { if (settingName === settingsNames.prompt) { diff --git a/src/m365/entra/commands/user/user-get.ts b/src/m365/entra/commands/user/user-get.ts index e022aeeedaa..f59a5258116 100644 --- a/src/m365/entra/commands/user/user-get.ts +++ b/src/m365/entra/commands/user/user-get.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; import { entraUser } from '../../../../utils/entraUser.js'; import { formatting } from '../../../../utils/formatting.js'; @@ -30,10 +29,6 @@ class EntraUserGetCommand extends GraphCommand { return 'Gets information about the specified user'; } - public alias(): string[] | undefined { - return [aadCommands.USER_GET]; - } - constructor() { super(); @@ -97,8 +92,6 @@ class EntraUserGetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_GET, commands.USER_GET); - try { let userIdOrPrincipalName = args.options.id; diff --git a/src/m365/entra/commands/user/user-guest-add.spec.ts b/src/m365/entra/commands/user/user-guest-add.spec.ts index 7be7b809be1..edee1366026 100644 --- a/src/m365/entra/commands/user/user-guest-add.spec.ts +++ b/src/m365/entra/commands/user/user-guest-add.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-guest-add.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_GUEST_ADD, () => { const emailAddress = 'john.doe@contoso.com'; @@ -86,16 +85,6 @@ describe(commands.USER_GUEST_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_GUEST_ADD]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'inviteRedeemUrl', 'invitedUserDisplayName', 'invitedUserEmailAddress', 'invitedUserType', 'resetRedemption', 'sendInvitationMessage', 'status']); }); diff --git a/src/m365/entra/commands/user/user-guest-add.ts b/src/m365/entra/commands/user/user-guest-add.ts index 320efed18a0..9f41a752c47 100644 --- a/src/m365/entra/commands/user/user-guest-add.ts +++ b/src/m365/entra/commands/user/user-guest-add.ts @@ -2,7 +2,6 @@ import { Logger } from '../../../../cli/Logger.js'; import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -28,10 +27,6 @@ class EntraUserGuestAddCommand extends GraphCommand { return 'Invite an external user to the organization'; } - public alias(): string[] | undefined { - return [aadCommands.USER_GUEST_ADD]; - } - constructor() { super(); @@ -83,8 +78,6 @@ class EntraUserGuestAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_GUEST_ADD, commands.USER_GUEST_ADD); - try { const requestOptions: CliRequestOptions = { url: `${this.resource}/v1.0/invitations`, diff --git a/src/m365/entra/commands/user/user-hibp.spec.ts b/src/m365/entra/commands/user/user-hibp.spec.ts index 71fa429da01..62c0aef613e 100644 --- a/src/m365/entra/commands/user/user-hibp.spec.ts +++ b/src/m365/entra/commands/user/user-hibp.spec.ts @@ -13,7 +13,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-hibp.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_HIBP, () => { let log: string[]; @@ -63,16 +62,6 @@ describe(commands.USER_HIBP, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_HIBP]); - }); - it('fails validation if userName and apiKey is not specified', async () => { sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => { if (settingName === settingsNames.prompt) { diff --git a/src/m365/entra/commands/user/user-hibp.ts b/src/m365/entra/commands/user/user-hibp.ts index 04e9567094a..70ed76b2710 100644 --- a/src/m365/entra/commands/user/user-hibp.ts +++ b/src/m365/entra/commands/user/user-hibp.ts @@ -4,7 +4,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { formatting } from '../../../../utils/formatting.js'; import { validation } from '../../../../utils/validation.js'; import AnonymousCommand from '../../../base/AnonymousCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -26,10 +25,6 @@ class EntraUserHibpCommand extends AnonymousCommand { return 'Allows you to retrieve all accounts that have been pwned with the specified username'; } - public alias(): string[] | undefined { - return [aadCommands.USER_HIBP]; - } - constructor() { super(); @@ -73,8 +68,6 @@ class EntraUserHibpCommand extends AnonymousCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_HIBP, commands.USER_HIBP); - try { const requestOptions: CliRequestOptions = { url: `https://haveibeenpwned.com/api/v3/breachedaccount/${formatting.encodeQueryParameter(args.options.userName)}${(args.options.domain ? `?domain=${formatting.encodeQueryParameter(args.options.domain)}` : '')}`, diff --git a/src/m365/entra/commands/user/user-license-add.spec.ts b/src/m365/entra/commands/user/user-license-add.spec.ts index f50e59b2e62..a6648d63c90 100644 --- a/src/m365/entra/commands/user/user-license-add.spec.ts +++ b/src/m365/entra/commands/user/user-license-add.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-license-add.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_LICENSE_ADD, () => { let commandInfo: CommandInfo; @@ -83,16 +82,6 @@ describe(commands.USER_LICENSE_ADD, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_LICENSE_ADD]); - }); - it('fails validation if ids is not a valid guid.', async () => { const actual = await command.validate({ options: { diff --git a/src/m365/entra/commands/user/user-license-add.ts b/src/m365/entra/commands/user/user-license-add.ts index 8471cdca5ed..9a8ed9aecc7 100644 --- a/src/m365/entra/commands/user/user-license-add.ts +++ b/src/m365/entra/commands/user/user-license-add.ts @@ -3,7 +3,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -25,10 +24,6 @@ class EntraUserLicenseAddCommand extends GraphCommand { return 'Assigns a license to a user'; } - public alias(): string[] | undefined { - return [aadCommands.USER_LICENSE_ADD]; - } - constructor() { super(); @@ -84,8 +79,6 @@ class EntraUserLicenseAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_LICENSE_ADD, commands.USER_LICENSE_ADD); - const addLicenses = args.options.ids.split(',').map(x => { return { "disabledPlans": [], "skuId": x }; }); const requestBody = { "addLicenses": addLicenses, "removeLicenses": [] }; diff --git a/src/m365/entra/commands/user/user-license-list.spec.ts b/src/m365/entra/commands/user/user-license-list.spec.ts index 4d07ff4a961..6936039da9f 100644 --- a/src/m365/entra/commands/user/user-license-list.spec.ts +++ b/src/m365/entra/commands/user/user-license-list.spec.ts @@ -13,7 +13,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-license-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_LICENSE_LIST, () => { const userId = '59f80e08-24b1-41f8-8586-16765fd830d3'; @@ -103,16 +102,6 @@ describe(commands.USER_LICENSE_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_LICENSE_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'skuId', 'skuPartNumber']); }); diff --git a/src/m365/entra/commands/user/user-license-list.ts b/src/m365/entra/commands/user/user-license-list.ts index 2d3437c393e..bcb2a8d09de 100644 --- a/src/m365/entra/commands/user/user-license-list.ts +++ b/src/m365/entra/commands/user/user-license-list.ts @@ -6,7 +6,6 @@ import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import auth from '../../../../Auth.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -26,10 +25,6 @@ class EntraUserLicenseListCommand extends GraphCommand { return 'Lists the license details for a given user'; } - public alias(): string[] | undefined { - return [aadCommands.USER_LICENSE_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'skuId', 'skuPartNumber']; } @@ -88,8 +83,6 @@ class EntraUserLicenseListCommand extends GraphCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[this.resource].accessToken); - await this.showDeprecationWarning(logger, aadCommands.USER_LICENSE_LIST, commands.USER_LICENSE_LIST); - if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName) { this.handleError(`Specify at least 'userId' or 'userName' when using application permissions.`); } diff --git a/src/m365/entra/commands/user/user-license-remove.spec.ts b/src/m365/entra/commands/user/user-license-remove.spec.ts index 09602532ef6..c82a1ebde6a 100644 --- a/src/m365/entra/commands/user/user-license-remove.spec.ts +++ b/src/m365/entra/commands/user/user-license-remove.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-license-remove.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_LICENSE_REMOVE, () => { let commandInfo: CommandInfo; @@ -77,16 +76,6 @@ describe(commands.USER_LICENSE_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_LICENSE_REMOVE]); - }); - it('fails validation if ids is not a valid guid.', async () => { const actual = await command.validate({ options: { diff --git a/src/m365/entra/commands/user/user-license-remove.ts b/src/m365/entra/commands/user/user-license-remove.ts index 4e03576eccd..9afcbfcb811 100644 --- a/src/m365/entra/commands/user/user-license-remove.ts +++ b/src/m365/entra/commands/user/user-license-remove.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import { cli } from '../../../../cli/cli.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -28,10 +27,6 @@ class EntraUserLicenseRemoveCommand extends GraphCommand { return 'Removes a license from a user'; } - public alias(): string[] | undefined { - return [aadCommands.USER_LICENSE_REMOVE]; - } - constructor() { super(); @@ -95,8 +90,6 @@ class EntraUserLicenseRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: any): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_LICENSE_REMOVE, commands.USER_LICENSE_REMOVE); - if (this.verbose) { await logger.logToStderr(`Removing the licenses for the user '${args.options.userId || args.options.userName}'...`); } diff --git a/src/m365/entra/commands/user/user-list.spec.ts b/src/m365/entra/commands/user/user-list.spec.ts index df51e8622d7..36120d661ba 100644 --- a/src/m365/entra/commands/user/user-list.spec.ts +++ b/src/m365/entra/commands/user/user-list.spec.ts @@ -13,7 +13,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_LIST, () => { let commandInfo: CommandInfo; @@ -65,16 +64,6 @@ describe(commands.USER_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_LIST]); - }); - it('fails validation if type is not a valid user type', async () => { const actual = await command.validate({ options: { type: 'invalid' } }, commandInfo); assert.notStrictEqual(actual, true); diff --git a/src/m365/entra/commands/user/user-list.ts b/src/m365/entra/commands/user/user-list.ts index 1edfd4b30ca..fdce96baafc 100644 --- a/src/m365/entra/commands/user/user-list.ts +++ b/src/m365/entra/commands/user/user-list.ts @@ -5,7 +5,6 @@ import { formatting } from '../../../../utils/formatting.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -27,10 +26,6 @@ class EntraUserListCommand extends GraphCommand { return 'Lists users matching specified criteria'; } - public alias(): string[] | undefined { - return [aadCommands.USER_LIST]; - } - public allowUnknownOptions(): boolean | undefined { return true; } @@ -86,8 +81,6 @@ class EntraUserListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_LIST, commands.USER_LIST); - try { let url = `${this.resource}/v1.0/users`; diff --git a/src/m365/entra/commands/user/user-password-validate.spec.ts b/src/m365/entra/commands/user/user-password-validate.spec.ts index 6e3facf5272..8834d5f6d43 100644 --- a/src/m365/entra/commands/user/user-password-validate.spec.ts +++ b/src/m365/entra/commands/user/user-password-validate.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-password-validate.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_PASSWORD_VALIDATE, () => { let log: string[]; @@ -61,16 +60,6 @@ describe(commands.USER_PASSWORD_VALIDATE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_PASSWORD_VALIDATE]); - }); - it('password is too short', async () => { sinon.stub(request, 'post').callsFake(async opts => { if (opts.url === 'https://graph.microsoft.com/beta/users/validatePassword' && diff --git a/src/m365/entra/commands/user/user-password-validate.ts b/src/m365/entra/commands/user/user-password-validate.ts index 30ea1a691ae..ed88f2d94b1 100644 --- a/src/m365/entra/commands/user/user-password-validate.ts +++ b/src/m365/entra/commands/user/user-password-validate.ts @@ -2,7 +2,6 @@ import { Logger } from '../../../../cli/Logger.js'; import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -22,10 +21,6 @@ class EntraUserPasswordValidateCommand extends GraphCommand { return "Check a user's password against the organization's password validation policy"; } - public alias(): string[] | undefined { - return [aadCommands.USER_PASSWORD_VALIDATE]; - } - constructor() { super(); @@ -41,8 +36,6 @@ class EntraUserPasswordValidateCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_PASSWORD_VALIDATE, commands.USER_PASSWORD_VALIDATE); - try { const requestOptions: CliRequestOptions = { url: `${this.resource}/beta/users/validatePassword`, diff --git a/src/m365/entra/commands/user/user-recyclebinitem-clear.spec.ts b/src/m365/entra/commands/user/user-recyclebinitem-clear.spec.ts index 5d52c4b76f3..9e5e59a2008 100644 --- a/src/m365/entra/commands/user/user-recyclebinitem-clear.spec.ts +++ b/src/m365/entra/commands/user/user-recyclebinitem-clear.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-recyclebinitem-clear.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_RECYCLEBINITEM_CLEAR, () => { let log: string[]; @@ -74,16 +73,6 @@ describe(commands.USER_RECYCLEBINITEM_CLEAR, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_RECYCLEBINITEM_CLEAR]); - }); - it('removes a single user when prompt confirmed', async () => { let amountOfBatches = 0; diff --git a/src/m365/entra/commands/user/user-recyclebinitem-clear.ts b/src/m365/entra/commands/user/user-recyclebinitem-clear.ts index 861fb46e7d4..91a6bc37006 100644 --- a/src/m365/entra/commands/user/user-recyclebinitem-clear.ts +++ b/src/m365/entra/commands/user/user-recyclebinitem-clear.ts @@ -6,7 +6,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -25,10 +24,6 @@ class EntraUserRecycleBinItemClearCommand extends GraphCommand { return 'Removes all users from the tenant recycle bin'; } - public alias(): string[] | undefined { - return [aadCommands.USER_RECYCLEBINITEM_CLEAR]; - } - constructor() { super(); @@ -53,8 +48,6 @@ class EntraUserRecycleBinItemClearCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_RECYCLEBINITEM_CLEAR, commands.USER_RECYCLEBINITEM_CLEAR); - const clearRecycleBinUsers = async (): Promise => { try { const users = await odata.getAllItems(`${this.resource}/v1.0/directory/deletedItems/microsoft.graph.user?$select=id`); diff --git a/src/m365/entra/commands/user/user-recyclebinitem-list.spec.ts b/src/m365/entra/commands/user/user-recyclebinitem-list.spec.ts index 7c68be3cb6b..a49b69cfdf5 100644 --- a/src/m365/entra/commands/user/user-recyclebinitem-list.spec.ts +++ b/src/m365/entra/commands/user/user-recyclebinitem-list.spec.ts @@ -10,7 +10,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-recyclebinitem-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_RECYCLEBINITEM_LIST, () => { const deletedUsersResponse = [{ "businessPhones": [], "displayName": "John Doe", "givenName": "John Doe", "jobTitle": "Developer", "mail": "john@contoso.com", "mobilePhone": "0476345130", "officeLocation": "Washington", "preferredLanguage": "nl-BE", "surname": "John", "userPrincipalName": "7e06b56615f340138bf879874d52e68ajohn@contoso.com", "id": "7e06b566-15f3-4013-8bf8-79874d52e68a" }]; @@ -63,16 +62,6 @@ describe(commands.USER_RECYCLEBINITEM_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_RECYCLEBINITEM_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'displayName', 'userPrincipalName']); }); diff --git a/src/m365/entra/commands/user/user-recyclebinitem-list.ts b/src/m365/entra/commands/user/user-recyclebinitem-list.ts index e43e6f910c2..a9da1950cac 100644 --- a/src/m365/entra/commands/user/user-recyclebinitem-list.ts +++ b/src/m365/entra/commands/user/user-recyclebinitem-list.ts @@ -3,7 +3,6 @@ import { Logger } from '../../../../cli/Logger.js'; import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; class EntraUserRecycleBinItemListCommand extends GraphCommand { public get name(): string { @@ -14,17 +13,11 @@ class EntraUserRecycleBinItemListCommand extends GraphCommand { return 'Lists users from the recycle bin in the current tenant'; } - public alias(): string[] | undefined { - return [aadCommands.USER_RECYCLEBINITEM_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'displayName', 'userPrincipalName']; } public async commandAction(logger: Logger): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_RECYCLEBINITEM_LIST, commands.USER_RECYCLEBINITEM_LIST); - if (this.verbose) { await logger.logToStderr('Retrieving users from the recycle bin...'); } diff --git a/src/m365/entra/commands/user/user-recyclebinitem-remove.spec.ts b/src/m365/entra/commands/user/user-recyclebinitem-remove.spec.ts index 5fb87f6542d..3c5725df198 100644 --- a/src/m365/entra/commands/user/user-recyclebinitem-remove.spec.ts +++ b/src/m365/entra/commands/user/user-recyclebinitem-remove.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-recyclebinitem-remove.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_RECYCLEBINITEM_REMOVE, () => { const validUserId = 'd839826a-81bf-4c38-8f80-f150d11ce6c7'; @@ -73,16 +72,6 @@ describe(commands.USER_RECYCLEBINITEM_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_RECYCLEBINITEM_REMOVE]); - }); - it('removes the user when prompt confirmed', async () => { sinonUtil.restore(cli.promptForConfirmation); sinon.stub(cli, 'promptForConfirmation').resolves(true); diff --git a/src/m365/entra/commands/user/user-recyclebinitem-remove.ts b/src/m365/entra/commands/user/user-recyclebinitem-remove.ts index 56f8c39f213..191c3ec74f7 100644 --- a/src/m365/entra/commands/user/user-recyclebinitem-remove.ts +++ b/src/m365/entra/commands/user/user-recyclebinitem-remove.ts @@ -4,7 +4,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -25,10 +24,6 @@ class EntraUserRecycleBinItemRemoveCommand extends GraphCommand { return 'Removes a user from the recycle bin in the current tenant'; } - public alias(): string[] | undefined { - return [aadCommands.USER_RECYCLEBINITEM_REMOVE]; - } - constructor() { super(); @@ -69,8 +64,6 @@ class EntraUserRecycleBinItemRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_RECYCLEBINITEM_REMOVE, commands.USER_RECYCLEBINITEM_REMOVE); - const clearRecycleBinItem: () => Promise = async (): Promise => { if (this.verbose) { await logger.logToStderr(`Permanently deleting user with id ${args.options.id} from Microsoft Entra ID`); diff --git a/src/m365/entra/commands/user/user-recyclebinitem-restore.spec.ts b/src/m365/entra/commands/user/user-recyclebinitem-restore.spec.ts index 41acd7cda87..79a12f9b9d6 100644 --- a/src/m365/entra/commands/user/user-recyclebinitem-restore.spec.ts +++ b/src/m365/entra/commands/user/user-recyclebinitem-restore.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-recyclebinitem-restore.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_RECYCLEBINITEM_RESTORE, () => { const validUserId = 'd839826a-81bf-4c38-8f80-f150d11ce6c7'; @@ -82,16 +81,6 @@ describe(commands.USER_RECYCLEBINITEM_RESTORE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_RECYCLEBINITEM_RESTORE]); - }); - it('restores the user from the recycle bin', async () => { sinon.stub(request, 'post').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/directory/deletedItems/${validUserId}/restore`) { diff --git a/src/m365/entra/commands/user/user-recyclebinitem-restore.ts b/src/m365/entra/commands/user/user-recyclebinitem-restore.ts index f66f0c16f05..52e392cfd98 100644 --- a/src/m365/entra/commands/user/user-recyclebinitem-restore.ts +++ b/src/m365/entra/commands/user/user-recyclebinitem-restore.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -24,10 +23,6 @@ class EntraUserRecycleBinItemRestoreCommand extends GraphCommand { return 'Restores a user from the tenant recycle bin'; } - public alias(): string[] | undefined { - return [aadCommands.USER_RECYCLEBINITEM_RESTORE]; - } - constructor() { super(); @@ -56,8 +51,6 @@ class EntraUserRecycleBinItemRestoreCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_RECYCLEBINITEM_RESTORE, commands.USER_RECYCLEBINITEM_RESTORE); - if (this.verbose) { await logger.logToStderr(`Restoring user with id ${args.options.id} from the recycle bin.`); } diff --git a/src/m365/entra/commands/user/user-registrationdetails-list.spec.ts b/src/m365/entra/commands/user/user-registrationdetails-list.spec.ts index b3c87ee1dcf..e5ee0099f85 100644 --- a/src/m365/entra/commands/user/user-registrationdetails-list.spec.ts +++ b/src/m365/entra/commands/user/user-registrationdetails-list.spec.ts @@ -2,7 +2,6 @@ import assert from 'assert'; import sinon from 'sinon'; import auth from '../../../../Auth.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; import request from '../../../../request.js'; import command from './user-registrationdetails-list.js'; import { telemetry } from '../../../../telemetry.js'; @@ -133,16 +132,6 @@ describe(commands.USER_REGISTRATIONDETAILS_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_REGISTRATIONDETAILS_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['userPrincipalName', 'methodsRegistered', 'lastUpdatedDateTime']); }); diff --git a/src/m365/entra/commands/user/user-registrationdetails-list.ts b/src/m365/entra/commands/user/user-registrationdetails-list.ts index 960ff6cf6bb..9d8b8507c1c 100644 --- a/src/m365/entra/commands/user/user-registrationdetails-list.ts +++ b/src/m365/entra/commands/user/user-registrationdetails-list.ts @@ -2,7 +2,6 @@ import GlobalOptions from '../../../../GlobalOptions.js'; import { Logger } from '../../../../cli/Logger.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; import { odata } from '../../../../utils/odata.js'; import { UserRegistrationDetails } from '@microsoft/microsoft-graph-types'; import { entraUser } from '../../../../utils/entraUser.js'; @@ -42,10 +41,6 @@ class EntraUserRegistrationDetailsListCommand extends GraphCommand { return 'Retrieves a list of the authentication methods registered for users'; } - public alias(): string[] | undefined { - return [aadCommands.USER_REGISTRATIONDETAILS_LIST]; - } - public defaultProperties(): string[] | undefined { return ['userPrincipalName', 'methodsRegistered', 'lastUpdatedDateTime']; } diff --git a/src/m365/entra/commands/user/user-remove.spec.ts b/src/m365/entra/commands/user/user-remove.spec.ts index 3bbe35bcb3e..b18c879a3be 100644 --- a/src/m365/entra/commands/user/user-remove.spec.ts +++ b/src/m365/entra/commands/user/user-remove.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-remove.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_REMOVE, () => { let commandInfo: CommandInfo; @@ -75,16 +74,6 @@ describe(commands.USER_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_REMOVE]); - }); - it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { diff --git a/src/m365/entra/commands/user/user-remove.ts b/src/m365/entra/commands/user/user-remove.ts index 2279e334076..76025701f98 100644 --- a/src/m365/entra/commands/user/user-remove.ts +++ b/src/m365/entra/commands/user/user-remove.ts @@ -5,7 +5,6 @@ import request, { CliRequestOptions } from '../../../../request.js'; import { validation } from '../../../../utils/validation.js'; import { cli } from '../../../../cli/cli.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -27,10 +26,6 @@ class EntraUserRemoveCommand extends GraphCommand { return 'Removes a specific user'; } - public alias(): string[] | undefined { - return [aadCommands.USER_REMOVE]; - } - constructor() { super(); @@ -87,8 +82,6 @@ class EntraUserRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: any): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_REMOVE, commands.USER_REMOVE); - if (this.verbose) { await logger.logToStderr(`Removing user '${args.options.id || args.options.userName}'...`); } diff --git a/src/m365/entra/commands/user/user-set.spec.ts b/src/m365/entra/commands/user/user-set.spec.ts index 12c30875988..3da3de2bf43 100644 --- a/src/m365/entra/commands/user/user-set.spec.ts +++ b/src/m365/entra/commands/user/user-set.spec.ts @@ -15,7 +15,6 @@ import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-set.js'; import { settingsNames } from '../../../../settingsNames.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_SET, () => { const currentPassword = '9%9OLUg6p@Ra'; @@ -95,16 +94,6 @@ describe(commands.USER_SET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_SET]); - }); - it('fails validation if neither the id nor the userName are specified', async () => { sinon.stub(cli, 'getSettingWithDefaultValue').callsFake((settingName, defaultValue) => { if (settingName === settingsNames.prompt) { diff --git a/src/m365/entra/commands/user/user-set.ts b/src/m365/entra/commands/user/user-set.ts index 84cf11eadfe..677261a7477 100644 --- a/src/m365/entra/commands/user/user-set.ts +++ b/src/m365/entra/commands/user/user-set.ts @@ -6,7 +6,6 @@ import { accessToken } from '../../../../utils/accessToken.js'; import { formatting } from '../../../../utils/formatting.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import aadCommands from '../../aadCommands.js'; import commands from '../../commands.js'; interface CommandArgs { @@ -45,10 +44,6 @@ class EntraUserSetCommand extends GraphCommand { return 'Updates information about the specified user'; } - public alias(): string[] | undefined { - return [aadCommands.USER_SET]; - } - public allowUnknownOptions(): boolean | undefined { return true; } @@ -249,8 +244,6 @@ class EntraUserSetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_SET, commands.USER_SET); - try { if (args.options.currentPassword) { if (args.options.id && args.options.id !== accessToken.getUserIdFromAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken)) { diff --git a/src/m365/entra/commands/user/user-signin-list.spec.ts b/src/m365/entra/commands/user/user-signin-list.spec.ts index 0515ced18e8..632be3d30cc 100644 --- a/src/m365/entra/commands/user/user-signin-list.spec.ts +++ b/src/m365/entra/commands/user/user-signin-list.spec.ts @@ -12,7 +12,6 @@ import { session } from '../../../../utils/session.js'; import { sinonUtil } from '../../../../utils/sinonUtil.js'; import commands from '../../commands.js'; import command from './user-signin-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.USER_SIGNIN_LIST, () => { let log: string[]; @@ -192,16 +191,6 @@ describe(commands.USER_SIGNIN_LIST, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.USER_SIGNIN_LIST]); - }); - it('defines correct properties for the default output', () => { assert.deepStrictEqual(command.defaultProperties(), ['id', 'userPrincipalName', 'appId', 'appDisplayName', 'createdDateTime']); }); diff --git a/src/m365/entra/commands/user/user-signin-list.ts b/src/m365/entra/commands/user/user-signin-list.ts index f34dd17cace..afa9ee5eab8 100644 --- a/src/m365/entra/commands/user/user-signin-list.ts +++ b/src/m365/entra/commands/user/user-signin-list.ts @@ -6,7 +6,6 @@ import { odata } from '../../../../utils/odata.js'; import { validation } from '../../../../utils/validation.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -28,10 +27,6 @@ class EntraUserSigninListCommand extends GraphCommand { return 'Retrieves the Entra ID user sign-ins for the tenant'; } - public alias(): string[] | undefined { - return [aadCommands.USER_SIGNIN_LIST]; - } - constructor() { super(); @@ -101,8 +96,6 @@ class EntraUserSigninListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.USER_SIGNIN_LIST, commands.USER_SIGNIN_LIST); - try { let endpoint: string = `${this.resource}/v1.0/auditLogs/signIns`; let filter: string = ""; diff --git a/src/m365/spo/commands/group/group-member-remove.spec.ts b/src/m365/spo/commands/group/group-member-remove.spec.ts index cbccf4c3882..303e4d65037 100644 --- a/src/m365/spo/commands/group/group-member-remove.spec.ts +++ b/src/m365/spo/commands/group/group-member-remove.spec.ts @@ -130,6 +130,40 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { assert(postStub.called); }); + it('Removes Microsoft Entra group from SharePoint group using Microsoft Entra Group Name', async () => { + sinonUtil.restore(cli.promptForConfirmation); + sinon.stub(cli, 'promptForConfirmation').resolves(true); + + sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { + if (command === spoGroupMemberListCommand) { + return ({ + stdout: spoGroupMemberListCommandOutput + }); + } + + throw new CommandError('Unknown case'); + }); + + const postStub = sinon.stub(request, 'post').callsFake(async opts => { + if ((opts.url as string).indexOf('/_api/web/sitegroups/GetByName') > -1) { + return UserRemovalJSONResponse; + } + + throw `Invalid request ${JSON.stringify(opts)}`; + }); + + await command.action(logger, { + options: { + debug: true, + webUrl: "https://contoso.sharepoint.com/sites/SiteA", + groupName: "Site A Visitors", + entraGroupName: "Microsoft Entra Security Group" + } + }); + + assert(postStub.called); + }); + it('Removes Entra group from SharePoint group using Entra Group ID - Without Confirmation Prompt', async () => { sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { if (command === spoGroupMemberListCommand) { @@ -160,6 +194,36 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { assert(postStub.called); }); + it('Removes Microsoft Entra group from SharePoint group using Microsoft Entra Group ID - Without Confirmation Prompt', async () => { + sinon.stub(cli, 'executeCommandWithOutput').callsFake(async (command): Promise => { + if (command === spoGroupMemberListCommand) { + return ({ + stdout: spoGroupMemberListCommandOutput + }); + } + + throw new CommandError('Unknown case'); + }); + + const postStub = sinon.stub(request, 'post').callsFake(async opts => { + if ((opts.url as string).indexOf('/_api/web/sitegroups/GetByName') > -1) { + return UserRemovalJSONResponse; + } + + throw `Invalid request ${JSON.stringify(opts)}`; + }); + await command.action(logger, { + options: { + debug: true, + webUrl: "https://contoso.sharepoint.com/sites/SiteA", + groupName: "Site A Visitors", + entraGroupId: "5786b8e8-c495-4734-b345-756733960730", + force: true + } + }); + assert(postStub.called); + }); + it('Removes Entra group from SharePoint group using Entra Group ID and SharePoint Group ID', async () => { sinonUtil.restore(cli.promptForConfirmation); sinon.stub(cli, 'promptForConfirmation').resolves(true); From 32d39bd8de7bce4a0ccf2a2c27e0ed198d647087 Mon Sep 17 00:00:00 2001 From: Nanddeep Nachan Date: Mon, 26 Aug 2024 17:20:16 +0000 Subject: [PATCH 3/7] build fix --- .../commands/m365group/m365group-user-add.spec.ts | 1 - .../entra/commands/m365group/m365group-user-add.ts | 8 ++++++-- .../commands/m365group/m365group-user-set.spec.ts | 11 ----------- .../entra/commands/m365group/m365group-user-set.ts | 3 --- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/m365/entra/commands/m365group/m365group-user-add.spec.ts b/src/m365/entra/commands/m365group/m365group-user-add.spec.ts index 3c860f33f93..e27c9624cbf 100644 --- a/src/m365/entra/commands/m365group/m365group-user-add.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-user-add.spec.ts @@ -15,7 +15,6 @@ import command from './m365group-user-add.js'; import { settingsNames } from '../../../../settingsNames.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; import { entraUser } from '../../../../utils/entraUser.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_USER_ADD, () => { const groupId = '3f04e370-cbc6-4091-80fe-1d038be2ad06'; diff --git a/src/m365/entra/commands/m365group/m365group-user-add.ts b/src/m365/entra/commands/m365group/m365group-user-add.ts index 7fb4f8acea6..f5eaddf6a10 100644 --- a/src/m365/entra/commands/m365group/m365group-user-add.ts +++ b/src/m365/entra/commands/m365group/m365group-user-add.ts @@ -5,8 +5,6 @@ import { entraGroup } from '../../../../utils/entraGroup.js'; import { validation } from '../../../../utils/validation.js'; import { formatting } from '../../../../utils/formatting.js'; import GraphCommand from '../../../base/GraphCommand.js'; -import teamsCommands from '../../../teams/commands.js'; -import aadCommands from '../../aadCommands.js'; import { entraUser } from '../../../../utils/entraUser.js'; import commands from '../../commands.js'; @@ -130,7 +128,13 @@ class EntraM365GroupUserAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { +<<<<<<< HEAD await this.showDeprecationWarning(logger, aadCommands.M365GROUP_USER_ADD, commands.M365GROUP_USER_ADD); +======= + if (args.options.userName) { + await this.warn(logger, `Option 'userName' is deprecated. Please use 'ids' or 'userNames' instead.`); + } +>>>>>>> 8835d6d1c... build fix try { const providedGroupId: string = await this.getGroupId(logger, args); diff --git a/src/m365/entra/commands/m365group/m365group-user-set.spec.ts b/src/m365/entra/commands/m365group/m365group-user-set.spec.ts index 6c0b85d2c7d..0a2912c336d 100644 --- a/src/m365/entra/commands/m365group/m365group-user-set.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-user-set.spec.ts @@ -14,7 +14,6 @@ import commands from '../../commands.js'; import command from './m365group-user-set.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; import { entraUser } from '../../../../utils/entraUser.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.M365GROUP_USER_SET, () => { const groupId = '630dfae3-6904-4154-acc2-812e11205351'; @@ -72,16 +71,6 @@ describe(commands.M365GROUP_USER_SET, () => { assert.notStrictEqual(command.description, null); }); - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [teamsCommands.USER_SET, aadCommands.M365GROUP_USER_SET]); - }); - it('fails validation if groupId is not a valid GUID', async () => { const actual = await command.validate({ options: { groupId: 'foo', ids: userIds[0], role: 'Member' } }, commandInfo); assert.notStrictEqual(actual, true); diff --git a/src/m365/entra/commands/m365group/m365group-user-set.ts b/src/m365/entra/commands/m365group/m365group-user-set.ts index 69d0d5fc411..be1d9e0d51f 100644 --- a/src/m365/entra/commands/m365group/m365group-user-set.ts +++ b/src/m365/entra/commands/m365group/m365group-user-set.ts @@ -7,7 +7,6 @@ import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { entraGroup } from '../../../../utils/entraGroup.js'; import { entraUser } from '../../../../utils/entraUser.js'; -import aadCommands from '../../aadCommands.js'; interface CommandArgs { options: Options; @@ -132,8 +131,6 @@ class EntraM365GroupUserSetCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_USER_SET, commands.M365GROUP_USER_SET); - if (args.options.userName) { await this.warn(logger, `Option 'userName' is deprecated. Please use 'ids' or 'userNames' instead.`); } From cbd252f440c348a70b5820d5a9853444febbb4de Mon Sep 17 00:00:00 2001 From: Nanddeep Nachan Date: Fri, 6 Sep 2024 17:00:00 +0000 Subject: [PATCH 4/7] build fix --- src/m365/entra/commands/app/app-add.ts | 30 -------------------------- 1 file changed, 30 deletions(-) diff --git a/src/m365/entra/commands/app/app-add.ts b/src/m365/entra/commands/app/app-add.ts index 30c977e28f2..c75d34009d7 100644 --- a/src/m365/entra/commands/app/app-add.ts +++ b/src/m365/entra/commands/app/app-add.ts @@ -10,36 +10,6 @@ import GraphCommand from '../../../base/GraphCommand.js'; import { M365RcJson } from '../../../base/M365RcJson.js'; import commands from '../../commands.js'; -interface ServicePrincipalInfo { - appId: string; - appRoles: { id: string; value: string; }[]; - id: string; - oauth2PermissionScopes: { id: string; value: string; }[]; - servicePrincipalNames: string[]; -} - -interface RequiredResourceAccess { - resourceAppId: string; - resourceAccess: ResourceAccess[]; -} - -interface ResourceAccess { - id: string; - type: string; -} - -interface AppInfo { - appId: string; - // objectId - id: string; - tenantId: string; - secrets?: { - displayName: string; - value: string; - }[]; - requiredResourceAccess: RequiredResourceAccess[]; -} - interface CommandArgs { options: Options; } From 3e5d478488a3f5b61c97e4398787444d48cce85e Mon Sep 17 00:00:00 2001 From: Nanddeep Nachan Date: Wed, 25 Sep 2024 05:19:58 +0000 Subject: [PATCH 5/7] Removed alias blocks fromdocs --- .../administrativeunit-add.mdx | 6 ----- .../administrativeunit-get.mdx | 6 ----- .../administrativeunit-list.mdx | 6 ----- .../administrativeunit-member-add.mdx | 6 ----- .../administrativeunit-member-get.mdx | 6 ----- .../administrativeunit-member-list.mdx | 6 ----- .../administrativeunit-remove.mdx | 6 ----- docs/docs/cmd/entra/app/app-add.mdx | 1 - docs/docs/cmd/entra/app/app-get.mdx | 1 - docs/docs/cmd/entra/app/app-list.mdx | 1 - .../docs/cmd/entra/app/app-permission-add.mdx | 1 - .../cmd/entra/app/app-permission-list.mdx | 6 ----- docs/docs/cmd/entra/app/app-remove.mdx | 1 - docs/docs/cmd/entra/app/app-role-add.mdx | 1 - docs/docs/cmd/entra/app/app-role-list.mdx | 1 - docs/docs/cmd/entra/app/app-role-remove.mdx | 1 - docs/docs/cmd/entra/app/app-set.mdx | 1 - .../approleassignment-add.mdx | 6 ----- .../approleassignment-list.mdx | 6 ----- .../approleassignment-remove.mdx | 6 ----- .../entra/enterpriseapp/enterpriseapp-add.mdx | 1 - .../entra/enterpriseapp/enterpriseapp-get.mdx | 1 - .../enterpriseapp/enterpriseapp-list.mdx | 1 - docs/docs/cmd/entra/group/group-add.mdx | 6 ----- docs/docs/cmd/entra/group/group-get.mdx | 6 ----- docs/docs/cmd/entra/group/group-list.mdx | 6 ----- .../cmd/entra/group/group-member-list.mdx | 6 ----- docs/docs/cmd/entra/group/group-remove.mdx | 6 ----- .../entra/groupsetting/groupsetting-add.mdx | 6 ----- .../entra/groupsetting/groupsetting-get.mdx | 6 ----- .../entra/groupsetting/groupsetting-list.mdx | 6 ----- .../groupsetting/groupsetting-remove.mdx | 6 ----- .../entra/groupsetting/groupsetting-set.mdx | 6 ----- .../groupsettingtemplate-get.mdx | 6 ----- .../groupsettingtemplate-list.mdx | 6 ----- docs/docs/cmd/entra/license/license-list.mdx | 6 ----- .../cmd/entra/m365group/m365group-add.mdx | 6 ----- .../m365group/m365group-conversation-list.mdx | 6 ----- .../m365group-conversation-post-list.mdx | 6 ----- .../cmd/entra/m365group/m365group-get.mdx | 6 ----- .../cmd/entra/m365group/m365group-list.mdx | 6 ----- .../m365group-recyclebinitem-clear.mdx | 6 ----- .../m365group-recyclebinitem-list.mdx | 6 ----- .../m365group-recyclebinitem-remove.mdx | 6 ----- .../m365group-recyclebinitem-restore.mdx | 6 ----- .../cmd/entra/m365group/m365group-remove.mdx | 6 ----- .../cmd/entra/m365group/m365group-renew.mdx | 6 ----- .../m365group-report-activitycounts.mdx | 6 ----- .../m365group-report-activitydetail.mdx | 6 ----- .../m365group-report-activityfilecounts.mdx | 6 ----- .../m365group-report-activitygroupcounts.mdx | 10 ++------ .../m365group-report-activitystorage.mdx | 10 ++------ .../cmd/entra/m365group/m365group-set.mdx | 8 +------ .../cmd/entra/m365group/m365group-teamify.mdx | 16 ++++--------- .../entra/m365group/m365group-user-add.mdx | 16 ++++--------- .../entra/m365group/m365group-user-list.mdx | 6 ----- .../entra/m365group/m365group-user-remove.mdx | 24 ++++++------------- .../entra/m365group/m365group-user-set.mdx | 10 -------- .../cmd/entra/oauth2grant/oauth2grant-add.mdx | 12 +++------- .../entra/oauth2grant/oauth2grant-list.mdx | 8 +------ .../entra/oauth2grant/oauth2grant-remove.mdx | 14 ++++------- .../cmd/entra/oauth2grant/oauth2grant-set.mdx | 12 +++------- docs/docs/cmd/entra/policy/policy-list.mdx | 12 +++------- .../siteclassification-disable.mdx | 12 +++------- .../siteclassification-enable.mdx | 20 ++++++---------- .../siteclassification-get.mdx | 8 +------ .../siteclassification-set.mdx | 22 +++++++---------- docs/docs/cmd/entra/user/user-add.mdx | 14 ++++------- docs/docs/cmd/entra/user/user-get.mdx | 20 ++++++---------- docs/docs/cmd/entra/user/user-guest-add.mdx | 12 +++------- docs/docs/cmd/entra/user/user-hibp.mdx | 10 ++------ docs/docs/cmd/entra/user/user-license-add.mdx | 6 ----- .../docs/cmd/entra/user/user-license-list.mdx | 6 ----- .../cmd/entra/user/user-license-remove.mdx | 10 ++------ docs/docs/cmd/entra/user/user-list.mdx | 8 +------ .../cmd/entra/user/user-password-validate.mdx | 8 +------ .../entra/user/user-recyclebinitem-clear.mdx | 10 ++------ .../entra/user/user-recyclebinitem-list.mdx | 6 ----- .../entra/user/user-recyclebinitem-remove.mdx | 10 ++------ .../user/user-recyclebinitem-restore.mdx | 6 ----- .../user/user-registrationdetails-list.mdx | 20 ++++++---------- docs/docs/cmd/entra/user/user-remove.mdx | 10 ++------ docs/docs/cmd/entra/user/user-set.mdx | 6 ----- docs/docs/cmd/entra/user/user-signin-list.mdx | 24 +++++++------------ .../commands/m365group/m365group-set.spec.ts | 21 ---------------- .../commands/m365group/m365group-user-add.ts | 4 ---- 86 files changed, 97 insertions(+), 574 deletions(-) diff --git a/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx b/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx index 9f447889c2b..8c029bdea03 100644 --- a/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx +++ b/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx @@ -12,12 +12,6 @@ Creates a new administrative unit m365 entra administrativeunit add [options] ``` -## Alias - -```sh -m365 aad administrativeunit add [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx b/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx index 3e4748bf758..8b3e4d93224 100644 --- a/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx +++ b/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx @@ -12,12 +12,6 @@ Gets information about a specific administrative unit m365 entra administrativeunit get [options] ``` -## Alias - -```sh -m365 aad administrativeunit get [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx b/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx index ac644383da6..7c0734f3715 100644 --- a/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx +++ b/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx @@ -12,12 +12,6 @@ Retrieves a list of administrative units m365 entra administrativeunit list [options] ``` -## Alias - -```sh -m365 aad administrativeunit list [options] -``` - ## Options diff --git a/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx b/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx index d0af68b7432..ea48be2de45 100644 --- a/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx +++ b/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx @@ -10,12 +10,6 @@ Add a member (user, group, or device) to an administrative unit m365 entra administrativeunit member add [options] ``` -## Alias - -```sh -m365 aad administrativeunit member add [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx b/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx index a234e2e2330..424f7271a2e 100644 --- a/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx +++ b/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx @@ -12,12 +12,6 @@ Retrieves info about a specific member of an administrative unit m365 entra administrativeunit member get [options] ``` -## Alias - -```sh -m365 aad administrativeunit member get [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx b/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx index fe0922cc4c0..8de9b4fdd73 100644 --- a/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx +++ b/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx @@ -12,12 +12,6 @@ Retrieves members (users, groups, or devices) of an administrative unit m365 entra administrativeunit member list [options] ``` -## Alias - -```sh -m365 aad administrativeunit member list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx b/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx index 445d10fc340..43d9abc6223 100644 --- a/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx +++ b/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx @@ -10,12 +10,6 @@ Removes an administrative unit m365 entra administrativeunit remove [options] ``` -## Alias - -```sh -m365 aad administrativeunit remove [options] -``` - ## options ```md definition-list diff --git a/docs/docs/cmd/entra/app/app-add.mdx b/docs/docs/cmd/entra/app/app-add.mdx index f204a6094c8..c71ce0f7f02 100644 --- a/docs/docs/cmd/entra/app/app-add.mdx +++ b/docs/docs/cmd/entra/app/app-add.mdx @@ -15,7 +15,6 @@ m365 entra app add [options] ## Alias ```sh -m365 aad app add [options] m365 entra appregistration add [options] ``` diff --git a/docs/docs/cmd/entra/app/app-get.mdx b/docs/docs/cmd/entra/app/app-get.mdx index d340157cd6a..87fc9aa69b5 100644 --- a/docs/docs/cmd/entra/app/app-get.mdx +++ b/docs/docs/cmd/entra/app/app-get.mdx @@ -15,7 +15,6 @@ m365 entra app get [options] ## Alias ```sh -m365 aad app get [options] m365 entra appregistration get [options] ``` diff --git a/docs/docs/cmd/entra/app/app-list.mdx b/docs/docs/cmd/entra/app/app-list.mdx index 62b6aa66b71..2461a55ddac 100644 --- a/docs/docs/cmd/entra/app/app-list.mdx +++ b/docs/docs/cmd/entra/app/app-list.mdx @@ -15,7 +15,6 @@ m365 entra app list [options] ## Alias ```sh -m365 aad app list [options] m365 entra appregistration list [options] ``` diff --git a/docs/docs/cmd/entra/app/app-permission-add.mdx b/docs/docs/cmd/entra/app/app-permission-add.mdx index 4be61409cd6..5d193c9e043 100644 --- a/docs/docs/cmd/entra/app/app-permission-add.mdx +++ b/docs/docs/cmd/entra/app/app-permission-add.mdx @@ -15,7 +15,6 @@ m365 entra app permission add [options] ## Alias ```sh -m365 aad app permission add [options] m365 entra appregistration permission add [options] ``` diff --git a/docs/docs/cmd/entra/app/app-permission-list.mdx b/docs/docs/cmd/entra/app/app-permission-list.mdx index c568ccf1ad1..07952de3699 100644 --- a/docs/docs/cmd/entra/app/app-permission-list.mdx +++ b/docs/docs/cmd/entra/app/app-permission-list.mdx @@ -12,12 +12,6 @@ Lists the application and delegated permissions for a specified Entra Applicatio m365 entra app permission list [options] ``` -## Alias - -```sh -m365 aad app permission list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/app/app-remove.mdx b/docs/docs/cmd/entra/app/app-remove.mdx index cf37323a9ca..288df6891ef 100644 --- a/docs/docs/cmd/entra/app/app-remove.mdx +++ b/docs/docs/cmd/entra/app/app-remove.mdx @@ -13,7 +13,6 @@ m365 entra app remove [options] ## Alias ```sh -m365 aad app remove [options] m365 entra appregistration remove [options] ``` diff --git a/docs/docs/cmd/entra/app/app-role-add.mdx b/docs/docs/cmd/entra/app/app-role-add.mdx index b3d000b0eb6..f5922737c48 100644 --- a/docs/docs/cmd/entra/app/app-role-add.mdx +++ b/docs/docs/cmd/entra/app/app-role-add.mdx @@ -13,7 +13,6 @@ m365 entra app role add [options] ## Alias ```sh -m365 aad app role add [options] m365 entra appregistration role add [options] ``` diff --git a/docs/docs/cmd/entra/app/app-role-list.mdx b/docs/docs/cmd/entra/app/app-role-list.mdx index e14ac64a4b7..90dacd955ce 100644 --- a/docs/docs/cmd/entra/app/app-role-list.mdx +++ b/docs/docs/cmd/entra/app/app-role-list.mdx @@ -15,7 +15,6 @@ m365 entra app role list [options] ## Alias ```sh -m365 aad app role list [options] m365 entra appregistration role list [options] ``` diff --git a/docs/docs/cmd/entra/app/app-role-remove.mdx b/docs/docs/cmd/entra/app/app-role-remove.mdx index c962626d13a..478c145596c 100644 --- a/docs/docs/cmd/entra/app/app-role-remove.mdx +++ b/docs/docs/cmd/entra/app/app-role-remove.mdx @@ -13,7 +13,6 @@ m365 entra app role remove [options] ## Alias ```sh -m365 aad app role remove [options] m365 entra appregistration role remove [options] ``` diff --git a/docs/docs/cmd/entra/app/app-set.mdx b/docs/docs/cmd/entra/app/app-set.mdx index 58fac2e47c7..cda8afe9644 100644 --- a/docs/docs/cmd/entra/app/app-set.mdx +++ b/docs/docs/cmd/entra/app/app-set.mdx @@ -13,7 +13,6 @@ m365 entra app set [options] ## Alias ```sh -m365 aad app set [options] m365 entra appregistration set [options] ``` diff --git a/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx b/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx index b22254634d7..11778890b72 100644 --- a/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx +++ b/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx @@ -12,12 +12,6 @@ Adds service principal permissions also known as scopes and app role assignments m365 entra approleassignment add [options] ``` -## Alias - -```sh -m365 aad approleassignment add [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx b/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx index 8bb2b18ad7e..4f1e2b57731 100644 --- a/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx +++ b/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx @@ -12,12 +12,6 @@ Lists app role assignments for the specified application registration m365 entra approleassignment list [options] ``` -## Alias - -```sh -m365 aad approleassignment list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx b/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx index 87ae22f3dda..33cd74337e7 100644 --- a/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx +++ b/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx @@ -10,12 +10,6 @@ Deletes an app role assignment for the specified Entra application registration m365 entra approleassignment remove [options] ``` -## Alias - -```sh -m365 aad approleassignment remove [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx b/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx index 511a85a0380..92934c74d01 100644 --- a/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +++ b/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx @@ -15,7 +15,6 @@ m365 entra enterpriseapp add [options] ## Alias ```sh -m365 aad sp add [options] m365 entra sp add [options] ``` diff --git a/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx b/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx index ed83fcc0863..ec9269db708 100644 --- a/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +++ b/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx @@ -15,7 +15,6 @@ m365 entra enterpriseapp get [options] ## Alias ```sh -m365 aad sp get [options] m365 entra sp get [options] ``` diff --git a/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx b/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx index c3785dfc4e2..9e23c259b46 100644 --- a/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +++ b/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx @@ -15,7 +15,6 @@ m365 entra enterpriseapp list [options] ## Alias ```sh -m365 aad sp list [options] m365 entra sp list [options] ``` diff --git a/docs/docs/cmd/entra/group/group-add.mdx b/docs/docs/cmd/entra/group/group-add.mdx index dfa9ef81cb3..9c51e3977b9 100644 --- a/docs/docs/cmd/entra/group/group-add.mdx +++ b/docs/docs/cmd/entra/group/group-add.mdx @@ -12,12 +12,6 @@ Creates a Microsoft Entra group m365 entra group add [options] ``` -## Alias - -```sh -m365 aad group add [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/group/group-get.mdx b/docs/docs/cmd/entra/group/group-get.mdx index 2f370ecf72d..490559b0b2b 100644 --- a/docs/docs/cmd/entra/group/group-get.mdx +++ b/docs/docs/cmd/entra/group/group-get.mdx @@ -12,12 +12,6 @@ Gets information about the specified Entra group m365 entra group get [options] ``` -## Alias - -```sh -m365 aad group get [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/group/group-list.mdx b/docs/docs/cmd/entra/group/group-list.mdx index be9a4c7506b..da9b300b3a6 100644 --- a/docs/docs/cmd/entra/group/group-list.mdx +++ b/docs/docs/cmd/entra/group/group-list.mdx @@ -12,12 +12,6 @@ Lists Entra groups m365 entra group list [options] ``` -## Alias - -```sh -m365 aad group list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/group/group-member-list.mdx b/docs/docs/cmd/entra/group/group-member-list.mdx index 65dd320dad0..5840bf2dbde 100644 --- a/docs/docs/cmd/entra/group/group-member-list.mdx +++ b/docs/docs/cmd/entra/group/group-member-list.mdx @@ -12,12 +12,6 @@ Lists members of a specific Entra group m365 entra group member list [options] ``` -## Alias - -```sh -m365 aad group user list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/group/group-remove.mdx b/docs/docs/cmd/entra/group/group-remove.mdx index f5ae06c50fa..b9181d92202 100644 --- a/docs/docs/cmd/entra/group/group-remove.mdx +++ b/docs/docs/cmd/entra/group/group-remove.mdx @@ -10,12 +10,6 @@ Removes an Entra group m365 entra group remove [options] ``` -## Alias - -```sh -m365 aad group remove [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx b/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx index 2203d36c9d9..dc181d5108a 100644 --- a/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx +++ b/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx @@ -12,12 +12,6 @@ Creates a group setting m365 entra groupsetting add [options] ``` -## Alias - -```sh -m365 aad groupsetting add [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx b/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx index b53a8203fea..054b7f614a3 100644 --- a/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx +++ b/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx @@ -12,12 +12,6 @@ Gets information about the particular group setting m365 entra groupsetting get [options] ``` -## Alias - -```sh -m365 aad groupsetting get [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx b/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx index 575919d819f..48190c87e0b 100644 --- a/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx +++ b/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx @@ -12,12 +12,6 @@ Lists Entra group settings m365 entra groupsetting list [options] ``` -## Alias - -```sh -m365 aad groupsetting list [options] -``` - ## Options diff --git a/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx b/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx index 19fed3f2ae5..ca5809b5eb1 100644 --- a/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx +++ b/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx @@ -10,12 +10,6 @@ Removes the particular group setting m365 entra groupsetting remove [options] ``` -## Alias - -```sh -m365 aad groupsetting remove [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx b/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx index a444b65e596..7c599831406 100644 --- a/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx +++ b/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx @@ -10,12 +10,6 @@ Updates the particular group setting m365 entra groupsetting set [options] ``` -## Alias - -```sh -m365 aad groupsetting set [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-get.mdx b/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-get.mdx index ef0d13715a9..8e6f0d12366 100644 --- a/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-get.mdx +++ b/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-get.mdx @@ -12,12 +12,6 @@ Gets information about the specified Entra group settings template m365 entra groupsettingtemplate get [options] ``` -## Alias - -```sh -m365 aad groupsettingtemplate get [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-list.mdx b/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-list.mdx index b13b2f20b08..ccf18b83d4e 100644 --- a/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-list.mdx +++ b/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-list.mdx @@ -12,12 +12,6 @@ Lists Entra group settings templates m365 entra groupsettingtemplate list [options] ``` -## Alias - -```sh -m365 aad groupsettingtemplate list [options] -``` - ## Options diff --git a/docs/docs/cmd/entra/license/license-list.mdx b/docs/docs/cmd/entra/license/license-list.mdx index d46280f5655..d25cfa395e0 100644 --- a/docs/docs/cmd/entra/license/license-list.mdx +++ b/docs/docs/cmd/entra/license/license-list.mdx @@ -12,12 +12,6 @@ Lists commercial subscriptions that an organization has acquired m365 entra license list [options] ``` -## Alias - -```sh -m365 aad license list [options] -``` - ## Options diff --git a/docs/docs/cmd/entra/m365group/m365group-add.mdx b/docs/docs/cmd/entra/m365group/m365group-add.mdx index b7fed8d9a7e..6c2f885b410 100644 --- a/docs/docs/cmd/entra/m365group/m365group-add.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-add.mdx @@ -12,12 +12,6 @@ Creates a Microsoft 365 Group m365 entra m365group add [options] ``` -## Alias - -```sh -m365 aad m365group add [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx b/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx index 03c194dd968..1cf4dbcdde7 100644 --- a/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx @@ -12,12 +12,6 @@ Lists conversations for the specified Microsoft 365 group m365 entra m365group conversation list [options] ``` -## Alias - -```sh -m365 aad m365group conversation list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx b/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx index f24890ed5a8..69f2953b13c 100644 --- a/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx @@ -12,12 +12,6 @@ Lists conversation posts of a Microsoft 365 group m365 entra m365group conversation post list [options] ``` -## Alias - -```sh -m365 aad m365group conversation post list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-get.mdx b/docs/docs/cmd/entra/m365group/m365group-get.mdx index dcef5d64baf..f7663c58ca3 100644 --- a/docs/docs/cmd/entra/m365group/m365group-get.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-get.mdx @@ -12,12 +12,6 @@ Gets information about the specified Microsoft 365 Group or Microsoft Teams team m365 entra m365group get [options] ``` -## Alias - -```sh -m365 aad m365group get [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-list.mdx b/docs/docs/cmd/entra/m365group/m365group-list.mdx index ea96328f2cc..57a3cd1bb5c 100644 --- a/docs/docs/cmd/entra/m365group/m365group-list.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-list.mdx @@ -12,12 +12,6 @@ Lists Microsoft 365 Groups in the current tenant m365 entra m365group list [options] ``` -## Alias - -```sh -m365 aad m365group list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-clear.mdx b/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-clear.mdx index 14bd60724ac..e65b2305576 100644 --- a/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-clear.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-clear.mdx @@ -10,12 +10,6 @@ Clears Microsoft 365 Groups from the recycle bin in the current tenant m365 entra m365group recyclebinitem clear [options] ``` -## Alias - -```sh -m365 aad m365group recyclebinitem clear [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx b/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx index 1c7014d6371..52075b45ded 100644 --- a/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx @@ -12,12 +12,6 @@ Lists Groups from the recycle bin in the current tenant m365 entra m365group recyclebinitem list [options] ``` -## Alias - -```sh -m365 aad m365group recyclebinitem list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-remove.mdx b/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-remove.mdx index 3bbc122e05e..ad98cbabdc4 100644 --- a/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-remove.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-remove.mdx @@ -10,12 +10,6 @@ Permanently deletes a Microsoft 365 Group from the recycle bin in the current te m365 entra m365group recyclebinitem remove [options] ``` -## Alias - -```sh -m365 aad m365group recyclebinitem remove [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-restore.mdx b/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-restore.mdx index 63cfcad014b..b32c69d3831 100644 --- a/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-restore.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-restore.mdx @@ -10,12 +10,6 @@ Restores a deleted Microsoft 365 Group m365 entra m365group recyclebinitem restore [options] ``` -## Alias - -```sh -m365 aad m365group recyclebinitem restore [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-remove.mdx b/docs/docs/cmd/entra/m365group/m365group-remove.mdx index 98d4b630fb6..3b65202a7a2 100644 --- a/docs/docs/cmd/entra/m365group/m365group-remove.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-remove.mdx @@ -10,12 +10,6 @@ Removes an Microsoft 365 Group m365 entra m365group remove [options] ``` -## Alias - -```sh -m365 aad m365group remove [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-renew.mdx b/docs/docs/cmd/entra/m365group/m365group-renew.mdx index f1d85a9c0ec..bafec1f8263 100644 --- a/docs/docs/cmd/entra/m365group/m365group-renew.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-renew.mdx @@ -10,12 +10,6 @@ Renews Microsoft 365 group's expiration m365 entra m365group renew [options] ``` -## Alias - -```sh -m365 aad m365group renew [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx b/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx index 12b929e1fa8..0c1d32ca15a 100644 --- a/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx @@ -12,12 +12,6 @@ Get the number of group activities across group workloads m365 entra m365group report activitycounts [options] ``` -## Alias - -```sh -m365 aad m365group report activitycounts [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx b/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx index 621334b4cef..66b4ad6c177 100644 --- a/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx @@ -12,12 +12,6 @@ Get details about Microsoft 365 Groups activity by group. m365 entra m365group report activitydetail [options] ``` -## Alias - -```sh -m365 aad m365group report activitydetail [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx b/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx index 19fe15412c5..9f120d21a7e 100644 --- a/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx @@ -12,12 +12,6 @@ Get the total number of files and how many of them were active across all group m365 entra m365group report activityfilecounts [options] ``` -## Alias - -```sh -m365 aad m365group report activityfilecounts [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx b/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx index b5e915437ad..c95d4cbd32c 100644 --- a/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx @@ -12,20 +12,14 @@ Get the daily total number of groups and how many of them were active based on e m365 entra m365group report activitygroupcounts [options] ``` -## Alias - -```sh -m365 aad m365group report activitygroupcounts [options] -``` - ## Options ```md definition-list `-p, --period ` -: The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180` +: The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. `--outputFile [outputFile]` -: Path to the file where the Microsoft 365 Groups activities report should be stored in +: Path to the file where the Microsoft 365 Groups activities report should be stored in. ``` diff --git a/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx b/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx index cac96591875..9cd71abd568 100644 --- a/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx @@ -12,20 +12,14 @@ Get the total storage used across all group mailboxes and group sites m365 entra m365group report activitystorage [options] ``` -## Alias - -```sh -m365 aad m365group report activitystorage [options] -``` - ## Options ```md definition-list `-p, --period ` -: The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180` +: The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. `--outputFile [outputFile]` -: Path to the file where the Microsoft 365 Groups activities report should be stored in +: Path to the file where the Microsoft 365 Groups activities report should be stored in. ``` diff --git a/docs/docs/cmd/entra/m365group/m365group-set.mdx b/docs/docs/cmd/entra/m365group/m365group-set.mdx index d3e3db2cd9f..3690677b2ff 100644 --- a/docs/docs/cmd/entra/m365group/m365group-set.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-set.mdx @@ -10,12 +10,6 @@ Updates Microsoft 365 Group properties m365 entra m365group set [options] ``` -## Alias - -```sh -m365 aad m365group set [options] -``` - ## Options ```md definition-list @@ -44,7 +38,7 @@ m365 aad m365group set [options] : Comma-separated list of UPNs of Microsoft Entra ID users that will be group members. Specify either `memberIds` or `memberUserNames`, but not both. `--isPrivate [isPrivate]` -: Set to `true` if the Microsoft 365 Group should be private and `false` if it should be public. +: Set to `true` if the Microsoft 365 Group should be private and `false` if it should be public. `-l, --logoPath [logoPath]` : Local path to the image file to use as group logo. diff --git a/docs/docs/cmd/entra/m365group/m365group-teamify.mdx b/docs/docs/cmd/entra/m365group/m365group-teamify.mdx index ebc8b4859ad..4f31bb9f458 100644 --- a/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-teamify.mdx @@ -10,33 +10,27 @@ Creates a new Microsoft Teams team under existing Microsoft 365 group m365 entra m365group teamify [options] ``` -## Alias - -```sh -m365 aad m365group teamify [options] -``` - ## Options ```md definition-list `-i, --id [id]` -: The ID of the Microsoft 365 Group to connect to Microsoft Teams. Specify either id or mailNickname but not both +: The ID of the Microsoft 365 Group to connect to Microsoft Teams. Specify either `id` or `mailNickname` but not both. `--mailNickname [mailNickname]` -: The mail alias of the Microsoft 365 Group to connect to Microsoft Teams. Specify either id or mailNickname but not both +: The mail alias of the Microsoft 365 Group to connect to Microsoft Teams. Specify either `id` or `mailNickname` but not both. ``` ## Examples -Creates a new Microsoft Teams team under existing Microsoft 365 group with id _e3f60f99-0bad-481f-9e9f-ff0f572fbd03_ +Creates a new Microsoft Teams team under existing Microsoft 365 group with the specified id. ```sh m365 entra m365group teamify --id e3f60f99-0bad-481f-9e9f-ff0f572fbd03 ``` -Creates a new Microsoft Teams team under existing Microsoft 365 group with mailNickname _GroupName_ +Creates a new Microsoft Teams team under existing Microsoft 365 group with the specified mailNickname. ```sh m365 entra m365group teamify --mailNickname GroupName @@ -44,4 +38,4 @@ m365 entra m365group teamify --mailNickname GroupName ## Response -The command won't return a response on success. +The command won't return a response on success. \ No newline at end of file diff --git a/docs/docs/cmd/entra/m365group/m365group-user-add.mdx b/docs/docs/cmd/entra/m365group/m365group-user-add.mdx index 3cfcb119345..8f708e970a7 100644 --- a/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-user-add.mdx @@ -12,12 +12,6 @@ m365 entra m365group user add [options] ## Alias -```sh -m365 aad m365group user add [options] -``` - -## Alias - ```sh m365 teams user add ``` @@ -44,32 +38,32 @@ m365 teams user add : The user principal names of users. You can also pass a comma-separated list of UPNs. Specify either `ids` or `userNames` but not both. `-r, --role [role]` -: The role to be assigned to the new user: `Owner,Member`. Default `Member` +: The role to be assigned to the new user: `Owner,Member`. Default `Member`. ``` ## Examples -Add a new member with the userNames parameter to the specified Microsoft 365 Group +Add a new member with the userNames parameter to the specified Microsoft 365 Group. ```sh m365 entra m365group user add --groupId '00000000-0000-0000-0000-000000000000' --userNames 'anne.matthews@contoso.onmicrosoft.com' ``` -Add multiple new owners with the userNames parameter to the specified Microsoft 365 Group +Add multiple new owners with the userNames parameter to the specified Microsoft 365 Group. ```sh m365 entra m365group user add --groupName 'Contoso' --userNames 'anne.matthews@contoso.onmicrosoft.com, john.doe@contoso.onmicrosoft.com' --role Owner ``` -Add a new member with the userNames parameter to the specified Microsoft Teams team +Add a new member with the userNames parameter to the specified Microsoft Teams team. ```sh m365 entra m365group member add --teamId '00000000-0000-0000-0000-000000000000' --userNames 'anne.matthews@contoso.onmicrosoft.com' --role Member ``` -Add multiple new members with the ids parameter to the specified Microsoft Teams team +Add multiple new members with the ids parameter to the specified Microsoft Teams team. ```sh m365 entra m365group user add --teamName 'Engineering' --ids '74a3b772-3122-447b-b9da-10895e238219,dd3d21e4-a142-46b9-8482-bca8fe9596b3' --role Member diff --git a/docs/docs/cmd/entra/m365group/m365group-user-list.mdx b/docs/docs/cmd/entra/m365group/m365group-user-list.mdx index 48f3b0d13f1..173ae648e97 100644 --- a/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-user-list.mdx @@ -12,12 +12,6 @@ Lists users for the specified Microsoft 365 group m365 entra m365group user list [options] ``` -## Alias - -```sh -m365 aad m365group user list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx b/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx index 57d8f1d6930..e560924f197 100644 --- a/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx @@ -10,30 +10,20 @@ Removes the specified user from specified Microsoft 365 Group or Microsoft Teams m365 entra m365group user remove [options] ``` -## Alias - -```sh -m365 aad m365group user remove [options] -``` - -```sh -m365 aad teams user remove -``` - ## Options ```md definition-list `-i, --groupId [groupId]` -: The ID of the Microsoft 365 Group from which to remove the user +: The ID of the Microsoft 365 Group from which to remove the user. `--teamId [teamId]` -: The ID of the Microsoft Teams team from which to remove the user +: The ID of the Microsoft Teams team from which to remove the user. `-n, --userName ` -: User's UPN (user principal name), eg. `johndoe@example.com` +: User's UPN (user principal name), eg. `johndoe@example.com`. `-f, --force` -: Don't prompt for confirming removing the user from the specified Microsoft 365 Group or Microsoft Teams team +: Don't prompt for confirming removing the user from the specified Microsoft 365 Group or Microsoft Teams team. ``` @@ -44,19 +34,19 @@ You can remove users from a Microsoft 365 Group or Microsoft Teams team if you a ## Examples -Removes user from the specified Microsoft 365 Group +Removes user from the specified Microsoft 365 Group. ```sh m365 entra m365group user remove --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' ``` -Removes user from the specified Microsoft 365 Group without confirmation +Removes user from the specified Microsoft 365 Group without confirmation. ```sh m365 entra m365group user remove --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --force ``` -Removes user from the specified Microsoft Teams team +Removes user from the specified Microsoft Teams team. ```sh m365 entra teams user remove --teamId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' diff --git a/docs/docs/cmd/entra/m365group/m365group-user-set.mdx b/docs/docs/cmd/entra/m365group/m365group-user-set.mdx index fcebdb3a6fe..f2ac7cc1451 100644 --- a/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +++ b/docs/docs/cmd/entra/m365group/m365group-user-set.mdx @@ -10,16 +10,6 @@ Updates role of the specified users in the specified Microsoft 365 Group or Micr m365 entra m365group user set [options] ``` -## Alias - -```sh -m365 aad m365group user set [options] -``` - -```sh -m365 aad teams user set -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx b/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx index db3b6116e44..416373f3002 100644 --- a/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx +++ b/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx @@ -10,23 +10,17 @@ Grant the specified service principal OAuth2 permissions to the specified resour m365 entra oauth2grant add [options] ``` -## Alias - -```sh -m365 aad oauth2grant add [options] -``` - ## Options ```md definition-list `-i, --clientId ` -: `objectId` of the service principal for which permissions should be granted +: `objectId` of the service principal for which permissions should be granted. `-r, --resourceId ` -: `objectId` of the Entra application to which permissions should be granted +: `objectId` of the Entra application to which permissions should be granted. `-s, --scope ` -: Permissions to grant +: Permissions to grant. ``` diff --git a/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx b/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx index 3e96b9624fb..0024fd3fef7 100644 --- a/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx +++ b/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx @@ -12,17 +12,11 @@ Lists OAuth2 permission grants for the specified service principal m365 entra oauth2grant list [options] ``` -## Alias - -```sh -m365 aad oauth2grant list [options] -``` - ## Options ```md definition-list `-i, --spObjectId ` -: objectId of the service principal for which the configured OAuth2 permission grants should be retrieved +: objectId of the service principal for which the configured OAuth2 permission grants should be retrieved. ``` diff --git a/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx b/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx index b9cd9efa91d..0d65ea3d6e5 100644 --- a/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx +++ b/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx @@ -10,20 +10,14 @@ Remove specified service principal OAuth2 permissions m365 entra oauth2grant remove [options] ``` -## Alias - -```sh -m365 aad oauth2grant remove [options] -``` - ## Options ```md definition-list `-i, --grantId ` -: `objectId` of OAuth2 permission grant to remove +: `objectId` of OAuth2 permission grant to remove. `-f, --force` -: Do not prompt for confirmation before removing OAuth2 permission grant +: Do not prompt for confirmation before removing OAuth2 permission grant. ``` @@ -40,13 +34,13 @@ m365 entra oauth2grant remove --grantId \\-Zc1JRY8REeLxmXz5KtixAYU3Q6noCBPlhwGiX ## Examples -Remove the OAuth2 permission grant with ID _YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek_ +Remove the OAuth2 permission grant with the specified ID. ```sh m365 entra oauth2grant remove --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek ``` -Remove the OAuth2 permission grant with ID _YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek_ without being asked for confirmation +Remove the OAuth2 permission grant with the specified ID without being asked for confirmation ```sh m365 entra oauth2grant remove --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek --force diff --git a/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx b/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx index 235a88dcd1d..23cbff2c390 100644 --- a/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx +++ b/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx @@ -10,20 +10,14 @@ Update OAuth2 permissions for the service principal m365 entra oauth2grant set [options] ``` -## Alias - -```sh -m365 aad oauth2grant set [options] -``` - ## Options ```md definition-list `-i, --grantId ` -: `objectId` of OAuth2 permission grant to update +: `objectId` of OAuth2 permission grant to update. `-s, --scope ` -: Permissions to grant +: Permissions to grant. ``` @@ -40,7 +34,7 @@ m365 entra oauth2grant set --grantId \\-Zc1JRY8REeLxmXz5KtixAYU3Q6noCBPlhwGiX7px ## Examples -Update the existing OAuth2 permission grant with ID _YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek_ to the _Calendars.Read Mail.Read_ permissions +Update the existing OAuth2 permission grant with ID _YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek_ to the _Calendars.Read Mail.Read_ permissions. ```sh m365 entra oauth2grant set --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek --scope "Calendars.Read Mail.Read" diff --git a/docs/docs/cmd/entra/policy/policy-list.mdx b/docs/docs/cmd/entra/policy/policy-list.mdx index 2e7c36042c6..cecde3e994d 100644 --- a/docs/docs/cmd/entra/policy/policy-list.mdx +++ b/docs/docs/cmd/entra/policy/policy-list.mdx @@ -12,30 +12,24 @@ Returns policies from Entra ID m365 entra policy list [options] ``` -## Alias - -```sh -m365 aad policy list [options] -``` - ## Options ```md definition-list `-t, --type [type]` -: The type of policies to return. Allowed values `activityBasedTimeout`, `authorization`, `claimsMapping`, `homeRealmDiscovery`, `identitySecurityDefaultsEnforcement`, `tokenIssuance`, `tokenLifetime`. If omitted, all policies are returned +: The type of policies to return. Allowed values `activityBasedTimeout`, `authorization`, `claimsMapping`, `homeRealmDiscovery`, `identitySecurityDefaultsEnforcement`, `tokenIssuance`, `tokenLifetime`. If omitted, all policies are returned. ``` ## Examples -Returns all policies from Entra ID +Returns all policies from Entra ID. ```sh m365 entra policy list ``` -Returns claim-mapping policies from Entra ID +Returns claim-mapping policies from Entra ID. ```sh m365 entra policy list --type "claimsMapping" diff --git a/docs/docs/cmd/entra/siteclassification/siteclassification-disable.mdx b/docs/docs/cmd/entra/siteclassification/siteclassification-disable.mdx index 3f338393686..05d786f0022 100644 --- a/docs/docs/cmd/entra/siteclassification/siteclassification-disable.mdx +++ b/docs/docs/cmd/entra/siteclassification/siteclassification-disable.mdx @@ -10,30 +10,24 @@ Disables site classification m365 entra siteclassification disable [options] ``` -## Alias - -```sh -m365 aad siteclassification disable [options] -``` - ## Options ```md definition-list `-f, --force` -: Don't prompt for confirming disabling site classification +: Don't prompt for confirming disabling site classification. ``` ## Examples -Disable site classification +Disable site classification. ```sh m365 entra siteclassification disable ``` -Disable site classification without confirmation +Disable site classification without confirmation. ```sh m365 entra siteclassification disable --force diff --git a/docs/docs/cmd/entra/siteclassification/siteclassification-enable.mdx b/docs/docs/cmd/entra/siteclassification/siteclassification-enable.mdx index e3c037dd66b..3c6a99d53ea 100644 --- a/docs/docs/cmd/entra/siteclassification/siteclassification-enable.mdx +++ b/docs/docs/cmd/entra/siteclassification/siteclassification-enable.mdx @@ -10,45 +10,39 @@ Enables site classification configuration m365 entra siteclassification enable [options] ``` -## Alias - -```sh -m365 aad siteclassification enable [options] -``` - ## Options ```md definition-list `-c, --classifications ` -: Comma-separated list of classifications to enable in the tenant +: Comma-separated list of classifications to enable in the tenant. `-d, --defaultClassification ` -: Classification to use by default +: Classification to use by default. `-u, --usageGuidelinesUrl [usageGuidelinesUrl]` -: URL with usage guidelines for members +: URL with usage guidelines for members. `-g, --guestUsageGuidelinesUrl [guestUsageGuidelinesUrl]` -: URL with usage guidelines for guests +: URL with usage guidelines for guests. ``` ## Examples -Enable site classification +Enable site classification. ```sh m365 entra siteclassification enable --classifications "High, Medium, Low" --defaultClassification "Medium" ``` -Enable site classification with a usage guidelines URL +Enable site classification with a usage guidelines URL. ```sh m365 entra siteclassification enable --classifications "High, Medium, Low" --defaultClassification "Medium" --usageGuidelinesUrl "http://aka.ms/pnp" ``` -Enable site classification with usage guidelines URLs for guests and members +Enable site classification with usage guidelines URLs for guests and members. ```sh m365 entra siteclassification enable --classifications "High, Medium, Low" --defaultClassification "Medium" --usageGuidelinesUrl "http://aka.ms/pnp" --guestUsageGuidelinesUrl "http://aka.ms/pnp" diff --git a/docs/docs/cmd/entra/siteclassification/siteclassification-get.mdx b/docs/docs/cmd/entra/siteclassification/siteclassification-get.mdx index 5069a976e88..514a8a92a21 100644 --- a/docs/docs/cmd/entra/siteclassification/siteclassification-get.mdx +++ b/docs/docs/cmd/entra/siteclassification/siteclassification-get.mdx @@ -12,19 +12,13 @@ Gets site classification configuration m365 entra siteclassification get [options] ``` -## Alias - -```sh -m365 aad siteclassification get [options] -``` - ## Options ## Examples -Get information about the Microsoft 365 Tenant site classification +Get information about the Microsoft 365 Tenant site classification. ```sh m365 entra siteclassification get diff --git a/docs/docs/cmd/entra/siteclassification/siteclassification-set.mdx b/docs/docs/cmd/entra/siteclassification/siteclassification-set.mdx index 8fc85094be8..85434e81b6a 100644 --- a/docs/docs/cmd/entra/siteclassification/siteclassification-set.mdx +++ b/docs/docs/cmd/entra/siteclassification/siteclassification-set.mdx @@ -10,26 +10,20 @@ Updates site classification configuration m365 entra siteclassification set [options] ``` -## Alias - -```sh -m365 aad siteclassification set [options] -``` - ## Options ```md definition-list `-c, --classifications [classifications]` -: Comma-separated list of classifications +: Comma-separated list of classifications. `-d, --defaultClassification [defaultClassification]` -: Classification to use by default +: Classification to use by default. `-u, --usageGuidelinesUrl [usageGuidelinesUrl]` -: URL with usage guidelines for members +: URL with usage guidelines for members. `-g, --guestUsageGuidelinesUrl [guestUsageGuidelinesUrl]` -: URL with usage guidelines for guests +: URL with usage guidelines for guests. ``` @@ -37,25 +31,25 @@ m365 aad siteclassification set [options] ## Examples -Update Microsoft 365 Tenant site classification configuration +Update Microsoft 365 Tenant site classification configuration. ```sh m365 entra siteclassification set --classifications "High, Medium, Low" --defaultClassification "Medium" ``` -Update only the default classification +Update only the default classification. ```sh m365 entra siteclassification set --defaultClassification "Low" ``` -Update site classification with a usage guidelines URL +Update site classification with a usage guidelines URL. ```sh m365 entra siteclassification set --usageGuidelinesUrl "http://aka.ms/pnp" ``` -Update site classification with usage guidelines URLs for guests and members +Update site classification with usage guidelines URLs for guests and members. ```sh m365 entra siteclassification set --usageGuidelinesUrl "http://aka.ms/pnp" --guestUsageGuidelinesUrl "http://aka.ms/pnp" diff --git a/docs/docs/cmd/entra/user/user-add.mdx b/docs/docs/cmd/entra/user/user-add.mdx index 4b4789d8ca5..6ac299830e4 100644 --- a/docs/docs/cmd/entra/user/user-add.mdx +++ b/docs/docs/cmd/entra/user/user-add.mdx @@ -12,12 +12,6 @@ Creates a new user m365 entra user add [options] ``` -## Alias - -```sh -m365 aad user add [options] -``` - ## Options ```md definition-list @@ -95,25 +89,25 @@ If the specified option is not found, you will receive a `Resource 'xyz' does no ## Examples -Create a user and let him/her update the password at first login +Create a user and let him/her update the password at first login. ```sh m365 entra user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --forceChangePasswordNextSignIn ``` -Create a user with job information +Create a user with job information. ```sh m365 entra user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --firstName John --lastName Doe --jobTitle "Sales Manager" --companyName Contoso --department Sales --officeLocation Vosselaar --forceChangePasswordNextSignIn ``` -Create a user with language information +Create a user with language information. ```sh m365 entra user add --displayName "John Doe" --userName "john.doe@contoso.com" --preferredLanguage "nl-BE" --usageLocation BE --forceChangePasswordNextSignIn ``` -Create a user with a manager +Create a user with a manager. ```sh m365 entra user add --displayName "John Doe" --userName "john.doe@contoso.com" --managerUserName "adele@contoso.com" diff --git a/docs/docs/cmd/entra/user/user-get.mdx b/docs/docs/cmd/entra/user/user-get.mdx index ed4d0999d87..8fed3877102 100644 --- a/docs/docs/cmd/entra/user/user-get.mdx +++ b/docs/docs/cmd/entra/user/user-get.mdx @@ -12,12 +12,6 @@ Gets information about the specified user m365 entra user get [options] ``` -## Alias - -```sh -m365 aad user get [options] -``` - ## Options ```md definition-list @@ -47,43 +41,43 @@ If the user with the specified id, user name, or email doesn't exist, you will g ## Examples -Get information about the user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ +Get information about the user by id. ```sh m365 entra user get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 ``` -Get information about the user by user name +Get information about the user by user name. ```sh m365 entra user get --userName AarifS@contoso.onmicrosoft.com ``` -Get information about the user by email +Get information about the user by email. ```sh m365 entra user get --email AarifS@contoso.onmicrosoft.com ``` -For the user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ retrieve the user name, e-mail address and full name +For the user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ retrieve the user name, e-mail address and full name. ```sh m365 entra user get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --properties "userPrincipalName,mail,displayName" ``` -Get information about the currently logged user using the Id token +Get information about the currently logged user using the Id token. ```sh m365 entra user get --id "@meId" ``` -Get information about the currently logged in user using the UserName token +Get information about the currently logged in user using the UserName token. ```sh m365 entra user get --userName "@meUserName" ``` -Get information about a user with the manager's details +Get information about a user with the manager's details. ```sh m365 entra user get --userName AarifS@contoso.onmicrosoft.com --withManager diff --git a/docs/docs/cmd/entra/user/user-guest-add.mdx b/docs/docs/cmd/entra/user/user-guest-add.mdx index 0e7bd8c91ba..26ff5f348b3 100644 --- a/docs/docs/cmd/entra/user/user-guest-add.mdx +++ b/docs/docs/cmd/entra/user/user-guest-add.mdx @@ -12,12 +12,6 @@ Invite an external user to the organization m365 entra user guest add [options] ``` -## Alias - -```sh -m365 aad user guest add [options] -``` - ## Options ```md definition-list @@ -47,19 +41,19 @@ m365 aad user guest add [options] ## Examples -Invite a user via email and set the display name +Invite a user via email and set the display name. ```sh m365 entra user guest add --emailAddress john.doe@contoso.com --displayName "John Doe" --sendInvitationMessage ``` -Invite a user with a custom email and custom redirect url +Invite a user with a custom email and custom redirect url. ```sh m365 entra user guest add --emailAddress john.doe@contoso.com --welcomeMessage "Hi John, welcome to the organization!" --inviteRedirectUrl https://contoso.sharepoint.com --sendInvitationMessage ``` -Invite a user and send an invitation mail in Dutch +Invite a user and send an invitation mail in Dutch. ```sh m365 entra user guest add --emailAddress john.doe@contoso.com --messageLanguage nl-BE --sendInvitationMessage diff --git a/docs/docs/cmd/entra/user/user-hibp.mdx b/docs/docs/cmd/entra/user/user-hibp.mdx index b754419ea6d..569f897cb3a 100644 --- a/docs/docs/cmd/entra/user/user-hibp.mdx +++ b/docs/docs/cmd/entra/user/user-hibp.mdx @@ -12,12 +12,6 @@ Allows you to retrieve all accounts that have been pwned with the specified user m365 entra user hibp [options] ``` -## Alias - -```sh -m365 aad user hibp [options] -``` - ## Options ```md definition-list @@ -41,13 +35,13 @@ If `API Key` is invalid, you will get a `Required option apiKey not specified` e ## Examples -Check if user with by a user name is in a data breach +Check if user with by a user name is in a data breach. ```sh m365 entra user hibp --userName account-exists@hibp-integration-tests.com --apiKey _YOUR-API-KEY_ ``` -Check if user by a user name is in a data breach against the domain specified +Check if user by a user name is in a data breach against the domain specified. ```sh m365 entra user hibp --userName account-exists@hibp-integration-tests.com --apiKey _YOUR-API-KEY_ --domain adobe.com diff --git a/docs/docs/cmd/entra/user/user-license-add.mdx b/docs/docs/cmd/entra/user/user-license-add.mdx index f9fa66219d6..c5374f4d587 100644 --- a/docs/docs/cmd/entra/user/user-license-add.mdx +++ b/docs/docs/cmd/entra/user/user-license-add.mdx @@ -12,12 +12,6 @@ Assigns a license to a user m365 entra user license add [options] ``` -## Alias - -```sh -m365 aad user license add [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/user/user-license-list.mdx b/docs/docs/cmd/entra/user/user-license-list.mdx index 0a37510a8e6..802c15d1d0a 100644 --- a/docs/docs/cmd/entra/user/user-license-list.mdx +++ b/docs/docs/cmd/entra/user/user-license-list.mdx @@ -12,12 +12,6 @@ Lists the license details for a given user m365 entra user license list [options] ``` -## Alias - -```sh -m365 aad user license list [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/user/user-license-remove.mdx b/docs/docs/cmd/entra/user/user-license-remove.mdx index b598b08d363..a8bb50c7ec9 100644 --- a/docs/docs/cmd/entra/user/user-license-remove.mdx +++ b/docs/docs/cmd/entra/user/user-license-remove.mdx @@ -10,12 +10,6 @@ Removes a license from a user m365 entra user license remove [options] ``` -## Alias - -```sh -m365 aad user license remove [options] -``` - ## Options ```md definition-list @@ -36,13 +30,13 @@ m365 aad user license remove [options] ## Examples -Remove specific licenses from a specific user by UPN +Remove specific licenses from a specific user by UPN. ```sh m365 entra user license remove --userName "john.doe@contoso.com" --ids "45715bb8-13f9-4bf6-927f-ef96c102d394,bea13e0c-3828-4daa-a392-28af7ff61a0f" ``` -Remove specific licenses from a specific user by ID +Remove specific licenses from a specific user by ID. ```sh m365 entra user license remove --userId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --ids "45715bb8-13f9-4bf6-927f-ef96c102d394,bea13e0c-3828-4daa-a392-28af7ff61a0f" diff --git a/docs/docs/cmd/entra/user/user-list.mdx b/docs/docs/cmd/entra/user/user-list.mdx index 9b2d79e865e..745f86f21bc 100644 --- a/docs/docs/cmd/entra/user/user-list.mdx +++ b/docs/docs/cmd/entra/user/user-list.mdx @@ -12,12 +12,6 @@ Lists users matching specified criteria m365 entra user list [options] ``` -## Alias - -```sh -m365 aad user list [options] -``` - ## Options ```md definition-list @@ -25,7 +19,7 @@ m365 aad user list [options] : Filter the results to only users of a given type: `Member` or `Guest`. By default, all users are listed. `-p, --properties [properties]` -: Comma-separated list of properties to retrieve +: Comma-separated list of properties to retrieve. ``` diff --git a/docs/docs/cmd/entra/user/user-password-validate.mdx b/docs/docs/cmd/entra/user/user-password-validate.mdx index eede936a320..cbc4ca1eb7a 100644 --- a/docs/docs/cmd/entra/user/user-password-validate.mdx +++ b/docs/docs/cmd/entra/user/user-password-validate.mdx @@ -12,12 +12,6 @@ Check a user's password against the organization's password validation policy m365 entra user password validate [options] ``` -## Alias - -```sh -m365 aad user password validate [options] -``` - ## Options ```md definition-list @@ -37,7 +31,7 @@ This command is based on an API that is currently in preview and is subject to c ## Examples -Validate password _cli365P@ssW0rd_ against the organization's password validation policy +Validate password _cli365P@ssW0rd_ against the organization's password validation policy. ```sh m365 entra user password validate --password "cli365P@ssW0rd" diff --git a/docs/docs/cmd/entra/user/user-recyclebinitem-clear.mdx b/docs/docs/cmd/entra/user/user-recyclebinitem-clear.mdx index 28eed161445..f1e549b1cea 100644 --- a/docs/docs/cmd/entra/user/user-recyclebinitem-clear.mdx +++ b/docs/docs/cmd/entra/user/user-recyclebinitem-clear.mdx @@ -10,12 +10,6 @@ Removes all users from the tenant recycle bin m365 entra user recyclebinitem clear [options] ``` -## Alias - -```sh -m365 aad user recyclebinitem clear [options] -``` - ## Options ```md definition-list @@ -41,13 +35,13 @@ After running this command, it may take a minute before all deleted users are ef ## Examples -Removes all users from the tenant recycle bin +Removes all users from the tenant recycle bin. ```sh m365 entra user recyclebinitem clear ``` -Removes all users from the tenant recycle bin without confirmation prompt +Removes all users from the tenant recycle bin without confirmation prompt. ```sh m365 entra user recyclebinitem clear --force diff --git a/docs/docs/cmd/entra/user/user-recyclebinitem-list.mdx b/docs/docs/cmd/entra/user/user-recyclebinitem-list.mdx index e2094a0876c..88811da7155 100644 --- a/docs/docs/cmd/entra/user/user-recyclebinitem-list.mdx +++ b/docs/docs/cmd/entra/user/user-recyclebinitem-list.mdx @@ -12,12 +12,6 @@ Lists users from the recycle bin in the current tenant m365 entra user recyclebinitem list [options] ``` -## Alias - -```sh -m365 aad user recyclebinitem list [options] -``` - ## Options diff --git a/docs/docs/cmd/entra/user/user-recyclebinitem-remove.mdx b/docs/docs/cmd/entra/user/user-recyclebinitem-remove.mdx index b7a8702296f..0cbc49f54ac 100644 --- a/docs/docs/cmd/entra/user/user-recyclebinitem-remove.mdx +++ b/docs/docs/cmd/entra/user/user-recyclebinitem-remove.mdx @@ -10,12 +10,6 @@ Removes a user from the recycle bin in the current tenant m365 entra user recyclebinitem remove [options] ``` -## Alias - -```sh -m365 aad user recyclebinitem remove [options] -``` - ## Options ```md definition-list @@ -44,13 +38,13 @@ After running this command, it may take a minute before the deleted user is effe ## Examples -Removes a specific user from the recycle bin +Removes a specific user from the recycle bin. ```sh m365 entra user recyclebinitem remove --id 59f80e08-24b1-41f8-8586-16765fd830d3 ``` -Removes a specific user from the recycle bin without confirmation prompt +Removes a specific user from the recycle bin without confirmation prompt. ```sh m365 entra user recyclebinitem remove --id 59f80e08-24b1-41f8-8586-16765fd830d3 --force diff --git a/docs/docs/cmd/entra/user/user-recyclebinitem-restore.mdx b/docs/docs/cmd/entra/user/user-recyclebinitem-restore.mdx index 2c57f079de0..c005e93ee90 100644 --- a/docs/docs/cmd/entra/user/user-recyclebinitem-restore.mdx +++ b/docs/docs/cmd/entra/user/user-recyclebinitem-restore.mdx @@ -12,12 +12,6 @@ Restores a user from the recycle bin in the current tenant m365 entra user recyclebinitem restore [options] ``` -## Alias - -```sh -m365 aad user recyclebinitem restore [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/user/user-registrationdetails-list.mdx b/docs/docs/cmd/entra/user/user-registrationdetails-list.mdx index b66f14044fc..7bced2154c4 100644 --- a/docs/docs/cmd/entra/user/user-registrationdetails-list.mdx +++ b/docs/docs/cmd/entra/user/user-registrationdetails-list.mdx @@ -12,12 +12,6 @@ Retrieves a list of the authentication methods registered for users m365 entra user registrationdetails list [options] ``` -## Alias - -```sh -m365 aad user registrationdetails list [options] -``` - ## Options ```md definition-list @@ -85,43 +79,43 @@ When multiple values are specified for `--registeredMethods` option, the command ## Examples -Retrieve registration details for all users +Retrieve registration details for all users. ```sh m365 entra user registrationdetails list ``` -Retrieve user registration details and returns only specific properties +Retrieve user registration details and returns only specific properties. ```sh m365 entra user registrationdetails list --properties 'id,isAdmin' ``` -Retrieve registration details for admins +Retrieve registration details for admins. ```sh m365 entra user registrationdetails list --isAdmin true ``` -Retrieve registration details for guest users +Retrieve registration details for guest users. ```sh m365 entra user registrationdetails list --userType guest ``` -Retrieve registration details for users who selected either sms or push authentication method as the default second-factor for performing multifactor authentication +Retrieve registration details for users who selected either sms or push authentication method as the default second-factor for performing multifactor authentication. ```sh m365 entra user registrationdetails list --userPreferredMethodForSecondaryAuthentication 'sms,push' ``` -Retrieve registration details for users with push authentication method as the most secure authentication method among the registered methods for second factor authentication determined by the system +Retrieve registration details for users with push authentication method as the most secure authentication method among the registered methods for second factor authentication determined by the system. ```sh m365 entra user registrationdetails list --systemPreferredAuthenticationMethods push ``` -Retrieve registration details for users who have used either Microsoft Authenticator app or mobile phone during registration +Retrieve registration details for users who have used either Microsoft Authenticator app or mobile phone during registration. ```sh m365 entra user registrationdetails list --methodsRegistered 'microsoftAuthenticatorPush,mobilePhone' diff --git a/docs/docs/cmd/entra/user/user-remove.mdx b/docs/docs/cmd/entra/user/user-remove.mdx index 33ac9738ad5..e8aaeebdbc5 100644 --- a/docs/docs/cmd/entra/user/user-remove.mdx +++ b/docs/docs/cmd/entra/user/user-remove.mdx @@ -10,12 +10,6 @@ Removes a specific user m365 entra user remove [options] ``` -## Alias - -```sh -m365 aad user remove [options] -``` - ## Options ```md definition-list @@ -53,13 +47,13 @@ After running this command, it may take a minute before the user is effectively ## Examples -Removes a specific user by id +Removes a specific user by id. ```sh m365 entra user remove --id a33bd401-9117-4e0e-bb7b-3f61c1539e10 ``` -Removes a specific user by its UPN +Removes a specific user by its UPN. ```sh m365 entra user remove --userName john.doe@contoso.com diff --git a/docs/docs/cmd/entra/user/user-set.mdx b/docs/docs/cmd/entra/user/user-set.mdx index d1313cc96bf..0064d82a674 100644 --- a/docs/docs/cmd/entra/user/user-set.mdx +++ b/docs/docs/cmd/entra/user/user-set.mdx @@ -10,12 +10,6 @@ Updates information of the specified user m365 entra user set [options] ``` -## Alias - -```sh -m365 aad user set [options] -``` - ## Options ```md definition-list diff --git a/docs/docs/cmd/entra/user/user-signin-list.mdx b/docs/docs/cmd/entra/user/user-signin-list.mdx index 18f384aac5e..8c7b7e92f1a 100644 --- a/docs/docs/cmd/entra/user/user-signin-list.mdx +++ b/docs/docs/cmd/entra/user/user-signin-list.mdx @@ -12,12 +12,6 @@ Retrieves the Entra ID user sign-ins for the tenant m365 entra user signin list [options] ``` -## Alias - -```sh -m365 aad user signin list [options] -``` - ## Options ```md definition-list @@ -38,55 +32,55 @@ m365 aad user signin list [options] ## Examples -Get all user's sign-ins in your tenant +Get all user's sign-ins in your tenant. ```sh m365 entra user signin list ``` -Get all user's sign-ins filter by given user's UPN in the tenant +Get all user's sign-ins filter by given user's UPN in the tenant. ```sh m365 entra user signin list --userName 'johndoe@example.com' ``` -Get all user's sign-ins filter by given user's Id in the tenant +Get all user's sign-ins filter by given user's Id in the tenant. ```sh m365 entra user signin list --userId '11111111-1111-1111-1111-111111111111' ``` -Get all user's sign-ins filter by given application display name in the tenant +Get all user's sign-ins filter by given application display name in the tenant. ```sh m365 entra user signin list --appDisplayName 'Graph explorer' ``` -Get all user's sign-ins filter by given application identifier in the tenant +Get all user's sign-ins filter by given application identifier in the tenant. ```sh m365 entra user signin list --appId '00000000-0000-0000-0000-000000000000' ``` -Get all user's sign-ins filter by given user's UPN and application display name in the tenant +Get all user's sign-ins filter by given user's UPN and application display name in the tenant. ```sh m365 entra user signin list --userName 'johndoe@example.com' --appDisplayName 'Graph explorer' ``` -Get all user's sign-ins filter by given user's Id and application display name in the tenant +Get all user's sign-ins filter by given user's Id and application display name in the tenant. ```sh m365 entra user signin list --userId '11111111-1111-1111-1111-111111111111' --appDisplayName 'Graph explorer' ``` -Get all user's sign-ins filter by given user's UPN and application identifier in the tenant +Get all user's sign-ins filter by given user's UPN and application identifier in the tenant. ```sh m365 entra user signin list --userName 'johndoe@example.com' --appId '00000000-0000-0000-0000-000000000000' ``` -Get all user's sign-ins filter by given user's Id and application identifier in the tenant +Get all user's sign-ins filter by given user's Id and application identifier in the tenant. ```sh m365 entra user signin list --userId '11111111-1111-1111-1111-111111111111' --appId '00000000-0000-0000-0000-000000000000' diff --git a/src/m365/entra/commands/m365group/m365group-set.spec.ts b/src/m365/entra/commands/m365group/m365group-set.spec.ts index 23d5f0526e3..4e4816412dd 100644 --- a/src/m365/entra/commands/m365group/m365group-set.spec.ts +++ b/src/m365/entra/commands/m365group/m365group-set.spec.ts @@ -118,33 +118,12 @@ describe(commands.M365GROUP_SET, () => { assert.notStrictEqual(command.description, null); }); -<<<<<<< HEAD - it('defines alias', () => { - const alias = command.alias(); - assert.notStrictEqual(typeof alias, 'undefined'); - }); - - it('defines correct alias', () => { - const alias = command.alias(); - assert.deepStrictEqual(alias, [aadCommands.M365GROUP_SET]); - }); - it('updates Microsoft 365 Group display name while group is being retrieved by display name', async () => { const groupName = 'Project A'; sinon.stub(entraGroup, 'getGroupIdByDisplayName').withArgs(groupName).resolves(groupId); const patchStub = sinon.stub(request, 'patch').callsFake(async (opts) => { if (opts.url === `https://graph.microsoft.com/v1.0/groups/${groupId}`) { return; -======= - it('updates Microsoft 365 Group display name', async () => { - sinon.stub(request, 'patch').callsFake(async (opts) => { - if (opts.url === 'https://graph.microsoft.com/v1.0/groups/28beab62-7540-4db1-a23f-29a6018a3848') { - if (JSON.stringify(opts.data) === JSON.stringify({ - displayName: 'My group' - })) { - return; - } ->>>>>>> ef060945e... removed aad aliases } throw 'Invalid request'; diff --git a/src/m365/entra/commands/m365group/m365group-user-add.ts b/src/m365/entra/commands/m365group/m365group-user-add.ts index f5eaddf6a10..d3251e83af4 100644 --- a/src/m365/entra/commands/m365group/m365group-user-add.ts +++ b/src/m365/entra/commands/m365group/m365group-user-add.ts @@ -128,13 +128,9 @@ class EntraM365GroupUserAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { -<<<<<<< HEAD - await this.showDeprecationWarning(logger, aadCommands.M365GROUP_USER_ADD, commands.M365GROUP_USER_ADD); -======= if (args.options.userName) { await this.warn(logger, `Option 'userName' is deprecated. Please use 'ids' or 'userNames' instead.`); } ->>>>>>> 8835d6d1c... build fix try { const providedGroupId: string = await this.getGroupId(logger, args); From bb9eb1447c74e97a8b7cb4c44373b3cffa70f114 Mon Sep 17 00:00:00 2001 From: Nanddeep Nachan Date: Wed, 25 Sep 2024 05:42:46 +0000 Subject: [PATCH 6/7] build fix --- src/m365/entra/commands/m365group/m365group-user-add.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/m365/entra/commands/m365group/m365group-user-add.ts b/src/m365/entra/commands/m365group/m365group-user-add.ts index d3251e83af4..0d43d3e3d7f 100644 --- a/src/m365/entra/commands/m365group/m365group-user-add.ts +++ b/src/m365/entra/commands/m365group/m365group-user-add.ts @@ -128,10 +128,6 @@ class EntraM365GroupUserAddCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.userName) { - await this.warn(logger, `Option 'userName' is deprecated. Please use 'ids' or 'userNames' instead.`); - } - try { const providedGroupId: string = await this.getGroupId(logger, args); const isUnifiedGroup = await entraGroup.isUnifiedGroup(providedGroupId); From 68fdf3a7b5240e1b3e13746f3c92f96f5f047b5c Mon Sep 17 00:00:00 2001 From: Nanddeep Nachan Date: Fri, 11 Oct 2024 08:55:29 +0000 Subject: [PATCH 7/7] build fix --- src/m365/entra/commands/group/group-member-list.spec.ts | 1 - src/m365/entra/commands/group/group-member-list.ts | 6 ------ 2 files changed, 7 deletions(-) diff --git a/src/m365/entra/commands/group/group-member-list.spec.ts b/src/m365/entra/commands/group/group-member-list.spec.ts index 708daff7235..28865ea0912 100644 --- a/src/m365/entra/commands/group/group-member-list.spec.ts +++ b/src/m365/entra/commands/group/group-member-list.spec.ts @@ -15,7 +15,6 @@ import { settingsNames } from '../../../../settingsNames.js'; import { formatting } from '../../../../utils/formatting.js'; import commands from '../../commands.js'; import command from './group-member-list.js'; -import aadCommands from '../../aadCommands.js'; describe(commands.GROUP_MEMBER_LIST, () => { const groupId = '2c1ba4c4-cd9b-4417-832f-92a34bc34b2a'; diff --git a/src/m365/entra/commands/group/group-member-list.ts b/src/m365/entra/commands/group/group-member-list.ts index 33c61a25a29..2728922d49f 100644 --- a/src/m365/entra/commands/group/group-member-list.ts +++ b/src/m365/entra/commands/group/group-member-list.ts @@ -33,10 +33,6 @@ class EntraGroupMemberListCommand extends GraphCommand { return 'Lists members of a specific Entra group'; } - public alias(): string[] | undefined { - return [aadCommands.GROUP_USER_LIST]; - } - public defaultProperties(): string[] | undefined { return ['id', 'displayName', 'userPrincipalName', 'roles']; } @@ -110,8 +106,6 @@ class EntraGroupMemberListCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - await this.showDeprecationWarning(logger, aadCommands.GROUP_USER_LIST, commands.GROUP_MEMBER_LIST); - try { const groupId = await this.getGroupId(args.options, logger);