@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
package/dist/Auth.js CHANGED
@@ -212,7 +212,10 @@ export class Auth {
212
212
  };
213
213
  this.connection.active = true;
214
214
  this.connection.identityName = accessTokenUtil.accessToken.getUserNameFromAccessToken(response.accessToken);
215
- this.connection.identityId = accessTokenUtil.accessToken.getUserIdFromAccessToken(response.accessToken);
215
+ // the oid claim is not available on app-only access tokens issued while
216
+ // the service principal hasn't been provisioned in the tenant yet. Fall
217
+ // back to the appId so that the connection still has a valid identity
218
+ this.connection.identityId = accessTokenUtil.accessToken.getUserIdFromAccessToken(response.accessToken) || this.connection.appId;
216
219
  this.connection.identityTenantId = accessTokenUtil.accessToken.getTenantIdFromAccessToken(response.accessToken);
217
220
  this.connection.name = this.connection.name || this.connection.identityId;
218
221
  try {
package/dist/cli/cli.js CHANGED
@@ -924,6 +924,9 @@ async function promptForOptionSetNameAndValue(args, options) {
924
924
  coercedValue = Number(trimmed);
925
925
  }
926
926
  }
927
+ options
928
+ .filter(optionName => optionName !== selectedOptionName)
929
+ .forEach(optionName => args.options[optionName] = undefined);
927
930
  args.options[selectedOptionName] = coercedValue;
928
931
  await cli.error('');
929
932
  }
@@ -1,32 +1,69 @@
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 _EntraM365GroupAddCommand_instances, _EntraM365GroupAddCommand_initTelemetry, _EntraM365GroupAddCommand_initOptions, _EntraM365GroupAddCommand_initTypes, _EntraM365GroupAddCommand_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 { formatting } from '../../../../utils/formatting.js';
8
+ import { zod } from '../../../../utils/zod.js';
12
9
  import GraphCommand from '../../../base/GraphCommand.js';
13
10
  import commands from '../../commands.js';
