@pnp/cli-microsoft365 6.4.0-beta.3946b02 → 6.4.0-beta.91f8cd3

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 (105) hide show
  1. package/README.md +12 -1
  2. package/dist/m365/aad/commands/user/user-get.js +3 -0
  3. package/dist/m365/aad/commands/user/user-set.js +3 -0
  4. package/dist/m365/aad/commands/user/user-signin-list.js +3 -0
  5. package/dist/m365/flow/commands/owner/owner-add.js +147 -0
  6. package/dist/m365/flow/commands/owner/owner-remove.js +147 -0
  7. package/dist/m365/flow/commands/run/run-list.js +5 -2
  8. package/dist/m365/flow/commands.js +2 -0
  9. package/dist/m365/planner/commands/roster/roster-member-add.js +3 -0
  10. package/dist/m365/planner/commands/roster/roster-member-get.js +98 -0
  11. package/dist/m365/planner/commands.js +1 -0
  12. package/dist/m365/spfx/commands/spfx-doctor.js +43 -29
  13. package/dist/m365/spo/commands/customaction/customaction-get.js +27 -7
  14. package/dist/m365/spo/commands/file/file-move.js +1 -1
  15. package/dist/m365/spo/commands/list/list-add.js +11 -8
  16. package/dist/m365/spo/commands/list/list-set.js +3 -3
  17. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +118 -0
  18. package/dist/m365/spo/commands.js +1 -0
  19. package/dist/utils/aadGroup.js +18 -0
  20. package/dist/utils/md.js +7 -0
  21. package/dist/utils/spo.js +14 -0
  22. package/docs/docs/cmd/flow/owner/owner-add.md +61 -0
  23. package/docs/docs/cmd/flow/owner/owner-remove.md +67 -0
  24. package/docs/docs/cmd/flow/run/run-list.md +28 -0
  25. package/docs/docs/cmd/onenote/page/page-list.md +1 -1
  26. package/docs/docs/cmd/outlook/mail/mail-send.md +4 -0
  27. package/docs/docs/cmd/outlook/message/message-get.md +143 -0
  28. package/docs/docs/cmd/outlook/message/message-list.md +119 -0
  29. package/docs/docs/cmd/outlook/message/message-move.md +4 -0
  30. package/docs/docs/cmd/outlook/report/report-mailactivitycounts.md +40 -0
  31. package/docs/docs/cmd/outlook/report/report-mailactivityusercounts.md +40 -0
  32. package/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.md +45 -0
  33. package/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.md +43 -0
  34. package/docs/docs/cmd/outlook/report/report-mailappusageusercounts.md +44 -0
  35. package/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.md +48 -0
  36. package/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.md +41 -0
  37. package/docs/docs/cmd/outlook/report/report-mailboxusagedetail.md +49 -0
  38. package/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.md +37 -0
  39. package/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.md +40 -0
  40. package/docs/docs/cmd/outlook/report/report-mailboxusagestorage.md +36 -0
  41. package/docs/docs/cmd/outlook/room/room-list.md +81 -0
  42. package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +58 -0
  43. package/docs/docs/cmd/planner/plan/plan-add.md +3 -3
  44. package/docs/docs/cmd/planner/plan/plan-set.md +73 -7
  45. package/docs/docs/cmd/planner/roster/roster-add.md +16 -1
  46. package/docs/docs/cmd/planner/roster/roster-member-get.md +87 -0
  47. package/docs/docs/cmd/planner/task/task-add.md +230 -0
  48. package/docs/docs/cmd/planner/task/task-checklistitem-add.md +55 -0
  49. package/docs/docs/cmd/planner/task/task-checklistitem-list.md +55 -0
  50. package/docs/docs/cmd/planner/task/task-checklistitem-remove.md +4 -0
  51. package/docs/docs/cmd/planner/task/task-get.md +131 -0
  52. package/docs/docs/cmd/planner/task/task-list.md +92 -0
  53. package/docs/docs/cmd/planner/task/task-reference-add.md +46 -0
  54. package/docs/docs/cmd/planner/task/task-reference-list.md +46 -0
  55. package/docs/docs/cmd/planner/task/task-reference-remove.md +4 -0
  56. package/docs/docs/cmd/planner/task/task-remove.md +4 -0
  57. package/docs/docs/cmd/planner/task/task-set.md +230 -0
  58. package/docs/docs/cmd/planner/tenant/tenant-settings-list.md +55 -0
  59. package/docs/docs/cmd/planner/tenant/tenant-settings-set.md +55 -0
  60. package/docs/docs/cmd/pp/card/card-get.md +2 -2
  61. package/docs/docs/cmd/pp/card/card-list.md +2 -2
  62. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +7 -7
  63. package/docs/docs/cmd/skype/report/report-activitycounts.md +38 -0
  64. package/docs/docs/cmd/skype/report/report-activityusercounts.md +38 -0
  65. package/docs/docs/cmd/skype/report/report-activityuserdetail.md +67 -0
  66. package/docs/docs/cmd/spo/customaction/customaction-get.md +113 -11
  67. package/docs/docs/cmd/spo/list/list-add.md +2 -2
  68. package/docs/docs/cmd/spo/list/list-set.md +2 -2
  69. package/docs/docs/cmd/spo/listitem/listitem-add.md +1 -1
  70. package/docs/docs/cmd/spo/listitem/listitem-batch-add.md +1 -1
  71. package/docs/docs/cmd/spo/listitem/listitem-set.md +1 -1
  72. package/docs/docs/cmd/spo/site/site-set.md +2 -2
  73. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.md +142 -0
  74. package/docs/docs/cmd/spo/term/term-list.md +1 -1
  75. package/docs/docs/cmd/teams/channel/channel-get.md +1 -1
  76. package/docs/docs/cmd/teams/message/message-get.md +39 -4
  77. package/docs/docs/cmd/teams/message/message-list.md +41 -6
  78. package/docs/docs/cmd/teams/message/message-reply-list.md +39 -4
  79. package/docs/docs/cmd/teams/messagingsettings/messagingsettings-list.md +20 -2
  80. package/docs/docs/cmd/teams/messagingsettings/messagingsettings-set.md +8 -8
  81. package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.md +12 -5
  82. package/docs/docs/cmd/teams/report/report-deviceusageusercounts.md +13 -6
  83. package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.md +14 -7
  84. package/docs/docs/cmd/teams/report/report-directroutingcalls.md +13 -6
  85. package/docs/docs/cmd/teams/report/report-pstncalls.md +13 -6
  86. package/docs/docs/cmd/teams/report/report-useractivitycounts.md +13 -6
  87. package/docs/docs/cmd/teams/report/report-useractivityusercounts.md +13 -6
  88. package/docs/docs/cmd/teams/report/report-useractivityuserdetail.md +13 -6
  89. package/docs/docs/cmd/teams/tab/tab-add.md +16 -0
  90. package/docs/docs/cmd/teams/tab/tab-get.md +17 -0
  91. package/docs/docs/cmd/teams/tab/tab-list.md +19 -0
  92. package/docs/docs/cmd/teams/team/team-add.md +77 -8
  93. package/docs/docs/cmd/teams/team/team-app-list.md +18 -2
  94. package/docs/docs/cmd/teams/team/team-archive.md +2 -2
  95. package/docs/docs/cmd/teams/team/team-clone.md +8 -8
  96. package/docs/docs/cmd/teams/team/team-get.md +34 -4
  97. package/docs/docs/cmd/teams/team/team-list.md +34 -3
  98. package/docs/docs/cmd/teams/team/team-remove.md +3 -3
  99. package/docs/docs/cmd/teams/team/team-set.md +8 -8
  100. package/docs/docs/cmd/teams/team/team-unarchive.md +3 -2
  101. package/docs/docs/cmd/teams/user/user-app-add.md +3 -3
  102. package/docs/docs/cmd/teams/user/user-app-list.md +18 -2
  103. package/docs/docs/cmd/teams/user/user-app-remove.md +4 -4
  104. package/docs/docs/cmd/teams/user/user-list.md +21 -4
  105. package/package.json +1 -1
