@pnp/cli-microsoft365 6.0.0-beta.dc71aa3 → 6.0.0-beta.dc8d53d

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 (326) hide show
  1. package/LICENSE +1 -3
  2. package/dist/Command.js +8 -6
  3. package/dist/cli/Cli.js +64 -6
  4. package/dist/m365/aad/commands/app/app-add.js +1 -1
  5. package/dist/m365/aad/commands/app/app-get.js +1 -1
  6. package/dist/m365/aad/commands/app/app-remove.js +1 -1
  7. package/dist/m365/aad/commands/app/app-role-add.js +1 -1
  8. package/dist/m365/aad/commands/app/app-role-list.js +1 -1
  9. package/dist/m365/aad/commands/app/app-role-remove.js +1 -1
  10. package/dist/m365/aad/commands/app/app-set.js +1 -1
  11. package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +1 -1
  12. package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +1 -1
  13. package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +1 -1
  14. package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +1 -1
  15. package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +1 -1
  16. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-remove.js +1 -1
  17. package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +1 -1
  18. package/dist/m365/aad/commands/o365group/o365group-teamify.js +1 -1
  19. package/dist/m365/aad/commands/o365group/o365group-user-add.js +1 -1
  20. package/dist/m365/aad/commands/o365group/o365group-user-remove.js +1 -1
  21. package/dist/m365/aad/commands/o365group/o365group-user-set.js +1 -1
  22. package/dist/m365/aad/commands/sp/sp-add.js +1 -1
  23. package/dist/m365/aad/commands/sp/sp-get.js +1 -1
  24. package/dist/m365/aad/commands/user/user-get.js +1 -1
  25. package/dist/m365/aad/commands/user/user-set.js +1 -1
  26. package/dist/m365/adaptivecard/commands/adaptivecard-send.js +1 -1
  27. package/dist/m365/booking/commands/business/business-get.js +1 -1
  28. package/dist/m365/cli/commands/config/config-set.js +4 -0
  29. package/dist/m365/commands/login.js +6 -1
  30. package/dist/m365/outlook/commands/message/message-list.js +1 -1
  31. package/dist/m365/outlook/commands/message/message-move.js +1 -1
  32. package/dist/m365/pa/commands/app/app-get.js +1 -1
  33. package/dist/m365/planner/commands/bucket/bucket-add.js +1 -1
  34. package/dist/m365/planner/commands/bucket/bucket-get.js +1 -1
  35. package/dist/m365/planner/commands/bucket/bucket-list.js +1 -1
  36. package/dist/m365/planner/commands/bucket/bucket-remove.js +1 -1
  37. package/dist/m365/planner/commands/bucket/bucket-set.js +1 -1
  38. package/dist/m365/planner/commands/plan/plan-add.js +1 -1
  39. package/dist/m365/planner/commands/plan/plan-get.js +1 -1
  40. package/dist/m365/planner/commands/plan/plan-list.js +1 -1
  41. package/dist/m365/planner/commands/plan/plan-remove.js +1 -1
  42. package/dist/m365/planner/commands/task/task-add.js +1 -1
  43. package/dist/m365/planner/commands/task/task-get.js +1 -1
  44. package/dist/m365/planner/commands/task/task-reference-remove.js +1 -1
  45. package/dist/m365/planner/commands/task/task-remove.js +1 -1
  46. package/dist/m365/pp/commands/card/card-clone.js +2 -2
  47. package/dist/m365/pp/commands/card/card-get.js +2 -2
  48. package/dist/m365/pp/commands/card/card-list.js +1 -1
  49. package/dist/m365/pp/commands/card/card-remove.js +2 -2
  50. package/dist/m365/pp/commands/dataverse/dataverse-table-get.js +1 -1
  51. package/dist/m365/pp/commands/dataverse/dataverse-table-list.js +1 -1
  52. package/dist/m365/pp/commands/dataverse/dataverse-table-remove.js +1 -1
  53. package/dist/m365/pp/commands/environment/environment-get.js +1 -1
  54. package/dist/m365/pp/commands/environment/environment-list.js +1 -1
  55. package/dist/m365/pp/commands/managementapp/managementapp-add.js +1 -1
  56. package/dist/m365/pp/commands/solution/solution-get.js +2 -2
  57. package/dist/m365/pp/commands/solution/solution-list.js +1 -1
  58. package/dist/m365/pp/commands/solution/solution-publisher-get.js +2 -2
  59. package/dist/m365/pp/commands/solution/solution-publisher-list.js +1 -1
  60. package/dist/m365/pp/commands/solution/solution-publisher-remove.js +2 -2
  61. package/dist/m365/pp/commands/solution/solution-remove.js +2 -2
  62. package/dist/m365/search/commands/externalconnection/externalconnection-get.js +1 -1
  63. package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +1 -1
  64. package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.16.0-rc.0.js → doctor-1.16.0.js} +1 -1
  65. package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
  66. package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.16.0-rc.0.js → upgrade-1.16.0.js} +26 -26
  67. package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
  68. package/dist/m365/spfx/commands/spfx-doctor.js +1 -1
  69. package/dist/m365/spo/commands/app/app-deploy.js +1 -1
  70. package/dist/m365/spo/commands/app/app-get.js +1 -1
  71. package/dist/m365/spo/commands/app/app-list.js +4 -11
  72. package/dist/m365/spo/commands/contenttype/contenttype-get.js +1 -1
  73. package/dist/m365/spo/commands/contenttype/contenttype-list.js +3 -10
  74. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +1 -1
  75. package/dist/m365/spo/commands/contenttype/contenttype-set.js +1 -1
  76. package/dist/m365/spo/commands/customaction/customaction-get.js +1 -1
  77. package/dist/m365/spo/commands/customaction/customaction-list.js +4 -17
  78. package/dist/m365/spo/commands/customaction/customaction-remove.js +1 -1
  79. package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +44 -28
  80. package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +3 -10
  81. package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +3 -9
  82. package/dist/m365/spo/commands/feature/feature-list.js +4 -11
  83. package/dist/m365/spo/commands/field/field-get.js +1 -1
  84. package/dist/m365/spo/commands/field/field-list.js +3 -10
  85. package/dist/m365/spo/commands/field/field-remove.js +1 -1
  86. package/dist/m365/spo/commands/field/field-set.js +1 -1
  87. package/dist/m365/spo/commands/file/file-checkin.js +1 -1
  88. package/dist/m365/spo/commands/file/file-checkout.js +1 -1
  89. package/dist/m365/spo/commands/file/file-get.js +28 -2
  90. package/dist/m365/spo/commands/file/file-remove.js +1 -1
  91. package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
  92. package/dist/m365/spo/commands/file/file-roleassignment-remove.js +1 -1
  93. package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
  94. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
  95. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +1 -1
  96. package/dist/m365/spo/commands/file/file-version-clear.js +1 -1
  97. package/dist/m365/spo/commands/file/file-version-get.js +1 -1
  98. package/dist/m365/spo/commands/file/file-version-list.js +7 -11
  99. package/dist/m365/spo/commands/file/file-version-remove.js +1 -1
  100. package/dist/m365/spo/commands/file/file-version-restore.js +1 -1
  101. package/dist/m365/spo/commands/folder/folder-get.js +30 -5
  102. package/dist/m365/spo/commands/folder/folder-list.js +4 -11
  103. package/dist/m365/spo/commands/group/group-add.js +1 -1
  104. package/dist/m365/spo/commands/group/group-get.js +1 -1
  105. package/dist/m365/spo/commands/group/group-list.js +4 -9
  106. package/dist/m365/spo/commands/group/group-member-add.js +1 -1
  107. package/dist/m365/spo/commands/group/group-member-list.js +4 -11
  108. package/dist/m365/spo/commands/group/group-member-remove.js +1 -1
  109. package/dist/m365/spo/commands/group/group-remove.js +1 -1
  110. package/dist/m365/spo/commands/group/group-set.js +1 -1
  111. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +1 -1
  112. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +1 -1
  113. package/dist/m365/spo/commands/hubsite/hubsite-get.js +1 -1
  114. package/dist/m365/spo/commands/hubsite/hubsite-list.js +4 -10
  115. package/dist/m365/spo/commands/list/list-contenttype-add.js +1 -1
  116. package/dist/m365/spo/commands/list/list-contenttype-default-set.js +1 -1
  117. package/dist/m365/spo/commands/list/list-contenttype-list.js +4 -12
  118. package/dist/m365/spo/commands/list/list-contenttype-remove.js +1 -1
  119. package/dist/m365/spo/commands/list/list-get.js +13 -5
  120. package/dist/m365/spo/commands/list/list-label-get.js +34 -22
  121. package/dist/m365/spo/commands/list/list-label-set.js +1 -1
  122. package/dist/m365/spo/commands/list/list-list.js +4 -12
  123. package/dist/m365/spo/commands/list/list-remove.js +1 -1
  124. package/dist/m365/spo/commands/list/list-roleassignment-add.js +1 -1
  125. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +1 -1
  126. package/dist/m365/spo/commands/list/list-roleinheritance-break.js +1 -1
  127. package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +1 -1
  128. package/dist/m365/spo/commands/list/list-set.js +1 -1
  129. package/dist/m365/spo/commands/list/list-sitescript-get.js +35 -24
  130. package/dist/m365/spo/commands/list/list-view-add.js +1 -1
  131. package/dist/m365/spo/commands/list/list-view-field-add.js +1 -1
  132. package/dist/m365/spo/commands/list/list-view-field-remove.js +1 -1
  133. package/dist/m365/spo/commands/list/list-view-field-set.js +1 -1
  134. package/dist/m365/spo/commands/list/list-view-get.js +1 -1
  135. package/dist/m365/spo/commands/list/list-view-list.js +4 -11
  136. package/dist/m365/spo/commands/list/list-view-remove.js +1 -1
  137. package/dist/m365/spo/commands/list/list-view-set.js +1 -1
  138. package/dist/m365/spo/commands/list/list-webhook-add.js +1 -1
  139. package/dist/m365/spo/commands/list/list-webhook-get.js +1 -1
  140. package/dist/m365/spo/commands/list/list-webhook-list.js +6 -14
  141. package/dist/m365/spo/commands/list/list-webhook-remove.js +1 -1
  142. package/dist/m365/spo/commands/list/list-webhook-set.js +1 -1
  143. package/dist/m365/spo/commands/listitem/listitem-add.js +1 -1
  144. package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +1 -1
  145. package/dist/m365/spo/commands/listitem/listitem-batch-add.js +202 -0
  146. package/dist/m365/spo/commands/listitem/listitem-get.js +28 -5
  147. package/dist/m365/spo/commands/listitem/listitem-isrecord.js +1 -1
  148. package/dist/m365/spo/commands/listitem/listitem-list.js +1 -1
  149. package/dist/m365/spo/commands/listitem/listitem-record-declare.js +1 -1
  150. package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +1 -1
  151. package/dist/m365/spo/commands/listitem/listitem-remove.js +1 -1
  152. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +1 -1
  153. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +1 -1
  154. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +1 -1
  155. package/dist/m365/spo/commands/listitem/listitem-set.js +1 -1
  156. package/dist/m365/spo/commands/navigation/navigation-node-list.js +3 -10
  157. package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +1 -1
  158. package/dist/m365/spo/commands/page/page-list.js +7 -21
  159. package/dist/m365/spo/commands/page/page-set.js +36 -3
  160. package/dist/m365/spo/commands/page/page-template-list.js +4 -11
  161. package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +3 -10
  162. package/dist/m365/spo/commands/site/site-apppermission-add.js +1 -1
  163. package/dist/m365/spo/commands/site/site-apppermission-remove.js +1 -1
  164. package/dist/m365/spo/commands/site/site-apppermission-set.js +1 -1
  165. package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +1 -1
  166. package/dist/m365/spo/commands/term/term-add.js +1 -1
  167. package/dist/m365/spo/commands/term/term-get.js +1 -1
  168. package/dist/m365/spo/commands/term/term-group-get.js +1 -1
  169. package/dist/m365/spo/commands/term/term-list.js +1 -1
  170. package/dist/m365/spo/commands/term/term-set-add.js +1 -1
  171. package/dist/m365/spo/commands/term/term-set-get.js +1 -1
  172. package/dist/m365/spo/commands/term/term-set-list.js +1 -1
  173. package/dist/m365/spo/commands/user/user-get.js +1 -1
  174. package/dist/m365/spo/commands/user/user-remove.js +1 -1
  175. package/dist/m365/spo/commands/web/web-get.js +24 -1
  176. package/dist/m365/spo/commands/web/web-list.js +3 -10
  177. package/dist/m365/spo/commands/web/web-roleassignment-add.js +1 -1
  178. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +1 -1
  179. package/dist/m365/spo/commands.js +1 -0
  180. package/dist/m365/teams/commands/app/app-install.js +1 -1
  181. package/dist/m365/teams/commands/app/app-update.js +1 -1
  182. package/dist/m365/teams/commands/cache/cache-remove.js +41 -10
  183. package/dist/m365/teams/commands/channel/channel-add.js +1 -1
  184. package/dist/m365/teams/commands/channel/channel-get.js +1 -1
  185. package/dist/m365/teams/commands/channel/channel-list.js +1 -1
  186. package/dist/m365/teams/commands/channel/channel-member-add.js +1 -1
  187. package/dist/m365/teams/commands/channel/channel-member-list.js +1 -1
  188. package/dist/m365/teams/commands/channel/channel-member-remove.js +1 -1
  189. package/dist/m365/teams/commands/channel/channel-member-set.js +1 -1
  190. package/dist/m365/teams/commands/channel/channel-remove.js +1 -1
  191. package/dist/m365/teams/commands/channel/channel-set.js +1 -1
  192. package/dist/m365/teams/commands/chat/chat-get.js +1 -1
  193. package/dist/m365/teams/commands/chat/chat-message-send.js +1 -1
  194. package/dist/m365/teams/commands/meeting/meeting-get.js +134 -0
  195. package/dist/m365/teams/commands/tab/tab-get.js +1 -1
  196. package/dist/m365/teams/commands/team/team-archive.js +1 -1
  197. package/dist/m365/teams/commands/team/team-clone.js +1 -1
  198. package/dist/m365/teams/commands/team/team-get.js +1 -1
  199. package/dist/m365/teams/commands/team/team-remove.js +1 -1
  200. package/dist/m365/teams/commands/team/team-unarchive.js +1 -1
  201. package/dist/m365/teams/commands/user/user-app-list.js +1 -1
  202. package/dist/m365/teams/commands.js +1 -0
  203. package/dist/m365/todo/commands/list/list-get.js +1 -1
  204. package/dist/m365/todo/commands/list/list-remove.js +1 -1
  205. package/dist/m365/todo/commands/list/list-set.js +1 -1
  206. package/dist/m365/todo/commands/task/task-add.js +1 -1
  207. package/dist/m365/todo/commands/task/task-get.js +1 -1
  208. package/dist/m365/todo/commands/task/task-list.js +1 -1
  209. package/dist/m365/todo/commands/task/task-remove.js +1 -1
  210. package/dist/m365/todo/commands/task/task-set.js +1 -1
  211. package/dist/settingsNames.js +1 -0
  212. package/dist/utils/formatting.js +15 -15
  213. package/dist/utils/odata.js +2 -1
  214. package/docs/docs/_clisettings.md +1 -0
  215. package/docs/docs/cmd/_global.md +2 -2
  216. package/docs/docs/cmd/aad/user/user-guest-add.md +1 -1
  217. package/docs/docs/cmd/app/app-open.md +1 -1
  218. package/docs/docs/cmd/flow/environment/environment-get.md +100 -0
  219. package/docs/docs/cmd/flow/environment/environment-list.md +97 -0
  220. package/docs/docs/cmd/flow/flow-disable.md +7 -3
  221. package/docs/docs/cmd/flow/flow-enable.md +4 -0
  222. package/docs/docs/cmd/flow/flow-export.md +20 -0
  223. package/docs/docs/cmd/flow/flow-get.md +372 -0
  224. package/docs/docs/cmd/flow/flow-list.md +107 -0
  225. package/docs/docs/cmd/flow/flow-remove.md +4 -0
  226. package/docs/docs/cmd/flow/run/run-cancel.md +4 -0
  227. package/docs/docs/cmd/flow/run/run-get.md +72 -0
  228. package/docs/docs/cmd/flow/run/run-list.md +68 -0
  229. package/docs/docs/cmd/flow/run/run-resubmit.md +4 -0
  230. package/docs/docs/cmd/pp/card/card-clone.md +1 -1
  231. package/docs/docs/cmd/pp/card/card-get.md +1 -1
  232. package/docs/docs/cmd/pp/card/card-list.md +1 -1
  233. package/docs/docs/cmd/pp/dataverse/dataverse-table-get.md +1 -1
  234. package/docs/docs/cmd/pp/dataverse/dataverse-table-list.md +1 -1
  235. package/docs/docs/cmd/pp/dataverse/dataverse-table-remove.md +1 -1
  236. package/docs/docs/cmd/pp/environment/environment-get.md +1 -1
  237. package/docs/docs/cmd/pp/environment/environment-list.md +1 -1
  238. package/docs/docs/cmd/pp/solution/solution-get.md +1 -1
  239. package/docs/docs/cmd/pp/solution/solution-list.md +1 -1
  240. package/docs/docs/cmd/pp/solution/solution-publisher-get.md +1 -1
  241. package/docs/docs/cmd/pp/solution/solution-publisher-list.md +1 -1
  242. package/docs/docs/cmd/spfx/package/package-generate.md +4 -0
  243. package/docs/docs/cmd/spfx/project/project-doctor.md +92 -0
  244. package/docs/docs/cmd/spfx/project/project-externalize.md +116 -0
  245. package/docs/docs/cmd/spfx/project/project-rename.md +6 -2
  246. package/docs/docs/cmd/spfx/project/project-upgrade.md +101 -1
  247. package/docs/docs/cmd/spfx/spfx-doctor.md +38 -0
  248. package/docs/docs/cmd/spo/eventreceiver/eventreceiver-get.md +42 -2
  249. package/docs/docs/cmd/spo/file/file-get.md +219 -8
  250. package/docs/docs/cmd/spo/file/file-version-list.md +5 -5
  251. package/docs/docs/cmd/spo/folder/folder-get.md +11 -0
  252. package/docs/docs/cmd/spo/homesite/homesite-get.md +31 -0
  253. package/docs/docs/cmd/spo/homesite/homesite-remove.md +20 -0
  254. package/docs/docs/cmd/spo/homesite/homesite-set.md +20 -0
  255. package/docs/docs/cmd/spo/hubsite/hubsite-data-get.md +57 -0
  256. package/docs/docs/cmd/spo/hubsite/hubsite-get.md +89 -0
  257. package/docs/docs/cmd/spo/hubsite/hubsite-list.md +94 -0
  258. package/docs/docs/cmd/spo/hubsite/hubsite-register.md +53 -0
  259. package/docs/docs/cmd/spo/hubsite/hubsite-rights-grant.md +4 -0
  260. package/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.md +4 -0
  261. package/docs/docs/cmd/spo/hubsite/hubsite-set.md +45 -0
  262. package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +4 -0
  263. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +20 -0
  264. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +20 -0
  265. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +20 -0
  266. package/docs/docs/cmd/spo/list/list-add.md +133 -0
  267. package/docs/docs/cmd/spo/list/list-contenttype-add.md +88 -1
  268. package/docs/docs/cmd/spo/list/list-contenttype-default-set.md +4 -0
  269. package/docs/docs/cmd/spo/list/list-contenttype-list.md +60 -0
  270. package/docs/docs/cmd/spo/list/list-contenttype-remove.md +4 -0
  271. package/docs/docs/cmd/spo/list/list-get.md +154 -6
  272. package/docs/docs/cmd/spo/list/list-label-get.md +83 -7
  273. package/docs/docs/cmd/spo/list/list-label-set.md +4 -0
  274. package/docs/docs/cmd/spo/list/list-list.md +89 -0
  275. package/docs/docs/cmd/spo/list/list-remove.md +4 -0
  276. package/docs/docs/cmd/spo/list/list-roleassignment-add.md +4 -0
  277. package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +4 -0
  278. package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +4 -0
  279. package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +4 -0
  280. package/docs/docs/cmd/spo/list/list-set.md +4 -0
  281. package/docs/docs/cmd/spo/list/list-sitescript-get.md +94 -8
  282. package/docs/docs/cmd/spo/list/list-view-add.md +121 -0
  283. package/docs/docs/cmd/spo/list/list-view-field-add.md +3 -0
  284. package/docs/docs/cmd/spo/list/list-view-field-remove.md +4 -0
  285. package/docs/docs/cmd/spo/list/list-view-field-set.md +3 -0
  286. package/docs/docs/cmd/spo/list/list-view-get.md +121 -0
  287. package/docs/docs/cmd/spo/list/list-view-list.md +78 -0
  288. package/docs/docs/cmd/spo/list/list-view-remove.md +4 -0
  289. package/docs/docs/cmd/spo/list/list-view-set.md +4 -0
  290. package/docs/docs/cmd/spo/list/list-webhook-add.md +33 -0
  291. package/docs/docs/cmd/spo/list/list-webhook-get.md +33 -0
  292. package/docs/docs/cmd/spo/list/list-webhook-list.md +32 -0
  293. package/docs/docs/cmd/spo/list/list-webhook-remove.md +4 -0
  294. package/docs/docs/cmd/spo/listitem/listitem-add.md +59 -0
  295. package/docs/docs/cmd/spo/listitem/listitem-attachment-list.md +34 -0
  296. package/docs/docs/cmd/spo/listitem/listitem-batch-add.md +61 -0
  297. package/docs/docs/cmd/spo/listitem/listitem-get.md +188 -4
  298. package/docs/docs/cmd/spo/listitem/listitem-isrecord.md +19 -0
  299. package/docs/docs/cmd/spo/listitem/listitem-list.md +41 -0
  300. package/docs/docs/cmd/spo/listitem/listitem-record-declare.md +29 -0
  301. package/docs/docs/cmd/spo/listitem/listitem-record-undeclare.md +4 -0
  302. package/docs/docs/cmd/spo/listitem/listitem-remove.md +4 -0
  303. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-add.md +5 -1
  304. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +4 -0
  305. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +5 -1
  306. package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.md +4 -0
  307. package/docs/docs/cmd/spo/listitem/listitem-set.md +59 -0
  308. package/docs/docs/cmd/spo/mail/mail-send.md +4 -0
  309. package/docs/docs/cmd/spo/navigation/navigation-node-add.md +39 -0
  310. package/docs/docs/cmd/spo/navigation/navigation-node-list.md +29 -0
  311. package/docs/docs/cmd/spo/navigation/navigation-node-remove.md +4 -0
  312. package/docs/docs/cmd/spo/page/page-add.md +2 -2
  313. package/docs/docs/cmd/spo/page/page-set.md +15 -2
  314. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-add.md +3 -1
  315. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-list.md +3 -1
  316. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-revoke.md +3 -3
  317. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-approve.md +3 -3
  318. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-deny.md +3 -3
  319. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-list.md +3 -1
  320. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-set.md +3 -3
  321. package/docs/docs/cmd/spo/web/web-get.md +258 -2
  322. package/docs/docs/cmd/teams/meeting/meeting-get.md +159 -0
  323. package/package.json +2 -1
  324. package/dist/m365/spo/commands/group/GroupPropertiesCollection.js +0 -3
  325. package/dist/m365/spo/commands/list/ListInstanceCollection.js +0 -3
  326. package/dist/m365/spo/commands/page/PageTemplateResponse.js +0 -3
