@pnp/cli-microsoft365 11.9.0-beta.8c1ee05 → 11.9.0-beta.93bd508

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 (73) hide show
  1. package/.devproxy/api-specs/sharepoint.yaml +82 -0
  2. package/allCommands.json +1 -1
  3. package/allCommandsFull.json +1 -1
  4. package/dist/m365/cli/commands/app/app-reconsent.js +8 -0
  5. package/dist/m365/cli/commands/cli-consent.js +8 -31
  6. package/dist/m365/cli/commands/cli-doctor.js +6 -1
  7. package/dist/m365/cli/commands/cli-issue.js +8 -36
  8. package/dist/m365/cli/commands/completion/completion-clink-update.js +8 -0
  9. package/dist/m365/cli/commands/completion/completion-pwsh-setup.js +8 -16
  10. package/dist/m365/cli/commands/completion/completion-pwsh-update.js +8 -0
  11. package/dist/m365/cli/commands/completion/completion-sh-setup.js +8 -0
  12. package/dist/m365/cli/commands/completion/completion-sh-update.js +8 -0
  13. package/dist/m365/cli/commands/config/config-get.js +9 -32
  14. package/dist/m365/cli/commands/config/config-list.js +8 -0
  15. package/dist/m365/cli/commands/config/config-reset.js +9 -34
  16. package/dist/m365/cli/commands/config/config-set.js +86 -70
  17. package/dist/m365/commands/request.js +26 -60
  18. package/dist/m365/commands/search.js +59 -77
  19. package/dist/m365/commands/setup.js +16 -31
  20. package/dist/m365/commands/version.js +6 -0
  21. package/dist/m365/connection/commands/connection-remove.js +9 -29
  22. package/dist/m365/connection/commands/connection-use.js +8 -26
  23. package/dist/m365/context/commands/context-init.js +6 -0
  24. package/dist/m365/context/commands/option/option-set.js +9 -18
  25. package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-add.js +32 -63
  26. package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-get.js +21 -45
  27. package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-list.js +32 -53
  28. package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-remove.js +34 -74
  29. package/dist/m365/entra/commands/administrativeunit/administrativeunit-roleassignment-add.js +37 -57
  30. package/dist/m365/entra/commands/multitenant/multitenant-get.js +8 -1
  31. package/dist/m365/entra/commands/multitenant/multitenant-remove.js +8 -22
  32. package/dist/m365/entra/commands/multitenant/multitenant-set.js +15 -36
  33. package/dist/m365/entra/commands/oauth2grant/oauth2grant-add.js +10 -31
  34. package/dist/m365/entra/commands/oauth2grant/oauth2grant-list.js +8 -24
  35. package/dist/m365/entra/commands/oauth2grant/oauth2grant-remove.js +9 -17
  36. package/dist/m365/entra/commands/oauth2grant/oauth2grant-set.js +9 -17
  37. package/dist/m365/outlook/commands/calendar/calendar-get.js +1 -1
  38. package/dist/m365/spe/commands/container/container-get.js +54 -26
  39. package/dist/m365/spe/commands/container/container-permission-list.js +43 -4
  40. package/dist/m365/spe/commands/container/container-set.js +77 -0
  41. package/dist/m365/spe/commands.js +1 -0
  42. package/dist/m365/spo/commands/file/file-unarchive.js +83 -0
  43. package/dist/m365/spo/commands/folder/folder-archive.js +89 -0
  44. package/dist/m365/spo/commands.js +2 -0
  45. package/dist/m365/viva/commands/engage/engage-role-member-add.js +79 -0
  46. package/dist/m365/viva/commands.js +1 -0
  47. package/docs/docs/cmd/outlook/calendar/calendar-get.mdx +7 -7
  48. package/docs/docs/cmd/spe/container/container-get.mdx +24 -3
  49. package/docs/docs/cmd/spe/container/container-permission-list.mdx +24 -3
  50. package/docs/docs/cmd/spe/container/container-set.mdx +160 -0
  51. package/docs/docs/cmd/spo/app/app-add.mdx +19 -0
  52. package/docs/docs/cmd/spo/app/app-deploy.mdx +21 -0
  53. package/docs/docs/cmd/spo/app/app-get.mdx +19 -0
  54. package/docs/docs/cmd/spo/app/app-install.mdx +21 -0
  55. package/docs/docs/cmd/spo/app/app-instance-list.mdx +19 -0
  56. package/docs/docs/cmd/spo/app/app-list.mdx +19 -0
  57. package/docs/docs/cmd/spo/app/app-remove.mdx +21 -0
  58. package/docs/docs/cmd/spo/app/app-retract.mdx +21 -0
  59. package/docs/docs/cmd/spo/app/app-teamspackage-download.mdx +21 -0
  60. package/docs/docs/cmd/spo/app/app-uninstall.mdx +21 -0
  61. package/docs/docs/cmd/spo/app/app-upgrade.mdx +21 -0
  62. package/docs/docs/cmd/spo/apppage/apppage-add.mdx +19 -1
  63. package/docs/docs/cmd/spo/apppage/apppage-set.mdx +21 -0
  64. package/docs/docs/cmd/spo/commandset/commandset-add.mdx +19 -0
  65. package/docs/docs/cmd/spo/commandset/commandset-get.mdx +19 -0
  66. package/docs/docs/cmd/spo/commandset/commandset-list.mdx +19 -0
  67. package/docs/docs/cmd/spo/commandset/commandset-remove.mdx +21 -0
  68. package/docs/docs/cmd/spo/commandset/commandset-set.mdx +21 -0
  69. package/docs/docs/cmd/spo/file/file-unarchive.mdx +68 -0
  70. package/docs/docs/cmd/spo/folder/folder-archive.mdx +73 -0
  71. package/docs/docs/cmd/viva/engage/engage-role-member-add.mdx +76 -0
  72. package/npm-shrinkwrap.json +273 -128
  73. package/package.json +18 -18
