@pnp/cli-microsoft365 6.0.0-beta.c377306 → 6.0.0-beta.c5b75e1

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 (587) hide show
  1. package/dist/Auth.js +3 -3
  2. package/dist/Command.js +56 -43
  3. package/dist/api.js +3 -3
  4. package/dist/cli/Cli.js +36 -28
  5. package/dist/index.js +2 -2
  6. package/dist/m365/aad/commands/app/app-add.js +34 -33
  7. package/dist/m365/aad/commands/app/app-get.js +15 -12
  8. package/dist/m365/aad/commands/app/app-remove.js +37 -38
  9. package/dist/m365/aad/commands/app/app-role-add.js +29 -26
  10. package/dist/m365/aad/commands/app/app-role-list.js +21 -9
  11. package/dist/m365/aad/commands/app/app-role-remove.js +25 -24
  12. package/dist/m365/aad/commands/app/app-set.js +12 -7
  13. package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +92 -96
  14. package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +41 -41
  15. package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +93 -95
  16. package/dist/m365/aad/commands/group/group-list.js +36 -24
  17. package/dist/m365/aad/commands/groupsetting/groupsetting-add.js +35 -34
  18. package/dist/m365/aad/commands/groupsetting/groupsetting-get.js +19 -16
  19. package/dist/m365/aad/commands/groupsetting/groupsetting-list.js +20 -8
  20. package/dist/m365/aad/commands/groupsetting/groupsetting-remove.js +33 -32
  21. package/dist/m365/aad/commands/groupsetting/groupsetting-set.js +35 -32
  22. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +17 -15
  23. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-list.js +20 -8
  24. package/dist/m365/aad/commands/o365group/o365group-add.js +87 -98
  25. package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +13 -9
  26. package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +14 -12
  27. package/dist/m365/aad/commands/o365group/o365group-get.js +22 -27
  28. package/dist/m365/aad/commands/o365group/o365group-list.js +39 -44
  29. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +34 -22
  30. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-list.js +25 -13
  31. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-remove.js +36 -38
  32. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +26 -25
  33. package/dist/m365/aad/commands/o365group/o365group-remove.js +41 -43
  34. package/dist/m365/aad/commands/o365group/o365group-renew.js +19 -14
  35. package/dist/m365/aad/commands/o365group/o365group-set.js +98 -116
  36. package/dist/m365/aad/commands/o365group/o365group-teamify.js +33 -30
  37. package/dist/m365/aad/commands/o365group/o365group-user-add.js +30 -27
  38. package/dist/m365/aad/commands/o365group/o365group-user-list.js +20 -21
  39. package/dist/m365/aad/commands/o365group/o365group-user-remove.js +61 -64
  40. package/dist/m365/aad/commands/o365group/o365group-user-set.js +65 -65
  41. package/dist/m365/aad/commands/oauth2grant/oauth2grant-add.js +28 -23
  42. package/dist/m365/aad/commands/oauth2grant/oauth2grant-list.js +23 -20
  43. package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +42 -32
  44. package/dist/m365/aad/commands/oauth2grant/oauth2grant-set.js +30 -16
  45. package/dist/m365/aad/commands/policy/policy-list.js +22 -23
  46. package/dist/m365/aad/commands/siteclassification/siteclassification-disable.js +61 -53
  47. package/dist/m365/aad/commands/siteclassification/siteclassification-enable.js +84 -72
  48. package/dist/m365/aad/commands/siteclassification/siteclassification-get.js +66 -57
  49. package/dist/m365/aad/commands/siteclassification/siteclassification-set.js +96 -93
  50. package/dist/m365/aad/commands/sp/sp-add.js +25 -24
  51. package/dist/m365/aad/commands/sp/sp-get.js +25 -24
  52. package/dist/m365/aad/commands/user/user-get.js +39 -39
  53. package/dist/m365/aad/commands/user/user-hibp.js +23 -24
  54. package/dist/m365/aad/commands/user/user-list.js +32 -22
  55. package/dist/m365/aad/commands/user/user-password-validate.js +29 -17
  56. package/dist/m365/aad/commands/user/user-set.js +20 -15
  57. package/dist/m365/aad/commands/user/user-signin-list.js +28 -24
  58. package/dist/m365/aad/commands.js +0 -1
  59. package/dist/m365/adaptivecard/commands/adaptivecard-send.js +39 -37
  60. package/dist/m365/app/commands/app-get.js +28 -16
  61. package/dist/m365/app/commands/app-open.js +20 -5
  62. package/dist/m365/app/commands/permission/permission-list.js +19 -17
  63. package/dist/m365/base/AnonymousCommand.js +14 -3
  64. package/dist/m365/base/AppCommand.js +54 -47
  65. package/dist/m365/base/DateAndPeriodBasedReport.js +7 -5
  66. package/dist/m365/base/PeriodBasedReport.js +23 -16
  67. package/dist/m365/base/SpoCommand.js +13 -9
  68. package/dist/m365/base/YammerCommand.js +4 -4
  69. package/dist/m365/booking/commands/business/business-get.js +27 -17
  70. package/dist/m365/booking/commands/business/business-list.js +21 -12
  71. package/dist/m365/cli/commands/cli-consent.js +15 -12
  72. package/dist/m365/cli/commands/cli-doctor.js +37 -27
  73. package/dist/m365/cli/commands/cli-issue.js +15 -15
  74. package/dist/m365/cli/commands/cli-reconsent.js +31 -19
  75. package/dist/m365/cli/commands/completion/completion-clink-update.js +13 -3
  76. package/dist/m365/cli/commands/completion/completion-pwsh-setup.js +47 -38
  77. package/dist/m365/cli/commands/completion/completion-pwsh-update.js +16 -6
  78. package/dist/m365/cli/commands/completion/completion-sh-setup.js +21 -11
  79. package/dist/m365/cli/commands/completion/completion-sh-update.js +16 -6
  80. package/dist/m365/cli/commands/config/config-get.js +5 -4
  81. package/dist/m365/cli/commands/config/config-reset.js +10 -9
  82. package/dist/m365/cli/commands/config/config-set.js +20 -19
  83. package/dist/m365/commands/commands.js +1 -0
  84. package/dist/m365/commands/login.js +66 -63
  85. package/dist/m365/commands/logout.js +34 -23
  86. package/dist/m365/commands/request.js +150 -0
  87. package/dist/m365/commands/status.js +50 -28
  88. package/dist/m365/commands/version.js +13 -3
  89. package/dist/m365/file/commands/convert/convert-pdf.js +58 -53
  90. package/dist/m365/file/commands/file-add.js +17 -12
  91. package/dist/m365/file/commands/file-list.js +31 -33
  92. package/dist/m365/flow/commands/environment/environment-get.js +34 -22
  93. package/dist/m365/flow/commands/environment/environment-list.js +33 -21
  94. package/dist/m365/flow/commands/flow-disable.js +28 -14
  95. package/dist/m365/flow/commands/flow-enable.js +28 -14
  96. package/dist/m365/flow/commands/flow-export.js +104 -104
  97. package/dist/m365/flow/commands/flow-get.js +33 -21
  98. package/dist/m365/flow/commands/flow-list.js +28 -16
  99. package/dist/m365/flow/commands/flow-remove.js +41 -45
  100. package/dist/m365/flow/commands/run/run-cancel.js +35 -34
  101. package/dist/m365/flow/commands/run/run-get.js +33 -21
  102. package/dist/m365/flow/commands/run/run-list.js +31 -19
  103. package/dist/m365/flow/commands/run/run-resubmit.js +39 -40
  104. package/dist/m365/graph/Changelog.js +3 -0
  105. package/dist/m365/graph/commands/changelog/changelog-list.js +164 -0
  106. package/dist/m365/graph/commands/schemaextension/schemaextension-add.js +32 -29
  107. package/dist/m365/graph/commands/schemaextension/schemaextension-get.js +30 -17
  108. package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +40 -36
  109. package/dist/m365/graph/commands/schemaextension/schemaextension-remove.js +43 -32
  110. package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +59 -56
  111. package/dist/m365/graph/commands/subscription/subscription-add.js +30 -27
  112. package/dist/m365/graph/commands.js +1 -0
  113. package/dist/m365/onedrive/commands/onedrive-list.js +25 -15
  114. package/dist/m365/onenote/commands/notebook/notebook-list.js +140 -0
  115. package/dist/m365/onenote/commands.js +7 -0
  116. package/dist/m365/outlook/commands/mail/mail-send.js +73 -34
  117. package/dist/m365/outlook/commands/message/message-list.js +22 -12
  118. package/dist/m365/outlook/commands/message/message-move.js +33 -25
  119. package/dist/m365/outlook/commands/room/room-list.js +24 -12
  120. package/dist/m365/outlook/commands/roomlist/roomlist-list.js +20 -8
  121. package/dist/m365/outlook/commands.js +1 -2
  122. package/dist/m365/pa/commands/app/app-get.js +45 -46
  123. package/dist/m365/pa/commands/app/app-list.js +20 -17
  124. package/dist/m365/pa/commands/app/app-remove.js +41 -41
  125. package/dist/m365/pa/commands/connector/connector-export.js +102 -104
  126. package/dist/m365/pa/commands/connector/connector-list.js +29 -17
  127. package/dist/m365/pa/commands/environment/environment-get.js +34 -22
  128. package/dist/m365/pa/commands/environment/environment-list.js +33 -21
  129. package/dist/m365/pa/commands/pcf/pcf-init.js +39 -38
  130. package/dist/m365/pa/commands/solution/solution-init.js +50 -49
  131. package/dist/m365/pa/commands/solution/solution-reference-add.js +15 -14
  132. package/dist/m365/planner/commands/bucket/bucket-add.js +30 -28
  133. package/dist/m365/planner/commands/bucket/bucket-get.js +18 -14
  134. package/dist/m365/planner/commands/bucket/bucket-list.js +19 -14
  135. package/dist/m365/planner/commands/bucket/bucket-remove.js +39 -39
  136. package/dist/m365/planner/commands/bucket/bucket-set.js +31 -27
  137. package/dist/m365/planner/commands/plan/plan-add.js +35 -31
  138. package/dist/m365/planner/commands/plan/plan-get.js +33 -33
  139. package/dist/m365/planner/commands/plan/plan-list.js +19 -15
  140. package/dist/m365/planner/commands/plan/plan-remove.js +38 -40
  141. package/dist/m365/planner/commands/task/task-add.js +47 -50
  142. package/dist/m365/planner/commands/task/task-checklistitem-add.js +47 -37
  143. package/dist/m365/planner/commands/task/task-checklistitem-list.js +36 -22
  144. package/dist/m365/planner/commands/task/task-checklistitem-remove.js +52 -42
  145. package/dist/m365/planner/commands/task/task-get.js +26 -15
  146. package/dist/m365/planner/commands/task/task-list.js +48 -56
  147. package/dist/m365/planner/commands/task/task-reference-add.js +25 -24
  148. package/dist/m365/planner/commands/task/task-reference-list.js +31 -19
  149. package/dist/m365/planner/commands/task/task-reference-remove.js +41 -42
  150. package/dist/m365/planner/commands/task/task-remove.js +38 -37
  151. package/dist/m365/planner/commands/task/task-set.js +38 -41
  152. package/dist/m365/planner/commands/tenant/tenant-settings-list.js +26 -14
  153. package/dist/m365/planner/commands/tenant/tenant-settings-set.js +27 -24
  154. package/dist/m365/pp/commands/environment/environment-list.js +41 -29
  155. package/dist/m365/pp/commands/gateway/gateway-list.js +29 -17
  156. package/dist/m365/pp/commands/managementapp/managementapp-add.js +22 -21
  157. package/dist/m365/pp/commands/managementapp/managementapp-list.js +21 -9
  158. package/dist/m365/search/commands/externalconnection/externalconnection-add.js +29 -24
  159. package/dist/m365/search/commands/externalconnection/externalconnection-get.js +37 -28
  160. package/dist/m365/search/commands/externalconnection/externalconnection-list.js +20 -8
  161. package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +40 -33
  162. package/dist/m365/spfx/commands/package/package-generate.js +105 -98
  163. package/dist/m365/spfx/commands/project/base-project-command.js +19 -18
  164. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.16.0-beta.1.js +23 -0
  165. package/dist/m365/spfx/commands/project/project-doctor/rules/FN001008_DEP_react.js +2 -2
  166. package/dist/m365/spfx/commands/project/project-doctor/rules/FN001009_DEP_react_dom.js +2 -2
  167. package/dist/m365/spfx/commands/project/project-doctor/rules/FN001022_DEP_office_ui_fabric_react.js +2 -2
  168. package/dist/m365/spfx/commands/project/project-doctor/rules/FN002015_DEVDEP_types_react.js +2 -2
  169. package/dist/m365/spfx/commands/project/project-doctor/rules/FN002016_DEVDEP_types_react_dom.js +2 -2
  170. package/dist/m365/spfx/commands/project/project-doctor.js +104 -106
  171. package/dist/m365/spfx/commands/project/project-externalize.js +45 -38
  172. package/dist/m365/spfx/commands/project/project-rename.js +38 -30
  173. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001005_DEP_types_react.js +2 -2
  174. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001006_DEP_types_react_dom.js +2 -2
  175. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001008_DEP_react.js +2 -2
  176. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001009_DEP_react_dom.js +2 -2
  177. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001015_DEP_types_react_addons_shallow_compare.js +2 -2
  178. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001016_DEP_types_react_addons_update.js +2 -2
  179. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001017_DEP_types_react_addons_update.js +2 -2
  180. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001019_DEP_knockout.js +2 -2
  181. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001020_DEP_types_knockout.js +2 -2
  182. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.js +2 -2
  183. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002015_DEVDEP_types_react.js +2 -2
  184. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002016_DEVDEP_types_react_dom.js +2 -2
  185. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002025_DEVDEP_eslint_plugin_react_hooks.js +2 -2
  186. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010008_YORC_nodeVersion.js +1 -1
  187. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015008_FILE_eslintrc_js.js +2 -2
  188. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN020001_RES_types_react.js +2 -2
  189. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN022001_SCSS_remove_fabric_react.js +2 -2
  190. package/dist/m365/spfx/commands/project/project-upgrade/rules/FN022002_SCSS_add_fabric_react.js +2 -2
  191. package/dist/m365/spfx/commands/project/project-upgrade.js +185 -190
  192. package/dist/m365/spfx/commands/spfx-doctor.js +132 -126
  193. package/dist/m365/spo/commands/app/app-add.js +34 -34
  194. package/dist/m365/spo/commands/app/app-deploy.js +41 -41
  195. package/dist/m365/spo/commands/app/app-get.js +43 -43
  196. package/dist/m365/spo/commands/app/app-install.js +21 -16
  197. package/dist/m365/spo/commands/app/app-instance-list.js +27 -23
  198. package/dist/m365/spo/commands/app/app-list.js +32 -34
  199. package/dist/m365/spo/commands/app/app-remove.js +38 -40
  200. package/dist/m365/spo/commands/app/app-retract.js +38 -40
  201. package/dist/m365/spo/commands/app/app-teamspackage-download.js +42 -43
  202. package/dist/m365/spo/commands/app/app-uninstall.js +35 -34
  203. package/dist/m365/spo/commands/app/app-upgrade.js +21 -16
  204. package/dist/m365/spo/commands/apppage/apppage-add.js +39 -40
  205. package/dist/m365/spo/commands/apppage/apppage-set.js +21 -16
  206. package/dist/m365/spo/commands/cdn/cdn-get.js +36 -42
  207. package/dist/m365/spo/commands/cdn/cdn-origin-add.js +31 -38
  208. package/dist/m365/spo/commands/cdn/cdn-origin-list.js +34 -40
  209. package/dist/m365/spo/commands/cdn/cdn-origin-remove.js +46 -59
  210. package/dist/m365/spo/commands/cdn/cdn-policy-list.js +42 -49
  211. package/dist/m365/spo/commands/cdn/cdn-policy-set.js +38 -46
  212. package/dist/m365/spo/commands/cdn/cdn-set.js +64 -68
  213. package/dist/m365/spo/commands/contenttype/contenttype-add.js +54 -57
  214. package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +100 -116
  215. package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +127 -151
  216. package/dist/m365/spo/commands/contenttype/contenttype-get.js +38 -36
  217. package/dist/m365/spo/commands/contenttype/contenttype-list.js +23 -20
  218. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +65 -69
  219. package/dist/m365/spo/commands/contenttype/contenttype-set.js +168 -0
  220. package/dist/m365/spo/commands/contenttypehub/contenttypehub-get.js +51 -48
  221. package/dist/m365/spo/commands/customaction/customaction-add.js +46 -43
  222. package/dist/m365/spo/commands/customaction/customaction-clear.js +30 -28
  223. package/dist/m365/spo/commands/customaction/customaction-get.js +43 -38
  224. package/dist/m365/spo/commands/customaction/customaction-list.js +30 -25
  225. package/dist/m365/spo/commands/customaction/customaction-remove.js +36 -35
  226. package/dist/m365/spo/commands/customaction/customaction-set.js +25 -20
  227. package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +47 -42
  228. package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +39 -35
  229. package/dist/m365/spo/commands/externaluser/externaluser-list.js +55 -58
  230. package/dist/m365/spo/commands/feature/feature-disable.js +26 -21
  231. package/dist/m365/spo/commands/feature/feature-enable.js +28 -23
  232. package/dist/m365/spo/commands/feature/feature-list.js +25 -22
  233. package/dist/m365/spo/commands/field/field-add.js +29 -26
  234. package/dist/m365/spo/commands/field/field-get.js +41 -36
  235. package/dist/m365/spo/commands/field/field-list.js +33 -28
  236. package/dist/m365/spo/commands/field/field-remove.js +87 -88
  237. package/dist/m365/spo/commands/field/field-set.js +70 -81
  238. package/dist/m365/spo/commands/file/file-add.js +158 -177
  239. package/dist/m365/spo/commands/file/file-checkin.js +39 -34
  240. package/dist/m365/spo/commands/file/file-checkout.js +26 -21
  241. package/dist/m365/spo/commands/file/file-copy.js +67 -67
  242. package/dist/m365/spo/commands/file/file-get.js +67 -69
  243. package/dist/m365/spo/commands/file/file-list.js +17 -11
  244. package/dist/m365/spo/commands/file/file-move.js +66 -66
  245. package/dist/m365/spo/commands/file/file-remove.js +58 -60
  246. package/dist/m365/spo/commands/file/file-rename.js +35 -36
  247. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +125 -0
  248. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +49 -46
  249. package/dist/m365/spo/commands/folder/folder-add.js +29 -25
  250. package/dist/m365/spo/commands/folder/folder-copy.js +49 -44
  251. package/dist/m365/spo/commands/folder/folder-get.js +59 -28
  252. package/dist/m365/spo/commands/folder/folder-list.js +25 -21
  253. package/dist/m365/spo/commands/folder/folder-move.js +50 -45
  254. package/dist/m365/spo/commands/folder/folder-remove.js +44 -42
  255. package/dist/m365/spo/commands/folder/folder-rename.js +34 -38
  256. package/dist/m365/spo/commands/group/group-add.js +28 -25
  257. package/dist/m365/spo/commands/group/group-get.js +42 -39
  258. package/dist/m365/spo/commands/group/group-list.js +23 -20
  259. package/dist/m365/spo/commands/group/group-remove.js +49 -52
  260. package/dist/m365/spo/commands/group/group-set.js +31 -26
  261. package/dist/m365/spo/commands/group/group-user-add.js +34 -38
  262. package/dist/m365/spo/commands/group/group-user-list.js +25 -22
  263. package/dist/m365/spo/commands/group/group-user-remove.js +42 -43
  264. package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +30 -20
  265. package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +23 -20
  266. package/dist/m365/spo/commands/homesite/homesite-get.js +29 -19
  267. package/dist/m365/spo/commands/homesite/homesite-remove.js +50 -49
  268. package/dist/m365/spo/commands/homesite/homesite-set.js +28 -31
  269. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +22 -18
  270. package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +27 -24
  271. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +38 -38
  272. package/dist/m365/spo/commands/hubsite/hubsite-get.js +24 -37
  273. package/dist/m365/spo/commands/hubsite/hubsite-list.js +65 -63
  274. package/dist/m365/spo/commands/hubsite/hubsite-register.js +22 -20
  275. package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +33 -36
  276. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +48 -55
  277. package/dist/m365/spo/commands/hubsite/hubsite-set.js +38 -41
  278. package/dist/m365/spo/commands/hubsite/hubsite-theme-sync.js +21 -16
  279. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +36 -36
  280. package/dist/m365/spo/commands/knowledgehub/knowledgehub-get.js +35 -32
  281. package/dist/m365/spo/commands/knowledgehub/knowledgehub-remove.js +52 -53
  282. package/dist/m365/spo/commands/knowledgehub/knowledgehub-set.js +29 -33
  283. package/dist/m365/spo/commands/list/list-add.js +28 -25
  284. package/dist/m365/spo/commands/list/list-contenttype-add.js +34 -30
  285. package/dist/m365/spo/commands/list/list-contenttype-default-set.js +60 -60
  286. package/dist/m365/spo/commands/list/list-contenttype-list.js +33 -29
  287. package/dist/m365/spo/commands/list/list-contenttype-remove.js +46 -47
  288. package/dist/m365/spo/commands/list/list-get.js +37 -33
  289. package/dist/m365/spo/commands/list/list-label-get.js +51 -51
  290. package/dist/m365/spo/commands/list/list-label-set.js +51 -47
  291. package/dist/m365/spo/commands/list/list-list.js +26 -23
  292. package/dist/m365/spo/commands/list/list-remove.js +46 -47
  293. package/dist/m365/spo/commands/list/list-roleassignment-add.js +53 -43
  294. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +71 -42
  295. package/dist/m365/spo/commands/list/list-roleinheritance-break.js +58 -31
  296. package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +54 -27
  297. package/dist/m365/spo/commands/list/list-set.js +31 -28
  298. package/dist/m365/spo/commands/list/list-sitescript-get.js +54 -55
  299. package/dist/m365/spo/commands/list/list-view-add.js +37 -32
  300. package/dist/m365/spo/commands/list/list-view-field-add.js +53 -53
  301. package/dist/m365/spo/commands/list/list-view-field-remove.js +47 -49
  302. package/dist/m365/spo/commands/list/list-view-field-set.js +34 -30
  303. package/dist/m365/spo/commands/list/list-view-get.js +36 -31
  304. package/dist/m365/spo/commands/list/list-view-list.js +32 -28
  305. package/dist/m365/spo/commands/list/list-view-remove.js +46 -46
  306. package/dist/m365/spo/commands/list/list-view-set.js +31 -26
  307. package/dist/m365/spo/commands/list/list-webhook-add.js +43 -41
  308. package/dist/m365/spo/commands/list/list-webhook-get.js +34 -32
  309. package/dist/m365/spo/commands/list/list-webhook-list.js +52 -48
  310. package/dist/m365/spo/commands/list/list-webhook-remove.js +47 -49
  311. package/dist/m365/spo/commands/list/list-webhook-set.js +40 -38
  312. package/dist/m365/spo/commands/listitem/listitem-add.js +106 -112
  313. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +32 -28
  314. package/dist/m365/spo/commands/listitem/listitem-get.js +32 -28
  315. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +68 -69
  316. package/dist/m365/spo/commands/listitem/listitem-list.js +63 -68
  317. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +55 -55
  318. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +54 -54
  319. package/dist/m365/spo/commands/listitem/listitem-remove.js +51 -51
  320. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +206 -0
  321. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +58 -31
  322. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +54 -24
  323. package/dist/m365/spo/commands/listitem/listitem-set.js +146 -163
  324. package/dist/m365/spo/commands/mail/mail-send.js +50 -45
  325. package/dist/m365/spo/commands/navigation/navigation-node-add.js +31 -28
  326. package/dist/m365/spo/commands/navigation/navigation-node-list.js +28 -25
  327. package/dist/m365/spo/commands/navigation/navigation-node-remove.js +38 -38
  328. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +30 -33
  329. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +49 -45
  330. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +50 -50
  331. package/dist/m365/spo/commands/orgnewssite/orgnewssite-list.js +35 -31
  332. package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +41 -50
  333. package/dist/m365/spo/commands/orgnewssite/orgnewssite-set.js +26 -29
  334. package/dist/m365/spo/commands/page/Page.js +2 -2
  335. package/dist/m365/spo/commands/page/page-add.js +197 -218
  336. package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +186 -189
  337. package/dist/m365/spo/commands/page/page-column-get.js +25 -22
  338. package/dist/m365/spo/commands/page/page-column-list.js +20 -17
  339. package/dist/m365/spo/commands/page/page-control-get.js +39 -36
  340. package/dist/m365/spo/commands/page/page-control-list.js +35 -32
  341. package/dist/m365/spo/commands/page/page-control-set.js +100 -100
  342. package/dist/m365/spo/commands/page/page-copy.js +53 -53
  343. package/dist/m365/spo/commands/page/page-get.js +52 -53
  344. package/dist/m365/spo/commands/page/page-header-set.js +230 -234
  345. package/dist/m365/spo/commands/page/page-list.js +42 -41
  346. package/dist/m365/spo/commands/page/page-remove.js +48 -47
  347. package/dist/m365/spo/commands/page/page-section-add.js +68 -70
  348. package/dist/m365/spo/commands/page/page-section-get.js +16 -13
  349. package/dist/m365/spo/commands/page/page-section-list.js +25 -22
  350. package/dist/m365/spo/commands/page/page-set.js +219 -238
  351. package/dist/m365/spo/commands/page/page-template-list.js +26 -27
  352. package/dist/m365/spo/commands/page/page-text-add.js +45 -43
  353. package/dist/m365/spo/commands/propertybag/propertybag-base.js +4 -3
  354. package/dist/m365/spo/commands/propertybag/propertybag-get.js +27 -24
  355. package/dist/m365/spo/commands/propertybag/propertybag-list.js +22 -19
  356. package/dist/m365/spo/commands/propertybag/propertybag-remove.js +36 -40
  357. package/dist/m365/spo/commands/propertybag/propertybag-set.js +25 -29
  358. package/dist/m365/spo/commands/roledefinition/roledefinition-add.js +117 -0
  359. package/dist/m365/spo/commands/roledefinition/roledefinition-get.js +27 -24
  360. package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +22 -19
  361. package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +38 -37
  362. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-add.js +40 -35
  363. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +43 -39
  364. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-revoke.js +35 -30
  365. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +33 -36
  366. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-deny.js +28 -31
  367. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +45 -41
  368. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +47 -56
  369. package/dist/m365/spo/commands/site/site-add.js +189 -199
  370. package/dist/m365/spo/commands/site/site-appcatalog-add.js +33 -36
  371. package/dist/m365/spo/commands/site/site-appcatalog-remove.js +33 -36
  372. package/dist/m365/spo/commands/site/site-apppermission-add.js +69 -37
  373. package/dist/m365/spo/commands/site/site-apppermission-get.js +21 -18
  374. package/dist/m365/spo/commands/site/site-apppermission-list.js +17 -19
  375. package/dist/m365/spo/commands/site/site-apppermission-remove.js +33 -39
  376. package/dist/m365/spo/commands/site/site-apppermission-set.js +33 -32
  377. package/dist/m365/spo/commands/site/site-chrome-set.js +52 -47
  378. package/dist/m365/spo/commands/site/site-commsite-enable.js +30 -33
  379. package/dist/m365/spo/commands/site/site-ensure.js +46 -36
  380. package/dist/m365/spo/commands/site/site-get.js +19 -16
  381. package/dist/m365/spo/commands/site/site-groupify.js +37 -34
  382. package/dist/m365/spo/commands/site/site-inplacerecordsmanagement-set.js +27 -22
  383. package/dist/m365/spo/commands/site/site-list.js +20 -20
  384. package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +29 -26
  385. package/dist/m365/spo/commands/site/site-recyclebinitem-restore.js +36 -28
  386. package/dist/m365/spo/commands/site/site-remove.js +66 -73
  387. package/dist/m365/spo/commands/site/site-rename.js +66 -77
  388. package/dist/m365/spo/commands/site/site-set.js +47 -50
  389. package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +40 -42
  390. package/dist/m365/spo/commands/sitedesign/sitedesign-apply.js +31 -29
  391. package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +26 -28
  392. package/dist/m365/spo/commands/sitedesign/sitedesign-list.js +28 -18
  393. package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +38 -42
  394. package/dist/m365/spo/commands/sitedesign/sitedesign-rights-grant.js +29 -29
  395. package/dist/m365/spo/commands/sitedesign/sitedesign-rights-list.js +28 -30
  396. package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +41 -45
  397. package/dist/m365/spo/commands/sitedesign/sitedesign-run-list.js +30 -26
  398. package/dist/m365/spo/commands/sitedesign/sitedesign-run-status-get.js +25 -21
  399. package/dist/m365/spo/commands/sitedesign/sitedesign-set.js +53 -51
  400. package/dist/m365/spo/commands/sitedesign/sitedesign-task-get.js +25 -23
  401. package/dist/m365/spo/commands/sitedesign/sitedesign-task-list.js +19 -15
  402. package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +37 -37
  403. package/dist/m365/spo/commands/sitescript/sitescript-add.js +23 -26
  404. package/dist/m365/spo/commands/sitescript/sitescript-get.js +25 -27
  405. package/dist/m365/spo/commands/sitescript/sitescript-list.js +31 -25
  406. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +38 -42
  407. package/dist/m365/spo/commands/sitescript/sitescript-set.js +38 -40
  408. package/dist/m365/spo/commands/spo-get.js +16 -6
  409. package/dist/m365/spo/commands/spo-search.js +23 -23
  410. package/dist/m365/spo/commands/spo-set.js +11 -9
  411. package/dist/m365/spo/commands/storageentity/storageentity-get.js +37 -27
  412. package/dist/m365/spo/commands/storageentity/storageentity-list.js +36 -38
  413. package/dist/m365/spo/commands/storageentity/storageentity-remove.js +43 -51
  414. package/dist/m365/spo/commands/storageentity/storageentity-set.js +33 -36
  415. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +21 -22
  416. package/dist/m365/spo/commands/tenant/tenant-appcatalogurl-get.js +32 -22
  417. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-list.js +39 -35
  418. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +56 -62
  419. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +24 -22
  420. package/dist/m365/spo/commands/tenant/tenant-settings-list.js +57 -53
  421. package/dist/m365/spo/commands/tenant/tenant-settings-set.js +56 -66
  422. package/dist/m365/spo/commands/term/term-add.js +98 -103
  423. package/dist/m365/spo/commands/term/term-get.js +49 -53
  424. package/dist/m365/spo/commands/term/term-group-add.js +74 -81
  425. package/dist/m365/spo/commands/term/term-group-get.js +36 -39
  426. package/dist/m365/spo/commands/term/term-group-list.js +43 -39
  427. package/dist/m365/spo/commands/term/term-list.js +40 -43
  428. package/dist/m365/spo/commands/term/term-set-add.js +84 -89
  429. package/dist/m365/spo/commands/term/term-set-get.js +38 -41
  430. package/dist/m365/spo/commands/term/term-set-list.js +39 -42
  431. package/dist/m365/spo/commands/theme/theme-apply.js +56 -60
  432. package/dist/m365/spo/commands/theme/theme-get.js +39 -34
  433. package/dist/m365/spo/commands/theme/theme-list.js +36 -26
  434. package/dist/m365/spo/commands/theme/theme-remove.js +47 -39
  435. package/dist/m365/spo/commands/theme/theme-set.js +33 -34
  436. package/dist/m365/spo/commands/user/user-get.js +33 -30
  437. package/dist/m365/spo/commands/user/user-list.js +25 -22
  438. package/dist/m365/spo/commands/user/user-remove.js +42 -41
  439. package/dist/m365/spo/commands/userprofile/userprofile-get.js +25 -24
  440. package/dist/m365/spo/commands/userprofile/userprofile-set.js +42 -34
  441. package/dist/m365/spo/commands/web/web-add.js +74 -99
  442. package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +31 -28
  443. package/dist/m365/spo/commands/web/web-get.js +23 -20
  444. package/dist/m365/spo/commands/web/web-installedlanguage-list.js +22 -19
  445. package/dist/m365/spo/commands/web/web-list.js +26 -23
  446. package/dist/m365/spo/commands/web/web-reindex.js +44 -55
  447. package/dist/m365/spo/commands/web/web-remove.js +36 -35
  448. package/dist/m365/spo/commands/web/web-roleassignment-add.js +186 -0
  449. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +168 -0
  450. package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +51 -20
  451. package/dist/m365/spo/commands/web/web-set.js +53 -48
  452. package/dist/m365/spo/commands.js +6 -0
  453. package/dist/m365/teams/commands/app/app-install.js +33 -30
  454. package/dist/m365/teams/commands/app/app-list.js +19 -15
  455. package/dist/m365/teams/commands/app/app-publish.js +23 -20
  456. package/dist/m365/teams/commands/app/app-remove.js +32 -31
  457. package/dist/m365/teams/commands/app/app-uninstall.js +31 -30
  458. package/dist/m365/teams/commands/app/app-update.js +23 -20
  459. package/dist/m365/teams/commands/cache/cache-remove.js +25 -24
  460. package/dist/m365/teams/commands/channel/channel-add.js +13 -10
  461. package/dist/m365/teams/commands/channel/channel-get.js +27 -29
  462. package/dist/m365/teams/commands/channel/channel-list.js +20 -18
  463. package/dist/m365/teams/commands/channel/channel-member-add.js +21 -30
  464. package/dist/m365/teams/commands/channel/channel-member-list.js +24 -29
  465. package/dist/m365/teams/commands/channel/channel-member-remove.js +31 -34
  466. package/dist/m365/teams/commands/channel/channel-member-set.js +30 -35
  467. package/dist/m365/teams/commands/channel/channel-remove.js +58 -61
  468. package/dist/m365/teams/commands/channel/channel-set.js +29 -26
  469. package/dist/m365/teams/commands/chat/chat-get.js +11 -8
  470. package/dist/m365/teams/commands/chat/chat-list.js +13 -10
  471. package/dist/m365/teams/commands/chat/chat-member-list.js +14 -10
  472. package/dist/m365/teams/commands/chat/chat-message-list.js +30 -26
  473. package/dist/m365/teams/commands/chat/chat-message-send.js +15 -11
  474. package/dist/m365/teams/commands/funsettings/funsettings-list.js +19 -16
  475. package/dist/m365/teams/commands/funsettings/funsettings-set.js +28 -23
  476. package/dist/m365/teams/commands/guestsettings/guestsettings-list.js +19 -16
  477. package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +25 -20
  478. package/dist/m365/teams/commands/membersettings/membersettings-list.js +19 -16
  479. package/dist/m365/teams/commands/membersettings/membersettings-set.js +25 -20
  480. package/dist/m365/teams/commands/message/message-get.js +20 -17
  481. package/dist/m365/teams/commands/message/message-list.js +22 -18
  482. package/dist/m365/teams/commands/message/message-reply-list.js +19 -15
  483. package/dist/m365/teams/commands/messagingsettings/messagingsettings-list.js +19 -16
  484. package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +26 -21
  485. package/dist/m365/teams/commands/report/report-directroutingcalls.js +21 -18
  486. package/dist/m365/teams/commands/report/report-pstncalls.js +21 -18
  487. package/dist/m365/teams/commands/tab/tab-add.js +23 -20
  488. package/dist/m365/teams/commands/tab/tab-get.js +25 -30
  489. package/dist/m365/teams/commands/tab/tab-list.js +18 -14
  490. package/dist/m365/teams/commands/tab/tab-remove.js +34 -31
  491. package/dist/m365/teams/commands/team/team-add.js +53 -55
  492. package/dist/m365/teams/commands/team/team-archive.js +24 -21
  493. package/dist/m365/teams/commands/team/team-clone.js +34 -29
  494. package/dist/m365/teams/commands/team/team-get.js +20 -19
  495. package/dist/m365/teams/commands/team/team-list.js +29 -19
  496. package/dist/m365/teams/commands/team/team-remove.js +33 -34
  497. package/dist/m365/teams/commands/team/team-set.js +24 -19
  498. package/dist/m365/teams/commands/team/team-unarchive.js +21 -18
  499. package/dist/m365/teams/commands/user/user-app-add.js +23 -18
  500. package/dist/m365/teams/commands/user/user-app-list.js +31 -31
  501. package/dist/m365/teams/commands/user/user-app-remove.js +33 -32
  502. package/dist/m365/teams/commands/user/user-list.js +21 -22
  503. package/dist/m365/teams/commands.js +0 -3
  504. package/dist/m365/tenant/commands/id/id-get.js +37 -26
  505. package/dist/m365/tenant/commands/report/report-office365activationcounts.js +38 -24
  506. package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +38 -24
  507. package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +38 -24
  508. package/dist/m365/tenant/commands/security/security-alerts-list.js +19 -7
  509. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +19 -7
  510. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +19 -7
  511. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +26 -14
  512. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +24 -12
  513. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +20 -17
  514. package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +24 -12
  515. package/dist/m365/todo/commands/list/list-add.js +31 -19
  516. package/dist/m365/todo/commands/list/list-list.js +20 -8
  517. package/dist/m365/todo/commands/list/list-remove.js +57 -49
  518. package/dist/m365/todo/commands/list/list-set.js +34 -22
  519. package/dist/m365/todo/commands/task/task-add.js +32 -22
  520. package/dist/m365/todo/commands/task/task-list.js +33 -23
  521. package/dist/m365/todo/commands/task/task-remove.js +57 -49
  522. package/dist/m365/todo/commands/task/task-set.js +22 -21
  523. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +26 -14
  524. package/dist/m365/viva/commands/connections/connections-app-create.js +104 -106
  525. package/dist/m365/yammer/commands/group/group-list.js +11 -8
  526. package/dist/m365/yammer/commands/group/group-user-add.js +21 -16
  527. package/dist/m365/yammer/commands/group/group-user-remove.js +39 -38
  528. package/dist/m365/yammer/commands/message/message-add.js +27 -24
  529. package/dist/m365/yammer/commands/message/message-get.js +18 -15
  530. package/dist/m365/yammer/commands/message/message-like-set.js +45 -46
  531. package/dist/m365/yammer/commands/message/message-list.js +24 -21
  532. package/dist/m365/yammer/commands/message/message-remove.js +31 -30
  533. package/dist/m365/yammer/commands/network/network-list.js +29 -17
  534. package/dist/m365/yammer/commands/user/user-get.js +25 -22
  535. package/dist/m365/yammer/commands/user/user-list.js +11 -8
  536. package/dist/m365/yammer/commands/yammer-search.js +76 -73
  537. package/dist/request.js +10 -6
  538. package/dist/utils/fsUtil.js +2 -4
  539. package/dist/utils/md.js +1 -1
  540. package/dist/utils/spo.js +7 -6
  541. package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +1 -7
  542. package/docs/docs/cmd/aad/user/user-signin-list.md +1 -1
  543. package/docs/docs/cmd/adaptivecard/adaptivecard-send.md +0 -20
  544. package/docs/docs/cmd/graph/changelog/changelog-list.md +53 -0
  545. package/docs/docs/cmd/onedrive/report/report-activityusercounts.md +1 -1
  546. package/docs/docs/cmd/onenote/notebook/notebook-list.md +70 -0
  547. package/docs/docs/cmd/outlook/mail/mail-send.md +69 -17
  548. package/docs/docs/cmd/planner/task/task-checklistitem-list.md +1 -1
  549. package/docs/docs/cmd/planner/task/task-reference-add.md +1 -1
  550. package/docs/docs/cmd/pp/environment/environment-list.md +1 -1
  551. package/docs/docs/cmd/request.md +76 -0
  552. package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +1 -1
  553. package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
  554. package/docs/docs/cmd/spo/contenttype/contenttype-set.md +45 -0
  555. package/docs/docs/cmd/spo/field/field-set.md +0 -3
  556. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.md +39 -0
  557. package/docs/docs/cmd/spo/folder/folder-get.md +13 -4
  558. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +2 -2
  559. package/docs/docs/cmd/spo/list/list-roleassignment-add.md +3 -3
  560. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +6 -3
  561. package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +9 -0
  562. package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +9 -0
  563. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +67 -0
  564. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +9 -0
  565. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.md +9 -0
  566. package/docs/docs/cmd/spo/roledefinition/roledefinition-add.md +43 -0
  567. package/docs/docs/cmd/spo/site/site-add.md +2 -2
  568. package/docs/docs/cmd/spo/site/site-apppermission-add.md +1 -1
  569. package/docs/docs/cmd/spo/site/site-apppermission-set.md +1 -1
  570. package/docs/docs/cmd/spo/site/site-groupify.md +0 -6
  571. package/docs/docs/cmd/spo/web/web-roleassignment-add.md +57 -0
  572. package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +54 -0
  573. package/docs/docs/cmd/spo/web/web-roleinheritance-reset.md +10 -1
  574. package/docs/docs/cmd/teams/cache/cache-remove.md +1 -1
  575. package/docs/docs/cmd/teams/channel/channel-add.md +1 -1
  576. package/docs/docs/cmd/teams/channel/channel-list.md +1 -1
  577. package/docs/docs/cmd/teams/channel/channel-member-add.md +5 -11
  578. package/docs/docs/cmd/teams/channel/channel-member-list.md +0 -6
  579. package/docs/docs/cmd/teams/channel/channel-member-remove.md +1 -7
  580. package/docs/docs/cmd/teams/channel/channel-member-set.md +2 -2
  581. package/docs/docs/cmd/teams/funsettings/funsettings-set.md +6 -6
  582. package/docs/docs/cmd/tenant/security/security-alerts-list.md +1 -1
  583. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +1 -1
  584. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +1 -1
  585. package/package.json +5 -1
  586. package/dist/cli/index.js +0 -21
  587. package/dist/utils/index.js +0 -31