@@ -137,7 +137,7 @@ _SpoListWebhookAddCommand_instances = new WeakSet(), _SpoListWebhookAddCommand_i
137
137
  return true;
138
138
  }));
139
139
  }, _SpoListWebhookAddCommand_initOptionSets = function _SpoListWebhookAddCommand_initOptionSets() {
140
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
140
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
141
141
  };
142
142
  module.exports = new SpoListWebhookAddCommand();
143
143
  //# sourceMappingURL=list-webhook-add.js.map
@@ -111,7 +111,7 @@ _SpoListWebhookGetCommand_instances = new WeakSet(), _SpoListWebhookGetCommand_i
111
111
  return true;
112
112
  }));
113
113
  }, _SpoListWebhookGetCommand_initOptionSets = function _SpoListWebhookGetCommand_initOptionSets() {
114
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
114
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
115
115
  };
116
116
  module.exports = new SpoListWebhookGetCommand();
117
117
  //# sourceMappingURL=list-webhook-get.js.map
@@ -15,8 +15,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _SpoListWebhookListCommand_instances, _SpoListWebhookListCommand_initTelemetry, _SpoListWebhookListCommand_initOptions, _SpoListWebhookListCommand_initValidators, _SpoListWebhookListCommand_initOptionSets;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const request_1 = require("../../../../request");
19
18
  const formatting_1 = require("../../../../utils/formatting");
