@pnp/cli-microsoft365 6.8.0-beta.74dea8a → 6.8.0-beta.85a1ca9

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 (80) hide show
  1. package/dist/Command.js +6 -0
  2. package/dist/chili/chili.js +298 -0
  3. package/dist/chili/index.js +20 -0
  4. package/dist/cli/Cli.js +2 -2
  5. package/dist/m365/app/commands/permission/permission-add.js +279 -0
  6. package/dist/m365/app/commands.js +1 -0
  7. package/dist/m365/commands/commands.js +1 -0
  8. package/dist/m365/commands/setup.js +180 -0
  9. package/dist/m365/commands/setupPresets.js +25 -0
  10. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +2 -0
  11. package/dist/m365/spfx/commands/spfx-doctor.js +14 -30
  12. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +146 -0
  13. package/dist/m365/spo/commands/listitem/listitem-batch-set.js +308 -0
  14. package/dist/m365/spo/commands/page/page-section-add.js +2 -3
  15. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +30 -39
  16. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +47 -0
  17. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +151 -0
  18. package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +152 -0
  19. package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +203 -0
  20. package/dist/m365/spo/commands.js +6 -0
  21. package/dist/utils/formatting.js +35 -11
  22. package/dist/utils/pid.js +5 -0
  23. package/docs/docs/cmd/app/permission/permission-add.md +53 -0
  24. package/docs/docs/cmd/flow/environment/environment-list.md +18 -0
  25. package/docs/docs/cmd/flow/flow-get.md +20 -0
  26. package/docs/docs/cmd/flow/flow-list.md +17 -0
  27. package/docs/docs/cmd/planner/plan/plan-get.md +1 -1
  28. package/docs/docs/cmd/planner/plan/plan-list.md +1 -1
  29. package/docs/docs/cmd/planner/roster/roster-add.md +2 -1
  30. package/docs/docs/cmd/planner/roster/roster-get.md +1 -1
  31. package/docs/docs/cmd/planner/roster/roster-remove.md +2 -1
  32. package/docs/docs/cmd/planner/task/task-set.md +1 -1
  33. package/docs/docs/cmd/purview/retentionevent/retentionevent-add.md +6 -7
  34. package/docs/docs/cmd/purview/retentionevent/retentionevent-get.md +6 -7
  35. package/docs/docs/cmd/purview/retentionevent/retentionevent-list.md +4 -4
  36. package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.md +4 -4
  37. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +10 -10
  38. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.md +11 -11
  39. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.md +10 -10
  40. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.md +10 -10
  41. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.md +10 -10
  42. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +12 -12
  43. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.md +8 -9
  44. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.md +8 -9
  45. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.md +8 -8
  46. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.md +8 -8
  47. package/docs/docs/cmd/setup.md +86 -0
  48. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.md +1 -1
  49. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.md +77 -0
  50. package/docs/docs/cmd/spo/commandset/commandset-set.md +1 -1
  51. package/docs/docs/cmd/spo/contenttype/contenttype-set.md +2 -2
  52. package/docs/docs/cmd/spo/customaction/customaction-add.md +1 -1
  53. package/docs/docs/cmd/spo/customaction/customaction-set.md +1 -1
  54. package/docs/docs/cmd/spo/folder/folder-copy.md +1 -1
  55. package/docs/docs/cmd/spo/listitem/listitem-batch-set.md +67 -0
  56. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +1 -1
  57. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.md +103 -0
  58. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.md +49 -0
  59. package/docs/docs/cmd/spo/tenant/tenant-commandset-remove.md +49 -0
  60. package/docs/docs/cmd/spo/tenant/tenant-commandset-set.md +57 -0
  61. package/docs/docs/cmd/teams/tab/tab-remove.md +1 -1
  62. package/docs/docs/cmd/version.md +1 -1
  63. package/docs/docs/cmd/yammer/group/group-list.md +42 -0
  64. package/docs/docs/cmd/yammer/message/message-add.md +32 -0
  65. package/docs/docs/cmd/yammer/message/message-get.md +32 -0
  66. package/docs/docs/cmd/yammer/message/message-list.md +34 -0
  67. package/docs/docs/cmd/yammer/network/network-list.md +70 -0
  68. package/docs/docs/cmd/yammer/report/report-activitycounts.md +7 -0
  69. package/docs/docs/cmd/yammer/report/report-activityusercounts.md +7 -0
  70. package/docs/docs/cmd/yammer/report/report-activityuserdetail.md +7 -0
  71. package/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.md +7 -0
  72. package/docs/docs/cmd/yammer/report/report-deviceusageusercounts.md +7 -0
  73. package/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.md +7 -0
  74. package/docs/docs/cmd/yammer/report/report-groupsactivitycounts.md +7 -0
  75. package/docs/docs/cmd/yammer/report/report-groupsactivitydetail.md +7 -0
  76. package/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.md +7 -0
  77. package/docs/docs/cmd/yammer/user/user-get.md +55 -0
  78. package/docs/docs/cmd/yammer/user/user-list.md +55 -0
  79. package/docs/docs/cmd/yammer/yammer-search.md +15 -3
  80. package/package.json +2 -1