@@ -15,9 +15,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _SpoFileRemoveCommand_instances, _SpoFileRemoveCommand_initTelemetry, _SpoFileRemoveCommand_initOptions, _SpoFileRemoveCommand_initValidators, _SpoFileRemoveCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const cli_1 = require("../../../../cli");
18
+ const Cli_1 = require("../../../../cli/Cli");
19
19
  const request_1 = require("../../../../request");
20
- const utils_1 = require("../../../../utils");
20
+ const validation_1 = require("../../../../utils/validation");
21
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
22
22
  const commands_1 = require("../../commands");
23
23
  class SpoFileRemoveCommand extends SpoCommand_1.default {
@@ -38,67 +38,65 @@ class SpoFileRemoveCommand extends SpoCommand_1.default {
38
38
  getExcludedOptionsWithUrls() {
39
39
  return ['url'];
40
40
  }
41
- commandAction(logger, args, cb) {
42
- const removeFile = () => {
43
- if (this.verbose) {
44
- logger.logToStderr(`Removing file in site at ${args.options.webUrl}...`);
45
- }
46
- let requestUrl = '';
47
- if (args.options.id) {
48
- requestUrl = `${args.options.webUrl}/_api/web/GetFileById(guid'${encodeURIComponent(args.options.id)}')`;
49
- }
50
- else {
51
- // concatenate trailing '/' if not provided
52
- // so if the provided url is for the root site, the substr bellow will get the right value
53
- let serverRelativeSiteUrl = args.options.webUrl;
54
- if (!serverRelativeSiteUrl.endsWith('/')) {
55
- serverRelativeSiteUrl = `${serverRelativeSiteUrl}/`;
56
- }
57
- serverRelativeSiteUrl = serverRelativeSiteUrl.substr(serverRelativeSiteUrl.indexOf('/', 8));
58
- let fileUrl = args.options.url;
59
- if (!fileUrl.startsWith(serverRelativeSiteUrl)) {
60
- fileUrl = `${serverRelativeSiteUrl}${fileUrl}`;
41
+ commandAction(logger, args) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const removeFile = () => __awaiter(this, void 0, void 0, function* () {
44
+ if (this.verbose) {
45
+ logger.logToStderr(`Removing file in site at ${args.options.webUrl}...`);
61
46
  }
62
- requestUrl = `${args.options.webUrl}/_api/web/GetFileByServerRelativeUrl('${encodeURIComponent(fileUrl)}')`;
63
- }
64
- if (args.options.recycle) {
65
- requestUrl += `/recycle()`;
66
- }
67
- const requestOptions = {
68
- url: requestUrl,
69
- method: 'POST',
70
- headers: {
71
- 'X-HTTP-Method': 'DELETE',
72
- 'If-Match': '*',
73
- 'accept': 'application/json;odata=nometadata'
74
- },
75
- responseType: 'json'
76
- };
77
- request_1.default
78
- .post(requestOptions)
79
- .then(() => {
80
- // REST post call doesn't return anything
81
- cb();
82
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
83
- };
84
- if (args.options.confirm) {
85
- removeFile();
86
- }
87
- else {
88
- cli_1.Cli.prompt({
89
- type: 'confirm',
90
- name: 'continue',
91
- default: false,
92
- message: `Are you sure you want to ${args.options.recycle ? "recycle" : "remove"} the file ${args.options.id || args.options.url} located in site ${args.options.webUrl}?`
93
- }, (result) => {
94
- if (!result.continue) {
95
- cb();
47
+ let requestUrl = '';
48
+ if (args.options.id) {
49
+ requestUrl = `${args.options.webUrl}/_api/web/GetFileById(guid'${encodeURIComponent(args.options.id)}')`;
96
50
  }
97
51
  else {
98
- removeFile();
52
+ // concatenate trailing '/' if not provided
53
+ // so if the provided url is for the root site, the substr bellow will get the right value
54
+ let serverRelativeSiteUrl = args.options.webUrl;
55
+ if (!serverRelativeSiteUrl.endsWith('/')) {
56
+ serverRelativeSiteUrl = `${serverRelativeSiteUrl}/`;
57
+ }
58
+ serverRelativeSiteUrl = serverRelativeSiteUrl.substr(serverRelativeSiteUrl.indexOf('/', 8));
59
+ let fileUrl = args.options.url;
60
+ if (!fileUrl.startsWith(serverRelativeSiteUrl)) {
61
+ fileUrl = `${serverRelativeSiteUrl}${fileUrl}`;
62
+ }
63
+ requestUrl = `${args.options.webUrl}/_api/web/GetFileByServerRelativeUrl('${encodeURIComponent(fileUrl)}')`;
64
+ }
65
+ if (args.options.recycle) {
66
+ requestUrl += `/recycle()`;
67
+ }
68
+ const requestOptions = {
69
+ url: requestUrl,
70
+ method: 'POST',
71
+ headers: {
72
+ 'X-HTTP-Method': 'DELETE',
73
+ 'If-Match': '*',
74
+ 'accept': 'application/json;odata=nometadata'
75
+ },
76
+ responseType: 'json'
77
+ };
78
+ try {
79
+ yield request_1.default.post(requestOptions);
80
+ }
81
+ catch (err) {
82
+ this.handleRejectedODataJsonPromise(err);
99
83
  }
100
84
  });
101
- }
85
+ if (args.options.confirm) {
86
+ yield removeFile();
87
+ }
88
+ else {
89
+ const result = yield Cli_1.Cli.prompt({
90
+ type: 'confirm',
91
+ name: 'continue',
92
+ default: false,
93
+ message: `Are you sure you want to ${args.options.recycle ? "recycle" : "remove"} the file ${args.options.id || args.options.url} located in site ${args.options.webUrl}?`
94
+ });
95
+ if (result.continue) {
96
+ yield removeFile();
97
+ }
98
+ }
99
+ });
102
100
  }
103
101
  }
104
102
  _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelemetry = function _SpoFileRemoveCommand_initTelemetry() {
@@ -124,12 +122,12 @@ _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelem
124
122
  });
125
123
  }, _SpoFileRemoveCommand_initValidators = function _SpoFileRemoveCommand_initValidators() {
126
124
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
127
- const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
125
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
128
126
  if (isValidSharePointUrl !== true) {
129
127
  return isValidSharePointUrl;
130
128
  }
131
129
  if (args.options.id &&
132
- !utils_1.validation.isValidGuid(args.options.id)) {
130
+ !validation_1.validation.isValidGuid(args.options.id)) {
133
131
  return `${args.options.id} is not a valid GUID`;
134
132
  }
135
133
  return true;
@@ -15,9 +15,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _SpoFileRenameCommand_instances, _SpoFileRenameCommand_initTelemetry, _SpoFileRenameCommand_initOptions, _SpoFileRenameCommand_initValidators;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const cli_1 = require("../../../../cli");
18
+ const Cli_1 = require("../../../../cli/Cli");
19
19
  const request_1 = require("../../../../request");
20
- const utils_1 = require("../../../../utils");
20
+ const urlUtil_1 = require("../../../../utils/urlUtil");
21
+ const validation_1 = require("../../../../utils/validation");
21
22
  const SpoCommand_1 = require("../../../base/SpoCommand");
22
23
  const commands_1 = require("../../commands");
23
24
  const removeCommand = require('./file-remove');
@@ -35,38 +36,36 @@ class SpoFileRenameCommand extends SpoCommand_1.default {
35
36
  get description() {
36
37
  return 'Renames a file';
37
38
  }
38
- commandAction(logger, args, cb) {
39
- const webUrl = args.options.webUrl;
40
- const originalFileServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.sourceUrl);
41
- this
42
- .getFile(originalFileServerRelativeUrl, webUrl)
43
- .then((_) => {
44
- if (args.options.force) {
45
- return this.deleteFile(webUrl, args.options.sourceUrl, args.options.targetFileName);
39
+ commandAction(logger, args) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const webUrl = args.options.webUrl;
42
+ const originalFileServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.sourceUrl);
43
+ try {
44
+ yield this.getFile(originalFileServerRelativeUrl, webUrl);
45
+ if (args.options.force) {
46
+ yield this.deleteFile(webUrl, args.options.sourceUrl, args.options.targetFileName);
47
+ }
48
+ const requestBody = {
49
+ formValues: [{
50
+ FieldName: 'FileLeafRef',
51
+ FieldValue: args.options.targetFileName
52
+ }]
53
+ };
54
+ const requestOptions = {
55
+ url: `${webUrl}/_api/web/GetFileByServerRelativeUrl('${encodeURIComponent(originalFileServerRelativeUrl)}')/ListItemAllFields/ValidateUpdateListItem()`,
56
+ headers: {
57
+ 'accept': 'application/json;odata=nometadata'
58
+ },
59
+ data: requestBody,
60
+ responseType: 'json'
61
+ };
62
+ const resp = yield request_1.default.post(requestOptions);
63
+ logger.log(resp.value);
46
64
  }
47
- return Promise.resolve();
48
- })
49
- .then(_ => {
50
- const requestBody = {
51
- formValues: [{
52
- FieldName: 'FileLeafRef',
53
- FieldValue: args.options.targetFileName
54
- }]
55
- };
56
- const requestOptions = {
57
- url: `${webUrl}/_api/web/GetFileByServerRelativeUrl('${encodeURIComponent(originalFileServerRelativeUrl)}')/ListItemAllFields/ValidateUpdateListItem()`,
58
- headers: {
59
- 'accept': 'application/json;odata=nometadata'
60
- },
61
- data: requestBody,
62
- responseType: 'json'
63
- };
64
- return request_1.default.post(requestOptions);
65
- })
66
- .then((resp) => {
67
- logger.log(resp.value);
68
- cb();
69
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
65
+ catch (err) {
66
+ this.handleRejectedODataJsonPromise(err);
67
+ }
68
+ });
70
69
  }
71
70
  getFile(originalFileServerRelativeUrl, webUrl) {
72
71
  const requestUrl = `${webUrl}/_api/web/GetFileByServerRelativeUrl('${encodeURIComponent(originalFileServerRelativeUrl)}')?$select=UniqueId`;
@@ -80,7 +79,7 @@ class SpoFileRenameCommand extends SpoCommand_1.default {
80
79
  return request_1.default.get(requestOptions);
81
80
  }
82
81
  deleteFile(webUrl, sourceUrl, targetFileName) {
83
- const targetFileServerRelativeUrl = `${utils_1.urlUtil.getServerRelativePath(webUrl, sourceUrl.substring(0, sourceUrl.lastIndexOf('/')))}/${targetFileName}`;
82
+ const targetFileServerRelativeUrl = `${urlUtil_1.urlUtil.getServerRelativePath(webUrl, sourceUrl.substring(0, sourceUrl.lastIndexOf('/')))}/${targetFileName}`;
84
83
  const options = {
85
84
  webUrl: webUrl,
86
85
  url: targetFileServerRelativeUrl,
@@ -89,7 +88,7 @@ class SpoFileRenameCommand extends SpoCommand_1.default {
89
88
  debug: this.debug,
90
89
  verbose: this.verbose
91
90
  };
92
- return cli_1.Cli.executeCommandWithOutput(removeCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) })
91
+ return Cli_1.Cli.executeCommandWithOutput(removeCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) })
93
92
  .then(_ => {
94
93
  return Promise.resolve();
95
94
  }, (err) => {
@@ -117,7 +116,7 @@ _SpoFileRenameCommand_instances = new WeakSet(), _SpoFileRenameCommand_initTelem
117
116
  option: '--force'
118
117
  });
119
118
  }, _SpoFileRenameCommand_initValidators = function _SpoFileRenameCommand_initValidators() {
120
- this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return utils_1.validation.isValidSharePointUrl(args.options.webUrl); }));
119
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
121
120
  };
