@pnp/cli-microsoft365 12.0.0-beta.d58fb77 → 12.0.0-beta.e3af9f8

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 (91) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +4 -1
  4. package/dist/cli/cli.js +3 -0
  5. package/dist/m365/entra/commands/m365group/m365group-add.js +52 -97
  6. package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +20 -33
  7. package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +20 -39
  8. package/dist/m365/entra/commands/m365group/m365group-get.js +20 -41
  9. package/dist/m365/entra/commands/m365group/m365group-list.js +11 -31
  10. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +8 -22
  11. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +9 -25
  12. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +21 -43
  13. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +21 -41
  14. package/dist/m365/entra/commands/m365group/m365group-remove.js +25 -46
  15. package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -32
  16. package/dist/m365/entra/commands/m365group/m365group-set.js +86 -141
  17. package/dist/m365/entra/commands/m365group/m365group-teamify.js +20 -43
  18. package/dist/m365/entra/commands/m365group/m365group-user-add.js +44 -77
  19. package/dist/m365/entra/commands/m365group/m365group-user-list.js +28 -55
  20. package/dist/m365/entra/commands/m365group/m365group-user-remove.js +37 -74
  21. package/dist/m365/entra/commands/m365group/m365group-user-set.js +45 -77
  22. package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
  23. package/dist/m365/spe/commands.js +1 -0
  24. package/dist/m365/spo/commands/listitem/listitem-add.js +27 -55
  25. package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +30 -58
  26. package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +27 -52
  27. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +26 -50
  28. package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +28 -55
  29. package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +30 -57
  30. package/dist/m365/spo/commands/listitem/listitem-batch-add.js +36 -58
  31. package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +68 -92
  32. package/dist/m365/spo/commands/listitem/listitem-batch-set.js +37 -57
  33. package/dist/m365/spo/commands/listitem/listitem-get.js +45 -68
  34. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +31 -55
  35. package/dist/m365/spo/commands/listitem/listitem-list.js +47 -81
  36. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +37 -60
  37. package/dist/m365/spo/commands/listitem/listitem-record-lock.js +30 -52
  38. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +31 -52
  39. package/dist/m365/spo/commands/listitem/listitem-record-unlock.js +30 -52
  40. package/dist/m365/spo/commands/listitem/listitem-remove.js +33 -61
  41. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +46 -67
  42. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +33 -56
  43. package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +55 -98
  44. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +48 -74
  45. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +33 -56
  46. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +31 -53
  47. package/dist/m365/spo/commands/listitem/listitem-set.js +33 -58
  48. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +8 -1
  49. package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -1
  50. package/dist/m365/teams/commands/report/report-deviceusagedistributionusercounts.js +10 -0
  51. package/dist/m365/teams/commands/report/report-deviceusageusercounts.js +10 -0
  52. package/dist/m365/teams/commands/report/report-deviceusageuserdetail.js +22 -0
  53. package/dist/m365/teams/commands/report/report-directroutingcalls.js +19 -39
  54. package/dist/m365/teams/commands/report/report-pstncalls.js +19 -39
  55. package/dist/m365/teams/commands/report/report-useractivitycounts.js +10 -0
  56. package/dist/m365/teams/commands/report/report-useractivityusercounts.js +10 -0
  57. package/dist/m365/teams/commands/report/report-useractivityuserdetail.js +22 -0
  58. package/dist/m365/teams/commands/tab/tab-add.js +23 -49
  59. package/dist/m365/teams/commands/tab/tab-get.js +55 -56
  60. package/dist/m365/teams/commands/tab/tab-list.js +17 -28
  61. package/dist/m365/teams/commands/tab/tab-remove.js +23 -42
  62. package/dist/m365/teams/commands/team/team-add.js +76 -114
  63. package/dist/m365/teams/commands/team/team-app-list.js +23 -36
  64. package/dist/m365/teams/commands/team/team-archive.js +24 -39
  65. package/dist/m365/teams/commands/team/team-clone.js +28 -62
  66. package/dist/m365/teams/commands/team/team-get.js +23 -36
  67. package/dist/m365/teams/commands/team/team-list.js +43 -57
  68. package/dist/m365/teams/commands/team/team-remove.js +24 -37
  69. package/dist/m365/teams/commands/team/team-set.js +23 -52
  70. package/dist/m365/teams/commands/team/team-unarchive.js +23 -28
  71. package/dist/m365/teams/commands/user/user-app-add.js +40 -49
  72. package/dist/m365/teams/commands/user/user-app-list.js +26 -39
  73. package/dist/m365/teams/commands/user/user-app-remove.js +37 -49
  74. package/dist/m365/teams/commands/user/user-app-upgrade.js +36 -52
  75. package/dist/m365/teams/commands/user/user-list.js +17 -39
  76. package/dist/m365/tenant/commands/report/report-activeusercounts.js +2 -1
  77. package/dist/m365/tenant/commands/report/report-activeuserdetail.js +2 -1
  78. package/dist/m365/tenant/commands/report/report-office365activationcounts.js +9 -0
  79. package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +9 -0
  80. package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +9 -0
  81. package/dist/m365/tenant/commands/report/report-servicesusercounts.js +2 -1
  82. package/dist/m365/tenant/commands/report/report-settings-get.js +5 -0
  83. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +9 -20
  84. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +8 -20
  85. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +8 -15
  86. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +8 -15
  87. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +12 -26
  88. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +8 -22
  89. package/dist/utils/zod.js +4 -4
  90. package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
  91. package/package.json +1 -1