11
+ const VisibilityEnum = {
12
+ Private: 'Private',
13
+ Public: 'Public',
14
+ HiddenMembership: 'HiddenMembership'
15
+ };
16
+ export const options = z.strictObject({
17
+ ...globalOptionsZod.shape,
18
+ displayName: z.string().alias('n'),
19
+ mailNickname: z.string().alias('m'),
20
+ description: z.string().optional().alias('d'),
21
+ owners: z.string()
22
+ .refine(owners => owners.split(',').map(o => o.trim()).every(o => o.indexOf('@') > -1), {
23
+ error: e => `${e.input.split(',').map(o => o.trim()).find(o => o.indexOf('@') < 0)} is not a valid userPrincipalName`
24
+ }).optional(),
25
+ members: z.string()
26
+ .refine(members => members.split(',').map(m => m.trim()).every(m => m.indexOf('@') > -1), {
27
+ error: e => `${e.input.split(',').map(m => m.trim()).find(m => m.indexOf('@') < 0)} is not a valid userPrincipalName`
28
+ }).optional(),
29
+ visibility: zod.coercedEnum(VisibilityEnum).optional(),
30
+ logoPath: z.string()
31
+ .refine(logoPath => {
32
+ const fullPath = path.resolve(logoPath);
33
+ return fs.existsSync(fullPath) && !fs.lstatSync(fullPath).isDirectory();
34
+ }, {
35
+ error: e => {
36
+ const fullPath = path.resolve(e.input);
37
+ return fs.existsSync(fullPath) ? `Path '${fullPath}' points to a directory` : `File '${fullPath}' not found`;
38
+ }
39
+ })
40
+ .optional()
41
+ .alias('l'),
42
+ allowMembersToPost: z.boolean().optional(),
43
+ hideGroupInOutlook: z.boolean().optional(),
44
+ subscribeNewGroupMembers: z.boolean().optional(),
45
+ welcomeEmailDisabled: z.boolean().optional()
46
+ });
14
47
  class EntraM365GroupAddCommand extends GraphCommand {
48
+ constructor() {
49
+ super(...arguments);
50
+ this.pollingInterval = 500;
51
+ }
15
52
  get name() {
16
53
  return commands.M365GROUP_ADD;
17
54
  }
18
55
  get description() {
19
56
  return 'Creates a Microsoft 365 Group';
20
57
  }
21
- constructor() {
22
- super();
23
- _EntraM365GroupAddCommand_instances.add(this);
24
- this.pollingInterval = 500;
25
- this.allowedVisibilities = ['Private', 'Public', 'HiddenMembership'];
26
- __classPrivateFieldGet(this, _EntraM365GroupAddCommand_instances, "m", _EntraM365GroupAddCommand_initTelemetry).call(this);
27
- __classPrivateFieldGet(this, _EntraM365GroupAddCommand_instances, "m", _EntraM365GroupAddCommand_initOptions).call(this);
28
- __classPrivateFieldGet(this, _EntraM365GroupAddCommand_instances, "m", _EntraM365GroupAddCommand_initTypes).call(this);
29
- __classPrivateFieldGet(this, _EntraM365GroupAddCommand_instances, "m", _EntraM365GroupAddCommand_initValidators).call(this);
58
+ get schema() {
59
+ return options;
60
+ }
61
+ getRefinedSchema(schema) {
62
+ return schema
63
+ .refine(opts => opts.mailNickname.indexOf(' ') === -1, {
64
+ error: 'The option mailNickname cannot contain spaces.',
65
+ path: ['mailNickname']
66
+ });
30
67
  }
31
68
  async commandAction(logger, args) {
32
69
  let group;
@@ -177,88 +214,6 @@ class EntraM365GroupAddCommand extends GraphCommand {
177
214
  }
178
215
  }
179
216
  }
180
- _EntraM365GroupAddCommand_instances = new WeakSet(), _EntraM365GroupAddCommand_initTelemetry = function _EntraM365GroupAddCommand_initTelemetry() {
181
- this.telemetry.push((args) => {
182
- Object.assign(this.telemetryProperties, {
183
- description: typeof args.options.description !== 'undefined',
184
- owners: typeof args.options.owners !== 'undefined',
185
- members: typeof args.options.members !== 'undefined',
186
- logoPath: typeof args.options.logoPath !== 'undefined',
187
- visibility: typeof args.options.visibility !== 'undefined',
188
- allowMembersToPost: !!args.options.allowMembersToPost,
189
- hideGroupInOutlook: !!args.options.hideGroupInOutlook,
190
- subscribeNewGroupMembers: !!args.options.subscribeNewGroupMembers,
191
- welcomeEmailDisabled: !!args.options.welcomeEmailDisabled
192
- });
193
- });
194
- }, _EntraM365GroupAddCommand_initOptions = function _EntraM365GroupAddCommand_initOptions() {
195
- this.options.unshift({
196
- option: '-n, --displayName <displayName>'
197
- }, {
198
- option: '-m, --mailNickname <mailNickname>'
199
- }, {
200
- option: '-d, --description [description]'
201
- }, {
202
- option: '--owners [owners]'
203
- }, {
204
- option: '--members [members]'
205
- }, {
206
- option: '--visibility [visibility]',
207
- autocomplete: this.allowedVisibilities
208
- }, {
209
- option: '--allowMembersToPost [allowMembersToPost]',
210
- autocomplete: ['true', 'false']
211
- }, {
212
- option: '--hideGroupInOutlook [hideGroupInOutlook]',
213
- autocomplete: ['true', 'false']
214
- }, {
215
- option: '--subscribeNewGroupMembers [subscribeNewGroupMembers]',
216
- autocomplete: ['true', 'false']
217
- }, {
218
- option: '--welcomeEmailDisabled [welcomeEmailDisabled]',
219
- autocomplete: ['true', 'false']
220
- }, {
221
- option: '-l, --logoPath [logoPath]'
222
- });
223
- }, _EntraM365GroupAddCommand_initTypes = function _EntraM365GroupAddCommand_initTypes() {
224
- this.types.string.push('displayName', 'mailNickname', 'description', 'owners', 'members', 'visibility', 'logoPath');
225
- this.types.boolean.push('allowMembersToPost', 'hideGroupInOutlook', 'subscribeNewGroupMembers', 'welcomeEmailDisabled');
226
- }, _EntraM365GroupAddCommand_initValidators = function _EntraM365GroupAddCommand_initValidators() {
227
- this.validators.push(async (args) => {
228
- if (args.options.owners) {
229
- const owners = args.options.owners.split(',').map(o => o.trim());
230
- for (let i = 0; i < owners.length; i++) {
231
- if (owners[i].indexOf('@') < 0) {
232
- return `${owners[i]} is not a valid userPrincipalName`;
233
- }
234
- }
235
- }
236
- if (args.options.members) {
237
- const members = args.options.members.split(',').map(m => m.trim());
238
- for (let i = 0; i < members.length; i++) {
239
- if (members[i].indexOf('@') < 0) {
240
- return `${members[i]} is not a valid userPrincipalName`;
241
- }
242
- }
243
- }
244
- if (args.options.mailNickname.indexOf(' ') !== -1) {
245
- return 'The option mailNickname cannot contain spaces.';
246
- }
247
- if (args.options.logoPath) {
248
- const fullPath = path.resolve(args.options.logoPath);
249
- if (!fs.existsSync(fullPath)) {
250
- return `File '${fullPath}' not found`;
251
- }
252
- if (fs.lstatSync(fullPath).isDirectory()) {
253
- return `Path '${fullPath}' points to a directory`;
254
- }
255
- }
256
- if (args.options.visibility && this.allowedVisibilities.map(x => x.toLowerCase()).indexOf(args.options.visibility.toLowerCase()) === -1) {
257
- return `${args.options.visibility} is not a valid visibility. Allowed values are ${this.allowedVisibilities.join(', ')}`;
258
- }
259
- return true;
260
- });
261
- };
262
217
  EntraM365GroupAddCommand.numRepeat = 15;
263
218
  export default new EntraM365GroupAddCommand();
264
219
  //# sourceMappingURL=m365group-add.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 _EntraM365GroupConversationListCommand_instances, _EntraM365GroupConversationListCommand_initOptions, _EntraM365GroupConversationListCommand_initValidators, _EntraM365GroupConversationListCommand_initOptionSets, _EntraM365GroupConversationListCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
3
+ import { entraGroup } from '../../../../utils/entraGroup.js';
7
4
  import { odata } from '../../../../utils/odata.js';
8
- import { validation } from '../../../../utils/validation.js';
9
5
  import GraphCommand from '../../../base/GraphCommand.js';
10
6
  import commands from '../../commands.js';
11
- import { entraGroup } from '../../../../utils/entraGroup.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ groupId: z.uuid().optional().alias('i'),
10
+ groupName: z.string().optional().alias('n')
11
+ });
12
12
  class EntraM365GroupConversationListCommand extends GraphCommand {
13
13
  get name() {
14
14
  return commands.M365GROUP_CONVERSATION_LIST;
@@ -19,13 +19,18 @@ class EntraM365GroupConversationListCommand extends GraphCommand {
19
19
  defaultProperties() {
20
20
  return ['topic', 'lastDeliveredDateTime', 'id'];
21
21
  }
22
- constructor() {
23
- super();
24
- _EntraM365GroupConversationListCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupConversationListCommand_instances, "m", _EntraM365GroupConversationListCommand_initOptions).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupConversationListCommand_instances, "m", _EntraM365GroupConversationListCommand_initValidators).call(this);
27
- __classPrivateFieldGet(this, _EntraM365GroupConversationListCommand_instances, "m", _EntraM365GroupConversationListCommand_initOptionSets).call(this);
28
- __classPrivateFieldGet(this, _EntraM365GroupConversationListCommand_instances, "m", _EntraM365GroupConversationListCommand_initTypes).call(this);
22
+ get schema() {
23
+ return options;
24
+ }
25
+ getRefinedSchema(schema) {
26
+ return schema
27
+ .refine(opts => [opts.groupId, opts.groupName].filter(o => o !== undefined).length === 1, {
28
+ error: 'Use one of the following options: groupId or groupName.',
29
+ params: {
30
+ customCode: 'optionSet',
31
+ options: ['groupId', 'groupName']
32
+ }
33
+ });
29
34
  }
30
35
  async commandAction(logger, args) {
31
36
  if (this.verbose) {
@@ -48,23 +53,5 @@ class EntraM365GroupConversationListCommand extends GraphCommand {
48
53
  }
49
54
  }
50
55
  }
51
- _EntraM365GroupConversationListCommand_instances = new WeakSet(), _EntraM365GroupConversationListCommand_initOptions = function _EntraM365GroupConversationListCommand_initOptions() {
52
- this.options.unshift({
53
- option: '-i, --groupId [groupId]'
54
- }, {
55
- option: '-n, --groupName [groupName]'
56
- });
57
- }, _EntraM365GroupConversationListCommand_initValidators = function _EntraM365GroupConversationListCommand_initValidators() {
58
- this.validators.push(async (args) => {
59
- if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
60
- return `${args.options.groupId} is not a valid GUID`;
61
- }
62
- return true;
63
- });
64
- }, _EntraM365GroupConversationListCommand_initOptionSets = function _EntraM365GroupConversationListCommand_initOptionSets() {
65
- this.optionSets.push({ options: ['groupId', 'groupName'] });
66
- }, _EntraM365GroupConversationListCommand_initTypes = function _EntraM365GroupConversationListCommand_initTypes() {
67
- this.types.string.push('groupId', 'groupName');
68
- };
69
56
  export default new EntraM365GroupConversationListCommand();
70
57
  //# sourceMappingURL=m365group-conversation-list.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 _EntraM365GroupConversationPostListCommand_instances, _EntraM365GroupConversationPostListCommand_initTelemetry, _EntraM365GroupConversationPostListCommand_initOptions, _EntraM365GroupConversationPostListCommand_initValidators, _EntraM365GroupConversationPostListCommand_initOptionSets;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { entraGroup } from '../../../../utils/entraGroup.js';
8
4
  import { formatting } from '../../../../utils/formatting.js';
9
5
  import { odata } from '../../../../utils/odata.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
+ groupId: z.uuid().optional().alias('i'),
11
+ groupName: z.string().optional().alias('d'),
12
+ threadId: z.string().alias('t')
13
+ });
13
14
  class EntraM365GroupConversationPostListCommand extends GraphCommand {
14
15
  get name() {
15
16
  return commands.M365GROUP_CONVERSATION_POST_LIST;
@@ -17,13 +18,18 @@ class EntraM365GroupConversationPostListCommand extends GraphCommand {
17
18
  get description() {
18
19
  return 'Lists conversation posts of a Microsoft 365 group';
19
20
  }
20
- constructor() {
21
- super();
22
- _EntraM365GroupConversationPostListCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupConversationPostListCommand_instances, "m", _EntraM365GroupConversationPostListCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _EntraM365GroupConversationPostListCommand_instances, "m", _EntraM365GroupConversationPostListCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupConversationPostListCommand_instances, "m", _EntraM365GroupConversationPostListCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupConversationPostListCommand_instances, "m", _EntraM365GroupConversationPostListCommand_initOptionSets).call(this);
21
+ get schema() {
22
+ return options;
23
+ }
24
+ getRefinedSchema(schema) {
25
+ return schema
26
+ .refine(opts => [opts.groupId, opts.groupName].filter(o => o !== undefined).length === 1, {
27
+ error: 'Use one of the following options: groupId or groupName.',
28
+ params: {
29
+ customCode: 'optionSet',
30
+ options: ['groupId', 'groupName']
31
+ }
32
+ });
27
33
  }
28
34
  defaultProperties() {
29
35
  return ['receivedDateTime', 'id'];
@@ -50,30 +56,5 @@ class EntraM365GroupConversationPostListCommand extends GraphCommand {
50
56
  return group.id;
51
57
  }
52
58
  }
53
- _EntraM365GroupConversationPostListCommand_instances = new WeakSet(), _EntraM365GroupConversationPostListCommand_initTelemetry = function _EntraM365GroupConversationPostListCommand_initTelemetry() {
54
- this.telemetry.push((args) => {
55
- Object.assign(this.telemetryProperties, {
56
- groupId: typeof args.options.groupId !== 'undefined',
57
- groupName: typeof args.options.groupName !== 'undefined'
58
- });
59
- });
60
- }, _EntraM365GroupConversationPostListCommand_initOptions = function _EntraM365GroupConversationPostListCommand_initOptions() {
61
- this.options.unshift({
62
- option: '-i, --groupId [groupId]'
63
- }, {
64
- option: '-d, --groupName [groupName]'
65
- }, {
66
- option: '-t, --threadId <threadId>'
67
- });
68
- }, _EntraM365GroupConversationPostListCommand_initValidators = function _EntraM365GroupConversationPostListCommand_initValidators() {
69
- this.validators.push(async (args) => {
70
- if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
71
- return `${args.options.groupId} is not a valid GUID`;
72
- }
73
- return true;
74
- });
75
- }, _EntraM365GroupConversationPostListCommand_initOptionSets = function _EntraM365GroupConversationPostListCommand_initOptionSets() {
76
- this.optionSets.push({ options: ['groupId', 'groupName'] });
77
- };
78
59
  export default new EntraM365GroupConversationPostListCommand();
79
60
  //# sourceMappingURL=m365group-conversation-post-list.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 _EntraM365GroupGetCommand_instances, _EntraM365GroupGetCommand_initTelemetry, _EntraM365GroupGetCommand_initOptions, _EntraM365GroupGetCommand_initValidators, _EntraM365GroupGetCommand_initOptionSets, _EntraM365GroupGetCommand_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
+ withSiteUrl: z.boolean().optional()
12
+ });
12
13
  class EntraM365GroupGetCommand extends GraphCommand {
13
14
  get name() {
14
15
  return commands.M365GROUP_GET;
@@ -16,14 +17,18 @@ class EntraM365GroupGetCommand extends GraphCommand {
16
17
  get description() {
17
18
  return 'Gets information about the specified Microsoft 365 Group or Microsoft Teams team';
18
19
  }
19
- constructor() {
20
- super();
21
- _EntraM365GroupGetCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initOptionSets).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupGetCommand_instances, "m", _EntraM365GroupGetCommand_initTypes).call(this);
20
+ get schema() {
21
+ return options;
22
+ }
23
+ getRefinedSchema(schema) {
24
+ return schema
25
+ .refine(opts => [opts.id, opts.displayName].filter(o => o !== undefined).length === 1, {
26
+ error: 'Use one of the following options: id or displayName.',
27
+ params: {
28
+ customCode: 'optionSet',
29
+ options: ['id', 'displayName']
30
+ }
31
+ });
27
32
  }
28
33
  async commandAction(logger, args) {
29
34
  let group;
@@ -65,31 +70,5 @@ class EntraM365GroupGetCommand extends GraphCommand {
65
70
  }
66
71
  }
67
72
  }
68
- _EntraM365GroupGetCommand_instances = new WeakSet(), _EntraM365GroupGetCommand_initTelemetry = function _EntraM365GroupGetCommand_initTelemetry() {
69
- this.telemetry.push((args) => {
70
- Object.assign(this.telemetryProperties, {
71
- withSiteUrl: !!args.options.withSiteUrl
72
- });
73
- });
74
- }, _EntraM365GroupGetCommand_initOptions = function _EntraM365GroupGetCommand_initOptions() {
75
- this.options.unshift({
76
- option: '-i, --id [id]'
77
- }, {
78
- option: '-n, --displayName [displayName]'
79
- }, {
80
- option: '--withSiteUrl'
81
- });
82
- }, _EntraM365GroupGetCommand_initValidators = function _EntraM365GroupGetCommand_initValidators() {
83
- this.validators.push(async (args) => {
84
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
85
- return `${args.options.id} is not a valid GUID`;
86
- }
87
- return true;
88
- });
89
- }, _EntraM365GroupGetCommand_initOptionSets = function _EntraM365GroupGetCommand_initOptionSets() {
90
- this.optionSets.push({ options: ['id', 'displayName'] });
91
- }, _EntraM365GroupGetCommand_initTypes = function _EntraM365GroupGetCommand_initTypes() {
92
- this.types.string.push('id', 'displayName');
93
- };
94
73
  export default new EntraM365GroupGetCommand();