@@ -1,17 +1,23 @@
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 _EntraAdministrativeUnitMemberAddCommand_instances, _EntraAdministrativeUnitMemberAddCommand_initTelemetry, _EntraAdministrativeUnitMemberAddCommand_initOptions, _EntraAdministrativeUnitMemberAddCommand_initValidators, _EntraAdministrativeUnitMemberAddCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { entraAdministrativeUnit } from "../../../../utils/entraAdministrativeUnit.js";
8
4
  import { entraGroup } from "../../../../utils/entraGroup.js";
9
5
  import { entraUser } from "../../../../utils/entraUser.js";
10
- import { validation } from "../../../../utils/validation.js";
11
6
  import GraphCommand from "../../../base/GraphCommand.js";
12
7
  import commands from "../../commands.js";
13
8
  import request from "../../../../request.js";
14
9
  import { entraDevice } from "../../../../utils/entraDevice.js";
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ administrativeUnitId: z.uuid().optional().alias('i'),
13
+ administrativeUnitName: z.string().optional().alias('n'),
14
+ userId: z.uuid().optional(),
15
+ userName: z.string().optional(),
16
+ groupId: z.uuid().optional(),
17
+ groupName: z.string().optional(),
18
+ deviceId: z.uuid().optional(),
19
+ deviceName: z.string().optional()
20
+ });
15
21
  class EntraAdministrativeUnitMemberAddCommand extends GraphCommand {
16
22
  get name() {
17
23
  return commands.ADMINISTRATIVEUNIT_MEMBER_ADD;
@@ -19,13 +25,25 @@ class EntraAdministrativeUnitMemberAddCommand extends GraphCommand {
19
25
  get description() {
20
26
  return 'Adds a member (user, group, device) to an administrative unit';
21
27
  }
22
- constructor() {
23
- super();
24
- _EntraAdministrativeUnitMemberAddCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberAddCommand_instances, "m", _EntraAdministrativeUnitMemberAddCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberAddCommand_instances, "m", _EntraAdministrativeUnitMemberAddCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberAddCommand_instances, "m", _EntraAdministrativeUnitMemberAddCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberAddCommand_instances, "m", _EntraAdministrativeUnitMemberAddCommand_initOptionSets).call(this);
28
+ get schema() {
29
+ return options;
30
+ }
31
+ getRefinedSchema(schema) {
32
+ return schema
33
+ .refine(options => [options.administrativeUnitId, options.administrativeUnitName].filter(Boolean).length === 1, {
34
+ error: 'Specify either administrativeUnitId or administrativeUnitName',
35
+ params: {
36
+ customCode: 'optionSet',
37
+ options: ['administrativeUnitId', 'administrativeUnitName']
38
+ }
39
+ })
40
+ .refine(options => [options.userId, options.userName, options.groupId, options.groupName, options.deviceId, options.deviceName].filter(Boolean).length === 1, {
41
+ error: 'Specify either userId, userName, groupId, groupName, deviceId, or deviceName',
42
+ params: {
43
+ customCode: 'optionSet',
44
+ options: ['userId', 'userName', 'groupId', 'groupName', 'deviceId', 'deviceName']
45
+ }
46
+ });
29
47
  }
30
48
  async commandAction(logger, args) {
31
49
  let administrativeUnitId = args.options.administrativeUnitId;
@@ -84,54 +102,5 @@ class EntraAdministrativeUnitMemberAddCommand extends GraphCommand {
84
102
  }
85
103
  }
86
104
  }
87
- _EntraAdministrativeUnitMemberAddCommand_instances = new WeakSet(), _EntraAdministrativeUnitMemberAddCommand_initTelemetry = function _EntraAdministrativeUnitMemberAddCommand_initTelemetry() {
88
- this.telemetry.push((args) => {
89
- Object.assign(this.telemetryProperties, {
90
- userId: typeof args.options.userId !== 'undefined',
91
- userName: typeof args.options.userName !== 'undefined',
92
- groupId: typeof args.options.groupId !== 'undefined',
93
- groupName: typeof args.options.groupName !== 'undefined',
94
- deviceId: typeof args.options.deviceId !== 'undefined',
95
- deviceName: typeof args.options.deviceName !== 'undefined'
96
- });
97
- });
98
- }, _EntraAdministrativeUnitMemberAddCommand_initOptions = function _EntraAdministrativeUnitMemberAddCommand_initOptions() {
99
- this.options.unshift({
100
- option: '-i, --administrativeUnitId [administrativeUnitId]'
101
- }, {
102
- option: '-n, --administrativeUnitName [administrativeUnitName]'
103
- }, {
104
- option: "--userId [userId]"
105
- }, {
106
- option: "--userName [userName]"
107
- }, {
108
- option: "--groupId [groupId]"
109
- }, {
110
- option: "--groupName [groupName]"
111
- }, {
112
- option: "--deviceId [deviceId]"
113
- }, {
114
- option: "--deviceName [deviceName]"
115
- });
116
- }, _EntraAdministrativeUnitMemberAddCommand_initValidators = function _EntraAdministrativeUnitMemberAddCommand_initValidators() {
117
- this.validators.push(async (args) => {
118
- if (args.options.administrativeUnitId && !validation.isValidGuid(args.options.administrativeUnitId)) {
119
- return `${args.options.administrativeUnitId} is not a valid GUID`;
120
- }
121
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
122
- return `${args.options.userId} is not a valid GUID`;
123
- }
124
- if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
125
- return `${args.options.groupId} is not a valid GUID`;
126
- }
127
- if (args.options.deviceId && !validation.isValidGuid(args.options.deviceId)) {
128
- return `${args.options.deviceId} is not a valid GUID`;
129
- }
130
- return true;
131
- });
132
- }, _EntraAdministrativeUnitMemberAddCommand_initOptionSets = function _EntraAdministrativeUnitMemberAddCommand_initOptionSets() {
133
- this.optionSets.push({ options: ['administrativeUnitId', 'administrativeUnitName'] });
134
- this.optionSets.push({ options: ['userId', 'userName', 'groupId', 'groupName', 'deviceId', 'deviceName'] });
135
- };
136
105
  export default new EntraAdministrativeUnitMemberAddCommand();