122
121
  module.exports = new SpoFileRenameCommand();
123
122
  //# sourceMappingURL=file-rename.js.map
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ 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");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _SpoFileRoleInheritanceResetCommand_instances, _SpoFileRoleInheritanceResetCommand_initTelemetry, _SpoFileRoleInheritanceResetCommand_initOptions, _SpoFileRoleInheritanceResetCommand_initValidators, _SpoFileRoleInheritanceResetCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Cli_1 = require("../../../../cli/Cli");
19
+ const request_1 = require("../../../../request");
20
+ const validation_1 = require("../../../../utils/validation");
21
+ const formatting_1 = require("../../../../utils/formatting");
22
+ const SpoCommand_1 = require("../../../base/SpoCommand");
23
+ const commands_1 = require("../../commands");
24
+ const SpoFileGetCommand = require("./file-get");
25
+ class SpoFileRoleInheritanceResetCommand extends SpoCommand_1.default {
26
+ constructor() {
27
+ super();
28
+ _SpoFileRoleInheritanceResetCommand_instances.add(this);
29
+ __classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initTelemetry).call(this);
30
+ __classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initOptions).call(this);
31
+ __classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initValidators).call(this);
32
+ __classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initOptionSets).call(this);
33
+ }
34
+ get name() {
35
+ return commands_1.default.FILE_ROLEINHERITANCE_RESET;
36
+ }
37
+ get description() {
38
+ return 'Restores the role inheritance of a file';
39
+ }
40
+ commandAction(logger, args) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const resetFileRoleInheritance = () => __awaiter(this, void 0, void 0, function* () {
43
+ try {
44
+ const fileURL = yield this.getFileURL(args);
45
+ const requestOptions = {
46
+ url: `${args.options.webUrl}/_api/web/GetFileByServerRelativeUrl('${formatting_1.formatting.encodeQueryParameter(fileURL)}')/ListItemAllFields/resetroleinheritance`,
47
+ headers: {
48
+ accept: 'application/json;odata.metadata=none'
49
+ },
50
+ responseType: 'json'
51
+ };
52
+ yield request_1.default.post(requestOptions);
53
+ }
54
+ catch (err) {
55
+ this.handleRejectedODataJsonPromise(err);
56
+ }
57
+ });
58
+ if (args.options.confirm) {
59
+ yield resetFileRoleInheritance();
60
+ }
61
+ else {
62
+ const result = yield Cli_1.Cli.prompt({
63
+ type: 'confirm',
64
+ name: 'continue',
65
+ default: false,
66
+ message: `Are you sure you want to reset the role inheritance of file ${args.options.fileUrl || args.options.fileId} located in site ${args.options.webUrl}?`
67
+ });
68
+ if (result.continue) {
69
+ yield resetFileRoleInheritance();
70
+ }
71
+ }
72
+ });
73
+ }
74
+ getFileURL(args) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ if (args.options.fileUrl) {
77
+ return args.options.fileUrl;
78
+ }
79
+ const options = {
80
+ webUrl: args.options.webUrl,
81
+ id: args.options.fileId,
82
+ output: 'json',
83
+ debug: this.debug,
84
+ verbose: this.verbose
85
+ };
86
+ const output = yield Cli_1.Cli.executeCommandWithOutput(SpoFileGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
87
+ const getFileOutput = JSON.parse(output.stdout);
88
+ return getFileOutput.ServerRelativeUrl;
89
+ });
90
+ }
91
+ }
92
+ _SpoFileRoleInheritanceResetCommand_instances = new WeakSet(), _SpoFileRoleInheritanceResetCommand_initTelemetry = function _SpoFileRoleInheritanceResetCommand_initTelemetry() {
93
+ this.telemetry.push((args) => {
94
+ Object.assign(this.telemetryProperties, {
95
+ fileUrl: typeof args.options.fileUrl !== 'undefined',
96
+ fileId: typeof args.options.fileId !== 'undefined',
97
+ confirm: !!args.options.confirm
98
+ });
99
+ });
100
+ }, _SpoFileRoleInheritanceResetCommand_initOptions = function _SpoFileRoleInheritanceResetCommand_initOptions() {
101
+ this.options.unshift({
102
+ option: '-u, --webUrl <webUrl>'
103
+ }, {
104
+ option: '--fileUrl [fileUrl]'
105
+ }, {
106
+ option: 'i, --fileId [fileId]'
107
+ }, {
108
+ option: '--confirm'
109
+ });
110
+ }, _SpoFileRoleInheritanceResetCommand_initValidators = function _SpoFileRoleInheritanceResetCommand_initValidators() {
111
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
112
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
113
+ if (isValidSharePointUrl !== true) {
114
+ return isValidSharePointUrl;
115
+ }
116
+ if (args.options.fileId && !validation_1.validation.isValidGuid(args.options.fileId)) {
117
+ return `${args.options.fileId} is not a valid GUID`;
118
+ }
119
+ return true;
120
+ }));
121
+ }, _SpoFileRoleInheritanceResetCommand_initOptionSets = function _SpoFileRoleInheritanceResetCommand_initOptionSets() {
122
+ this.optionSets.push(['fileId', 'fileUrl']);
123
+ };
124
+ module.exports = new SpoFileRoleInheritanceResetCommand();
125
+ //# sourceMappingURL=file-roleinheritance-reset.js.map
@@ -16,7 +16,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
16
16
  var _SpoFileSharinginfoGetCommand_instances, _SpoFileSharinginfoGetCommand_initTelemetry, _SpoFileSharinginfoGetCommand_initOptions, _SpoFileSharinginfoGetCommand_initValidators, _SpoFileSharinginfoGetCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
