@pnp/cli-microsoft365 12.0.0-beta.792164a → 12.0.0-beta.93e11fb

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 (232) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +19 -2
  4. package/dist/cli/cli.js +3 -0
  5. package/dist/m365/cli/commands/cli-consent.js +9 -2
  6. package/dist/m365/entra/commands/m365group/m365group-add.js +52 -97
  7. package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +20 -33
  8. package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +20 -39
  9. package/dist/m365/entra/commands/m365group/m365group-get.js +20 -41
  10. package/dist/m365/entra/commands/m365group/m365group-list.js +11 -31
  11. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +8 -22
  12. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +9 -25
  13. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +21 -43
  14. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +21 -41
  15. package/dist/m365/entra/commands/m365group/m365group-remove.js +25 -46
  16. package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -32
  17. package/dist/m365/entra/commands/m365group/m365group-set.js +86 -141
  18. package/dist/m365/entra/commands/m365group/m365group-teamify.js +20 -43
  19. package/dist/m365/entra/commands/m365group/m365group-user-add.js +44 -77
  20. package/dist/m365/entra/commands/m365group/m365group-user-list.js +28 -55
  21. package/dist/m365/entra/commands/m365group/m365group-user-remove.js +37 -74
  22. package/dist/m365/entra/commands/m365group/m365group-user-set.js +45 -77
  23. package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +14 -16
  24. package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
  25. package/dist/m365/spe/commands.js +1 -0
  26. package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
  27. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0.js +19 -0
  28. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  29. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
  30. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
  31. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
  32. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0.js +77 -0
  33. package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
  34. package/dist/m365/spo/commands/app/app-add.js +35 -56
  35. package/dist/m365/spo/commands/app/app-deploy.js +41 -59
  36. package/dist/m365/spo/commands/app/app-get.js +40 -56
  37. package/dist/m365/spo/commands/app/app-install.js +20 -41
  38. package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
  39. package/dist/m365/spo/commands/app/app-list.js +26 -44
  40. package/dist/m365/spo/commands/app/app-remove.js +32 -52
  41. package/dist/m365/spo/commands/app/app-retract.js +32 -51
  42. package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
  43. package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
  44. package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
  45. package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
  46. package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
  47. package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
  48. package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
  49. package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
  50. package/dist/m365/spo/commands/externaluser/externaluser-list.js +5 -14
  51. package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
  52. package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
  53. package/dist/m365/spo/commands/feature/feature-list.js +11 -36
  54. package/dist/m365/spo/commands/field/field-add.js +33 -62
  55. package/dist/m365/spo/commands/field/field-get.js +30 -57
  56. package/dist/m365/spo/commands/field/field-list.js +21 -46
  57. package/dist/m365/spo/commands/field/field-remove.js +32 -63
  58. package/dist/m365/spo/commands/field/field-set.js +34 -66
  59. package/dist/m365/spo/commands/file/file-get.js +4 -3
  60. package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
  61. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
  62. package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
  63. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
  64. package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
  65. package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
  66. package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
  67. package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
  68. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
  69. package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
  70. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
  71. package/dist/m365/spo/commands/listitem/listitem-add.js +27 -55
  72. package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +30 -58
  73. package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +27 -52
  74. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +26 -50
  75. package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +28 -55
  76. package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +30 -57
  77. package/dist/m365/spo/commands/listitem/listitem-batch-add.js +36 -58
  78. package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +68 -92
  79. package/dist/m365/spo/commands/listitem/listitem-batch-set.js +37 -57
  80. package/dist/m365/spo/commands/listitem/listitem-get.js +45 -68
  81. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +31 -55
  82. package/dist/m365/spo/commands/listitem/listitem-list.js +47 -81
  83. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +37 -60
  84. package/dist/m365/spo/commands/listitem/listitem-record-lock.js +30 -52
  85. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +31 -52
  86. package/dist/m365/spo/commands/listitem/listitem-record-unlock.js +30 -52
  87. package/dist/m365/spo/commands/listitem/listitem-remove.js +33 -61
  88. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +46 -67
  89. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +33 -56
  90. package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +55 -98
  91. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +48 -74
  92. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +33 -56
  93. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +31 -53
  94. package/dist/m365/spo/commands/listitem/listitem-set.js +33 -58
  95. package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
  96. package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
  97. package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
  98. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +1 -1
  99. package/dist/m365/spo/commands/page/page-column-list.js +7 -8
  100. package/dist/m365/spo/commands/page/page-section-list.js +15 -17
  101. package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
  102. package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
  103. package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
  104. package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
  105. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
  106. package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
  107. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +8 -1
  108. package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -1
  109. package/dist/m365/spo/commands/term/term-group-list.js +7 -8
  110. package/dist/m365/spo/commands/term/term-set-list.js +6 -9
  111. package/dist/m365/spo/commands.js +3 -1
  112. package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
  113. package/dist/m365/spp/commands/model/model-get.js +25 -45
  114. package/dist/m365/spp/commands/model/model-list.js +12 -23
  115. package/dist/m365/spp/commands/model/model-remove.js +25 -45
  116. package/dist/m365/teams/commands/chat/chat-get.js +30 -45
  117. package/dist/m365/teams/commands/chat/chat-list.js +22 -42
  118. package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
  119. package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
  120. package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
  121. package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
  122. package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
  123. package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
  124. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
  125. package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
  126. package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
  127. package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
  128. package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
  129. package/dist/m365/teams/commands/message/message-get.js +19 -30
  130. package/dist/m365/teams/commands/message/message-list.js +26 -43
  131. package/dist/m365/teams/commands/message/message-remove.js +43 -58
  132. package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
  133. package/dist/m365/teams/commands/message/message-restore.js +40 -50
  134. package/dist/m365/teams/commands/message/message-send.js +19 -30
  135. package/dist/m365/teams/commands/report/report-deviceusagedistributionusercounts.js +10 -0
  136. package/dist/m365/teams/commands/report/report-deviceusageusercounts.js +10 -0
  137. package/dist/m365/teams/commands/report/report-deviceusageuserdetail.js +22 -0
  138. package/dist/m365/teams/commands/report/report-directroutingcalls.js +19 -39
  139. package/dist/m365/teams/commands/report/report-pstncalls.js +19 -39
  140. package/dist/m365/teams/commands/report/report-useractivitycounts.js +10 -0
  141. package/dist/m365/teams/commands/report/report-useractivityusercounts.js +10 -0
  142. package/dist/m365/teams/commands/report/report-useractivityuserdetail.js +22 -0
  143. package/dist/m365/teams/commands/tab/tab-add.js +23 -49
  144. package/dist/m365/teams/commands/tab/tab-get.js +55 -56
  145. package/dist/m365/teams/commands/tab/tab-list.js +17 -28
  146. package/dist/m365/teams/commands/tab/tab-remove.js +23 -42
  147. package/dist/m365/teams/commands/team/team-add.js +76 -114
  148. package/dist/m365/teams/commands/team/team-app-list.js +23 -36
  149. package/dist/m365/teams/commands/team/team-archive.js +24 -39
  150. package/dist/m365/teams/commands/team/team-clone.js +28 -62
  151. package/dist/m365/teams/commands/team/team-get.js +23 -36
  152. package/dist/m365/teams/commands/team/team-list.js +43 -57
  153. package/dist/m365/teams/commands/team/team-remove.js +24 -37
  154. package/dist/m365/teams/commands/team/team-set.js +23 -52
  155. package/dist/m365/teams/commands/team/team-unarchive.js +23 -28
  156. package/dist/m365/teams/commands/user/user-app-add.js +40 -49
  157. package/dist/m365/teams/commands/user/user-app-list.js +26 -39
  158. package/dist/m365/teams/commands/user/user-app-remove.js +37 -49
  159. package/dist/m365/teams/commands/user/user-app-upgrade.js +36 -52
  160. package/dist/m365/teams/commands/user/user-list.js +17 -39
  161. package/dist/m365/tenant/commands/report/report-activeusercounts.js +2 -1
  162. package/dist/m365/tenant/commands/report/report-activeuserdetail.js +2 -1
  163. package/dist/m365/tenant/commands/report/report-office365activationcounts.js +9 -0
  164. package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +9 -0
  165. package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +9 -0
  166. package/dist/m365/tenant/commands/report/report-servicesusercounts.js +2 -1
  167. package/dist/m365/tenant/commands/report/report-settings-get.js +5 -0
  168. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +9 -20
  169. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +8 -20
  170. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +8 -15
  171. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +8 -15
  172. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +12 -26
  173. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +8 -22
  174. package/dist/utils/formatting.js +16 -0
  175. package/dist/utils/pid.js +7 -16
  176. package/dist/utils/spo.js +39 -0
  177. package/dist/utils/zod.js +4 -4
  178. package/docs/docs/cmd/login.mdx +15 -2
  179. package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
  180. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  181. package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +17 -30
  182. package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
  183. package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
  184. package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
  185. package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
  186. package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
  187. package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
  188. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  189. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
  190. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
  191. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  192. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
  193. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
  194. package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
  195. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +1 -1
  196. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +1 -1
  197. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +1 -1
  198. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +1 -1
  199. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +1 -1
  200. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +1 -1
  201. package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
  202. package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
  203. package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
  204. package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
  205. package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
  206. package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
  207. package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
  208. package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
  209. package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
  210. package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
  211. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
  212. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
  213. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +1 -1
  214. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +1 -1
  215. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +1 -1
  216. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  217. package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
  218. package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
  219. package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
  220. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +0 -21
  221. package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
  222. package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
  223. package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
  224. package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
  225. package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
  226. package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
  227. package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
  228. package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
  229. package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
  230. package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
  231. package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
  232. package/package.json +4 -6
