@pnp/cli-microsoft365 6.3.0 → 6.4.0-beta.39e5130

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 (185) hide show
  1. package/.eslintrc.js +1 -0
  2. package/README.md +12 -1
  3. package/dist/Command.js +1 -0
  4. package/dist/m365/aad/commands/user/user-get.js +3 -0
  5. package/dist/m365/aad/commands/user/user-license-remove.js +2 -1
  6. package/dist/m365/aad/commands/user/user-recyclebinitem-restore.js +2 -9
  7. package/dist/m365/aad/commands/user/user-set.js +3 -0
  8. package/dist/m365/aad/commands/user/user-signin-list.js +3 -0
  9. package/dist/m365/flow/commands/flow-disable.js +9 -2
  10. package/dist/m365/flow/commands/flow-enable.js +9 -2
  11. package/dist/m365/flow/commands/flow-get.js +9 -2
  12. package/dist/m365/flow/commands/flow-list.js +1 -1
  13. package/dist/m365/flow/commands/flow-remove.js +2 -2
  14. package/dist/m365/flow/commands/owner/owner-add.js +147 -0
  15. package/dist/m365/flow/commands/owner/owner-list.js +89 -0
  16. package/dist/m365/flow/commands/owner/owner-remove.js +147 -0
  17. package/dist/m365/flow/commands/run/run-cancel.js +9 -2
  18. package/dist/m365/flow/commands/run/run-list.js +5 -2
  19. package/dist/m365/flow/commands.js +3 -0
  20. package/dist/m365/planner/commands/roster/roster-member-add.js +3 -0
  21. package/dist/m365/planner/commands/roster/roster-member-get.js +98 -0
  22. package/dist/m365/planner/commands.js +1 -0
  23. package/dist/m365/spfx/commands/spfx-doctor.js +43 -29
  24. package/dist/m365/spo/commands/customaction/customaction-get.js +27 -7
  25. package/dist/m365/spo/commands/file/file-move.js +1 -1
  26. package/dist/m365/spo/commands/group/group-member-add.js +54 -95
  27. package/dist/m365/spo/commands/list/list-add.js +11 -8
  28. package/dist/m365/spo/commands/list/list-set.js +3 -3
  29. package/dist/m365/spo/commands/navigation/navigation-node-add.js +5 -4
  30. package/dist/m365/spo/commands/navigation/navigation-node-set.js +5 -1
  31. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +118 -0
  32. package/dist/m365/spo/commands/term/term-get.js +68 -48
  33. package/dist/m365/spo/commands.js +1 -0
  34. package/dist/utils/aadGroup.js +18 -0
  35. package/dist/utils/aadUser.js +20 -0
  36. package/dist/utils/md.js +7 -0
  37. package/dist/utils/spo.js +32 -0
  38. package/docs/docs/cmd/aad/approleassignment/approleassignment-add.md +5 -5
  39. package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.md +3 -3
  40. package/docs/docs/cmd/aad/user/user-remove.md +1 -1
  41. package/docs/docs/cmd/cli/completion/completion-clink-update.md +4 -4
  42. package/docs/docs/cmd/flow/owner/owner-add.md +61 -0
  43. package/docs/docs/cmd/flow/owner/owner-list.md +90 -0
  44. package/docs/docs/cmd/flow/owner/owner-remove.md +67 -0
  45. package/docs/docs/cmd/flow/run/run-list.md +28 -0
  46. package/docs/docs/cmd/onenote/page/page-list.md +1 -1
  47. package/docs/docs/cmd/outlook/mail/mail-send.md +7 -3
  48. package/docs/docs/cmd/outlook/message/message-get.md +143 -0
  49. package/docs/docs/cmd/outlook/message/message-list.md +119 -0
  50. package/docs/docs/cmd/outlook/message/message-move.md +4 -0
  51. package/docs/docs/cmd/outlook/report/report-mailactivitycounts.md +40 -0
  52. package/docs/docs/cmd/outlook/report/report-mailactivityusercounts.md +40 -0
  53. package/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.md +45 -0
  54. package/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.md +43 -0
  55. package/docs/docs/cmd/outlook/report/report-mailappusageusercounts.md +44 -0
  56. package/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.md +48 -0
  57. package/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.md +41 -0
  58. package/docs/docs/cmd/outlook/report/report-mailboxusagedetail.md +49 -0
  59. package/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.md +37 -0
  60. package/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.md +40 -0
  61. package/docs/docs/cmd/outlook/report/report-mailboxusagestorage.md +36 -0
  62. package/docs/docs/cmd/outlook/room/room-list.md +81 -0
  63. package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +58 -0
  64. package/docs/docs/cmd/planner/plan/plan-add.md +3 -3
  65. package/docs/docs/cmd/planner/plan/plan-set.md +73 -7
  66. package/docs/docs/cmd/planner/roster/roster-add.md +16 -1
  67. package/docs/docs/cmd/planner/roster/roster-member-get.md +87 -0
  68. package/docs/docs/cmd/planner/task/task-add.md +230 -0
  69. package/docs/docs/cmd/planner/task/task-checklistitem-add.md +55 -0
  70. package/docs/docs/cmd/planner/task/task-checklistitem-list.md +55 -0
  71. package/docs/docs/cmd/planner/task/task-checklistitem-remove.md +4 -0
  72. package/docs/docs/cmd/planner/task/task-get.md +131 -0
  73. package/docs/docs/cmd/planner/task/task-list.md +92 -0
  74. package/docs/docs/cmd/planner/task/task-reference-add.md +46 -0
  75. package/docs/docs/cmd/planner/task/task-reference-list.md +46 -0
  76. package/docs/docs/cmd/planner/task/task-reference-remove.md +4 -0
  77. package/docs/docs/cmd/planner/task/task-remove.md +4 -0
  78. package/docs/docs/cmd/planner/task/task-set.md +230 -0
  79. package/docs/docs/cmd/planner/tenant/tenant-settings-list.md +55 -0
  80. package/docs/docs/cmd/planner/tenant/tenant-settings-set.md +55 -0
  81. package/docs/docs/cmd/pp/card/card-get.md +2 -2
  82. package/docs/docs/cmd/pp/card/card-list.md +2 -2
  83. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +7 -7
  84. package/docs/docs/cmd/skype/report/report-activitycounts.md +38 -0
  85. package/docs/docs/cmd/skype/report/report-activityusercounts.md +38 -0
  86. package/docs/docs/cmd/skype/report/report-activityuserdetail.md +67 -0
  87. package/docs/docs/cmd/spfx/project/project-doctor.md +3 -3
  88. package/docs/docs/cmd/spfx/project/project-externalize.md +3 -3
  89. package/docs/docs/cmd/spfx/project/project-upgrade.md +3 -3
  90. package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
  91. package/docs/docs/cmd/spo/cdn/cdn-get.md +6 -6
  92. package/docs/docs/cmd/spo/cdn/cdn-origin-add.md +3 -3
  93. package/docs/docs/cmd/spo/cdn/cdn-origin-list.md +3 -3
  94. package/docs/docs/cmd/spo/cdn/cdn-origin-remove.md +3 -3
  95. package/docs/docs/cmd/spo/cdn/cdn-policy-list.md +3 -3
  96. package/docs/docs/cmd/spo/cdn/cdn-policy-set.md +3 -3
  97. package/docs/docs/cmd/spo/cdn/cdn-set.md +3 -3
  98. package/docs/docs/cmd/spo/customaction/customaction-get.md +113 -11
  99. package/docs/docs/cmd/spo/externaluser/externaluser-list.md +2 -0
  100. package/docs/docs/cmd/spo/group/group-member-add.md +26 -4
  101. package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.md +2 -0
  102. package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.md +2 -0
  103. package/docs/docs/cmd/spo/homesite/homesite-remove.md +2 -0
  104. package/docs/docs/cmd/spo/homesite/homesite-set.md +2 -0
  105. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +2 -0
  106. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +2 -0
  107. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +3 -3
  108. package/docs/docs/cmd/spo/list/list-add.md +2 -2
  109. package/docs/docs/cmd/spo/list/list-set.md +2 -2
  110. package/docs/docs/cmd/spo/listitem/listitem-add.md +1 -1
  111. package/docs/docs/cmd/spo/listitem/listitem-batch-add.md +1 -1
  112. package/docs/docs/cmd/spo/listitem/listitem-set.md +1 -1
  113. package/docs/docs/cmd/spo/navigation/navigation-node-add.md +3 -3
  114. package/docs/docs/cmd/spo/navigation/navigation-node-set.md +2 -2
  115. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.md +2 -0
  116. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.md +2 -0
  117. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.md +2 -0
  118. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.md +2 -0
  119. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.md +2 -0
  120. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.md +3 -3
  121. package/docs/docs/cmd/spo/site/site-appcatalog-add.md +2 -0
  122. package/docs/docs/cmd/spo/site/site-appcatalog-remove.md +3 -3
  123. package/docs/docs/cmd/spo/site/site-commsite-enable.md +2 -0
  124. package/docs/docs/cmd/spo/site/site-list.md +3 -3
  125. package/docs/docs/cmd/spo/site/site-remove.md +3 -3
  126. package/docs/docs/cmd/spo/site/site-rename.md +3 -3
  127. package/docs/docs/cmd/spo/site/site-set.md +5 -5
  128. package/docs/docs/cmd/spo/storageentity/storageentity-remove.md +3 -3
  129. package/docs/docs/cmd/spo/storageentity/storageentity-set.md +3 -3
  130. package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.md +3 -3
  131. package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.md +2 -0
  132. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +3 -3
  133. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.md +142 -0
  134. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.md +2 -0
  135. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.md +3 -3
  136. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.md +3 -3
  137. package/docs/docs/cmd/spo/tenant/tenant-settings-list.md +2 -0
  138. package/docs/docs/cmd/spo/tenant/tenant-settings-set.md +28 -26
  139. package/docs/docs/cmd/spo/term/term-add.md +3 -3
  140. package/docs/docs/cmd/spo/term/term-get.md +3 -3
  141. package/docs/docs/cmd/spo/term/term-group-add.md +2 -0
  142. package/docs/docs/cmd/spo/term/term-group-get.md +2 -0
  143. package/docs/docs/cmd/spo/term/term-group-list.md +2 -0
  144. package/docs/docs/cmd/spo/term/term-list.md +3 -1
  145. package/docs/docs/cmd/spo/term/term-set-add.md +3 -3
  146. package/docs/docs/cmd/spo/term/term-set-get.md +2 -0
  147. package/docs/docs/cmd/spo/term/term-set-list.md +2 -0
  148. package/docs/docs/cmd/spo/theme/theme-apply.md +3 -3
  149. package/docs/docs/cmd/spo/theme/theme-get.md +2 -0
  150. package/docs/docs/cmd/spo/theme/theme-list.md +2 -0
  151. package/docs/docs/cmd/spo/theme/theme-remove.md +2 -0
  152. package/docs/docs/cmd/spo/theme/theme-set.md +3 -3
  153. package/docs/docs/cmd/teams/channel/channel-get.md +1 -1
  154. package/docs/docs/cmd/teams/channel/channel-member-add.md +2 -2
  155. package/docs/docs/cmd/teams/message/message-get.md +39 -4
  156. package/docs/docs/cmd/teams/message/message-list.md +41 -6
  157. package/docs/docs/cmd/teams/message/message-reply-list.md +39 -4
  158. package/docs/docs/cmd/teams/messagingsettings/messagingsettings-list.md +20 -2
  159. package/docs/docs/cmd/teams/messagingsettings/messagingsettings-set.md +8 -8
  160. package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.md +12 -5
  161. package/docs/docs/cmd/teams/report/report-deviceusageusercounts.md +13 -6
  162. package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.md +14 -7
  163. package/docs/docs/cmd/teams/report/report-directroutingcalls.md +13 -6
  164. package/docs/docs/cmd/teams/report/report-pstncalls.md +13 -6
  165. package/docs/docs/cmd/teams/report/report-useractivitycounts.md +13 -6
  166. package/docs/docs/cmd/teams/report/report-useractivityusercounts.md +13 -6
  167. package/docs/docs/cmd/teams/report/report-useractivityuserdetail.md +13 -6
  168. package/docs/docs/cmd/teams/tab/tab-add.md +16 -0
  169. package/docs/docs/cmd/teams/tab/tab-get.md +17 -0
  170. package/docs/docs/cmd/teams/tab/tab-list.md +19 -0
  171. package/docs/docs/cmd/teams/team/team-add.md +77 -8
  172. package/docs/docs/cmd/teams/team/team-app-list.md +18 -2
  173. package/docs/docs/cmd/teams/team/team-archive.md +2 -2
  174. package/docs/docs/cmd/teams/team/team-clone.md +8 -8
  175. package/docs/docs/cmd/teams/team/team-get.md +34 -4
  176. package/docs/docs/cmd/teams/team/team-list.md +34 -3
  177. package/docs/docs/cmd/teams/team/team-remove.md +3 -3
  178. package/docs/docs/cmd/teams/team/team-set.md +8 -8
  179. package/docs/docs/cmd/teams/team/team-unarchive.md +3 -2
  180. package/docs/docs/cmd/teams/user/user-app-add.md +3 -3
  181. package/docs/docs/cmd/teams/user/user-app-list.md +18 -2
  182. package/docs/docs/cmd/teams/user/user-app-remove.md +4 -4
  183. package/docs/docs/cmd/teams/user/user-list.md +21 -4
  184. package/npm-shrinkwrap.json +279 -194
  185. package/package.json +14 -14
