@pnp/cli-microsoft365 7.3.0-beta.16c6462 → 7.3.0-beta.38bb1d7

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 (425) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +4 -5
  4. package/dist/Command.js +10 -13
  5. package/dist/api.js +2 -3
  6. package/dist/autocomplete.js +4 -6
  7. package/dist/chili/chili.js +1 -2
  8. package/dist/cli/cli.js +880 -0
  9. package/dist/index.js +2 -2
  10. package/dist/m365/aad/commands/administrativeunit/administrativeunit-member-add.js +137 -0
  11. package/dist/m365/aad/commands/administrativeunit/administrativeunit-member-list.js +138 -0
  12. package/dist/m365/aad/commands/administrativeunit/administrativeunit-remove.js +2 -2
  13. package/dist/m365/aad/commands/app/app-get.js +2 -2
  14. package/dist/m365/aad/commands/app/app-permission-add.js +237 -0
  15. package/dist/m365/aad/commands/app/app-remove.js +3 -3
  16. package/dist/m365/aad/commands/app/app-role-add.js +2 -2
  17. package/dist/m365/aad/commands/app/app-role-list.js +2 -2
  18. package/dist/m365/aad/commands/app/app-role-remove.js +4 -4
  19. package/dist/m365/aad/commands/app/app-set.js +2 -2
  20. package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +2 -2
  21. package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +2 -2
  22. package/dist/m365/aad/commands/group/group-list.js +71 -3
  23. package/dist/m365/aad/commands/group/group-remove.js +2 -2
  24. package/dist/m365/aad/commands/groupsetting/groupsetting-remove.js +2 -2
  25. package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-clear.js +2 -2
  26. package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-remove.js +3 -3
  27. package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-restore.js +2 -2
  28. package/dist/m365/aad/commands/m365group/m365group-remove.js +2 -2
  29. package/dist/m365/aad/commands/m365group/m365group-teamify.js +2 -2
  30. package/dist/m365/aad/commands/m365group/m365group-user-remove.js +2 -2
  31. package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +2 -2
  32. package/dist/m365/aad/commands/siteclassification/siteclassification-disable.js +2 -2
  33. package/dist/m365/aad/commands/sp/sp-add.js +2 -2
  34. package/dist/m365/aad/commands/sp/sp-get.js +2 -2
  35. package/dist/m365/aad/commands/user/user-get.js +2 -2
  36. package/dist/m365/aad/commands/user/user-license-remove.js +2 -2
  37. package/dist/m365/aad/commands/user/user-recyclebinitem-clear.js +2 -2
  38. package/dist/m365/aad/commands/user/user-recyclebinitem-remove.js +2 -2
  39. package/dist/m365/aad/commands/user/user-remove.js +2 -2
  40. package/dist/m365/aad/commands.js +4 -1
  41. package/dist/m365/app/commands/app-get.js +2 -2
  42. package/dist/m365/app/commands/app-open.js +2 -2
  43. package/dist/m365/app/commands/permission/permission-list.js +2 -2
  44. package/dist/m365/base/AppCommand.js +2 -2
  45. package/dist/m365/booking/commands/business/business-get.js +2 -2
  46. package/dist/m365/cli/commands/cli-doctor.js +2 -2
  47. package/dist/m365/cli/commands/cli-reconsent.js +2 -2
  48. package/dist/m365/cli/commands/config/config-get.js +2 -2
  49. package/dist/m365/cli/commands/config/config-list.js +2 -2
  50. package/dist/m365/cli/commands/config/config-reset.js +3 -3
  51. package/dist/m365/cli/commands/config/config-set.js +4 -4
  52. package/dist/m365/commands/docs.js +2 -2
  53. package/dist/m365/commands/login.js +4 -4
  54. package/dist/m365/commands/setup.js +8 -8
  55. package/dist/m365/context/commands/context-remove.js +2 -2
  56. package/dist/m365/context/commands/option/option-remove.js +2 -2
  57. package/dist/m365/external/commands/connection/connection-doctor.js +1 -2
  58. package/dist/m365/external/commands/connection/connection-remove.js +3 -3
  59. package/dist/m365/flow/commands/flow-remove.js +2 -2
  60. package/dist/m365/flow/commands/owner/owner-list.js +2 -2
  61. package/dist/m365/flow/commands/owner/owner-remove.js +2 -2
  62. package/dist/m365/flow/commands/run/run-cancel.js +2 -2
  63. package/dist/m365/flow/commands/run/run-resubmit.js +2 -2
  64. package/dist/m365/graph/commands/changelog/changelog-list.js +3 -3
  65. package/dist/m365/graph/commands/schemaextension/schemaextension-remove.js +2 -2
  66. package/dist/m365/outlook/commands/message/message-list.js +2 -2
  67. package/dist/m365/outlook/commands/message/message-move.js +2 -2
  68. package/dist/m365/pa/commands/app/app-consent-set.js +2 -2
  69. package/dist/m365/pa/commands/app/app-get.js +2 -2
  70. package/dist/m365/pa/commands/app/app-permission-remove.js +2 -2
  71. package/dist/m365/pa/commands/app/app-remove.js +2 -2
  72. package/dist/m365/planner/commands/bucket/bucket-get.js +2 -2
  73. package/dist/m365/planner/commands/bucket/bucket-remove.js +3 -3
  74. package/dist/m365/planner/commands/bucket/bucket-set.js +2 -2
  75. package/dist/m365/planner/commands/plan/plan-remove.js +2 -2
  76. package/dist/m365/planner/commands/roster/roster-member-remove.js +3 -3
  77. package/dist/m365/planner/commands/roster/roster-remove.js +2 -2
  78. package/dist/m365/planner/commands/task/task-checklistitem-add.js +2 -2
  79. package/dist/m365/planner/commands/task/task-checklistitem-list.js +2 -2
  80. package/dist/m365/planner/commands/task/task-checklistitem-remove.js +2 -2
  81. package/dist/m365/planner/commands/task/task-get.js +3 -3
  82. package/dist/m365/planner/commands/task/task-reference-remove.js +2 -2
  83. package/dist/m365/planner/commands/task/task-remove.js +4 -4
  84. package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +2 -2
  85. package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-remove.js +3 -3
  86. package/dist/m365/pp/commands/card/card-clone.js +2 -2
  87. package/dist/m365/pp/commands/card/card-get.js +2 -2
  88. package/dist/m365/pp/commands/card/card-remove.js +3 -3
  89. package/dist/m365/pp/commands/chatbot/chatbot-get.js +2 -2
  90. package/dist/m365/pp/commands/chatbot/chatbot-remove.js +3 -3
  91. package/dist/m365/pp/commands/dataverse/dataverse-table-remove.js +2 -2
  92. package/dist/m365/pp/commands/dataverse/dataverse-table-row-remove.js +2 -2
  93. package/dist/m365/pp/commands/managementapp/managementapp-add.js +2 -2
  94. package/dist/m365/pp/commands/solution/solution-get.js +2 -2
  95. package/dist/m365/pp/commands/solution/solution-list.js +2 -2
  96. package/dist/m365/pp/commands/solution/solution-publish.js +2 -2
  97. package/dist/m365/pp/commands/solution/solution-publisher-remove.js +3 -3
  98. package/dist/m365/pp/commands/solution/solution-remove.js +3 -3
  99. package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +2 -2
  100. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +2 -2
  101. package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +2 -2
  102. package/dist/m365/spfx/commands/project/project-permissions-grant.js +2 -2
  103. package/dist/m365/spo/commands/app/app-add.js +2 -2
  104. package/dist/m365/spo/commands/app/app-remove.js +2 -2
  105. package/dist/m365/spo/commands/app/app-retract.js +2 -2
  106. package/dist/m365/spo/commands/app/app-uninstall.js +2 -2
  107. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +2 -2
  108. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +3 -3
  109. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +2 -2
  110. package/dist/m365/spo/commands/cdn/cdn-origin-remove.js +2 -2
  111. package/dist/m365/spo/commands/commandset/commandset-get.js +2 -2
  112. package/dist/m365/spo/commands/commandset/commandset-remove.js +3 -3
  113. package/dist/m365/spo/commands/commandset/commandset-set.js +2 -2
  114. package/dist/m365/spo/commands/contenttype/contenttype-add.js +2 -2
  115. package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +2 -2
  116. package/dist/m365/spo/commands/contenttype/contenttype-remove.js +2 -2
  117. package/dist/m365/spo/commands/customaction/customaction-add.js +1 -1
  118. package/dist/m365/spo/commands/customaction/customaction-clear.js +2 -2
  119. package/dist/m365/spo/commands/customaction/customaction-get.js +3 -3
  120. package/dist/m365/spo/commands/customaction/customaction-remove.js +3 -3
  121. package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +2 -2
  122. package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +3 -3
  123. package/dist/m365/spo/commands/field/field-remove.js +2 -2
  124. package/dist/m365/spo/commands/file/file-add.js +1 -1
  125. package/dist/m365/spo/commands/file/file-checkout-undo.js +2 -2
  126. package/dist/m365/spo/commands/file/file-remove.js +2 -2
  127. package/dist/m365/spo/commands/file/file-rename.js +2 -2
  128. package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +2 -2
  129. package/dist/m365/spo/commands/file/file-roleassignment-add.js +5 -5
  130. package/dist/m365/spo/commands/file/file-roleassignment-remove.js +5 -5
  131. package/dist/m365/spo/commands/file/file-roleinheritance-break.js +3 -3
  132. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +3 -3
  133. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +2 -2
  134. package/dist/m365/spo/commands/file/file-sharinglink-clear.js +3 -3
  135. package/dist/m365/spo/commands/file/file-sharinglink-list.js +2 -2
  136. package/dist/m365/spo/commands/file/file-sharinglink-remove.js +2 -2
  137. package/dist/m365/spo/commands/file/file-version-clear.js +2 -2
  138. package/dist/m365/spo/commands/file/file-version-remove.js +2 -2
  139. package/dist/m365/spo/commands/file/file-version-restore.js +2 -2
  140. package/dist/m365/spo/commands/folder/folder-remove.js +2 -2
  141. package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +2 -2
  142. package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +4 -4
  143. package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +4 -4
  144. package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +2 -2
  145. package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +2 -2
  146. package/dist/m365/spo/commands/group/group-list.js +2 -2
  147. package/dist/m365/spo/commands/group/group-member-remove.js +9 -9
  148. package/dist/m365/spo/commands/group/group-remove.js +2 -2
  149. package/dist/m365/spo/commands/group/group-set.js +2 -2
  150. package/dist/m365/spo/commands/homesite/homesite-remove.js +2 -2
  151. package/dist/m365/spo/commands/hubsite/hubsite-connect.js +2 -2
  152. package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +3 -3
  153. package/dist/m365/spo/commands/hubsite/hubsite-get.js +4 -4
  154. package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +2 -2
  155. package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +2 -2
  156. package/dist/m365/spo/commands/knowledgehub/knowledgehub-remove.js +2 -2
  157. package/dist/m365/spo/commands/list/list-contenttype-remove.js +2 -2
  158. package/dist/m365/spo/commands/list/list-remove.js +2 -2
  159. package/dist/m365/spo/commands/list/list-retentionlabel-remove.js +2 -2
  160. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +4 -4
  161. package/dist/m365/spo/commands/list/list-roleinheritance-break.js +2 -2
  162. package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +2 -2
  163. package/dist/m365/spo/commands/list/list-view-field-remove.js +2 -2
  164. package/dist/m365/spo/commands/list/list-view-remove.js +2 -2
  165. package/dist/m365/spo/commands/list/list-webhook-remove.js +2 -2
  166. package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +2 -2
  167. package/dist/m365/spo/commands/listitem/listitem-list.js +2 -2
  168. package/dist/m365/spo/commands/listitem/listitem-remove.js +2 -2
  169. package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +2 -2
  170. package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +4 -4
  171. package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +4 -4
  172. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +2 -2
  173. package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +2 -2
  174. package/dist/m365/spo/commands/navigation/navigation-node-remove.js +2 -2
  175. package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +2 -2
  176. package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +2 -2
  177. package/dist/m365/spo/commands/page/page-add.js +4 -4
  178. package/dist/m365/spo/commands/page/page-column-get.js +2 -2
  179. package/dist/m365/spo/commands/page/page-column-list.js +2 -2
  180. package/dist/m365/spo/commands/page/page-remove.js +2 -2
  181. package/dist/m365/spo/commands/page/page-section-get.js +2 -2
  182. package/dist/m365/spo/commands/page/page-section-list.js +2 -2
  183. package/dist/m365/spo/commands/page/page-set.js +5 -5
  184. package/dist/m365/spo/commands/propertybag/propertybag-remove.js +2 -2
  185. package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +2 -2
  186. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +2 -2
  187. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +2 -2
  188. package/dist/m365/spo/commands/site/site-apppermission-remove.js +2 -2
  189. package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +2 -2
  190. package/dist/m365/spo/commands/site/site-recyclebinitem-clear.js +2 -2
  191. package/dist/m365/spo/commands/site/site-recyclebinitem-move.js +2 -2
  192. package/dist/m365/spo/commands/site/site-recyclebinitem-remove.js +2 -2
  193. package/dist/m365/spo/commands/site/site-remove.js +2 -2
  194. package/dist/m365/spo/commands/site/site-set.js +3 -3
  195. package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +2 -2
  196. package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +2 -2
  197. package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +2 -2
  198. package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +2 -2
  199. package/dist/m365/spo/commands/sitescript/sitescript-remove.js +2 -2
  200. package/dist/m365/spo/commands/spo-search.js +2 -2
  201. package/dist/m365/spo/commands/storageentity/storageentity-remove.js +2 -2
  202. package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +5 -5
  203. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +5 -5
  204. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +2 -2
  205. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +3 -3
  206. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +4 -4
  207. package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +5 -5
  208. package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +2 -2
  209. package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +3 -3
  210. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +2 -2
  211. package/dist/m365/spo/commands/term/term-get.js +2 -2
  212. package/dist/m365/spo/commands/term/term-list.js +2 -2
  213. package/dist/m365/spo/commands/theme/theme-remove.js +2 -2
  214. package/dist/m365/spo/commands/user/user-remove.js +2 -2
  215. package/dist/m365/spo/commands/userprofile/userprofile-get.js +2 -2
  216. package/dist/m365/spo/commands/web/web-remove.js +2 -2
  217. package/dist/m365/spo/commands/web/web-roleassignment-add.js +4 -4
  218. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +4 -4
  219. package/dist/m365/spo/commands/web/web-roleinheritance-break.js +2 -2
  220. package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +2 -2
  221. package/dist/m365/teams/commands/app/app-install.js +32 -5
  222. package/dist/m365/teams/commands/app/app-remove.js +3 -3
  223. package/dist/m365/teams/commands/app/app-uninstall.js +2 -2
  224. package/dist/m365/teams/commands/app/app-update.js +2 -2
  225. package/dist/m365/teams/commands/cache/cache-remove.js +2 -2
  226. package/dist/m365/teams/commands/channel/channel-add.js +2 -2
  227. package/dist/m365/teams/commands/channel/channel-member-add.js +2 -2
  228. package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -3
  229. package/dist/m365/teams/commands/channel/channel-member-set.js +2 -2
  230. package/dist/m365/teams/commands/channel/channel-remove.js +2 -2
  231. package/dist/m365/teams/commands/chat/chat-get.js +3 -3
  232. package/dist/m365/teams/commands/chat/chat-member-remove.js +2 -2
  233. package/dist/m365/teams/commands/chat/chat-message-send.js +3 -3
  234. package/dist/m365/teams/commands/meeting/meeting-add.js +151 -0
  235. package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +2 -2
  236. package/dist/m365/teams/commands/tab/tab-remove.js +2 -2
  237. package/dist/m365/teams/commands/team/team-app-list.js +3 -3
  238. package/dist/m365/teams/commands/team/team-remove.js +2 -2
  239. package/dist/m365/teams/commands/user/user-app-add.js +23 -5
  240. package/dist/m365/teams/commands/user/user-app-list.js +2 -2
  241. package/dist/m365/teams/commands/user/user-app-remove.js +3 -3
  242. package/dist/m365/teams/commands.js +2 -1
  243. package/dist/m365/tenant/commands/people/people-profilecardproperty-remove.js +2 -2
  244. package/dist/m365/todo/commands/list/list-remove.js +2 -2
  245. package/dist/m365/todo/commands/task/task-get.js +2 -2
  246. package/dist/m365/todo/commands/task/task-list.js +2 -2
  247. package/dist/m365/todo/commands/task/task-remove.js +2 -2
  248. package/dist/m365/viva/commands/connections/connections-app-create.js +2 -2
  249. package/dist/m365/yammer/commands/group/group-user-remove.js +2 -2
  250. package/dist/m365/yammer/commands/message/message-like-set.js +2 -2
  251. package/dist/m365/yammer/commands/message/message-remove.js +2 -2
  252. package/dist/m365/yammer/commands/yammer-search.js +2 -2
  253. package/dist/telemetry.js +2 -2
  254. package/dist/utils/aadAdministrativeUnit.js +2 -2
  255. package/dist/utils/aadDevice.js +25 -0
  256. package/dist/utils/aadGroup.js +3 -3
  257. package/dist/utils/prompt.js +4 -7
  258. package/dist/utils/validation.js +5 -2
  259. package/docs/docs/cmd/aad/administrativeunit/administrativeunit-member-add.mdx +93 -0
  260. package/docs/docs/cmd/aad/administrativeunit/administrativeunit-member-list.mdx +312 -0
  261. package/docs/docs/cmd/aad/app/app-permission-add.mdx +62 -0
  262. package/docs/docs/cmd/aad/group/group-list.mdx +11 -0
  263. package/docs/docs/cmd/aad/user/user-password-validate.mdx +2 -2
  264. package/docs/docs/cmd/adaptivecard/adaptivecard-send.mdx +1 -1
  265. package/docs/docs/cmd/external/connection/connection-doctor.mdx +3 -0
  266. package/docs/docs/cmd/flow/environment/environment-get.mdx +1 -1
  267. package/docs/docs/cmd/flow/environment/environment-list.mdx +1 -1
  268. package/docs/docs/cmd/flow/flow-disable.mdx +1 -1
  269. package/docs/docs/cmd/flow/flow-enable.mdx +1 -1
  270. package/docs/docs/cmd/flow/flow-export.mdx +1 -1
  271. package/docs/docs/cmd/flow/flow-get.mdx +1 -1
  272. package/docs/docs/cmd/flow/flow-list.mdx +1 -1
  273. package/docs/docs/cmd/flow/run/run-cancel.mdx +1 -1
  274. package/docs/docs/cmd/flow/run/run-get.mdx +1 -1
  275. package/docs/docs/cmd/flow/run/run-list.mdx +1 -1
  276. package/docs/docs/cmd/flow/run/run-resubmit.mdx +1 -1
  277. package/docs/docs/cmd/graph/changelog/changelog-list.mdx +1 -1
  278. package/docs/docs/cmd/graph/schemaextension/schemaextension-add.mdx +1 -1
  279. package/docs/docs/cmd/graph/schemaextension/schemaextension-set.mdx +1 -1
  280. package/docs/docs/cmd/onedrive/report/report-activityfilecounts.mdx +0 -3
  281. package/docs/docs/cmd/onedrive/report/report-activityusercounts.mdx +0 -3
  282. package/docs/docs/cmd/onedrive/report/report-activityuserdetail.mdx +0 -3
  283. package/docs/docs/cmd/onedrive/report/report-usageaccountcounts.mdx +0 -3
  284. package/docs/docs/cmd/onedrive/report/report-usageaccountdetail.mdx +0 -3
  285. package/docs/docs/cmd/onedrive/report/report-usagefilecounts.mdx +0 -3
  286. package/docs/docs/cmd/onedrive/report/report-usagestorage.mdx +0 -3
  287. package/docs/docs/cmd/outlook/report/report-mailactivitycounts.mdx +0 -3
  288. package/docs/docs/cmd/outlook/report/report-mailactivityusercounts.mdx +0 -3
  289. package/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.mdx +0 -3
  290. package/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.mdx +0 -3
  291. package/docs/docs/cmd/outlook/report/report-mailappusageusercounts.mdx +0 -3
  292. package/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.mdx +0 -3
  293. package/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.mdx +0 -3
  294. package/docs/docs/cmd/outlook/report/report-mailboxusagedetail.mdx +0 -3
  295. package/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.mdx +0 -3
  296. package/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.mdx +0 -3
  297. package/docs/docs/cmd/outlook/report/report-mailboxusagestorage.mdx +0 -3
  298. package/docs/docs/cmd/pa/app/app-get.mdx +1 -1
  299. package/docs/docs/cmd/pa/app/app-list.mdx +1 -1
  300. package/docs/docs/cmd/pa/connector/connector-export.mdx +1 -1
  301. package/docs/docs/cmd/pa/connector/connector-list.mdx +1 -1
  302. package/docs/docs/cmd/pa/environment/environment-get.mdx +1 -1
  303. package/docs/docs/cmd/pa/environment/environment-list.mdx +1 -1
  304. package/docs/docs/cmd/planner/bucket/bucket-add.mdx +1 -1
  305. package/docs/docs/cmd/planner/bucket/bucket-get.mdx +1 -1
  306. package/docs/docs/cmd/planner/bucket/bucket-list.mdx +1 -1
  307. package/docs/docs/cmd/planner/bucket/bucket-remove.mdx +1 -1
  308. package/docs/docs/cmd/planner/bucket/bucket-set.mdx +1 -1
  309. package/docs/docs/cmd/planner/plan/plan-get.mdx +1 -1
  310. package/docs/docs/cmd/planner/plan/plan-list.mdx +1 -1
  311. package/docs/docs/cmd/planner/plan/plan-set.mdx +1 -1
  312. package/docs/docs/cmd/planner/roster/roster-add.mdx +2 -2
  313. package/docs/docs/cmd/planner/roster/roster-get.mdx +1 -1
  314. package/docs/docs/cmd/planner/roster/roster-member-add.mdx +1 -1
  315. package/docs/docs/cmd/planner/roster/roster-member-get.mdx +1 -1
  316. package/docs/docs/cmd/planner/roster/roster-member-list.mdx +1 -1
  317. package/docs/docs/cmd/planner/roster/roster-member-remove.mdx +2 -2
  318. package/docs/docs/cmd/planner/roster/roster-plan-list.mdx +1 -1
  319. package/docs/docs/cmd/planner/roster/roster-remove.mdx +2 -2
  320. package/docs/docs/cmd/planner/task/task-add.mdx +1 -1
  321. package/docs/docs/cmd/planner/task/task-list.mdx +2 -2
  322. package/docs/docs/cmd/planner/task/task-remove.mdx +1 -1
  323. package/docs/docs/cmd/planner/task/task-set.mdx +1 -1
  324. package/docs/docs/cmd/pp/environment/environment-get.mdx +1 -1
  325. package/docs/docs/cmd/pp/environment/environment-list.mdx +1 -1
  326. package/docs/docs/cmd/pp/tenant/tenant-settings-list.mdx +1 -1
  327. package/docs/docs/cmd/pp/tenant/tenant-settings-set.mdx +1 -1
  328. package/docs/docs/cmd/purview/retentionevent/retentionevent-add.mdx +1 -1
  329. package/docs/docs/cmd/purview/retentionevent/retentionevent-get.mdx +1 -1
  330. package/docs/docs/cmd/purview/retentionevent/retentionevent-list.mdx +1 -1
  331. package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx +1 -1
  332. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.mdx +1 -1
  333. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.mdx +1 -1
  334. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.mdx +1 -1
  335. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx +1 -1
  336. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.mdx +1 -1
  337. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.mdx +1 -1
  338. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.mdx +1 -1
  339. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.mdx +1 -1
  340. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx +1 -1
  341. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.mdx +1 -1
  342. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.mdx +2 -2
  343. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.mdx +2 -2
  344. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.mdx +2 -2
  345. package/docs/docs/cmd/skype/report/report-activitycounts.mdx +0 -2
  346. package/docs/docs/cmd/skype/report/report-activityusercounts.mdx +0 -3
  347. package/docs/docs/cmd/skype/report/report-activityuserdetail.mdx +0 -3
  348. package/docs/docs/cmd/spfx/project/project-externalize.mdx +1 -1
  349. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.mdx +1 -1
  350. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +1 -1
  351. package/docs/docs/cmd/spo/commandset/commandset-add.mdx +1 -1
  352. package/docs/docs/cmd/spo/commandset/commandset-set.mdx +1 -1
  353. package/docs/docs/cmd/spo/contenttype/contenttype-set.mdx +1 -1
  354. package/docs/docs/cmd/spo/customaction/customaction-add.mdx +1 -1
  355. package/docs/docs/cmd/spo/customaction/customaction-set.mdx +1 -1
  356. package/docs/docs/cmd/spo/eventreceiver/eventreceiver-remove.mdx +1 -1
  357. package/docs/docs/cmd/spo/field/field-set.mdx +1 -1
  358. package/docs/docs/cmd/spo/list/list-sensitivitylabel-ensure.mdx +1 -1
  359. package/docs/docs/cmd/spo/list/list-view-set.mdx +1 -1
  360. package/docs/docs/cmd/spo/listitem/listitem-add.mdx +1 -1
  361. package/docs/docs/cmd/spo/listitem/listitem-batch-add.mdx +1 -1
  362. package/docs/docs/cmd/spo/listitem/listitem-set.mdx +1 -1
  363. package/docs/docs/cmd/spo/page/page-clientsidewebpart-add.mdx +1 -1
  364. package/docs/docs/cmd/spo/page/page-control-set.mdx +1 -1
  365. package/docs/docs/cmd/spo/page/page-set.mdx +1 -1
  366. package/docs/docs/cmd/spo/report/report-activityfilecounts.mdx +0 -3
  367. package/docs/docs/cmd/spo/report/report-activitypages.mdx +0 -3
  368. package/docs/docs/cmd/spo/report/report-activityusercounts.mdx +0 -3
  369. package/docs/docs/cmd/spo/report/report-activityuserdetail.mdx +0 -3
  370. package/docs/docs/cmd/spo/report/report-siteusagedetail.mdx +0 -3
  371. package/docs/docs/cmd/spo/report/report-siteusagefilecounts.mdx +0 -3
  372. package/docs/docs/cmd/spo/report/report-siteusagepages.mdx +0 -3
  373. package/docs/docs/cmd/spo/report/report-siteusagesitecounts.mdx +0 -3
  374. package/docs/docs/cmd/spo/report/report-siteusagestorage.mdx +0 -3
  375. package/docs/docs/cmd/spo/site/site-groupify.mdx +1 -1
  376. package/docs/docs/cmd/spo/site/site-recyclebinitem-clear.mdx +1 -1
  377. package/docs/docs/cmd/spo/site/site-recyclebinitem-remove.mdx +1 -1
  378. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.mdx +1 -1
  379. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-set.mdx +1 -1
  380. package/docs/docs/cmd/spo/tenant/tenant-commandset-add.mdx +1 -1
  381. package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +1 -1
  382. package/docs/docs/cmd/spo/term/term-add.mdx +1 -1
  383. package/docs/docs/cmd/spo/term/term-group-add.mdx +1 -1
  384. package/docs/docs/cmd/spo/term/term-set-add.mdx +1 -1
  385. package/docs/docs/cmd/teams/app/app-install.mdx +11 -2
  386. package/docs/docs/cmd/teams/meeting/meeting-add.mdx +283 -0
  387. package/docs/docs/cmd/teams/meeting/meeting-transcript-list.mdx +2 -2
  388. package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.mdx +0 -3
  389. package/docs/docs/cmd/teams/report/report-deviceusageusercounts.mdx +0 -3
  390. package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.mdx +0 -3
  391. package/docs/docs/cmd/teams/report/report-useractivitycounts.mdx +0 -3
  392. package/docs/docs/cmd/teams/report/report-useractivityusercounts.mdx +0 -3
  393. package/docs/docs/cmd/teams/report/report-useractivityuserdetail.mdx +0 -3
  394. package/docs/docs/cmd/teams/user/user-app-add.mdx +12 -3
  395. package/docs/docs/cmd/teams/user/user-app-remove.mdx +2 -2
  396. package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +1 -1
  397. package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +1 -1
  398. package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +1 -1
  399. package/docs/docs/cmd/tenant/report/report-activeusercounts.mdx +0 -3
  400. package/docs/docs/cmd/tenant/report/report-activeuserdetail.mdx +0 -3
  401. package/docs/docs/cmd/tenant/report/report-servicesusercounts.mdx +0 -3
  402. package/docs/docs/cmd/yammer/group/group-list.mdx +1 -1
  403. package/docs/docs/cmd/yammer/group/group-user-add.mdx +1 -1
  404. package/docs/docs/cmd/yammer/group/group-user-remove.mdx +1 -1
  405. package/docs/docs/cmd/yammer/message/message-add.mdx +1 -1
  406. package/docs/docs/cmd/yammer/message/message-get.mdx +1 -1
  407. package/docs/docs/cmd/yammer/message/message-like-set.mdx +1 -1
  408. package/docs/docs/cmd/yammer/message/message-list.mdx +1 -1
  409. package/docs/docs/cmd/yammer/message/message-remove.mdx +1 -1
  410. package/docs/docs/cmd/yammer/network/network-list.mdx +1 -1
  411. package/docs/docs/cmd/yammer/report/report-activitycounts.mdx +0 -3
  412. package/docs/docs/cmd/yammer/report/report-activityusercounts.mdx +0 -3
  413. package/docs/docs/cmd/yammer/report/report-activityuserdetail.mdx +0 -3
  414. package/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.mdx +0 -3
  415. package/docs/docs/cmd/yammer/report/report-deviceusageusercounts.mdx +0 -3
  416. package/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.mdx +0 -3
  417. package/docs/docs/cmd/yammer/report/report-groupsactivitycounts.mdx +0 -3
  418. package/docs/docs/cmd/yammer/report/report-groupsactivitydetail.mdx +0 -3
  419. package/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.mdx +0 -3
  420. package/docs/docs/cmd/yammer/user/user-get.mdx +1 -1
  421. package/docs/docs/cmd/yammer/user/user-list.mdx +1 -1
  422. package/docs/docs/cmd/yammer/yammer-search.mdx +1 -1
  423. package/npm-shrinkwrap.json +1008 -406
  424. package/package.json +25 -24
  425. package/dist/cli/Cli.js +0 -857
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { Cli } from './cli/Cli.js';
2
+ import { cli } from './cli/cli.js';
3
3
  import { app } from './utils/app.js';