@@ -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 _EntraM365GroupTeamifyCommand_instances, _EntraM365GroupTeamifyCommand_initTelemetry, _EntraM365GroupTeamifyCommand_initOptions, _EntraM365GroupTeamifyCommand_initValidators, _EntraM365GroupTeamifyCommand_initOptionSets, _EntraM365GroupTeamifyCommand_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
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('n'),
12
+ mailNickname: z.string().optional()
13
+ });
13
14
  class EntraM365GroupTeamifyCommand extends GraphCommand {
14
15
  get name() {
15
16
  return commands.M365GROUP_TEAMIFY;
@@ -17,14 +18,18 @@ class EntraM365GroupTeamifyCommand extends GraphCommand {
17
18
  get description() {
18
19
  return 'Creates a new Microsoft Teams team under existing Microsoft 365 group';
19
20
  }
20
- constructor() {
21
- super();
22
- _EntraM365GroupTeamifyCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initOptionSets).call(this);
27
- __classPrivateFieldGet(this, _EntraM365GroupTeamifyCommand_instances, "m", _EntraM365GroupTeamifyCommand_initTypes).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
+ });
28
33
  }
29
34
  async getGroupId(options) {
30
35
  if (options.id) {
@@ -71,33 +76,5 @@ class EntraM365GroupTeamifyCommand extends GraphCommand {
71
76
  }
72
77
  }
73
78
  }