19
+ const odata_1 = require("../../../../utils/odata");
20
20
  const urlUtil_1 = require("../../../../utils/urlUtil");
21
21
  const validation_1 = require("../../../../utils/validation");
22
22
  const SpoCommand_1 = require("../../../base/SpoCommand");
@@ -55,21 +55,13 @@ class SpoListWebhookListCommand extends SpoCommand_1.default {
55
55
  const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
56
56
  requestUrl += `/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/Subscriptions`;
57
57
  }
58
- const requestOptions = {
59
- url: requestUrl,
60
- method: 'GET',
61
- headers: {
62
- 'accept': 'application/json;odata=nometadata'
63
- },
64
- responseType: 'json'
65
- };
66
58
  try {
67
- const res = yield request_1.default.get(requestOptions);
68
- if (res.value && res.value.length > 0) {
69
- res.value.forEach(w => {
59
+ const res = yield odata_1.odata.getAllItems(requestUrl);
60
+ if (res && res.length > 0) {
61
+ res.forEach(w => {
70
62
  w.clientState = w.clientState || '';
71
63
  });
72
- logger.log(res.value);
64
+ logger.log(res);
73
65
  }
74
66
  else {
75
67
  if (this.verbose) {
@@ -115,7 +107,7 @@ _SpoListWebhookListCommand_instances = new WeakSet(), _SpoListWebhookListCommand
115
107
  return true;
116
108
  }));
117
109
  }, _SpoListWebhookListCommand_initOptionSets = function _SpoListWebhookListCommand_initOptionSets() {
118
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
110
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
119
111
  };
120
112
  module.exports = new SpoListWebhookListCommand();
121
113
  //# sourceMappingURL=list-webhook-list.js.map
@@ -129,7 +129,7 @@ _SpoListWebhookRemoveCommand_instances = new WeakSet(), _SpoListWebhookRemoveCom
129
129
  return true;
130
130
  }));
