@pnp/cli-microsoft365 6.7.0 → 6.8.0-beta.00c3a00

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 (267) hide show
  1. package/.eslintrc.js +2 -0
  2. package/.mocharc.json +1 -0
  3. package/README.md +6 -1
  4. package/dist/Command.js +6 -0
  5. package/dist/chili/chili.js +298 -0
  6. package/dist/chili/index.js +20 -0
  7. package/dist/cli/Cli.js +2 -2
  8. package/dist/m365/aad/commands/user/user-add.js +30 -21
  9. package/dist/m365/app/commands/permission/permission-add.js +279 -0
  10. package/dist/m365/app/commands.js +1 -0
  11. package/dist/m365/commands/commands.js +2 -0
  12. package/dist/m365/commands/docs.js +42 -0
  13. package/dist/m365/commands/login.js +1 -1
  14. package/dist/m365/commands/setup.js +180 -0
  15. package/dist/m365/commands/setupPresets.js +25 -0
  16. package/dist/m365/pa/commands/app/app-consent-set.js +101 -0
  17. package/dist/m365/pa/commands.js +1 -0
  18. package/dist/m365/planner/commands/roster/roster-plan-list.js +102 -0
  19. package/dist/m365/planner/commands.js +1 -0
  20. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +97 -0
  21. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +85 -0
  22. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +89 -0
  23. package/dist/m365/purview/commands.js +3 -0
  24. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +2 -0
  25. package/dist/m365/spfx/commands/spfx-doctor.js +14 -30
  26. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +146 -0
  27. package/dist/m365/spo/commands/file/file-checkin.js +8 -3
  28. package/dist/m365/spo/commands/file/file-checkout.js +8 -3
  29. package/dist/m365/spo/commands/file/file-copy.js +4 -4
  30. package/dist/m365/spo/commands/file/file-get.js +3 -1
  31. package/dist/m365/spo/commands/file/file-list.js +17 -6
  32. package/dist/m365/spo/commands/file/file-move.js +6 -7
  33. package/dist/m365/spo/commands/file/file-remove.js +6 -12
  34. package/dist/m365/spo/commands/file/file-rename.js +3 -3
  35. package/dist/m365/spo/commands/file/file-roleassignment-add.js +2 -1
  36. package/dist/m365/spo/commands/file/file-roleassignment-remove.js +3 -3
  37. package/dist/m365/spo/commands/file/file-roleinheritance-break.js +2 -1
  38. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +2 -1
  39. package/dist/m365/spo/commands/file/file-sharinginfo-get.js +4 -2
  40. package/dist/m365/spo/commands/file/file-version-clear.js +3 -1
  41. package/dist/m365/spo/commands/file/file-version-get.js +3 -1
  42. package/dist/m365/spo/commands/file/file-version-remove.js +3 -1
  43. package/dist/m365/spo/commands/file/file-version-restore.js +3 -1
  44. package/dist/m365/spo/commands/folder/folder-copy.js +4 -4
  45. package/dist/m365/spo/commands/folder/folder-get.js +5 -2
  46. package/dist/m365/spo/commands/folder/folder-move.js +3 -2
  47. package/dist/m365/spo/commands/folder/folder-rename.js +5 -2
  48. package/dist/m365/spo/commands/list/list-get.js +30 -3
  49. package/dist/m365/spo/commands/list/list-list.js +39 -2
  50. package/dist/m365/spo/commands/listitem/listitem-batch-set.js +308 -0
  51. package/dist/m365/spo/commands/page/page-section-add.js +2 -3
  52. package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +46 -1
  53. package/dist/m365/spo/commands/site/site-recyclebinitem-move.js +119 -0
  54. package/dist/m365/spo/commands/site/site-recyclebinitem-remove.js +106 -0
  55. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +30 -39
  56. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +47 -0
  57. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +151 -0
  58. package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +152 -0
  59. package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +203 -0
  60. package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -0
  61. package/dist/m365/spo/commands/term/term-add.js +13 -4
  62. package/dist/m365/spo/commands/term/term-get.js +14 -5
  63. package/dist/m365/spo/commands/term/term-group-get.js +12 -3
  64. package/dist/m365/spo/commands/term/term-group-list.js +39 -4
  65. package/dist/m365/spo/commands/term/term-list.js +18 -9
  66. package/dist/m365/spo/commands/term/term-set-add.js +13 -4
  67. package/dist/m365/spo/commands/term/term-set-get.js +12 -3
  68. package/dist/m365/spo/commands/term/term-set-list.js +12 -3
  69. package/dist/m365/spo/commands.js +9 -0
  70. package/dist/m365/teams/commands/chat/chat-member-remove.js +137 -0
  71. package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +124 -0
  72. package/dist/m365/teams/commands.js +2 -0
  73. package/dist/utils/formatting.js +35 -11
  74. package/dist/utils/pid.js +5 -0
  75. package/dist/utils/spo.js +1 -1
  76. package/docs/docs/cmd/aad/o365group/o365group-get.md +0 -12
  77. package/docs/docs/cmd/aad/user/user-add.md +4 -0
  78. package/docs/docs/cmd/aad/user/user-set.md +2 -2
  79. package/docs/docs/cmd/app/permission/permission-add.md +53 -0
  80. package/docs/docs/cmd/cli/cli-consent.md +6 -0
  81. package/docs/docs/cmd/cli/cli-doctor.md +17 -0
  82. package/docs/docs/cmd/cli/cli-issue.md +6 -0
  83. package/docs/docs/cmd/cli/cli-reconsent.md +6 -0
  84. package/docs/docs/cmd/cli/completion/completion-sh-setup.md +6 -0
  85. package/docs/docs/cmd/cli/config/config-get.md +6 -0
  86. package/docs/docs/cmd/docs.md +51 -0
  87. package/docs/docs/cmd/flow/environment/environment-list.md +18 -0
  88. package/docs/docs/cmd/flow/flow-get.md +20 -0
  89. package/docs/docs/cmd/flow/flow-list.md +17 -0
  90. package/docs/docs/cmd/graph/changelog/changelog-list.md +52 -0
  91. package/docs/docs/cmd/graph/schemaextension/schemaextension-add.md +61 -0
  92. package/docs/docs/cmd/graph/schemaextension/schemaextension-get.md +61 -0
  93. package/docs/docs/cmd/graph/schemaextension/schemaextension-list.md +61 -0
  94. package/docs/docs/cmd/graph/schemaextension/schemaextension-remove.md +4 -0
  95. package/docs/docs/cmd/graph/schemaextension/schemaextension-set.md +4 -0
  96. package/docs/docs/cmd/graph/subscription/subscription-add.md +73 -0
  97. package/docs/docs/cmd/login.md +1 -1
  98. package/docs/docs/cmd/onedrive/onedrive-list.md +225 -0
  99. package/docs/docs/cmd/onedrive/report/report-activityfilecounts.md +39 -0
  100. package/docs/docs/cmd/onedrive/report/report-activityusercounts.md +39 -0
  101. package/docs/docs/cmd/onedrive/report/report-activityuserdetail.md +43 -0
  102. package/docs/docs/cmd/onedrive/report/report-usageaccountcounts.md +38 -0
  103. package/docs/docs/cmd/onedrive/report/report-usageaccountdetail.md +43 -0
  104. package/docs/docs/cmd/onedrive/report/report-usagefilecounts.md +38 -0
  105. package/docs/docs/cmd/onedrive/report/report-usagestorage.md +37 -0
  106. package/docs/docs/cmd/onenote/notebook/notebook-list.md +79 -0
  107. package/docs/docs/cmd/pa/app/app-consent-set.md +47 -0
  108. package/docs/docs/cmd/planner/plan/plan-get.md +1 -1
  109. package/docs/docs/cmd/planner/plan/plan-list.md +1 -1
  110. package/docs/docs/cmd/planner/roster/roster-add.md +2 -1
  111. package/docs/docs/cmd/planner/roster/roster-get.md +1 -1
  112. package/docs/docs/cmd/planner/roster/roster-plan-list.md +109 -0
  113. package/docs/docs/cmd/planner/roster/roster-remove.md +2 -1
  114. package/docs/docs/cmd/planner/task/task-get.md +0 -6
  115. package/docs/docs/cmd/planner/task/task-set.md +1 -1
  116. package/docs/docs/cmd/purview/retentionevent/retentionevent-add.md +6 -7
  117. package/docs/docs/cmd/purview/retentionevent/retentionevent-get.md +6 -7
  118. package/docs/docs/cmd/purview/retentionevent/retentionevent-list.md +4 -4
  119. package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.md +4 -4
  120. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +10 -10
  121. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.md +11 -11
  122. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.md +10 -10
  123. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.md +10 -10
  124. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.md +10 -10
  125. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +12 -12
  126. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.md +8 -9
  127. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.md +8 -9
  128. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.md +8 -8
  129. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.md +8 -8
  130. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.md +118 -0
  131. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.md +111 -0
  132. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.md +97 -0
  133. package/docs/docs/cmd/search/externalconnection/externalconnection-get.md +17 -0
  134. package/docs/docs/cmd/search/externalconnection/externalconnection-list.md +17 -0
  135. package/docs/docs/cmd/setup.md +86 -0
  136. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +1 -1
  137. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.md +77 -0
  138. package/docs/docs/cmd/spo/commandset/commandset-set.md +1 -1
  139. package/docs/docs/cmd/spo/contenttype/contenttype-set.md +2 -2
  140. package/docs/docs/cmd/spo/customaction/customaction-add.md +1 -1
  141. package/docs/docs/cmd/spo/customaction/customaction-set.md +1 -1
  142. package/docs/docs/cmd/spo/feature/feature-enable.md +2 -2
  143. package/docs/docs/cmd/spo/file/file-add.md +1 -1
  144. package/docs/docs/cmd/spo/file/file-checkin.md +1 -1
  145. package/docs/docs/cmd/spo/file/file-checkout.md +1 -1
  146. package/docs/docs/cmd/spo/file/file-copy.md +1 -1
  147. package/docs/docs/cmd/spo/file/file-get.md +1 -1
  148. package/docs/docs/cmd/spo/file/file-list.md +9 -6
  149. package/docs/docs/cmd/spo/file/file-move.md +3 -3
  150. package/docs/docs/cmd/spo/file/file-remove.md +12 -0
  151. package/docs/docs/cmd/spo/file/file-rename.md +1 -1
  152. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.md +3 -3
  153. package/docs/docs/cmd/spo/file/file-retentionlabel-remove.md +2 -2
  154. package/docs/docs/cmd/spo/file/file-roleassignment-add.md +1 -1
  155. package/docs/docs/cmd/spo/file/file-roleassignment-remove.md +1 -1
  156. package/docs/docs/cmd/spo/file/file-roleinheritance-break.md +1 -1
  157. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.md +1 -1
  158. package/docs/docs/cmd/spo/file/file-sharinginfo-get.md +1 -1
  159. package/docs/docs/cmd/spo/file/file-sharinglink-add.md +1 -1
  160. package/docs/docs/cmd/spo/file/file-sharinglink-clear.md +1 -1
  161. package/docs/docs/cmd/spo/file/file-sharinglink-get.md +1 -1
  162. package/docs/docs/cmd/spo/file/file-sharinglink-list.md +1 -1
  163. package/docs/docs/cmd/spo/file/file-sharinglink-remove.md +1 -1
  164. package/docs/docs/cmd/spo/file/file-sharinglink-set.md +1 -1
  165. package/docs/docs/cmd/spo/file/file-version-clear.md +2 -2
  166. package/docs/docs/cmd/spo/file/file-version-get.md +1 -1
  167. package/docs/docs/cmd/spo/file/file-version-list.md +1 -1
  168. package/docs/docs/cmd/spo/file/file-version-remove.md +1 -1
  169. package/docs/docs/cmd/spo/file/file-version-restore.md +1 -1
  170. package/docs/docs/cmd/spo/folder/folder-add.md +9 -3
  171. package/docs/docs/cmd/spo/folder/folder-copy.md +2 -2
  172. package/docs/docs/cmd/spo/folder/folder-get.md +7 -7
  173. package/docs/docs/cmd/spo/folder/folder-list.md +11 -11
  174. package/docs/docs/cmd/spo/folder/folder-move.md +1 -1
  175. package/docs/docs/cmd/spo/folder/folder-remove.md +7 -7
  176. package/docs/docs/cmd/spo/folder/folder-rename.md +11 -5
  177. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.md +3 -3
  178. package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.md +1 -1
  179. package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.md +1 -1
  180. package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.md +4 -4
  181. package/docs/docs/cmd/spo/list/list-get.md +10 -0
  182. package/docs/docs/cmd/spo/list/list-list.md +28 -0
  183. package/docs/docs/cmd/spo/listitem/listitem-batch-set.md +67 -0
  184. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.md +19 -0
  185. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.md +12 -0
  186. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.md +6 -0
  187. package/docs/docs/cmd/spo/page/page-column-get.md +15 -0
  188. package/docs/docs/cmd/spo/page/page-column-list.md +16 -0
  189. package/docs/docs/cmd/spo/page/page-control-get.md +18 -0
  190. package/docs/docs/cmd/spo/page/page-control-list.md +18 -0
  191. package/docs/docs/cmd/spo/page/page-copy.md +35 -0
  192. package/docs/docs/cmd/spo/page/page-get.md +39 -0
  193. package/docs/docs/cmd/spo/page/page-list.md +53 -0
  194. package/docs/docs/cmd/spo/page/page-section-get.md +12 -0
  195. package/docs/docs/cmd/spo/page/page-section-list.md +13 -0
  196. package/docs/docs/cmd/spo/page/page-template-list.md +31 -0
  197. package/docs/docs/cmd/spo/propertybag/propertybag-get.md +6 -0
  198. package/docs/docs/cmd/spo/propertybag/propertybag-list.md +13 -0
  199. package/docs/docs/cmd/spo/report/report-activityfilecounts.md +7 -0
  200. package/docs/docs/cmd/spo/report/report-activitypages.md +7 -0
  201. package/docs/docs/cmd/spo/report/report-activityusercounts.md +7 -0
  202. package/docs/docs/cmd/spo/report/report-activityuserdetail.md +7 -0
  203. package/docs/docs/cmd/spo/report/report-siteusagedetail.md +7 -0
  204. package/docs/docs/cmd/spo/report/report-siteusagefilecounts.md +7 -0
  205. package/docs/docs/cmd/spo/report/report-siteusagepages.md +7 -0
  206. package/docs/docs/cmd/spo/report/report-siteusagesitecounts.md +7 -0
  207. package/docs/docs/cmd/spo/report/report-siteusagestorage.md +7 -0
  208. package/docs/docs/cmd/spo/roledefinition/roledefinition-get.md +20 -0
  209. package/docs/docs/cmd/spo/roledefinition/roledefinition-list.md +20 -0
  210. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-add.md +20 -0
  211. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-list.md +18 -0
  212. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-approve.md +20 -0
  213. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-list.md +17 -0
  214. package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-set.md +13 -0
  215. package/docs/docs/cmd/spo/site/site-recyclebinitem-move.md +43 -0
  216. package/docs/docs/cmd/spo/site/site-recyclebinitem-remove.md +45 -0
  217. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +1 -1
  218. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.md +103 -0
  219. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.md +49 -0
  220. package/docs/docs/cmd/spo/tenant/tenant-commandset-remove.md +49 -0
  221. package/docs/docs/cmd/spo/tenant/tenant-commandset-set.md +57 -0
  222. package/docs/docs/cmd/spo/tenant/tenant-settings-set.md +57 -54
  223. package/docs/docs/cmd/spo/term/term-add.md +107 -6
  224. package/docs/docs/cmd/spo/term/term-get.md +111 -10
  225. package/docs/docs/cmd/spo/term/term-group-get.md +71 -5
  226. package/docs/docs/cmd/spo/term/term-group-list.md +70 -2
  227. package/docs/docs/cmd/spo/term/term-list.md +80 -8
  228. package/docs/docs/cmd/spo/term/term-set-add.md +95 -11
  229. package/docs/docs/cmd/spo/term/term-set-get.md +92 -8
  230. package/docs/docs/cmd/spo/term/term-set-list.md +85 -5
  231. package/docs/docs/cmd/teams/app/app-list.md +17 -0
  232. package/docs/docs/cmd/teams/app/app-publish.md +18 -1
  233. package/docs/docs/cmd/teams/channel/channel-add.md +20 -0
  234. package/docs/docs/cmd/teams/channel/channel-get.md +21 -0
  235. package/docs/docs/cmd/teams/channel/channel-list.md +21 -0
  236. package/docs/docs/cmd/teams/channel/channel-member-list.md +20 -0
  237. package/docs/docs/cmd/teams/channel/channel-member-set.md +21 -0
  238. package/docs/docs/cmd/teams/chat/chat-get.md +22 -0
  239. package/docs/docs/cmd/teams/chat/chat-list.md +22 -0
  240. package/docs/docs/cmd/teams/chat/chat-member-list.md +20 -0
  241. package/docs/docs/cmd/teams/chat/chat-member-remove.md +52 -0
  242. package/docs/docs/cmd/teams/chat/chat-message-list.md +23 -0
  243. package/docs/docs/cmd/teams/funsettings/funsettings-list.md +15 -0
  244. package/docs/docs/cmd/teams/guestsettings/guestsettings-list.md +13 -0
  245. package/docs/docs/cmd/teams/meeting/meeting-transcript-list.md +96 -0
  246. package/docs/docs/cmd/teams/membersettings/membersettings-list.md +17 -0
  247. package/docs/docs/cmd/teams/tab/tab-remove.md +1 -1
  248. package/docs/docs/cmd/version.md +1 -1
  249. package/docs/docs/cmd/yammer/group/group-list.md +42 -0
  250. package/docs/docs/cmd/yammer/message/message-add.md +32 -0
  251. package/docs/docs/cmd/yammer/message/message-get.md +32 -0
  252. package/docs/docs/cmd/yammer/message/message-list.md +34 -0
  253. package/docs/docs/cmd/yammer/network/network-list.md +70 -0
  254. package/docs/docs/cmd/yammer/report/report-activitycounts.md +7 -0
  255. package/docs/docs/cmd/yammer/report/report-activityusercounts.md +7 -0
  256. package/docs/docs/cmd/yammer/report/report-activityuserdetail.md +7 -0
  257. package/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.md +7 -0
  258. package/docs/docs/cmd/yammer/report/report-deviceusageusercounts.md +7 -0
  259. package/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.md +7 -0
  260. package/docs/docs/cmd/yammer/report/report-groupsactivitycounts.md +7 -0
  261. package/docs/docs/cmd/yammer/report/report-groupsactivitydetail.md +7 -0
  262. package/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.md +7 -0
  263. package/docs/docs/cmd/yammer/user/user-get.md +55 -0
  264. package/docs/docs/cmd/yammer/user/user-list.md +55 -0
  265. package/docs/docs/cmd/yammer/yammer-search.md +15 -3
  266. package/npm-shrinkwrap.json +269 -336
  267. package/package.json +15 -13