74
- _EntraM365GroupTeamifyCommand_instances = new WeakSet(), _EntraM365GroupTeamifyCommand_initTelemetry = function _EntraM365GroupTeamifyCommand_initTelemetry() {
75
- this.telemetry.push((args) => {
76
- Object.assign(this.telemetryProperties, {
77
- id: typeof args.options.id !== 'undefined',
78
- mailNickname: typeof args.options.mailNickname !== 'undefined',
79
- displayName: typeof args.options.displayName !== 'undefined'
80
- });
81
- });
82
- }, _EntraM365GroupTeamifyCommand_initOptions = function _EntraM365GroupTeamifyCommand_initOptions() {
83
- this.options.unshift({
84
- option: '-i, --id [id]'
85
- }, {
86
- option: '-n, --displayName [displayName]'
87
- }, {
88
- option: '--mailNickname [mailNickname]'
89
- });
90
- }, _EntraM365GroupTeamifyCommand_initValidators = function _EntraM365GroupTeamifyCommand_initValidators() {
91
- this.validators.push(async (args) => {
92
- if (args.options.id && !validation.isValidGuid(args.options.id)) {
93
- return `${args.options.id} is not a valid GUID`;
94
- }
95
- return true;
96
- });
97
- }, _EntraM365GroupTeamifyCommand_initOptionSets = function _EntraM365GroupTeamifyCommand_initOptionSets() {
98
- this.optionSets.push({ options: ['id', 'displayName', 'mailNickname'] });
99
- }, _EntraM365GroupTeamifyCommand_initTypes = function _EntraM365GroupTeamifyCommand_initTypes() {
100
- this.types.string.push('id', 'displayName', 'mailNickname');
101
- };
102
79
  export default new EntraM365GroupTeamifyCommand();
103
80
  //# sourceMappingURL=m365group-teamify.js.map
@@ -1,16 +1,33 @@
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 _EntraM365GroupUserAddCommand_instances, _EntraM365GroupUserAddCommand_initTelemetry, _EntraM365GroupUserAddCommand_initOptions, _EntraM365GroupUserAddCommand_initValidators, _EntraM365GroupUserAddCommand_initOptionSets, _EntraM365GroupUserAddCommand_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';
5
+ import { entraUser } from '../../../../utils/entraUser.js';
10
6
  import { formatting } from '../../../../utils/formatting.js';
7
+ import { validation } from '../../../../utils/validation.js';
8
+ import { zod } from '../../../../utils/zod.js';
11
9
  import GraphCommand from '../../../base/GraphCommand.js';
12
- import { entraUser } from '../../../../utils/entraUser.js';
13
10
  import commands from '../../commands.js';
