@pnp/cli-microsoft365 10.8.0-beta.cdb5c81 → 10.9.0-beta.3261443

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/.devcontainer/Dockerfile +1 -1
  2. package/Dockerfile +3 -3
  3. package/README.md +4 -2
  4. package/allCommands.json +1 -1
  5. package/allCommandsFull.json +1 -1
  6. package/dist/m365/app/commands/app-get.js +5 -2
  7. package/dist/m365/app/commands/app-open.js +9 -22
  8. package/dist/m365/app/commands/permission/permission-add.js +18 -30
  9. package/dist/m365/app/commands/permission/permission-list.js +5 -2
  10. package/dist/m365/base/AppCommand.js +9 -25
  11. package/dist/m365/booking/commands/business/business-get.js +18 -25
  12. package/dist/m365/context/commands/context-remove.js +12 -25
  13. package/dist/m365/context/commands/option/option-remove.js +11 -25
  14. package/dist/m365/entra/commands/m365group/m365group-get.js +16 -3
  15. package/dist/m365/entra/commands/m365group/m365group-list.js +7 -1
  16. package/dist/m365/entra/commands/pim/pim-role-assignment-eligibility-list.js +9 -3
  17. package/dist/m365/entra/commands/pim/pim-role-assignment-list.js +9 -3
  18. package/dist/m365/entra/commands/pim/pim-role-request-list.js +9 -3
  19. package/dist/m365/flow/commands/flow-list.js +14 -7
  20. package/dist/m365/flow/commands/run/run-get.js +1 -1
  21. package/dist/m365/graph/commands/directoryextension/directoryextension-list.js +74 -0
  22. package/dist/m365/graph/commands/subscription/subscription-add.js +10 -3
  23. package/dist/m365/graph/commands.js +1 -0
  24. package/dist/m365/pp/commands/solution/solution-publisher-list.js +8 -1
  25. package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +9 -2
  26. package/dist/m365/spo/commands/file/file-move.js +8 -2
  27. package/dist/m365/spo/commands/hubsite/hubsite-get.js +14 -5
  28. package/dist/m365/spo/commands/hubsite/hubsite-list.js +9 -2
  29. package/dist/m365/spo/commands/list/list-get.js +12 -6
  30. package/dist/m365/spo/commands/page/clientsidepages.js +49 -17
  31. package/dist/m365/spo/commands/tenant/tenant-site-list.js +16 -5
  32. package/dist/m365/spo/commands/term/term-list.js +10 -3
  33. package/dist/m365/spp/commands/model/model-apply.js +130 -0
  34. package/dist/m365/spp/commands/model/model-get.js +7 -24
  35. package/dist/m365/spp/commands/model/model-list.js +1 -1
  36. package/dist/m365/spp/commands/model/model-remove.js +1 -1
  37. package/dist/m365/spp/commands.js +1 -0
  38. package/dist/m365/teams/commands/chat/chat-member-add.js +10 -4
  39. package/dist/m365/viva/commands/engage/engage-community-remove.js +99 -0
  40. package/dist/m365/viva/commands/engage/engage-network-list.js +8 -2
  41. package/dist/m365/viva/commands.js +1 -0
  42. package/dist/utils/spp.js +59 -1
  43. package/docs/docs/cmd/entra/m365group/m365group-get.mdx +8 -5
  44. package/docs/docs/cmd/entra/m365group/m365group-list.mdx +14 -12
  45. package/docs/docs/cmd/entra/pim/pim-role-assignment-eligibility-list.mdx +7 -4
  46. package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +9 -6
  47. package/docs/docs/cmd/entra/pim/pim-role-request-list.mdx +7 -4
  48. package/docs/docs/cmd/flow/flow-list.mdx +8 -5
  49. package/docs/docs/cmd/flow/run/run-get.mdx +1 -1
  50. package/docs/docs/cmd/graph/directoryextension/directoryextension-list.mdx +135 -0
  51. package/docs/docs/cmd/graph/subscription/subscription-add.mdx +6 -3
  52. package/docs/docs/cmd/pp/solution/solution-publisher-list.mdx +7 -4
  53. package/docs/docs/cmd/purview/threatassessment/threatassessment-get.mdx +7 -4
  54. package/docs/docs/cmd/spo/file/file-move.mdx +4 -1
  55. package/docs/docs/cmd/spo/hubsite/hubsite-get.mdx +6 -3
  56. package/docs/docs/cmd/spo/hubsite/hubsite-list.mdx +7 -4
  57. package/docs/docs/cmd/spo/list/list-add.mdx +1 -1
  58. package/docs/docs/cmd/spo/list/list-get.mdx +12 -3
  59. package/docs/docs/cmd/spo/list/list-set.mdx +2 -2
  60. package/docs/docs/cmd/spo/tenant/tenant-site-list.mdx +10 -7
  61. package/docs/docs/cmd/spo/term/term-list.mdx +7 -4
  62. package/docs/docs/cmd/spp/model/model-apply.mdx +79 -0
  63. package/docs/docs/cmd/teams/chat/chat-member-add.mdx +6 -3
  64. package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +61 -0
  65. package/docs/docs/cmd/viva/engage/engage-network-list.mdx +7 -4
  66. package/npm-shrinkwrap.json +112 -97
  67. package/package.json +14 -14
