@pnp/cli-microsoft365 10.9.0-beta.bc13e90 → 10.10.0-beta.3dc1bcf
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.
- package/.devcontainer/Dockerfile +1 -1
- package/.devproxy/api-specs/sharepoint-admin.yaml +67 -0
- package/.devproxy/api-specs/sharepoint.yaml +230 -0
- package/.devproxy/devproxyrc.json +48 -0
- package/.devproxy/generate-openapi-spec.json +24 -0
- package/.devproxy/spo-csom-types.json +54 -0
- package/.eslintrc.cjs +8 -0
- package/Dockerfile +3 -3
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/cli/cli.js +1 -1
- package/dist/m365/entra/commands/m365group/m365group-get.js +16 -3
- package/dist/m365/entra/commands/m365group/m365group-list.js +7 -1
- package/dist/m365/entra/commands/pim/pim-role-assignment-eligibility-list.js +9 -3
- package/dist/m365/entra/commands/pim/pim-role-assignment-list.js +9 -3
- package/dist/m365/entra/commands/pim/pim-role-request-list.js +9 -3
- package/dist/m365/file/commands/file-copy.js +2 -2
- package/dist/m365/file/commands/file-move.js +1 -1
- package/dist/m365/flow/commands/flow-list.js +14 -7
- package/dist/m365/flow/commands/run/run-get.js +1 -1
- package/dist/m365/graph/commands/subscription/subscription-add.js +10 -3
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +0 -3
- package/dist/m365/pp/commands/solution/solution-publisher-list.js +8 -1
- package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +9 -2
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +3 -65
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +5 -50
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +4 -48
- package/dist/m365/spo/commands/contenttype/contenttype-set.js +8 -58
- package/dist/m365/spo/commands/contenttype/contenttype-sync.js +2 -2
- package/dist/m365/spo/commands/file/file-move.js +8 -2
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +1 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +14 -5
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +9 -2
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +3 -27
- package/dist/m365/spo/commands/page/Page.js +16 -1
- package/dist/m365/spo/commands/page/clientsidepages.js +49 -17
- package/dist/m365/spo/commands/page/page-add.js +1 -1
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +2 -8
- package/dist/m365/spo/commands/page/page-control-remove.js +99 -0
- package/dist/m365/spo/commands/page/page-control-set.js +1 -1
- package/dist/m365/spo/commands/page/page-header-set.js +9 -40
- package/dist/m365/spo/commands/page/page-publish.js +2 -10
- package/dist/m365/spo/commands/page/page-section-add.js +2 -8
- package/dist/m365/spo/commands/page/page-set.js +1 -1
- package/dist/m365/spo/commands/site/site-admin-add.js +1 -12
- package/dist/m365/spo/commands/tenant/tenant-site-list.js +16 -5
- package/dist/m365/spo/commands/term/term-list.js +10 -3
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/chat/chat-member-add.js +10 -4
- package/dist/m365/viva/commands/engage/engage-community-remove.js +99 -0
- package/dist/m365/viva/commands/engage/engage-network-list.js +8 -2
- package/dist/m365/viva/commands.js +1 -0
- package/dist/utils/md.js +3 -3
- package/dist/utils/spo.js +87 -3
- package/docs/docs/cmd/_global.mdx +1 -1
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +8 -5
- package/docs/docs/cmd/entra/m365group/m365group-list.mdx +14 -12
- package/docs/docs/cmd/entra/pim/pim-role-assignment-eligibility-list.mdx +7 -4
- package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +9 -6
- package/docs/docs/cmd/entra/pim/pim-role-request-list.mdx +7 -4
- package/docs/docs/cmd/flow/flow-list.mdx +8 -5
- package/docs/docs/cmd/flow/run/run-get.mdx +1 -1
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +6 -3
- package/docs/docs/cmd/planner/bucket/bucket-add.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-get.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-list.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-remove.mdx +21 -0
- package/docs/docs/cmd/planner/bucket/bucket-set.mdx +21 -0
- package/docs/docs/cmd/planner/plan/plan-add.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-get.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-list.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-remove.mdx +21 -0
- package/docs/docs/cmd/planner/plan/plan-set.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-add.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-get.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-add.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-get.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-list.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-remove.mdx +21 -0
- package/docs/docs/cmd/planner/roster/roster-plan-list.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-get.mdx +27 -0
- package/docs/docs/cmd/planner/task/task-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-set.mdx +19 -0
- package/docs/docs/cmd/planner/tenant/tenant-settings-list.mdx +44 -7
- package/docs/docs/cmd/planner/tenant/tenant-settings-set.mdx +43 -8
- package/docs/docs/cmd/pp/solution/solution-publisher-list.mdx +7 -4
- package/docs/docs/cmd/purview/threatassessment/threatassessment-get.mdx +7 -4
- package/docs/docs/cmd/spo/file/file-move.mdx +4 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-get.mdx +6 -3
- package/docs/docs/cmd/spo/hubsite/hubsite-list.mdx +7 -4
- package/docs/docs/cmd/spo/list/list-add.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-set.mdx +2 -2
- package/docs/docs/cmd/spo/page/page-control-remove.mdx +56 -0
- package/docs/docs/cmd/spo/tenant/tenant-site-list.mdx +10 -7
- package/docs/docs/cmd/spo/term/term-list.mdx +7 -4
- package/docs/docs/cmd/teams/chat/chat-member-add.mdx +6 -3
- package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +61 -0
- package/docs/docs/cmd/viva/engage/engage-network-list.mdx +7 -4
- package/npm-shrinkwrap.json +112 -97
- package/package.json +17 -14
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { validation } from '../../../../utils/validation.js';
|
|
5
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
6
|
+
import { zod } from '../../../../utils/zod.js';
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { Page } from './Page.js';
|
|
11
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
12
|
+
const options = globalOptionsZod
|
|
13
|
+
.extend({
|
|
14
|
+
webUrl: zod.alias('u', z.string())
|
|
15
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, url => ({
|
|
16
|
+
message: `'${url}' is not a valid SharePoint URL.`
|
|
17
|
+
})),
|
|
18
|
+
pageName: zod.alias('n', z.string()),
|
|
19
|
+
id: zod.alias('i', z.string())
|
|
20
|
+
.refine(id => validation.isValidGuid(id), id => ({
|
|
21
|
+
message: `'${id}' is not a valid GUID.`
|
|
22
|
+
})),
|
|
23
|
+
draft: z.boolean().optional(),
|
|
24
|
+
force: zod.alias('f', z.boolean().optional())
|
|
25
|
+
})
|
|
26
|
+
.strict();
|
|
27
|
+
class SpoPageControlRemoveCommand extends SpoCommand {
|
|
28
|
+
get name() {
|
|
29
|
+
return commands.PAGE_CONTROL_REMOVE;
|
|
30
|
+
}
|
|
31
|
+
get description() {
|
|
32
|
+
return 'Removes a control from a modern page';
|
|
33
|
+
}
|
|
34
|
+
get schema() {
|
|
35
|
+
return options;
|
|
36
|
+
}
|
|
37
|
+
async commandAction(logger, args) {
|
|
38
|
+
if (!args.options.force) {
|
|
39
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to delete control '${args.options.id}' on page '${args.options.pageName}'?` });
|
|
40
|
+
if (!result) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
if (this.verbose) {
|
|
46
|
+
await logger.logToStderr(`Getting page properties for page '${args.options.pageName}'...`);
|
|
47
|
+
}
|
|
48
|
+
const pageName = urlUtil.removeLeadingSlashes(args.options.pageName.toLowerCase().endsWith('.aspx') ? args.options.pageName : `${args.options.pageName}.aspx`);
|
|
49
|
+
let requestOptions = {
|
|
50
|
+
url: `${args.options.webUrl}/_api/SitePages/Pages/GetByUrl('SitePages/${formatting.encodeQueryParameter(pageName)}')?$select=CanvasContent1`,
|
|
51
|
+
headers: {
|
|
52
|
+
accept: 'application/json;odata=nometadata'
|
|
53
|
+
},
|
|
54
|
+
responseType: 'json'
|
|
55
|
+
};
|
|
56
|
+
const pageProps = await request.get(requestOptions);
|
|
57
|
+
if (!pageProps.CanvasContent1) {
|
|
58
|
+
throw `Page '${pageName}' doesn't contain canvas control '${args.options.id}'.`;
|
|
59
|
+
}
|
|
60
|
+
const pageControls = JSON.parse(pageProps.CanvasContent1);
|
|
61
|
+
const hasControl = pageControls.some(control => control.id?.toLowerCase() === args.options.id.toLowerCase());
|
|
62
|
+
if (!hasControl) {
|
|
63
|
+
throw `Control with ID '${args.options.id}' was not found on page '${pageName}'.`;
|
|
64
|
+
}
|
|
65
|
+
if (this.verbose) {
|
|
66
|
+
await logger.logToStderr('Checking out page...');
|
|
67
|
+
}
|
|
68
|
+
const page = await Page.checkout(pageName, args.options.webUrl, logger, this.verbose);
|
|
69
|
+
const canvasContent = JSON.parse(page.CanvasContent1);
|
|
70
|
+
if (this.verbose) {
|
|
71
|
+
await logger.logToStderr(`Removing control with ID '${args.options.id}' from page...`);
|
|
72
|
+
}
|
|
73
|
+
const pageContent = canvasContent.filter(control => !control.id || control.id.toLowerCase() !== args.options.id.toLowerCase());
|
|
74
|
+
requestOptions = {
|
|
75
|
+
url: `${args.options.webUrl}/_api/SitePages/Pages/GetByUrl('SitePages/${formatting.encodeQueryParameter(pageName)}')/SavePageAsDraft`,
|
|
76
|
+
headers: {
|
|
77
|
+
'content-type': 'application/json;odata=nometadata',
|
|
78
|
+
accept: 'application/json;odata=nometadata'
|
|
79
|
+
},
|
|
80
|
+
responseType: 'json',
|
|
81
|
+
data: {
|
|
82
|
+
CanvasContent1: JSON.stringify(pageContent)
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
await request.patch(requestOptions);
|
|
86
|
+
if (!args.options.draft) {
|
|
87
|
+
if (this.verbose) {
|
|
88
|
+
await logger.logToStderr(`Republishing page...`);
|
|
89
|
+
}
|
|
90
|
+
await Page.publishPage(args.options.webUrl, pageName);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
this.handleRejectedODataJsonPromise(err);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export default new SpoPageControlRemoveCommand();
|
|
99
|
+
//# sourceMappingURL=page-control-remove.js.map
|
|
@@ -50,7 +50,7 @@ class SpoPageControlSetCommand extends SpoCommand {
|
|
|
50
50
|
await logger.logToStderr(`Control with ID ${args.options.id} found on the page`);
|
|
51
51
|
}
|
|
52
52
|
// Check out the page
|
|
53
|
-
const page = await Page.checkout(pageName, args.options.webUrl, logger, this.
|
|
53
|
+
const page = await Page.checkout(pageName, args.options.webUrl, logger, this.verbose);
|
|
54
54
|
// Update the web part data
|
|
55
55
|
const canvasContent = JSON.parse(page.CanvasContent1);
|
|
56
56
|
if (this.debug) {
|
|
@@ -6,9 +6,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _SpoPageHeaderSetCommand_instances, _SpoPageHeaderSetCommand_initTelemetry, _SpoPageHeaderSetCommand_initOptions, _SpoPageHeaderSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
|
+
import { spo } from '../../../../utils/spo.js';
|
|
9
10
|
import { validation } from '../../../../utils/validation.js';
|
|
10
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
12
|
import commands from '../../commands.js';
|
|
13
|
+
import { Page } from './Page.js';
|
|
12
14
|
const BannerWebPartId = 'cbe7b0a9-3504-44dd-a3a3-0e5cacd07788';
|
|
13
15
|
class SpoPageHeaderSetCommand extends SpoCommand {
|
|
14
16
|
get name() {
|
|
@@ -148,14 +150,7 @@ class SpoPageHeaderSetCommand extends SpoCommand {
|
|
|
148
150
|
pageData = await request.get(requestOptions);
|
|
149
151
|
}
|
|
150
152
|
else {
|
|
151
|
-
|
|
152
|
-
url: `${args.options.webUrl}/_api/sitepages/pages/GetByUrl('sitepages/${formatting.encodeQueryParameter(pageFullName)}')/checkoutpage`,
|
|
153
|
-
headers: {
|
|
154
|
-
'accept': 'application/json;odata=nometadata'
|
|
155
|
-
},
|
|
156
|
-
responseType: 'json'
|
|
157
|
-
};
|
|
158
|
-
pageData = await request.post(requestOptions);
|
|
153
|
+
pageData = await Page.checkout(pageFullName, args.options.webUrl, logger, this.verbose);
|
|
159
154
|
}
|
|
160
155
|
switch (args.options.type) {
|
|
161
156
|
case 'None':
|
|
@@ -220,23 +215,23 @@ class SpoPageHeaderSetCommand extends SpoCommand {
|
|
|
220
215
|
}
|
|
221
216
|
else {
|
|
222
217
|
const res = await Promise.all([
|
|
223
|
-
|
|
224
|
-
|
|
218
|
+
spo.getSiteIdBySPApi(args.options.webUrl, logger, this.verbose),
|
|
219
|
+
spo.getWebId(args.options.webUrl, logger, this.verbose),
|
|
225
220
|
this.getImageInfo(args.options.webUrl, args.options.imageUrl, this.verbose, logger)
|
|
226
221
|
]);
|
|
227
222
|
header.serverProcessedContent.customMetadata = {
|
|
228
223
|
imageSource: {
|
|
229
|
-
siteId: res[0]
|
|
230
|
-
webId: res[1]
|
|
224
|
+
siteId: res[0],
|
|
225
|
+
webId: res[1],
|
|
231
226
|
listId: res[2].ListId,
|
|
232
227
|
uniqueId: res[2].UniqueId
|
|
233
228
|
}
|
|
234
229
|
};
|
|
235
230
|
const properties = header.properties;
|
|
236
231
|
properties.listId = res[2].ListId;
|
|
237
|
-
properties.siteId = res[0]
|
|
232
|
+
properties.siteId = res[0];
|
|
238
233
|
properties.uniqueId = res[2].UniqueId;
|
|
239
|
-
properties.webId = res[1]
|
|
234
|
+
properties.webId = res[1];
|
|
240
235
|
header.properties = properties;
|
|
241
236
|
}
|
|
242
237
|
}
|
|
@@ -306,32 +301,6 @@ class SpoPageHeaderSetCommand extends SpoCommand {
|
|
|
306
301
|
this.handleRejectedODataJsonPromise(err);
|
|
307
302
|
}
|
|
308
303
|
}
|
|
309
|
-
async getSiteId(siteUrl, verbose, logger) {
|
|
310
|
-
if (verbose) {
|
|
311
|
-
await logger.logToStderr(`Retrieving information about the site collection...`);
|
|
312
|
-
}
|
|
313
|
-
const requestOptions = {
|
|
314
|
-
url: `${siteUrl}/_api/site?$select=Id`,
|
|
315
|
-
headers: {
|
|
316
|
-
accept: 'application/json;odata=nometadata'
|
|
317
|
-
},
|
|
318
|
-
responseType: 'json'
|
|
319
|
-
};
|
|
320
|
-
return request.get(requestOptions);
|
|
321
|
-
}
|
|
322
|
-
async getWebId(siteUrl, verbose, logger) {
|
|
323
|
-
if (verbose) {
|
|
324
|
-
await logger.logToStderr(`Retrieving information about the site...`);
|
|
325
|
-
}
|
|
326
|
-
const requestOptions = {
|
|
327
|
-
url: `${siteUrl}/_api/web?$select=Id`,
|
|
328
|
-
headers: {
|
|
329
|
-
accept: 'application/json;odata=nometadata'
|
|
330
|
-
},
|
|
331
|
-
responseType: 'json'
|
|
332
|
-
};
|
|
333
|
-
return request.get(requestOptions);
|
|
334
|
-
}
|
|
335
304
|
async getImageInfo(siteUrl, imageUrl, verbose, logger) {
|
|
336
305
|
if (verbose) {
|
|
337
306
|
await logger.logToStderr(`Retrieving information about the header image...`);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { zod } from '../../../../utils/zod.js';
|
|
3
3
|
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
|
-
import request from '../../../../request.js';
|
|
5
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
6
4
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
7
5
|
import { validation } from '../../../../utils/validation.js';
|
|
8
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
9
7
|
import commands from '../../commands.js';
|
|
8
|
+
import { Page } from './Page.js';
|
|
10
9
|
const options = globalOptionsZod
|
|
11
10
|
.extend({
|
|
12
11
|
webUrl: zod.alias('u', z.string()
|
|
@@ -36,14 +35,7 @@ class SpoPagePublishCommand extends SpoCommand {
|
|
|
36
35
|
if (this.verbose) {
|
|
37
36
|
await logger.logToStderr(`Publishing page ${pageName}...`);
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
const requestOptions = {
|
|
41
|
-
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(filePath)}')/Publish()`,
|
|
42
|
-
headers: {
|
|
43
|
-
accept: 'application/json;odata=nometadata'
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
await request.post(requestOptions);
|
|
38
|
+
await Page.publishPage(args.options.webUrl, pageName);
|
|
47
39
|
}
|
|
48
40
|
catch (err) {
|
|
49
41
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -11,6 +11,7 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
11
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
13
|
import { CanvasSectionTemplate } from './clientsidepages.js';
|
|
14
|
+
import { Page } from './Page.js';
|
|
14
15
|
class SpoPageSectionAddCommand extends SpoCommand {
|
|
15
16
|
get name() {
|
|
16
17
|
return commands.PAGE_SECTION_ADD;
|
|
@@ -50,14 +51,7 @@ class SpoPageSectionAddCommand extends SpoCommand {
|
|
|
50
51
|
const res = await request.get(requestOptions);
|
|
51
52
|
canvasContent = JSON.parse(res.CanvasContent1 || "[{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]");
|
|
52
53
|
if (!res.IsPageCheckedOutToCurrentUser) {
|
|
53
|
-
|
|
54
|
-
url: `${args.options.webUrl}/_api/sitepages/pages/GetByUrl('sitepages/${formatting.encodeQueryParameter(pageFullName)}')/checkoutpage`,
|
|
55
|
-
headers: {
|
|
56
|
-
'accept': 'application/json;odata=nometadata'
|
|
57
|
-
},
|
|
58
|
-
responseType: 'json'
|
|
59
|
-
};
|
|
60
|
-
await request.post(requestOptions);
|
|
54
|
+
await Page.checkout(pageFullName, args.options.webUrl, logger, this.verbose);
|
|
61
55
|
}
|
|
62
56
|
// get unique zoneIndex values given each section can have 1 or more
|
|
63
57
|
// columns each assigned to the zoneIndex of the corresponding section
|
|
@@ -52,7 +52,7 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
52
52
|
try {
|
|
53
53
|
const requestDigestResult = await spo.getRequestDigest(args.options.webUrl);
|
|
54
54
|
const requestDigest = requestDigestResult.FormDigestValue;
|
|
55
|
-
const page = await Page.checkout(args.options.name, args.options.webUrl, logger, this.
|
|
55
|
+
const page = await Page.checkout(args.options.name, args.options.webUrl, logger, this.verbose);
|
|
56
56
|
if (page) {
|
|
57
57
|
pageTitle = pageTitle || page.Title;
|
|
58
58
|
pageId = page.Id;
|
|
@@ -125,7 +125,7 @@ class SpoSiteAdminAddCommand extends SpoCommand {
|
|
|
125
125
|
const ensuredUserData = await this.ensureUser(args, loginNameToAdd);
|
|
126
126
|
await this.setSiteAdmin(args.options.siteUrl, loginNameToAdd);
|
|
127
127
|
if (args.options.primary) {
|
|
128
|
-
const siteId = await
|
|
128
|
+
const siteId = await spo.getSiteIdBySPApi(args.options.siteUrl, logger, this.verbose);
|
|
129
129
|
const previousPrimaryOwner = await this.getSiteOwnerLoginName(args.options.siteUrl);
|
|
130
130
|
await this.setPrimaryOwnerLoginFromSite(logger, args.options.siteUrl, siteId, ensuredUserData);
|
|
131
131
|
await this.setSiteAdmin(args.options.siteUrl, previousPrimaryOwner);
|
|
@@ -157,17 +157,6 @@ class SpoSiteAdminAddCommand extends SpoCommand {
|
|
|
157
157
|
};
|
|
158
158
|
return request.post(requestOptions);
|
|
159
159
|
}
|
|
160
|
-
async getSiteId(siteUrl) {
|
|
161
|
-
const requestOptions = {
|
|
162
|
-
url: `${siteUrl}/_api/site?$select=Id`,
|
|
163
|
-
headers: {
|
|
164
|
-
accept: 'application/json;odata=nometadata'
|
|
165
|
-
},
|
|
166
|
-
responseType: 'json'
|
|
167
|
-
};
|
|
168
|
-
const response = await request.get(requestOptions);
|
|
169
|
-
return response.Id;
|
|
170
|
-
}
|
|
171
160
|
async getSiteOwnerLoginName(siteUrl) {
|
|
172
161
|
const requestOptions = {
|
|
173
162
|
url: `${siteUrl}/_api/site/owner?$select=LoginName`,
|
|
@@ -31,8 +31,11 @@ class SpoTenantSiteListCommand extends SpoCommand {
|
|
|
31
31
|
return [commands.SITE_LIST];
|
|
32
32
|
}
|
|
33
33
|
async commandAction(logger, args) {
|
|
34
|
+
if (args.options.includeOneDriveSites) {
|
|
35
|
+
await this.warn(logger, `Parameter 'includeOneDriveSites' is deprecated. Please use 'withOneDriveSites' instead`);
|
|
36
|
+
}
|
|
34
37
|
const webTemplate = this.getWebTemplateId(args.options);
|
|
35
|
-
const includeOneDriveSites = args.options.includeOneDriveSites || false;
|
|
38
|
+
const includeOneDriveSites = (args.options.includeOneDriveSites || args.options.withOneDriveSites) || false;
|
|
36
39
|
const personalSite = includeOneDriveSites === false ? '0' : '1';
|
|
37
40
|
try {
|
|
38
41
|
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
@@ -76,7 +79,7 @@ class SpoTenantSiteListCommand extends SpoCommand {
|
|
|
76
79
|
if (options.webTemplate) {
|
|
77
80
|
return options.webTemplate;
|
|
78
81
|
}
|
|
79
|
-
if (options.includeOneDriveSites) {
|
|
82
|
+
if (options.includeOneDriveSites || options.withOneDriveSites) {
|
|
80
83
|
return '';
|
|
81
84
|
}
|
|
82
85
|
switch (options.type) {
|
|
@@ -95,7 +98,8 @@ _SpoTenantSiteListCommand_instances = new WeakSet(), _SpoTenantSiteListCommand_i
|
|
|
95
98
|
webTemplate: args.options.webTemplate,
|
|
96
99
|
type: args.options.type,
|
|
97
100
|
filter: (!(!args.options.filter)).toString(),
|
|
98
|
-
includeOneDriveSites: typeof args.options.includeOneDriveSites !== 'undefined'
|
|
101
|
+
includeOneDriveSites: typeof args.options.includeOneDriveSites !== 'undefined',
|
|
102
|
+
withOneDriveSites: typeof args.options.withOneDriveSites !== 'undefined'
|
|
99
103
|
});
|
|
100
104
|
});
|
|
101
105
|
}, _SpoTenantSiteListCommand_initOptions = function _SpoTenantSiteListCommand_initOptions() {
|
|
@@ -108,6 +112,8 @@ _SpoTenantSiteListCommand_instances = new WeakSet(), _SpoTenantSiteListCommand_i
|
|
|
108
112
|
option: '--filter [filter]'
|
|
109
113
|
}, {
|
|
110
114
|
option: '--includeOneDriveSites'
|
|
115
|
+
}, {
|
|
116
|
+
option: '--withOneDriveSites'
|
|
111
117
|
});
|
|
112
118
|
}, _SpoTenantSiteListCommand_initValidators = function _SpoTenantSiteListCommand_initValidators() {
|
|
113
119
|
this.validators.push(async (args) => {
|
|
@@ -119,9 +125,14 @@ _SpoTenantSiteListCommand_instances = new WeakSet(), _SpoTenantSiteListCommand_i
|
|
|
119
125
|
typeValues.indexOf(args.options.type) < 0) {
|
|
120
126
|
return `${args.options.type} is not a valid value for the type option. Allowed values are ${typeValues.join('|')}`;
|
|
121
127
|
}
|
|
122
|
-
if (args.options.includeOneDriveSites
|
|
128
|
+
if (args.options.includeOneDriveSites || args.options.withOneDriveSites
|
|
123
129
|
&& (args.options.type || args.options.webTemplate)) {
|
|
124
|
-
|
|
130
|
+
if (args.options.includeOneDriveSites) {
|
|
131
|
+
return 'When using includeOneDriveSites, don\'t specify the type or webTemplate options';
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return 'When using withOneDriveSites, don\'t specify the type or webTemplate options';
|
|
135
|
+
}
|
|
125
136
|
}
|
|
126
137
|
return true;
|
|
127
138
|
});
|
|
@@ -31,6 +31,9 @@ class SpoTermListCommand extends SpoCommand {
|
|
|
31
31
|
__classPrivateFieldGet(this, _SpoTermListCommand_instances, "m", _SpoTermListCommand_initOptionSets).call(this);
|
|
32
32
|
}
|
|
33
33
|
async commandAction(logger, args) {
|
|
34
|
+
if (args.options.includeChildTerms) {
|
|
35
|
+
await this.warn(logger, `Parameter 'includeChildTerms' is deprecated. Please use 'withChildTerms' instead`);
|
|
36
|
+
}
|
|
34
37
|
try {
|
|
35
38
|
const spoWebUrl = args.options.webUrl ? args.options.webUrl : await spo.getSpoAdminUrl(logger, this.debug);
|
|
36
39
|
const res = await spo.getRequestDigest(spoWebUrl);
|
|
@@ -40,13 +43,14 @@ class SpoTermListCommand extends SpoCommand {
|
|
|
40
43
|
const termGroupQuery = args.options.termGroupId ? `<Method Id="77" ParentId="75" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="77" ParentId="75" Name="GetByName"><Parameters><Parameter Type="String">${formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
|
|
41
44
|
const termSetQuery = args.options.termSetId ? `<Method Id="82" ParentId="80" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termSetId}}</Parameter></Parameters></Method>` : `<Method Id="82" ParentId="80" Name="GetByName"><Parameters><Parameter Type="String">${formatting.escapeXml(args.options.termSetName)}</Parameter></Parameters></Method>`;
|
|
42
45
|
const data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="70" ObjectPathId="69" /><ObjectIdentityQuery Id="71" ObjectPathId="69" /><ObjectPath Id="73" ObjectPathId="72" /><ObjectIdentityQuery Id="74" ObjectPathId="72" /><ObjectPath Id="76" ObjectPathId="75" /><ObjectPath Id="78" ObjectPathId="77" /><ObjectIdentityQuery Id="79" ObjectPathId="77" /><ObjectPath Id="81" ObjectPathId="80" /><ObjectPath Id="83" ObjectPathId="82" /><ObjectIdentityQuery Id="84" ObjectPathId="82" /><ObjectPath Id="86" ObjectPathId="85" /><Query Id="87" ObjectPathId="85"><Query SelectAllProperties="false"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties><Property Name="Name" ScalarProperty="true" /><Property Name="Id" ScalarProperty="true" /></Properties></ChildItemQuery></Query></Actions><ObjectPaths><StaticMethod Id="69" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="72" ParentId="69" Name="GetDefaultSiteCollectionTermStore" /><Property Id="75" ParentId="72" Name="Groups" />${termGroupQuery}<Property Id="80" ParentId="77" Name="TermSets" />${termSetQuery}<Property Id="85" ParentId="82" Name="Terms" /></ObjectPaths></Request>`;
|
|
46
|
+
const shouldIncludeChildTerms = args.options.includeChildTerms || args.options.withChildTerms;
|
|
43
47
|
const result = await this.executeCsomCall(data, spoWebUrl, res);
|
|
44
48
|
const terms = [];
|
|
45
49
|
if (result._Child_Items_ && result._Child_Items_.length > 0) {
|
|
46
50
|
for (const term of result._Child_Items_) {
|
|
47
51
|
this.setTermDetails(term);
|
|
48
52
|
terms.push(term);
|
|
49
|
-
if (
|
|
53
|
+
if (shouldIncludeChildTerms && term.TermsCount > 0) {
|
|
50
54
|
await this.getChildTerms(spoWebUrl, res, term);
|
|
51
55
|
}
|
|
52
56
|
}
|
|
@@ -54,7 +58,7 @@ class SpoTermListCommand extends SpoCommand {
|
|
|
54
58
|
if (!args.options.output || !cli.shouldTrimOutput(args.options.output)) {
|
|
55
59
|
await logger.log(terms);
|
|
56
60
|
}
|
|
57
|
-
else if (!
|
|
61
|
+
else if (!shouldIncludeChildTerms) {
|
|
58
62
|
// Converted to text friendly output
|
|
59
63
|
await logger.log(terms.map(i => {
|
|
60
64
|
return {
|
|
@@ -142,7 +146,8 @@ _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry
|
|
|
142
146
|
termGroupName: typeof args.options.termGroupName !== 'undefined',
|
|
143
147
|
termSetId: typeof args.options.termSetId !== 'undefined',
|
|
144
148
|
termSetName: typeof args.options.termSetName !== 'undefined',
|
|
145
|
-
includeChildTerms: !!args.options.includeChildTerms
|
|
149
|
+
includeChildTerms: !!args.options.includeChildTerms,
|
|
150
|
+
withChildTerms: !!args.options.withChildTerms
|
|
146
151
|
});
|
|
147
152
|
});
|
|
148
153
|
}, _SpoTermListCommand_initOptions = function _SpoTermListCommand_initOptions() {
|
|
@@ -158,6 +163,8 @@ _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry
|
|
|
158
163
|
option: '--termSetName [termSetName]'
|
|
159
164
|
}, {
|
|
160
165
|
option: '--includeChildTerms'
|
|
166
|
+
}, {
|
|
167
|
+
option: '--withChildTerms'
|
|
161
168
|
});
|
|
162
169
|
}, _SpoTermListCommand_initValidators = function _SpoTermListCommand_initValidators() {
|
|
163
170
|
this.validators.push(async (args) => {
|
|
@@ -217,6 +217,7 @@ export default {
|
|
|
217
217
|
PAGE_COLUMN_LIST: `${prefix} page column list`,
|
|
218
218
|
PAGE_CONTROL_GET: `${prefix} page control get`,
|
|
219
219
|
PAGE_CONTROL_LIST: `${prefix} page control list`,
|
|
220
|
+
PAGE_CONTROL_REMOVE: `${prefix} page control remove`,
|
|
220
221
|
PAGE_CONTROL_SET: `${prefix} page control set`,
|
|
221
222
|
PAGE_HEADER_SET: `${prefix} page header set`,
|
|
222
223
|
PAGE_SECTION_ADD: `${prefix} page section add`,
|
|
@@ -29,6 +29,9 @@ class TeamsChatMemberAddCommand extends GraphCommand {
|
|
|
29
29
|
if (this.verbose) {
|
|
30
30
|
await logger.logToStderr(`Adding member ${args.options.userId || args.options.userName} to chat with id ${args.options.chatId}...`);
|
|
31
31
|
}
|
|
32
|
+
if (args.options.includeAllHistory) {
|
|
33
|
+
await this.warn(logger, `Parameter 'includeAllHistory' is deprecated. Please use 'withAllHistory' instead`);
|
|
34
|
+
}
|
|
32
35
|
const chatMemberAddOptions = {
|
|
33
36
|
url: `${this.resource}/v1.0/chats/${args.options.chatId}/members`,
|
|
34
37
|
headers: {
|
|
@@ -38,7 +41,7 @@ class TeamsChatMemberAddCommand extends GraphCommand {
|
|
|
38
41
|
data: {
|
|
39
42
|
'@odata.type': '#microsoft.graph.aadUserConversationMember',
|
|
40
43
|
'user@odata.bind': `https://graph.microsoft.com/v1.0/users/${args.options.userId || formatting.encodeQueryParameter(args.options.userName)}`,
|
|
41
|
-
visibleHistoryStartDateTime: args.options.includeAllHistory ? '0001-01-01T00:00:00Z' : args.options.visibleHistoryStartDateTime,
|
|
44
|
+
visibleHistoryStartDateTime: (args.options.includeAllHistory || args.options.withAllHistory) ? '0001-01-01T00:00:00Z' : args.options.visibleHistoryStartDateTime,
|
|
42
45
|
roles: [args.options.role || 'owner']
|
|
43
46
|
}
|
|
44
47
|
};
|
|
@@ -56,7 +59,8 @@ _a = TeamsChatMemberAddCommand, _TeamsChatMemberAddCommand_instances = new WeakS
|
|
|
56
59
|
userName: typeof args.options.userName !== 'undefined',
|
|
57
60
|
role: typeof args.options.role !== 'undefined',
|
|
58
61
|
visibleHistoryStartDateTime: typeof args.options.visibleHistoryStartDateTime !== 'undefined',
|
|
59
|
-
includeAllHistory: !!args.options.includeAllHistory
|
|
62
|
+
includeAllHistory: !!args.options.includeAllHistory,
|
|
63
|
+
withAllHistory: !!args.options.withAllHistory
|
|
60
64
|
});
|
|
61
65
|
});
|
|
62
66
|
}, _TeamsChatMemberAddCommand_initOptions = function _TeamsChatMemberAddCommand_initOptions() {
|
|
@@ -73,6 +77,8 @@ _a = TeamsChatMemberAddCommand, _TeamsChatMemberAddCommand_instances = new WeakS
|
|
|
73
77
|
option: '--visibleHistoryStartDateTime [visibleHistoryStartDateTime]'
|
|
74
78
|
}, {
|
|
75
79
|
option: '--includeAllHistory'
|
|
80
|
+
}, {
|
|
81
|
+
option: '--withAllHistory'
|
|
76
82
|
});
|
|
77
83
|
}, _TeamsChatMemberAddCommand_initValidators = function _TeamsChatMemberAddCommand_initValidators() {
|
|
78
84
|
this.validators.push(async (args) => {
|
|
@@ -95,8 +101,8 @@ _a = TeamsChatMemberAddCommand, _TeamsChatMemberAddCommand_instances = new WeakS
|
|
|
95
101
|
});
|
|
96
102
|
}, _TeamsChatMemberAddCommand_initOptionSets = function _TeamsChatMemberAddCommand_initOptionSets() {
|
|
97
103
|
this.optionSets.push({ options: ['userId', 'userName'] }, {
|
|
98
|
-
options: ['visibleHistoryStartDateTime', 'includeAllHistory'],
|
|
99
|
-
runsWhen: (args) => args.options.visibleHistoryStartDateTime || args.options.includeAllHistory
|
|
104
|
+
options: ['visibleHistoryStartDateTime', 'includeAllHistory', 'withAllHistory'],
|
|
105
|
+
runsWhen: (args) => args.options.visibleHistoryStartDateTime || args.options.includeAllHistory || args.options.withAllHistory
|
|
100
106
|
});
|
|
101
107
|
};
|
|
102
108
|
TeamsChatMemberAddCommand.roles = ['owner', 'guest'];
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _VivaEngageCommunityRemoveCommand_instances, _VivaEngageCommunityRemoveCommand_initTelemetry, _VivaEngageCommunityRemoveCommand_initOptions, _VivaEngageCommunityRemoveCommand_initValidators, _VivaEngageCommunityRemoveCommand_initOptionSets, _VivaEngageCommunityRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { validation } from '../../../../utils/validation.js';
|
|
10
|
+
import { vivaEngage } from '../../../../utils/vivaEngage.js';
|
|
11
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
|
+
import commands from '../../commands.js';
|
|
13
|
+
class VivaEngageCommunityRemoveCommand extends GraphCommand {
|
|
14
|
+
get name() {
|
|
15
|
+
return commands.ENGAGE_COMMUNITY_REMOVE;
|
|
16
|
+
}
|
|
17
|
+
get description() {
|
|
18
|
+
return 'Removes a Viva Engage community';
|
|
19
|
+
}
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
_VivaEngageCommunityRemoveCommand_instances.add(this);
|
|
23
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initTelemetry).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initOptions).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initValidators).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initOptionSets).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initTypes).call(this);
|
|
28
|
+
}
|
|
29
|
+
async commandAction(logger, args) {
|
|
30
|
+
const removeCommunity = async () => {
|
|
31
|
+
try {
|
|
32
|
+
let communityId = args.options.id;
|
|
33
|
+
if (args.options.displayName) {
|
|
34
|
+
communityId = (await vivaEngage.getCommunityByDisplayName(args.options.displayName, ['id'])).id;
|
|
35
|
+
}
|
|
36
|
+
else if (args.options.entraGroupId) {
|
|
37
|
+
communityId = (await vivaEngage.getCommunityByEntraGroupId(args.options.entraGroupId, ['id'])).id;
|
|
38
|
+
}
|
|
39
|
+
if (args.options.verbose) {
|
|
40
|
+
await logger.logToStderr(`Removing Viva Engage community with ID ${communityId}...`);
|
|
41
|
+
}
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: `${this.resource}/v1.0/employeeExperience/communities/${communityId}`,
|
|
44
|
+
headers: {
|
|
45
|
+
accept: 'application/json;odata.metadata=none'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
await request.delete(requestOptions);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
this.handleRejectedODataJsonPromise(err);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
if (args.options.force) {
|
|
55
|
+
await removeCommunity();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove Viva Engage community '${args.options.id || args.options.displayName || args.options.entraGroupId}'?` });
|
|
59
|
+
if (result) {
|
|
60
|
+
await removeCommunity();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
_VivaEngageCommunityRemoveCommand_instances = new WeakSet(), _VivaEngageCommunityRemoveCommand_initTelemetry = function _VivaEngageCommunityRemoveCommand_initTelemetry() {
|
|
66
|
+
this.telemetry.push((args) => {
|
|
67
|
+
Object.assign(this.telemetryProperties, {
|
|
68
|
+
id: args.options.id !== 'undefined',
|
|
69
|
+
displayName: args.options.displayName !== 'undefined',
|
|
70
|
+
entraGroupId: args.options.entraGroupId !== 'undefined',
|
|
71
|
+
force: !!args.options.force
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}, _VivaEngageCommunityRemoveCommand_initOptions = function _VivaEngageCommunityRemoveCommand_initOptions() {
|
|
75
|
+
this.options.unshift({
|
|
76
|
+
option: '-i, --id [id]'
|
|
77
|
+
}, {
|
|
78
|
+
option: '-n, --displayName [displayName]'
|
|
79
|
+
}, {
|
|
80
|
+
option: '--entraGroupId [entraGroupId]'
|
|
81
|
+
}, {
|
|
82
|
+
option: '-f, --force'
|
|
83
|
+
});
|
|
84
|
+
}, _VivaEngageCommunityRemoveCommand_initValidators = function _VivaEngageCommunityRemoveCommand_initValidators() {
|
|
85
|
+
this.validators.push(async (args) => {
|
|
86
|
+
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
87
|
+
return `${args.options.entraGroupId} is not a valid GUID for the option 'entraGroupId'.`;
|
|
88
|
+
}
|
|
89
|
+
return true;
|
|
90
|
+
});
|
|
91
|
+
}, _VivaEngageCommunityRemoveCommand_initOptionSets = function _VivaEngageCommunityRemoveCommand_initOptionSets() {
|
|
92
|
+
this.optionSets.push({
|
|
93
|
+
options: ['id', 'displayName', 'entraGroupId']
|
|
94
|
+
});
|
|
95
|
+
}, _VivaEngageCommunityRemoveCommand_initTypes = function _VivaEngageCommunityRemoveCommand_initTypes() {
|
|
96
|
+
this.types.string.push('id', 'displayName', 'entraGroupId');
|
|
97
|
+
};
|
|
98
|
+
export default new VivaEngageCommunityRemoveCommand();
|
|
99
|
+
//# sourceMappingURL=engage-community-remove.js.map
|
|
@@ -24,6 +24,9 @@ class VivaEngageNetworkListCommand extends VivaEngageCommand {
|
|
|
24
24
|
__classPrivateFieldGet(this, _VivaEngageNetworkListCommand_instances, "m", _VivaEngageNetworkListCommand_initOptions).call(this);
|
|
25
25
|
}
|
|
26
26
|
async commandAction(logger, args) {
|
|
27
|
+
if (args.options.includeSuspended) {
|
|
28
|
+
await this.warn(logger, `Parameter 'includeSuspended' is deprecated. Please use 'withSuspended' instead`);
|
|
29
|
+
}
|
|
27
30
|
const requestOptions = {
|
|
28
31
|
url: `${this.resource}/v1/networks/current.json`,
|
|
29
32
|
headers: {
|
|
@@ -32,7 +35,7 @@ class VivaEngageNetworkListCommand extends VivaEngageCommand {
|
|
|
32
35
|
},
|
|
33
36
|
responseType: 'json',
|
|
34
37
|
data: {
|
|
35
|
-
includeSuspended: args.options.includeSuspended !== undefined && args.options.includeSuspended !== false
|
|
38
|
+
includeSuspended: (args.options.includeSuspended !== undefined && args.options.includeSuspended !== false) || (args.options.withSuspended !== undefined && args.options.withSuspended !== false)
|
|
36
39
|
}
|
|
37
40
|
};
|
|
38
41
|
try {
|
|
@@ -47,12 +50,15 @@ class VivaEngageNetworkListCommand extends VivaEngageCommand {
|
|
|
47
50
|
_VivaEngageNetworkListCommand_instances = new WeakSet(), _VivaEngageNetworkListCommand_initTelemetry = function _VivaEngageNetworkListCommand_initTelemetry() {
|
|
48
51
|
this.telemetry.push((args) => {
|
|
49
52
|
Object.assign(this.telemetryProperties, {
|
|
50
|
-
includeSuspended: args.options.includeSuspended
|
|
53
|
+
includeSuspended: args.options.includeSuspended,
|
|
54
|
+
withSuspended: args.options.withSuspended
|
|
51
55
|
});
|
|
52
56
|
});
|
|
53
57
|
}, _VivaEngageNetworkListCommand_initOptions = function _VivaEngageNetworkListCommand_initOptions() {
|
|
54
58
|
this.options.unshift({
|
|
55
59
|
option: '--includeSuspended'
|
|
60
|
+
}, {
|
|
61
|
+
option: '--withSuspended'
|
|
56
62
|
});
|
|
57
63
|
};
|
|
58
64
|
export default new VivaEngageNetworkListCommand();
|
|
@@ -4,6 +4,7 @@ export default {
|
|
|
4
4
|
ENGAGE_COMMUNITY_ADD: `${prefix} engage community add`,
|
|
5
5
|
ENGAGE_COMMUNITY_GET: `${prefix} engage community get`,
|
|
6
6
|
ENGAGE_COMMUNITY_LIST: `${prefix} engage community list`,
|
|
7
|
+
ENGAGE_COMMUNITY_REMOVE: `${prefix} engage community remove`,
|
|
7
8
|
ENGAGE_COMMUNITY_SET: `${prefix} engage community set`,
|
|
8
9
|
ENGAGE_COMMUNITY_USER_ADD: `${prefix} engage community user add`,
|
|
9
10
|
ENGAGE_COMMUNITY_USER_LIST: `${prefix} engage community user list`,
|
package/dist/utils/md.js
CHANGED
|
@@ -13,8 +13,8 @@ function convertHeadings(md) {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
function convertAdmonitions(md) {
|
|
16
|
-
const regex = new RegExp(
|
|
17
|
-
return md.replace(regex, (_, label, title, content) => label.toLocaleUpperCase() + (title ? EOL + EOL + title : '') + EOL + EOL + content.trim());
|
|
16
|
+
const regex = new RegExp(/^([ \t]*):::(\w+)(?:\[([^\]]+)\])?([\s\S]*?)^\1:::$/, 'gm');
|
|
17
|
+
return md.replace(regex, (_, indent, label, title, content) => indent + label.toLocaleUpperCase() + (title ? EOL + EOL + indent + title : '') + EOL + EOL + indent + content.trim());
|
|
18
18
|
}
|
|
19
19
|
function includeContent(md, rootFolder) {
|
|
20
20
|
const mdxImports = [
|
|
@@ -49,7 +49,7 @@ function convertHyperlinks(md) {
|
|
|
49
49
|
function convertContentTabs(md) {
|
|
50
50
|
return md
|
|
51
51
|
.replace(/<TabItem value="([^"]+)">/gm, '$1')
|
|
52
|
-
.replace(
|
|
52
|
+
.replace(/.*\n?<\/?(Tabs|TabItem)>.*\n?/g, '')
|
|
53
53
|
.replace(/```(?:\w+)?\s*([\s\S]*?)\s*```/g, '$1')
|
|
54
54
|
.trim();
|
|
55
55
|
}
|