4
4
  // required to make console.log() in combination with piped output synchronous
5
5
  // on Windows/in PowerShell so that the output is not trimmed by calling
@@ -13,5 +13,5 @@ if (!process.env.CLIMICROSOFT365_NOUPDATE) {
13
13
  updateNotifier.default({ pkg: app.packageJson() }).notify({ defer: false });
14
14
  });
15
15
  }
16
- Cli.getInstance().execute(process.argv.slice(2));
16
+ cli.execute(process.argv.slice(2));
17
17
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,137 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var _AadAdministrativeUnitMemberAddCommand_instances, _AadAdministrativeUnitMemberAddCommand_initTelemetry, _AadAdministrativeUnitMemberAddCommand_initOptions, _AadAdministrativeUnitMemberAddCommand_initValidators, _AadAdministrativeUnitMemberAddCommand_initOptionSets;
7
+ import { aadAdministrativeUnit } from "../../../../utils/aadAdministrativeUnit.js";
8
+ import { aadGroup } from "../../../../utils/aadGroup.js";
9
+ import { aadUser } from "../../../../utils/aadUser.js";
10
+ import { validation } from "../../../../utils/validation.js";
11
+ import GraphCommand from "../../../base/GraphCommand.js";
12
+ import commands from "../../commands.js";
13
+ import request from "../../../../request.js";
14
+ import { aadDevice } from "../../../../utils/aadDevice.js";
15
+ class AadAdministrativeUnitMemberAddCommand extends GraphCommand {
16
+ get name() {
17
+ return commands.ADMINISTRATIVEUNIT_MEMBER_ADD;
18
+ }
19
+ get description() {
20
+ return 'Adds a member (user, group, device) to an administrative unit';
21
+ }
22
+ constructor() {
23
+ super();
24
+ _AadAdministrativeUnitMemberAddCommand_instances.add(this);
25
+ __classPrivateFieldGet(this, _AadAdministrativeUnitMemberAddCommand_instances, "m", _AadAdministrativeUnitMemberAddCommand_initTelemetry).call(this);
26
+ __classPrivateFieldGet(this, _AadAdministrativeUnitMemberAddCommand_instances, "m", _AadAdministrativeUnitMemberAddCommand_initOptions).call(this);
27
+ __classPrivateFieldGet(this, _AadAdministrativeUnitMemberAddCommand_instances, "m", _AadAdministrativeUnitMemberAddCommand_initValidators).call(this);
28
+ __classPrivateFieldGet(this, _AadAdministrativeUnitMemberAddCommand_instances, "m", _AadAdministrativeUnitMemberAddCommand_initOptionSets).call(this);
29
+ }
30
+ async commandAction(logger, args) {
31
+ let administrativeUnitId = args.options.administrativeUnitId;
32
+ let memberType;
33
+ let memberId;
34
+ try {
35
+ if (args.options.administrativeUnitName) {
36
+ if (this.verbose) {
37
+ await logger.logToStderr(`Retrieving Administrative Unit Id...`);
38
+ }
39
+ administrativeUnitId = (await aadAdministrativeUnit.getAdministrativeUnitByDisplayName(args.options.administrativeUnitName)).id;
40
+ }
41
+ if (args.options.userId || args.options.userName) {
42
+ memberType = 'users';
43
+ memberId = args.options.userId;
44
+ if (args.options.userName) {
45
+ if (this.verbose) {
46
+ await logger.logToStderr(`Retrieving User Id...`);
47
+ }
48
+ memberId = await aadUser.getUserIdByUpn(args.options.userName);
49
+ }
50
+ }
51
+ else if (args.options.groupId || args.options.groupName) {
52
+ memberType = 'groups';
53
+ memberId = args.options.groupId;
54
+ if (args.options.groupName) {
55
+ if (this.verbose) {
56
+ await logger.logToStderr(`Retrieving Group Id...`);
57
+ }
58
+ memberId = await aadGroup.getGroupIdByDisplayName(args.options.groupName);
59
+ }
60
+ }
61
+ else if (args.options.deviceId || args.options.deviceName) {
62
+ memberType = 'devices';
63
+ memberId = args.options.deviceId;
64
+ if (args.options.deviceName) {
65
+ if (this.verbose) {
66
+ await logger.logToStderr(`Device with name ${args.options.deviceName} retrieved, returned id: ${memberId}`);
67
+ }
68
+ memberId = (await aadDevice.getDeviceByDisplayName(args.options.deviceName)).id;
69
+ }
70
+ }
71
+ const requestOptions = {
72
+ url: `${this.resource}/v1.0/directory/administrativeUnits/${administrativeUnitId}/members/$ref`,
73
+ headers: {
74
+ 'accept': 'application/json;odata.metadata=none'
75
+ },
76
+ data: {
77
+ "@odata.id": `https://graph.microsoft.com/v1.0/${memberType}/${memberId}`
78
+ }
79
+ };
80
+ await request.post(requestOptions);
81
+ }
82
+ catch (err) {
83
+ this.handleRejectedODataJsonPromise(err);
84
+ }
85
+ }
86
+ }
87
+ _AadAdministrativeUnitMemberAddCommand_instances = new WeakSet(), _AadAdministrativeUnitMemberAddCommand_initTelemetry = function _AadAdministrativeUnitMemberAddCommand_initTelemetry() {
88
+ this.telemetry.push((args) => {
89
+ Object.assign(this.telemetryProperties, {
90
+ userId: typeof args.options.userId !== 'undefined',
91
+ userName: typeof args.options.userName !== 'undefined',
92
+ groupId: typeof args.options.groupId !== 'undefined',
93
+ groupName: typeof args.options.groupName !== 'undefined',
94
+ deviceId: typeof args.options.deviceId !== 'undefined',
95
+ deviceName: typeof args.options.deviceName !== 'undefined'
96
+ });
97
+ });
98
+ }, _AadAdministrativeUnitMemberAddCommand_initOptions = function _AadAdministrativeUnitMemberAddCommand_initOptions() {
99
+ this.options.unshift({
100
+ option: '-i, --administrativeUnitId [administrativeUnitId]'
101
+ }, {
102
+ option: '-n, --administrativeUnitName [administrativeUnitName]'
103
+ }, {
104
+ option: "--userId [userId]"
105
+ }, {
106
+ option: "--userName [userName]"
107
+ }, {
108
+ option: "--groupId [groupId]"
109
+ }, {
110
+ option: "--groupName [groupName]"
111
+ }, {
112
+ option: "--deviceId [deviceId]"
113
+ }, {
114
+ option: "--deviceName [deviceName]"
115
+ });
116
+ }, _AadAdministrativeUnitMemberAddCommand_initValidators = function _AadAdministrativeUnitMemberAddCommand_initValidators() {
117
+ this.validators.push(async (args) => {
118
+ if (args.options.administrativeUnitId && !validation.isValidGuid(args.options.administrativeUnitId)) {
119
+ return `${args.options.administrativeUnitId} is not a valid GUID`;
120
+ }
121
+ if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
122
+ return `${args.options.userId} is not a valid GUID`;
123
+ }
124
+ if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
125
+ return `${args.options.groupId} is not a valid GUID`;
126
+ }
127
+ if (args.options.deviceId && !validation.isValidGuid(args.options.deviceId)) {
128
+ return `${args.options.deviceId} is not a valid GUID`;
129
+ }
130
+ return true;
131
+ });
132
+ }, _AadAdministrativeUnitMemberAddCommand_initOptionSets = function _AadAdministrativeUnitMemberAddCommand_initOptionSets() {
133
+ this.optionSets.push({ options: ['administrativeUnitId', 'administrativeUnitName'] });
134
+ this.optionSets.push({ options: ['userId', 'userName', 'groupId', 'groupName', 'deviceId', 'deviceName'] });
135
+ };
136
+ export default new AadAdministrativeUnitMemberAddCommand();
137
+ //# sourceMappingURL=administrativeunit-member-add.js.map
@@ -0,0 +1,138 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var _AadAdministrativeUnitMemberListCommand_instances, _AadAdministrativeUnitMemberListCommand_initTelemetry, _AadAdministrativeUnitMemberListCommand_initOptions, _AadAdministrativeUnitMemberListCommand_initValidators, _AadAdministrativeUnitMemberListCommand_initOptionSets;
7
+ import { odata } from '../../../../utils/odata.js';
8
+ import GraphCommand from '../../../base/GraphCommand.js';
9
+ import commands from '../../commands.js';
10
+ import { aadAdministrativeUnit } from '../../../../utils/aadAdministrativeUnit.js';
11
+ import { validation } from '../../../../utils/validation.js';
12
+ class AadAdministrativeUnitMemberListCommand extends GraphCommand {
13
+ get name() {
14
+ return commands.ADMINISTRATIVEUNIT_MEMBER_LIST;
15
+ }
16
+ get description() {
17
+ return 'Retrieves members (users, groups, or devices) of an administrative unit.';
18
+ }
19
+ defaultProperties() {
20
+ return ['id', 'displayName'];
21
+ }
22
+ constructor() {
23
+ super();
24
+ _AadAdministrativeUnitMemberListCommand_instances.add(this);
25
+ __classPrivateFieldGet(this, _AadAdministrativeUnitMemberListCommand_instances, "m", _AadAdministrativeUnitMemberListCommand_initTelemetry).call(this);
26
+ __classPrivateFieldGet(this, _AadAdministrativeUnitMemberListCommand_instances, "m", _AadAdministrativeUnitMemberListCommand_initOptions).call(this);
27
+ __classPrivateFieldGet(this, _AadAdministrativeUnitMemberListCommand_instances, "m", _AadAdministrativeUnitMemberListCommand_initValidators).call(this);
28
+ __classPrivateFieldGet(this, _AadAdministrativeUnitMemberListCommand_instances, "m", _AadAdministrativeUnitMemberListCommand_initOptionSets).call(this);
29
+ }
30
+ async commandAction(logger, args) {
31
+ let administrativeUnitId = args.options.administrativeUnitId;
32
+ try {
33
+ if (args.options.administrativeUnitName) {
34
+ administrativeUnitId = (await aadAdministrativeUnit.getAdministrativeUnitByDisplayName(args.options.administrativeUnitName)).id;
35
+ }
36
+ let results;
37
+ const endpoint = this.getRequestUrl(administrativeUnitId, args.options);
38
+ if (args.options.type) {
39
+ if (args.options.filter) {
40
+ // While using the filter, we need to specify the ConsistencyLevel header.
41
+ // Can be refactored when the header is no longer necessary.
42
+ const requestOptions = {
43
+ url: endpoint,
44
+ headers: {
45
+ accept: 'application/json;odata.metadata=none',
46
+ ConsistencyLevel: 'eventual'
47
+ },
48
+ responseType: 'json'
49
+ };
50
+ results = await odata.getAllItems(requestOptions);
51
+ }
52
+ else {
53
+ results = await odata.getAllItems(endpoint);
54
+ }
55
+ }
56
+ else {
57
+ results = await odata.getAllItems(endpoint, 'minimal');
58
+ results.forEach(c => {
59
+ const odataType = c['@odata.type'];
60
+ if (odataType) {
61
+ c.type = odataType.replace('#microsoft.graph.', '');
62
+ }
63
+ delete c['@odata.type'];
64
+ });
65
+ }
66
+ await logger.log(results);
67
+ }
68
+ catch (err) {
69
+ this.handleRejectedODataJsonPromise(err);
70
+ }
71
+ }
72
+ getRequestUrl(administrativeUnitId, options) {
73
+ const queryParameters = [];
74
+ if (options.properties) {
75
+ const allProperties = options.properties.split(',');
76
+ const selectProperties = allProperties.filter(prop => !prop.includes('/'));
77
+ const expandProperties = allProperties.filter(prop => prop.includes('/'));
78
+ if (selectProperties.length > 0) {
79
+ queryParameters.push(`$select=${selectProperties}`);
80
+ }
81
+ if (expandProperties.length > 0) {
82
+ const fieldExpands = expandProperties.map(p => `${p.split('/')[0]}($select=${p.split('/')[1]})`);
83
+ queryParameters.push(`$expand=${fieldExpands.join(',')}`);
84
+ }
85
+ }
86
+ if (options.filter) {
87
+ queryParameters.push(`$filter=${options.filter}`);
88
+ queryParameters.push('$count=true');
89
+ }
90
+ const queryString = queryParameters.length > 0
91
+ ? `?${queryParameters.join('&')}`
92
+ : '';
93
+ return options.type
94
+ ? `${this.resource}/v1.0/directory/administrativeUnits/${administrativeUnitId}/members/microsoft.graph.${options.type}${queryString}`
95
+ : `${this.resource}/v1.0/directory/administrativeUnits/${administrativeUnitId}/members${queryString}`;
96
+ }
97
+ }
98
+ _AadAdministrativeUnitMemberListCommand_instances = new WeakSet(), _AadAdministrativeUnitMemberListCommand_initTelemetry = function _AadAdministrativeUnitMemberListCommand_initTelemetry() {
99
+ this.telemetry.push((args) => {
100
+ Object.assign(this.telemetryProperties, {
101
+ type: typeof args.options.type !== 'undefined',
102
+ properties: typeof args.options.properties !== 'undefined',
103
+ filter: typeof args.options.filter !== 'undefined'
104
+ });
105
+ });
106
+ }, _AadAdministrativeUnitMemberListCommand_initOptions = function _AadAdministrativeUnitMemberListCommand_initOptions() {
107
+ this.options.unshift({
108
+ option: '-i, --administrativeUnitId [administrativeUnitId]'
109
+ }, {
110
+ option: '-n, --administrativeUnitName [administrativeUnitName]'
111
+ }, {
112
+ option: '-t, --type [type]',
113
+ autocomplete: ['user', 'group', 'device']
114
+ }, {
115
+ option: '-p, --properties [properties]'
116
+ }, {
117
+ option: '-f, --filter [filter]'
118
+ });
119
+ }, _AadAdministrativeUnitMemberListCommand_initValidators = function _AadAdministrativeUnitMemberListCommand_initValidators() {
120
+ this.validators.push(async (args) => {
121
+ if (args.options.administrativeUnitId && !validation.isValidGuid(args.options.administrativeUnitId)) {
122
+ return `${args.options.administrativeUnitId} is not a valid GUID`;
123
+ }
124
+ if (args.options.type) {
125
+ if (['user', 'group', 'device'].every(type => type !== args.options.type)) {
126
+ return `${args.options.type} is not a valid type value. Allowed values user|group|device`;
127
+ }
128
+ }
129
+ if (args.options.filter && !args.options.type) {
130
+ return 'Filter can be specified only if type is set';
131
+ }
132
+ return true;
133
+ });
134
+ }, _AadAdministrativeUnitMemberListCommand_initOptionSets = function _AadAdministrativeUnitMemberListCommand_initOptionSets() {
135
+ this.optionSets.push({ options: ['administrativeUnitId', 'administrativeUnitName'] });
136
+ };
137
+ export default new AadAdministrativeUnitMemberListCommand();
138
+ //# sourceMappingURL=administrativeunit-member-list.js.map
@@ -9,7 +9,7 @@ import { validation } from "../../../../utils/validation.js";
9
9
  import request from "../../../../request.js";