@@ -77,14 +77,26 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
77
77
  }
78
78
  return customAction;
79
79
  }
80
- const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
81
- if (customActions.length === 1) {
82
- return customActions[0];
80
+ else if (options.title) {
81
+ const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
82
+ if (customActions.length === 1) {
83
+ return customActions[0];
84
+ }
85
+ if (customActions.length === 0) {
86
+ throw `No user custom action with title '${options.title}' found`;
87
+ }
88
+ throw `Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
83
89
  }
84
- if (customActions.length === 0) {
85
- throw `No user custom action with title '${options.title}' found`;
90
+ else {
91
+ const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `ClientSideComponentId eq guid'${options.clientSideComponentId}'`);
92
+ if (customActions.length === 0) {
93
+ throw `No user custom action with ClientSideComponentId '${options.clientSideComponentId}' found`;
94
+ }
95
+ if (customActions.length > 1) {
96
+ throw `Multiple user custom actions with ClientSideComponentId '${options.clientSideComponentId}' found. Please disambiguate using IDs: ${customActions.map((customAction) => customAction.Id).join(', ')}`;
97
+ }
98
+ return customActions[0];
86
99
  }
87
- throw `Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
88
100
  });
89
101
  }
90
102
  humanizeScope(scope) {
@@ -100,6 +112,9 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
100
112
  _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand_initTelemetry = function _SpoCustomActionGetCommand_initTelemetry() {
101
113
  this.telemetry.push((args) => {
102
114
  Object.assign(this.telemetryProperties, {
115
+ id: typeof args.options.id !== 'undefined',
116
+ title: typeof args.options.title !== 'undefined',
117
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
103
118
  scope: args.options.scope || 'All'
104
119
  });
105
120
  });
@@ -108,6 +123,8 @@ _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand
108
123
  option: '-i, --id [id]'
109
124
  }, {
110
125
  option: '-t, --title [title]'
126
+ }, {
127
+ option: '-c, --clientSideComponentId [clientSideComponentId]'
111
128
  }, {
112
129
  option: '-u, --webUrl <webUrl>'
113
130
  }, {
@@ -130,10 +147,13 @@ _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand
130
147
  return `${args.options.scope} is not a valid custom action scope. Allowed values are Site|Web|All`;
131
148
  }
132
149
  }
