@pnp/cli-microsoft365 12.0.0-beta.feb621e → 12.1.0-beta.79db3d9

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 (309) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +19 -2
  4. package/dist/Command.js +11 -8
  5. package/dist/cli/cli.js +34 -18
  6. package/dist/config.js +2 -0
  7. package/dist/m365/cli/commands/cli-consent.js +9 -2
  8. package/dist/m365/entra/commands/agent/agent-blueprint-list.js +52 -0
  9. package/dist/m365/entra/commands/agent/agent-blueprintprincipal-list.js +56 -0
  10. package/dist/m365/entra/commands/m365group/m365group-add.js +52 -97
  11. package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +20 -33
  12. package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +20 -39
  13. package/dist/m365/entra/commands/m365group/m365group-get.js +20 -41
  14. package/dist/m365/entra/commands/m365group/m365group-list.js +11 -31
  15. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +8 -22
  16. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +9 -25
  17. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +21 -43
  18. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +21 -41
  19. package/dist/m365/entra/commands/m365group/m365group-remove.js +25 -46
  20. package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -32
  21. package/dist/m365/entra/commands/m365group/m365group-set.js +86 -141
  22. package/dist/m365/entra/commands/m365group/m365group-teamify.js +20 -43
  23. package/dist/m365/entra/commands/m365group/m365group-user-add.js +44 -77
  24. package/dist/m365/entra/commands/m365group/m365group-user-list.js +28 -55
  25. package/dist/m365/entra/commands/m365group/m365group-user-remove.js +37 -74
  26. package/dist/m365/entra/commands/m365group/m365group-user-set.js +45 -77
  27. package/dist/m365/entra/commands.js +2 -0
  28. package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +14 -16
  29. package/dist/m365/outlook/commands/calendargroup/calendargroup-add.js +97 -0
  30. package/dist/m365/outlook/commands/event/event-add.js +324 -0
  31. package/dist/m365/outlook/commands.js +2 -0
  32. package/dist/m365/spe/commands/container/container-activate.js +8 -16
  33. package/dist/m365/spe/commands/container/container-list.js +21 -42
  34. package/dist/m365/spe/commands/container/container-permission-add.js +114 -0
  35. package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
  36. package/dist/m365/spe/commands/container/container-permission-set.js +90 -0
  37. package/dist/m365/spe/commands/containertype/containertype-list.js +5 -0
  38. package/dist/m365/spe/commands.js +3 -0
  39. package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +16 -1
  40. package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.24.0-rc.0.js → doctor-1.24.0.js} +1 -1
  41. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.1.js +19 -0
  42. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  43. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027004_OVERRIDES_serialize_javascript.js +34 -0
  44. package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.24.0-rc.0.js → upgrade-1.24.0.js} +27 -27
  45. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.1.js +57 -0
  46. package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
  47. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +38 -71
  48. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +25 -59
  49. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +11 -34
  50. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +25 -54
  51. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +52 -83
  52. package/dist/m365/spo/commands/apppage/apppage-add.js +21 -39
  53. package/dist/m365/spo/commands/apppage/apppage-set.js +20 -30
  54. package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
  55. package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
  56. package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
  57. package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
  58. package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
  59. package/dist/m365/spo/commands/contenttype/contenttype-add.js +22 -51
  60. package/dist/m365/spo/commands/contenttype/contenttype-field-list.js +38 -62
  61. package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +25 -54
  62. package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +20 -43
  63. package/dist/m365/spo/commands/contenttype/contenttype-get.js +29 -54
  64. package/dist/m365/spo/commands/contenttype/contenttype-list.js +13 -30
  65. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +24 -39
  66. package/dist/m365/spo/commands/contenttype/contenttype-set.js +42 -63
  67. package/dist/m365/spo/commands/contenttype/contenttype-sync.js +37 -59
  68. package/dist/m365/spo/commands/contenttypehub/contenttypehub-get.js +5 -0
  69. package/dist/m365/spo/commands/customaction/customaction-add.js +124 -145
  70. package/dist/m365/spo/commands/customaction/customaction-clear.js +12 -43
  71. package/dist/m365/spo/commands/customaction/customaction-get.js +28 -59
  72. package/dist/m365/spo/commands/customaction/customaction-list.js +12 -42
  73. package/dist/m365/spo/commands/customaction/customaction-remove.js +26 -54
  74. package/dist/m365/spo/commands/customaction/customaction-set.js +75 -132
  75. package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +39 -65
  76. package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +28 -56
  77. package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +40 -68
  78. package/dist/m365/spo/commands/externaluser/externaluser-list.js +29 -80
  79. package/dist/m365/spo/commands/group/group-add.js +19 -60
  80. package/dist/m365/spo/commands/group/group-get.js +32 -45
  81. package/dist/m365/spo/commands/group/group-list.js +13 -27
  82. package/dist/m365/spo/commands/group/group-member-add.js +52 -84
  83. package/dist/m365/spo/commands/group/group-member-list.js +24 -38
  84. package/dist/m365/spo/commands/group/group-member-remove.js +49 -68
  85. package/dist/m365/spo/commands/group/group-remove.js +25 -45
  86. package/dist/m365/spo/commands/group/group-set.js +36 -79
  87. package/dist/m365/spo/commands/knowledgehub/knowledgehub-get.js +5 -0
  88. package/dist/m365/spo/commands/knowledgehub/knowledgehub-remove.js +8 -22
  89. package/dist/m365/spo/commands/knowledgehub/knowledgehub-set.js +10 -18
  90. package/dist/m365/spo/commands/listitem/listitem-add.js +27 -55
  91. package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +30 -58
  92. package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +27 -52
  93. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +26 -50
  94. package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +28 -55
  95. package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +30 -57
  96. package/dist/m365/spo/commands/listitem/listitem-batch-add.js +36 -58
  97. package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +68 -92
  98. package/dist/m365/spo/commands/listitem/listitem-batch-set.js +37 -57
  99. package/dist/m365/spo/commands/listitem/listitem-get.js +45 -68
  100. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +31 -55
  101. package/dist/m365/spo/commands/listitem/listitem-list.js +47 -81
  102. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +37 -60
  103. package/dist/m365/spo/commands/listitem/listitem-record-lock.js +30 -52
  104. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +31 -52
  105. package/dist/m365/spo/commands/listitem/listitem-record-unlock.js +30 -52
  106. package/dist/m365/spo/commands/listitem/listitem-remove.js +33 -61
  107. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +46 -67
  108. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +33 -56
  109. package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +55 -98
  110. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +48 -74
  111. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +33 -56
  112. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +31 -53
  113. package/dist/m365/spo/commands/listitem/listitem-set.js +33 -58
  114. package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
  115. package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
  116. package/dist/m365/spo/commands/navigation/navigation-node-list.js +1 -1
  117. package/dist/m365/spo/commands/navigation/navigation-node-remove.js +13 -47
  118. package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
  119. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +15 -49
  120. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +6 -1
  121. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +9 -17
  122. package/dist/m365/spo/commands/orgnewssite/orgnewssite-list.js +5 -0
  123. package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +11 -27
  124. package/dist/m365/spo/commands/orgnewssite/orgnewssite-set.js +10 -18
  125. package/dist/m365/spo/commands/page/page-column-list.js +7 -8
  126. package/dist/m365/spo/commands/page/page-section-list.js +15 -17
  127. package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
  128. package/dist/m365/spo/commands/propertybag/propertybag-get.js +14 -29
  129. package/dist/m365/spo/commands/propertybag/propertybag-list.js +13 -27
  130. package/dist/m365/spo/commands/propertybag/propertybag-remove.js +15 -32
  131. package/dist/m365/spo/commands/propertybag/propertybag-set.js +15 -31
  132. package/dist/m365/spo/commands/roledefinition/roledefinition-add.js +45 -44
  133. package/dist/m365/spo/commands/roledefinition/roledefinition-get.js +14 -25
  134. package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +12 -18
  135. package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +15 -35
  136. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-add.js +9 -17
  137. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +5 -0
  138. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-revoke.js +9 -17
  139. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +29 -39
  140. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-deny.js +10 -23
  141. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +5 -0
  142. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +19 -28
  143. package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +24 -59
  144. package/dist/m365/spo/commands/sitedesign/sitedesign-apply.js +10 -34
  145. package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +19 -36
  146. package/dist/m365/spo/commands/sitedesign/sitedesign-list.js +8 -0
  147. package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +9 -32
  148. package/dist/m365/spo/commands/sitedesign/sitedesign-rights-grant.js +10 -31
  149. package/dist/m365/spo/commands/sitedesign/sitedesign-rights-list.js +8 -23
  150. package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +10 -34
  151. package/dist/m365/spo/commands/sitedesign/sitedesign-run-list.js +9 -38
  152. package/dist/m365/spo/commands/sitedesign/sitedesign-run-status-get.js +9 -29
  153. package/dist/m365/spo/commands/sitedesign/sitedesign-set.js +27 -80
  154. package/dist/m365/spo/commands/sitedesign/sitedesign-task-get.js +8 -23
  155. package/dist/m365/spo/commands/sitedesign/sitedesign-task-list.js +8 -18
  156. package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +9 -32
  157. package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
  158. package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
  159. package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
  160. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
  161. package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
  162. package/dist/m365/spo/commands/spo-search.js +43 -116
  163. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +15 -46
  164. package/dist/m365/spo/commands/tenant/tenant-appcatalogurl-get.js +5 -0
  165. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +20 -57
  166. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +25 -49
  167. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +5 -1
  168. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +25 -49
  169. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +47 -79
  170. package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +23 -54
  171. package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +25 -50
  172. package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +5 -1
  173. package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +25 -49
  174. package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +41 -65
  175. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-list.js +5 -0
  176. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +10 -30
  177. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +8 -21
  178. package/dist/m365/spo/commands/tenant/tenant-settings-list.js +5 -0
  179. package/dist/m365/spo/commands/tenant/tenant-settings-set.js +104 -386
  180. package/dist/m365/spo/commands/term/term-add.js +95 -110
  181. package/dist/m365/spo/commands/term/term-get.js +63 -75
  182. package/dist/m365/spo/commands/term/term-group-add.js +11 -41
  183. package/dist/m365/spo/commands/term/term-group-get.js +16 -47
  184. package/dist/m365/spo/commands/term/term-group-list.js +16 -42
  185. package/dist/m365/spo/commands/term/term-list.js +42 -57
  186. package/dist/m365/spo/commands/term/term-set-add.js +50 -71
  187. package/dist/m365/spo/commands/term/term-set-get.js +41 -58
  188. package/dist/m365/spo/commands/term/term-set-list.js +22 -56
  189. package/dist/m365/spo/commands/theme/theme-apply.js +27 -43
  190. package/dist/m365/spo/commands/theme/theme-get.js +8 -15
  191. package/dist/m365/spo/commands/theme/theme-list.js +5 -0
  192. package/dist/m365/spo/commands/theme/theme-remove.js +9 -24
  193. package/dist/m365/spo/commands/theme/theme-set.js +12 -34
  194. package/dist/m365/spo/commands.js +1 -0
  195. package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
  196. package/dist/m365/spp/commands/model/model-get.js +25 -45
  197. package/dist/m365/spp/commands/model/model-list.js +12 -23
  198. package/dist/m365/spp/commands/model/model-remove.js +25 -45
  199. package/dist/m365/teams/commands/app/app-install.js +35 -44
  200. package/dist/m365/teams/commands/app/app-list.js +8 -33
  201. package/dist/m365/teams/commands/app/app-publish.js +21 -27
  202. package/dist/m365/teams/commands/app/app-remove.js +22 -39
  203. package/dist/m365/teams/commands/app/app-uninstall.js +12 -34
  204. package/dist/m365/teams/commands/app/app-update.js +35 -45
  205. package/dist/m365/teams/commands/funsettings/funsettings-list.js +12 -23
  206. package/dist/m365/teams/commands/funsettings/funsettings-set.js +18 -54
  207. package/dist/m365/teams/commands/guestsettings/guestsettings-list.js +12 -23
  208. package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +15 -40
  209. package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
  210. package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
  211. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
  212. package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
  213. package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
  214. package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
  215. package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
  216. package/dist/m365/teams/commands/membersettings/membersettings-list.js +12 -23
  217. package/dist/m365/teams/commands/membersettings/membersettings-set.js +18 -49
  218. package/dist/m365/teams/commands/message/message-get.js +19 -30
  219. package/dist/m365/teams/commands/message/message-list.js +26 -43
  220. package/dist/m365/teams/commands/message/message-remove.js +43 -58
  221. package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
  222. package/dist/m365/teams/commands/message/message-restore.js +40 -50
  223. package/dist/m365/teams/commands/message/message-send.js +19 -30
  224. package/dist/m365/teams/commands/messagingsettings/messagingsettings-list.js +12 -23
  225. package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +18 -60
  226. package/dist/m365/teams/commands/report/report-deviceusagedistributionusercounts.js +10 -0
  227. package/dist/m365/teams/commands/report/report-deviceusageusercounts.js +10 -0
  228. package/dist/m365/teams/commands/report/report-deviceusageuserdetail.js +22 -0
  229. package/dist/m365/teams/commands/report/report-directroutingcalls.js +19 -39
  230. package/dist/m365/teams/commands/report/report-pstncalls.js +19 -39
  231. package/dist/m365/teams/commands/report/report-useractivitycounts.js +10 -0
  232. package/dist/m365/teams/commands/report/report-useractivityusercounts.js +10 -0
  233. package/dist/m365/teams/commands/report/report-useractivityuserdetail.js +22 -0
  234. package/dist/m365/teams/commands/tab/tab-add.js +23 -49
  235. package/dist/m365/teams/commands/tab/tab-get.js +55 -56
  236. package/dist/m365/teams/commands/tab/tab-list.js +17 -28
  237. package/dist/m365/teams/commands/tab/tab-remove.js +23 -42
  238. package/dist/m365/teams/commands/team/team-add.js +76 -114
  239. package/dist/m365/teams/commands/team/team-app-list.js +23 -36
  240. package/dist/m365/teams/commands/team/team-archive.js +24 -39
  241. package/dist/m365/teams/commands/team/team-clone.js +28 -62
  242. package/dist/m365/teams/commands/team/team-get.js +23 -36
  243. package/dist/m365/teams/commands/team/team-list.js +43 -57
  244. package/dist/m365/teams/commands/team/team-remove.js +24 -37
  245. package/dist/m365/teams/commands/team/team-set.js +23 -52
  246. package/dist/m365/teams/commands/team/team-unarchive.js +23 -28
  247. package/dist/m365/teams/commands/user/user-app-add.js +40 -49
  248. package/dist/m365/teams/commands/user/user-app-list.js +26 -39
  249. package/dist/m365/teams/commands/user/user-app-remove.js +37 -49
  250. package/dist/m365/teams/commands/user/user-app-upgrade.js +36 -52
  251. package/dist/m365/teams/commands/user/user-list.js +17 -39
  252. package/dist/m365/tenant/commands/id/id-get.js +8 -22
  253. package/dist/m365/tenant/commands/info/info-get.js +23 -36
  254. package/dist/m365/tenant/commands/people/people-profilecardproperty-add.js +67 -55
  255. package/dist/m365/tenant/commands/people/people-profilecardproperty-get.js +11 -24
  256. package/dist/m365/tenant/commands/people/people-profilecardproperty-list.js +5 -0
  257. package/dist/m365/tenant/commands/people/people-profilecardproperty-remove.js +12 -33
  258. package/dist/m365/tenant/commands/people/people-profilecardproperty-set.js +31 -51
  259. package/dist/m365/tenant/commands/people/people-pronouns-get.js +5 -0
  260. package/dist/m365/tenant/commands/people/profileCardProperties.js +10 -7
  261. package/dist/m365/tenant/commands/report/report-activeusercounts.js +2 -1
  262. package/dist/m365/tenant/commands/report/report-activeuserdetail.js +2 -1
  263. package/dist/m365/tenant/commands/report/report-office365activationcounts.js +9 -0
  264. package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +9 -0
  265. package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +9 -0
  266. package/dist/m365/tenant/commands/report/report-servicesusercounts.js +2 -1
  267. package/dist/m365/tenant/commands/report/report-settings-get.js +5 -0
  268. package/dist/m365/tenant/commands/security/security-alerts-list.js +8 -20
  269. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +9 -20
  270. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +8 -20
  271. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +8 -15
  272. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +8 -15
  273. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +12 -26
  274. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +8 -22
  275. package/dist/utils/calendar.js +1 -1
  276. package/dist/utils/formatting.js +16 -0
  277. package/dist/utils/pid.js +7 -16
  278. package/dist/utils/spe.js +1 -1
  279. package/dist/utils/spo.js +39 -0
  280. package/dist/utils/validation.js +36 -0
  281. package/dist/utils/zod.js +18 -7
  282. package/docs/docs/cmd/entra/agent/agent-blueprint-list.mdx +175 -0
  283. package/docs/docs/cmd/entra/agent/agent-blueprintprincipal-list.mdx +156 -0
  284. package/docs/docs/cmd/login.mdx +15 -2
  285. package/docs/docs/cmd/outlook/calendargroup/calendargroup-add.mdx +126 -0
  286. package/docs/docs/cmd/outlook/event/event-add.mdx +390 -0
  287. package/docs/docs/cmd/spe/container/container-add.mdx +0 -8
  288. package/docs/docs/cmd/spe/container/container-list.mdx +0 -8
  289. package/docs/docs/cmd/spe/container/container-permission-add.mdx +140 -0
  290. package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
  291. package/docs/docs/cmd/spe/container/container-permission-set.mdx +78 -0
  292. package/docs/docs/cmd/spe/container/container-recyclebinitem-list.mdx +0 -8
  293. package/docs/docs/cmd/spe/container/container-recyclebinitem-restore.mdx +0 -8
  294. package/docs/docs/cmd/spe/container/container-remove.mdx +0 -8
  295. package/docs/docs/cmd/spe/containertype/containertype-add.mdx +1 -1
  296. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  297. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +1 -1
  298. package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +17 -30
  299. package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
  300. package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
  301. package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
  302. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +0 -21
  303. package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
  304. package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
  305. package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
  306. package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
  307. package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
  308. package/npm-shrinkwrap.json +2 -2
  309. package/package.json +3 -1