@@ -150,7 +150,7 @@ class SpoListSetCommand extends SpoCommand_1.default {
150
150
  requestBody.DisableGridEditing = options.disableGridEditing;
151
151
  }
152
152
  if (options.draftVersionVisibility) {
153
- requestBody.DraftVersionVisibility = options.draftVersionVisibility;
153
+ requestBody.DraftVersionVisibility = DraftVisibilityType_1.DraftVisibilityType[options.draftVersionVisibility.trim()];
154
154
  }
155
155
  if (options.emailAlias) {
156
156
  requestBody.EmailAlias = options.emailAlias;
@@ -228,7 +228,7 @@ class SpoListSetCommand extends SpoCommand_1.default {
228
228
  requestBody.IsApplicationList = options.isApplicationList;
229
229
  }
230
230
  if (options.listExperienceOptions) {
231
- requestBody.ListExperienceOptions = options.listExperienceOptions;
231
+ requestBody.ListExperienceOptions = ListExperience_1.ListExperience[options.listExperienceOptions.trim()];
232
232
  }
233
233
  if (options.majorVersionLimit) {
234
234
  requestBody.MajorVersionLimit = options.majorVersionLimit;
@@ -545,7 +545,7 @@ _SpoListSetCommand_instances = new WeakSet(), _SpoListSetCommand_initTelemetry =
545
545
  }
546
546
  if (args.options.draftVersionVisibility) {
547
547
  const draftType = DraftVisibilityType_1.DraftVisibilityType[args.options.draftVersionVisibility.trim()];
548
- if (!draftType) {
548
+ if (draftType === undefined) {
549
549
  return `${args.options.draftVersionVisibility} is not a valid draftVisibilityType value`;
550
550
  }
551
551
  }
@@ -38,7 +38,7 @@ class SpoNavigationNodeAddCommand extends SpoCommand_1.default {
38
38
  return ['url'];
39
39
  }
40
40
  commandAction(logger, args) {
41
- var _a;
41
+ var _a, _b;
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
43
  if (this.verbose) {
44
44
  logger.logToStderr(`Adding navigation node...`);
@@ -56,7 +56,7 @@ class SpoNavigationNodeAddCommand extends SpoCommand_1.default {
56
56
  data: {
57
57
  AudienceIds: (_a = args.options.audienceIds) === null || _a === void 0 ? void 0 : _a.split(','),
58
58
  Title: args.options.title,
59
- Url: args.options.url,
59
+ Url: (_b = args.options.url) !== null && _b !== void 0 ? _b : 'http://linkless.header/',
60
60
  IsExternal: args.options.isExternal === true
61
61
  }
62
62
  };
@@ -76,7 +76,8 @@ _SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCom
76
76
  isExternal: args.options.isExternal,
77
77
  location: typeof args.options.location !== 'undefined',
78
78
  parentNodeId: typeof args.options.parentNodeId !== 'undefined',
79
- audienceIds: typeof args.options.audienceIds !== 'undefined'
79
+ audienceIds: typeof args.options.audienceIds !== 'undefined',
80
+ url: typeof args.options.url !== 'undefined'
80
81
  });
81
82
  });
