@pnp/cli-microsoft365 12.1.0-beta.dbc076e → 12.1.0-beta.f55735f
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/spfx/commands/package/package-generate.js +30 -51
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +27 -62
- package/dist/m365/spfx/commands/project/project-doctor.js +20 -51
- package/dist/m365/spfx/commands/project/project-externalize.js +16 -26
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +28 -65
- package/dist/m365/spfx/commands/project/project-permissions-grant.js +4 -2
- package/dist/m365/spfx/commands/project/project-rename.js +17 -29
- package/dist/m365/spfx/commands/project/project-upgrade.js +0 -3
- package/dist/m365/spfx/commands/spfx-doctor.js +23 -47
- package/dist/m365/spo/commands/file/file-add.js +51 -77
- package/dist/m365/spo/commands/file/file-archive.js +1 -1
- package/dist/m365/spo/commands/file/file-checkin.js +35 -64
- package/dist/m365/spo/commands/file/file-checkout-undo.js +25 -49
- package/dist/m365/spo/commands/file/file-checkout.js +24 -47
- package/dist/m365/spo/commands/file/file-copy.js +37 -68
- package/dist/m365/spo/commands/file/file-get.js +44 -79
- package/dist/m365/spo/commands/file/file-list.js +16 -39
- package/dist/m365/spo/commands/file/file-move.js +30 -68
- package/dist/m365/spo/commands/file/file-remove.js +27 -56
- package/dist/m365/spo/commands/file/file-rename.js +15 -36
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +26 -51
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +25 -50
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +47 -75
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +39 -70
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +26 -52
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +25 -49
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +24 -47
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +46 -70
- package/dist/m365/spo/commands/file/file-sharinglink-clear.js +33 -57
- package/dist/m365/spo/commands/file/file-sharinglink-get.js +25 -47
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +32 -53
- package/dist/m365/spo/commands/file/file-sharinglink-remove.js +26 -51
- package/dist/m365/spo/commands/file/file-sharinglink-set.js +29 -55
- package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
- package/dist/m365/spo/commands/file/file-version-clear.js +25 -45
- package/dist/m365/spo/commands/file/file-version-get.js +25 -43
- package/dist/m365/spo/commands/file/file-version-keep.js +1 -1
- package/dist/m365/spo/commands/file/file-version-list.js +24 -41
- package/dist/m365/spo/commands/file/file-version-remove.js +26 -47
- package/dist/m365/spo/commands/file/file-version-restore.js +26 -47
- package/dist/m365/spo/commands/folder/folder-add.js +19 -48
- package/dist/m365/spo/commands/folder/folder-copy.js +36 -62
- package/dist/m365/spo/commands/folder/folder-get.js +30 -51
- package/dist/m365/spo/commands/folder/folder-list.js +16 -39
- package/dist/m365/spo/commands/folder/folder-move.js +36 -62
- package/dist/m365/spo/commands/folder/folder-remove.js +15 -36
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +30 -48
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +30 -50
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +49 -79
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +37 -67
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +15 -36
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +14 -33
- package/dist/m365/spo/commands/folder/folder-set.js +28 -48
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +58 -86
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +33 -50
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +33 -42
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +32 -47
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +34 -41
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +38 -43
- package/dist/m365/spo/commands/page/page-add.js +31 -68
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +74 -101
- package/dist/m365/spo/commands/page/page-column-get.js +15 -32
- package/dist/m365/spo/commands/page/page-column-list.js +14 -27
- package/dist/m365/spo/commands/page/page-control-get.js +18 -27
- package/dist/m365/spo/commands/page/page-control-list.js +13 -20
- package/dist/m365/spo/commands/page/page-control-remove.js +1 -1
- package/dist/m365/spo/commands/page/page-control-set.js +51 -61
- package/dist/m365/spo/commands/page/page-copy.js +15 -31
- package/dist/m365/spo/commands/page/page-header-set.js +25 -89
- package/dist/m365/spo/commands/page/page-list.js +12 -18
- package/dist/m365/spo/commands/page/page-remove.js +16 -39
- package/dist/m365/spo/commands/page/page-section-add.js +108 -173
- package/dist/m365/spo/commands/page/page-section-get.js +17 -27
- package/dist/m365/spo/commands/page/page-section-list.js +13 -20
- package/dist/m365/spo/commands/page/page-section-remove.js +4 -1
- package/dist/m365/spo/commands/page/page-set.js +50 -100
- package/dist/m365/spo/commands/page/page-template-list.js +12 -18
- package/dist/m365/spo/commands/page/page-text-add.js +23 -45
- package/dist/m365/viva/commands/connections/connections-app-create.js +36 -42
- package/dist/m365/viva/commands/engage/engage-community-add.js +75 -71
- package/dist/m365/viva/commands/engage/engage-community-get.js +8 -16
- package/dist/m365/viva/commands/engage/engage-community-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-community-remove.js +28 -48
- package/dist/m365/viva/commands/engage/engage-community-set.js +43 -66
- package/dist/m365/viva/commands/engage/engage-community-user-add.js +7 -12
- package/dist/m365/viva/commands/engage/engage-community-user-list.js +1 -1
- package/dist/m365/viva/commands/engage/engage-community-user-remove.js +4 -2
- package/dist/m365/viva/commands/engage/engage-message-add.js +22 -52
- package/dist/m365/viva/commands/engage/engage-message-get.js +8 -23
- package/dist/m365/viva/commands/engage/engage-message-like-set.js +10 -39
- package/dist/m365/viva/commands/engage/engage-message-list.js +22 -66
- package/dist/m365/viva/commands/engage/engage-message-remove.js +9 -32
- package/dist/m365/viva/commands/engage/engage-network-list.js +8 -22
- package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +2 -1
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +2 -1
- package/dist/m365/viva/commands/engage/engage-role-list.js +5 -0
- package/dist/m365/viva/commands/engage/engage-role-member-add.js +3 -5
- package/dist/m365/viva/commands/engage/engage-role-member-list.js +1 -1
- package/dist/m365/viva/commands/engage/engage-role-member-remove.js +4 -2
- package/dist/m365/viva/commands/engage/engage-search.js +16 -65
- package/dist/m365/viva/commands/engage/engage-user-get.js +15 -33
- package/dist/m365/viva/commands/engage/engage-user-list.js +22 -57
- package/docs/docs/cmd/spo/listitem/listitem-record-declare.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-lock.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-undeclare.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-unlock.mdx +21 -0
- package/docs/docs/cmd/spo/page/page-text-add.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-community-add.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-get.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-community-set.mdx +19 -0
- package/package.json +1 -1
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
|
|
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 _SpoPageSectionGetCommand_instances, _SpoPageSectionGetCommand_initOptions, _SpoPageSectionGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
11
7
|
import { Page } from './Page.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
})
|
|
14
|
+
.alias('u'),
|
|
15
|
+
pageName: z.string().alias('n'),
|
|
16
|
+
section: z.number()
|
|
17
|
+
.int()
|
|
18
|
+
.min(1, { error: 'The value of parameter section must be 1 or higher' })
|
|
19
|
+
.alias('s')
|
|
20
|
+
});
|
|
12
21
|
class SpoPageSectionGetCommand extends SpoCommand {
|
|
13
22
|
get name() {
|
|
14
23
|
return commands.PAGE_SECTION_GET;
|
|
@@ -16,11 +25,8 @@ class SpoPageSectionGetCommand extends SpoCommand {
|
|
|
16
25
|
get description() {
|
|
17
26
|
return 'Gets information about the specified modern page section';
|
|
18
27
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoPageSectionGetCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoPageSectionGetCommand_instances, "m", _SpoPageSectionGetCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoPageSectionGetCommand_instances, "m", _SpoPageSectionGetCommand_initValidators).call(this);
|
|
28
|
+
get schema() {
|
|
29
|
+
return options;
|
|
24
30
|
}
|
|
25
31
|
async commandAction(logger, args) {
|
|
26
32
|
try {
|
|
@@ -37,21 +43,5 @@ class SpoPageSectionGetCommand extends SpoCommand {
|
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
}
|
|
40
|
-
_SpoPageSectionGetCommand_instances = new WeakSet(), _SpoPageSectionGetCommand_initOptions = function _SpoPageSectionGetCommand_initOptions() {
|
|
41
|
-
this.options.unshift({
|
|
42
|
-
option: '-u, --webUrl <webUrl>'
|
|
43
|
-
}, {
|
|
44
|
-
option: '-n, --pageName <pageName>'
|
|
45
|
-
}, {
|
|
46
|
-
option: '-s, --section <section>'
|
|
47
|
-
});
|
|
48
|
-
}, _SpoPageSectionGetCommand_initValidators = function _SpoPageSectionGetCommand_initValidators() {
|
|
49
|
-
this.validators.push(async (args) => {
|
|
50
|
-
if (isNaN(args.options.section)) {
|
|
51
|
-
return `${args.options.section} is not a number`;
|
|
52
|
-
}
|
|
53
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
46
|
export default new SpoPageSectionGetCommand();
|
|
57
47
|
//# sourceMappingURL=page-section-get.js.map
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
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 _SpoPageSectionListCommand_instances, _SpoPageSectionListCommand_initOptions, _SpoPageSectionListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
11
7
|
import { Page } from './Page.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
})
|
|
14
|
+
.alias('u'),
|
|
15
|
+
pageName: z.string().alias('n')
|
|
16
|
+
});
|
|
12
17
|
class SpoPageSectionListCommand extends SpoCommand {
|
|
13
18
|
get name() {
|
|
14
19
|
return commands.PAGE_SECTION_LIST;
|
|
@@ -16,11 +21,8 @@ class SpoPageSectionListCommand extends SpoCommand {
|
|
|
16
21
|
get description() {
|
|
17
22
|
return 'Lists sections in the specific modern page';
|
|
18
23
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoPageSectionListCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoPageSectionListCommand_instances, "m", _SpoPageSectionListCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoPageSectionListCommand_instances, "m", _SpoPageSectionListCommand_initValidators).call(this);
|
|
24
|
+
get schema() {
|
|
25
|
+
return options;
|
|
24
26
|
}
|
|
25
27
|
async commandAction(logger, args) {
|
|
26
28
|
try {
|
|
@@ -49,14 +51,5 @@ class SpoPageSectionListCommand extends SpoCommand {
|
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
_SpoPageSectionListCommand_instances = new WeakSet(), _SpoPageSectionListCommand_initOptions = function _SpoPageSectionListCommand_initOptions() {
|
|
53
|
-
this.options.unshift({
|
|
54
|
-
option: '-u, --webUrl <webUrl>'
|
|
55
|
-
}, {
|
|
56
|
-
option: '-n, --pageName <pageName>'
|
|
57
|
-
});
|
|
58
|
-
}, _SpoPageSectionListCommand_initValidators = function _SpoPageSectionListCommand_initValidators() {
|
|
59
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
60
|
-
};
|
|
61
54
|
export default new SpoPageSectionListCommand();
|
|
62
55
|
//# sourceMappingURL=page-section-list.js.map
|
|
@@ -16,7 +16,10 @@ export const options = z.strictObject({
|
|
|
16
16
|
})
|
|
17
17
|
.alias('u'),
|
|
18
18
|
pageName: z.string().alias('n'),
|
|
19
|
-
section: z.number()
|
|
19
|
+
section: z.number()
|
|
20
|
+
.int()
|
|
21
|
+
.min(1, { error: 'The value of parameter section must be 1 or higher' })
|
|
22
|
+
.alias('s'),
|
|
20
23
|
force: z.boolean().optional().alias('f')
|
|
21
24
|
});
|
|
22
25
|
class SpoPageSectionRemoveCommand extends SpoCommand {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
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 _SpoPageSetCommand_instances, _SpoPageSetCommand_initTelemetry, _SpoPageSetCommand_initOptions, _SpoPageSetCommand_initTypes, _SpoPageSetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { Auth } from '../../../../Auth.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -13,6 +9,37 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
13
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
14
10
|
import commands from '../../commands.js';
|
|
15
11
|
import { Page, supportedPageLayouts, supportedPromoteAs } from './Page.js';
|
|
12
|
+
export const options = z.strictObject({
|
|
13
|
+
...globalOptionsZod.shape,
|
|
14
|
+
webUrl: z.string()
|
|
15
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
16
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
17
|
+
})
|
|
18
|
+
.alias('u'),
|
|
19
|
+
name: z.string().alias('n'),
|
|
20
|
+
layoutType: z.enum(supportedPageLayouts).optional().alias('l'),
|
|
21
|
+
promoteAs: z.enum(supportedPromoteAs).optional().alias('p'),
|
|
22
|
+
demoteFrom: z.enum(['NewsPage']).optional(),
|
|
23
|
+
commentsEnabled: z.boolean().optional().autocomplete(['true', 'false']),
|
|
24
|
+
publish: z.boolean().optional(),
|
|
25
|
+
publishMessage: z.string().optional(),
|
|
26
|
+
description: z.string().optional(),
|
|
27
|
+
title: z.string().optional(),
|
|
28
|
+
content: z.string()
|
|
29
|
+
.refine(content => {
|
|
30
|
+
try {
|
|
31
|
+
JSON.parse(content);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
error: 'Specified content is not a valid JSON string.'
|
|
39
|
+
})
|
|
40
|
+
.optional(),
|
|
41
|
+
isRetired: z.boolean().optional().autocomplete(['true', 'false'])
|
|
42
|
+
});
|
|
16
43
|
class SpoPageSetCommand extends SpoCommand {
|
|
17
44
|
get name() {
|
|
18
45
|
return commands.PAGE_SET;
|
|
@@ -20,13 +47,23 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
20
47
|
get description() {
|
|
21
48
|
return 'Updates modern page properties';
|
|
22
49
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
50
|
+
get schema() {
|
|
51
|
+
return options;
|
|
52
|
+
}
|
|
53
|
+
getRefinedSchema(schema) {
|
|
54
|
+
return schema
|
|
55
|
+
.refine(opts => !!(opts.layoutType || opts.promoteAs || opts.demoteFrom || opts.commentsEnabled !== undefined ||
|
|
56
|
+
opts.publish || opts.description || opts.title || opts.content || opts.isRetired !== undefined), {
|
|
57
|
+
error: 'Specify at least one option to update.'
|
|
58
|
+
})
|
|
59
|
+
.refine(opts => opts.promoteAs !== 'HomePage' || opts.layoutType === 'Home', {
|
|
60
|
+
error: 'You can only promote home pages as site home page',
|
|
61
|
+
path: ['promoteAs']
|
|
62
|
+
})
|
|
63
|
+
.refine(opts => opts.promoteAs !== 'NewsPage' || !opts.layoutType || opts.layoutType === 'Article', {
|
|
64
|
+
error: 'You can only promote article pages as news article',
|
|
65
|
+
path: ['promoteAs']
|
|
66
|
+
});
|
|
30
67
|
}
|
|
31
68
|
async commandAction(logger, args) {
|
|
32
69
|
const resource = Auth.getResourceFromUrl(args.options.webUrl);
|
|
@@ -231,92 +268,5 @@ class SpoPageSetCommand extends SpoCommand {
|
|
|
231
268
|
}
|
|
232
269
|
}
|
|
233
270
|
}
|
|
234
|
-
_SpoPageSetCommand_instances = new WeakSet(), _SpoPageSetCommand_initTelemetry = function _SpoPageSetCommand_initTelemetry() {
|
|
235
|
-
this.telemetry.push((args) => {
|
|
236
|
-
Object.assign(this.telemetryProperties, {
|
|
237
|
-
layoutType: args.options.layoutType || false,
|
|
238
|
-
promoteAs: args.options.promoteAs || false,
|
|
239
|
-
demotefrom: args.options.demoteFrom || false,
|
|
240
|
-
commentsEnabled: args.options.commentsEnabled || false,
|
|
241
|
-
publish: args.options.publish || false,
|
|
242
|
-
publishMessage: typeof args.options.publishMessage !== 'undefined',
|
|
243
|
-
description: typeof args.options.description !== 'undefined',
|
|
244
|
-
title: typeof args.options.title !== 'undefined',
|
|
245
|
-
content: typeof args.options.content !== 'undefined',
|
|
246
|
-
isRetired: typeof args.options.isRetired !== 'undefined'
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
}, _SpoPageSetCommand_initOptions = function _SpoPageSetCommand_initOptions() {
|
|
250
|
-
this.options.unshift({
|
|
251
|
-
option: '-n, --name <name>'
|
|
252
|
-
}, {
|
|
253
|
-
option: '-u, --webUrl <webUrl>'
|
|
254
|
-
}, {
|
|
255
|
-
option: '-l, --layoutType [layoutType]',
|
|
256
|
-
autocomplete: supportedPageLayouts
|
|
257
|
-
}, {
|
|
258
|
-
option: '-p, --promoteAs [promoteAs]',
|
|
259
|
-
autocomplete: supportedPromoteAs
|
|
260
|
-
}, {
|
|
261
|
-
option: '--demoteFrom [demoteFrom]',
|
|
262
|
-
autocomplete: ['NewsPage']
|
|
263
|
-
}, {
|
|
264
|
-
option: '--commentsEnabled [commentsEnabled]',
|
|
265
|
-
autocomplete: ['true', 'false']
|
|
266
|
-
}, {
|
|
267
|
-
option: '--publish'
|
|
268
|
-
}, {
|
|
269
|
-
option: '--publishMessage [publishMessage]'
|
|
270
|
-
}, {
|
|
271
|
-
option: '--description [description]'
|
|
272
|
-
}, {
|
|
273
|
-
option: '--title [title]'
|
|
274
|
-
}, {
|
|
275
|
-
option: '--content [content]'
|
|
276
|
-
}, {
|
|
277
|
-
option: '--isRetired [isRetired]',
|
|
278
|
-
autocomplete: ['true', 'false']
|
|
279
|
-
});
|
|
280
|
-
}, _SpoPageSetCommand_initTypes = function _SpoPageSetCommand_initTypes() {
|
|
281
|
-
this.types.boolean.push('commentsEnabled', 'isRetired');
|
|
282
|
-
}, _SpoPageSetCommand_initValidators = function _SpoPageSetCommand_initValidators() {
|
|
283
|
-
this.validators.push(async (args) => {
|
|
284
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
285
|
-
if (isValidSharePointUrl !== true) {
|
|
286
|
-
return isValidSharePointUrl;
|
|
287
|
-
}
|
|
288
|
-
if (!args.options.layoutType && !args.options.promoteAs && !args.options.demoteFrom && args.options.commentsEnabled === undefined &&
|
|
289
|
-
!args.options.publish && !args.options.description && !args.options.title && !args.options.content && args.options.isRetired === undefined) {
|
|
290
|
-
return 'Specify at least one option to update.';
|
|
291
|
-
}
|
|
292
|
-
if (args.options.layoutType &&
|
|
293
|
-
supportedPageLayouts.indexOf(args.options.layoutType) < 0) {
|
|
294
|
-
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values ${supportedPageLayouts.join(', ')}`;
|
|
295
|
-
}
|
|
296
|
-
if (args.options.promoteAs &&
|
|
297
|
-
supportedPromoteAs.indexOf(args.options.promoteAs) < 0) {
|
|
298
|
-
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values ${supportedPromoteAs.join(', ')}`;
|
|
299
|
-
}
|
|
300
|
-
if (args.options.demoteFrom &&
|
|
301
|
-
args.options.demoteFrom !== 'NewsPage') {
|
|
302
|
-
return `${args.options.demoteFrom} is not a valid option for demoteFrom. The only allowed value is 'NewsPage'`;
|
|
303
|
-
}
|
|
304
|
-
if (args.options.promoteAs === 'HomePage' && args.options.layoutType !== 'Home') {
|
|
305
|
-
return 'You can only promote home pages as site home page';
|
|
306
|
-
}
|
|
307
|
-
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType && args.options.layoutType !== 'Article') {
|
|
308
|
-
return 'You can only promote article pages as news article';
|
|
309
|
-
}
|
|
310
|
-
if (args.options.content) {
|
|
311
|
-
try {
|
|
312
|
-
JSON.parse(args.options.content);
|
|
313
|
-
}
|
|
314
|
-
catch (e) {
|
|
315
|
-
return `Specified content is not a valid JSON string. Input: ${args.options.content}. Error: ${e}`;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return true;
|
|
319
|
-
});
|
|
320
|
-
};
|
|
321
271
|
export default new SpoPageSetCommand();
|
|
322
272
|
//# sourceMappingURL=page-set.js.map
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoPageTemplateListCommand_instances, _SpoPageTemplateListCommand_initOptions, _SpoPageTemplateListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { odata } from '../../../../utils/odata.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string()
|
|
10
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
|
+
})
|
|
13
|
+
.alias('u')
|
|
14
|
+
});
|
|
11
15
|
class SpoPageTemplateListCommand extends SpoCommand {
|
|
12
16
|
get name() {
|
|
13
17
|
return commands.PAGE_TEMPLATE_LIST;
|
|
@@ -18,11 +22,8 @@ class SpoPageTemplateListCommand extends SpoCommand {
|
|
|
18
22
|
defaultProperties() {
|
|
19
23
|
return ['Title', 'FileName', 'Id', 'PageLayoutType', 'Url'];
|
|
20
24
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_SpoPageTemplateListCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoPageTemplateListCommand_instances, "m", _SpoPageTemplateListCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoPageTemplateListCommand_instances, "m", _SpoPageTemplateListCommand_initValidators).call(this);
|
|
25
|
+
get schema() {
|
|
26
|
+
return options;
|
|
26
27
|
}
|
|
27
28
|
async commandAction(logger, args) {
|
|
28
29
|
if (this.verbose) {
|
|
@@ -42,12 +43,5 @@ class SpoPageTemplateListCommand extends SpoCommand {
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
_SpoPageTemplateListCommand_instances = new WeakSet(), _SpoPageTemplateListCommand_initOptions = function _SpoPageTemplateListCommand_initOptions() {
|
|
46
|
-
this.options.unshift({
|
|
47
|
-
option: '-u, --webUrl <webUrl>'
|
|
48
|
-
});
|
|
49
|
-
}, _SpoPageTemplateListCommand_initValidators = function _SpoPageTemplateListCommand_initValidators() {
|
|
50
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
51
|
-
};
|
|
52
46
|
export default new SpoPageTemplateListCommand();
|
|
53
47
|
//# sourceMappingURL=page-template-list.js.map
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoPageTextAddCommand_instances, _SpoPageTextAddCommand_initTelemetry, _SpoPageTextAddCommand_initOptions, _SpoPageTextAddCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { spo } from '../../../../utils/spo.js';
|
|
9
5
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -12,6 +8,25 @@ import SpoCommand from '../../../base/SpoCommand.js';
|
|
|
12
8
|
import commands from '../../commands.js';
|
|
13
9
|
import { CanvasSection, ClientSideText } from './clientsidepages.js';
|
|
14
10
|
import { Page } from './Page.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
webUrl: z.string()
|
|
14
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
15
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
16
|
+
})
|
|
17
|
+
.alias('u'),
|
|
18
|
+
pageName: z.string().alias('n'),
|
|
19
|
+
text: z.string().alias('t'),
|
|
20
|
+
section: z.number()
|
|
21
|
+
.int()
|
|
22
|
+
.min(1, { error: 'The value of parameter section must be 1 or higher' })
|
|
23
|
+
.optional(),
|
|
24
|
+
column: z.number()
|
|
25
|
+
.int()
|
|
26
|
+
.min(1, { error: 'The value of parameter column must be 1 or higher' })
|
|
27
|
+
.optional(),
|
|
28
|
+
order: z.number().int().min(1, { error: 'The value of parameter order must be 1 or higher' }).optional()
|
|
29
|
+
});
|
|
15
30
|
class SpoPageTextAddCommand extends SpoCommand {
|
|
16
31
|
get name() {
|
|
17
32
|
return commands.PAGE_TEXT_ADD;
|
|
@@ -19,12 +34,8 @@ class SpoPageTextAddCommand extends SpoCommand {
|
|
|
19
34
|
get description() {
|
|
20
35
|
return 'Adds text to a modern page';
|
|
21
36
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_SpoPageTextAddCommand_instances.add(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoPageTextAddCommand_instances, "m", _SpoPageTextAddCommand_initTelemetry).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoPageTextAddCommand_instances, "m", _SpoPageTextAddCommand_initOptions).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpoPageTextAddCommand_instances, "m", _SpoPageTextAddCommand_initValidators).call(this);
|
|
37
|
+
get schema() {
|
|
38
|
+
return options;
|
|
28
39
|
}
|
|
29
40
|
async commandAction(logger, args) {
|
|
30
41
|
let pageName = args.options.pageName;
|
|
@@ -100,38 +111,5 @@ class SpoPageTextAddCommand extends SpoCommand {
|
|
|
100
111
|
return request.post(requestOptions);
|
|
101
112
|
}
|
|
102
113
|
}
|
|
103
|
-
_SpoPageTextAddCommand_instances = new WeakSet(), _SpoPageTextAddCommand_initTelemetry = function _SpoPageTextAddCommand_initTelemetry() {
|
|
104
|
-
this.telemetry.push((args) => {
|
|
105
|
-
Object.assign(this.telemetryProperties, {
|
|
106
|
-
section: typeof args.options.section !== 'undefined',
|
|
107
|
-
column: typeof args.options.column !== 'undefined',
|
|
108
|
-
order: typeof args.options.order !== 'undefined'
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
}, _SpoPageTextAddCommand_initOptions = function _SpoPageTextAddCommand_initOptions() {
|
|
112
|
-
this.options.unshift({
|
|
113
|
-
option: '-u, --webUrl <webUrl>'
|
|
114
|
-
}, {
|
|
115
|
-
option: '-n, --pageName <pageName>'
|
|
116
|
-
}, {
|
|
117
|
-
option: '-t, --text <text>'
|
|
118
|
-
}, {
|
|
119
|
-
option: '--section [section]'
|
|
120
|
-
}, {
|
|
121
|
-
option: '--column [column]'
|
|
122
|
-
}, {
|
|
123
|
-
option: '--order [order]'
|
|
124
|
-
});
|
|
125
|
-
}, _SpoPageTextAddCommand_initValidators = function _SpoPageTextAddCommand_initValidators() {
|
|
126
|
-
this.validators.push(async (args) => {
|
|
127
|
-
if (args.options.section && (!Number.isInteger(args.options.section) || args.options.section < 1)) {
|
|
128
|
-
return 'The value of parameter section must be 1 or higher';
|
|
129
|
-
}
|
|
130
|
-
if (args.options.column && (!Number.isInteger(args.options.column) || args.options.column < 1)) {
|
|
131
|
-
return 'The value of parameter column must be 1 or higher';
|
|
132
|
-
}
|
|
133
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
114
|
export default new SpoPageTextAddCommand();
|
|
137
115
|
//# sourceMappingURL=page-text-add.js.map
|
|
@@ -1,16 +1,31 @@
|
|
|
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 _VivaConnectionsAppCreateCommand_instances, _VivaConnectionsAppCreateCommand_initOptions, _VivaConnectionsAppCreateCommand_initValidators;
|
|
7
1
|
import AdmZip from 'adm-zip';
|
|
8
2
|
import fs from 'fs';
|
|
9
3
|
import path from 'path';
|
|
10
4
|
import { v4 } from 'uuid';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
11
7
|
import AnonymousCommand from '../../../base/AnonymousCommand.js';
|
|
12
8
|
import commands from '../../commands.js';
|
|
13
9
|
import { spo } from '../../../../utils/spo.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
portalUrl: z.string(),
|
|
13
|
+
name: z.string().max(30, { message: 'App name must not exceed 30 characters' }),
|
|
14
|
+
description: z.string().max(80, { message: 'Description must not exceed 80 characters' }),
|
|
15
|
+
longDescription: z.string().max(4000, { message: 'Long description must not exceed 4000 characters' }),
|
|
16
|
+
privacyPolicyUrl: z.string().optional(),
|
|
17
|
+
termsOfUseUrl: z.string().optional(),
|
|
18
|
+
companyName: z.string(),
|
|
19
|
+
companyWebsiteUrl: z.string(),
|
|
20
|
+
coloredIconPath: z.string().refine(val => fs.existsSync(path.resolve(val)), {
|
|
21
|
+
error: e => `File ${path.resolve(e.input)} doesn't exist`
|
|
22
|
+
}),
|
|
23
|
+
outlineIconPath: z.string().refine(val => fs.existsSync(path.resolve(val)), {
|
|
24
|
+
error: e => `File ${path.resolve(e.input)} doesn't exist`
|
|
25
|
+
}),
|
|
26
|
+
accentColor: z.string().optional(),
|
|
27
|
+
force: z.boolean().optional()
|
|
28
|
+
});
|
|
14
29
|
class VivaConnectionsAppCreateCommand extends AnonymousCommand {
|
|
15
30
|
get name() {
|
|
16
31
|
return commands.CONNECTIONS_APP_CREATE;
|
|
@@ -18,11 +33,20 @@ class VivaConnectionsAppCreateCommand extends AnonymousCommand {
|
|
|
18
33
|
get description() {
|
|
19
34
|
return 'Creates Viva Connections app';
|
|
20
35
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
get schema() {
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
getRefinedSchema(schema) {
|
|
40
|
+
return schema
|
|
41
|
+
.superRefine((opts, ctx) => {
|
|
42
|
+
const appFilePath = path.resolve(`${opts.name}.zip`);
|
|
43
|
+
if (fs.existsSync(appFilePath) && !opts.force) {
|
|
44
|
+
ctx.addIssue({
|
|
45
|
+
message: `File ${path.resolve(`${opts.name}.zip`)} already exists. Delete the file or use the --force option to overwrite the existing file`,
|
|
46
|
+
code: z.ZodIssueCode.custom
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
26
50
|
}
|
|
27
51
|
async commandAction(logger, args) {
|
|
28
52
|
try {
|
|
@@ -133,40 +157,10 @@ class VivaConnectionsAppCreateCommand extends AnonymousCommand {
|
|
|
133
157
|
}
|
|
134
158
|
async getWeb(args, logger) {
|
|
135
159
|
if (this.verbose) {
|
|
136
|
-
await logger.logToStderr(`Checking if site ${args.options.
|
|
160
|
+
await logger.logToStderr(`Checking if site ${args.options.portalUrl} exists...`);
|
|
137
161
|
}
|
|
138
162
|
return await spo.getWeb(args.options.portalUrl, logger, this.verbose);
|
|
139
163
|
}
|
|
140
164
|
}
|
|
141
|
-
_VivaConnectionsAppCreateCommand_instances = new WeakSet(), _VivaConnectionsAppCreateCommand_initOptions = function _VivaConnectionsAppCreateCommand_initOptions() {
|
|
142
|
-
this.options.unshift({ option: '--portalUrl <portalUrl>' }, { option: '--name <name>' }, { option: '--description <description>' }, { option: '--longDescription <longDescription>' }, { option: '--privacyPolicyUrl [privacyPolicyUrl]' }, { option: '--termsOfUseUrl [termsOfUseUrl]' }, { option: '--companyName <companyName>' }, { option: '--companyWebsiteUrl <companyWebsiteUrl>' }, { option: '--coloredIconPath <coloredIconPath>' }, { option: '--outlineIconPath <outlineIconPath>' }, { option: '--accentColor [accentColor]' }, { option: '--force' });
|
|
143
|
-
}, _VivaConnectionsAppCreateCommand_initValidators = function _VivaConnectionsAppCreateCommand_initValidators() {
|
|
144
|
-
this.validators.push(async (args) => {
|
|
145
|
-
if (args.options.name.length > 30) {
|
|
146
|
-
return `App name must not exceed 30 characters`;
|
|
147
|
-
}
|
|
148
|
-
if (args.options.description &&
|
|
149
|
-
args.options.description.length > 80) {
|
|
150
|
-
return 'Description must not exceed 80 characters';
|
|
151
|
-
}
|
|
152
|
-
if (args.options.longDescription &&
|
|
153
|
-
args.options.longDescription.length > 4000) {
|
|
154
|
-
return 'Long description must not exceed 4000 characters';
|
|
155
|
-
}
|
|
156
|
-
const appFilePath = path.resolve(`${args.options.name}.zip`);
|
|
157
|
-
if (fs.existsSync(appFilePath) && !args.options.force) {
|
|
158
|
-
return `File ${appFilePath} already exists. Delete the file or use the --force option to overwrite the existing file`;
|
|
159
|
-
}
|
|
160
|
-
const coloredIconPath = path.resolve(args.options.coloredIconPath);
|
|
161
|
-
if (!fs.existsSync(coloredIconPath)) {
|
|
162
|
-
return `File ${coloredIconPath} doesn't exist`;
|
|
163
|
-
}
|
|
164
|
-
const outlineIconPath = path.resolve(args.options.outlineIconPath);
|
|
165
|
-
if (!fs.existsSync(outlineIconPath)) {
|
|
166
|
-
return `File ${outlineIconPath} doesn't exist`;
|
|
167
|
-
}
|
|
168
|
-
return true;
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
165
|
export default new VivaConnectionsAppCreateCommand();
|
|
172
166
|
//# sourceMappingURL=connections-app-create.js.map
|