95
74
  //# sourceMappingURL=m365group-get.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 _EntraM365GroupListCommand_instances, _EntraM365GroupListCommand_initTelemetry, _EntraM365GroupListCommand_initOptions;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
4
  import { formatting } from '../../../../utils/formatting.js';
9
5
  import { odata } from '../../../../utils/odata.js';
10
6
  import GraphCommand from '../../../base/GraphCommand.js';
11
7
  import commands from '../../commands.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ displayName: z.string().optional().alias('d'),
11
+ mailNickname: z.string().optional().alias('m'),
12
+ withSiteUrl: z.boolean().optional(),
13
+ orphaned: z.boolean().optional()
14
+ });
12
15
  class EntraM365GroupListCommand extends GraphCommand {
13
16
  get name() {
14
17
  return commands.M365GROUP_LIST;
@@ -16,11 +19,8 @@ class EntraM365GroupListCommand extends GraphCommand {
16
19
  get description() {
17
20
  return 'Lists Microsoft 365 Groups in the current tenant';
18
21
  }
19
- constructor() {
20
- super();
21
- _EntraM365GroupListCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraM365GroupListCommand_instances, "m", _EntraM365GroupListCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupListCommand_instances, "m", _EntraM365GroupListCommand_initOptions).call(this);
22
+ get schema() {
23
+ return options;
24
24
  }
25
25
  defaultProperties() {
26
26
  return ['id', 'displayName', 'mailNickname', 'siteUrl'];
@@ -76,25 +76,5 @@ class EntraM365GroupListCommand extends GraphCommand {
76
76
  };
77
77
  }
78
78
  }
79
- _EntraM365GroupListCommand_instances = new WeakSet(), _EntraM365GroupListCommand_initTelemetry = function _EntraM365GroupListCommand_initTelemetry() {
80
- this.telemetry.push((args) => {
81
- Object.assign(this.telemetryProperties, {
82
- displayName: typeof args.options.displayName !== 'undefined',
83
- mailNickname: typeof args.options.mailNickname !== 'undefined',
84
- withSiteUrl: !!args.options.withSiteUrl,
85
- orphaned: !!args.options.orphaned
86
- });
87
- });
88
- }, _EntraM365GroupListCommand_initOptions = function _EntraM365GroupListCommand_initOptions() {
89
- this.options.unshift({
90
- option: '-d, --displayName [displayName]'
91
- }, {
92
- option: '-m, --mailNickname [displayName]'
93
- }, {
94
- option: '--withSiteUrl'
95
- }, {
96
- option: '--orphaned'
97
- });
98
- };
99
79
  export default new EntraM365GroupListCommand();
100
80
  //# sourceMappingURL=m365group-list.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 _EntraM365GroupRecycleBinItemClearCommand_instances, _EntraM365GroupRecycleBinItemClearCommand_initTelemetry, _EntraM365GroupRecycleBinItemClearCommand_initOptions;
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 { odata } from '../../../../utils/odata.js';
10
6
  import GraphCommand from '../../../base/GraphCommand.js';
11
7
  import commands from '../../commands.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ force: z.boolean().optional().alias('f')
11
+ });
12
12
  class EntraM365GroupRecycleBinItemClearCommand extends GraphCommand {
13
13
  get name() {
14
14
  return commands.M365GROUP_RECYCLEBINITEM_CLEAR;
@@ -16,11 +16,8 @@ class EntraM365GroupRecycleBinItemClearCommand extends GraphCommand {
16
16
  get description() {
17
17
  return 'Clears all M365 Groups from recycle bin.';
18
18
  }
19
- constructor() {
20
- super();
21
- _EntraM365GroupRecycleBinItemClearCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemClearCommand_instances, "m", _EntraM365GroupRecycleBinItemClearCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemClearCommand_instances, "m", _EntraM365GroupRecycleBinItemClearCommand_initOptions).call(this);
19
+ get schema() {
20
+ return options;
24
21
  }
25
22
  async commandAction(logger, args) {
26
23
  const clearM365GroupRecycleBinItems = async () => {
@@ -62,16 +59,5 @@ class EntraM365GroupRecycleBinItemClearCommand extends GraphCommand {
62
59
  await Promise.all(deletePromises);
63
60
  }
64
61
  }
65
- _EntraM365GroupRecycleBinItemClearCommand_instances = new WeakSet(), _EntraM365GroupRecycleBinItemClearCommand_initTelemetry = function _EntraM365GroupRecycleBinItemClearCommand_initTelemetry() {
66
- this.telemetry.push((args) => {
67
- Object.assign(this.telemetryProperties, {
68
- force: typeof args.options.force !== 'undefined'
69
- });
70
- });
71
- }, _EntraM365GroupRecycleBinItemClearCommand_initOptions = function _EntraM365GroupRecycleBinItemClearCommand_initOptions() {
72
- this.options.unshift({
73
- option: '-f, --force'
74
- });
75
- };
76
62
  export default new EntraM365GroupRecycleBinItemClearCommand();
77
63
  //# sourceMappingURL=m365group-recyclebinitem-clear.js.map
@@ -1,13 +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 _EntraM365GroupRecycleBinItemListCommand_instances, _EntraM365GroupRecycleBinItemListCommand_initTelemetry, _EntraM365GroupRecycleBinItemListCommand_initOptions;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import { formatting } from '../../../../utils/formatting.js';
8
4
  import { odata } from '../../../../utils/odata.js';
9
5
  import GraphCommand from '../../../base/GraphCommand.js';
10
6
  import commands from '../../commands.js';
7
+ export const options = z.strictObject({
8
+ ...globalOptionsZod.shape,
9
+ groupName: z.string().optional().alias('d'),
10
+ groupMailNickname: z.string().optional().alias('m')
11
+ });
11
12
  class EntraM365GroupRecycleBinItemListCommand extends GraphCommand {
12
13
  get name() {
13
14
  return commands.M365GROUP_RECYCLEBINITEM_LIST;
@@ -15,11 +16,8 @@ class EntraM365GroupRecycleBinItemListCommand extends GraphCommand {
15
16
  get description() {
16
17
  return 'Lists Microsoft 365 Groups deleted in the current tenant';
17
18
  }
18
- constructor() {
19
- super();
20
- _EntraM365GroupRecycleBinItemListCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemListCommand_instances, "m", _EntraM365GroupRecycleBinItemListCommand_initTelemetry).call(this);
22
- __classPrivateFieldGet(this, _EntraM365GroupRecycleBinItemListCommand_instances, "m", _EntraM365GroupRecycleBinItemListCommand_initOptions).call(this);
19
+ get schema() {
20
+ return options;
23
21
  }
24
22
  defaultProperties() {
25
23
  return ['id', 'displayName', 'mailNickname'];
@@ -39,19 +37,5 @@ class EntraM365GroupRecycleBinItemListCommand extends GraphCommand {
39
37
  }
40
38
  }
41
39
  }
42
- _EntraM365GroupRecycleBinItemListCommand_instances = new WeakSet(), _EntraM365GroupRecycleBinItemListCommand_initTelemetry = function _EntraM365GroupRecycleBinItemListCommand_initTelemetry() {
43
- this.telemetry.push((args) => {
44
- Object.assign(this.telemetryProperties, {
45
- groupName: typeof args.options.groupName !== 'undefined',
46
- groupMailNickname: typeof args.options.groupMailNickname !== 'undefined'
47
- });
48
- });
49
- }, _EntraM365GroupRecycleBinItemListCommand_initOptions = function _EntraM365GroupRecycleBinItemListCommand_initOptions() {
50
- this.options.unshift({
51
- option: '-d, --groupName [groupName]'
52
- }, {
53
- option: '-m, --groupMailNickname [groupMailNickname]'
54
- });
55
- };
56
40
  export default new EntraM365GroupRecycleBinItemListCommand();
57
41
  //# sourceMappingURL=m365group-recyclebinitem-list.js.map