- const utils_1 = require("../../../../utils");
19
+ const formatting_1 = require("../../../../utils/formatting");
20
+ const validation_1 = require("../../../../utils/validation");
20
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
21
22
  const commands_1 = require("../../commands");
22
23
  const FileSharingPrincipalType_1 = require("./FileSharingPrincipalType");
@@ -38,55 +39,57 @@ class SpoFileSharinginfoGetCommand extends SpoCommand_1.default {
38
39
  getExcludedOptionsWithUrls() {
39
40
  return ['fileUrl'];
40
41
  }
41
- commandAction(logger, args, cb) {
42
- if (this.verbose) {
43
- logger.logToStderr(`Retrieving sharing information report for the file...`);
44
- }
45
- this
46
- .getNeededFileInformation(args)
47
- .then((fileInformation) => {
42
+ commandAction(logger, args) {
43
+ return __awaiter(this, void 0, void 0, function* () {
48
44
  if (this.verbose) {
49
- logger.logToStderr(`Retrieving sharing information report for the file with item Id ${fileInformation.fileItemId}`);
50
- }
51
- const requestOptions = {
52
- url: `${args.options.webUrl}/_api/web/lists/getbytitle('${utils_1.formatting.encodeQueryParameter(fileInformation.libraryName)}')/items(${fileInformation.fileItemId})/GetSharingInformation?$select=permissionsInformation&$Expand=permissionsInformation`,
53
- headers: {
54
- 'accept': 'application/json;odata=nometadata'
55
- },
56
- responseType: 'json'
57
- };
58
- return request_1.default.post(requestOptions);
59
- }).then((res) => {
60
- // typically, we don't do this, but in this case, we need to due to
61
- // the complexity of the retrieved object and the fact that we can't
62
- // use the generic way of simplifying the output
63
- if (args.options.output === 'json') {
64
- logger.log(res);
45
+ logger.logToStderr(`Retrieving sharing information report for the file...`);
65
46
  }
66
- else {
67
- const fileSharingInfoCollection = [];
68
- res.permissionsInformation.links.forEach(link => {
69
- link.linkDetails.Invitations.forEach(linkInvite => {
70
- fileSharingInfoCollection.push({
71
- SharedWith: linkInvite.invitee.name,
72
- IsActive: linkInvite.invitee.isActive,
73
- IsExternal: linkInvite.invitee.isExternal,
74
- PrincipalType: FileSharingPrincipalType_1.FileSharingPrincipalType[parseInt(linkInvite.invitee.principalType)]
47
+ try {
48
+ const fileInformation = yield this.getNeededFileInformation(args);
49
+ if (this.verbose) {
50
+ logger.logToStderr(`Retrieving sharing information report for the file with item Id ${fileInformation.fileItemId}`);
51
+ }
52
+ const requestOptions = {
53
+ url: `${args.options.webUrl}/_api/web/lists/getbytitle('${formatting_1.formatting.encodeQueryParameter(fileInformation.libraryName)}')/items(${fileInformation.fileItemId})/GetSharingInformation?$select=permissionsInformation&$Expand=permissionsInformation`,
54
+ headers: {
55
+ 'accept': 'application/json;odata=nometadata'
56
+ },
57
+ responseType: 'json'
58
+ };
59
+ const res = yield request_1.default.post(requestOptions);
60
+ // typically, we don't do this, but in this case, we need to due to
61
+ // the complexity of the retrieved object and the fact that we can't
62
+ // use the generic way of simplifying the output
63
+ if (args.options.output === 'json') {
64
+ logger.log(res);
65
+ }
66
+ else {
67
+ const fileSharingInfoCollection = [];
68
+ res.permissionsInformation.links.forEach(link => {
69
+ link.linkDetails.Invitations.forEach(linkInvite => {
70
+ fileSharingInfoCollection.push({
71
+ SharedWith: linkInvite.invitee.name,
72
+ IsActive: linkInvite.invitee.isActive,
73
+ IsExternal: linkInvite.invitee.isExternal,
74
+ PrincipalType: FileSharingPrincipalType_1.FileSharingPrincipalType[parseInt(linkInvite.invitee.principalType)]
75
+ });
75
76
  });
76
77
  });
77
- });
78
- res.permissionsInformation.principals.forEach(principal => {
79
- fileSharingInfoCollection.push({
80
- SharedWith: principal.principal.name,
81
- IsActive: principal.principal.isActive,
82
- IsExternal: principal.principal.isExternal,
83
- PrincipalType: FileSharingPrincipalType_1.FileSharingPrincipalType[parseInt(principal.principal.principalType)]
78
+ res.permissionsInformation.principals.forEach(principal => {
79
+ fileSharingInfoCollection.push({
80
+ SharedWith: principal.principal.name,
81
+ IsActive: principal.principal.isActive,
82
+ IsExternal: principal.principal.isExternal,
83
+ PrincipalType: FileSharingPrincipalType_1.FileSharingPrincipalType[parseInt(principal.principal.principalType)]
84
+ });
84
85
  });
85
- });
86
- logger.log(fileSharingInfoCollection);
86
+ logger.log(fileSharingInfoCollection);
87
+ }
88
+ }
89
+ catch (err) {
90
+ this.handleRejectedODataJsonPromise(err);
87
91
  }
88
- cb();
89
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
92
+ });
90
93
  }
91
94
  getNeededFileInformation(args) {
92
95
  let requestUrl = '';
@@ -127,12 +130,12 @@ _SpoFileSharinginfoGetCommand_instances = new WeakSet(), _SpoFileSharinginfoGetC
127
130
  });
128
131
  }, _SpoFileSharinginfoGetCommand_initValidators = function _SpoFileSharinginfoGetCommand_initValidators() {
129
132
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
130
- const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
133
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
131
134
  if (isValidSharePointUrl !== true) {
132
135
  return isValidSharePointUrl;
133
136
  }
134
137
  if (args.options.fileId) {
135
- if (!utils_1.validation.isValidGuid(args.options.fileId)) {
138
+ if (!validation_1.validation.isValidGuid(args.options.fileId)) {
136
139
  return `${args.options.fileId} is not a valid GUID`;
137
140
  }
138
141
  }
@@ -16,7 +16,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
16
16
  var _SpoFolderAddCommand_instances, _SpoFolderAddCommand_initOptions, _SpoFolderAddCommand_initValidators;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const request_1 = require("../../../../request");
19
- const utils_1 = require("../../../../utils");
19
+ const urlUtil_1 = require("../../../../utils/urlUtil");
20
+ const validation_1 = require("../../../../utils/validation");
20
21
  const SpoCommand_1 = require("../../../base/SpoCommand");
21
22
  const commands_1 = require("../../commands");
22
23
  class SpoFolderAddCommand extends SpoCommand_1.default {
@@ -32,29 +33,32 @@ class SpoFolderAddCommand extends SpoCommand_1.default {
32
33
  get description() {
33
34
  return 'Creates a folder within a parent folder';
34
35
  }
35
- commandAction(logger, args, cb) {
36
- if (this.verbose) {
37
- logger.logToStderr(`Adding folder to site ${args.options.webUrl}...`);
38
- }
39
- const parentFolderServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.parentFolderUrl);
40
- const serverRelativeUrl = `${parentFolderServerRelativeUrl}/${args.options.name}`;
41
- const requestUrl = `${args.options.webUrl}/_api/web/folders`;
42
- const requestOptions = {
43
- url: requestUrl,
44
- headers: {
45
- 'accept': 'application/json;odata=nometadata'
46
- },
47
- data: {
48
- 'ServerRelativeUrl': serverRelativeUrl
49
- },
50
- responseType: 'json'
51
- };
52
- request_1.default
53
- .post(requestOptions)
54
- .then((folder) => {
55
- logger.log(folder);
56
- cb();
57
- }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
36
+ commandAction(logger, args) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (this.verbose) {
39
+ logger.logToStderr(`Adding folder to site ${args.options.webUrl}...`);
40
+ }
41
+ const parentFolderServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.parentFolderUrl);
42
+ const serverRelativeUrl = `${parentFolderServerRelativeUrl}/${args.options.name}`;
43
+ const requestUrl = `${args.options.webUrl}/_api/web/folders`;
44
+ const requestOptions = {
45
+ url: requestUrl,
46
+ headers: {
47
+ 'accept': 'application/json;odata=nometadata'
48
+ },
49
+ data: {
50
+ 'ServerRelativeUrl': serverRelativeUrl
51
+ },
52
+ responseType: 'json'
53
+ };
54
+ try {
55
+ const folder = yield request_1.default.post(requestOptions);
56
+ logger.log(folder);
57
+ }
58
+ catch (err) {
59
+ this.handleRejectedODataJsonPromise(err);
60
+ }
61
+ });
58
62
  }
59
63
  }
60
64
  _SpoFolderAddCommand_instances = new WeakSet(), _SpoFolderAddCommand_initOptions = function _SpoFolderAddCommand_initOptions() {
@@ -66,7 +70,7 @@ _SpoFolderAddCommand_instances = new WeakSet(), _SpoFolderAddCommand_initOptions
66
70
  option: '-n, --name <name>'
67
71
  });
68
72
  }, _SpoFolderAddCommand_initValidators = function _SpoFolderAddCommand_initValidators() {
69
- this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return utils_1.validation.isValidSharePointUrl(args.options.webUrl); }));
73
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
70
74
  };
71
75
  module.exports = new SpoFolderAddCommand();
72
76
  //# sourceMappingURL=folder-add.js.map