@@ -0,0 +1,152 @@
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 _SpoTenantCommandSetRemoveCommand_instances, _SpoTenantCommandSetRemoveCommand_initTelemetry, _SpoTenantCommandSetRemoveCommand_initOptions, _SpoTenantCommandSetRemoveCommand_initValidators, _SpoTenantCommandSetRemoveCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Cli_1 = require("../../../../cli/Cli");
19
+ const request_1 = require("../../../../request");
20
+ const formatting_1 = require("../../../../utils/formatting");
21
+ const odata_1 = require("../../../../utils/odata");
22
+ const spo_1 = require("../../../../utils/spo");
23
+ const urlUtil_1 = require("../../../../utils/urlUtil");
24
+ const validation_1 = require("../../../../utils/validation");
25
+ const SpoCommand_1 = require("../../../base/SpoCommand");
26
+ const commands_1 = require("../../commands");
27
+ class SpoTenantCommandSetRemoveCommand extends SpoCommand_1.default {
28
+ get name() {
29
+ return commands_1.default.TENANT_COMMANDSET_REMOVE;
30
+ }
31
+ get description() {
32
+ return 'Removes a ListView Command Set that is installed tenant wide.';
33
+ }
34
+ constructor() {
35
+ super();
36
+ _SpoTenantCommandSetRemoveCommand_instances.add(this);
37
+ __classPrivateFieldGet(this, _SpoTenantCommandSetRemoveCommand_instances, "m", _SpoTenantCommandSetRemoveCommand_initTelemetry).call(this);
38
+ __classPrivateFieldGet(this, _SpoTenantCommandSetRemoveCommand_instances, "m", _SpoTenantCommandSetRemoveCommand_initOptions).call(this);
39
+ __classPrivateFieldGet(this, _SpoTenantCommandSetRemoveCommand_instances, "m", _SpoTenantCommandSetRemoveCommand_initValidators).call(this);
40
+ __classPrivateFieldGet(this, _SpoTenantCommandSetRemoveCommand_instances, "m", _SpoTenantCommandSetRemoveCommand_initOptionSets).call(this);
41
+ }
42
+ commandAction(logger, args) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ try {
45
+ if (args.options.confirm) {
46
+ return yield this.removeTenantCommandSet(logger, args);
47
+ }
48
+ const result = yield Cli_1.Cli.prompt({
49
+ type: 'confirm',
50
+ name: 'continue',
51
+ default: false,
52
+ message: `Are you sure you want to remove the tenant commandset ${args.options.id || args.options.title || args.options.clientSideComponentId}?`
53
+ });
54
+ if (result.continue) {
55
+ yield this.removeTenantCommandSet(logger, args);
56
+ }
57
+ }
58
+ catch (err) {
59
+ logger.log(err);
60
+ this.handleRejectedODataJsonPromise(err);
61
+ }
62
+ });
63
+ }
64
+ removeTenantCommandSet(logger, args) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ const appCatalogUrl = yield spo_1.spo.getTenantAppCatalogUrl(logger, this.debug);
67
+ if (!appCatalogUrl) {
68
+ throw 'No app catalog URL found';
69
+ }
70
+ const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
71
+ const requestUrl = `${appCatalogUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
72
+ const id = yield this.getTenantCommandSetId(logger, args, requestUrl);
73
+ if (this.verbose) {
74
+ logger.logToStderr(`Removing tenant command set ${args.options.id || args.options.title || args.options.clientSideComponentId}`);
75
+ }
76
+ const requestOptions = {
77
+ url: `${requestUrl}/items(${id})`,
78
+ method: 'POST',
79
+ headers: {
80
+ 'X-HTTP-Method': 'DELETE',
81
+ 'If-Match': '*',
82
+ 'accept': 'application/json;odata=nometadata'
83
+ },
84
+ responseType: 'json'
85
+ };
86
+ yield request_1.default.post(requestOptions);
87
+ });
88
+ }
89
+ getTenantCommandSetId(logger, args, requestUrl) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ if (this.verbose) {
92
+ logger.logToStderr(`Getting the tenant command set ${args.options.id || args.options.title || args.options.clientSideComponentId}`);
93
+ }
94
+ let filter = '';
95
+ if (args.options.title) {
96
+ filter = `Title eq '${args.options.title}'`;
97
+ }
98
+ else if (args.options.id) {
99
+ filter = `Id eq ${args.options.id}`;
100
+ }
101
+ else {
102
+ filter = `TenantWideExtensionComponentId eq '${args.options.clientSideComponentId}'`;
103
+ }
104
+ const listItemInstances = yield odata_1.odata.getAllItems(`${requestUrl}/items?$filter=startswith(TenantWideExtensionLocation,'ClientSideExtension.ListViewCommandSet') and ${filter}`);
105
+ if (listItemInstances.length === 0) {
106
+ throw 'The specified command set was not found';
107
+ }
108
+ if (listItemInstances.length > 1) {
109
+ throw `Multiple command sets with ${args.options.title || args.options.clientSideComponentId} were found. Please disambiguate (IDs): ${listItemInstances.map(item => item.Id).join(', ')}`;
110
+ }
111
+ return listItemInstances[0].Id;
112
+ });
113
+ }
114
+ }
115
+ _SpoTenantCommandSetRemoveCommand_instances = new WeakSet(), _SpoTenantCommandSetRemoveCommand_initTelemetry = function _SpoTenantCommandSetRemoveCommand_initTelemetry() {
116
+ this.telemetry.push((args) => {
117
+ Object.assign(this.telemetryProperties, {
118
+ title: typeof args.options.title !== 'undefined',
119
+ id: typeof args.options.id !== 'undefined',
120
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
121
+ confirm: !!args.options.confirm
122
+ });
123
+ });
124
+ }, _SpoTenantCommandSetRemoveCommand_initOptions = function _SpoTenantCommandSetRemoveCommand_initOptions() {
125
+ this.options.unshift({
126
+ option: '-t, --title [title]'
127
+ }, {
128
+ option: '-i, --id [id]'
129
+ }, {
130
+ option: '-c, --clientSideComponentId [clientSideComponentId]'
131
+ }, {
132
+ option: '--confirm'
133
+ });
134
+ }, _SpoTenantCommandSetRemoveCommand_initValidators = function _SpoTenantCommandSetRemoveCommand_initValidators() {
135
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
136
+ if (args.options.id) {
137
+ const id = parseInt(args.options.id);
138
+ if (isNaN(id)) {
139
+ return `${args.options.id} is not a valid list item ID`;
140
+ }
141
+ }
142
+ if (args.options.clientSideComponentId &&
143
+ !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
144
+ return `${args.options.clientSideComponentId} is not a valid GUID`;
145
+ }
146
+ return true;
147
+ }));
148
+ }, _SpoTenantCommandSetRemoveCommand_initOptionSets = function _SpoTenantCommandSetRemoveCommand_initOptionSets() {
149
+ this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
150
+ };
151
+ module.exports = new SpoTenantCommandSetRemoveCommand();
152
+ //# sourceMappingURL=tenant-commandset-remove.js.map
@@ -0,0 +1,203 @@
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 _SpoTenantCommandSetSetCommand_instances, _SpoTenantCommandSetSetCommand_initTelemetry, _SpoTenantCommandSetSetCommand_initOptions, _SpoTenantCommandSetSetCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const validation_1 = require("../../../../utils/validation");
19
+ const SpoCommand_1 = require("../../../base/SpoCommand");
20
+ const commands_1 = require("../../commands");
21
+ const urlUtil_1 = require("../../../../utils/urlUtil");
22
+ const request_1 = require("../../../../request");
23
+ const formatting_1 = require("../../../../utils/formatting");
24
+ const spo_1 = require("../../../../utils/spo");
25
+ class SpoTenantCommandSetSetCommand extends SpoCommand_1.default {
26
+ get name() {
27
+ return commands_1.default.TENANT_COMMANDSET_SET;
28
+ }
29
+ get description() {
30
+ return 'Updates a ListView Command Set that is installed tenant wide.';
31
+ }
32
+ constructor() {
33
+ super();
34
+ _SpoTenantCommandSetSetCommand_instances.add(this);
35
+ __classPrivateFieldGet(this, _SpoTenantCommandSetSetCommand_instances, "m", _SpoTenantCommandSetSetCommand_initTelemetry).call(this);
36
+ __classPrivateFieldGet(this, _SpoTenantCommandSetSetCommand_instances, "m", _SpoTenantCommandSetSetCommand_initOptions).call(this);
37
+ __classPrivateFieldGet(this, _SpoTenantCommandSetSetCommand_instances, "m", _SpoTenantCommandSetSetCommand_initValidators).call(this);
38
+ }
39
+ commandAction(logger, args) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ try {
42
+ const appCatalogUrl = yield spo_1.spo.getTenantAppCatalogUrl(logger, this.debug);
43
+ if (!appCatalogUrl) {
44
+ throw 'No app catalog URL found';
45
+ }
46
+ const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
47
+ const listItem = yield this.getListItemById(logger, appCatalogUrl, listServerRelativeUrl, args.options.id);
48
+ if (listItem.TenantWideExtensionLocation.indexOf("ClientSideExtension.ListViewCommandSet") === -1) {
49
+ throw 'The item is not a ListViewCommandSet';
50
+ }
51
+ yield this.updateTenantWideExtension(appCatalogUrl, args.options, listServerRelativeUrl, logger);
52
+ }
53
+ catch (err) {
54
+ this.handleRejectedODataJsonPromise(err);
55
+ }
56
+ });
57
+ }
58
+ getListItemById(logger, webUrl, listServerRelativeUrl, id) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ if (this.verbose) {
61
+ logger.logToStderr(`Getting the list item by id ${id}`);
62
+ }
63
+ const reqOptions = {
64
+ url: `${webUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/Items(${id})`,
65
+ headers: {
66
+ 'accept': 'application/json;odata=nometadata'
67
+ },
68
+ responseType: 'json'
69
+ };
70
+ return yield request_1.default.get(reqOptions);
71
+ });
72
+ }
73
+ updateTenantWideExtension(appCatalogUrl, options, listServerRelativeUrl, logger) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ if (this.verbose) {
76
+ logger.logToStderr('Updating tenant wide extension to the TenantWideExtensions list');
77
+ }
78
+ const formValues = [];
79
+ if (options.newTitle !== undefined) {
80
+ formValues.push({
81
+ FieldName: 'Title',
82
+ FieldValue: options.newTitle
83
+ });
84
+ }
85
+ if (options.clientSideComponentId !== undefined) {
86
+ formValues.push({
87
+ FieldName: 'TenantWideExtensionComponentId',
88
+ FieldValue: options.clientSideComponentId
89
+ });
90
+ }
91
+ if (options.location !== undefined) {
92
+ formValues.push({
93
+ FieldName: 'TenantWideExtensionLocation',
94
+ FieldValue: this.getLocation(options.location)
95
+ });
96
+ }
97
+ if (options.listType !== undefined) {
98
+ formValues.push({
99
+ FieldName: 'TenantWideExtensionListTemplate',
100
+ FieldValue: this.getListTemplate(options.listType)
101
+ });
102
+ }
103
+ if (options.clientSideComponentProperties !== undefined) {
104
+ formValues.push({
105
+ FieldName: 'TenantWideExtensionComponentProperties',
106
+ FieldValue: options.clientSideComponentProperties
107
+ });
108
+ }
109
+ if (options.webTemplate !== undefined) {
110
+ formValues.push({
111
+ FieldName: 'TenantWideExtensionWebTemplate',
112
+ FieldValue: options.webTemplate
113
+ });
114
+ }
115
+ const requestOptions = {
116
+ url: `${appCatalogUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/Items(${options.id})/ValidateUpdateListItem()`,
117
+ headers: {
118
+ 'accept': 'application/json;odata=nometadata'
119
+ },
120
+ data: {
121
+ formValues: formValues
122
+ },
123
+ responseType: 'json'
124
+ };
125
+ yield request_1.default.post(requestOptions);
126
+ });
127
+ }
128
+ getLocation(location) {
129
+ switch (location) {
130
+ case 'Both':
131
+ return 'ClientSideExtension.ListViewCommandSet';
132
+ case 'ContextMenu':
133
+ return 'ClientSideExtension.ListViewCommandSet.ContextMenu';
134
+ default:
135
+ return 'ClientSideExtension.ListViewCommandSet.CommandBar';
136
+ }
137
+ }
138
+ getListTemplate(listTemplate) {
139
+ switch (listTemplate) {
140
+ case 'SitePages':
141
+ return '119';
142
+ case 'Library':
143
+ return '101';
144
+ default:
145
+ return '100';
146
+ }
147
+ }
148
+ }
149
+ _SpoTenantCommandSetSetCommand_instances = new WeakSet(), _SpoTenantCommandSetSetCommand_initTelemetry = function _SpoTenantCommandSetSetCommand_initTelemetry() {
150
+ this.telemetry.push((args) => {
151
+ Object.assign(this.telemetryProperties, {
152
+ newTitle: typeof args.options.newTitle !== 'undefined',
153
+ listType: args.options.listType,
154
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
155
+ clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
156
+ webTemplate: typeof args.options.webTemplate !== 'undefined',
157
+ location: args.options.location
158
+ });
159
+ });
160
+ }, _SpoTenantCommandSetSetCommand_initOptions = function _SpoTenantCommandSetSetCommand_initOptions() {
161
+ this.options.unshift({
162
+ option: '-i, --id <id>'
163
+ }, {
164
+ option: '-t, --newTitle [newTitle]'
165
+ }, {
166
+ option: '-l, --listType [listType]',
167
+ autocomplete: SpoTenantCommandSetSetCommand.listTypes
168
+ }, {
169
+ option: '-i, --clientSideComponentId [clientSideComponentId]'
170
+ }, {
171
+ option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
172
+ }, {
173
+ option: '-w, --webTemplate [webTemplate]'
174
+ }, {
175
+ option: '--location [location]',
176
+ autocomplete: SpoTenantCommandSetSetCommand.locations
177
+ });
178
+ }, _SpoTenantCommandSetSetCommand_initValidators = function _SpoTenantCommandSetSetCommand_initValidators() {
179
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
180
+ if (!args.options.newTitle &&
181
+ !args.options.listType &&
182
+ !args.options.clientSideComponentId &&
183
+ !args.options.clientSideComponentProperties &&
184
+ !args.options.webTemplate &&
185
+ !args.options.location) {
186
+ return 'Specify at least one property to update';
187
+ }
188
+ if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
189
+ return `${args.options.clientSideComponentId} is not a valid GUID`;
190
+ }
191
+ if (args.options.listType && SpoTenantCommandSetSetCommand.listTypes.indexOf(args.options.listType) < 0) {
192
+ return `${args.options.listType} is not a valid list type. Allowed values are ${SpoTenantCommandSetSetCommand.listTypes.join(', ')}`;
193
+ }
194
+ if (args.options.location && SpoTenantCommandSetSetCommand.locations.indexOf(args.options.location) < 0) {
195
+ return `${args.options.location} is not a valid location. Allowed values are ${SpoTenantCommandSetSetCommand.locations.join(', ')}`;
196
+ }
197
+ return true;
198
+ }));
199
+ };
200
+ SpoTenantCommandSetSetCommand.listTypes = ['List', 'Library', 'SitePages'];
201
+ SpoTenantCommandSetSetCommand.locations = ['ContextMenu', 'CommandBar', 'Both'];
202
+ module.exports = new SpoTenantCommandSetSetCommand();
203
+ //# sourceMappingURL=tenant-commandset-set.js.map
@@ -418,6 +418,9 @@ _SpoTenantSettingsSetCommand_instances = new WeakSet(), _SpoTenantSettingsSetCom
418
418
  }, {
419
419
  option: '--DisableCustomAppAuthentication [DisableCustomAppAuthentication]',
420
420
  autocomplete: ['true', 'false']
421
+ }, {
422
+ option: '--CommentsOnListItemsDisabled [CommentsOnListItemsDisabled]',
423
+ autocomplete: ['true', 'false']
421
424
  }, {
422
425
  option: '--EnableAzureADB2BIntegration [EnableAzureADB2BIntegration]',
423
426
  autocomplete: ['true', 'false']
@@ -504,6 +507,7 @@ SpoTenantSettingsSetCommand.booleanOptions = [
504
507
  'ShowNGSCDialogForSyncOnODB',
505
508
  'SyncPrivacyProfileProperties',
506
509
  'DisableCustomAppAuthentication',
510
+ 'CommentsOnListItemsDisabled',
507
511
  'EnableAzureADB2BIntegration',
508
512
  'SyncAadB2BManagementPolicy'
509
513
  ];
@@ -43,8 +43,8 @@ class SpoTermAddCommand extends SpoCommand_1.default {
43
43
  let term;
44
44
  let formDigest;
45
45
  try {
46
- const spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
47
- const res = yield spo_1.spo.getRequestDigest(spoAdminUrl);
46
+ const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
47
+ const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
48
48
  formDigest = res.FormDigestValue;
49
49
  if (this.verbose) {
50
50
  logger.logToStderr(`Adding taxonomy term...`);
@@ -58,7 +58,7 @@ class SpoTermAddCommand extends SpoCommand_1.default {
58
58
  const termId = args.options.id || (0, uuid_1.v4)();
59
59
  const data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="4" ObjectPathId="3" /><ObjectIdentityQuery Id="5" ObjectPathId="3" /><ObjectPath Id="7" ObjectPathId="6" /><ObjectIdentityQuery Id="8" ObjectPathId="6" /><ObjectPath Id="10" ObjectPathId="9" /><ObjectPath Id="12" ObjectPathId="11" /><ObjectIdentityQuery Id="13" ObjectPathId="11" /><ObjectPath Id="15" ObjectPathId="14" /><ObjectPath Id="17" ObjectPathId="16" /><ObjectIdentityQuery Id="18" ObjectPathId="16" /><ObjectPath Id="20" ObjectPathId="19" /><ObjectIdentityQuery Id="21" ObjectPathId="19" /><Query Id="22" ObjectPathId="19"><Query SelectAllProperties="true"><Properties /></Query></Query></Actions><ObjectPaths><StaticMethod Id="3" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="6" ParentId="3" Name="GetDefaultSiteCollectionTermStore" /><Property Id="9" ParentId="6" Name="Groups" />${termGroupQuery}<Property Id="14" ParentId="11" Name="TermSets" />${termParentQuery}<Method Id="19" ParentId="16" Name="CreateTerm"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter><Parameter Type="Int32">1033</Parameter><Parameter Type="Guid">{${termId}}</Parameter></Parameters></Method></ObjectPaths></Request>`;
60
60
  const requestOptionsPost = {
61
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
61
+ url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
62
62
  headers: {
63
63
  'X-RequestDigest': res.FormDigestValue
64
64
  },
@@ -108,7 +108,7 @@ class SpoTermAddCommand extends SpoCommand_1.default {
108
108
  break;
109
109
  }
110
110
  const requestOptions = {
111
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
111
+ url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
112
112
  headers: {
113
113
  'X-RequestDigest': formDigest
114
114
  },
@@ -139,6 +139,7 @@ class SpoTermAddCommand extends SpoCommand_1.default {
139
139
  _SpoTermAddCommand_instances = new WeakSet(), _SpoTermAddCommand_initTelemetry = function _SpoTermAddCommand_initTelemetry() {
140
140
  this.telemetry.push((args) => {
141
141
  Object.assign(this.telemetryProperties, {
142
+ webUrl: typeof args.options.webUrl !== 'undefined',
142
143
  customProperties: typeof args.options.customProperties !== 'undefined',
143
144
  description: typeof args.options.description !== 'undefined',
144
145
  id: typeof args.options.id !== 'undefined',
@@ -153,6 +154,8 @@ _SpoTermAddCommand_instances = new WeakSet(), _SpoTermAddCommand_initTelemetry =
153
154
  }, _SpoTermAddCommand_initOptions = function _SpoTermAddCommand_initOptions() {
154
155
  this.options.unshift({
155
156
  option: '-n, --name <name>'
157
+ }, {
158
+ option: '-u, --webUrl [webUrl]'
156
159
  }, {
157
160
  option: '--termSetId [termSetId]'
158
161
  }, {
@@ -174,6 +177,12 @@ _SpoTermAddCommand_instances = new WeakSet(), _SpoTermAddCommand_initTelemetry =
174
177
  });
175
178
  }, _SpoTermAddCommand_initValidators = function _SpoTermAddCommand_initValidators() {
176
179
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
180
+ if (args.options.webUrl) {
181
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
182
+ if (isValidSharePointUrl !== true) {
183
+ return isValidSharePointUrl;
184
+ }
185
+ }
177
186
  if (args.options.id) {
178
187
  if (!validation_1.validation.isValidGuid(args.options.id)) {
179
188
  return `${args.options.id} is not a valid GUID`;
@@ -41,8 +41,8 @@ class SpoTermGetCommand extends SpoCommand_1.default {
41
41
  commandAction(logger, args) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
43
  try {
44
- const spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
45
- const res = yield spo_1.spo.getRequestDigest(spoAdminUrl);
44
+ const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
45
+ const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
46
46
  if (this.verbose) {
47
47
  logger.logToStderr(`Retrieving taxonomy term...`);
48
48
  }
@@ -54,7 +54,7 @@ class SpoTermGetCommand extends SpoCommand_1.default {
54
54
  data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="2" ObjectPathId="1" /><ObjectIdentityQuery Id="3" ObjectPathId="1" /><ObjectPath Id="5" ObjectPathId="4" /><ObjectIdentityQuery Id="6" ObjectPathId="4" /><ObjectPath Id="8" ObjectPathId="7" /><ObjectPath Id="10" ObjectPathId="9" /><ObjectIdentityQuery Id="11" ObjectPathId="9" /><ObjectPath Id="13" ObjectPathId="12" /><ObjectPath Id="15" ObjectPathId="14" /><ObjectIdentityQuery Id="16" ObjectPathId="14" /><ObjectPath Id="18" ObjectPathId="17" /><SetProperty Id="19" ObjectPathId="17" Name="TrimUnavailable"><Parameter Type="Boolean">true</Parameter></SetProperty><SetProperty Id="20" ObjectPathId="17" Name="TermLabel"><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter></SetProperty><ObjectPath Id="22" ObjectPathId="21" /><Query Id="23" ObjectPathId="21"><Query SelectAllProperties="true"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties /></ChildItemQuery></Query></Actions><ObjectPaths><StaticMethod Id="1" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="4" ParentId="1" Name="GetDefaultSiteCollectionTermStore" /><Property Id="7" ParentId="4" Name="Groups" /><Method Id="9" ParentId="7" Name="${args.options.termGroupName === undefined ? "GetById" : "GetByName"}"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName) || args.options.termGroupId}</Parameter></Parameters></Method><Property Id="12" ParentId="9" Name="TermSets" /><Method Id="14" ParentId="12" Name="${args.options.termSetName === undefined ? "GetById" : "GetByName"}"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termSetName) || args.options.termSetId}</Parameter></Parameters></Method><Constructor Id="17" TypeId="{61a1d689-2744-4ea3-a88b-c95bee9803aa}" /><Method Id="21" ParentId="14" Name="GetTerms"><Parameters><Parameter ObjectPathId="17" /></Parameters></Method></ObjectPaths></Request>`;
55
55
  }
56
56
  let term;
57
- const csomResponse = yield this.executeCsomCall(data, spoAdminUrl, res);
57
+ const csomResponse = yield this.executeCsomCall(data, spoWebUrl, res);
58
58
  if (csomResponse === null) {
59
59
  throw `Term with id '${args.options.id}' could not be found.`;
60
60
  }
@@ -86,10 +86,10 @@ class SpoTermGetCommand extends SpoCommand_1.default {
86
86
  }
87
87
  });
88
88
  }
89
- executeCsomCall(data, spoAdminUrl, res) {
89
+ executeCsomCall(data, spoWebUrl, res) {
90
90
  return __awaiter(this, void 0, void 0, function* () {
91
91
  const requestOptions = {
92
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
92
+ url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
93
93
  headers: {
94
94
  'X-RequestDigest': res.FormDigestValue
95
95
  },
@@ -115,6 +115,7 @@ class SpoTermGetCommand extends SpoCommand_1.default {
115
115
  _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry = function _SpoTermGetCommand_initTelemetry() {
116
116
  this.telemetry.push((args) => {
117
117
  Object.assign(this.telemetryProperties, {
118
+ webUrl: typeof args.options.webUrl !== 'undefined',
118
119
  id: typeof args.options.id !== 'undefined',
119
120
  name: typeof args.options.name !== 'undefined',
120
121
  termGroupId: typeof args.options.termGroupId !== 'undefined',
@@ -125,6 +126,8 @@ _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry =
125
126
  });
126
127
  }, _SpoTermGetCommand_initOptions = function _SpoTermGetCommand_initOptions() {
127
128
  this.options.unshift({
129
+ option: '-u, --webUrl [webUrl]'
130
+ }, {
128
131
  option: '-i, --id [id]'
129
132
  }, {
130
133
  option: '-n, --name [name]'
@@ -139,6 +142,12 @@ _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry =
139
142
  });
140
143
  }, _SpoTermGetCommand_initValidators = function _SpoTermGetCommand_initValidators() {
141
144
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
145
+ if (args.options.webUrl) {
146
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
147
+ if (isValidSharePointUrl !== true) {
148
+ return isValidSharePointUrl;
149
+ }
150
+ }
142
151
  if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
143
152
  return `${args.options.id} is not a valid GUID`;
144
153
  }
@@ -40,14 +40,14 @@ class SpoTermGroupGetCommand extends SpoCommand_1.default {
40
40
  commandAction(logger, args) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
42
  try {
43
- const spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
44
- const res = yield spo_1.spo.getRequestDigest(spoAdminUrl);
43
+ const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
44
+ const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
45
45
  if (this.verbose) {
46
46
  logger.logToStderr(`Retrieving taxonomy term groups...`);
47
47
  }
48
48
  const query = args.options.id ? `<Method Id="32" ParentId="30" Name="GetById"><Parameters><Parameter Type="Guid">{${formatting_1.formatting.escapeXml(args.options.id)}}</Parameter></Parameters></Method>` : `<Method Id="32" ParentId="30" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter></Parameters></Method>`;
49
49
  const requestOptions = {
50
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
50
+ url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
51
51
  headers: {
52
52
  'X-RequestDigest': res.FormDigestValue
53
53
  },
@@ -76,18 +76,27 @@ class SpoTermGroupGetCommand extends SpoCommand_1.default {
76
76
  _SpoTermGroupGetCommand_instances = new WeakSet(), _SpoTermGroupGetCommand_initTelemetry = function _SpoTermGroupGetCommand_initTelemetry() {
77
77
  this.telemetry.push((args) => {
78
78
  Object.assign(this.telemetryProperties, {
79
+ webUrl: typeof args.options.webUrl !== 'undefined',
79
80
  id: typeof args.options.id !== 'undefined',
80
81
  name: typeof args.options.name !== 'undefined'
81
82
  });
82
83
  });
83
84
  }, _SpoTermGroupGetCommand_initOptions = function _SpoTermGroupGetCommand_initOptions() {
84
85
  this.options.unshift({
86
+ option: '-u, --webUrl [webUrl]'
87
+ }, {
85
88
  option: '-i, --id [id]'
86
89
  }, {
87
90
  option: '-n, --name [name]'
88
91
  });
89
92
  }, _SpoTermGroupGetCommand_initValidators = function _SpoTermGroupGetCommand_initValidators() {
90
93
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
94
+ if (args.options.webUrl) {
95
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
96
+ if (isValidSharePointUrl !== true) {
97
+ return isValidSharePointUrl;
98
+ }
99
+ }
91
100
  if (args.options.id) {
92
101
  if (!validation_1.validation.isValidGuid(args.options.id)) {
93
102
  return `${args.options.id} is not a valid GUID`;
@@ -8,10 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
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 _SpoTermGroupListCommand_instances, _SpoTermGroupListCommand_initTelemetry, _SpoTermGroupListCommand_initOptions, _SpoTermGroupListCommand_initValidators;
11
17
  Object.defineProperty(exports, "__esModule", { value: true });
12
18
  const config_1 = require("../../../../config");
13
19
  const request_1 = require("../../../../request");
14
20
  const spo_1 = require("../../../../utils/spo");
21
+ const validation_1 = require("../../../../utils/validation");
15
22
  const SpoCommand_1 = require("../../../base/SpoCommand");
16
23
  const commands_1 = require("../../commands");
17
24
  class SpoTermGroupListCommand extends SpoCommand_1.default {
@@ -24,16 +31,23 @@ class SpoTermGroupListCommand extends SpoCommand_1.default {
24
31
  defaultProperties() {
25
32
  return ['Id', 'Name'];
26
33
  }
27
- commandAction(logger) {
34
+ constructor() {
35
+ super();
36
+ _SpoTermGroupListCommand_instances.add(this);
37
+ __classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initTelemetry).call(this);
38
+ __classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initOptions).call(this);
39
+ __classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initValidators).call(this);
40
+ }
41
+ commandAction(logger, args) {
28
42
  return __awaiter(this, void 0, void 0, function* () {
29
43
  try {
30
- const spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
31
- const res = yield spo_1.spo.getRequestDigest(spoAdminUrl);
44
+ const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
45
+ const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
32
46
  if (this.verbose) {
33
47
  logger.logToStderr(`Retrieving taxonomy term groups...`);
34
48
  }
35
49
  const requestOptions = {
36
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
50
+ url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
37
51
  headers: {
38
52
  'X-RequestDigest': res.FormDigestValue
39
53
  },
@@ -61,5 +75,26 @@ class SpoTermGroupListCommand extends SpoCommand_1.default {
61
75
  });
62
76
  }
63
77
  }
78
+ _SpoTermGroupListCommand_instances = new WeakSet(), _SpoTermGroupListCommand_initTelemetry = function _SpoTermGroupListCommand_initTelemetry() {
79
+ this.telemetry.push((args) => {
80
+ Object.assign(this.telemetryProperties, {
81
+ webUrl: typeof args.options.webUrl !== 'undefined'
82
+ });
83
+ });
84
+ }, _SpoTermGroupListCommand_initOptions = function _SpoTermGroupListCommand_initOptions() {
85
+ this.options.unshift({
86
+ option: '-u, --webUrl [webUrl]'
87
+ });
88
+ }, _SpoTermGroupListCommand_initValidators = function _SpoTermGroupListCommand_initValidators() {
89
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
90
+ if (args.options.webUrl) {
91
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
92
+ if (isValidSharePointUrl !== true) {
93
+ return isValidSharePointUrl;
94
+ }
95
+ }
96
+ return true;
97
+ }));
98
+ };
64
99
  module.exports = new SpoTermGroupListCommand();
65
100
  //# sourceMappingURL=term-group-list.js.map