137
106
  //# sourceMappingURL=administrativeunit-member-add.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 _EntraAdministrativeUnitMemberGetCommand_instances, _EntraAdministrativeUnitMemberGetCommand_initTelemetry, _EntraAdministrativeUnitMemberGetCommand_initOptions, _EntraAdministrativeUnitMemberGetCommand_initValidators, _EntraAdministrativeUnitMemberGetCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import GraphCommand from '../../../base/GraphCommand.js';
8
4
  import commands from '../../commands.js';
9
- import { validation } from '../../../../utils/validation.js';
10
5
  import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js';
11
6
  import request from '../../../../request.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ id: z.uuid().alias('i'),
10
+ administrativeUnitId: z.uuid().optional().alias('u'),
11
+ administrativeUnitName: z.string().optional().alias('n'),
12
+ properties: z.string().optional().alias('p')
13
+ });
12
14
  class EntraAdministrativeUnitMemberGetCommand extends GraphCommand {
13
15
  get name() {
14
16
  return commands.ADMINISTRATIVEUNIT_MEMBER_GET;
@@ -16,13 +18,18 @@ class EntraAdministrativeUnitMemberGetCommand extends GraphCommand {
16
18
  get description() {
17
19
  return 'Retrieve a specific member (user, group, or device) of an administrative unit';
18
20
  }
19
- constructor() {
20
- super();
21
- _EntraAdministrativeUnitMemberGetCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberGetCommand_instances, "m", _EntraAdministrativeUnitMemberGetCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberGetCommand_instances, "m", _EntraAdministrativeUnitMemberGetCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberGetCommand_instances, "m", _EntraAdministrativeUnitMemberGetCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberGetCommand_instances, "m", _EntraAdministrativeUnitMemberGetCommand_initOptionSets).call(this);
21
+ get schema() {
22
+ return options;
23
+ }
24
+ getRefinedSchema(schema) {
25
+ return schema
26
+ .refine(options => [options.administrativeUnitId, options.administrativeUnitName].filter(Boolean).length === 1, {
27
+ error: 'Specify either administrativeUnitId or administrativeUnitName',
28
+ params: {
29
+ customCode: 'optionSet',
30
+ options: ['administrativeUnitId', 'administrativeUnitName']
31
+ }
32
+ });
26
33
  }
27
34
  async commandAction(logger, args) {
28
35
  let administrativeUnitId = args.options.administrativeUnitId;
@@ -77,36 +84,5 @@ class EntraAdministrativeUnitMemberGetCommand extends GraphCommand {
77
84
  return `${this.resource}/v1.0/directory/administrativeUnits/${administrativeUnitId}/members/${memberId}${queryString}`;
78
85
  }
79
86
  }
80
- _EntraAdministrativeUnitMemberGetCommand_instances = new WeakSet(), _EntraAdministrativeUnitMemberGetCommand_initTelemetry = function _EntraAdministrativeUnitMemberGetCommand_initTelemetry() {
81
- this.telemetry.push((args) => {
82
- Object.assign(this.telemetryProperties, {
83
- administrativeUnitId: typeof args.options.administrativeUnitId !== 'undefined',
84
- administrativeUnitName: typeof args.options.administrativeUnitName !== 'undefined',
85
- properties: typeof args.options.properties !== 'undefined'
86
- });
87
- });
88
- }, _EntraAdministrativeUnitMemberGetCommand_initOptions = function _EntraAdministrativeUnitMemberGetCommand_initOptions() {
89
- this.options.unshift({
90
- option: '-i, --id <id>'
91
- }, {
92
- option: '-u, --administrativeUnitId [administrativeUnitId]'
93
- }, {
94
- option: '-n, --administrativeUnitName [administrativeUnitName]'
95
- }, {
96
- option: '-p, --properties [properties]'
97
- });
98
- }, _EntraAdministrativeUnitMemberGetCommand_initValidators = function _EntraAdministrativeUnitMemberGetCommand_initValidators() {
99
- this.validators.push(async (args) => {
100
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
101
- return `${args.options.id} is not a valid GUID`;
102
- }
103
- if (args.options.administrativeUnitId && !validation.isValidGuid(args.options.administrativeUnitId)) {
104
- return `${args.options.administrativeUnitId} is not a valid GUID`;
105
- }
106
- return true;
107
- });
108
- }, _EntraAdministrativeUnitMemberGetCommand_initOptionSets = function _EntraAdministrativeUnitMemberGetCommand_initOptionSets() {
109
- this.optionSets.push({ options: ['administrativeUnitId', 'administrativeUnitName'] });
110
- };
111
87
  export default new EntraAdministrativeUnitMemberGetCommand();
112
88
  //# sourceMappingURL=administrativeunit-member-get.js.map
@@ -1,14 +1,24 @@
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 _EntraAdministrativeUnitMemberListCommand_instances, _EntraAdministrativeUnitMemberListCommand_initTelemetry, _EntraAdministrativeUnitMemberListCommand_initOptions, _EntraAdministrativeUnitMemberListCommand_initValidators, _EntraAdministrativeUnitMemberListCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { odata } from '../../../../utils/odata.js';
8
4
  import GraphCommand from '../../../base/GraphCommand.js';
9
5
  import commands from '../../commands.js';
10
6
  import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js';
11
- import { validation } from '../../../../utils/validation.js';
7
+ import { zod } from '../../../../utils/zod.js';
8
+ var MemberType;
9
+ (function (MemberType) {
10
+ MemberType["User"] = "user";
11
+ MemberType["Group"] = "group";
12
+ MemberType["Device"] = "device";
13
+ })(MemberType || (MemberType = {}));
14
+ export const options = z.strictObject({
15
+ ...globalOptionsZod.shape,
16
+ administrativeUnitId: z.uuid().optional().alias('i'),
17
+ administrativeUnitName: z.string().optional().alias('n'),
18
+ type: zod.coercedEnum(MemberType).optional().alias('t'),
19
+ properties: z.string().optional().alias('p'),
20
+ filter: z.string().optional().alias('f')
21
+ });
12
22
  class EntraAdministrativeUnitMemberListCommand extends GraphCommand {
13
23
  get name() {
14
24
  return commands.ADMINISTRATIVEUNIT_MEMBER_LIST;
@@ -19,13 +29,21 @@ class EntraAdministrativeUnitMemberListCommand extends GraphCommand {
19
29
  defaultProperties() {
20
30
  return ['id', 'displayName'];
21
31
  }
22
- constructor() {
23
- super();
24
- _EntraAdministrativeUnitMemberListCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberListCommand_instances, "m", _EntraAdministrativeUnitMemberListCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberListCommand_instances, "m", _EntraAdministrativeUnitMemberListCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberListCommand_instances, "m", _EntraAdministrativeUnitMemberListCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberListCommand_instances, "m", _EntraAdministrativeUnitMemberListCommand_initOptionSets).call(this);
32
+ get schema() {
33
+ return options;
34
+ }
35
+ getRefinedSchema(schema) {
36
+ return schema
37
+ .refine(options => [options.administrativeUnitId, options.administrativeUnitName].filter(Boolean).length === 1, {
38
+ error: 'Specify either administrativeUnitId or administrativeUnitName',
39
+ params: {
40
+ customCode: 'optionSet',
41
+ options: ['administrativeUnitId', 'administrativeUnitName']
42
+ }
43
+ })
44
+ .refine(options => !options.filter || options.type, {
45
+ error: 'Filter can be specified only if type is set'
46
+ });
29
47
  }
30
48
  async commandAction(logger, args) {
31
49
  let administrativeUnitId = args.options.administrativeUnitId;
@@ -95,44 +113,5 @@ class EntraAdministrativeUnitMemberListCommand extends GraphCommand {
95
113
  : `${this.resource}/v1.0/directory/administrativeUnits/${administrativeUnitId}/members${queryString}`;
96
114
  }
97
115
  }
98
- _EntraAdministrativeUnitMemberListCommand_instances = new WeakSet(), _EntraAdministrativeUnitMemberListCommand_initTelemetry = function _EntraAdministrativeUnitMemberListCommand_initTelemetry() {
99
- this.telemetry.push((args) => {
100
- Object.assign(this.telemetryProperties, {
101
- type: typeof args.options.type !== 'undefined',
102
- properties: typeof args.options.properties !== 'undefined',
103
- filter: typeof args.options.filter !== 'undefined'
104
- });
105
- });
106
- }, _EntraAdministrativeUnitMemberListCommand_initOptions = function _EntraAdministrativeUnitMemberListCommand_initOptions() {
107
- this.options.unshift({
108
- option: '-i, --administrativeUnitId [administrativeUnitId]'
109
- }, {
110
- option: '-n, --administrativeUnitName [administrativeUnitName]'
111
- }, {
112
- option: '-t, --type [type]',
113
- autocomplete: ['user', 'group', 'device']
114
- }, {
115
- option: '-p, --properties [properties]'
116
- }, {
117
- option: '-f, --filter [filter]'
118
- });
119
- }, _EntraAdministrativeUnitMemberListCommand_initValidators = function _EntraAdministrativeUnitMemberListCommand_initValidators() {
120
- this.validators.push(async (args) => {
121
- if (args.options.administrativeUnitId && !validation.isValidGuid(args.options.administrativeUnitId)) {
122
- return `${args.options.administrativeUnitId} is not a valid GUID`;
123
- }
124
- if (args.options.type) {
125
- if (['user', 'group', 'device'].every(type => type !== args.options.type)) {
126
- return `${args.options.type} is not a valid type value. Allowed values user|group|device`;
127
- }
128
- }
129
- if (args.options.filter && !args.options.type) {
130
- return 'Filter can be specified only if type is set';
131
- }
132
- return true;
133
- });
134
- }, _EntraAdministrativeUnitMemberListCommand_initOptionSets = function _EntraAdministrativeUnitMemberListCommand_initOptionSets() {
135
- this.optionSets.push({ options: ['administrativeUnitId', 'administrativeUnitName'] });
136
- };
137
116
  export default new EntraAdministrativeUnitMemberListCommand();
138
117
  //# sourceMappingURL=administrativeunit-member-list.js.map
@@ -1,18 +1,26 @@
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 _EntraAdministrativeUnitMemberRemoveCommand_instances, _EntraAdministrativeUnitMemberRemoveCommand_initTelemetry, _EntraAdministrativeUnitMemberRemoveCommand_initOptions, _EntraAdministrativeUnitMemberRemoveCommand_initValidators, _EntraAdministrativeUnitMemberRemoveCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js';
8
4
  import { entraDevice } from '../../../../utils/entraDevice.js';
9
5
  import { entraGroup } from '../../../../utils/entraGroup.js';
10
6
  import { entraUser } from '../../../../utils/entraUser.js';
11
- import { validation } from '../../../../utils/validation.js';
12
7
  import GraphCommand from '../../../base/GraphCommand.js';
13
8
  import commands from '../../commands.js';
14
9
  import request from '../../../../request.js';
15
10
  import { cli } from '../../../../cli/cli.js';
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ id: z.uuid().optional().alias('i'),
14
+ userId: z.uuid().optional(),
15
+ userName: z.string().optional(),
16
+ groupId: z.uuid().optional(),
17
+ groupName: z.string().optional(),
18
+ deviceId: z.uuid().optional(),
19
+ deviceName: z.string().optional(),
20
+ administrativeUnitId: z.uuid().optional(),
21
+ administrativeUnitName: z.string().optional(),
22
+ force: z.boolean().optional().alias('f')
23
+ });
16
24
  class EntraAdministrativeUnitMemberRemoveCommand extends GraphCommand {
17
25
  get name() {
18
26
  return commands.ADMINISTRATIVEUNIT_MEMBER_REMOVE;
@@ -20,13 +28,25 @@ class EntraAdministrativeUnitMemberRemoveCommand extends GraphCommand {
20
28
  get description() {
21
29
  return 'Remove a specific member (user, group, or device) from an administrative unit';
22
30
  }
23
- constructor() {
24
- super();
25
- _EntraAdministrativeUnitMemberRemoveCommand_instances.add(this);
26
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberRemoveCommand_instances, "m", _EntraAdministrativeUnitMemberRemoveCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberRemoveCommand_instances, "m", _EntraAdministrativeUnitMemberRemoveCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberRemoveCommand_instances, "m", _EntraAdministrativeUnitMemberRemoveCommand_initOptionSets).call(this);
29
- __classPrivateFieldGet(this, _EntraAdministrativeUnitMemberRemoveCommand_instances, "m", _EntraAdministrativeUnitMemberRemoveCommand_initTelemetry).call(this);
31
+ get schema() {
32
+ return options;
33
+ }
34
+ getRefinedSchema(schema) {
35
+ return schema
36
+ .refine(options => [options.administrativeUnitId, options.administrativeUnitName].filter(Boolean).length === 1, {
37
+ error: 'Specify either administrativeUnitId or administrativeUnitName',
38
+ params: {
39
+ customCode: 'optionSet',
40
+ options: ['administrativeUnitId', 'administrativeUnitName']
41
+ }
42
+ })
43
+ .refine(options => [options.id, options.userId, options.userName, options.groupId, options.groupName, options.deviceId, options.deviceName].filter(Boolean).length === 1, {
44
+ error: 'Specify either id, userId, userName, groupId, groupName, deviceId, or deviceName',
45
+ params: {
46
+ customCode: 'optionSet',
47
+ options: ['id', 'userId', 'userName', 'groupId', 'groupName', 'deviceId', 'deviceName']
48
+ }
49
+ });
30
50
  }
31
51
  async commandAction(logger, args) {
32
52
  const removeAdministrativeUnitMember = async () => {
@@ -89,65 +109,5 @@ class EntraAdministrativeUnitMemberRemoveCommand extends GraphCommand {
89
109
  }
90
110
  }
91
111
  }
92
- _EntraAdministrativeUnitMemberRemoveCommand_instances = new WeakSet(), _EntraAdministrativeUnitMemberRemoveCommand_initTelemetry = function _EntraAdministrativeUnitMemberRemoveCommand_initTelemetry() {
93
- this.telemetry.push((args) => {
94
- Object.assign(this.telemetryProperties, {
95
- id: typeof args.options.id !== 'undefined',
96
- userId: typeof args.options.userId !== 'undefined',
97
- userName: typeof args.options.userName !== 'undefined',
98
- groupId: typeof args.options.groupId !== 'undefined',
99
- groupName: typeof args.options.groupName !== 'undefined',
100
- deviceId: typeof args.options.deviceId !== 'undefined',
101
- deviceName: typeof args.options.deviceName !== 'undefined',
102
- administrativeUnitId: typeof args.options.administrativeUnitId !== 'undefined',
103
- administrativeUnitName: typeof args.options.administrativeUnitName !== 'undefined',
104
- force: !!args.options.force
105
- });
106
- });
107
- }, _EntraAdministrativeUnitMemberRemoveCommand_initOptions = function _EntraAdministrativeUnitMemberRemoveCommand_initOptions() {
108
- this.options.unshift({
109
- option: '-i, --id [id]'
110
- }, {
111
- option: "--userId [userId]"
112
- }, {
113
- option: "--userName [userName]"
114
- }, {
115
- option: "--groupId [groupId]"
116
- }, {
117
- option: "--groupName [groupName]"
118
- }, {
119
- option: "--deviceId [deviceId]"
120
- }, {
121
- option: "--deviceName [deviceName]"
122
- }, {
123
- option: '--administrativeUnitId [administrativeUnitId]'
124
- }, {
125
- option: '--administrativeUnitName [administrativeUnitName]'
126
- }, {
127
- option: '-f, --force'
128
- });
129
- }, _EntraAdministrativeUnitMemberRemoveCommand_initValidators = function _EntraAdministrativeUnitMemberRemoveCommand_initValidators() {
130
- this.validators.push(async (args) => {
131
- if (args.options.administrativeUnitId && !validation.isValidGuid(args.options.administrativeUnitId)) {
132
- return `${args.options.administrativeUnitId} is not a valid GUID`;
133
- }
134
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
135
- return `${args.options.id} is not a valid GUID`;
136
- }
137
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
138
- return `${args.options.userId} is not a valid GUID`;
139
- }
140
- if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
141
- return `${args.options.groupId} is not a valid GUID`;
142
- }
143
- if (args.options.deviceId && !validation.isValidGuid(args.options.deviceId)) {
144
- return `${args.options.deviceId} is not a valid GUID`;
145
- }
146
- return true;
147
- });
148
- }, _EntraAdministrativeUnitMemberRemoveCommand_initOptionSets = function _EntraAdministrativeUnitMemberRemoveCommand_initOptionSets() {
149
- this.optionSets.push({ options: ['administrativeUnitId', 'administrativeUnitName'] });
150
- this.optionSets.push({ options: ['id', 'userId', 'userName', 'groupId', 'groupName', 'deviceId', 'deviceName'] });
151
- };
152
112
  export default new EntraAdministrativeUnitMemberRemoveCommand();
153
113
  //# sourceMappingURL=administrativeunit-member-remove.js.map
@@ -1,16 +1,20 @@
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 _EntraAdministrativeUnitRoleAssignmentAddCommand_instances, _EntraAdministrativeUnitRoleAssignmentAddCommand_initTelemetry, _EntraAdministrativeUnitRoleAssignmentAddCommand_initOptions, _EntraAdministrativeUnitRoleAssignmentAddCommand_initValidators, _EntraAdministrativeUnitRoleAssignmentAddCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js';
8
4
  import { entraUser } from '../../../../utils/entraUser.js';
9
5
  import { roleAssignment } from '../../../../utils/roleAssignment.js';
10
6
  import { roleDefinition } from '../../../../utils/roleDefinition.js';
11
- import { validation } from '../../../../utils/validation.js';
12
7
  import GraphCommand from '../../../base/GraphCommand.js';
13
8
  import commands from '../../commands.js';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ administrativeUnitId: z.uuid().optional().alias('i'),
12
+ administrativeUnitName: z.string().optional().alias('n'),
13
+ roleDefinitionId: z.uuid().optional(),
14
+ roleDefinitionName: z.string().optional(),
15
+ userId: z.uuid().optional(),
16
+ userName: z.string().optional()
17
+ });
14
18
  class EntraAdministrativeUnitRoleAssignmentAddCommand extends GraphCommand {
15
19
  get name() {
16
20
  return commands.ADMINISTRATIVEUNIT_ROLEASSIGNMENT_ADD;
@@ -18,13 +22,32 @@ class EntraAdministrativeUnitRoleAssignmentAddCommand extends GraphCommand {
18
22
  get description() {
19
23
  return 'Assigns a Microsoft Entra role with administrative unit scope to a user';
20
24
  }
21
- constructor() {
22
- super();
23
- _EntraAdministrativeUnitRoleAssignmentAddCommand_instances.add(this);
24
- __classPrivateFieldGet(this, _EntraAdministrativeUnitRoleAssignmentAddCommand_instances, "m", _EntraAdministrativeUnitRoleAssignmentAddCommand_initTelemetry).call(this);
25
- __classPrivateFieldGet(this, _EntraAdministrativeUnitRoleAssignmentAddCommand_instances, "m", _EntraAdministrativeUnitRoleAssignmentAddCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _EntraAdministrativeUnitRoleAssignmentAddCommand_instances, "m", _EntraAdministrativeUnitRoleAssignmentAddCommand_initValidators).call(this);
27
- __classPrivateFieldGet(this, _EntraAdministrativeUnitRoleAssignmentAddCommand_instances, "m", _EntraAdministrativeUnitRoleAssignmentAddCommand_initOptionSets).call(this);
25
+ get schema() {
26
+ return options;
27
+ }
28
+ getRefinedSchema(schema) {
29
+ return schema
30
+ .refine(options => [options.administrativeUnitId, options.administrativeUnitName].filter(Boolean).length === 1, {
31
+ error: 'Specify either administrativeUnitId or administrativeUnitName',
32
+ params: {
33
+ customCode: 'optionSet',
34
+ options: ['administrativeUnitId', 'administrativeUnitName']
35
+ }
36
+ })
37
+ .refine(options => [options.roleDefinitionId, options.roleDefinitionName].filter(Boolean).length === 1, {
38
+ error: 'Specify either roleDefinitionId or roleDefinitionName',
39
+ params: {
40
+ customCode: 'optionSet',
41
+ options: ['roleDefinitionId', 'roleDefinitionName']
42
+ }
43
+ })
44
+ .refine(options => [options.userId, options.userName].filter(Boolean).length === 1, {
45
+ error: 'Specify either userId or userName',
46
+ params: {
47
+ customCode: 'optionSet',
48
+ options: ['userId', 'userName']
49
+ }
50
+ });
28
51
  }
29
52
  async commandAction(logger, args) {
30
53
  try {
@@ -55,48 +78,5 @@ class EntraAdministrativeUnitRoleAssignmentAddCommand extends GraphCommand {
55
78
  }
56
79
  }
57
80
  }
58
- _EntraAdministrativeUnitRoleAssignmentAddCommand_instances = new WeakSet(), _EntraAdministrativeUnitRoleAssignmentAddCommand_initTelemetry = function _EntraAdministrativeUnitRoleAssignmentAddCommand_initTelemetry() {
59
- this.telemetry.push((args) => {
60
- Object.assign(this.telemetryProperties, {
61
- administrativeUnitId: typeof args.options.administrativeUnitId !== 'undefined',
62
- administrativeUnitName: typeof args.options.administrativeUnitName !== 'undefined',
63
- roleDefinitionId: typeof args.options.roleDefinitionId !== 'undefined',
64
- roleDefinitionName: typeof args.options.roleDefinitionName !== 'undefined',
65
- userId: typeof args.options.userId !== 'undefined',
66
- userName: typeof args.options.userName !== 'undefined'
67
- });
68
- });
69
- }, _EntraAdministrativeUnitRoleAssignmentAddCommand_initOptions = function _EntraAdministrativeUnitRoleAssignmentAddCommand_initOptions() {
70
- this.options.unshift({
71
- option: '-i, --administrativeUnitId [administrativeUnitId]'
72
- }, {
73
- option: '-n, --administrativeUnitName [administrativeUnitName]'
74
- }, {
75
- option: '--roleDefinitionId [roleDefinitionId]'
76
- }, {
77
- option: '--roleDefinitionName [roleDefinitionName]'
78
- }, {
79
- option: '--userId [userId]'
80
- }, {
81
- option: '--userName [userName]'
82
- });
83
- }, _EntraAdministrativeUnitRoleAssignmentAddCommand_initValidators = function _EntraAdministrativeUnitRoleAssignmentAddCommand_initValidators() {
84
- this.validators.push(async (args) => {
85
- if (args.options.administrativeUnitId && !validation.isValidGuid(args.options.administrativeUnitId)) {
86
- return `${args.options.administrativeUnitId} is not a valid GUID`;
87
- }
88
- if (args.options.roleDefinitionId && !validation.isValidGuid(args.options.roleDefinitionId)) {
89
- return `${args.options.roleDefinitionId} is not a valid GUID`;
90
- }
91
- if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
92
- return `${args.options.userId} is not a valid GUID`;
93
- }
94
- return true;
95
- });
96
- }, _EntraAdministrativeUnitRoleAssignmentAddCommand_initOptionSets = function _EntraAdministrativeUnitRoleAssignmentAddCommand_initOptionSets() {
97
- this.optionSets.push({ options: ['administrativeUnitId', 'administrativeUnitName'] });
98
- this.optionSets.push({ options: ['roleDefinitionId', 'roleDefinitionName'] });
99
- this.optionSets.push({ options: ['userId', 'userName'] });
100
- };
101
81
  export default new EntraAdministrativeUnitRoleAssignmentAddCommand();
102
82
  //# sourceMappingURL=administrativeunit-roleassignment-add.js.map
@@ -1,6 +1,10 @@
1
+ import { globalOptionsZod } from '../../../../Command.js';
1
2
  import request from '../../../../request.js';
2
3
  import GraphCommand from '../../../base/GraphCommand.js';
3
4
  import commands from '../../commands.js';
5
+ export const options = globalOptionsZod
6
+ .extend({})
7
+ .strict();
4
8
  class EntraMultitenantGetCommand extends GraphCommand {
5
9
  get name() {
6
10
  return commands.MULTITENANT_GET;
@@ -8,7 +12,10 @@ class EntraMultitenantGetCommand extends GraphCommand {
8
12
  get description() {
9
13
  return 'Gets properties of the multitenant organization';
10
14
  }
11
- async commandAction(logger) {
15
+ get schema() {
16
+ return options;
17
+ }
18
+ async commandAction(logger, _args) {
12
19
  const requestOptions = {
13
20
  url: `${this.resource}/v1.0/tenantRelationships/multiTenantOrganization`,
14
21
  headers: {
@@ -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 _EntraMultitenantRemoveCommand_instances, _EntraMultitenantRemoveCommand_initTelemetry, _EntraMultitenantRemoveCommand_initOptions;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import GraphCommand from '../../../base/GraphCommand.js';
9
5
  import commands from '../../commands.js';
10
6
  import { odata } from '../../../../utils/odata.js';
11
7
  import { cli } from '../../../../cli/cli.js';
8
+ export const options = globalOptionsZod
9
+ .extend({
10
+ force: z.boolean().optional().alias('f')
11
+ }).strict();
12
12
  class EntraMultitenantRemoveCommand extends GraphCommand {
13
13
  get name() {
14
14
  return commands.MULTITENANT_REMOVE;
@@ -16,11 +16,8 @@ class EntraMultitenantRemoveCommand extends GraphCommand {
16
16
  get description() {
17
17
  return 'Removes a multitenant organization';
18
18
  }
19
- constructor() {
20
- super();
21
- _EntraMultitenantRemoveCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraMultitenantRemoveCommand_instances, "m", _EntraMultitenantRemoveCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraMultitenantRemoveCommand_instances, "m", _EntraMultitenantRemoveCommand_initOptions).call(this);
19
+ get schema() {
20
+ return options;
24
21
  }
25
22
  async commandAction(logger, args) {
26
23
  const removeMultitenantOrg = async () => {
@@ -103,16 +100,5 @@ class EntraMultitenantRemoveCommand extends GraphCommand {
103
100
  await request.delete(requestOptions);
104
101
  }
105
102
  }
106
- _EntraMultitenantRemoveCommand_instances = new WeakSet(), _EntraMultitenantRemoveCommand_initTelemetry = function _EntraMultitenantRemoveCommand_initTelemetry() {
107
- this.telemetry.push((args) => {
108
- Object.assign(this.telemetryProperties, {
109
- force: !!args.options.force
110
- });
111
- });
112
- }, _EntraMultitenantRemoveCommand_initOptions = function _EntraMultitenantRemoveCommand_initOptions() {
113
- this.options.unshift({
114
- option: '-f, --force'
115
- });
116
- };
117
103
  export default new EntraMultitenantRemoveCommand();
118
104
  //# sourceMappingURL=multitenant-remove.js.map