82
83
  }, _SpoNavigationNodeAddCommand_initOptions = function _SpoNavigationNodeAddCommand_initOptions() {
@@ -88,7 +89,7 @@ _SpoNavigationNodeAddCommand_instances = new WeakSet(), _SpoNavigationNodeAddCom
88
89
  }, {
89
90
  option: '-t, --title <title>'
90
91
  }, {
91
- option: '--url <url>'
92
+ option: '--url [url]'
92
93
  }, {
93
94
  option: '--parentNodeId [parentNodeId]'
94
95
  }, {
@@ -40,10 +40,14 @@ class SpoNavigationNodeSetCommand extends SpoCommand_1.default {
40
40
  if (this.verbose) {
41
41
  logger.logToStderr(`Setting navigation node...`);
42
42
  }
43
+ let url = args.options.url;
44
+ if (url === '') {
45
+ url = 'http://linkless.header/';
46
+ }
43
47
  const requestBody = {
44
48
  Title: args.options.title,
45
49
  IsExternal: args.options.isExternal,
46
- Url: args.options.url
50
+ Url: url
47
51
  };
48
52
  if (args.options.audienceIds !== undefined) {
49
53
  requestBody.AudienceIds = args.options.audienceIds === '' ? [] : args.options.audienceIds.split(',');
@@ -0,0 +1,118 @@
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 _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Command_1 = require("../../../../Command");
19
+ const request_1 = require("../../../../request");
20
+ const formatting_1 = require("../../../../utils/formatting");
21
+ const spo_1 = require("../../../../utils/spo");
22
+ const urlUtil_1 = require("../../../../utils/urlUtil");
23
+ const validation_1 = require("../../../../utils/validation");
24
+ const SpoCommand_1 = require("../../../base/SpoCommand");
25
+ const commands_1 = require("../../commands");
26
+ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand_1.default {
27
+ get name() {
28
+ return commands_1.default.TENANT_APPLICATIONCUSTOMIZER_GET;
29
+ }
30
+ get description() {
31
+ return 'Get an application customizer that is installed tenant wide';
32
+ }
33
+ constructor() {
34
+ super();
35
+ _SpoTenantApplicationCustomizerGetCommand_instances.add(this);
36
+ __classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initTelemetry).call(this);
37
+ __classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptions).call(this);
38
+ __classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initValidators).call(this);
39
+ __classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptionSets).call(this);
40
+ }
41
+ commandAction(logger, args) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const appCatalogUrl = yield spo_1.spo.getTenantAppCatalogUrl(logger, this.debug);
44
+ if (!appCatalogUrl) {
45
+ throw new Command_1.CommandError('No app catalog URL found');
46
+ }
47
+ let filter = '';
48
+ if (args.options.title) {
49
+ filter = `Title eq '${args.options.title}'`;
50
+ }
51
+ else if (args.options.id) {
52
+ filter = `GUID eq '${args.options.id}'`;
53
+ }
54
+ else if (args.options.clientSideComponentId) {
55
+ filter = `TenantWideExtensionComponentId eq '${args.options.clientSideComponentId}'`;
56
+ }
57
+ const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(appCatalogUrl, '/lists/TenantWideExtensions');
58
+ const reqOptions = {
59
+ url: `${appCatalogUrl}/_api/web/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=${filter}`,
60
+ headers: {
61
+ 'accept': 'application/json;odata=nometadata'
62
+ },
63
+ responseType: 'json'
64
+ };
65
+ let listItemInstances;
66
+ try {
67
+ listItemInstances = yield request_1.default.get(reqOptions);
68
+ }
69
+ catch (err) {
70
+ return this.handleRejectedODataJsonPromise(err);
71
+ }
72
+ if (listItemInstances) {
73
+ if (listItemInstances.value.length === 0) {
74
+ throw new Command_1.CommandError('The specified application customizer was not found');
75
+ }
76
+ if (listItemInstances.value.length > 1) {
77
+ throw new Command_1.CommandError(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found. Please disambiguate (IDs): ${listItemInstances.value.map(item => item.GUID).join(', ')}`);
78
+ }
79
+ listItemInstances.value.forEach(v => delete v['ID']);
80
+ logger.log(listItemInstances.value[0]);
81
+ }
82
+ else {
83
+ throw new Command_1.CommandError('The specified application customizer was not found');
84
+ }
85
+ });
86
+ }
87
+ }
88
+ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantApplicationCustomizerGetCommand_initTelemetry = function _SpoTenantApplicationCustomizerGetCommand_initTelemetry() {
89
+ this.telemetry.push((args) => {
90
+ Object.assign(this.telemetryProperties, {
91
+ title: typeof args.options.title !== 'undefined',
92
+ id: typeof args.options.id !== 'undefined',
93
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
94
+ });
95
+ });
96
+ }, _SpoTenantApplicationCustomizerGetCommand_initOptions = function _SpoTenantApplicationCustomizerGetCommand_initOptions() {
97
+ this.options.unshift({
98
+ option: '-t, --title [title]'
99
+ }, {
100
+ option: '-i, --id [id]'
101
+ }, {
102
+ option: '-c, --clientSideComponentId [clientSideComponentId]'
103
+ });
104
+ }, _SpoTenantApplicationCustomizerGetCommand_initValidators = function _SpoTenantApplicationCustomizerGetCommand_initValidators() {
105
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
106
+ if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
107
+ return `${args.options.id} is not a valid GUID`;
108
+ }
109
+ if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
110
+ return `${args.options.clientSideComponentId} is not a valid GUID`;
111
+ }
112
+ return true;
113
+ }));
114
+ }, _SpoTenantApplicationCustomizerGetCommand_initOptionSets = function _SpoTenantApplicationCustomizerGetCommand_initOptionSets() {
115
+ this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
116
+ };
117
+ module.exports = new SpoTenantApplicationCustomizerGetCommand();
118
+ //# sourceMappingURL=tenant-applicationcustomizer-get.js.map
@@ -22,6 +22,7 @@ const spo_1 = require("../../../../utils/spo");
22
22
  const validation_1 = require("../../../../utils/validation");
23
23
  const SpoCommand_1 = require("../../../base/SpoCommand");
24
24
  const commands_1 = require("../../commands");
25
+ const os = require("os");
25
26
  class SpoTermGetCommand extends SpoCommand_1.default {
26
27
  get name() {
27
28
  return commands_1.default.TERM_GET;
@@ -50,32 +51,34 @@ class SpoTermGetCommand extends SpoCommand_1.default {
50
51
  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="14" ObjectPathId="13" /><ObjectIdentityQuery Id="15" ObjectPathId="13" /><Query Id="16" ObjectPathId="13"><Query SelectAllProperties="true"><Properties /></Query></Query></Actions><ObjectPaths><StaticMethod Id="6" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="7" ParentId="6" Name="GetDefaultSiteCollectionTermStore" /><Method Id="13" ParentId="7" Name="GetTerm"><Parameters><Parameter Type="Guid">{${args.options.id}}</Parameter></Parameters></Method></ObjectPaths></Request>`;
51
52
  }
52
53
  else {
53
- const termGroupQuery = args.options.termGroupId ? `<Method Id="98" ParentId="96" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="98" ParentId="96" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
54
- const termSetQuery = args.options.termSetId ? `<Method Id="103" ParentId="101" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termSetId}}</Parameter></Parameters></Method>` : `<Method Id="103" ParentId="101" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termSetName)}</Parameter></Parameters></Method>`;
55
- 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="91" ObjectPathId="90" /><ObjectIdentityQuery Id="92" ObjectPathId="90" /><ObjectPath Id="94" ObjectPathId="93" /><ObjectIdentityQuery Id="95" ObjectPathId="93" /><ObjectPath Id="97" ObjectPathId="96" /><ObjectPath Id="99" ObjectPathId="98" /><ObjectIdentityQuery Id="100" ObjectPathId="98" /><ObjectPath Id="102" ObjectPathId="101" /><ObjectPath Id="104" ObjectPathId="103" /><ObjectIdentityQuery Id="105" ObjectPathId="103" /><ObjectPath Id="107" ObjectPathId="106" /><ObjectPath Id="109" ObjectPathId="108" /><ObjectIdentityQuery Id="110" ObjectPathId="108" /><Query Id="111" ObjectPathId="108"><Query SelectAllProperties="true"><Properties /></Query></Query></Actions><ObjectPaths><StaticMethod Id="90" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="93" ParentId="90" Name="GetDefaultSiteCollectionTermStore" /><Property Id="96" ParentId="93" Name="Groups" />${termGroupQuery}<Property Id="101" ParentId="98" Name="TermSets" />${termSetQuery}<Property Id="106" ParentId="103" Name="Terms" /><Method Id="108" ParentId="106" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter></Parameters></Method></ObjectPaths></Request>`;
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>`;
56
55
  }
57
- const requestOptions = {
58
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
59
- headers: {
60
- 'X-RequestDigest': res.FormDigestValue
61
- },
62
- data: data
63
- };
64
- const processQuery = yield request_1.default.post(requestOptions);
65
- const json = JSON.parse(processQuery);
66
- const response = json[0];
67
- if (response.ErrorInfo) {
68
- throw response.ErrorInfo.ErrorMessage;
56
+ let term;
57
+ const csomResponse = yield this.executeCsomCall(data, spoAdminUrl, res);
58
+ if (csomResponse === null) {
59
+ throw `Term with id '${args.options.id}' could not be found.`;
69
60
  }
70
- const term = json[json.length - 1];
71
- if (!term) {
72
- return;
61
+ else if (csomResponse._Child_Items_ !== undefined) {
62
+ const terms = csomResponse;
63
+ if (terms._Child_Items_.length === 0) {
64
+ throw `Term with name '${args.options.name}' could not be found.`;
65
+ }
66
+ if (terms._Child_Items_.length > 1) {
67
+ const disambiguationText = terms._Child_Items_.map(c => {
68
+ return `- ${this.getTermId(c.Id)} - ${c.PathOfTerm}`;
69
+ }).join(os.EOL);
70
+ throw new Error(`Multiple terms with the specific term name found. Please disambiguate:${os.EOL}${disambiguationText}`);
71
+ }
72
+ term = terms._Child_Items_[0];
73
+ }
74
+ else {
75
+ term = csomResponse;
73
76
  }
74
77
  delete term._ObjectIdentity_;
75
78
  delete term._ObjectType_;
76
- term.CreatedDate = new Date(Number(term.CreatedDate.replace('/Date(', '').replace(')/', ''))).toISOString();
77
- term.Id = term.Id.replace('/Guid(', '').replace(')/', '');
78
- term.LastModifiedDate = new Date(Number(term.LastModifiedDate.replace('/Date(', '').replace(')/', ''))).toISOString();
79
+ term.CreatedDate = this.parseTermDateToIsoString(term.CreatedDate);
80
+ term.Id = this.getTermId(term.Id);
81
+ term.LastModifiedDate = this.parseTermDateToIsoString(term.LastModifiedDate);
79
82
  logger.log(term);
80
83
  }
81
84
  catch (err) {
@@ -83,6 +86,31 @@ class SpoTermGetCommand extends SpoCommand_1.default {
83
86
  }
84
87
  });
85
88
  }
89
+ executeCsomCall(data, spoAdminUrl, res) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const requestOptions = {
92
+ url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
93
+ headers: {
94
+ 'X-RequestDigest': res.FormDigestValue
95
+ },
96
+ data: data
97
+ };
98
+ const processQuery = yield request_1.default.post(requestOptions);
99
+ const json = JSON.parse(processQuery);
100
+ const response = json[0];
101
+ if (response.ErrorInfo) {
102
+ throw response.ErrorInfo.ErrorMessage;
103
+ }
104
+ const responseObject = json[json.length - 1];
105
+ return responseObject;
106
+ });
107
+ }
108
+ getTermId(termId) {
109
+ return termId.replace('/Guid(', '').replace(')/', '');
110
+ }
111
+ parseTermDateToIsoString(dateAsString) {
112
+ return new Date(Number(dateAsString.replace('/Date(', '').replace(')/', ''))).toISOString();
113
+ }
86
114
  }
87
115
  _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry = function _SpoTermGetCommand_initTelemetry() {
88
116
  this.telemetry.push((args) => {
@@ -111,39 +139,31 @@ _SpoTermGetCommand_instances = new WeakSet(), _SpoTermGetCommand_initTelemetry =
111
139
  });
112
140
  }, _SpoTermGetCommand_initValidators = function _SpoTermGetCommand_initValidators() {
113
141
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
114
- if (args.options.id) {
115
- if (!validation_1.validation.isValidGuid(args.options.id)) {
116
- return `${args.options.id} is not a valid GUID`;
117
- }
142
+ if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
143
+ return `${args.options.id} is not a valid GUID`;
118
144
  }
119
- if (args.options.name) {
120
- if (!args.options.termGroupId && !args.options.termGroupName) {
121
- return 'Specify termGroupId or termGroupName';
122
- }
123
- if (!args.options.termSetId && !args.options.termSetName) {
124
- return 'Specify termSetId or termSetName';
125
- }
145
+ if (args.options.termGroupId && !validation_1.validation.isValidGuid(args.options.termGroupId)) {
146
+ return `${args.options.termGroupId} is not a valid GUID`;
126
147
  }
127
- if (args.options.termGroupId && args.options.termGroupName) {
128
- return 'Specify termGroupId or termGroupName but not both';
129
- }
130
- if (args.options.termGroupId) {
131
- if (!validation_1.validation.isValidGuid(args.options.termGroupId)) {
132
- return `${args.options.termGroupId} is not a valid GUID`;
133
- }
134
- }
135
- if (args.options.termSetId && args.options.termSetName) {
136
- return 'Specify termSetId or termSetName but not both';
137
- }
138
- if (args.options.termSetId) {
139
- if (!validation_1.validation.isValidGuid(args.options.termSetId)) {
140
- return `${args.options.termSetId} is not a valid GUID`;
141
- }
148
+ if (args.options.termSetId && !validation_1.validation.isValidGuid(args.options.termSetId)) {
149
+ return `${args.options.termSetId} is not a valid GUID`;
142
150
  }
143
151
  return true;
144
152
  }));
145
153
  }, _SpoTermGetCommand_initOptionSets = function _SpoTermGetCommand_initOptionSets() {
146
- this.optionSets.push({ options: ['id', 'name'] });
154
+ this.optionSets.push({
155
+ options: ['id', 'name']
156
+ }, {
157
+ options: ['termGroupId', 'termGroupName'],
158
+ runsWhen: (args) => {
159
+ return args.options.name !== undefined;
160
+ }
161
+ }, {
162
+ options: ['termSetId', 'termSetName'],
163
+ runsWhen: (args) => {
164
+ return args.options.name !== undefined;
165
+ }
166
+ });
147
167
  };
148
168
  module.exports = new SpoTermGetCommand();
149
169
  //# sourceMappingURL=term-get.js.map
@@ -279,6 +279,7 @@ exports.default = {
279
279
  TENANT_APPCATALOG_ADD: `${prefix} tenant appcatalog add`,
280
280
  TENANT_APPCATALOGURL_GET: `${prefix} tenant appcatalogurl get`,
281
281
  TENANT_APPLICATIONCUSTOMIZER_ADD: `${prefix} tenant applicationcustomizer add`,
282
+ TENANT_APPLICATIONCUSTOMIZER_GET: `${prefix} tenant applicationcustomizer get`,
282
283
  TENANT_RECYCLEBINITEM_LIST: `${prefix} tenant recyclebinitem list`,
283
284
  TENANT_RECYCLEBINITEM_REMOVE: `${prefix} tenant recyclebinitem remove`,
284
285
  TENANT_RECYCLEBINITEM_RESTORE: `${prefix} tenant recyclebinitem restore`,
@@ -53,6 +53,24 @@ exports.aadGroup = {
53
53
  }
54
54
  return groups[0];
55
55
  });
56
+ },
57
+ /**
58
+ * Get id of a group by its display name.
59
+ * @param displayName Group display name.
60
+ * @throws Error when group was not found.
61
+ * @throws Error when multiple groups with the same name were found.
62
+ */
63
+ getGroupIdByDisplayName(displayName) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const groups = yield odata_1.odata.getAllItems(`${graphResource}/v1.0/groups?$filter=displayName eq '${formatting_1.formatting.encodeQueryParameter(displayName)}'&$select=id`);
66
+ if (!groups.length) {
67
+ throw Error(`The specified group '${displayName}' does not exist.`);
68
+ }
69
+ if (groups.length > 1) {
70
+ throw Error(`Multiple groups with name '${displayName}' found: ${groups.map(x => x.id).join(',')}.`);
71
+ }
72
+ return groups[0].id;
73
+ });
56
74
  }
57
75
  };
58
76
  //# sourceMappingURL=aadGroup.js.map
@@ -33,6 +33,26 @@ exports.aadUser = {
33
33
  }
34
34
  return res.value[0].id;
35
35
  });
36
+ },
37
+ /**
38
+ * Retrieve the ID of a user by its email.
39
+ * @param mail User email.
40
+ */
41
+ getUserIdByEmail(email) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const requestOptions = {
44
+ url: `${graphResource}/v1.0/users?$filter=mail eq '${formatting_1.formatting.encodeQueryParameter(email)}'&$select=id`,
45
+ headers: {
46
+ accept: 'application/json;odata.metadata=none'
47
+ },
48
+ responseType: 'json'
49
+ };
50
+ const res = yield request_1.default.get(requestOptions);
51
+ if (res.value.length === 0) {
52
+ throw Error(`The specified user with email ${email} does not exist`);
53
+ }
54
+ return res.value[0].id;
55
+ });
36
56
  }
37
57
  };
38
58
  //# sourceMappingURL=aadUser.js.map
package/dist/utils/md.js CHANGED
@@ -51,6 +51,12 @@ function convertContentTabs(md) {
51
51
  return ` ${title}${os_1.EOL}${os_1.EOL}${content.replace(/^ /gms, '')}`;
52
52
  });
53
53
  }
54
+ function convertMdOutput(md) {
55
+ const regex = new RegExp('(?<=^ ```md)(.*)(?= ```)', 'gms');
56
+ return md.replace(regex, (match, content) => {
57
+ return content.replace(/^ /gms, '');
58
+ });
59
+ }
54
60
  function convertCodeFences(md) {
55
61
  const regex = new RegExp('^```.*?(?:\r\n|\n)(.*?)```(?:\r\n|\n)', 'gms');
56
62
  return md.replace(regex, (match, code) => {
@@ -79,6 +85,7 @@ const convertFunctions = [
79
85
  convertAdmonitions,
80
86
  convertDd,
81
87
  convertHyperlinks,
88
+ convertMdOutput,
82
89
  convertContentTabs,
83
90
  convertCodeFences,
84
91
  removeInlineMarkup,
package/dist/utils/spo.js CHANGED
@@ -536,6 +536,38 @@ exports.spo = {
536
536
  const customActionOnSite = yield getById(webUrl, id, "Site");
537
537
  return customActionOnSite;
538
538
  });
539
+ },
540
+ getTenantAppCatalogUrl(logger, debug) {
541
+ return __awaiter(this, void 0, void 0, function* () {
542
+ const spoUrl = yield exports.spo.getSpoUrl(logger, debug);
543
+ const requestOptions = {
544
+ url: `${spoUrl}/_api/SP_TenantSettings_Current`,
545
+ headers: {
546
+ accept: 'application/json;odata=nometadata'
547
+ },
548
+ responseType: 'json'
549
+ };
550
+ const result = yield request_1.default.get(requestOptions);
551
+ return result.CorporateCatalogUrl;
552
+ });
553
+ },
554
+ /**
555
+ * Retrieves the Azure AD ID from a SP user.
556
+ * @param webUrl Web url
557
+ * @param id The Id of the user
558
+ */
559
+ getUserAzureIdBySpoId(webUrl, id) {
560
+ return __awaiter(this, void 0, void 0, function* () {
561
+ const requestOptions = {
562
+ url: `${webUrl}/_api/web/siteusers/GetById('${formatting_1.formatting.encodeQueryParameter(id)}')?$select=AadObjectId`,
563
+ headers: {
564
+ accept: 'application/json;odata=nometadata'
565
+ },
566
+ responseType: 'json'
567
+ };
568
+ const res = yield request_1.default.get(requestOptions);
569
+ return res.AadObjectId.NameId;
570
+ });
539
571
  }
540
572
  };
541
573
  //# sourceMappingURL=spo.js.map
@@ -20,10 +20,10 @@ m365 aad approleassignment add [options]
20
20
  : Application name of the App Registration to which the configured scopes (app roles) should be applied
21
21
 
22
22
  `-r, --resource <resource>`
23
- : Service principal name, appId or objectId that has the scopes (roles) ex. `SharePoint`.
23
+ : Service principal name, appId or objectId that has the scopes (roles) e.g. `SharePoint`.
24
24
 
25
25
  `-s, --scope <scope>`
26
- : Permissions known also as scopes and roles to grant the application with. If multiple permissions have to be granted, they have to be comma separated ex. `Sites.Read.All,Sites.ReadWrite.all`
26
+ : Permissions known also as scopes and roles to grant the application with. If multiple permissions have to be granted, they have to be comma-separated e.g. `Sites.Read.All,Sites.ReadWrite.all`
27
27
 
28
28
  --8<-- "docs/cmd/_global.md"
29
29
 
@@ -33,7 +33,7 @@ This command requires tenant administrator permissions.
33
33
 
34
34
  Specify either the `appId`, `appObjectId` or `appDisplayName` but not multiple. If you specify more than one option value, the command will fail with an error.
35
35
 
36
- Autocomplete values for the `resource` option do not mean allowed values. The autocomplete will just suggest some known names, but that doesn't restrict you to use name of your own custom application or other application within your tenant.
36
+ Autocomplete values for the `resource` option do not mean allowed values. The autocomplete will just suggest some known names, but that doesn't restrict you to use the name of your own custom application or other application within your tenant.
37
37
 
38
38
  This command can also be used to assign permissions to system or user-assigned managed identity.
39
39
 
@@ -45,13 +45,13 @@ Adds SharePoint _Sites.Read.All_ application permissions to Azure AD application
45
45
  m365 aad approleassignment add --appId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "SharePoint" --scope "Sites.Read.All"
46
46
  ```
47
47
 
48
- Adds multiple Microsoft Graph application permissions to an Azure AD application with name _MyAppName_
48
+ Adds multiple Microsoft Graph application permissions to an Azure AD application with the name _MyAppName__
49
49
 
50
50
  ```sh
51
51
  m365 aad approleassignment add --appDisplayName "MyAppName" --resource "Microsoft Graph" --scope "Mail.Read,Mail.Send"
52
52
  ```
53
53
 
54
- Adds Microsoft Graph _Mail.Read_ application permissions to a system managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
54
+ Adds Microsoft Graph _Mail.Read_ application permissions to a system-managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
55
55
 
56
56
  ```sh
57
57
  m365 aad approleassignment add --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "Microsoft Graph" --scope "Mail.Read"
@@ -20,10 +20,10 @@ m365 aad approleassignment remove [options]
20
20
  : Application name of the App Registration for which the configured scopes (app roles) should be deleted
21
21
 
22
22
  `-r, --resource <resource>`
23
- : Service principal name, appId or objectId that has the scopes (roles) ex. `SharePoint`
23
+ : Service principal name, appId or objectId that has the scopes (roles) e.g. `SharePoint`
24
24
 
25
25
  `-s, --scope <scope>`
26
- : Permissions known also as scopes and roles to be deleted from the application. If multiple permissions have to be deleted, they have to be comma separated ex. `Sites.Read.All`,`Sites.ReadWrite.All`
26
+ : Permissions known also as scopes and roles to be deleted from the application. If multiple permissions have to be deleted, they have to be comma-separated e.g. `Sites.Read.All`,`Sites.ReadWrite.All`
27
27
 
28
28
  `--confirm`
29
29
  : Don't prompt for confirming removing the all role assignment
@@ -54,7 +54,7 @@ Deletes multiple Microsoft Graph application permissions from an Azure AD applic
54
54
  m365 aad approleassignment remove --appDisplayName "MyAppName" --resource "Microsoft Graph" --scope "Mail.Read,Mail.Send"
55
55
  ```
56
56
 
57
- Deletes Microsoft Graph _Mail.Read_ application permissions from a system managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
57
+ Deletes Microsoft Graph _Mail.Read_ application permissions from a system-managed identity app with objectId _57907bf8-73fa-43a6-89a5-1f603e29e451_
58
58
 
59
59
  ```sh
60
60
  m365 aad approleassignment remove --appObjectId "57907bf8-73fa-43a6-89a5-1f603e29e451" --resource "Microsoft Graph" --scope "Mail.Read"
@@ -43,7 +43,7 @@ m365 aad user remove --id a33bd401-9117-4e0e-bb7b-3f61c1539e10
43
43
  Removes a specific user by its UPN
44
44
 
45
45
  ```sh
46
- m365 aad user remove --name john.doe@contoso.com
46
+ m365 aad user remove --userName john.doe@contoso.com
47
47
  ```
48
48
 
49
49
  ## Response
@@ -12,16 +12,16 @@ m365 cli completion clink update [options]
12
12
 
13
13
  --8<-- "docs/cmd/_global.md"
14
14
 
15
- !!! important
16
- Before running this command, change the working directory to where your shell stores completion plugins. For cmder, it's `%CMDER_ROOT%\vendor\clink-completions`, where `%CMDER_ROOT%` is the folder where you installed cmder. After running this command, restart your terminal to load the completion.
17
-
18
15
  ## Remarks
19
16
 
20
17
  This commands updates the list of commands and their options used by command completion in Clink (cmder). You should run this command each time after upgrading the CLI for Microsoft 365.
21
18
 
19
+ !!! important
20
+ Before running this command, change the working directory to where your shell stores completion plugins. For cmder, it's `%CMDER_ROOT%\vendor\clink-completions`, where `%CMDER_ROOT%` is the folder where you installed cmder. After running this command, restart your terminal to load the completion.
21
+
22
22
  ## Examples
23
23
 
24
- Write the list of commands for Clink (cmder) command completion to a file named `m365.lua` in the current directory
24
+ Write the list of commands for Clink (cmder) command completion to a file named `m365.lua` in the current directory.
25
25
 
26
26
  ```powershell
27
27
  m365 cli completion clink update > m365.lua
@@ -0,0 +1,61 @@
1
+ # flow owner add
2
+
3
+ Assigns permissions to a Power Automate flow
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 flow owner add [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-e, --environmentName <environmentName>`
14
+ : The name of the environment.
15
+
16
+ `-f, --flowName <flowName>`
17
+ : The name of the Power Automate flow.
18
+
19
+ `--userId [userId]`
20
+ : The ID of the user. Specify either `userId`, `userName`, `groupId` or `groupName`.
21
+
22
+ `--userName [userName]`
23
+ : User principal name of the user. Specify either `userId`, `userName`, `groupId` or `groupName`.
24
+
25
+ `--groupId [groupId]`
26
+ : The ID of the group. Specify either `userId`, `userName`, `groupId` or `groupName`.
27
+
28
+ `--groupName [groupName]`
29
+ : The name of the group. Specify either `userId`, `userName`, `groupId` or `groupName`.
30
+
31
+ `--roleName <roleName>`
32
+ : Access level for the user on the flow. Valid options are `CanView` or `CanEdit`.
33
+
34
+ `--asAdmin`
35
+ : Run the command as admin.
36
+
37
+ --8<-- "docs/cmd/_global.md"
38
+
39
+ ## Examples
40
+
41
+ Assign owner permissions to a specific Power Automate flow for a user with ID
42
+
43
+ ```sh
44
+ m365 flow owner add --userId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --roleName CanEdit
45
+ ```
46
+
47
+ Assign owner permissions to a specific Power Automate flow for a user with UPN
48
+
49
+ ```sh
50
+ m365 flow owner add --userName "john.doe@contoso.com" --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --roleName CanEdit
51
+ ```
52
+
53
+ Assign owner permissions to a specific Power Automate flow for a group
54
+
55
+ ```sh
56
+ m365 flow owner add --groupId 8d4d9f32-1ab0-4f81-9054-efbb1759e8e6 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --roleName CanEdit
57
+ ```
58
+
59
+ ## Response
60
+
61
+ The command won't return a response on success.