11
+ const RoleEnum = {
12
+ owner: 'owner',
13
+ member: 'member'
14
+ };
15
+ export const options = z.strictObject({
16
+ ...globalOptionsZod.shape,
17
+ ids: z.string()
18
+ .refine(ids => validation.isValidGuidArray(ids) === true, {
19
+ error: e => `The following GUIDs are invalid for the option 'ids': ${validation.isValidGuidArray(e.input)}.`
20
+ }).optional(),
21
+ userNames: z.string()
22
+ .refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
23
+ error: e => `The following user principal names are invalid for the option 'userNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
24
+ }).optional(),
25
+ groupId: z.uuid().optional().alias('i'),
26
+ groupName: z.string().optional(),
27
+ teamId: z.uuid().optional(),
28
+ teamName: z.string().optional(),
29
+ role: zod.coercedEnum(RoleEnum).optional().alias('r')
30
+ });
14
31
  class EntraM365GroupUserAddCommand extends GraphCommand {
15
32
  get name() {
16
33
  return commands.M365GROUP_USER_ADD;
@@ -18,15 +35,25 @@ class EntraM365GroupUserAddCommand extends GraphCommand {
18
35
  get description() {
19
36
  return 'Adds user to specified Microsoft 365 Group or Microsoft Teams team';
20
37
  }
21
- constructor() {
22
- super();
23
- _EntraM365GroupUserAddCommand_instances.add(this);
24
- this.allowedRoles = ['owner', 'member'];
25
- __classPrivateFieldGet(this, _EntraM365GroupUserAddCommand_instances, "m", _EntraM365GroupUserAddCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupUserAddCommand_instances, "m", _EntraM365GroupUserAddCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _EntraM365GroupUserAddCommand_instances, "m", _EntraM365GroupUserAddCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _EntraM365GroupUserAddCommand_instances, "m", _EntraM365GroupUserAddCommand_initOptionSets).call(this);
29
- __classPrivateFieldGet(this, _EntraM365GroupUserAddCommand_instances, "m", _EntraM365GroupUserAddCommand_initTypes).call(this);
38
+ get schema() {
39
+ return options;
40
+ }
41
+ getRefinedSchema(schema) {
42
+ return schema
43
+ .refine(opts => [opts.groupId, opts.groupName, opts.teamId, opts.teamName].filter(o => o !== undefined).length === 1, {
44
+ error: 'Use one of the following options: groupId, groupName, teamId or teamName.',
45
+ params: {
46
+ customCode: 'optionSet',
47
+ options: ['groupId', 'groupName', 'teamId', 'teamName']
48
+ }
49
+ })
50
+ .refine(opts => [opts.ids, opts.userNames].filter(o => o !== undefined).length === 1, {
51
+ error: 'Use one of the following options: ids or userNames.',
52
+ params: {
53
+ customCode: 'optionSet',
54
+ options: ['ids', 'userNames']
55
+ }
56
+ });
30
57
  }
31
58
  async commandAction(logger, args) {
32
59
  try {
@@ -103,65 +130,5 @@ class EntraM365GroupUserAddCommand extends GraphCommand {
103
130
  }
104
131
  }
105
132
  }
106
- _EntraM365GroupUserAddCommand_instances = new WeakSet(), _EntraM365GroupUserAddCommand_initTelemetry = function _EntraM365GroupUserAddCommand_initTelemetry() {
107
- this.telemetry.push((args) => {
108
- Object.assign(this.telemetryProperties, {
109
- role: args.options.role !== 'undefined',
110
- teamId: typeof args.options.teamId !== 'undefined',
111
- groupId: typeof args.options.groupId !== 'undefined',
112
- teamName: typeof args.options.teamName !== 'undefined',
113
- groupName: typeof args.options.groupName !== 'undefined',
114
- ids: typeof args.options.ids !== 'undefined',
115
- userNames: typeof args.options.userNames !== 'undefined'
116
- });
117
- });
118
- }, _EntraM365GroupUserAddCommand_initOptions = function _EntraM365GroupUserAddCommand_initOptions() {
119
- this.options.unshift({
120
- option: '--ids [ids]'
121
- }, {
122
- option: '--userNames [userNames]'
123
- }, {
124
- option: '-i, --groupId [groupId]'
125
- }, {
126
- option: '--groupName [groupName]'
127
- }, {
128
- option: '--teamId [teamId]'
129
- }, {
130
- option: '--teamName [teamName]'
131
- }, {
132
- option: '-r, --role [role]',
133
- autocomplete: this.allowedRoles
134
- });
135
- }, _EntraM365GroupUserAddCommand_initValidators = function _EntraM365GroupUserAddCommand_initValidators() {
136
- this.validators.push(async (args) => {
137
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
138
- return `'${args.options.teamId}' is not a valid GUID for option 'teamId'.`;
139
- }
140
- if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
141
- return `'${args.options.groupId}' is not a valid GUID for option 'groupId'.`;
142
- }
143
- if (args.options.ids) {
144
- const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.ids);
145
- if (isValidGUIDArrayResult !== true) {
146
- return `The following GUIDs are invalid for the option 'ids': ${isValidGUIDArrayResult}.`;
147
- }
148
- }
149
- if (args.options.userNames) {
150
- const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.userNames);
151
- if (isValidUPNArrayResult !== true) {
152
- return `The following user principal names are invalid for the option 'userNames': ${isValidUPNArrayResult}.`;
153
- }
154
- }
155
- if (args.options.role && !this.allowedRoles.some(role => role.toLowerCase() === args.options.role.toLowerCase())) {
156
- return `'${args.options.role}' is not a valid role. Allowed values are: ${this.allowedRoles.join(',')}`;
157
- }
158
- return true;
159
- });
160
- }, _EntraM365GroupUserAddCommand_initOptionSets = function _EntraM365GroupUserAddCommand_initOptionSets() {
161
- this.optionSets.push({ options: ['groupId', 'groupName', 'teamId', 'teamName'] });
162
- this.optionSets.push({ options: ['ids', 'userNames'] });
163
- }, _EntraM365GroupUserAddCommand_initTypes = function _EntraM365GroupUserAddCommand_initTypes() {
164
- this.types.string.push('ids', 'userNames', 'groupId', 'groupName', 'teamId', 'teamName', 'role');
165
- };
166
133
  export default new EntraM365GroupUserAddCommand();
167
134
  //# sourceMappingURL=m365group-user-add.js.map
@@ -1,14 +1,22 @@
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 _EntraM365GroupUserListCommand_instances, _EntraM365GroupUserListCommand_initTelemetry, _EntraM365GroupUserListCommand_initOptions, _EntraM365GroupUserListCommand_initOptionSets, _EntraM365GroupUserListCommand_initValidators;
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';
5
+ import { zod } from '../../../../utils/zod.js';
9
6
  import GraphCommand from '../../../base/GraphCommand.js';
10
7
  import commands from '../../commands.js';
11
- import { entraGroup } from '../../../../utils/entraGroup.js';
8
+ const RoleEnum = {
9
+ Owner: 'Owner',
10
+ Member: 'Member'
11
+ };
12
+ export const options = z.strictObject({
13
+ ...globalOptionsZod.shape,
14
+ filter: z.string().optional().alias('f'),
15
+ groupId: z.uuid().optional().alias('i'),
16
+ groupDisplayName: z.string().optional().alias('n'),
17
+ properties: z.string().optional().alias('p'),
18
+ role: zod.coercedEnum(RoleEnum).optional().alias('r')
19
+ });
12
20
  class EntraM365GroupUserListCommand extends GraphCommand {
13
21
  get name() {
14
22
  return commands.M365GROUP_USER_LIST;
@@ -16,13 +24,18 @@ class EntraM365GroupUserListCommand extends GraphCommand {
16
24
  get description() {
17
25
  return "Lists users for the specified Microsoft 365 group";
18
26
  }
19
- constructor() {
20
- super();
21
- _EntraM365GroupUserListCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _EntraM365GroupUserListCommand_instances, "m", _EntraM365GroupUserListCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _EntraM365GroupUserListCommand_instances, "m", _EntraM365GroupUserListCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _EntraM365GroupUserListCommand_instances, "m", _EntraM365GroupUserListCommand_initOptionSets).call(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupUserListCommand_instances, "m", _EntraM365GroupUserListCommand_initValidators).call(this);
27
+ get schema() {
28
+ return options;
29
+ }
30
+ getRefinedSchema(schema) {
31
+ return schema
32
+ .refine(opts => [opts.groupId, opts.groupDisplayName].filter(o => o !== undefined).length === 1, {
33
+ error: 'Use one of the following options: groupId or groupDisplayName.',
34
+ params: {
35
+ customCode: 'optionSet',
36
+ options: ['groupId', 'groupDisplayName']
37
+ }
38
+ });
26
39
  }
27
40
  async commandAction(logger, args) {
28
41
  try {
@@ -103,45 +116,5 @@ class EntraM365GroupUserListCommand extends GraphCommand {
103
116
  }
104
117
  }
105
118
  }
106
- _EntraM365GroupUserListCommand_instances = new WeakSet(), _EntraM365GroupUserListCommand_initTelemetry = function _EntraM365GroupUserListCommand_initTelemetry() {
107
- this.telemetry.push((args) => {
108
- Object.assign(this.telemetryProperties, {
109
- groupId: typeof args.options.groupId !== 'undefined',
110
- groupDisplayName: typeof args.options.groupDisplayName !== 'undefined',
111
- role: typeof args.options.role !== 'undefined',
112
- properties: typeof args.options.properties !== 'undefined',
113
- filter: typeof args.options.filter !== 'undefined'
114
- });
115
- });
116
- }, _EntraM365GroupUserListCommand_initOptions = function _EntraM365GroupUserListCommand_initOptions() {
117
- this.options.unshift({
118
- option: "-i, --groupId [groupId]"
119
- }, {
120
- option: "-n, --groupDisplayName [groupDisplayName]"
121
- }, {
122
- option: "-r, --role [type]",
123
- autocomplete: ["Owner", "Member"]
124
- }, {
125
- option: "-p, --properties [properties]"
126
- }, {
127
- option: "-f, --filter [filter]"
128
- });
129
- }, _EntraM365GroupUserListCommand_initOptionSets = function _EntraM365GroupUserListCommand_initOptionSets() {
130
- this.optionSets.push({
131
- options: ['groupId', 'groupDisplayName']
132
- });
133
- }, _EntraM365GroupUserListCommand_initValidators = function _EntraM365GroupUserListCommand_initValidators() {
134
- this.validators.push(async (args) => {
135
- if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
136
- return `${args.options.groupId} is not a valid GUID`;
137
- }
138
- if (args.options.role) {
139
- if (['Owner', 'Member'].indexOf(args.options.role) === -1) {
140
- return `${args.options.role} is not a valid role value. Allowed values Owner|Member`;
141
- }
142
- }
143
- return true;
144
- });
145
- };
146
119
  export default new EntraM365GroupUserListCommand();
147
120
  //# sourceMappingURL=m365group-user-list.js.map
@@ -1,10 +1,6 @@
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 _EntraM365GroupUserRemoveCommand_instances, _EntraM365GroupUserRemoveCommand_initTelemetry, _EntraM365GroupUserRemoveCommand_initOptions, _EntraM365GroupUserRemoveCommand_initValidators, _EntraM365GroupUserRemoveCommand_initOptionSets, _EntraM365GroupUserRemoveCommand_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
6
  import { entraUser } from '../../../../utils/entraUser.js';
@@ -12,6 +8,22 @@ import { formatting } from '../../../../utils/formatting.js';
12
8
  import { validation } from '../../../../utils/validation.js';
13
9
  import GraphCommand from '../../../base/GraphCommand.js';
14
10
  import commands from '../../commands.js';
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ teamId: z.uuid().optional(),
14
+ teamName: z.string().optional(),
15
+ groupId: z.uuid().optional().alias('i'),
16
+ groupName: z.string().optional(),
17
+ ids: z.string()
18
+ .refine(ids => validation.isValidGuidArray(ids) === true, {
19
+ error: e => `The following GUIDs are invalid for the option 'ids': ${validation.isValidGuidArray(e.input)}.`
20
+ }).optional(),
21
+ userNames: z.string()
22
+ .refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
23
+ error: e => `The following user principal names are invalid for the option 'userNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
24
+ }).optional(),
25
+ force: z.boolean().optional().alias('f')
26
+ });
15
27
  class EntraM365GroupUserRemoveCommand extends GraphCommand {
16
28
  get name() {
17
29
  return commands.M365GROUP_USER_REMOVE;
@@ -19,14 +31,25 @@ class EntraM365GroupUserRemoveCommand extends GraphCommand {
19
31
  get description() {
20
32
  return 'Removes the specified user from specified Microsoft 365 Group or Microsoft Teams team';
21
33
  }
22
- constructor() {
23
- super();
24
- _EntraM365GroupUserRemoveCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _EntraM365GroupUserRemoveCommand_instances, "m", _EntraM365GroupUserRemoveCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupUserRemoveCommand_instances, "m", _EntraM365GroupUserRemoveCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _EntraM365GroupUserRemoveCommand_instances, "m", _EntraM365GroupUserRemoveCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _EntraM365GroupUserRemoveCommand_instances, "m", _EntraM365GroupUserRemoveCommand_initOptionSets).call(this);
29
- __classPrivateFieldGet(this, _EntraM365GroupUserRemoveCommand_instances, "m", _EntraM365GroupUserRemoveCommand_initTypes).call(this);
34
+ get schema() {
35
+ return options;
36
+ }
37
+ getRefinedSchema(schema) {
38
+ return schema
39
+ .refine(opts => [opts.groupId, opts.teamId, opts.groupName, opts.teamName].filter(o => o !== undefined).length === 1, {
40
+ error: 'Use one of the following options: groupId, teamId, groupName or teamName.',
41
+ params: {
42
+ customCode: 'optionSet',
43
+ options: ['groupId', 'teamId', 'groupName', 'teamName']
44
+ }
45
+ })
46
+ .refine(opts => [opts.ids, opts.userNames].filter(o => o !== undefined).length === 1, {
47
+ error: 'Use one of the following options: ids or userNames.',
48
+ params: {
49
+ customCode: 'optionSet',
50
+ options: ['ids', 'userNames']
51
+ }
52
+ });
30
53
  }
31
54
  async commandAction(logger, args) {
32
55
  const removeUser = async () => {
@@ -94,65 +117,5 @@ class EntraM365GroupUserRemoveCommand extends GraphCommand {
94
117
  }
95
118
  }
96
119
  }
97
- _EntraM365GroupUserRemoveCommand_instances = new WeakSet(), _EntraM365GroupUserRemoveCommand_initTelemetry = function _EntraM365GroupUserRemoveCommand_initTelemetry() {
98
- this.telemetry.push((args) => {
99
- Object.assign(this.telemetryProperties, {
100
- force: !!args.options.force,
101
- teamId: typeof args.options.teamId !== 'undefined',
102
- groupId: typeof args.options.groupId !== 'undefined',
103
- teamName: typeof args.options.teamName !== 'undefined',
104
- groupName: typeof args.options.groupName !== 'undefined',
105
- ids: typeof args.options.ids !== 'undefined',
106
- userNames: typeof args.options.userNames !== 'undefined'
107
- });
108
- });
109
- }, _EntraM365GroupUserRemoveCommand_initOptions = function _EntraM365GroupUserRemoveCommand_initOptions() {
110
- this.options.unshift({
111
- option: '-i, --groupId [groupId]'
112
- }, {
113
- option: '--groupName [groupName]'
114
- }, {
115
- option: '--teamId [teamId]'
116
- }, {
117
- option: '--teamName [teamName]'
118
- }, {
119
- option: '--ids [ids]'
120
- }, {
121
- option: '--userNames [userNames]'
122
- }, {
123
- option: '-f, --force'
124
- });
125
- }, _EntraM365GroupUserRemoveCommand_initValidators = function _EntraM365GroupUserRemoveCommand_initValidators() {
126
- this.validators.push(async (args) => {
127
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
128
- return `${args.options.teamId} is not a valid GUID for option 'teamId'.`;
129
- }
130
- if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
131
- return `${args.options.groupId} is not a valid GUID for option 'groupId'.`;
132
- }
133
- if (args.options.ids) {
134
- const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.ids);
135
- if (isValidGUIDArrayResult !== true) {
136
- return `The following GUIDs are invalid for the option 'ids': ${isValidGUIDArrayResult}.`;
137
- }
138
- }
139
- if (args.options.userNames) {
140
- const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.userNames);
141
- if (isValidUPNArrayResult !== true) {
142
- return `The following user principal names are invalid for the option 'userNames': ${isValidUPNArrayResult}.`;
143
- }
144
- }
145
- return true;
146
- });
147
- }, _EntraM365GroupUserRemoveCommand_initOptionSets = function _EntraM365GroupUserRemoveCommand_initOptionSets() {
148
- this.optionSets.push({
149
- options: ['groupId', 'teamId', 'groupName', 'teamName']
150
- }, {
151
- options: ['ids', 'userNames']
152
- });
153
- }, _EntraM365GroupUserRemoveCommand_initTypes = function _EntraM365GroupUserRemoveCommand_initTypes() {
154
- this.types.string.push('groupId', 'groupName', 'teamId', 'teamName', 'ids', 'userNames');
155
- this.types.boolean.push('force');
156
- };
157
120
  export default new EntraM365GroupUserRemoveCommand();