@@ -1,6 +1,6 @@
1
- import AppCommand from '../../base/AppCommand.js';
2
- import commands from '../commands.js';
3
1
  import { entraApp } from '../../../utils/entraApp.js';
2
+ import AppCommand, { appCommandOptions } from '../../base/AppCommand.js';
3
+ import commands from '../commands.js';
4
4
  class AppGetCommand extends AppCommand {
5
5
  get name() {
6
6
  return commands.GET;
@@ -8,6 +8,9 @@ class AppGetCommand extends AppCommand {
8
8
  get description() {
9
9
  return 'Retrieves information about the current Microsoft Entra app';
10
10
  }
11
+ get schema() {
12
+ return appCommandOptions;
13
+ }
11
14
  async commandAction(logger, args) {
12
15
  try {
13
16
  const app = await entraApp.getAppRegistrationByAppId(args.options.appId);
@@ -1,14 +1,14 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _AppOpenCommand_instances, _AppOpenCommand_initTelemetry, _AppOpenCommand_initOptions;
1
+ import { z } from 'zod';
7
2
  import { cli } from '../../../cli/cli.js';
8
3
  import { settingsNames } from '../../../settingsNames.js';
9
4
  import { browserUtil } from '../../../utils/browserUtil.js';
10
- import AppCommand from '../../base/AppCommand.js';
5
+ import AppCommand, { appCommandOptions } from '../../base/AppCommand.js';
11
6
  import commands from '../commands.js';
7
+ const options = appCommandOptions
8
+ .extend({
9
+ preview: z.boolean().optional().default(false)
10
+ })
11
+ .strict();
12
12
  class AppOpenCommand extends AppCommand {
13
13
  get name() {
14
14
  return commands.OPEN;
@@ -16,11 +16,8 @@ class AppOpenCommand extends AppCommand {
16
16
  get description() {
17
17
  return 'Opens Microsoft Entra app in the Microsoft Entra ID portal';
18
18
  }
19
- constructor() {
20
- super();
21
- _AppOpenCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _AppOpenCommand_instances, "m", _AppOpenCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _AppOpenCommand_instances, "m", _AppOpenCommand_initOptions).call(this);
19
+ get schema() {
20
+ return options;
24
21
  }
25
22
  async commandAction(logger, args) {
26
23
  try {
@@ -41,15 +38,5 @@ class AppOpenCommand extends AppCommand {
41
38
  await browserUtil.open(url);
42
39
  }
43
40
  }
44
- _AppOpenCommand_instances = new WeakSet(), _AppOpenCommand_initTelemetry = function _AppOpenCommand_initTelemetry() {
45
- this.telemetry.push((args) => {
46
- Object.assign(this.telemetryProperties, {
47
- appId: typeof args.options.appId !== 'undefined',
48
- preview: typeof args.options.preview !== 'undefined'
49
- });
50
- });
51
- }, _AppOpenCommand_initOptions = function _AppOpenCommand_initOptions() {
52
- this.options.unshift({ option: '--appId [appId]' }, { option: '--preview' });
53
- };
54
41
  export default new AppOpenCommand();
55
42
  //# sourceMappingURL=app-open.js.map
@@ -1,14 +1,16 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _AppPermissionAddCommand_instances, _AppPermissionAddCommand_initTelemetry, _AppPermissionAddCommand_initOptions, _AppPermissionAddCommand_initOptionSets;
1
+ import { z } from 'zod';
7
2
  import request from '../../../../request.js';
8
3
  import { formatting } from '../../../../utils/formatting.js';
9
4
  import { odata } from '../../../../utils/odata.js';
10
- import AppCommand from '../../../base/AppCommand.js';
5
+ import AppCommand, { appCommandOptions } from '../../../base/AppCommand.js';
11
6
  import commands from '../../commands.js';
7
+ const options = appCommandOptions
8
+ .extend({
9
+ applicationPermissions: z.string().optional(),
10
+ delegatedPermissions: z.string().optional(),
11
+ grantAdminConsent: z.boolean().optional()
12
+ })
13
+ .strict();
12
14
  var ScopeType;
13
15
  (function (ScopeType) {
14
16
  ScopeType["Role"] = "Role";
@@ -21,12 +23,15 @@ class AppPermissionAddCommand extends AppCommand {
21
23
  get description() {
22
24
  return 'Adds the specified application and/or delegated permissions to the current Microsoft Entra app API permissions';
23
25
  }
24
- constructor() {
25
- super();
26
- _AppPermissionAddCommand_instances.add(this);
27
- __classPrivateFieldGet(this, _AppPermissionAddCommand_instances, "m", _AppPermissionAddCommand_initTelemetry).call(this);
28
- __classPrivateFieldGet(this, _AppPermissionAddCommand_instances, "m", _AppPermissionAddCommand_initOptions).call(this);
29
- __classPrivateFieldGet(this, _AppPermissionAddCommand_instances, "m", _AppPermissionAddCommand_initOptionSets).call(this);
26
+ get schema() {
27
+ return options;
28
+ }
29
+ getRefinedSchema(schema) {
30
+ return schema
31
+ .refine(options => options.applicationPermissions || options.delegatedPermissions, {
32
+ message: 'Specify at least one of applicationPermissions or delegatedPermissions, or both.',
33
+ path: ['delegatedPermissions']
34
+ });
30
35
  }
31
36
  async commandAction(logger, args) {
32
37
  try {
@@ -194,22 +199,5 @@ class AppPermissionAddCommand extends AppCommand {
194
199
  return request.post(requestOptions);
195
200
  }
196
201
  }
197
- _AppPermissionAddCommand_instances = new WeakSet(), _AppPermissionAddCommand_initTelemetry = function _AppPermissionAddCommand_initTelemetry() {
198
- this.telemetry.push((args) => {
199
- Object.assign(this.telemetryProperties, {
200
- appId: typeof args.options.appId !== 'undefined',
201
- applicationPermissions: typeof args.options.applicationPermissions !== 'undefined',
202
- delegatedPermissions: typeof args.options.delegatedPermissions !== 'undefined',
203
- grantAdminConsent: !!args.options.grantAdminConsent
204
- });
205
- });
206
- }, _AppPermissionAddCommand_initOptions = function _AppPermissionAddCommand_initOptions() {
207
- this.options.unshift({ option: '--appId [appId]' }, { option: '--applicationPermissions [applicationPermissions]' }, { option: '--delegatedPermissions [delegatedPermissions]' }, { option: '--grantAdminConsent' });
208
- }, _AppPermissionAddCommand_initOptionSets = function _AppPermissionAddCommand_initOptionSets() {
209
- this.optionSets.push({
210
- options: ['applicationPermissions', 'delegatedPermissions'],
211
- runsWhen: (args) => args.options.delegatedPermissions === undefined && args.options.applicationPermissions === undefined
212
- });
213
- };
214
202
  export default new AppPermissionAddCommand();
215
203
  //# sourceMappingURL=permission-add.js.map
@@ -1,7 +1,7 @@
1
1
  import request from '../../../../request.js';
2
- import AppCommand from '../../../base/AppCommand.js';
3
- import commands from '../../commands.js';
4
2
  import { entraApp } from '../../../../utils/entraApp.js';
3
+ import AppCommand, { appCommandOptions } from '../../../base/AppCommand.js';
4
+ import commands from '../../commands.js';
5
5
  var GetServicePrincipal;
6
6
  (function (GetServicePrincipal) {
7
7
  GetServicePrincipal[GetServicePrincipal["withPermissions"] = 0] = "withPermissions";
@@ -14,6 +14,9 @@ class AppPermissionListCommand extends AppCommand {
14
14
  get description() {
15
15
  return 'Lists API permissions for the current Microsoft Entra app';
16
16
  }
17
+ get schema() {
18
+ return appCommandOptions;
19
+ }
17
20
  async commandAction(logger) {
18
21
  try {
19
22
  const servicePrincipal = await this.getServicePrincipal({ appId: this.appId }, logger, GetServicePrincipal.withPermissions);
@@ -1,23 +1,18 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _AppCommand_instances, _AppCommand_initOptions, _AppCommand_initValidators;
7
1
  import fs from 'fs';
2
+ import { z } from 'zod';
8
3
  import { cli } from '../../cli/cli.js';
9
- import Command, { CommandError } from '../../Command.js';
10
- import { validation } from '../../utils/validation.js';
4
+ import Command, { CommandError, globalOptionsZod } from '../../Command.js';
11
5
  import { formatting } from '../../utils/formatting.js';
12
- class AppCommand extends Command {
6
+ export const appCommandOptions = globalOptionsZod
7
+ .extend({
8
+ appId: z.string().uuid().optional()
9
+ });
10
+ export default class AppCommand extends Command {
13
11
  get resource() {
14
12
  return 'https://graph.microsoft.com';
15
13
  }
16
- constructor() {
17
- super();
18
- _AppCommand_instances.add(this);
19
- __classPrivateFieldGet(this, _AppCommand_instances, "m", _AppCommand_initOptions).call(this);
20
- __classPrivateFieldGet(this, _AppCommand_instances, "m", _AppCommand_initValidators).call(this);
14
+ get schema() {
15
+ return appCommandOptions;
21
16
  }
22
17
  async action(logger, args) {
23
18
  const m365rcJsonPath = '.m365rc.json';
@@ -63,15 +58,4 @@ class AppCommand extends Command {
63
58
  }
64
59
  }
65
60
  }
66
- _AppCommand_instances = new WeakSet(), _AppCommand_initOptions = function _AppCommand_initOptions() {
67
- this.options.unshift({ option: '--appId [appId]' });
68
- }, _AppCommand_initValidators = function _AppCommand_initValidators() {
69
- this.validators.push(async (args) => {
70
- if (args.options.appId && !validation.isValidGuid(args.options.appId)) {
71
- return `${args.options.appId} is not a valid GUID`;
72
- }
73
- return true;
74
- });
75
- };
76
- export default AppCommand;
77
61
  //# sourceMappingURL=AppCommand.js.map
@@ -1,14 +1,17 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _BookingBusinessGetCommand_instances, _BookingBusinessGetCommand_initTelemetry, _BookingBusinessGetCommand_initOptions, _BookingBusinessGetCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { cli } from '../../../../cli/cli.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
7
4
  import request from '../../../../request.js';
8
5
  import { formatting } from '../../../../utils/formatting.js';
6
+ import { zod } from '../../../../utils/zod.js';
9
7
  import GraphCommand from '../../../base/GraphCommand.js';
10
8
  import commands from '../../commands.js';
11
- import { cli } from '../../../../cli/cli.js';
9
+ const options = globalOptionsZod
10
+ .extend({
11
+ id: zod.alias('i', z.string().optional()),
12
+ name: zod.alias('n', z.string().optional())
13
+ })
14
+ .strict();
12
15
  class BookingBusinessGetCommand extends GraphCommand {
13
16
  get name() {
14
17
  return commands.BUSINESS_GET;
@@ -16,12 +19,14 @@ class BookingBusinessGetCommand extends GraphCommand {
16
19
  get description() {
17
20
  return 'Retrieve the specified Microsoft Bookings business.';
18
21
  }
19
- constructor() {
20
- super();
21
- _BookingBusinessGetCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _BookingBusinessGetCommand_instances, "m", _BookingBusinessGetCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _BookingBusinessGetCommand_instances, "m", _BookingBusinessGetCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _BookingBusinessGetCommand_instances, "m", _BookingBusinessGetCommand_initOptionSets).call(this);
22
+ get schema() {
23
+ return options;
24
+ }
25
+ getRefinedSchema(schema) {
26
+ return schema
27
+ .refine(options => options.id || options.name, {
28
+ message: 'Specify either id or name'
29
+ });
25
30
  }
26
31
  async commandAction(logger, args) {
27
32
  try {
@@ -65,17 +70,5 @@ class BookingBusinessGetCommand extends GraphCommand {
65
70
  return bookingBusinesses[0].id;
66
71
  }
67
72
  }
68
- _BookingBusinessGetCommand_instances = new WeakSet(), _BookingBusinessGetCommand_initTelemetry = function _BookingBusinessGetCommand_initTelemetry() {
69
- this.telemetry.push((args) => {
70
- Object.assign(this.telemetryProperties, {
71
- id: typeof args.options.id !== 'undefined',
72
- name: typeof args.options.name !== 'undefined'
73
- });
74
- });
75
- }, _BookingBusinessGetCommand_initOptions = function _BookingBusinessGetCommand_initOptions() {
76
- this.options.unshift({ option: '-i, --id [id]' }, { option: '-n, --name [name]' });
77
- }, _BookingBusinessGetCommand_initOptionSets = function _BookingBusinessGetCommand_initOptionSets() {
78
- this.optionSets.push({ options: ['id', 'name'] });
79
- };
80
73
  export default new BookingBusinessGetCommand();
81
74
  //# sourceMappingURL=business-get.js.map
@@ -1,14 +1,15 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _ContextRemoveCommand_instances, _ContextRemoveCommand_initTelemetry, _ContextRemoveCommand_initOptions;
7
1
  import fs from 'fs';
2
+ import { z } from 'zod';
8
3
  import { cli } from '../../../cli/cli.js';
9
- import { CommandError } from '../../../Command.js';
4
+ import { CommandError, globalOptionsZod } from '../../../Command.js';
5
+ import { zod } from '../../../utils/zod.js';
10
6
  import AnonymousCommand from '../../base/AnonymousCommand.js';
11
7
  import commands from '../commands.js';
8
+ const options = globalOptionsZod
9
+ .extend({
10
+ force: zod.alias('f', z.boolean().optional())
11
+ })
12
+ .strict();
12
13
  class ContextRemoveCommand extends AnonymousCommand {
13
14
  get name() {
14
15
  return commands.REMOVE;
@@ -16,20 +17,17 @@ class ContextRemoveCommand extends AnonymousCommand {
16
17
  get description() {
17
18
  return 'Removes the CLI for Microsoft 365 context in the current working folder';
18
19
  }
19
- constructor() {
20
- super();
21
- _ContextRemoveCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _ContextRemoveCommand_instances, "m", _ContextRemoveCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _ContextRemoveCommand_instances, "m", _ContextRemoveCommand_initOptions).call(this);
20
+ get schema() {
21
+ return options;
24
22
  }
25
23
  async commandAction(logger, args) {
26
24
  if (args.options.force) {
27
- await this.removeContext();
25
+ this.removeContext();
28
26
  }
29
27
  else {
30
28
  const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the context?` });
31
29
  if (result) {
32
- await this.removeContext();
30
+ this.removeContext();
33
31
  }
34
32
  }
35
33
  }
@@ -70,16 +68,5 @@ class ContextRemoveCommand extends AnonymousCommand {
70
68
  }
71
69
  }
72
70
  }
73
- _ContextRemoveCommand_instances = new WeakSet(), _ContextRemoveCommand_initTelemetry = function _ContextRemoveCommand_initTelemetry() {
74
- this.telemetry.push((args) => {
75
- Object.assign(this.telemetryProperties, {
76
- force: !!args.options.force
77
- });
78
- });
79
- }, _ContextRemoveCommand_initOptions = function _ContextRemoveCommand_initOptions() {
80
- this.options.unshift({
81
- option: '-f, --force'
82
- });
83
- };
84
71
  export default new ContextRemoveCommand();
85
72
  //# sourceMappingURL=context-remove.js.map
@@ -1,14 +1,16 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _ContextOptionRemoveCommand_instances, _ContextOptionRemoveCommand_initTelemetry, _ContextOptionRemoveCommand_initOptions;
7
1
  import fs from 'fs';
2
+ import { z } from 'zod';
8
3
  import { cli } from '../../../../cli/cli.js';
9
- import { CommandError } from '../../../../Command.js';
4
+ import { CommandError, globalOptionsZod } from '../../../../Command.js';
5
+ import { zod } from '../../../../utils/zod.js';
10
6
  import ContextCommand from '../../../base/ContextCommand.js';
11
7
  import commands from '../../commands.js';
8
+ const options = globalOptionsZod
9
+ .extend({
10
+ name: zod.alias('n', z.string()),
11
+ force: zod.alias('f', z.boolean().optional())
12
+ })
13
+ .strict();
12
14
  class ContextOptionRemoveCommand extends ContextCommand {
13
15
  get name() {
14
16
  return commands.OPTION_REMOVE;
@@ -16,11 +18,8 @@ class ContextOptionRemoveCommand extends ContextCommand {
16
18
  get description() {
17
19
  return 'Removes an already available name from local context file.';
18
20
  }
19
- constructor() {
20
- super();
21
- _ContextOptionRemoveCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _ContextOptionRemoveCommand_instances, "m", _ContextOptionRemoveCommand_initOptions).call(this);
23
- __classPrivateFieldGet(this, _ContextOptionRemoveCommand_instances, "m", _ContextOptionRemoveCommand_initTelemetry).call(this);
21
+ get schema() {
22
+ return options;
24
23
  }
25
24
  async commandAction(logger, args) {
26
25
  if (this.verbose) {
@@ -70,18 +69,5 @@ class ContextOptionRemoveCommand extends ContextCommand {
70
69
  }
71
70
  }
72
71
  }
73
- _ContextOptionRemoveCommand_instances = new WeakSet(), _ContextOptionRemoveCommand_initTelemetry = function _ContextOptionRemoveCommand_initTelemetry() {
74
- this.telemetry.push((args) => {
75
- Object.assign(this.telemetryProperties, {
76
- force: !!args.options.force
77
- });
78
- });
79
- }, _ContextOptionRemoveCommand_initOptions = function _ContextOptionRemoveCommand_initOptions() {
80
- this.options.unshift({
81
- option: '-n, --name <name>'
82
- }, {
83
- option: '-f, --force'
84
- });
85
- };
86
72
  export default new ContextOptionRemoveCommand();
87
73
  //# sourceMappingURL=option-remove.js.map
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
3
3
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
- var _EntraM365GroupGetCommand_instances, _EntraM365GroupGetCommand_initOptions, _EntraM365GroupGetCommand_initValidators, _EntraM365GroupGetCommand_initOptionSets, _EntraM365GroupGetCommand_initTypes;
6
+ var _EntraM365GroupGetCommand_instances, _EntraM365GroupGetCommand_initTelemetry, _EntraM365GroupGetCommand_initOptions, _EntraM365GroupGetCommand_initValidators, _EntraM365GroupGetCommand_initOptionSets, _EntraM365GroupGetCommand_initTypes;
7
7
  import request from '../../../../request.js';
8
8
  import { entraGroup } from '../../../../utils/entraGroup.js';
9
9
  import { validation } from '../../../../utils/validation.js';
@@ -19,12 +19,16 @@ class EntraM365GroupGetCommand extends GraphCommand {
19
19
  constructor() {
20
20
  super();
21
21
  _EntraM365GroupGetCommand_instances.add(this);
22
+ __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initTelemetry).call(this);
22
23
  __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initOptions).call(this);
23
24
  __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initValidators).call(this);
24
25
  __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initOptionSets).call(this);
25
26
  __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initTypes).call(this);
26
27
  }
27
28
  async commandAction(logger, args) {
29
+ if (args.options.includeSiteUrl) {
30
+ await this.warn(logger, `Parameter 'includeSiteUrl' is deprecated. Please use 'withSiteUrl' instead`);
31
+ }
28
32
  let group;
29
33
  try {
30
34
  if (args.options.id) {
@@ -46,7 +50,7 @@ class EntraM365GroupGetCommand extends GraphCommand {
46
50
  };
47
51
  const groupExtended = await request.get(requestExtendedOptions);
48
52
  group = { ...group, ...groupExtended };
49
- if (args.options.includeSiteUrl) {
53
+ if (args.options.includeSiteUrl || args.options.withSiteUrl) {
50
54
  const requestOptions = {
51
55
  url: `${this.resource}/v1.0/groups/${group.id}/drive?$select=webUrl`,
52
56
  headers: {
@@ -64,13 +68,22 @@ class EntraM365GroupGetCommand extends GraphCommand {
64
68
  }
65
69
  }
66
70
  }
67
- _EntraM365GroupGetCommand_instances = new WeakSet(), _EntraM365GroupGetCommand_initOptions = function _EntraM365GroupGetCommand_initOptions() {
71
+ _EntraM365GroupGetCommand_instances = new WeakSet(), _EntraM365GroupGetCommand_initTelemetry = function _EntraM365GroupGetCommand_initTelemetry() {
72
+ this.telemetry.push((args) => {
73
+ Object.assign(this.telemetryProperties, {
74
+ includeSiteUrl: !!args.options.includeSiteUrl,
75
+ withSiteUrl: !!args.options.withSiteUrl
76
+ });
77
+ });
78
+ }, _EntraM365GroupGetCommand_initOptions = function _EntraM365GroupGetCommand_initOptions() {
68
79
  this.options.unshift({
69
80
  option: '-i, --id [id]'
70
81
  }, {
71
82
  option: '-n, --displayName [displayName]'
72
83
  }, {
73
84
  option: '--includeSiteUrl'
85
+ }, {
86
+ option: '--withSiteUrl'
74
87
  });
75
88
  }, _EntraM365GroupGetCommand_initValidators = function _EntraM365GroupGetCommand_initValidators() {
76
89
  this.validators.push(async (args) => {
@@ -26,6 +26,9 @@ class EntraM365GroupListCommand extends GraphCommand {
26
26
  return ['id', 'displayName', 'mailNickname', 'siteUrl'];
27
27
  }
28
28
  async commandAction(logger, args) {
29
+ if (args.options.includeSiteUrl) {
30
+ await this.warn(logger, `Parameter 'includeSiteUrl' is deprecated. Please use 'withSiteUrl' instead`);
31
+ }
29
32
  const groupFilter = `?$filter=groupTypes/any(c:c+eq+'Unified')`;
30
33
  const displayNameFilter = args.options.displayName ? ` and startswith(DisplayName,'${formatting.encodeQueryParameter(args.options.displayName)}')` : '';
31
34
  const mailNicknameFilter = args.options.mailNickname ? ` and startswith(MailNickname,'${formatting.encodeQueryParameter(args.options.mailNickname)}')` : '';
@@ -43,7 +46,7 @@ class EntraM365GroupListCommand extends GraphCommand {
43
46
  });
44
47
  groups = orphanedGroups;
45
48
  }
46
- if (args.options.includeSiteUrl) {
49
+ if (args.options.includeSiteUrl || args.options.withSiteUrl) {
47
50
  const res = await Promise.all(groups.map(g => this.getGroupSiteUrl(g.id)));
48
51
  res.forEach(r => {
49
52
  for (let i = 0; i < groups.length; i++) {
@@ -82,6 +85,7 @@ _EntraM365GroupListCommand_instances = new WeakSet(), _EntraM365GroupListCommand
82
85
  displayName: typeof args.options.displayName !== 'undefined',
83
86
  mailNickname: typeof args.options.mailNickname !== 'undefined',
84
87
  includeSiteUrl: args.options.includeSiteUrl,
88
+ withSiteUrl: !!args.options.withSiteUrl,
85
89
  orphaned: !!args.options.orphaned
86
90
  });
87
91
  });
@@ -92,6 +96,8 @@ _EntraM365GroupListCommand_instances = new WeakSet(), _EntraM365GroupListCommand
92
96
  option: '-m, --mailNickname [displayName]'
93
97
  }, {
94
98
  option: '--includeSiteUrl'
99
+ }, {
100
+ option: '--withSiteUrl'
95
101
  }, {
96
102
  option: '--orphaned'
97
103
  });
@@ -29,6 +29,9 @@ class EntraPimRoleAssignmentEligibilityListCommand extends GraphCommand {
29
29
  __classPrivateFieldGet(this, _EntraPimRoleAssignmentEligibilityListCommand_instances, "m", _EntraPimRoleAssignmentEligibilityListCommand_initOptionSets).call(this);
30
30
  }
31
31
  async commandAction(logger, args) {
32
+ if (args.options.includePrincipalDetails) {
33
+ await this.warn(logger, `Parameter 'includePrincipalDetails' is deprecated. Please use 'withPrincipalDetails' instead`);
34
+ }
32
35
  if (this.verbose) {
33
36
  await logger.logToStderr(`Retrieving list of eligible roles for ${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName || 'all users'}...`);
34
37
  }
@@ -40,7 +43,7 @@ class EntraPimRoleAssignmentEligibilityListCommand extends GraphCommand {
40
43
  queryParameters.push(`$filter=principalId eq '${principalId}'`);
41
44
  }
42
45
  expands.push('roleDefinition($select=displayName)');
43
- if (args.options.includePrincipalDetails) {
46
+ if (args.options.includePrincipalDetails || args.options.withPrincipalDetails) {
44
47
  expands.push('principal');
45
48
  }
46
49
  queryParameters.push(`$expand=${expands.join(',')}`);
@@ -86,7 +89,8 @@ _EntraPimRoleAssignmentEligibilityListCommand_instances = new WeakSet(), _EntraP
86
89
  userName: typeof args.options.userName !== 'undefined',
87
90
  groupId: typeof args.options.groupId !== 'undefined',
88
91
  groupName: typeof args.options.groupName !== 'undefined',
89
- includePrincipalDetails: !!args.options.includePrincipalDetails
92
+ includePrincipalDetails: !!args.options.includePrincipalDetails,
93
+ withPrincipalDetails: !!args.options.withPrincipalDetails
90
94
  });
91
95
  });
92
96
  }, _EntraPimRoleAssignmentEligibilityListCommand_initOptions = function _EntraPimRoleAssignmentEligibilityListCommand_initOptions() {
@@ -99,7 +103,9 @@ _EntraPimRoleAssignmentEligibilityListCommand_instances = new WeakSet(), _EntraP
99
103
  }, {
100
104
  option: '--groupName [groupName]'
101
105
  }, {
102
- option: '--includePrincipalDetails [includePrincipalDetails]'
106
+ option: '--includePrincipalDetails'
107
+ }, {
108
+ option: '--withPrincipalDetails'
103
109
  });
104
110
  }, _EntraPimRoleAssignmentEligibilityListCommand_initValidators = function _EntraPimRoleAssignmentEligibilityListCommand_initValidators() {
105
111
  this.validators.push(async (args) => {
@@ -30,6 +30,9 @@ class EntraPimRoleAssignmentListCommand extends GraphCommand {
30
30
  const filters = [];
31
31
  const expands = [];
32
32
  try {
33
+ if (args.options.includePrincipalDetails) {
34
+ await this.warn(logger, `Parameter 'includePrincipalDetails' is deprecated. Please use 'withPrincipalDetails' instead`);
35
+ }
33
36
  const principalId = await this.getPrincipalId(logger, args.options);
34
37
  if (principalId) {
35
38
  filters.push(`principalId eq '${principalId}'`);
@@ -41,7 +44,7 @@ class EntraPimRoleAssignmentListCommand extends GraphCommand {
41
44
  queryParameters.push(`$filter=${filters.join(' and ')}`);
42
45
  }
43
46
  expands.push('roleDefinition($select=displayName)');
44
- if (args.options.includePrincipalDetails) {
47
+ if (args.options.includePrincipalDetails || args.options.withPrincipalDetails) {
45
48
  expands.push('principal');
46
49
  }
47
50
  queryParameters.push(`$expand=${expands.join(',')}`);
@@ -82,7 +85,8 @@ _EntraPimRoleAssignmentListCommand_instances = new WeakSet(), _EntraPimRoleAssig
82
85
  groupId: typeof args.options.groupId !== 'undefined',
83
86
  groupName: typeof args.options.groupName !== 'undefined',
84
87
  startDateTime: typeof args.options.startDateTime !== 'undefined',
85
- includePrincipalDetails: !!args.options.includePrincipalDetails
88
+ includePrincipalDetails: !!args.options.includePrincipalDetails,
89
+ withPrincipalDetails: !!args.options.withPrincipalDetails
86
90
  });
87
91
  });
88
92
  }, _EntraPimRoleAssignmentListCommand_initOptions = function _EntraPimRoleAssignmentListCommand_initOptions() {
@@ -97,7 +101,9 @@ _EntraPimRoleAssignmentListCommand_instances = new WeakSet(), _EntraPimRoleAssig
97
101
  }, {
98
102
  option: "-s, --startDateTime [startDateTime]"
99
103
  }, {
100
- option: "--includePrincipalDetails [includePrincipalDetails]"
104
+ option: "--includePrincipalDetails"
105
+ }, {
106
+ option: "--withPrincipalDetails"
101
107
  });
102
108
  }, _EntraPimRoleAssignmentListCommand_initValidators = function _EntraPimRoleAssignmentListCommand_initValidators() {
103
109
  this.validators.push(async (args) => {
@@ -30,6 +30,9 @@ class EntraPimRoleRequestListCommand extends GraphCommand {
30
30
  __classPrivateFieldGet(this, _EntraPimRoleRequestListCommand_instances, "m", _EntraPimRoleRequestListCommand_initOptionSets).call(this);
31
31
  }
32
32
  async commandAction(logger, args) {
33
+ if (args.options.includePrincipalDetails) {
34
+ await this.warn(logger, `Parameter 'includePrincipalDetails' is deprecated. Please use 'withPrincipalDetails' instead`);
35
+ }
33
36
  if (this.verbose) {
34
37
  await logger.logToStderr(`Retrieving list of PIM roles requests for ${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName || 'all users'}...`);
35
38
  }
@@ -51,7 +54,7 @@ class EntraPimRoleRequestListCommand extends GraphCommand {
51
54
  queryParameters.push(`$filter=${filters.join(' and ')}`);
52
55
  }
53
56
  expands.push('roleDefinition($select=displayName)');
54
- if (args.options.includePrincipalDetails) {
57
+ if (args.options.includePrincipalDetails || args.options.withPrincipalDetails) {
55
58
  expands.push('principal');
56
59
  }
57
60
  queryParameters.push(`$expand=${expands.join(',')}`);
@@ -100,7 +103,8 @@ _EntraPimRoleRequestListCommand_instances = new WeakSet(), _EntraPimRoleRequestL
100
103
  groupName: typeof args.options.groupName !== 'undefined',
101
104
  createdDateTime: typeof args.options.createdDateTime !== 'undefined',
102
105
  status: typeof args.options.status !== 'undefined',
103
- includePrincipalDetails: !!args.options.includePrincipalDetails
106
+ includePrincipalDetails: !!args.options.includePrincipalDetails,
107
+ withPrincipalDetails: !!args.options.withPrincipalDetails
104
108
  });
105
109
  });
106
110
  }, _EntraPimRoleRequestListCommand_initOptions = function _EntraPimRoleRequestListCommand_initOptions() {
@@ -118,7 +122,9 @@ _EntraPimRoleRequestListCommand_instances = new WeakSet(), _EntraPimRoleRequestL
118
122
  option: '-s, --status [status]',
119
123
  autocomplete: this.allowedStatuses
120
124
  }, {
121
- option: '--includePrincipalDetails [includePrincipalDetails]'
125
+ option: '--includePrincipalDetails'
126
+ }, {
127
+ option: '--withPrincipalDetails'
122
128
  });
123
129
  }, _EntraPimRoleRequestListCommand_initValidators = function _EntraPimRoleRequestListCommand_initValidators() {
124
130
  this.validators.push(async (args) => {