@@ -1,15 +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 _EntraM365GroupRecycleBinItemRemoveCommand_instances, _EntraM365GroupRecycleBinItemRemoveCommand_initTelemetry, _EntraM365GroupRecycleBinItemRemoveCommand_initOptions, _EntraM365GroupRecycleBinItemRemoveCommand_initValidators, _EntraM365GroupRecycleBinItemRemoveCommand_initOptionSets;
1
+ import { z } from 'zod';
7
2
  import { cli } from '../../../../cli/cli.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import request from '../../../../request.js';
9
5
  import { formatting } from '../../../../utils/formatting.js';
10
- import { validation } from '../../../../utils/validation.js';
11
6
  import GraphCommand from '../../../base/GraphCommand.js';
12
7
  import commands from '../../commands.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ id: z.uuid().optional().alias('i'),
11
+ displayName: z.string().optional().alias('d'),
12
+ mailNickname: z.string().optional().alias('m'),
13
+ force: z.boolean().optional().alias('f')
14
+ });
13
15
  class EntraM365GroupRecycleBinItemRemoveCommand extends GraphCommand {
14
16
  get name() {
15
17
  return commands.M365GROUP_RECYCLEBINITEM_REMOVE;
@@ -17,13 +19,18 @@ class EntraM365GroupRecycleBinItemRemoveCommand extends GraphCommand {
17
19
  get description() {
18
20
  return 'Permanently deletes a Microsoft 365 Group from the recycle bin in the current tenant';
19
21
  }
20
- constructor() {
21
- super();
22
- _EntraM365GroupRecycleBinItemRemoveCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemRemoveCommand_instances, "m", _EntraM365GroupRecycleBinItemRemoveCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemRemoveCommand_instances, "m", _EntraM365GroupRecycleBinItemRemoveCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemRemoveCommand_instances, "m", _EntraM365GroupRecycleBinItemRemoveCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemRemoveCommand_instances, "m", _EntraM365GroupRecycleBinItemRemoveCommand_initOptionSets).call(this);
22
+ get schema() {
23
+ return options;
24
+ }
25
+ getRefinedSchema(schema) {
26
+ return schema
27
+ .refine(opts => [opts.id, opts.displayName, opts.mailNickname].filter(o => o !== undefined).length === 1, {
28
+ error: 'Use one of the following options: id, displayName or mailNickname.',
29
+ params: {
30
+ customCode: 'optionSet',
31
+ options: ['id', 'displayName', 'mailNickname']
32
+ }
33
+ });
27
34
  }
28
35
  async commandAction(logger, args) {
29
36
  const removeGroup = async () => {
@@ -84,34 +91,5 @@ class EntraM365GroupRecycleBinItemRemoveCommand extends GraphCommand {
84
91
  return groups[0].id;
85
92
  }
86
93
  }
87
- _EntraM365GroupRecycleBinItemRemoveCommand_instances = new WeakSet(), _EntraM365GroupRecycleBinItemRemoveCommand_initTelemetry = function _EntraM365GroupRecycleBinItemRemoveCommand_initTelemetry() {
88
- this.telemetry.push((args) => {
89
- Object.assign(this.telemetryProperties, {
90
- id: typeof args.options.id !== 'undefined',
91
- displayName: typeof args.options.displayName !== 'undefined',
92
- mailNickname: typeof args.options.mailNickname !== 'undefined',
93
- force: !!args.options.force
94
- });
95
- });
96
- }, _EntraM365GroupRecycleBinItemRemoveCommand_initOptions = function _EntraM365GroupRecycleBinItemRemoveCommand_initOptions() {
97
- this.options.unshift({
98
- option: '-i, --id [id]'
99
- }, {
100
- option: '-d, --displayName [displayName]'
101
- }, {
102
- option: '-m, --mailNickname [mailNickname]'
103
- }, {
104
- option: '-f, --force'
105
- });
106
- }, _EntraM365GroupRecycleBinItemRemoveCommand_initValidators = function _EntraM365GroupRecycleBinItemRemoveCommand_initValidators() {
107
- this.validators.push(async (args) => {
108
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
109
- return `${args.options.id} is not a valid GUID`;
110
- }
111
- return true;
112
- });
113
- }, _EntraM365GroupRecycleBinItemRemoveCommand_initOptionSets = function _EntraM365GroupRecycleBinItemRemoveCommand_initOptionSets() {
114
- this.optionSets.push({ options: ['id', 'displayName', 'mailNickname'] });
115
- };
116
94
  export default new EntraM365GroupRecycleBinItemRemoveCommand();
117
95
  //# sourceMappingURL=m365group-recyclebinitem-remove.js.map
@@ -1,15 +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 _EntraM365GroupRecycleBinItemRestoreCommand_instances, _EntraM365GroupRecycleBinItemRestoreCommand_initTelemetry, _EntraM365GroupRecycleBinItemRestoreCommand_initOptions, _EntraM365GroupRecycleBinItemRestoreCommand_initValidators, _EntraM365GroupRecycleBinItemRestoreCommand_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';
9
- import { validation } from '../../../../utils/validation.js';
10
6
  import GraphCommand from '../../../base/GraphCommand.js';
11
7
  import commands from '../../commands.js';
12
- import { cli } from '../../../../cli/cli.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ id: z.uuid().optional().alias('i'),
11
+ displayName: z.string().optional().alias('d'),
12
+ mailNickname: z.string().optional().alias('m')
13
+ });
13
14
  class EntraM365GroupRecycleBinItemRestoreCommand extends GraphCommand {
14
15
  get name() {
15
16
  return commands.M365GROUP_RECYCLEBINITEM_RESTORE;
@@ -17,13 +18,18 @@ class EntraM365GroupRecycleBinItemRestoreCommand extends GraphCommand {
17
18
  get description() {
18
19
  return 'Restores a deleted Microsoft 365 Group';
19
20
  }
20
- constructor() {
21
- super();
22
- _EntraM365GroupRecycleBinItemRestoreCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemRestoreCommand_instances, "m", _EntraM365GroupRecycleBinItemRestoreCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemRestoreCommand_instances, "m", _EntraM365GroupRecycleBinItemRestoreCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemRestoreCommand_instances, "m", _EntraM365GroupRecycleBinItemRestoreCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemRestoreCommand_instances, "m", _EntraM365GroupRecycleBinItemRestoreCommand_initOptionSets).call(this);
21
+ get schema() {
22
+ return options;
23
+ }
24
+ getRefinedSchema(schema) {
25
+ return schema
26
+ .refine(opts => [opts.id, opts.displayName, opts.mailNickname].filter(o => o !== undefined).length === 1, {
27
+ error: 'Use one of the following options: id, displayName or mailNickname.',
28
+ params: {
29
+ customCode: 'optionSet',
30
+ options: ['id', 'displayName', 'mailNickname']
31
+ }
32
+ });
27
33
  }
28
34
  async commandAction(logger, args) {
29
35
  if (this.verbose) {
@@ -77,31 +83,5 @@ class EntraM365GroupRecycleBinItemRestoreCommand extends GraphCommand {
77
83
  return groups[0].id;
78
84
  }
79
85
  }
80
- _EntraM365GroupRecycleBinItemRestoreCommand_instances = new WeakSet(), _EntraM365GroupRecycleBinItemRestoreCommand_initTelemetry = function _EntraM365GroupRecycleBinItemRestoreCommand_initTelemetry() {
81
- this.telemetry.push((args) => {
82
- Object.assign(this.telemetryProperties, {
83
- id: typeof args.options.id !== 'undefined',
84
- displayName: typeof args.options.displayName !== 'undefined',
85
- mailNickname: typeof args.options.mailNickname !== 'undefined'
86
- });
87
- });
88
- }, _EntraM365GroupRecycleBinItemRestoreCommand_initOptions = function _EntraM365GroupRecycleBinItemRestoreCommand_initOptions() {
89
- this.options.unshift({
90
- option: '-i, --id [id]'
91
- }, {
92
- option: '-d, --displayName [displayName]'
93
- }, {
94
- option: '-m, --mailNickname [mailNickname]'
95
- });
96
- }, _EntraM365GroupRecycleBinItemRestoreCommand_initValidators = function _EntraM365GroupRecycleBinItemRestoreCommand_initValidators() {
97
- this.validators.push(async (args) => {
98
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
99
- return `${args.options.id} is not a valid GUID`;
100
- }
101
- return true;
102
- });
103
- }, _EntraM365GroupRecycleBinItemRestoreCommand_initOptionSets = function _EntraM365GroupRecycleBinItemRestoreCommand_initOptionSets() {
104
- this.optionSets.push({ options: ['id', 'displayName', 'mailNickname'] });
105
- };
106
86
  export default new EntraM365GroupRecycleBinItemRestoreCommand();
107
87
  //# sourceMappingURL=m365group-recyclebinitem-restore.js.map
@@ -1,35 +1,44 @@
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 _EntraM365GroupRemoveCommand_instances, _EntraM365GroupRemoveCommand_initTelemetry, _EntraM365GroupRemoveCommand_initOptions, _EntraM365GroupRemoveCommand_initValidators, _EntraM365GroupRemoveCommand_initOptionSets, _EntraM365GroupRemoveCommand_initTypes;
1
+ import { z } from 'zod';
7
2
  import { cli } from '../../../../cli/cli.js';
3
+ import { globalOptionsZod } from '../../../../Command.js';
8
4
  import request from '../../../../request.js';
9
5
  import { entraGroup } from '../../../../utils/entraGroup.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 config from '../../../../config.js';
14
9
  import { formatting } from '../../../../utils/formatting.js';
15
10
  import { spo } from '../../../../utils/spo.js';
16
11
  import { setTimeout } from 'timers/promises';
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ id: z.uuid().optional().alias('i'),
15
+ displayName: z.string().optional().alias('n'),
16
+ force: z.boolean().optional().alias('f'),
17
+ permanent: z.boolean().optional()
18
+ });
17
19
  class EntraM365GroupRemoveCommand extends GraphCommand {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.intervalInMs = 5000;
23
+ }
18
24
  get name() {
19
25
  return commands.M365GROUP_REMOVE;
20
26
  }
21
27
  get description() {
22
28
  return 'Removes a Microsoft 365 Group';
23
29
  }
24
- constructor() {
25
- super();
26
- _EntraM365GroupRemoveCommand_instances.add(this);
27
- this.intervalInMs = 5000;
28
- __classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initTelemetry).call(this);
29
- __classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initOptions).call(this);
30
- __classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initValidators).call(this);
31
- __classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initOptionSets).call(this);
32
- __classPrivateFieldGet(this, _EntraM365GroupRemoveCommand_instances, "m", _EntraM365GroupRemoveCommand_initTypes).call(this);
30
+ get schema() {
31
+ return options;
32
+ }
33
+ getRefinedSchema(schema) {
34
+ return schema
35
+ .refine(opts => [opts.id, opts.displayName].filter(o => o !== undefined).length === 1, {
36
+ error: 'Use one of the following options: id or displayName.',
37
+ params: {
38
+ customCode: 'optionSet',
39
+ options: ['id', 'displayName']
40
+ }
41
+ });
33
42
  }