10
10
  import GraphCommand from "../../../base/GraphCommand.js";
11
11
  import commands from "../../commands.js";
12
- import { Cli } from "../../../../cli/Cli.js";
12
+ import { cli } from "../../../../cli/cli.js";
13
13
  class AadAdministrativeUnitRemoveCommand extends GraphCommand {
14
14
  get name() {
15
15
  return commands.ADMINISTRATIVEUNIT_REMOVE;
@@ -50,7 +50,7 @@ class AadAdministrativeUnitRemoveCommand extends GraphCommand {
50
50
  await removeAdministrativeUnit();
51
51
  }
52
52
  else {
53
- const result = await Cli.promptForConfirmation({ message: `Are you sure you want to remove administrative unit '${args.options.id || args.options.displayName}'?` });
53
+ const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove administrative unit '${args.options.id || args.options.displayName}'?` });
54
54
  if (result) {
55
55
  await removeAdministrativeUnit();
56
56
  }
@@ -10,7 +10,7 @@ import { formatting } from '../../../../utils/formatting.js';
10
10
  import { validation } from '../../../../utils/validation.js';
11
11
  import GraphCommand from '../../../base/GraphCommand.js';
12
12
  import commands from '../../commands.js';
13
- import { Cli } from '../../../../cli/Cli.js';
13
+ import { cli } from '../../../../cli/cli.js';
14
14
  class AadAppGetCommand extends GraphCommand {
15
15
  get name() {
16
16
  return commands.APP_GET;
@@ -61,7 +61,7 @@ class AadAppGetCommand extends GraphCommand {
61
61
  throw `No Azure AD application registration with ${applicationIdentifier} found`;
62
62
  }
63
63
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
64
- const result = await Cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${name}' found.`, resultAsKeyValuePair);
64
+ const result = await cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${name}' found.`, resultAsKeyValuePair);
65
65
  return result.id;
66
66
  }
67
67
  async getAppInfo(appObjectId) {
@@ -0,0 +1,237 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var _AadAppPermissionAddCommand_instances, _AadAppPermissionAddCommand_initTelemetry, _AadAppPermissionAddCommand_initOptions, _AadAppPermissionAddCommand_initValidators, _AadAppPermissionAddCommand_initOptionSets;
7
+ import { odata } from "../../../../utils/odata.js";
8
+ import GraphCommand from "../../../base/GraphCommand.js";
9
+ import commands from "../../commands.js";
10
+ import request from "../../../../request.js";
11
+ import { validation } from "../../../../utils/validation.js";
12
+ var ScopeType;
13
+ (function (ScopeType) {
14
+ ScopeType["Role"] = "Role";
15
+ ScopeType["Scope"] = "Scope";
16
+ })(ScopeType || (ScopeType = {}));
17
+ class AadAppPermissionAddCommand extends GraphCommand {
18
+ get name() {
19
+ return commands.APP_PERMISSION_ADD;
20
+ }
21
+ get description() {
22
+ return 'Adds the specified application and/or delegated permissions to a specified Entra ID (Azure AD) app';
23
+ }
24
+ constructor() {
25
+ super();
26
+ _AadAppPermissionAddCommand_instances.add(this);
27
+ __classPrivateFieldGet(this, _AadAppPermissionAddCommand_instances, "m", _AadAppPermissionAddCommand_initTelemetry).call(this);
28
+ __classPrivateFieldGet(this, _AadAppPermissionAddCommand_instances, "m", _AadAppPermissionAddCommand_initOptions).call(this);
29
+ __classPrivateFieldGet(this, _AadAppPermissionAddCommand_instances, "m", _AadAppPermissionAddCommand_initValidators).call(this);
30
+ __classPrivateFieldGet(this, _AadAppPermissionAddCommand_instances, "m", _AadAppPermissionAddCommand_initOptionSets).call(this);
31
+ }
32
+ async commandAction(logger, args) {
33
+ try {
34
+ const appObject = await this.getAppObject(args.options);
35
+ const servicePrincipals = await this.getServicePrincipals();
36
+ const appPermissions = [];
37
+ if (args.options.delegatedPermissions) {
38
+ const delegatedPermissions = await this.getRequiredResourceAccessForApis(servicePrincipals, args.options.delegatedPermissions, ScopeType.Scope, appPermissions, logger);
39
+ this.addPermissionsToResourceArray(delegatedPermissions, appObject.requiredResourceAccess);
40
+ }
41
+ if (args.options.applicationPermissions) {
42
+ const applicationPermissions = await this.getRequiredResourceAccessForApis(servicePrincipals, args.options.applicationPermissions, ScopeType.Role, appPermissions, logger);
43
+ this.addPermissionsToResourceArray(applicationPermissions, appObject.requiredResourceAccess);
44
+ }
45
+ const addPermissionsRequestOptions = {
46
+ url: `${this.resource}/v1.0/applications/${appObject.id}`,
47
+ headers: {
48
+ accept: 'application/json;odata.metadata=none'
49
+ },
50
+ responseType: 'json',
51
+ data: {
52
+ requiredResourceAccess: appObject.requiredResourceAccess
53
+ }
54
+ };
55
+ await request.patch(addPermissionsRequestOptions);
56
+ if (args.options.grantAdminConsent) {
57
+ const appServicePrincipal = servicePrincipals.find(sp => sp.appId === appObject.appId);
58
+ await this.grantAdminConsent(appServicePrincipal, appPermissions, logger);
59
+ }
60
+ }
61
+ catch (err) {
62
+ this.handleRejectedODataJsonPromise(err);
63
+ }
64
+ }
65
+ async getAppObject(options) {
66
+ let apps;
67
+ if (options.appObjectId) {
68
+ apps = await odata.getAllItems(`${this.resource}/v1.0/applications/${options.appObjectId}?$select=id,appId,requiredResourceAccess`);
69
+ }
70
+ else {
71
+ apps = await odata.getAllItems(`${this.resource}/v1.0/applications(appId='${options.appId}')?$select=id,appId,requiredResourceAccess`);
72
+ }
73
+ if (apps.length === 0) {
74
+ throw `App with ${options.appObjectId ? 'object id' : 'client id'} ${options.appObjectId ? options.appObjectId : options.appId} not found in Entra ID (Azure AD)`;
75
+ }
76
+ return apps[0];
77
+ }
78
+ async getServicePrincipals() {
79
+ return await odata.getAllItems(`${this.resource}/v1.0/servicePrincipals?$select=appId,appRoles,id,oauth2PermissionScopes,servicePrincipalNames`);
80
+ }
81
+ async grantAdminConsent(servicePrincipal, appPermissions, logger) {
82
+ for await (const permission of appPermissions) {
83
+ if (permission.scope.length > 0) {
84
+ if (this.verbose) {
85
+ await logger.logToStderr(`Granting consent for delegated permission(s) with resourceId ${permission.resourceId} and scope(s) ${permission.scope.join(' ')}`);
86
+ }
87
+ await this.grantOAuth2Permission(servicePrincipal.id, permission.resourceId, permission.scope.join(' '));
88
+ }
89
+ for await (const access of permission.resourceAccess.filter(acc => acc.type === ScopeType.Role)) {
90
+ if (this.verbose) {
91
+ await logger.logToStderr(`Granting consent for application permission with resourceId ${permission.resourceId} and appRoleId ${access.id}`);
92
+ }
93
+ await this.addRoleToServicePrincipal(servicePrincipal.id, permission.resourceId, access.id);
94
+ }
95
+ }
96
+ }
97
+ async grantOAuth2Permission(servicePrincipalId, resourceId, scope) {
98
+ const grantAdminConsentApplicationRequestOptions = {
99
+ url: `${this.resource}/v1.0/oauth2PermissionGrants`,
100
+ headers: {
101
+ accept: 'application/json;odata.metadata=none'
102
+ },
103
+ responseType: 'json',
104
+ data: {
105
+ clientId: servicePrincipalId,
106
+ consentType: 'AllPrincipals',
107
+ principalId: null,
108
+ resourceId: resourceId,
109
+ scope: scope
110
+ }
111
+ };
112
+ return request.post(grantAdminConsentApplicationRequestOptions);
113
+ }
114
+ async addRoleToServicePrincipal(servicePrincipalId, resourceId, appRoleId) {
115
+ const requestOptions = {
116
+ url: `${this.resource}/v1.0/servicePrincipals/${servicePrincipalId}/appRoleAssignments`,
117
+ headers: {
118
+ 'content-type': 'application/json;odata.metadata=none'
119
+ },
120
+ responseType: 'json',
121
+ data: {
122
+ appRoleId: appRoleId,
123
+ principalId: servicePrincipalId,
124
+ resourceId: resourceId
125
+ }
126
+ };
127
+ return request.post(requestOptions);
128
+ }
129
+ async getRequiredResourceAccessForApis(servicePrincipals, apis, scopeType, appPermissions, logger) {
130
+ const resolvedApis = [];
131
+ const requestedApis = apis.split(' ').map(a => a.trim());
132
+ for await (const api of requestedApis) {
133
+ const pos = api.lastIndexOf('/');
134
+ const permissionName = api.substring(pos + 1);
135
+ const servicePrincipalName = api.substring(0, pos);
136
+ if (this.verbose) {
137
+ await logger.logToStderr(`Resolving ${api}...`);
138
+ await logger.logToStderr(`Permission name: ${permissionName}`);
139
+ await logger.logToStderr(`Service principal name: ${servicePrincipalName}`);
140
+ }
141
+ const servicePrincipal = servicePrincipals.find(sp => (sp.servicePrincipalNames.indexOf(servicePrincipalName) > -1 ||
142
+ sp.servicePrincipalNames.indexOf(`${servicePrincipalName}/`) > -1));
143
+ if (!servicePrincipal) {
144
+ throw `Service principal ${servicePrincipalName} not found`;
145
+ }
146
+ let permission = undefined;
147
+ if (scopeType === ScopeType.Scope) {
148
+ permission = servicePrincipal.oauth2PermissionScopes.find(scope => scope.value === permissionName);
149
+ }
150
+ else if (scopeType === ScopeType.Role) {
151
+ permission = servicePrincipal.appRoles.find(scope => scope.value === permissionName);
152
+ }
153
+ if (!permission) {
154
+ throw `Permission ${permissionName} for service principal ${servicePrincipalName} not found`;
155
+ }
156
+ let resolvedApi = resolvedApis.find(a => a.resourceAppId === servicePrincipal.appId);
157
+ if (!resolvedApi) {
158
+ resolvedApi = {
159
+ resourceAppId: servicePrincipal.appId,
160
+ resourceAccess: []
161
+ };
162
+ resolvedApis.push(resolvedApi);
163
+ }
164
+ const resourceAccessPermission = {
165
+ id: permission.id,
166
+ type: scopeType
167
+ };
168
+ resolvedApi.resourceAccess.push(resourceAccessPermission);
169
+ this.updateAppPermissions(servicePrincipal.id, resourceAccessPermission, permission.value, appPermissions);
170
+ }
171
+ return resolvedApis;
172
+ }
173
+ updateAppPermissions(spId, resourceAccessPermission, oAuth2PermissionValue, appPermissions) {
174
+ let existingPermission = appPermissions.find(oauth => oauth.resourceId === spId);
175
+ if (!existingPermission) {
176
+ existingPermission = {
177
+ resourceId: spId,
178
+ resourceAccess: [],
179
+ scope: []
180
+ };
181
+ appPermissions.push(existingPermission);
182
+ }
183
+ if (resourceAccessPermission.type === ScopeType.Scope && oAuth2PermissionValue && !existingPermission.scope.find(scp => scp === oAuth2PermissionValue)) {
184
+ existingPermission.scope.push(oAuth2PermissionValue);
185
+ }
186
+ if (!existingPermission.resourceAccess.find(res => res.id === resourceAccessPermission.id)) {
187
+ existingPermission.resourceAccess.push(resourceAccessPermission);
188
+ }
189
+ }
190
+ addPermissionsToResourceArray(permissions, existingArray) {
191
+ permissions.forEach(resolvedRequiredResource => {
192
+ const requiredResource = existingArray.find(api => api.resourceAppId === resolvedRequiredResource.resourceAppId);
193
+ if (requiredResource) {
194
+ // make sure that permission does not yet exist on the app or it will be added twice
195
+ resolvedRequiredResource.resourceAccess.forEach(resAccess => {
196
+ if (!requiredResource.resourceAccess.some(res => res.id === resAccess.id)) {
197
+ requiredResource.resourceAccess.push(resAccess);
198
+ }
199
+ });
200
+ }
201
+ else {
202
+ existingArray.push(resolvedRequiredResource);
203
+ }
204
+ });
205
+ }
206
+ }
207
+ _AadAppPermissionAddCommand_instances = new WeakSet(), _AadAppPermissionAddCommand_initTelemetry = function _AadAppPermissionAddCommand_initTelemetry() {
208
+ this.telemetry.push((args) => {
209
+ Object.assign(this.telemetryProperties, {
210
+ appId: typeof args.options.appId !== 'undefined',
211
+ appObjectId: typeof args.options.appObjectId !== 'undefined',
212
+ applicationPermissions: typeof args.options.applicationPermissions !== 'undefined',
213
+ delegatedPermissions: typeof args.options.delegatedPermissions !== 'undefined',
214
+ grantAdminConsent: !!args.options.grantAdminConsent
215
+ });
216
+ });
217
+ }, _AadAppPermissionAddCommand_initOptions = function _AadAppPermissionAddCommand_initOptions() {
218
+ this.options.unshift({ option: '-i, --appId [appId]' }, { option: '--appObjectId [appObjectId]' }, { option: '-a, --applicationPermissions [applicationPermissions]' }, { option: '-d, --delegatedPermissions [delegatedPermissions]' }, { option: '--grantAdminConsent' });
219
+ }, _AadAppPermissionAddCommand_initValidators = function _AadAppPermissionAddCommand_initValidators() {
220
+ this.validators.push(async (args) => {
221
+ if (args.options.appId && !validation.isValidGuid(args.options.appId)) {
222
+ return `${args.options.appId} is not a valid GUID`;
223
+ }
224
+ if (args.options.appObjectId && !validation.isValidGuid(args.options.appObjectId)) {
225
+ return `${args.options.appObjectId} is not a valid GUID`;
226
+ }
227
+ return true;
228
+ });
229
+ }, _AadAppPermissionAddCommand_initOptionSets = function _AadAppPermissionAddCommand_initOptionSets() {
230
+ this.optionSets.push({ options: ['appId', 'appObjectId'] });
231
+ this.optionSets.push({
232
+ options: ['applicationPermissions', 'delegatedPermissions'],
233
+ runsWhen: (args) => args.options.delegatedPermissions === undefined && args.options.applicationPermissions === undefined
234
+ });
235
+ };
236
+ export default new AadAppPermissionAddCommand();
237
+ //# sourceMappingURL=app-permission-add.js.map
@@ -4,7 +4,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
4
4
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
5
  };
6
6
  var _AadAppRemoveCommand_instances, _AadAppRemoveCommand_initTelemetry, _AadAppRemoveCommand_initOptions, _AadAppRemoveCommand_initValidators, _AadAppRemoveCommand_initOptionSets;
7
- import { Cli } from '../../../../cli/Cli.js';
7
+ import { cli } from '../../../../cli/cli.js';
8
8
  import request from '../../../../request.js';
9
9
  import { formatting } from '../../../../utils/formatting.js';
10
10
  import { validation } from '../../../../utils/validation.js';
@@ -49,7 +49,7 @@ class AadAppRemoveCommand extends GraphCommand {
49
49
  await deleteApp();
50
50
  }
51
51
  else {
52
- const result = await Cli.promptForConfirmation({ message: `Are you sure you want to remove the app?` });
52
+ const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the app?` });
53
53
  if (result) {
54
54
  await deleteApp();
55
55
  }
@@ -82,7 +82,7 @@ class AadAppRemoveCommand extends GraphCommand {
82
82
  throw `No Azure AD application registration with ${applicationIdentifier} found`;
83
83
  }
84
84
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
85
- const result = await Cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${name}' found.`, resultAsKeyValuePair);
85
+ const result = await cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${name}' found.`, resultAsKeyValuePair);
86
86
  return result.id;
87
87
  }