158
121
  //# sourceMappingURL=m365group-user-remove.js.map
@@ -1,16 +1,33 @@
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 _EntraM365GroupUserSetCommand_instances, _EntraM365GroupUserSetCommand_initTelemetry, _EntraM365GroupUserSetCommand_initOptions, _EntraM365GroupUserSetCommand_initValidators, _EntraM365GroupUserSetCommand_initOptionSets, _EntraM365GroupUserSetCommand_initTypes;
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
7
3
  import request from '../../../../request.js';
8
- import { validation } from '../../../../utils/validation.js';
4
+ import { entraGroup } from '../../../../utils/entraGroup.js';
5
+ import { entraUser } from '../../../../utils/entraUser.js';
9
6
  import { formatting } from '../../../../utils/formatting.js';
7
+ import { validation } from '../../../../utils/validation.js';
10
8
  import GraphCommand from '../../../base/GraphCommand.js';
11
9
  import commands from '../../commands.js';
12
- import { entraGroup } from '../../../../utils/entraGroup.js';
13
- import { entraUser } from '../../../../utils/entraUser.js';
10
+ import { zod } from '../../../../utils/zod.js';
11
+ const RoleEnum = {
12
+ owner: 'owner',
13
+ member: 'member'
14
+ };
15
+ export const options = z.strictObject({
16
+ ...globalOptionsZod.shape,
17
+ ids: z.string()
18
+ .refine(ids => validation.isValidGuidArray(ids) === true, {
19
+ error: e => `The following GUIDs are invalid for the option 'ids': ${validation.isValidGuidArray(e.input)}.`
20
+ }).optional(),
21
+ userNames: z.string()
22
+ .refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
23
+ error: e => `The following user principal names are invalid for the option 'userNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
24
+ }).optional(),
25
+ groupId: z.uuid().optional().alias('i'),
26
+ groupName: z.string().optional(),
27
+ teamId: z.uuid().optional(),
28
+ teamName: z.string().optional(),
29
+ role: zod.coercedEnum(RoleEnum).alias('r')
30
+ });
14
31
  class EntraM365GroupUserSetCommand extends GraphCommand {
15
32
  get name() {
16
33
  return commands.M365GROUP_USER_SET;
@@ -18,15 +35,25 @@ class EntraM365GroupUserSetCommand extends GraphCommand {
18
35
  get description() {
19
36
  return 'Updates role of the specified user in the specified Microsoft 365 Group or Microsoft Teams team';
20
37
  }
21
- constructor() {
22
- super();
23
- _EntraM365GroupUserSetCommand_instances.add(this);
24
- this.allowedRoles = ['owner', 'member'];
25
- __classPrivateFieldGet(this, _EntraM365GroupUserSetCommand_instances, "m", _EntraM365GroupUserSetCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _EntraM365GroupUserSetCommand_instances, "m", _EntraM365GroupUserSetCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _EntraM365GroupUserSetCommand_instances, "m", _EntraM365GroupUserSetCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _EntraM365GroupUserSetCommand_instances, "m", _EntraM365GroupUserSetCommand_initOptionSets).call(this);
29
- __classPrivateFieldGet(this, _EntraM365GroupUserSetCommand_instances, "m", _EntraM365GroupUserSetCommand_initTypes).call(this);
38
+ get schema() {
39
+ return options;
40
+ }
41
+ getRefinedSchema(schema) {
42
+ return schema
43
+ .refine(opts => [opts.groupId, opts.groupName, opts.teamId, opts.teamName].filter(o => o !== undefined).length === 1, {
44
+ error: 'Use one of the following options: groupId, groupName, teamId or teamName.',
45
+ params: {
46
+ customCode: 'optionSet',
47
+ options: ['groupId', 'groupName', 'teamId', 'teamName']
48
+ }
49
+ })
50
+ .refine(opts => [opts.ids, opts.userNames].filter(o => o !== undefined).length === 1, {
51
+ error: 'Use one of the following options: ids or userNames.',
52
+ params: {
53
+ customCode: 'optionSet',
54
+ options: ['ids', 'userNames']
55
+ }
56
+ });
30
57
  }
31
58
  async commandAction(logger, args) {
32
59
  try {
@@ -159,64 +186,5 @@ class EntraM365GroupUserSetCommand extends GraphCommand {
159
186
  return requestOptions;
160
187
  }
161
188
  }
162
- _EntraM365GroupUserSetCommand_instances = new WeakSet(), _EntraM365GroupUserSetCommand_initTelemetry = function _EntraM365GroupUserSetCommand_initTelemetry() {
163
- this.telemetry.push((args) => {
164
- Object.assign(this.telemetryProperties, {
165
- teamId: typeof args.options.teamId !== 'undefined',
166
- teamName: typeof args.options.teamName !== 'undefined',
167
- groupId: typeof args.options.groupId !== 'undefined',
168
- groupName: typeof args.options.groupName !== 'undefined',
169
- ids: typeof args.options.ids !== 'undefined',
170
- userNames: typeof args.options.userNames !== 'undefined'
171
- });
172
- });
173
- }, _EntraM365GroupUserSetCommand_initOptions = function _EntraM365GroupUserSetCommand_initOptions() {
174
- this.options.unshift({
175
- option: '--ids [ids]'
176
- }, {
177
- option: '--userNames [userNames]'
178
- }, {
179
- option: '-i, --groupId [groupId]'
180
- }, {
181
- option: '--groupName [groupName]'
182
- }, {
183
- option: '--teamId [teamId]'
184
- }, {
185
- option: '--teamName [teamName]'
186
- }, {
187
- option: '-r, --role <role>',
188
- autocomplete: this.allowedRoles
189
- });
190
- }, _EntraM365GroupUserSetCommand_initValidators = function _EntraM365GroupUserSetCommand_initValidators() {
191
- this.validators.push(async (args) => {
192
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
193
- return `'${args.options.teamId}' is not a valid GUID for option 'teamId'.`;
194
- }
195
- if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
196
- return `'${args.options.groupId}' is not a valid GUID for option 'groupId'.`;
197
- }
198
- if (args.options.ids) {
199
- const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.ids);
200
- if (isValidGUIDArrayResult !== true) {
201
- return `The following GUIDs are invalid for the option 'ids': ${isValidGUIDArrayResult}.`;
202
- }
203
- }
204
- if (args.options.userNames) {
205
- const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.userNames);
206
- if (isValidUPNArrayResult !== true) {
207
- return `The following user principal names are invalid for the option 'userNames': ${isValidUPNArrayResult}.`;
208
- }
209
- }
210
- if (args.options.role && !this.allowedRoles.some(role => role.toLowerCase() === args.options.role.toLowerCase())) {
211
- return `'${args.options.role}' is not a valid role. Allowed values are: ${this.allowedRoles.join(',')}`;
212
- }
213
- return true;
214
- });
215
- }, _EntraM365GroupUserSetCommand_initOptionSets = function _EntraM365GroupUserSetCommand_initOptionSets() {
216
- this.optionSets.push({ options: ['groupId', 'groupName', 'teamId', 'teamName'] });
217
- this.optionSets.push({ options: ['ids', 'userNames'] });
218
- }, _EntraM365GroupUserSetCommand_initTypes = function _EntraM365GroupUserSetCommand_initTypes() {
219
- this.types.string.push('ids', 'userNames', 'groupId', 'groupName', 'teamId', 'teamName', 'role');
220
- };
221
189
  export default new EntraM365GroupUserSetCommand();
222
190
  //# sourceMappingURL=m365group-user-set.js.map
@@ -53,22 +53,20 @@ class GraphSchemaExtensionListCommand extends GraphCommand {
53
53
  };
54
54
  try {
55
55
  const res = await request.get(requestOptions);
56
- if (res.value && res.value.length > 0) {
57
- const size = args.options.pageSize ? parseInt(args.options.pageSize) : parseInt(res.value.length);
58
- const result = res.value.slice(-size);
59
- if (args.options.output !== 'json' && result.length > 1) {
60
- await logger.log(result.map((x) => ({
61
- id: x.id,
62
- description: x.description,
63
- targetTypes: x.targetTypes,
64
- status: x.status,
65
- owner: x.owner,
66
- properties: JSON.stringify(x.properties)
67
- })));
68
- }
69
- else {
70
- await logger.log(result);
71
- }
56
+ const size = args.options.pageSize ? parseInt(args.options.pageSize) : res.value.length;
57
+ const result = res.value.slice(-size);
58
+ if (args.options.output !== 'json' && result.length > 1) {
59
+ await logger.log(result.map((x) => ({
60
+ id: x.id,
61
+ description: x.description,
62
+ targetTypes: x.targetTypes,
63
+ status: x.status,
64
+ owner: x.owner,
65
+ properties: JSON.stringify(x.properties)
66
+ })));
67
+ }
68
+ else {
69
+ await logger.log(result);
72
70
  }
73
71
  }
74
72
  catch (err) {