@@ -1,15 +1,42 @@
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 _SpoGroupMemberAddCommand_instances, _SpoGroupMemberAddCommand_initTelemetry, _SpoGroupMemberAddCommand_initOptions, _SpoGroupMemberAddCommand_initValidators, _SpoGroupMemberAddCommand_initOptionSets, _SpoGroupMemberAddCommand_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
6
  import { validation } from '../../../../utils/validation.js';
11
7
  import SpoCommand from '../../../base/SpoCommand.js';
12
8
  import commands from '../../commands.js';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ webUrl: z.string()
12
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
13
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
14
+ })
15
+ .alias('u'),
16
+ groupId: z.coerce.number().int().positive().optional(),
17
+ groupName: z.string().optional(),
18
+ userNames: z.string()
19
+ .refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
20
+ error: e => `Option 'userNames' contains one or more invalid UPNs: ${validation.isValidUserPrincipalNameArray(e.input)}.`
21
+ })
22
+ .optional(),
23
+ emails: z.string()
24
+ .refine(emails => validation.isValidUserPrincipalNameArray(emails) === true, {
25
+ error: e => `Option 'emails' contains one or more invalid UPNs: ${validation.isValidUserPrincipalNameArray(e.input)}.`
26
+ })
27
+ .optional(),
28
+ userIds: z.string()
29
+ .refine(ids => validation.isValidPositiveIntegerArray(ids) === true, {
30
+ error: e => `Option 'userIds' contains one or more invalid numbers: ${validation.isValidPositiveIntegerArray(e.input)}.`
31
+ })
32
+ .optional(),
33
+ entraGroupIds: z.string()
34
+ .refine(ids => validation.isValidGuidArray(ids) === true, {
35
+ error: e => `Option 'entraGroupIds' contains one or more invalid GUIDs: ${validation.isValidGuidArray(e.input)}.`
36
+ })
37
+ .optional(),
38
+ entraGroupNames: z.string().optional()
39
+ });
13
40
  class SpoGroupMemberAddCommand extends SpoCommand {
14
41
  get name() {
15
42
  return commands.GROUP_MEMBER_ADD;
@@ -17,14 +44,25 @@ class SpoGroupMemberAddCommand extends SpoCommand {
17
44
  get description() {
18
45
  return 'Adds members to a SharePoint Group';
19
46
  }
20
- constructor() {
21
- super();
22
- _SpoGroupMemberAddCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _SpoGroupMemberAddCommand_instances, "m", _SpoGroupMemberAddCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _SpoGroupMemberAddCommand_instances, "m", _SpoGroupMemberAddCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _SpoGroupMemberAddCommand_instances, "m", _SpoGroupMemberAddCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _SpoGroupMemberAddCommand_instances, "m", _SpoGroupMemberAddCommand_initOptionSets).call(this);
27
- __classPrivateFieldGet(this, _SpoGroupMemberAddCommand_instances, "m", _SpoGroupMemberAddCommand_initTypes).call(this);
47
+ get schema() {
48
+ return options;
49
+ }
50
+ getRefinedSchema(schema) {
51
+ return schema
52
+ .refine(o => [o.groupId, o.groupName].filter(x => x !== undefined).length === 1, {
53
+ error: `Specify either 'groupId' or 'groupName', but not both.`,
54
+ params: {
55
+ customCode: 'optionSet',
56
+ options: ['groupId', 'groupName']
57
+ }
58
+ })
59
+ .refine(o => [o.userNames, o.emails, o.userIds, o.entraGroupIds, o.entraGroupNames].filter(x => x !== undefined).length === 1, {
60
+ error: `Specify either 'userNames', 'emails', 'userIds', 'entraGroupIds', or 'entraGroupNames', but not multiple.`,
61
+ params: {
62
+ customCode: 'optionSet',
63
+ options: ['userNames', 'emails', 'userIds', 'entraGroupIds', 'entraGroupNames']
64
+ }
65
+ });
28
66
  }
29
67
  async commandAction(logger, args) {
30
68
  try {
@@ -112,75 +150,5 @@ class SpoGroupMemberAddCommand extends SpoCommand {
112
150
  return user.LoginName;
113
151
  }
114
152
  }
115
- _SpoGroupMemberAddCommand_instances = new WeakSet(), _SpoGroupMemberAddCommand_initTelemetry = function _SpoGroupMemberAddCommand_initTelemetry() {
116
- this.telemetry.push((args) => {
117
- Object.assign(this.telemetryProperties, {
118
- groupId: typeof args.options.groupId !== 'undefined',
119
- groupName: typeof args.options.groupName !== 'undefined',
120
- userNames: typeof args.options.userNames !== 'undefined',
121
- emails: typeof args.options.emails !== 'undefined',
122
- userIds: typeof args.options.userIds !== 'undefined',
123
- entraGroupIds: typeof args.options.entraGroupIds !== 'undefined',
124
- entraGroupNames: typeof args.options.entraGroupNames !== 'undefined'
125
- });
126
- });
127
- }, _SpoGroupMemberAddCommand_initOptions = function _SpoGroupMemberAddCommand_initOptions() {
128
- this.options.unshift({
129
- option: '-u, --webUrl <webUrl>'
130
- }, {
131
- option: '--groupId [groupId]'
132
- }, {
133
- option: '--groupName [groupName]'
134
- }, {
135
- option: '--userNames [userNames]'
136
- }, {
137
- option: '--emails [emails]'
138
- }, {
139
- option: '--userIds [userIds]'
140
- }, {
141
- option: '--entraGroupIds [entraGroupIds]'
142
- }, {
143
- option: '--entraGroupNames [entraGroupNames]'
144
- });
145
- }, _SpoGroupMemberAddCommand_initValidators = function _SpoGroupMemberAddCommand_initValidators() {
146
- this.validators.push(async (args) => {
147
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
148
- if (isValidSharePointUrl !== true) {
149
- return isValidSharePointUrl;
150
- }
151
- if (args.options.groupId && !validation.isValidPositiveInteger(args.options.groupId)) {
152
- return `Specified groupId ${args.options.groupId} is not a positive number.`;
153
- }
154
- if (args.options.userIds) {
155
- const isValidArray = validation.isValidPositiveIntegerArray(args.options.userIds);
156
- if (isValidArray !== true) {
157
- return `Option 'userIds' contains one or more invalid numbers: ${isValidArray}.`;
158
- }
159
- }
160
- if (args.options.userNames) {
161
- const isValidArray = validation.isValidUserPrincipalNameArray(args.options.userNames);
162
- if (isValidArray !== true) {
163
- return `Option 'userNames' contains one or more invalid UPNs: ${isValidArray}.`;
164
- }
165
- }
166
- if (args.options.emails) {
167
- const isValidArray = validation.isValidUserPrincipalNameArray(args.options.emails);
168
- if (isValidArray !== true) {
169
- return `Option 'emails' contains one or more invalid UPNs: ${isValidArray}.`;
170
- }
171
- }
172
- if (args.options.entraGroupIds) {
173
- const isValidArray = validation.isValidGuidArray(args.options.entraGroupIds);
174
- if (isValidArray !== true) {
175
- return `Option 'entraGroupIds' contains one or more invalid GUIDs: ${isValidArray}.`;
176
- }
177
- }
178
- return true;
179
- });
180
- }, _SpoGroupMemberAddCommand_initOptionSets = function _SpoGroupMemberAddCommand_initOptionSets() {
181
- this.optionSets.push({ options: ['groupId', 'groupName'] }, { options: ['userNames', 'emails', 'userIds', 'entraGroupIds', 'entraGroupNames'] });
182
- }, _SpoGroupMemberAddCommand_initTypes = function _SpoGroupMemberAddCommand_initTypes() {
183
- this.types.string.push('webUrl', 'groupName', 'userNames', 'emails', 'userIds', 'entraGroupIds', 'entraGroupNames');
184
- };
185
153
  export default new SpoGroupMemberAddCommand();
186
154
  //# sourceMappingURL=group-member-add.js.map
@@ -1,14 +1,20 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _SpoGroupMemberListCommand_instances, _SpoGroupMemberListCommand_initTelemetry, _SpoGroupMemberListCommand_initOptions, _SpoGroupMemberListCommand_initValidators, _SpoGroupMemberListCommand_initOptionSets;
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 { validation } from '../../../../utils/validation.js';
10
6
  import SpoCommand from '../../../base/SpoCommand.js';
11
7
  import commands from '../../commands.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ webUrl: z.string()
11
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
12
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
13
+ })
14
+ .alias('u'),
15
+ groupId: z.coerce.number().int().positive().optional(),
16
+ groupName: z.string().optional()
17
+ });
12
18
  class SpoGroupMemberListCommand extends SpoCommand {
13
19
  get name() {
14
20
  return commands.GROUP_MEMBER_LIST;
@@ -19,13 +25,18 @@ class SpoGroupMemberListCommand extends SpoCommand {
19
25
  defaultProperties() {
20
26
  return ['Title', 'UserPrincipalName', 'Id', 'Email'];
21
27
  }
22
- constructor() {
23
- super();
24
- _SpoGroupMemberListCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _SpoGroupMemberListCommand_instances, "m", _SpoGroupMemberListCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _SpoGroupMemberListCommand_instances, "m", _SpoGroupMemberListCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _SpoGroupMemberListCommand_instances, "m", _SpoGroupMemberListCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _SpoGroupMemberListCommand_instances, "m", _SpoGroupMemberListCommand_initOptionSets).call(this);
28
+ get schema() {
29
+ return options;
30
+ }
31
+ getRefinedSchema(schema) {
32
+ return schema
33
+ .refine(o => [o.groupId, o.groupName].filter(x => x !== undefined).length === 1, {
34
+ error: `Specify either 'groupId' or 'groupName', but not both.`,
35
+ params: {
36
+ customCode: 'optionSet',
37
+ options: ['groupId', 'groupName']
38
+ }
39
+ });
29
40
  }
30
41
  async commandAction(logger, args) {
31
42
  if (this.verbose) {
@@ -43,30 +54,5 @@ class SpoGroupMemberListCommand extends SpoCommand {
43
54
  }
44
55
  }
45
56
  }
46
- _SpoGroupMemberListCommand_instances = new WeakSet(), _SpoGroupMemberListCommand_initTelemetry = function _SpoGroupMemberListCommand_initTelemetry() {
47
- this.telemetry.push((args) => {
48
- Object.assign(this.telemetryProperties, {
49
- groupId: typeof args.options.groupId !== 'undefined',
50
- groupName: typeof args.options.groupName !== 'undefined'
51
- });
52
- });
53
- }, _SpoGroupMemberListCommand_initOptions = function _SpoGroupMemberListCommand_initOptions() {
54
- this.options.unshift({
55
- option: '-u, --webUrl <webUrl>'
56
- }, {
57
- option: '--groupId [groupId]'
58
- }, {
59
- option: '--groupName [groupName]'
60
- });
61
- }, _SpoGroupMemberListCommand_initValidators = function _SpoGroupMemberListCommand_initValidators() {
62
- this.validators.push(async (args) => {
63
- if (args.options.groupId && isNaN(args.options.groupId)) {
64
- return `Specified "groupId" ${args.options.groupId} is not valid`;
65
- }
66
- return validation.isValidSharePointUrl(args.options.webUrl);
67
- });
68
- }, _SpoGroupMemberListCommand_initOptionSets = function _SpoGroupMemberListCommand_initOptionSets() {
69
- this.optionSets.push({ options: ['groupName', 'groupId'] });
70
- };
71
57
  export default new SpoGroupMemberListCommand();
72
58
  //# sourceMappingURL=group-member-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 _SpoGroupMemberRemoveCommand_instances, _SpoGroupMemberRemoveCommand_initTelemetry, _SpoGroupMemberRemoveCommand_initOptions, _SpoGroupMemberRemoveCommand_initValidators, _SpoGroupMemberRemoveCommand_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
6
  import { validation } from '../../../../utils/validation.js';
@@ -12,6 +8,34 @@ import entraUserGetCommand from '../../../entra/commands/user/user-get.js';
12
8
  import SpoCommand from '../../../base/SpoCommand.js';
13
9
  import commands from '../../commands.js';
14
10
  import SpoGroupMemberListCommand from './group-member-list.js';
11
+ export const options = z.strictObject({
12
+ ...globalOptionsZod.shape,
13
+ webUrl: z.string()
14
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
15
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
16
+ })
17
+ .alias('u'),
18
+ groupId: z.coerce.number().int().positive().optional(),
19
+ groupName: z.string().optional(),
20
+ userName: z.string()
21
+ .refine(userName => validation.isValidUserPrincipalName(userName), {
22
+ error: e => `'${e.input}' is not a valid userName.`
23
+ })
24
+ .optional(),
25
+ email: z.string()
26
+ .refine(email => validation.isValidUserPrincipalName(email), {
27
+ error: e => `'${e.input}' is not a valid email.`
28
+ })
29
+ .optional(),
30
+ userId: z.number().optional(),
31
+ entraGroupId: z.string()
32
+ .refine(id => validation.isValidGuid(id), {
33
+ error: e => `'${e.input}' is not a valid GUID.`
34
+ })
35
+ .optional(),
36
+ entraGroupName: z.string().optional(),
37
+ force: z.boolean().optional().alias('f')
38
+ });
15
39
  class SpoGroupMemberRemoveCommand extends SpoCommand {
16
40
  get name() {
17
41
  return commands.GROUP_MEMBER_REMOVE;
@@ -19,13 +43,25 @@ class SpoGroupMemberRemoveCommand extends SpoCommand {
19
43
  get description() {
20
44
  return 'Removes the specified member from a SharePoint group';
21
45
  }
22
- constructor() {
23
- super();
24
- _SpoGroupMemberRemoveCommand_instances.add(this);
25
- __classPrivateFieldGet(this, _SpoGroupMemberRemoveCommand_instances, "m", _SpoGroupMemberRemoveCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _SpoGroupMemberRemoveCommand_instances, "m", _SpoGroupMemberRemoveCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _SpoGroupMemberRemoveCommand_instances, "m", _SpoGroupMemberRemoveCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _SpoGroupMemberRemoveCommand_instances, "m", _SpoGroupMemberRemoveCommand_initOptionSets).call(this);
46
+ get schema() {
47
+ return options;
48
+ }
49
+ getRefinedSchema(schema) {
50
+ return schema
51
+ .refine(o => [o.groupId, o.groupName].filter(x => x !== undefined).length === 1, {
52
+ error: `Specify either 'groupId' or 'groupName', but not both.`,
53
+ params: {
54
+ customCode: 'optionSet',
55
+ options: ['groupId', 'groupName']
56
+ }
57
+ })
58
+ .refine(o => [o.userName, o.email, o.userId, o.entraGroupId, o.entraGroupName].filter(x => x !== undefined).length === 1, {
59
+ error: `Specify either 'userName', 'email', 'userId', 'entraGroupId', or 'entraGroupName', but not multiple.`,
60
+ params: {
61
+ customCode: 'optionSet',
62
+ options: ['userName', 'email', 'userId', 'entraGroupId', 'entraGroupName']
63
+ }
64
+ });
29
65
  }
30
66
  async getUserName(logger, args) {
31
67
  if (args.options.userName) {
@@ -119,60 +155,5 @@ class SpoGroupMemberRemoveCommand extends SpoCommand {
119
155
  return foundGroups[0].Id;
120
156
  }
121
157
  }
122
- _SpoGroupMemberRemoveCommand_instances = new WeakSet(), _SpoGroupMemberRemoveCommand_initTelemetry = function _SpoGroupMemberRemoveCommand_initTelemetry() {
123
- this.telemetry.push((args) => {
124
- Object.assign(this.telemetryProperties, {
125
- groupId: (!(!args.options.groupId)).toString(),
126
- groupName: (!(!args.options.groupName)).toString(),
127
- userName: (!(!args.options.userName)).toString(),
128
- email: (!(!args.options.email)).toString(),
129
- userId: (!(!args.options.userId)).toString(),
130
- entraGroupId: (!(!args.options.entraGroupId)).toString(),
131
- entraGroupName: (!(!args.options.entraGroupName)).toString(),
132
- force: (!(!args.options.force)).toString()
133
- });
134
- });
135
- }, _SpoGroupMemberRemoveCommand_initOptions = function _SpoGroupMemberRemoveCommand_initOptions() {
136
- this.options.unshift({
137
- option: '-u, --webUrl <webUrl>'
138
- }, {
139
- option: '--groupId [groupId]'
140
- }, {
141
- option: '--groupName [groupName]'
142
- }, {
143
- option: '--userName [userName]'
144
- }, {
145
- option: '--email [email]'
146
- }, {
147
- option: '--userId [userId]'
148
- }, {
149
- option: '--entraGroupId [entraGroupId]'
150
- }, {
151
- option: '--entraGroupName [entraGroupName]'
152
- }, {
153
- option: '-f, --force'
154
- });
155
- }, _SpoGroupMemberRemoveCommand_initValidators = function _SpoGroupMemberRemoveCommand_initValidators() {
156
- this.validators.push(async (args) => {
157
- if (args.options.groupId && isNaN(args.options.groupId)) {
158
- return `Specified "groupId" ${args.options.groupId} is not valid`;
159
- }
160
- if (args.options.userId && isNaN(args.options.userId)) {
161
- return `Specified "userId" ${args.options.userId} is not valid`;
162
- }
163
- if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
164
- return `${args.options.userName} is not a valid userName`;
165
- }
166
- if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
167
- return `${args.options.email} is not a valid email`;
168
- }
169
- if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
170
- return `${args.options.entraGroupId} is not a valid GUID`;
171
- }
172
- return validation.isValidSharePointUrl(args.options.webUrl);
173
- });
174
- }, _SpoGroupMemberRemoveCommand_initOptionSets = function _SpoGroupMemberRemoveCommand_initOptionSets() {
175
- this.optionSets.push({ options: ['groupName', 'groupId'] }, { options: ['userName', 'email', 'userId', 'entraGroupId', 'entraGroupName'] });
176
- };
177
158
  export default new SpoGroupMemberRemoveCommand();
178
159
  //# sourceMappingURL=group-member-remove.js.map
@@ -1,14 +1,21 @@
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 _SpoGroupRemoveCommand_instances, _SpoGroupRemoveCommand_initTelemetry, _SpoGroupRemoveCommand_initOptions, _SpoGroupRemoveCommand_initValidators, _SpoGroupRemoveCommand_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 { validation } from '../../../../utils/validation.js';
10
6
  import SpoCommand from '../../../base/SpoCommand.js';
11
7
  import commands from '../../commands.js';
8
+ export const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ webUrl: z.string()
11
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
12
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
13
+ })
14
+ .alias('u'),
15
+ id: z.number().optional(),
16
+ name: z.string().optional(),
17
+ force: z.boolean().optional().alias('f')
18
+ });
12
19
  class SpoGroupRemoveCommand extends SpoCommand {
13
20
  get name() {
14
21
  return commands.GROUP_REMOVE;
@@ -16,13 +23,18 @@ class SpoGroupRemoveCommand extends SpoCommand {
16
23
  get description() {
17
24
  return 'Removes group from specific web';
18
25
  }
19
- constructor() {
20
- super();
21
- _SpoGroupRemoveCommand_instances.add(this);
22
- __classPrivateFieldGet(this, _SpoGroupRemoveCommand_instances, "m", _SpoGroupRemoveCommand_initTelemetry).call(this);
23
- __classPrivateFieldGet(this, _SpoGroupRemoveCommand_instances, "m", _SpoGroupRemoveCommand_initOptions).call(this);
24
- __classPrivateFieldGet(this, _SpoGroupRemoveCommand_instances, "m", _SpoGroupRemoveCommand_initValidators).call(this);
25
- __classPrivateFieldGet(this, _SpoGroupRemoveCommand_instances, "m", _SpoGroupRemoveCommand_initOptionSets).call(this);
26
+ get schema() {
27
+ return options;
28
+ }
29
+ getRefinedSchema(schema) {
30
+ return schema
31
+ .refine(o => [o.id, o.name].filter(x => x !== undefined).length === 1, {
32
+ error: `Specify either 'id' or 'name', but not both.`,
33
+ params: {
34
+ customCode: 'optionSet',
35
+ options: ['id', 'name']
36
+ }
37
+ });
26
38
  }
27
39
  async commandAction(logger, args) {
28
40
  const removeGroup = async () => {
@@ -73,37 +85,5 @@ class SpoGroupRemoveCommand extends SpoCommand {
73
85
  }
74
86
  }
75
87
  }
76
- _SpoGroupRemoveCommand_instances = new WeakSet(), _SpoGroupRemoveCommand_initTelemetry = function _SpoGroupRemoveCommand_initTelemetry() {
77
- this.telemetry.push((args) => {
78
- Object.assign(this.telemetryProperties, {
79
- id: (!(!args.options.id)).toString(),
80
- name: (!(!args.options.name)).toString(),
81
- force: (!(!args.options.force)).toString()
82
- });
83
- });
84
- }, _SpoGroupRemoveCommand_initOptions = function _SpoGroupRemoveCommand_initOptions() {
85
- this.options.unshift({
86
- option: '-u, --webUrl <webUrl>'
87
- }, {
88
- option: '--id [id]'
89
- }, {
90
- option: '--name [name]'
91
- }, {
92
- option: '-f, --force'
93
- });
94
- }, _SpoGroupRemoveCommand_initValidators = function _SpoGroupRemoveCommand_initValidators() {
95
- this.validators.push(async (args) => {
96
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
97
- if (isValidSharePointUrl !== true) {
98
- return isValidSharePointUrl;
99
- }
100
- if (args.options.id && typeof args.options.id !== 'number') {
101
- return `${args.options.id} is not a number`;
102
- }
103
- return true;
104
- });
105
- }, _SpoGroupRemoveCommand_initOptionSets = function _SpoGroupRemoveCommand_initOptionSets() {
106
- this.optionSets.push({ options: ['id', 'name'] });
107
- };
108
88
  export default new SpoGroupRemoveCommand();
109
89
  //# sourceMappingURL=group-remove.js.map
@@ -1,15 +1,30 @@
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 _SpoGroupSetCommand_instances, _SpoGroupSetCommand_initTelemetry, _SpoGroupSetCommand_initOptions, _SpoGroupSetCommand_initTypes, _SpoGroupSetCommand_initValidators, _SpoGroupSetCommand_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 { validation } from '../../../../utils/validation.js';
10
6
  import entraUserGetCommand from '../../../entra/commands/user/user-get.js';
11
7
  import SpoCommand from '../../../base/SpoCommand.js';
12
8
  import commands from '../../commands.js';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ webUrl: z.string()
12
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
13
+ error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
14
+ })
15
+ .alias('u'),
16
+ id: z.coerce.number().int().positive().optional().alias('i'),
17
+ name: z.string().optional().alias('n'),
18
+ newName: z.string().optional(),
19
+ description: z.string().optional(),
20
+ allowMembersEditMembership: z.boolean().optional(),
21
+ onlyAllowMembersViewMembership: z.boolean().optional(),
22
+ allowRequestToJoinLeave: z.boolean().optional(),
23
+ autoAcceptRequestToJoinLeave: z.boolean().optional(),
24
+ requestToJoinLeaveEmailSetting: z.string().optional(),
25
+ ownerEmail: z.string().optional(),
26
+ ownerUserName: z.string().optional()
27
+ });
13
28
  class SpoGroupSetCommand extends SpoCommand {
14
29
  get name() {
15
30
  return commands.GROUP_SET;
@@ -17,14 +32,21 @@ class SpoGroupSetCommand extends SpoCommand {
17
32
  get description() {
18
33
  return 'Updates a group in the specified site';
19
34
  }
20
- constructor() {
21
- super();
22
- _SpoGroupSetCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _SpoGroupSetCommand_instances, "m", _SpoGroupSetCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _SpoGroupSetCommand_instances, "m", _SpoGroupSetCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _SpoGroupSetCommand_instances, "m", _SpoGroupSetCommand_initTypes).call(this);
26
- __classPrivateFieldGet(this, _SpoGroupSetCommand_instances, "m", _SpoGroupSetCommand_initValidators).call(this);
27
- __classPrivateFieldGet(this, _SpoGroupSetCommand_instances, "m", _SpoGroupSetCommand_initOptionSets).call(this);
35
+ get schema() {
36
+ return options;
37
+ }
38
+ getRefinedSchema(schema) {
39
+ return schema
40
+ .refine(o => [o.id, o.name].filter(x => x !== undefined).length === 1, {
41
+ error: `Specify either 'id' or 'name', but not both.`,
42
+ params: {
43
+ customCode: 'optionSet',
44
+ options: ['id', 'name']
45
+ }
46
+ })
47
+ .refine(o => [o.ownerEmail, o.ownerUserName].filter(x => x !== undefined).length <= 1, {
48
+ error: `Specify either 'ownerEmail' or 'ownerUserName', but not both.`
49
+ });
28
50
  }
29
51
  async commandAction(logger, args) {
30
52
  if (this.verbose) {
@@ -91,70 +113,5 @@ class SpoGroupSetCommand extends SpoCommand {
91
113
  return response.Id;
92
114
  }
93
115
  }
94
- _SpoGroupSetCommand_instances = new WeakSet(), _SpoGroupSetCommand_initTelemetry = function _SpoGroupSetCommand_initTelemetry() {
95
- this.telemetry.push((args) => {
96
- Object.assign(this.telemetryProperties, {
97
- id: typeof args.options.id !== 'undefined',
98
- name: typeof args.options.name !== 'undefined',
99
- newName: typeof args.options.newName !== 'undefined',
100
- description: typeof args.options.description !== 'undefined',
101
- allowMembersEditMembership: args.options.allowMembersEditMembership,
102
- onlyAllowMembersViewMembership: args.options.onlyAllowMembersViewMembership,
103
- allowRequestToJoinLeave: args.options.allowRequestToJoinLeave,
104
- autoAcceptRequestToJoinLeave: args.options.autoAcceptRequestToJoinLeave,
105
- requestToJoinLeaveEmailSetting: typeof args.options.requestToJoinLeaveEmailSetting !== 'undefined',
106
- ownerEmail: typeof args.options.ownerEmail !== 'undefined',
107
- ownerUserName: typeof args.options.ownerUserName !== 'undefined'
108
- });
109
- });
110
- }, _SpoGroupSetCommand_initOptions = function _SpoGroupSetCommand_initOptions() {
111
- this.options.unshift({
112
- option: '-u, --webUrl <webUrl>'
113
- }, {
114
- option: '-i, --id [id]'
115
- }, {
116
- option: '-n, --name [name]'
117
- }, {
118
- option: '--newName [newName]'
119
- }, {
120
- option: '--description [description]'
121
- }, {
122
- option: '--allowMembersEditMembership [allowMembersEditMembership]',
123
- autocomplete: ['true', 'false']
124
- }, {
125
- option: '--onlyAllowMembersViewMembership [onlyAllowMembersViewMembership]',
126
- autocomplete: ['true', 'false']
127
- }, {
128
- option: '--allowRequestToJoinLeave [allowRequestToJoinLeave]',
129
- autocomplete: ['true', 'false']
130
- }, {
131
- option: '--autoAcceptRequestToJoinLeave [autoAcceptRequestToJoinLeave]',
132
- autocomplete: ['true', 'false']
133
- }, {
134
- option: '--requestToJoinLeaveEmailSetting [requestToJoinLeaveEmailSetting]'
135
- }, {
136
- option: '--ownerEmail [ownerEmail]'
137
- }, {
138
- option: '--ownerUserName [ownerUserName]'
139
- });
140
- }, _SpoGroupSetCommand_initTypes = function _SpoGroupSetCommand_initTypes() {
141
- this.types.boolean.push('allowMembersEditMembership', 'onlyAllowMembersViewMembership', 'allowRequestToJoinLeave', 'autoAcceptRequestToJoinLeave');
142
- }, _SpoGroupSetCommand_initValidators = function _SpoGroupSetCommand_initValidators() {
143
- this.validators.push(async (args) => {
144
- const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
145
- if (isValidSharePointUrl !== true) {
146
- return isValidSharePointUrl;
147
- }
148
- if (args.options.id && isNaN(args.options.id)) {
149
- return `Specified id ${args.options.id} is not a number`;
150
- }
151
- if (args.options.ownerEmail && args.options.ownerUserName) {
152
- return 'Specify either ownerEmail or ownerUserName but not both';
153
- }
154
- return true;
155
- });
156
- }, _SpoGroupSetCommand_initOptionSets = function _SpoGroupSetCommand_initOptionSets() {
157
- this.optionSets.push({ options: ['id', 'name'] });
158
- };
159
116
  export default new SpoGroupSetCommand();
160
117
  //# sourceMappingURL=group-set.js.map
@@ -1,8 +1,10 @@
1
+ import { globalOptionsZod } from '../../../../Command.js';
1
2
  import config from '../../../../config.js';
2
3
  import request from '../../../../request.js';
3
4
  import { spo } from '../../../../utils/spo.js';
4
5
  import SpoCommand from '../../../base/SpoCommand.js';
5
6
  import commands from '../../commands.js';
7
+ export const options = globalOptionsZod.strict();
6
8
  class SpoKnowledgehubGetCommand extends SpoCommand {
7
9
  get name() {
8
10
  return commands.KNOWLEDGEHUB_GET;
@@ -10,6 +12,9 @@ class SpoKnowledgehubGetCommand extends SpoCommand {
10
12
  get description() {
11
13
  return 'Gets the Knowledge Hub Site URL for your tenant';
12
14
  }
15
+ get schema() {
16
+ return options;
17
+ }
13
18
  async commandAction(logger) {
14
19
  try {
15
20
  const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);