@@ -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
@@ -16,6 +16,7 @@ exports.default = {
16
16
  APPLICATIONCUSTOMIZER_ADD: `${prefix} applicationcustomizer add`,
17
17
  APPLICATIONCUSTOMIZER_GET: `${prefix} applicationcustomizer get`,
18
18
  APPLICATIONCUSTOMIZER_LIST: `${prefix} applicationcustomizer list`,
19
+ APPLICATIONCUSTOMIZER_REMOVE: `${prefix} applicationcustomizer remove`,
19
20
  APPPAGE_ADD: `${prefix} apppage add`,
20
21
  APPPAGE_SET: `${prefix} apppage set`,
21
22
  CDN_GET: `${prefix} cdn get`,
@@ -158,6 +159,7 @@ exports.default = {
158
159
  LISTITEM_ADD: `${prefix} listitem add`,
159
160
  LISTITEM_ATTACHMENT_LIST: `${prefix} listitem attachment list`,
160
161
  LISTITEM_BATCH_ADD: `${prefix} listitem batch add`,
162
+ LISTITEM_BATCH_SET: `${prefix} listitem batch set`,
161
163
  LISTITEM_GET: `${prefix} listitem get`,
162
164
  LISTITEM_ISRECORD: `${prefix} listitem isrecord`,
163
165
  LISTITEM_LIST: `${prefix} listitem list`,
@@ -291,6 +293,10 @@ exports.default = {
291
293
  TENANT_APPCATALOGURL_GET: `${prefix} tenant appcatalogurl get`,
292
294
  TENANT_APPLICATIONCUSTOMIZER_ADD: `${prefix} tenant applicationcustomizer add`,
293
295
  TENANT_APPLICATIONCUSTOMIZER_GET: `${prefix} tenant applicationcustomizer get`,
296
+ TENANT_APPLICATIONCUSTOMIZER_LIST: `${prefix} tenant applicationcustomizer list`,
297
+ TENANT_APPLICATIONCUSTOMIZER_REMOVE: `${prefix} tenant applicationcustomizer remove`,
298
+ TENANT_COMMANDSET_REMOVE: `${prefix} tenant commandset remove`,
299
+ TENANT_COMMANDSET_SET: `${prefix} tenant commandset set`,
294
300
  TENANT_RECYCLEBINITEM_LIST: `${prefix} tenant recyclebinitem list`,
295
301
  TENANT_RECYCLEBINITEM_REMOVE: `${prefix} tenant recyclebinitem remove`,
296
302
  TENANT_RECYCLEBINITEM_RESTORE: `${prefix} tenant recyclebinitem restore`,
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatting = void 0;
3
+ exports.formatting = exports.CheckStatus = void 0;
4
+ const chalk = require("chalk");
4
5
  const stripJsonComments = require("strip-json-comments");
5
6
  const base_permissions_1 = require("../m365/spo/base-permissions");
6
7
  const RoleType_1 = require("../m365/spo/commands/roledefinition/RoleType");
8
+ /**
9
+ * Has the particular check passed or failed
10
+ */
11
+ var CheckStatus;
12
+ (function (CheckStatus) {
13
+ CheckStatus[CheckStatus["Success"] = 0] = "Success";
14
+ CheckStatus[CheckStatus["Failure"] = 1] = "Failure";
15
+ })(CheckStatus = exports.CheckStatus || (exports.CheckStatus = {}));
7
16
  exports.formatting = {
8
17
  escapeXml(s) {
9
18
  if (!s) {
@@ -54,16 +63,23 @@ exports.formatting = {
54
63
  const regex = new RegExp(`\\s*(${quoteChar})?(.*?)\\1\\s*(?:${delimiter}|$)`, 'gs');
55
64
  const lines = s.split('\n');
56
65
  const match = (line) => [...line.matchAll(regex)]
57
- .map(m => m[2]) // we only want the second capture group
58
- .slice(0, -1); // cut off blank match at the end
59
- const heads = match(lines[0]);
60
- return lines.slice(1).map(line => {
61
- return match(line).reduce((acc, cur, i) => {
62
- const val = cur;
63
- const numValue = parseInt(val);
64
- const key = heads[i];
65
- return Object.assign(Object.assign({}, acc), { [key]: isNaN(numValue) || numValue.toString() !== val ? val : numValue });
66
- }, {});
66
+ .map(m => m[2]); // we only want the second capture group
67
+ const heads = match(lines[0]).slice(0, -1);
68
+ return lines.slice(1)
69
+ .filter(text => text.trim() !== '')
70
+ .map(line => {
71
+ const lineMatch = match(line);
72
+ const obj = {};
73
+ heads.forEach((key, index) => {
74
+ const value = parseInt(lineMatch[index]);
75
+ if (isNaN(value) || value.toString() !== lineMatch[index]) {
76
+ obj[key] = lineMatch[index];
77
+ }
78
+ else {
79
+ obj[key] = parseInt(lineMatch[index]);
80
+ }
81
+ });
82
+ return obj;
67
83
  });
68
84
  },
69
85
  encodeQueryParameter(value) {
@@ -132,6 +148,14 @@ exports.formatting = {
132
148
  }
133
149
  xml = xml.replace(/<\/?[0-9]{1,}>/g, '');
134
150
  return xml;
151
+ },
152
+ getStatus(result, message) {
153
+ const primarySupported = process.platform !== 'win32' ||
154
+ process.env.CI === 'true' ||
155
+ process.env.TERM === 'xterm-256color';
156
+ const success = primarySupported ? '✔' : '√';
157
+ const failure = primarySupported ? '✖' : '×';
158
+ return `${result === CheckStatus.Success ? chalk.green(success) : chalk.red(failure)} ${message}`;
135
159
  }
136
160
  };
137
161
  //# sourceMappingURL=formatting.js.map
package/dist/utils/pid.js CHANGED
@@ -68,6 +68,11 @@ exports.pid = {
68
68
  return processName;
69
69
  }
70
70
  return undefined;
71
+ },
72
+ isPowerShell() {
73
+ const processName = exports.pid.getProcessName(process.ppid) || '';
74
+ return processName.indexOf('powershell') > -1 ||
75
+ processName.indexOf('pwsh') > -1;
71
76
  }
72
77
  };
73
78
  //# sourceMappingURL=pid.js.map
@@ -0,0 +1,53 @@
1
+ # app permission add
2
+
3
+ Adds the specified application and/or delegated permissions to the current AAD app API permissions
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 app permission add [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--appId [appId]`
14
+ : Client ID of the Azure AD app registered in the .m365rc.json file to retrieve API permissions for
15
+
16
+ `--applicationPermission [applicationPermission]`
17
+ : Space-separated list of application permissions to add
18
+
19
+ `--delegatedPermission [delegatedPermission]`
20
+ : Space-separated list of delegated permissions to add
21
+
22
+ `--grantAdminConsent`
23
+ : If specified, admin consent to the newly added permissions will be granted.
24
+
25
+ --8<-- "docs/cmd/_global.md"
26
+
27
+ ## Remarks
28
+
29
+ If you have multiple apps registered in your .m365rc.json file, you can specify the app for which you'd like to retrieve permissions using the `--appId` option. If you don't specify the app using the `--appId` option, you'll be prompted to select one of the applications from your .m365rc.json file.
30
+
31
+ ## Examples
32
+
33
+ Adds the specified application permissions to the default app registered in the .m365rc.json file while granting admin consent.
34
+
35
+ ```sh
36
+ m365 app permission add --applicationPermission 'https://graph.microsoft.com/User.ReadWrite.All https://graph.microsoft.com/User.Read.All' --grantAdminConsent
37
+ ```
38
+
39
+ Adds the specified delegated permissions to the default app registered in the .m365rc.json file without granting admin consent.
40
+
41
+ ```sh
42
+ m365 app permission add --delegatedPermission 'https://graph.microsoft.com/offline_access'
43
+ ```
44
+
45
+ Adds the specified application and delegated permissions to a specific app registered in the .m365rc.json file while granting admin consent.
46
+
47
+ ```sh
48
+ m365 app permission add --appId '1663767b-4172-4519-bfd1-28e6ff19055b' --applicationPermission 'https://graph.microsoft.com/User.ReadWrite.All https://graph.microsoft.com/User.Read.All' --delegatedPermission 'https://graph.microsoft.com/offline_access' --grantAdminConsent
49
+ ```
50
+
51
+ ## Response
52
+
53
+ The command won't return a response on success.
@@ -121,3 +121,21 @@ m365 flow environment list
121
121
  name,displayName
122
122
  d87a7535-dd31-4437-bfe1-95340acd55c5,Contoso Environment
123
123
  ```
124
+
125
+ === "Markdown"
126
+
127
+ ```md
128
+ # flow environment list
129
+
130
+ Date: 2023-05-18
131
+
132
+ ## Contoso Environment (/providers/Microsoft.ProcessSimple/environments/Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4)
133
+
134
+ Property | Value
135
+ ---------|-------
136
+ name | Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4
137
+ location | europe
138
+ type | Microsoft.ProcessSimple/environments
139
+ id | /providers/Microsoft.ProcessSimple/environments/Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4
140
+ displayName | Contoso Environment
141
+ ```
@@ -417,3 +417,23 @@ m365 flow get --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --n
417
417
  name,displayName,description,triggers,actions
418
418
  ca76d7b8-3b76-4050-8c03-9fb310ad172f,My Flow,,OpenApiConnection,"OpenApiConnection-AnalyzeImageV2, Compose, InitializeVariable, OpenApiConnection-HttpRequest, ParseJson, OpenApiConnection-PatchFileItem"
419
419
  ```
420
+
421
+ === "Markdown"
422
+
423
+ ```md
424
+ # flow get --environmentName "Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4" --name "ca76d7b8-3b76-4050-8c03-9fb310ad172f"
425
+
426
+ Date: 2023-05-18
427
+
428
+ ## My Flow (/providers/Microsoft.ProcessSimple/environments/Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4/flows/ca76d7b8-3b76-4050-8c03-9fb310ad172f)
429
+
430
+ Property | Value
431
+ ---------|-------
432
+ name | ca76d7b8-3b76-4050-8c03-9fb310ad172f
433
+ id | /providers/Microsoft.ProcessSimple/environments/Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4/flows/ca76d7b8-3b76-4050-8c03-9fb310ad172f
434
+ type | Microsoft.ProcessSimple/environments/flows
435
+ displayName | My Flow
436
+ description | My Flow
437
+ triggers | OpenApiConnection
438
+ actions | OpenApiConnection-AnalyzeImageV2, Compose, InitializeVariable, OpenApiConnection-HttpRequest, ParseJson, OpenApiConnection-PatchFileItem
439
+ ```
@@ -147,3 +147,20 @@ m365 flow list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --
147
147
  name,displayName
148
148
  00afcb83-df7b-4fe0-ab9c-1542a1dc66a9,Contoso Invoicing Flow
149
149
  ```
150
+
151
+ === "Markdown"
152
+
153
+ ```md
154
+ # flow list --environmentName "Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4"
155
+
156
+ Date: 2023-05-18
157
+
158
+ ## Contoso Invoicing Flow (/providers/Microsoft.ProcessSimple/environments/Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4/flows/00afcb83-df7b-4fe0-ab9c-1542a1dc66a9)
159
+
160
+ Property | Value
161
+ ---------|-------
162
+ name | 00afcb83-df7b-4fe0-ab9c-1542a1dc66a9
163
+ id | /providers/Microsoft.ProcessSimple/environments/Default-1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4/flows/00afcb83-df7b-4fe0-ab9c-1542a1dc66a9
164
+ type | Microsoft.ProcessSimple/environments/flows
165
+ displayName | Contoso Invoicing Flow
166
+ ```
@@ -30,7 +30,7 @@ m365 planner plan get [options]
30
30
  ## Remarks
31
31
 
32
32
  !!! attention
33
- When using `rosterId`, the command is based on an API that is currently in preview and is subject to change once the API reached general availability.
33
+ When using `rosterId`, the command is based on an API that is currently in preview and is subject to change once the API reached general availability.
34
34
 
35
35
  ## Examples
36
36
 
@@ -24,7 +24,7 @@ m365 planner plan list [options]
24
24
  ## Remarks
25
25
 
26
26
  !!! attention
27
- When using rosterId, the command is based on an API that is currently in preview and is subject to change once the API reached general availability.
27
+ When using rosterId, the command is based on an API that is currently in preview and is subject to change once the API reached general availability.
28
28
 
29
29
  ## Examples
30
30
 
@@ -71,5 +71,6 @@ m365 planner roster add
71
71
  assignedSensitivityLabel | null
72
72
  ```
73
73
 
74
- ## Additional information
74
+ ## More information
75
+
75
76
  Rosters are a new type of container for Microsoft Planner plans. This enables users to create a Planner plan without the need to create a new Microsoft 365 group (with a mailbox, SharePoint site, ...). Access to Roster-contained plans is controlled by the members on the Roster. A Planner Roster can contain only 1 plan.
@@ -68,6 +68,6 @@ m365 planner roster get --id tYqYlNd6eECmsNhN_fcq85cAGAnd
68
68
  assignedSensitivityLabel | null
69
69
  ```
70
70
 
71
- ## Additional information
71
+ ## More information
72
72
 
73
73
  Rosters are a new type of container for Microsoft Planner plans. This enables users to create a Planner plan without the need to create a new Microsoft 365 group (with a mailbox, SharePoint site, ...). Access to Roster-contained plans is controlled by the members on the Roster. A Planner Roster can contain only 1 plan.
@@ -44,5 +44,6 @@ m365 planner roster remove --id tYqYlNd6eECmsNhN_fcq85cAGAnd --confirm
44
44
 
45
45
  The command won't return a response on success.
46
46
 
47
- ## Additional information
47
+ ## More information
48
+
48
49
  Rosters are a new type of container for Microsoft Planner plans. This enables users to create a Planner plan without the need to create a new Microsoft 365 group (with a mailbox, SharePoint site, ...). Access to Roster-contained plans is controlled by the members on the Roster. A Planner Roster can contain only 1 plan.
@@ -335,7 +335,7 @@ m365 planner task set --id "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --percentComplete 50
335
335
  checklist | {}
336
336
  ```
337
337
 
338
- ## Additional information
338
+ ## More information
339
339
 
340
340
  - Using order hints in Planner: [https://docs.microsoft.com/graph/api/resources/planner-order-hint-format?view=graph-rest-1.0](https://docs.microsoft.com/graph/api/resources/planner-order-hint-format?view=graph-rest-1.0)
341
341
  - Applied categories in Planner: [https://docs.microsoft.com/graph/api/resources/plannerappliedcategories?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/resources/plannerappliedcategories?view=graph-rest-1.0)