150
+ if (args.options.clientSideComponentId && validation_1.validation.isValidGuid(args.options.clientSideComponentId) === false) {
151
+ return `${args.options.clientSideComponentId} is not a valid GUID.`;
152
+ }
133
153
  return true;
134
154
  }));
135
155
  }, _SpoCustomActionGetCommand_initOptionSets = function _SpoCustomActionGetCommand_initOptionSets() {
136
- this.optionSets.push({ options: ['id', 'title'] });
156
+ this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
137
157
  };
138
158
  module.exports = new SpoCustomActionGetCommand();
139
159
  //# sourceMappingURL=customaction-get.js.map
@@ -55,7 +55,7 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
55
55
  // A user might enter folder instead of file as source url by mistake
56
56
  // then there are edge cases when deleteIfAlreadyExists flag is set
57
57
  // the user can receive misleading error message.
58
- this.fileExists(tenantUrl, webUrl, args.options.sourceUrl);
58
+ yield this.fileExists(tenantUrl, webUrl, args.options.sourceUrl);
59
59
  if (args.options.deleteIfAlreadyExists) {
60
60
  // try delete target file, if deleteIfAlreadyExists flag is set
61
61
  const filename = args.options.sourceUrl.replace(/^.*[\\\/]/, '');
@@ -106,7 +106,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
106
106
  mapRequestBody(options) {
107
107
  const requestBody = {
108
108
  Title: options.title,
109
- BaseTemplate: ListTemplateType_1.ListTemplateType[options.baseTemplate.trim()].valueOf()
109
+ BaseTemplate: options.baseTemplate ? ListTemplateType_1.ListTemplateType[options.baseTemplate.trim()].valueOf() : ListTemplateType_1.ListTemplateType.GenericList
110
110
  };
111
111
  if (options.description) {
112
112
  requestBody.Description = options.description;
@@ -148,7 +148,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
148
148
  requestBody.DisableGridEditing = options.disableGridEditing;
149
149
  }
150
150
  if (options.draftVersionVisibility) {
151
- requestBody.DraftVersionVisibility = options.draftVersionVisibility;
151
+ requestBody.DraftVersionVisibility = DraftVisibilityType_1.DraftVisibilityType[options.draftVersionVisibility.trim()];
152
152
  }
153
153
  if (options.emailAlias) {
154
154
  requestBody.EmailAlias = options.emailAlias;
@@ -226,7 +226,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
226
226
  requestBody.IsApplicationList = options.isApplicationList;
227
227
  }
228
228
  if (options.listExperienceOptions) {
229
- requestBody.ListExperienceOptions = options.listExperienceOptions;
229
+ requestBody.ListExperienceOptions = ListExperience_1.ListExperience[options.listExperienceOptions.trim()];
230
230
  }
231
231
  if (options.majorVersionLimit) {
232
232
  requestBody.MajorVersionLimit = options.majorVersionLimit;
@@ -296,6 +296,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
296
296
  const telemetryProps = {};
297
297
  // add properties with identifiable data
298
298
  [
299
+ 'baseTemplate',
299
300
  'description',
300
301
  'templateFeatureId',
301
302
  'schemaXml',
@@ -342,7 +343,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
342
343
  this.options.unshift({
343
344
  option: '-t, --title <title>'
344
345
  }, {
345
- option: '--baseTemplate <baseTemplate>',
346
+ option: '--baseTemplate [baseTemplate]',
346
347
  autocomplete: this.listTemplateTypeMap
347
348
  }, {
348
349
  option: '-u, --webUrl <webUrl>'
@@ -520,9 +521,11 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
520
521
  if (isValidSharePointUrl !== true) {
521
522
  return isValidSharePointUrl;
522
523
  }
523
- const template = ListTemplateType_1.ListTemplateType[args.options.baseTemplate.trim()];
524
- if (!template) {
525
- return `${args.options.baseTemplate} is not a valid baseTemplate value`;
524
+ if (args.options.baseTemplate) {
525
+ const template = ListTemplateType_1.ListTemplateType[args.options.baseTemplate.trim()];
526
+ if (!template) {
527
+ return `${args.options.baseTemplate} is not a valid baseTemplate value`;
528
+ }
526
529
  }
527
530
  if (args.options.templateFeatureId &&
528
531
  !validation_1.validation.isValidGuid(args.options.templateFeatureId)) {
@@ -538,7 +541,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
538
541
  }
539
542
  if (args.options.draftVersionVisibility) {
540
543
  const draftType = DraftVisibilityType_1.DraftVisibilityType[args.options.draftVersionVisibility.trim()];
541
- if (!draftType) {
544
+ if (draftType === undefined) {
542
545
  return `${args.options.draftVersionVisibility} is not a valid draftVisibilityType value`;
543
546
  }
544
547
  }
@@ -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
  }
@@ -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
@@ -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
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,20 @@ 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
+ });
539
553
  }
540
554
  };
541
555
  //# sourceMappingURL=spo.js.map
@@ -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.
@@ -0,0 +1,67 @@
1
+ # flow owner remove
2
+
3
+ Removes owner permissions to a Power Automate flow
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 flow owner remove [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
+ `--asAdmin`
32
+ : Run the command as admin.
33
+
34
+ `--confirm`
35
+ : Don't prompt for confirmation.
36
+
37
+ --8<-- "docs/cmd/_global.md"
38
+
39
+ ## Examples
40
+
41
+ Remove owner permissions from a specific Power Automate flow for a user by ID without prompting for confirmation
42
+
43
+ ```sh
44
+ m365 flow owner remove --userId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --confirm
45
+ ```
46
+
47
+ Remove owner permissions from a specific Power Automate flow for a user by UPN as admin
48
+
49
+ ```sh
50
+ m365 flow owner remove --userName john.doe@contoso.com --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --asAdmin
51
+ ```
52
+
53
+ Remove owner permissions from a specific Power Automate flow for a group by ID
54
+
55
+ ```sh
56
+ m365 flow owner remove --groupId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72
57
+ ```
58
+
59
+ Remove owner permissions from a specific Power Automate flow for a group by name as admin
60
+
61
+ ```sh
62
+ m365 flow owner remove --groupName "Test group" --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --asAdmin
63
+ ```
64
+
65
+ ## Response
66
+
67
+ The command won't return a response on success.
@@ -25,6 +25,9 @@ m365 flow run list [options]
25
25
  `--triggerEndTime [triggerEndTime]`
26
26
  : Time indicating the exclusive end of a time range of flow runs to return. This should be defined as a valid ISO 8601 string (2021-12-16T18:28:48.6964197Z).
27
27
 
28
+ `--asAdmin`
29
+ : Run the command as admin. Use this flag when targeting flows you don't own.
30
+
28
31
  --8<-- "docs/cmd/_global.md"
29
32
 
30
33
  ## Remarks
@@ -56,6 +59,12 @@ List runs of the specified Microsoft Flow between a specific time range
56
59
  m365 flow run list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --triggerStartTime 2023-01-21T18:19:00Z --triggerEndTime 2023-01-22T00:00:00Z
57
60
  ```
58
61
 
62
+ List runs of the specified Microsoft Flow owned by another user
63
+
64
+ ```sh
65
+ m365 flow run list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --asAdmin
66
+ ```
67
+
59
68
  ## Response
60
69
 
61
70
  ### Standard response
@@ -123,3 +132,22 @@ m365 flow run list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c
123
132
  name,startTime,status
124
133
  08585329112602833828909892130CU17,2022-11-17T14:33:45.2763872Z,Running
125
134
  ```
135
+
136
+ === "Markdown"
137
+
138
+ ```md
139
+ # flow run list --environmentName "Default-de348bc7-1aeb-4406-8cb3-97db021cadb4" --flowName "08585329112602833828909892130CU17"
140
+
141
+ Date: 1/3/2023
142
+
143
+ ## 08585329112602833828909892130CU17 (/providers/Microsoft.ProcessSimple/environments/Default-de348bc7-1aeb-4406-8cb3-97db021cadb4/flows/170fb67e-a514-4d84-8727-582022bd13a9/runs/08585329112602833828909892130CU17)
144
+
145
+ Property | Value
146
+ ---------|-------
147
+ name | 08585329112602833828909892130CU17
148
+ id | /providers/Microsoft.ProcessSimple/environments/Default-de348bc7-1aeb-4406-8cb3-97db021cadb4/flows/170fb67e-a514-4d84-8727-582022bd13a9/runs/08585329112602833828909892130CU17
149
+ type | Microsoft.ProcessSimple/environments/flows/runs
150
+ properties | {"startTime":"2022-11-17T14:33:45.2763872Z","status":"Running","correlation":{"clientTrackingId":"08585329112602833829909892130CU00"},"trigger":{"name":"When_a_new_response_is_submitted","inputsLink":{"uri":"https://prod-08.centralindia.logic.azure.com:443/workflows/f7bf8f6b5c494e63bfc21b54087a596e/runs/08585329112602833828909892130CU17/contents/TriggerInputs?api-version=2016-06-01&se=2022-11-17T18%3A00%3A00.0000000Z&sp=%2Fruns%2F08585329112602833828909892130CU17%2Fcontents%2FTriggerInputs%2Fread&sv=1.0&sig=jmdMRWvY7uGoxTmqd3_a2bJtegXuVyuKTKKUVLiwh38","contentVersion":"6ZrBBE+MJg7IvhMgyJLMmA==","contentSize":349,"contentHash":{"algorithm":"md5","value":"6ZrBBE+MJg7IvhMgyJLMmA=="}},"outputsLink":{"uri":"https://prod-08.centralindia.logic.azure.com:443/workflows/f7bf8f6b5c494e63bfc21b54087a596e/runs/08585329112602833828909892130CU17/contents/TriggerOutputs?api-version=2016-06-01&se=2022-11-17T18%3A00%3A00.0000000Z&sp=%2Fruns%2F08585329112602833828909892130CU17%2Fcontents%2FTriggerOutputs%2Fread&sv=1.0&sig=Y3qqjuWrrcQJrmF7uvm6LVzQy5w-dNOFWJ8Yt8khXvA","contentVersion":"Z/4a8tfYygNAR1xpc44iww==","contentSize":493,"contentHash":{"algorithm":"md5","value":"Z/4a8tfYygNAR1xpc44iww=="}},"startTime":"2022-11-17T14:33:45.1914506Z","endTime":"2022-11-17T14:33:45.1914506Z","originHistoryName":"08585329112602833829909892130CU00","correlation":{"clientTrackingId":"08585329112602833829909892130CU00"},"status":"Succeeded"}}
151
+ startTime | 2022-11-17T14:33:45.2763872Z
152
+ status | Running
153
+ ```
@@ -118,7 +118,7 @@ m365 onenote page list --webUrl https://contoso.sharepoint.com/sites/testsite
118
118
  === "Markdown"
119
119
 
120
120
  ```md
121
- # onenote page list --userName "mathijs@mathijsdev2.onmicrosoft.com"
121
+ # onenote page list --userName "john.doe@contoso.onmicrosoft.com"
122
122
 
123
123
  Date: 07/01/2023
124
124
 
@@ -123,3 +123,7 @@ Send an email with multiple attachments
123
123
  ```sh
124
124
  m365 outlook mail send --to chris@contoso.com --subject "Monthly reports" --bodyContents "Here are the reports of this month." --attachment "C:/Reports/File1.jpg" --attachment "C:/Reports/File2.docx" --attachment "C:/Reports/File3.xlsx"
125
125
  ```
126
+
127
+ ## Response
128
+
129
+ The command won't return a response on success.