88
88
  }
@@ -9,7 +9,7 @@ import request from '../../../../request.js';
9
9
  import { formatting } from '../../../../utils/formatting.js';
10
10
  import GraphCommand from '../../../base/GraphCommand.js';
11
11
  import commands from '../../commands.js';
12
- import { Cli } from '../../../../cli/Cli.js';
12
+ import { cli } from '../../../../cli/cli.js';
13
13
  class AadAppRoleAddCommand extends GraphCommand {
14
14
  get name() {
15
15
  return commands.APP_ROLE_ADD;
@@ -106,7 +106,7 @@ class AadAppRoleAddCommand extends GraphCommand {
106
106
  throw `No Azure AD application registration with ${applicationIdentifier} found`;
107
107
  }
108
108
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
109
- const result = await Cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${appName}' found.`, resultAsKeyValuePair);
109
+ const result = await cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${appName}' found.`, resultAsKeyValuePair);
110
110
  return result.id;
111
111
  }
112
112
  }
@@ -9,7 +9,7 @@ import { formatting } from '../../../../utils/formatting.js';
9
9
  import { odata } from '../../../../utils/odata.js';
10
10
  import GraphCommand from '../../../base/GraphCommand.js';
11
11
  import commands from '../../commands.js';
12
- import { Cli } from '../../../../cli/Cli.js';
12
+ import { cli } from '../../../../cli/cli.js';
13
13
  class AadAppRoleListCommand extends GraphCommand {
14
14
  get name() {
15
15
  return commands.APP_ROLE_LIST;
@@ -64,7 +64,7 @@ class AadAppRoleListCommand extends GraphCommand {
64
64
  throw `No Azure AD application registration with ${applicationIdentifier} found`;
65
65
  }
66
66
  const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
67
- const result = await Cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${appName}' found.`, resultAsKeyValuePair);
67
+ const result = await cli.handleMultipleResultsFound(`Multiple Azure AD application registration with name '${appName}' found.`, resultAsKeyValuePair);
68
68
  return result.id;
69
69
  }
70
70
  }