131
131
  }, _SpoListWebhookRemoveCommand_initOptionSets = function _SpoListWebhookRemoveCommand_initOptionSets() {
132
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
132
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
133
133
  };
134
134
  module.exports = new SpoListWebhookRemoveCommand();
135
135
  //# sourceMappingURL=list-webhook-remove.js.map
@@ -132,7 +132,7 @@ _SpoListWebhookSetCommand_instances = new WeakSet(), _SpoListWebhookSetCommand_i
132
132
  return true;
133
133
  }));
134
134
  }, _SpoListWebhookSetCommand_initOptionSets = function _SpoListWebhookSetCommand_initOptionSets() {
135
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
135
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
136
136
  };
137
137
  module.exports = new SpoListWebhookSetCommand();
138
138
  //# sourceMappingURL=list-webhook-set.js.map
@@ -225,7 +225,7 @@ _SpoListItemAddCommand_instances = new WeakSet(), _SpoListItemAddCommand_initTel
225
225
  }, _SpoListItemAddCommand_initTypes = function _SpoListItemAddCommand_initTypes() {
226
226
  this.types.string.push('webUrl', 'listId', 'listTitle', 'listUrl', 'contentType', 'folder');
227
227
  }, _SpoListItemAddCommand_initOptionSets = function _SpoListItemAddCommand_initOptionSets() {
228
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
228
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
229
229
  };