34
43
  async commandAction(logger, args) {
35
44
  const removeGroup = async () => {
@@ -165,36 +174,6 @@ class EntraM365GroupRemoveCommand extends GraphCommand {
165
174
  }
166
175
  }
167
176
  }
168
- _EntraM365GroupRemoveCommand_instances = new WeakSet(), _EntraM365GroupRemoveCommand_initTelemetry = function _EntraM365GroupRemoveCommand_initTelemetry() {
169
- this.telemetry.push((args) => {
170
- Object.assign(this.telemetryProperties, {
171
- force: (!(!args.options.force)).toString(),
172
- permanent: !!args.options.permanent
173
- });
174
- });
175
- }, _EntraM365GroupRemoveCommand_initOptions = function _EntraM365GroupRemoveCommand_initOptions() {
176
- this.options.unshift({
177
- option: '-i, --id [id]'
178
- }, {
179
- option: '-n, --displayName [displayName]'
180
- }, {
181
- option: '-f, --force'
182
- }, {
183
- option: '--permanent'
184
- });
185
- }, _EntraM365GroupRemoveCommand_initValidators = function _EntraM365GroupRemoveCommand_initValidators() {
186
- this.validators.push(async (args) => {
187
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
188
- return `${args.options.id} is not a valid GUID`;
189
- }
190
- return true;
191
- });
192
- }, _EntraM365GroupRemoveCommand_initOptionSets = function _EntraM365GroupRemoveCommand_initOptionSets() {
193
- this.optionSets.push({ options: ['id', 'displayName'] });
194
- }, _EntraM365GroupRemoveCommand_initTypes = function _EntraM365GroupRemoveCommand_initTypes() {
195
- this.types.string.push('id', 'displayName');
196
- this.types.boolean.push('permanent');
197
- };
198
177
  EntraM365GroupRemoveCommand.maxRetries = 10;