230
230
  module.exports = new SpoListItemAddCommand();
231
231
  //# sourceMappingURL=listitem-add.js.map
@@ -112,7 +112,7 @@ _SpoListItemAttachmentListCommand_instances = new WeakSet(), _SpoListItemAttachm
112
112
  return true;
113
113
  }));
114
114
  }, _SpoListItemAttachmentListCommand_initOptionSets = function _SpoListItemAttachmentListCommand_initOptionSets() {
115
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
115
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
116
116
  };
117
117
  module.exports = new SpoListItemAttachmentListCommand();
118
118
  //# sourceMappingURL=listitem-attachment-list.js.map
@@ -0,0 +1,202 @@
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 __asyncValues = (this && this.__asyncValues) || function (o) {
17
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
18
+ var m = o[Symbol.asyncIterator], i;
19
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
20
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
21
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
22
+ };
23
+ var _SpoListItemBatchAddCommand_instances, _SpoListItemBatchAddCommand_initTelemetry, _SpoListItemBatchAddCommand_initOptions, _SpoListItemBatchAddCommand_initValidators, _SpoListItemBatchAddCommand_initTypes, _SpoListItemBatchAddCommand_initOptionSets;
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const fs = require("fs");
26
+ const request_1 = require("../../../../request");
27
+ const uuid_1 = require("uuid");
28
+ const formatting_1 = require("../../../../utils/formatting");
29
+ const urlUtil_1 = require("../../../../utils/urlUtil");
30
+ const validation_1 = require("../../../../utils/validation");
31
+ const SpoCommand_1 = require("../../../base/SpoCommand");
32
+ const commands_1 = require("../../commands");
33
+ class SpoListItemBatchAddCommand extends SpoCommand_1.default {
34
+ constructor() {
35
+ super();
36
+ _SpoListItemBatchAddCommand_instances.add(this);
37
+ __classPrivateFieldGet(this, _SpoListItemBatchAddCommand_instances, "m", _SpoListItemBatchAddCommand_initTelemetry).call(this);
38
+ __classPrivateFieldGet(this, _SpoListItemBatchAddCommand_instances, "m", _SpoListItemBatchAddCommand_initOptions).call(this);
39
+ __classPrivateFieldGet(this, _SpoListItemBatchAddCommand_instances, "m", _SpoListItemBatchAddCommand_initValidators).call(this);
40
+ __classPrivateFieldGet(this, _SpoListItemBatchAddCommand_instances, "m", _SpoListItemBatchAddCommand_initTypes).call(this);
41
+ __classPrivateFieldGet(this, _SpoListItemBatchAddCommand_instances, "m", _SpoListItemBatchAddCommand_initOptionSets).call(this);
42
+ }
43
+ allowUnknownOptions() {
44
+ return true;
45
+ }
46
+ get name() {
47
+ return commands_1.default.LISTITEM_BATCH_ADD;
48
+ }
49
+ get description() {
50
+ return 'Creates list items in a batch';
51
+ }
52
+ commandAction(logger, args) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ try {
55
+ if (this.verbose) {
56
+ logger.logToStderr(`Starting to create batch items from csv at path ${args.options.filePath}`);
57
+ }
58
+ const csvContent = fs.readFileSync(args.options.filePath, 'utf8');
59
+ const jsonContent = formatting_1.formatting.parseCsvToJson(csvContent);
60
+ yield this.addItemsAsBatch(jsonContent, args.options, logger);
61
+ }
62
+ catch (err) {
63
+ this.handleRejectedODataJsonPromise(err);
64
+ }
65
+ });
66
+ }
67
+ addItemsAsBatch(rows, options, logger) {
68
+ var e_1, _a;
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const requestUrl = this.getRequestUrl(options);
71
+ let itemsToAdd = [];
72
+ try {
73
+ for (var _b = __asyncValues(rows.entries()), _c; _c = yield _b.next(), !_c.done;) {
74
+ const [index, row] = _c.value;
75
+ itemsToAdd.push(this.getSingleItemRequestBody(row));
76
+ if (itemsToAdd.length === 100) {
77
+ if (this.verbose) {
78
+ logger.logToStderr(`Writing away batch of items, currently at: ${index + 1}/${rows.length}.`);
79
+ }
80
+ yield this.postBatchData(itemsToAdd, options.webUrl, requestUrl);
81
+ itemsToAdd = [];
82
+ }
83
+ }
84
+ }
85
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
86
+ finally {
87
+ try {
88
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
89
+ }
90
+ finally { if (e_1) throw e_1.error; }
91
+ }
92
+ if (itemsToAdd.length) {
93
+ if (this.verbose) {
94
+ logger.logToStderr(`Writing away ${itemsToAdd.length} items.`);
95
+ }
96
+ yield this.postBatchData(itemsToAdd, options.webUrl, requestUrl);
97
+ }
98
+ });
99
+ }
100
+ postBatchData(itemsToAdd, webUrl, requestUrl) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ const batchId = (0, uuid_1.v4)();
103
+ const requestBody = this.parseBatchRequestBody(itemsToAdd, batchId, requestUrl);
104
+ const requestOptions = {
105
+ url: `${webUrl}/_api/$batch`,
106
+ headers: {
107
+ 'Content-Type': `multipart/mixed; boundary=batch_${batchId}`,
108
+ 'Accept': 'application/json;odata=verbose'
109
+ },
110
+ data: requestBody.join('')
111
+ };
112
+ yield request_1.default.post(requestOptions);
113
+ });
114
+ }
115
+ parseBatchRequestBody(items, batchId, requestUrl) {
116
+ const changeSetId = (0, uuid_1.v4)();
117
+ const batchBody = [];
118
+ // add default batch body headers
119
+ batchBody.push(`--batch_${batchId}\n`);
120
+ batchBody.push(`Content-Type: multipart/mixed; boundary="changeset_${changeSetId}"\n\n`);
121
+ batchBody.push('Content-Transfer-Encoding: binary\n\n');
122
+ items.forEach((item) => {
123
+ batchBody.push(`--changeset_${changeSetId}\n`);
124
+ batchBody.push('Content-Type: application/http\n');
125
+ batchBody.push('Content-Transfer-Encoding: binary\n\n');
126
+ batchBody.push(`POST ${requestUrl} HTTP/1.1\n`);
127
+ batchBody.push(`Accept: application/json;odata=nometadata\n`);
128
+ batchBody.push(`Content-Type: application/json;odata=verbose\n`);
129
+ batchBody.push(`If-Match: *\n\n`);
130
+ batchBody.push(`{\n"formValues": ${JSON.stringify(item)}\n}`);
131
+ });
132
+ // close batch body
133
+ batchBody.push(`\n\n`);
134
+ batchBody.push(`--changeset_${changeSetId}--\n\n`);
135
+ batchBody.push(`--batch_${batchId}--\n`);
136
+ return batchBody;
137
+ }
138
+ getSingleItemRequestBody(row) {
139
+ const requestBody = [];
140
+ Object.keys(row).forEach(key => {
141
+ // have to do 'toString()' or the API will complain when entering a numeric field
142
+ requestBody.push({ FieldName: key, FieldValue: row[key].toString() });
143
+ });
144
+ return requestBody;
145
+ }
146
+ getRequestUrl(options) {
147
+ let listUrl = `${options.webUrl}/_api/web`;
148
+ if (options.listId) {
149
+ listUrl += `/lists(guid'${formatting_1.formatting.encodeQueryParameter(options.listId)}')`;
150
+ }
151
+ else if (options.listTitle) {
152
+ listUrl += `/lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(options.listTitle)}')`;
153
+ }
154
+ else if (options.listUrl) {
155
+ const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(options.webUrl, options.listUrl);
156
+ listUrl += `/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
157
+ }
158
+ return `${listUrl}/AddValidateUpdateItemUsingPath`;
159
+ }
160
+ }
161
+ _SpoListItemBatchAddCommand_instances = new WeakSet(), _SpoListItemBatchAddCommand_initTelemetry = function _SpoListItemBatchAddCommand_initTelemetry() {
162
+ this.telemetry.push((args) => {
163
+ Object.assign(this.telemetryProperties, {
164
+ listId: typeof args.options.listId !== 'undefined',
165
+ listTitle: typeof args.options.listTitle !== 'undefined',
166
+ listUrl: typeof args.options.listUrl !== 'undefined'
167
+ });
168
+ });
169
+ }, _SpoListItemBatchAddCommand_initOptions = function _SpoListItemBatchAddCommand_initOptions() {
170
+ this.options.unshift({
171
+ option: '-p, --filePath <filePath>'
172
+ }, {
173
+ option: '-u, --webUrl <webUrl>'
174
+ }, {
175
+ option: '-l, --listId [listId]'
176
+ }, {
177
+ option: '-t, --listTitle [listTitle]'
178
+ }, {
179
+ option: '--listUrl [listUrl]'
180
+ });
181
+ }, _SpoListItemBatchAddCommand_initValidators = function _SpoListItemBatchAddCommand_initValidators() {
182
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
183
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
184
+ if (isValidSharePointUrl !== true) {
185
+ return isValidSharePointUrl;
186
+ }
187
+ if (args.options.listId &&
188
+ !validation_1.validation.isValidGuid(args.options.listId)) {
189
+ return `${args.options.listId} in option listId is not a valid GUID`;
190
+ }
191
+ if (!fs.existsSync(args.options.filePath)) {
192
+ return `File with path ${args.options.filePath} does not exist`;
193
+ }
194
+ return true;
195
+ }));
196
+ }, _SpoListItemBatchAddCommand_initTypes = function _SpoListItemBatchAddCommand_initTypes() {
197
+ this.types.string.push('webUrl', 'filePath', 'listId', 'listTitle', 'listUrl');
198
+ }, _SpoListItemBatchAddCommand_initOptionSets = function _SpoListItemBatchAddCommand_initOptionSets() {
199
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
200
+ };
201
+ module.exports = new SpoListItemBatchAddCommand();
202
+ //# sourceMappingURL=listitem-batch-add.js.map
@@ -20,7 +20,9 @@ const formatting_1 = require("../../../../utils/formatting");
20
20
  const urlUtil_1 = require("../../../../utils/urlUtil");
21
21
  const validation_1 = require("../../../../utils/validation");
22
22
  const SpoCommand_1 = require("../../../base/SpoCommand");
23
+ const base_permissions_1 = require("../../base-permissions");
23
24
  const commands_1 = require("../../commands");
25
+ const RoleType_1 = require("../roledefinition/RoleType");
24
26
  class SpoListItemGetCommand extends SpoCommand_1.default {
25
27
  constructor() {
26
28
  super();
@@ -66,22 +68,41 @@ class SpoListItemGetCommand extends SpoCommand_1.default {
66
68
  responseType: 'json'
67
69
  };
68
70
  try {
69
- const response = yield request_1.default.get(requestOptions);
70
- delete response['ID'];
71
- logger.log(response);
71
+ const itemProperties = yield request_1.default.get(requestOptions);
72
+ if (args.options.withPermissions) {
73
+ requestOptions.url = `${requestUrl}/items(${args.options.id})/RoleAssignments?$expand=Member,RoleDefinitionBindings`;
74
+ const response = yield request_1.default.get(requestOptions);
75
+ const roleAssignments = this.setFriendlyPermissions(response.value);
76
+ itemProperties.RoleAssignments = roleAssignments;
77
+ }
78
+ delete itemProperties['ID'];
79
+ logger.log(itemProperties);
72
80
  }
73
81
  catch (err) {
74
82
  this.handleRejectedODataJsonPromise(err);
75
83
  }
76
84
  });
77
85
  }
86
+ setFriendlyPermissions(response) {
87
+ response.forEach((r) => {
88
+ r.RoleDefinitionBindings.forEach((r) => {
89
+ const permissions = new base_permissions_1.BasePermissions();
90
+ permissions.high = r.BasePermissions.High;
91
+ permissions.low = r.BasePermissions.Low;
92
+ r.BasePermissionsValue = permissions.parse();
93
+ r.RoleTypeKindValue = RoleType_1.RoleType[r.RoleTypeKind];
94
+ });
95
+ });
96
+ return response;
97
+ }
78
98
  }
79
99
  _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTelemetry = function _SpoListItemGetCommand_initTelemetry() {
80
100
  this.telemetry.push((args) => {
81
101
  Object.assign(this.telemetryProperties, {
82
102
  listId: typeof args.options.listId !== 'undefined',
83
103
  listTitle: typeof args.options.listTitle !== 'undefined',
84
- listUrl: typeof args.options.listUrl !== 'undefined'
104
+ listUrl: typeof args.options.listUrl !== 'undefined',
105
+ withPermissions: !!args.options.withPermissions
85
106
  });
86
107
  });
87
108
  }, _SpoListItemGetCommand_initOptions = function _SpoListItemGetCommand_initOptions() {
@@ -97,6 +118,8 @@ _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTel
97
118
  option: '--listUrl [listUrl]'
98
119
  }, {
99
120
  option: '-p, --properties [properties]'
121
+ }, {
122
+ option: '--withPermissions'
100
123
  });
101
124
  }, _SpoListItemGetCommand_initValidators = function _SpoListItemGetCommand_initValidators() {
102
125
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
@@ -116,7 +139,7 @@ _SpoListItemGetCommand_instances = new WeakSet(), _SpoListItemGetCommand_initTel
116
139
  }, _SpoListItemGetCommand_initTypes = function _SpoListItemGetCommand_initTypes() {
117
140
  this.types.string.push('webUrl', 'listId', 'listTitle', 'id', 'properties');
118
141
  }, _SpoListItemGetCommand_initOptionSets = function _SpoListItemGetCommand_initOptionSets() {
119
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
142
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
120
143
  };
121
144
  module.exports = new SpoListItemGetCommand();
122
145
  //# sourceMappingURL=listitem-get.js.map
@@ -165,7 +165,7 @@ _SpoListItemIsRecordCommand_instances = new WeakSet(), _SpoListItemIsRecordComma
165
165
  return true;
166
166
  }));
167
167
  }, _SpoListItemIsRecordCommand_initOptionSets = function _SpoListItemIsRecordCommand_initOptionSets() {
168
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
168
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
169
169
  };
170
170
  module.exports = new SpoListItemIsRecordCommand();
171
171
  //# sourceMappingURL=listitem-isrecord.js.map
@@ -177,7 +177,7 @@ _SpoListItemListCommand_instances = new WeakSet(), _SpoListItemListCommand_initT
177
177
  return true;
178
178
  }));
179
179
  }, _SpoListItemListCommand_initOptionSets = function _SpoListItemListCommand_initOptionSets() {
180
- this.optionSets.push(['listId', 'listTitle']);
180
+ this.optionSets.push({ options: ['listId', 'listTitle'] });
181
181
  }, _SpoListItemListCommand_initTypes = function _SpoListItemListCommand_initTypes() {
182
182
  this.types.string.push('webUrl', 'camlQuery', 'pageSize', 'pageNumber', 'fields', 'filter');
183
183
  };
@@ -149,7 +149,7 @@ _SpoListItemRecordDeclareCommand_instances = new WeakSet(), _SpoListItemRecordDe
149
149
  return true;
150
150
  }));
151
151
  }, _SpoListItemRecordDeclareCommand_initOptionSets = function _SpoListItemRecordDeclareCommand_initOptionSets() {
152
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
152
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
153
153
  };
154
154
  module.exports = new SpoListItemRecordDeclareCommand();
155
155
  //# sourceMappingURL=listitem-record-declare.js.map
@@ -127,7 +127,7 @@ _SpoListItemRecordUndeclareCommand_instances = new WeakSet(), _SpoListItemRecord
127
127
  return true;
128
128
  }));
129
129
  }, _SpoListItemRecordUndeclareCommand_initOptionSets = function _SpoListItemRecordUndeclareCommand_initOptionSets() {
130
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
130
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
131
131
  };
132
132
  module.exports = new SpoListItemRecordUndeclareCommand();
133
133
  //# sourceMappingURL=listitem-record-undeclare.js.map
@@ -136,7 +136,7 @@ _SpoListItemRemoveCommand_instances = new WeakSet(), _SpoListItemRemoveCommand_i
136
136
  return true;
137
137
  }));
138
138
  }, _SpoListItemRemoveCommand_initOptionSets = function _SpoListItemRemoveCommand_initOptionSets() {
139
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
139
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
140
140
  };
141
141
  module.exports = new SpoListItemRemoveCommand();
142
142
  //# sourceMappingURL=listitem-remove.js.map
@@ -189,7 +189,7 @@ _SpoListItemRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListItemR
189
189
  return true;
190
190
  }));
191
191
  }, _SpoListItemRoleAssignmentRemoveCommand_initOptionSets = function _SpoListItemRoleAssignmentRemoveCommand_initOptionSets() {
192
- this.optionSets.push(['listId', 'listTitle', 'listUrl'], ['principalId', 'upn', 'groupName']);
192
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['principalId', 'upn', 'groupName'] });
193
193
  };
194
194
  module.exports = new SpoListItemRoleAssignmentRemoveCommand();
195
195
  //# sourceMappingURL=listitem-roleassignment-remove.js.map
@@ -133,7 +133,7 @@ _SpoListItemRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoListItemR
133
133
  return true;
134
134
  }));
135
135
  }, _SpoListItemRoleInheritanceBreakCommand_initOptionSets = function _SpoListItemRoleInheritanceBreakCommand_initOptionSets() {
136
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
136
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
137
137
  };
138
138
  module.exports = new SpoListItemRoleInheritanceBreakCommand();
139
139
  //# sourceMappingURL=listitem-roleinheritance-break.js.map
@@ -126,7 +126,7 @@ _SpoListItemRoleInheritanceResetCommand_instances = new WeakSet(), _SpoListItemR
126
126
  return true;
127
127
  }));
128
128
  }, _SpoListItemRoleInheritanceResetCommand_initOptionSets = function _SpoListItemRoleInheritanceResetCommand_initOptionSets() {
129
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
129
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
130
130
  };
131
131
  module.exports = new SpoListItemRoleInheritanceResetCommand();
132
132
  //# sourceMappingURL=listitem-roleinheritance-reset.js.map
@@ -322,7 +322,7 @@ _SpoListItemSetCommand_instances = new WeakSet(), _SpoListItemSetCommand_initTel
322
322
  this.types.string.push('webUrl', 'listId', 'listTitle', 'listUrl', 'id', 'contentType');
323
323
  this.types.boolean.push('systemUpdate');
324
324
  }, _SpoListItemSetCommand_initOptionSets = function _SpoListItemSetCommand_initOptionSets() {
325
- this.optionSets.push(['listId', 'listTitle', 'listUrl']);
325
+ this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] });
326
326
  };
327
327
  module.exports = new SpoListItemSetCommand();
328
328
  //# sourceMappingURL=listitem-set.js.map
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _SpoNavigationNodeListCommand_instances, _SpoNavigationNodeListCommand_initTelemetry, _SpoNavigationNodeListCommand_initOptions, _SpoNavigationNodeListCommand_initValidators;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const request_1 = require("../../../../request");
18
+ const odata_1 = require("../../../../utils/odata");
19
19
  const validation_1 = require("../../../../utils/validation");
20
20
  const SpoCommand_1 = require("../../../base/SpoCommand");
21
21
  const commands_1 = require("../../commands");
@@ -38,16 +38,9 @@ class SpoNavigationNodeListCommand extends SpoCommand_1.default {
38
38
  if (this.verbose) {
39
39
  logger.logToStderr(`Retrieving navigation nodes...`);
40
40
  }
41
- const requestOptions = {
42
- url: `${args.options.webUrl}/_api/web/navigation/${args.options.location.toLowerCase()}`,
43
- headers: {
44
- accept: 'application/json;odata=nometadata'
45
- },
46
- responseType: 'json'
47
- };
48
41
  try {
49
- const res = yield request_1.default.get(requestOptions);
50
- logger.log(res.value.map(n => {
42
+ const res = yield odata_1.odata.getAllItems(`${args.options.webUrl}/_api/web/navigation/${args.options.location.toLowerCase()}`);
43
+ logger.log(res.map(n => {
51
44
  return {
52
45
  Id: n.Id,
53
46
  Title: n.Title,
@@ -400,7 +400,7 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
400
400
  return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
401
401
  }));
402
402
  }, _SpoPageClientSideWebPartAddCommand_initOptionSets = function _SpoPageClientSideWebPartAddCommand_initOptionSets() {
403
- this.optionSets.push(['standardWebPart', 'webPartId']);
403
+ this.optionSets.push({ options: ['standardWebPart', 'webPartId'] });
404
404
  };
405
405
  module.exports = new SpoPageClientSideWebPartAddCommand();
406
406
  //# sourceMappingURL=page-clientsidewebpart-add.js.map
@@ -15,7 +15,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  };
16
16
  var _SpoPageListCommand_instances, _SpoPageListCommand_initOptions, _SpoPageListCommand_initValidators;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- const request_1 = require("../../../../request");
18
+ const odata_1 = require("../../../../utils/odata");
19
19
  const validation_1 = require("../../../../utils/validation");
20
20
  const SpoCommand_1 = require("../../../base/SpoCommand");
21
21
  const commands_1 = require("../../commands");
@@ -41,28 +41,14 @@ class SpoPageListCommand extends SpoCommand_1.default {
41
41
  if (this.verbose) {
42
42
  logger.logToStderr(`Retrieving client-side pages...`);
43
43
  }
44
- let requestOptions = {
45
- url: `${args.options.webUrl}/_api/sitepages/pages?$orderby=Title`,
46
- headers: {
47
- accept: 'application/json;odata=nometadata'
48
- },
49
- responseType: 'json'
50
- };
51
44
  let pages = [];
52
- const pagesList = yield request_1.default.get(requestOptions);
53
- requestOptions = {
54
- url: `${args.options.webUrl}/_api/web/lists/SitePages/rootfolder/files?$expand=ListItemAllFields/ClientSideApplicationId&$orderby=Name`,
55
- headers: {
56
- accept: 'application/json;odata=nometadata'
57
- },
58
- responseType: 'json'
59
- };
60
- if (pagesList.value && pagesList.value.length > 0) {
61
- pages = pagesList.value;
45
+ const pagesList = yield odata_1.odata.getAllItems(`${args.options.webUrl}/_api/sitepages/pages?$orderby=Title`);
46
+ if (pagesList && pagesList.length > 0) {
47
+ pages = pagesList;
62
48
  }
63
- const res = yield request_1.default.get(requestOptions);
64
- if (res.value && res.value.length > 0) {
65
- const clientSidePages = res.value.filter(p => p.ListItemAllFields.ClientSideApplicationId === 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec');
49
+ const res = yield odata_1.odata.getAllItems(`${args.options.webUrl}/_api/web/lists/SitePages/rootfolder/files?$expand=ListItemAllFields/ClientSideApplicationId&$orderby=Name`);
50
+ if (res && res.length > 0) {
51
+ const clientSidePages = res.filter(p => p.ListItemAllFields.ClientSideApplicationId === 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec');
66
52
  pages = pages.map(p => {
67
53
  const clientSidePage = clientSidePages.find(cp => cp && cp.ListItemAllFields && cp.ListItemAllFields.Id === p.Id);
68
54
  if (clientSidePage) {
@@ -24,6 +24,9 @@ const validation_1 = require("../../../../utils/validation");
24
24
  const SpoCommand_1 = require("../../../base/SpoCommand");
25
25
  const commands_1 = require("../../commands");
26
26
  const Page_1 = require("./Page");
27
+ const spoFileGetCommand = require("../file/file-get");
28
+ const spoListItemSetCommand = require("../listitem/listitem-set");
29
+ const Cli_1 = require("../../../../cli/Cli");
27
30
  class SpoPageSetCommand extends SpoCommand_1.default {
28
31
  constructor() {
29
32
  super();
@@ -55,7 +58,8 @@ class SpoPageSetCommand extends SpoCommand_1.default {
55
58
  if (!pageName.endsWith('.aspx')) {
56
59
  pageName += '.aspx';
57
60
  }
58
- const serverRelativeFileUrl = `${urlUtil_1.urlUtil.getServerRelativeSiteUrl(args.options.webUrl)}/sitepages/${pageName}`;
61
+ const listServerRelativeUrl = `${urlUtil_1.urlUtil.getServerRelativeSiteUrl(args.options.webUrl)}/sitepages`;
62
+ const serverRelativeFileUrl = `${listServerRelativeUrl}/${pageName}`;
59
63
  const needsToSavePage = !!args.options.title || !!args.options.description;
60
64
  try {
61
65
  const requestDigestResult = yield spo_1.spo.getRequestDigest(args.options.webUrl);
@@ -233,6 +237,27 @@ class SpoPageSetCommand extends SpoCommand_1.default {
233
237
  };
234
238
  yield request_1.default.post(requestOptions);
235
239
  }
240
+ if (args.options.demoteFrom === 'NewsPage') {
241
+ const fileGetOptions = {
242
+ webUrl: args.options.webUrl,
243
+ url: serverRelativeFileUrl,
244
+ asListItem: true,
245
+ verbose: this.verbose,
246
+ debug: this.debug
247
+ };
248
+ const fileGetOutput = yield Cli_1.Cli.executeCommandWithOutput(spoFileGetCommand, { options: Object.assign(Object.assign({}, fileGetOptions), { _: [] }) });
249
+ const fileGetOutputJson = JSON.parse(fileGetOutput.stdout);
250
+ const listItemSetOptions = {
251
+ webUrl: args.options.webUrl,
252
+ listUrl: listServerRelativeUrl,
253
+ id: fileGetOutputJson.Id,
254
+ systemUpdate: true,
255
+ PromotedState: 0,
256
+ verbose: this.verbose,
257
+ debug: this.debug
258
+ };
259
+ yield Cli_1.Cli.executeCommandWithOutput(spoListItemSetCommand, { options: Object.assign(Object.assign({}, listItemSetOptions), { _: [] }) });
260
+ }
236
261
  let requestOptions;
237
262
  if (!args.options.publish) {
238
263
  if (args.options.promoteAs === 'Template' || !pageId) {
@@ -270,8 +295,9 @@ class SpoPageSetCommand extends SpoCommand_1.default {
270
295
  _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry = function _SpoPageSetCommand_initTelemetry() {
271
296
  this.telemetry.push((args) => {
272
297
  Object.assign(this.telemetryProperties, {
273
- layoutType: args.options.layoutType,
274
- promoteAs: args.options.promoteAs,
298
+ layoutType: args.options.layoutType || false,
299
+ promoteAs: args.options.promoteAs || false,
300
+ demotefrom: args.options.demoteFrom || false,
275
301
  commentsEnabled: args.options.commentsEnabled || false,
276
302
  publish: args.options.publish || false,
277
303
  publishMessage: typeof args.options.publishMessage !== 'undefined',
@@ -290,6 +316,9 @@ _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry =
290
316
  }, {
291
317
  option: '-p, --promoteAs [promoteAs]',
292
318
  autocomplete: Page_1.supportedPromoteAs
319
+ }, {
320
+ option: '--demoteFrom [demoteFrom]',
321
+ autocomplete: ['NewsPage']
293
322
  }, {
294
323
  option: '--commentsEnabled [commentsEnabled]',
295
324
  autocomplete: ['true', 'false']
@@ -316,6 +345,10 @@ _SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry =
316
345
  Page_1.supportedPromoteAs.indexOf(args.options.promoteAs) < 0) {
317
346
  return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values ${Page_1.supportedPromoteAs.join(', ')}`;
318
347
  }
348
+ if (args.options.demoteFrom &&
349
+ args.options.demoteFrom !== 'NewsPage') {
350
+ return `${args.options.demoteFrom} is not a valid option for demoteFrom. The only allowed value is 'NewsPage'`;
351
+ }
319
352
  if (args.options.promoteAs === 'HomePage' && args.options.layoutType !== 'Home') {
320
353
  return 'You can only promote home pages as site home page';
321
354
  }