199
178
  export default new EntraM365GroupRemoveCommand();
200
179
  //# sourceMappingURL=m365group-remove.js.map
@@ -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 _EntraM365GroupRenewCommand_instances, _EntraM365GroupRenewCommand_initOptions, _EntraM365GroupRenewCommand_initValidators, _EntraM365GroupRenewCommand_initOptionSets, _EntraM365GroupRenewCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import { entraGroup } from '../../../../utils/entraGroup.js';
9
- import { validation } from '../../../../utils/validation.js';
10
5
  import GraphCommand from '../../../base/GraphCommand.js';
11
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ id: z.uuid().optional().alias('i'),
10
+ displayName: z.string().optional().alias('n')
11
+ });
12
12
  class EntraM365GroupRenewCommand extends GraphCommand {
13
13
  get name() {
14
14
  return commands.M365GROUP_RENEW;
@@ -16,13 +16,18 @@ class EntraM365GroupRenewCommand extends GraphCommand {
16
16
  get description() {
17
17
  return `Renews Microsoft 365 group's expiration`;
18
18
  }
19
- constructor() {
20
- super();
21
- _EntraM365GroupRenewCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraM365GroupRenewCommand_instances, "m", _EntraM365GroupRenewCommand_initOptions).call(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupRenewCommand_instances, "m", _EntraM365GroupRenewCommand_initValidators).call(this);
24
- __classPrivateFieldGet(this, _EntraM365GroupRenewCommand_instances, "m", _EntraM365GroupRenewCommand_initOptionSets).call(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupRenewCommand_instances, "m", _EntraM365GroupRenewCommand_initTypes).call(this);
19
+ get schema() {
20
+ return options;
21
+ }
22
+ getRefinedSchema(schema) {
23
+ return schema
24
+ .refine(opts => [opts.id, opts.displayName].filter(o => o !== undefined).length === 1, {
25
+ error: 'Use one of the following options: id or displayName.',
26
+ params: {
27
+ customCode: 'optionSet',
28
+ options: ['id', 'displayName']
29
+ }
30
+ });
26
31
  }
27
32
  async commandAction(logger, args) {
28
33
  if (this.verbose) {
@@ -50,23 +55,5 @@ class EntraM365GroupRenewCommand extends GraphCommand {
50
55
  }
51
56
  }
52
57
  }
53
- _EntraM365GroupRenewCommand_instances = new WeakSet(), _EntraM365GroupRenewCommand_initOptions = function _EntraM365GroupRenewCommand_initOptions() {
54
- this.options.unshift({
55
- option: '-i, --id [id]'
56
- }, {
57
- option: '-n, --displayName [displayName]'
58
- });
59
- }, _EntraM365GroupRenewCommand_initValidators = function _EntraM365GroupRenewCommand_initValidators() {
60
- this.validators.push(async (args) => {
61
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
62
- return `${args.options.id} is not a valid GUID`;
63
- }
64
- return true;
65
- });
66
- }, _EntraM365GroupRenewCommand_initOptionSets = function _EntraM365GroupRenewCommand_initOptionSets() {
67
- this.optionSets.push({ options: ['id', 'displayName'] });
68
- }, _EntraM365GroupRenewCommand_initTypes = function _EntraM365GroupRenewCommand_initTypes() {
69
- this.types.string.push('id', 'displayName');
70
- };
71
58
  export default new EntraM365GroupRenewCommand();
72
59
  //# sourceMappingURL=m365group-renew.js.map
@@ -1,12 +1,8 @@
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 _EntraM365GroupSetCommand_instances, _EntraM365GroupSetCommand_initTelemetry, _EntraM365GroupSetCommand_initOptions, _EntraM365GroupSetCommand_initOptionSets, _EntraM365GroupSetCommand_initTypes, _EntraM365GroupSetCommand_initValidators;
7
1
  import { setTimeout } from 'timers/promises';
8
2
  import fs from 'fs';
9
3
  import path from 'path';
4
+ import { z } from 'zod';
5
+ import { globalOptionsZod } from '../../../../Command.js';
10
6
  import request from '../../../../request.js';
11
7
  import { validation } from '../../../../utils/validation.js';
12
8
  import GraphCommand from '../../../base/GraphCommand.js';
@@ -17,22 +13,97 @@ import auth from '../../../../Auth.js';
17
13
  import { entraUser } from '../../../../utils/entraUser.js';
18
14
  import { formatting } from '../../../../utils/formatting.js';
19
15
  import { odata } from '../../../../utils/odata.js';
16
+ export const options = z.strictObject({
17
+ ...globalOptionsZod.shape,
18
+ id: z.uuid().optional().alias('i'),
19
+ displayName: z.string().optional().alias('n'),
20
+ newDisplayName: z.string().optional(),
21
+ description: z.string().optional().alias('d'),
22
+ ownerIds: z.string()
23
+ .refine(ids => validation.isValidGuidArray(ids) === true, {
24
+ error: e => `The following GUIDs are invalid for the option 'ownerIds': ${validation.isValidGuidArray(e.input)}.`
25
+ }).optional(),
26
+ ownerUserNames: z.string()
27
+ .refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
28
+ error: e => `The following user principal names are invalid for the option 'ownerUserNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
29
+ }).optional(),
30
+ memberIds: z.string()
31
+ .refine(ids => validation.isValidGuidArray(ids) === true, {
32
+ error: e => `The following GUIDs are invalid for the option 'memberIds': ${validation.isValidGuidArray(e.input)}.`
33
+ }).optional(),
34
+ memberUserNames: z.string()
35
+ .refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
36
+ error: e => `The following user principal names are invalid for the option 'memberUserNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
37
+ }).optional(),
38
+ isPrivate: z.boolean().optional(),
39
+ logoPath: z.string()
40
+ .refine(logoPath => {
41
+ const fullPath = path.resolve(logoPath);
42
+ return fs.existsSync(fullPath) && !fs.lstatSync(fullPath).isDirectory();
43
+ }, {
44
+ error: e => {
45
+ const fullPath = path.resolve(e.input);
46
+ return fs.existsSync(fullPath) ? `Path '${fullPath}' points to a directory` : `File '${fullPath}' not found`;
47
+ }
48
+ })
49
+ .optional()
50
+ .alias('l'),
51
+ allowExternalSenders: z.boolean().optional(),
52
+ autoSubscribeNewMembers: z.boolean().optional(),
53
+ hideFromAddressLists: z.boolean().optional(),
54
+ hideFromOutlookClients: z.boolean().optional()
55
+ });
20
56
  class EntraM365GroupSetCommand extends GraphCommand {
57
+ constructor() {
58
+ super(...arguments);
59
+ this.pollingInterval = 500;
60
+ }
21
61
  get name() {
22
62
  return commands.M365GROUP_SET;
23
63
  }
24
64
  get description() {
25
65
  return 'Updates Microsoft 365 Group properties';
26
66
  }
27
- constructor() {
28
- super();
29
- _EntraM365GroupSetCommand_instances.add(this);
30
- this.pollingInterval = 500;
31
- __classPrivateFieldGet(this, _EntraM365GroupSetCommand_instances, "m", _EntraM365GroupSetCommand_initTelemetry).call(this);
32
- __classPrivateFieldGet(this, _EntraM365GroupSetCommand_instances, "m", _EntraM365GroupSetCommand_initOptions).call(this);
33
- __classPrivateFieldGet(this, _EntraM365GroupSetCommand_instances, "m", _EntraM365GroupSetCommand_initValidators).call(this);
34
- __classPrivateFieldGet(this, _EntraM365GroupSetCommand_instances, "m", _EntraM365GroupSetCommand_initOptionSets).call(this);
35
- __classPrivateFieldGet(this, _EntraM365GroupSetCommand_instances, "m", _EntraM365GroupSetCommand_initTypes).call(this);
67
+ get schema() {
68
+ return options;
69
+ }
70
+ getRefinedSchema(schema) {
71
+ return schema
72
+ .refine(opts => [opts.id, opts.displayName].filter(o => o !== undefined).length === 1, {
73
+ error: 'Use one of the following options: id or displayName.',
74
+ params: {
75
+ customCode: 'optionSet',
76
+ options: ['id', 'displayName']
77
+ }
78
+ })
79
+ .refine(opts => !(opts.ownerIds && opts.ownerUserNames), {
80
+ error: 'Use one of the following options: ownerIds or ownerUserNames.',
81
+ params: {
82
+ customCode: 'optionSet',
83
+ options: ['ownerIds', 'ownerUserNames']
84
+ }
85
+ })
86
+ .refine(opts => !(opts.memberIds && opts.memberUserNames), {
87
+ error: 'Use one of the following options: memberIds or memberUserNames.',
88
+ params: {
89
+ customCode: 'optionSet',
90
+ options: ['memberIds', 'memberUserNames']
91
+ }
92
+ })
93
+ .refine(opts => !!opts.newDisplayName ||
94
+ opts.description !== undefined ||
95
+ opts.ownerIds !== undefined ||
96
+ opts.ownerUserNames !== undefined ||
97
+ opts.memberIds !== undefined ||
98
+ opts.memberUserNames !== undefined ||
99
+ opts.isPrivate !== undefined ||
100
+ opts.logoPath !== undefined ||
101
+ opts.allowExternalSenders !== undefined ||
102
+ opts.autoSubscribeNewMembers !== undefined ||
103
+ opts.hideFromAddressLists !== undefined ||
104
+ opts.hideFromOutlookClients !== undefined, {
105
+ error: 'Specify at least one option to update.'
106
+ });
36
107
  }
37
108
  async commandAction(logger, args) {
38
109
  try {
@@ -220,132 +291,6 @@ class EntraM365GroupSetCommand extends GraphCommand {
220
291
  return requestOptions;
221
292
  }
222
293
  }
223
- _EntraM365GroupSetCommand_instances = new WeakSet(), _EntraM365GroupSetCommand_initTelemetry = function _EntraM365GroupSetCommand_initTelemetry() {
224
- this.telemetry.push((args) => {
225
- Object.assign(this.telemetryProperties, {
226
- id: typeof args.options.id !== 'undefined',
227
- displayName: typeof args.options.displayName !== 'undefined',
228
- newDisplayName: typeof args.options.newDisplayName !== 'undefined',
229
- description: typeof args.options.description !== 'undefined',
230
- ownerIds: typeof args.options.ownerIds !== 'undefined',
231
- ownerUserNames: typeof args.options.ownerUserNames !== 'undefined',
232
- memberIds: typeof args.options.memberIds !== 'undefined',
233
- memberUserNames: typeof args.options.memberUserNames !== 'undefined',
234
- isPrivate: !!args.options.isPrivate,
235
- logoPath: typeof args.options.logoPath !== 'undefined',
236
- allowExternalSenders: !!args.options.allowExternalSenders,
237
- autoSubscribeNewMembers: !!args.options.autoSubscribeNewMembers,
238
- hideFromAddressLists: !!args.options.hideFromAddressLists,
239
- hideFromOutlookClients: !!args.options.hideFromOutlookClients
240
- });
241
- });
242
- }, _EntraM365GroupSetCommand_initOptions = function _EntraM365GroupSetCommand_initOptions() {
243
- this.options.unshift({
244
- option: '-i, --id [id]'
245
- }, {
246
- option: '-n, --displayName [displayName]'
247
- }, {
248
- option: '--newDisplayName [newDisplayName]'
249
- }, {
250
- option: '-d, --description [description]'
251
- }, {
252
- option: '--ownerIds [ownerIds]'
253
- }, {
254
- option: '--ownerUserNames [ownerUserNames]'
255
- }, {
256
- option: '--memberIds [memberIds]'
257
- }, {
258
- option: '--memberUserNames [memberUserNames]'
259
- }, {
260
- option: '--isPrivate [isPrivate]',
261
- autocomplete: ['true', 'false']
262
- }, {
263
- option: '-l, --logoPath [logoPath]'
264
- }, {
265
- option: '--allowExternalSenders [allowExternalSenders]',
266
- autocomplete: ['true', 'false']
267
- }, {
268
- option: '--autoSubscribeNewMembers [autoSubscribeNewMembers]',
269
- autocomplete: ['true', 'false']
270
- }, {
271
- option: '--hideFromAddressLists [hideFromAddressLists]',
272
- autocomplete: ['true', 'false']
273
- }, {
274
- option: '--hideFromOutlookClients [hideFromOutlookClients]',
275
- autocomplete: ['true', 'false']
276
- });
277
- }, _EntraM365GroupSetCommand_initOptionSets = function _EntraM365GroupSetCommand_initOptionSets() {
278
- this.optionSets.push({ options: ['id', 'displayName'] });
279
- this.optionSets.push({
280
- options: ['ownerIds', 'ownerUserNames'],
281
- runsWhen: (args) => {
282
- return args.options.ownerIds !== undefined || args.options.ownerUserNames !== undefined;
283
- }
284
- });
285
- this.optionSets.push({
286
- options: ['memberIds', 'memberUserNames'],
287
- runsWhen: (args) => {
288
- return args.options.memberIds !== undefined || args.options.memberUserNames !== undefined;
289
- }
290
- });
291
- }, _EntraM365GroupSetCommand_initTypes = function _EntraM365GroupSetCommand_initTypes() {
292
- this.types.boolean.push('isPrivate', 'allowEternalSenders', 'autoSubscribeNewMembers', 'hideFromAddressLists', 'hideFromOutlookClients');
293
- this.types.string.push('id', 'displayName', 'newDisplayName', 'description', 'ownerIds', 'ownerUserNames', 'memberIds', 'memberUserNames', 'logoPath');
294
- }, _EntraM365GroupSetCommand_initValidators = function _EntraM365GroupSetCommand_initValidators() {
295
- this.validators.push(async (args) => {
296
- if (!args.options.newDisplayName &&
297
- args.options.description === undefined &&
298
- args.options.ownerIds === undefined &&
299
- args.options.ownerUserNames === undefined &&
300
- args.options.memberIds === undefined &&
301
- args.options.memberUserNames === undefined &&
302
- args.options.isPrivate === undefined &&
303
- args.options.logoPath === undefined &&
304
- args.options.allowExternalSenders === undefined &&
305
- args.options.autoSubscribeNewMembers === undefined &&
306
- args.options.hideFromAddressLists === undefined &&
307
- args.options.hideFromOutlookClients === undefined) {
308
- return 'Specify at least one option to update.';
309
- }
310
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
311
- return `${args.options.id} is not a valid GUID`;
312
- }
313
- if (args.options.ownerIds) {
314
- const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.ownerIds);
315
- if (isValidGUIDArrayResult !== true) {
316
- return `The following GUIDs are invalid for the option 'ownerIds': ${isValidGUIDArrayResult}.`;
317
- }
318
- }
319
- if (args.options.ownerUserNames) {
320
- const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.ownerUserNames);
321
- if (isValidUPNArrayResult !== true) {
322
- return `The following user principal names are invalid for the option 'ownerUserNames': ${isValidUPNArrayResult}.`;
323
- }
324
- }
325
- if (args.options.memberIds) {
326
- const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.memberIds);
327
- if (isValidGUIDArrayResult !== true) {
328
- return `The following GUIDs are invalid for the option 'memberIds': ${isValidGUIDArrayResult}.`;
329
- }
330
- }
331
- if (args.options.memberUserNames) {
332
- const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.memberUserNames);
333
- if (isValidUPNArrayResult !== true) {
334
- return `The following user principal names are invalid for the option 'memberUserNames': ${isValidUPNArrayResult}.`;
335
- }
336
- }
337
- if (args.options.logoPath) {
338
- const fullPath = path.resolve(args.options.logoPath);
339
- if (!fs.existsSync(fullPath)) {
340
- return `File '${fullPath}' not found`;
341
- }
342
- if (fs.lstatSync(fullPath).isDirectory()) {
343
- return `Path '${fullPath}' points to a directory`;
344
- }
345
- }
346
- return true;
347
- });
348
- };
349
294
  EntraM365GroupSetCommand.numRepeat = 15;
350
295
  export default new EntraM365GroupSetCommand();
351
296
  //# sourceMappingURL=m365group-set.js.map