@pnp/cli-microsoft365 12.0.0-beta.0be7d8d → 12.0.0-beta.10c5833
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/Auth.js +2 -6
- package/dist/auth/FileTokenStorage.js +0 -3
- package/dist/auth/msalCachePlugin.js +201 -12
- package/dist/m365/commands/logout.js +2 -4
- package/dist/m365/entra/commands/m365group/m365group-remove.js +4 -3
- package/dist/m365/spe/commands/container/container-remove.js +6 -7
- package/dist/m365/spo/commands/file/file-archive.js +1 -1
- package/dist/m365/spo/commands/file/file-remove.js +5 -5
- package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
- package/dist/m365/spo/commands/folder/folder-archive.js +1 -1
- package/dist/m365/spo/commands/folder/folder-remove.js +5 -5
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +5 -0
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +8 -26
- package/dist/m365/spo/commands/homesite/homesite-list.js +5 -0
- package/dist/m365/spo/commands/list/list-remove.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +5 -4
- package/dist/m365/spo/commands/listitem/listitem-remove.js +8 -5
- package/dist/m365/spo/commands/page/page-remove.js +7 -7
- package/dist/m365/spo/commands/site/site-list.js +60 -49
- package/dist/m365/spo/commands/site/site-remove.js +7 -7
- package/dist/m365/spo/commands/spo-get.js +5 -0
- package/dist/m365/spo/commands/spo-set.js +10 -21
- package/dist/m365/spo/commands/storageentity/storageentity-get.js +23 -17
- package/dist/m365/spo/commands/storageentity/storageentity-list.js +39 -36
- package/dist/m365/spo/commands/storageentity/storageentity-remove.js +26 -33
- package/dist/m365/spo/commands/storageentity/storageentity-set.js +26 -36
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
- package/dist/m365/spo/commands/user/user-ensure.js +24 -60
- package/dist/m365/spo/commands/user/user-get.js +25 -65
- package/dist/m365/spo/commands/user/user-list.js +10 -18
- package/dist/m365/spo/commands/user/user-remove.js +26 -68
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +10 -23
- package/dist/m365/spo/commands/userprofile/userprofile-set.js +10 -19
- package/dist/m365/spo/commands/web/web-add.js +20 -55
- package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +10 -18
- package/dist/m365/spo/commands/web/web-get.js +12 -30
- package/dist/m365/spo/commands/web/web-installedlanguage-list.js +10 -18
- package/dist/m365/spo/commands/web/web-list.js +10 -18
- package/dist/m365/spo/commands/web/web-reindex.js +10 -18
- package/dist/m365/spo/commands/web/web-remove.js +11 -27
- package/dist/m365/spo/commands/web/web-retentionlabel-list.js +10 -18
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +40 -64
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +31 -58
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +12 -36
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +11 -29
- package/dist/m365/spo/commands/web/web-rule-get.js +47 -0
- package/dist/m365/spo/commands/web/web-rule-list.js +6 -4
- package/dist/m365/spo/commands/web/web-rule-remove.js +0 -3
- package/dist/m365/spo/commands/web/web-set.js +26 -96
- package/dist/m365/spo/commands.js +1 -2
- package/dist/m365/teams/commands/channel/channel-list.js +2 -6
- package/dist/m365/teams/commands/channel/channel-member-add.js +2 -6
- package/dist/m365/teams/commands/channel/channel-member-list.js +2 -6
- package/dist/m365/teams/commands/channel/channel-member-remove.js +2 -6
- package/dist/m365/teams/commands/channel/channel-member-set.js +2 -6
- package/dist/m365/teams/commands/channel/channel-remove.js +2 -8
- package/dist/m365/teams/commands/channel/channel-set.js +2 -8
- package/dist/m365/teams/commands/tab/tab-get.js +2 -6
- package/dist/m365/teams/commands/team/team-archive.js +2 -6
- package/dist/m365/teams/commands/team/team-remove.js +2 -6
- package/dist/m365/teams/commands/team/team-unarchive.js +2 -6
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +4 -4
- package/docs/docs/cmd/spe/container/container-remove.mdx +5 -5
- package/docs/docs/cmd/spo/file/file-archive.mdx +8 -0
- package/docs/docs/cmd/spo/file/file-remove.mdx +4 -4
- package/docs/docs/cmd/spo/file/file-unarchive.mdx +8 -0
- package/docs/docs/cmd/spo/folder/folder-archive.mdx +6 -0
- package/docs/docs/cmd/spo/folder/folder-remove.mdx +4 -4
- package/docs/docs/cmd/spo/list/list-remove.mdx +4 -4
- package/docs/docs/cmd/spo/listitem/listitem-batch-remove.mdx +8 -2
- package/docs/docs/cmd/spo/listitem/listitem-remove.mdx +8 -2
- package/docs/docs/cmd/spo/page/page-remove.mdx +4 -4
- package/docs/docs/cmd/spo/site/site-apppermission-add.mdx +52 -21
- package/docs/docs/cmd/spo/site/site-list.mdx +22 -1
- package/docs/docs/cmd/spo/site/site-remove.mdx +3 -3
- package/docs/docs/cmd/spo/storageentity/storageentity-get.mdx +11 -2
- package/docs/docs/cmd/spo/storageentity/storageentity-list.mdx +9 -3
- package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +6 -6
- package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +10 -4
- package/docs/docs/cmd/spo/web/web-rule-get.mdx +108 -0
- package/docs/docs/cmd/spo/web/web-rule-list.mdx +8 -12
- package/docs/docs/cmd/spo/web/web-rule-remove.mdx +0 -6
- package/docs/docs/cmd/teams/app/app-install.mdx +21 -0
- package/docs/docs/cmd/teams/app/app-list.mdx +19 -0
- package/docs/docs/cmd/teams/app/app-publish.mdx +17 -0
- package/docs/docs/cmd/teams/app/app-remove.mdx +19 -0
- package/docs/docs/cmd/teams/app/app-uninstall.mdx +21 -0
- package/docs/docs/cmd/teams/app/app-update.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +19 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.mdx +19 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.mdx +19 -0
- package/npm-shrinkwrap.json +432 -0
- package/package.json +6 -1
|
@@ -1,15 +1,26 @@
|
|
|
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 _SpoWebRoleAssignmentAddCommand_instances, _SpoWebRoleAssignmentAddCommand_initTelemetry, _SpoWebRoleAssignmentAddCommand_initOptions, _SpoWebRoleAssignmentAddCommand_initValidators, _SpoWebRoleAssignmentAddCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
5
|
import { spo } from '../../../../utils/spo.js';
|
|
10
6
|
import { validation } from '../../../../utils/validation.js';
|
|
11
7
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
8
|
import commands from '../../commands.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
13
|
+
}).alias('u'),
|
|
14
|
+
principalId: z.number().optional(),
|
|
15
|
+
upn: z.string().optional(),
|
|
16
|
+
groupName: z.string().optional(),
|
|
17
|
+
entraGroupId: z.string().refine(id => validation.isValidGuid(id), {
|
|
18
|
+
error: e => `'${e.input}' is not a valid GUID for option entraGroupId.`
|
|
19
|
+
}).optional(),
|
|
20
|
+
entraGroupName: z.string().optional(),
|
|
21
|
+
roleDefinitionId: z.number().optional(),
|
|
22
|
+
roleDefinitionName: z.string().optional()
|
|
23
|
+
});
|
|
13
24
|
class SpoWebRoleAssignmentAddCommand extends SpoCommand {
|
|
14
25
|
get name() {
|
|
15
26
|
return commands.WEB_ROLEASSIGNMENT_ADD;
|
|
@@ -17,13 +28,25 @@ class SpoWebRoleAssignmentAddCommand extends SpoCommand {
|
|
|
17
28
|
get description() {
|
|
18
29
|
return 'Adds a role assignment to web';
|
|
19
30
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
getRefinedSchema(schema) {
|
|
35
|
+
return schema
|
|
36
|
+
.refine(options => [options.principalId, options.upn, options.groupName, options.entraGroupId, options.entraGroupName].filter(x => x !== undefined).length === 1, {
|
|
37
|
+
error: `Specify either 'principalId', 'upn', 'groupName', 'entraGroupId', or 'entraGroupName'.`,
|
|
38
|
+
params: {
|
|
39
|
+
customCode: 'optionSet',
|
|
40
|
+
options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName']
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
.refine(options => [options.roleDefinitionId, options.roleDefinitionName].filter(x => x !== undefined).length === 1, {
|
|
44
|
+
error: `Specify either 'roleDefinitionId' or 'roleDefinitionName'.`,
|
|
45
|
+
params: {
|
|
46
|
+
customCode: 'optionSet',
|
|
47
|
+
options: ['roleDefinitionId', 'roleDefinitionName']
|
|
48
|
+
}
|
|
49
|
+
});
|
|
27
50
|
}
|
|
28
51
|
async commandAction(logger, args) {
|
|
29
52
|
if (this.verbose) {
|
|
@@ -31,7 +54,10 @@ class SpoWebRoleAssignmentAddCommand extends SpoCommand {
|
|
|
31
54
|
}
|
|
32
55
|
try {
|
|
33
56
|
const roleDefinitionId = await this.getRoleDefinitionId(args.options, logger);
|
|
34
|
-
if (args.options.
|
|
57
|
+
if (args.options.principalId) {
|
|
58
|
+
await this.addRoleAssignment(args.options.webUrl, args.options.principalId, roleDefinitionId, logger);
|
|
59
|
+
}
|
|
60
|
+
else if (args.options.upn) {
|
|
35
61
|
const principalId = await this.getUserPrincipalId(args.options, logger);
|
|
36
62
|
await this.addRoleAssignment(args.options.webUrl, principalId, roleDefinitionId, logger);
|
|
37
63
|
}
|
|
@@ -85,55 +111,5 @@ class SpoWebRoleAssignmentAddCommand extends SpoCommand {
|
|
|
85
111
|
return user.Id;
|
|
86
112
|
}
|
|
87
113
|
}
|
|
88
|
-
_SpoWebRoleAssignmentAddCommand_instances = new WeakSet(), _SpoWebRoleAssignmentAddCommand_initTelemetry = function _SpoWebRoleAssignmentAddCommand_initTelemetry() {
|
|
89
|
-
this.telemetry.push((args) => {
|
|
90
|
-
Object.assign(this.telemetryProperties, {
|
|
91
|
-
principalId: typeof args.options.principalId !== 'undefined',
|
|
92
|
-
upn: typeof args.options.upn !== 'undefined',
|
|
93
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
94
|
-
entraGroupId: typeof args.options.entraGroupId !== 'undefined',
|
|
95
|
-
entraGroupName: typeof args.options.entraGroupName !== 'undefined',
|
|
96
|
-
roleDefinitionId: typeof args.options.roleDefinitionId !== 'undefined',
|
|
97
|
-
roleDefinitionName: typeof args.options.roleDefinitionName !== 'undefined'
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
}, _SpoWebRoleAssignmentAddCommand_initOptions = function _SpoWebRoleAssignmentAddCommand_initOptions() {
|
|
101
|
-
this.options.unshift({
|
|
102
|
-
option: '-u, --webUrl <webUrl>'
|
|
103
|
-
}, {
|
|
104
|
-
option: '--principalId [principalId]'
|
|
105
|
-
}, {
|
|
106
|
-
option: '--upn [upn]'
|
|
107
|
-
}, {
|
|
108
|
-
option: '--groupName [groupName]'
|
|
109
|
-
}, {
|
|
110
|
-
option: '--entraGroupId [entraGroupId]'
|
|
111
|
-
}, {
|
|
112
|
-
option: '--entraGroupName [entraGroupName]'
|
|
113
|
-
}, {
|
|
114
|
-
option: '--roleDefinitionId [roleDefinitionId]'
|
|
115
|
-
}, {
|
|
116
|
-
option: '--roleDefinitionName [roleDefinitionName]'
|
|
117
|
-
});
|
|
118
|
-
}, _SpoWebRoleAssignmentAddCommand_initValidators = function _SpoWebRoleAssignmentAddCommand_initValidators() {
|
|
119
|
-
this.validators.push(async (args) => {
|
|
120
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
121
|
-
if (isValidSharePointUrl !== true) {
|
|
122
|
-
return isValidSharePointUrl;
|
|
123
|
-
}
|
|
124
|
-
if (args.options.principalId && isNaN(args.options.principalId)) {
|
|
125
|
-
return `Specified principalId ${args.options.principalId} is not a number`;
|
|
126
|
-
}
|
|
127
|
-
if (args.options.roleDefinitionId && isNaN(args.options.roleDefinitionId)) {
|
|
128
|
-
return `Specified roleDefinitionId ${args.options.roleDefinitionId} is not a number`;
|
|
129
|
-
}
|
|
130
|
-
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
131
|
-
return `'${args.options.entraGroupId}' is not a valid GUID for option entraGroupId.`;
|
|
132
|
-
}
|
|
133
|
-
return true;
|
|
134
|
-
});
|
|
135
|
-
}, _SpoWebRoleAssignmentAddCommand_initOptionSets = function _SpoWebRoleAssignmentAddCommand_initOptionSets() {
|
|
136
|
-
this.optionSets.push({ options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName'] }, { options: ['roleDefinitionId', 'roleDefinitionName'] });
|
|
137
|
-
};
|
|
138
114
|
export default new SpoWebRoleAssignmentAddCommand();
|
|
139
115
|
//# sourceMappingURL=web-roleassignment-add.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 _SpoWebRoleAssignmentRemoveCommand_instances, _SpoWebRoleAssignmentRemoveCommand_initTelemetry, _SpoWebRoleAssignmentRemoveCommand_initOptions, _SpoWebRoleAssignmentRemoveCommand_initValidators, _SpoWebRoleAssignmentRemoveCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -11,6 +7,20 @@ import commands from '../../commands.js';
|
|
|
11
7
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
12
8
|
import { spo } from '../../../../utils/spo.js';
|
|
13
9
|
import { cli } from '../../../../cli/cli.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
14
|
+
}).alias('u'),
|
|
15
|
+
principalId: z.number().optional(),
|
|
16
|
+
upn: z.string().optional(),
|
|
17
|
+
groupName: z.string().optional(),
|
|
18
|
+
entraGroupId: z.string().refine(id => validation.isValidGuid(id), {
|
|
19
|
+
error: e => `'${e.input}' is not a valid GUID for option entraGroupId.`
|
|
20
|
+
}).optional(),
|
|
21
|
+
entraGroupName: z.string().optional(),
|
|
22
|
+
force: z.boolean().optional().alias('f')
|
|
23
|
+
});
|
|
14
24
|
class SpoWebRoleAssignmentRemoveCommand extends SpoCommand {
|
|
15
25
|
get name() {
|
|
16
26
|
return commands.WEB_ROLEASSIGNMENT_REMOVE;
|
|
@@ -18,13 +28,17 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
18
28
|
get description() {
|
|
19
29
|
return 'Removes a role assignment from web permissions';
|
|
20
30
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
getRefinedSchema(schema) {
|
|
35
|
+
return schema.refine(options => [options.principalId, options.upn, options.groupName, options.entraGroupId, options.entraGroupName].filter(x => x !== undefined).length === 1, {
|
|
36
|
+
error: `Specify either 'principalId', 'upn', 'groupName', 'entraGroupId', or 'entraGroupName'.`,
|
|
37
|
+
params: {
|
|
38
|
+
customCode: 'optionSet',
|
|
39
|
+
options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName']
|
|
40
|
+
}
|
|
41
|
+
});
|
|
28
42
|
}
|
|
29
43
|
async commandAction(logger, args) {
|
|
30
44
|
if (args.options.force) {
|
|
@@ -42,7 +56,10 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
42
56
|
await logger.logToStderr(`Removing role assignment from web ${options.webUrl}...`);
|
|
43
57
|
}
|
|
44
58
|
try {
|
|
45
|
-
if (options.
|
|
59
|
+
if (options.principalId) {
|
|
60
|
+
await this.removeRoleAssignmentWithOptions(options.webUrl, options.principalId, logger);
|
|
61
|
+
}
|
|
62
|
+
else if (options.upn) {
|
|
46
63
|
const principalId = await this.getUserPrincipalId(options, logger);
|
|
47
64
|
await this.removeRoleAssignmentWithOptions(options.webUrl, principalId, logger);
|
|
48
65
|
}
|
|
@@ -89,49 +106,5 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
89
106
|
return user.Id;
|
|
90
107
|
}
|
|
91
108
|
}
|
|
92
|
-
_SpoWebRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoWebRoleAssignmentRemoveCommand_initTelemetry = function _SpoWebRoleAssignmentRemoveCommand_initTelemetry() {
|
|
93
|
-
this.telemetry.push((args) => {
|
|
94
|
-
Object.assign(this.telemetryProperties, {
|
|
95
|
-
principalId: typeof args.options.principalId !== 'undefined',
|
|
96
|
-
upn: typeof args.options.upn !== 'undefined',
|
|
97
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
98
|
-
entraGroupId: typeof args.options.entraGroupId !== 'undefined',
|
|
99
|
-
entraGroupName: typeof args.options.entraGroupName !== 'undefined',
|
|
100
|
-
force: (!(!args.options.force)).toString()
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
}, _SpoWebRoleAssignmentRemoveCommand_initOptions = function _SpoWebRoleAssignmentRemoveCommand_initOptions() {
|
|
104
|
-
this.options.unshift({
|
|
105
|
-
option: '-u, --webUrl <webUrl>'
|
|
106
|
-
}, {
|
|
107
|
-
option: '--principalId [principalId]'
|
|
108
|
-
}, {
|
|
109
|
-
option: '--upn [upn]'
|
|
110
|
-
}, {
|
|
111
|
-
option: '--groupName [groupName]'
|
|
112
|
-
}, {
|
|
113
|
-
option: '--entraGroupId [entraGroupId]'
|
|
114
|
-
}, {
|
|
115
|
-
option: '--entraGroupName [entraGroupName]'
|
|
116
|
-
}, {
|
|
117
|
-
option: '-f, --force'
|
|
118
|
-
});
|
|
119
|
-
}, _SpoWebRoleAssignmentRemoveCommand_initValidators = function _SpoWebRoleAssignmentRemoveCommand_initValidators() {
|
|
120
|
-
this.validators.push(async (args) => {
|
|
121
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
122
|
-
if (isValidSharePointUrl !== true) {
|
|
123
|
-
return isValidSharePointUrl;
|
|
124
|
-
}
|
|
125
|
-
if (args.options.principalId && isNaN(args.options.principalId)) {
|
|
126
|
-
return `Specified principalId ${args.options.principalId} is not a number`;
|
|
127
|
-
}
|
|
128
|
-
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
129
|
-
return `'${args.options.entraGroupId}' is not a valid GUID for option entraGroupId.`;
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
});
|
|
133
|
-
}, _SpoWebRoleAssignmentRemoveCommand_initOptionSets = function _SpoWebRoleAssignmentRemoveCommand_initOptionSets() {
|
|
134
|
-
this.optionSets.push({ options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName'] });
|
|
135
|
-
};
|
|
136
109
|
export default new SpoWebRoleAssignmentRemoveCommand();
|
|
137
110
|
//# sourceMappingURL=web-roleassignment-remove.js.map
|
|
@@ -1,14 +1,18 @@
|
|
|
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 _SpoWebRoleInheritanceBreakCommand_instances, _SpoWebRoleInheritanceBreakCommand_initTelemetry, _SpoWebRoleInheritanceBreakCommand_initOptions, _SpoWebRoleInheritanceBreakCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
12
|
+
}).alias('u'),
|
|
13
|
+
clearExistingPermissions: z.boolean().optional().alias('c'),
|
|
14
|
+
force: z.boolean().optional().alias('f')
|
|
15
|
+
});
|
|
12
16
|
class SpoWebRoleInheritanceBreakCommand extends SpoCommand {
|
|
13
17
|
get name() {
|
|
14
18
|
return commands.WEB_ROLEINHERITANCE_BREAK;
|
|
@@ -16,12 +20,8 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
16
20
|
get description() {
|
|
17
21
|
return 'Breaks role inheritance of subsite';
|
|
18
22
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoWebRoleInheritanceBreakCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceBreakCommand_instances, "m", _SpoWebRoleInheritanceBreakCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceBreakCommand_instances, "m", _SpoWebRoleInheritanceBreakCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceBreakCommand_instances, "m", _SpoWebRoleInheritanceBreakCommand_initValidators).call(this);
|
|
23
|
+
get schema() {
|
|
24
|
+
return options;
|
|
25
25
|
}
|
|
26
26
|
async commandAction(logger, args) {
|
|
27
27
|
if (this.verbose) {
|
|
@@ -54,29 +54,5 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
_SpoWebRoleInheritanceBreakCommand_instances = new WeakSet(), _SpoWebRoleInheritanceBreakCommand_initTelemetry = function _SpoWebRoleInheritanceBreakCommand_initTelemetry() {
|
|
58
|
-
this.telemetry.push((args) => {
|
|
59
|
-
Object.assign(this.telemetryProperties, {
|
|
60
|
-
clearExistingPermissions: !!args.options.clearExistingPermissions,
|
|
61
|
-
force: !!args.options.force
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}, _SpoWebRoleInheritanceBreakCommand_initOptions = function _SpoWebRoleInheritanceBreakCommand_initOptions() {
|
|
65
|
-
this.options.unshift({
|
|
66
|
-
option: '-u, --webUrl <webUrl>'
|
|
67
|
-
}, {
|
|
68
|
-
option: '-c, --clearExistingPermissions'
|
|
69
|
-
}, {
|
|
70
|
-
option: '-f, --force'
|
|
71
|
-
});
|
|
72
|
-
}, _SpoWebRoleInheritanceBreakCommand_initValidators = function _SpoWebRoleInheritanceBreakCommand_initValidators() {
|
|
73
|
-
this.validators.push(async (args) => {
|
|
74
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
75
|
-
if (isValidSharePointUrl !== true) {
|
|
76
|
-
return isValidSharePointUrl;
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
57
|
export default new SpoWebRoleInheritanceBreakCommand();
|
|
82
58
|
//# sourceMappingURL=web-roleinheritance-break.js.map
|
|
@@ -1,14 +1,17 @@
|
|
|
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 _SpoWebRoleInheritanceResetCommand_instances, _SpoWebRoleInheritanceResetCommand_initTelemetry, _SpoWebRoleInheritanceResetCommand_initOptions, _SpoWebRoleInheritanceResetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
12
|
+
}).alias('u'),
|
|
13
|
+
force: z.boolean().optional().alias('f')
|
|
14
|
+
});
|
|
12
15
|
class SpoWebRoleInheritanceResetCommand extends SpoCommand {
|
|
13
16
|
get name() {
|
|
14
17
|
return commands.WEB_ROLEINHERITANCE_RESET;
|
|
@@ -16,12 +19,8 @@ class SpoWebRoleInheritanceResetCommand extends SpoCommand {
|
|
|
16
19
|
get description() {
|
|
17
20
|
return 'Restores role inheritance of subsite';
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoWebRoleInheritanceResetCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceResetCommand_instances, "m", _SpoWebRoleInheritanceResetCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceResetCommand_instances, "m", _SpoWebRoleInheritanceResetCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoWebRoleInheritanceResetCommand_instances, "m", _SpoWebRoleInheritanceResetCommand_initValidators).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
25
24
|
}
|
|
26
25
|
async commandAction(logger, args) {
|
|
27
26
|
if (this.verbose) {
|
|
@@ -55,22 +54,5 @@ class SpoWebRoleInheritanceResetCommand extends SpoCommand {
|
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
_SpoWebRoleInheritanceResetCommand_instances = new WeakSet(), _SpoWebRoleInheritanceResetCommand_initTelemetry = function _SpoWebRoleInheritanceResetCommand_initTelemetry() {
|
|
59
|
-
this.telemetry.push((args) => {
|
|
60
|
-
Object.assign(this.telemetryProperties, {
|
|
61
|
-
force: (!(!args.options.force)).toString()
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}, _SpoWebRoleInheritanceResetCommand_initOptions = function _SpoWebRoleInheritanceResetCommand_initOptions() {
|
|
65
|
-
this.options.unshift({
|
|
66
|
-
option: '-u, --webUrl <webUrl>'
|
|
67
|
-
}, {
|
|
68
|
-
option: '-f, --force'
|
|
69
|
-
});
|
|
70
|
-
}, _SpoWebRoleInheritanceResetCommand_initValidators = function _SpoWebRoleInheritanceResetCommand_initValidators() {
|
|
71
|
-
this.validators.push(async (args) => {
|
|
72
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
57
|
export default new SpoWebRoleInheritanceResetCommand();
|
|
76
58
|
//# sourceMappingURL=web-roleinheritance-reset.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import request from '../../../../request.js';
|
|
4
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
5
|
+
import { validation } from '../../../../utils/validation.js';
|
|
6
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
7
|
+
import commands from '../../commands.js';
|
|
8
|
+
const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
webUrl: z.string().alias('u')
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint URL.`
|
|
13
|
+
}),
|
|
14
|
+
id: z.uuid()
|
|
15
|
+
});
|
|
16
|
+
class SpoWebRuleGetCommand extends SpoCommand {
|
|
17
|
+
get name() {
|
|
18
|
+
return commands.WEB_RULE_GET;
|
|
19
|
+
}
|
|
20
|
+
get description() {
|
|
21
|
+
return 'Retrieves details of a specific rule from a SharePoint site list';
|
|
22
|
+
}
|
|
23
|
+
get schema() {
|
|
24
|
+
return options;
|
|
25
|
+
}
|
|
26
|
+
async commandAction(logger, args) {
|
|
27
|
+
try {
|
|
28
|
+
if (this.verbose) {
|
|
29
|
+
await logger.logToStderr(`Retrieving rule with id '${args.options.id}' from site '${args.options.webUrl}'...`);
|
|
30
|
+
}
|
|
31
|
+
const requestOptions = {
|
|
32
|
+
url: `${args.options.webUrl}/_api/web/alerts/GetById('${formatting.encodeQueryParameter(args.options.id)}')?$expand=List,User,List/Rootfolder&$select=*,List/Id,List/Title,List/Rootfolder/ServerRelativeUrl`,
|
|
33
|
+
headers: {
|
|
34
|
+
accept: 'application/json;odata=nometadata'
|
|
35
|
+
},
|
|
36
|
+
responseType: 'json'
|
|
37
|
+
};
|
|
38
|
+
const res = await request.get(requestOptions);
|
|
39
|
+
await logger.log(res);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
this.handleRejectedODataJsonPromise(err);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export default new SpoWebRuleGetCommand();
|
|
47
|
+
//# sourceMappingURL=web-rule-get.js.map
|
|
@@ -29,9 +29,6 @@ class SpoWebRuleListCommand extends SpoCommand {
|
|
|
29
29
|
get description() {
|
|
30
30
|
return 'Lists all SharePoint list alerts';
|
|
31
31
|
}
|
|
32
|
-
alias() {
|
|
33
|
-
return [commands.WEB_ALERT_LIST];
|
|
34
|
-
}
|
|
35
32
|
defaultProperties() {
|
|
36
33
|
return ['ID', 'Title', 'UserPrincipalName'];
|
|
37
34
|
}
|
|
@@ -75,7 +72,12 @@ class SpoWebRuleListCommand extends SpoCommand {
|
|
|
75
72
|
listId = args.options.listId;
|
|
76
73
|
}
|
|
77
74
|
else if (args.options.listUrl || args.options.listTitle) {
|
|
78
|
-
|
|
75
|
+
try {
|
|
76
|
+
listId = await spo.getListId(args.options.webUrl, args.options.listTitle, args.options.listUrl, logger, this.verbose);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
this.handleRejectedODataJsonPromise(err);
|
|
80
|
+
}
|
|
79
81
|
}
|
|
80
82
|
if (listId) {
|
|
81
83
|
filters.push(`List/Id eq guid'${formatting.encodeQueryParameter(listId)}'`);
|
|
@@ -1,13 +1,28 @@
|
|
|
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 _SpoWebSetCommand_instances, _a, _SpoWebSetCommand_initTelemetry, _SpoWebSetCommand_initOptions, _SpoWebSetCommand_initTypes, _SpoWebSetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.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.looseObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
description: z.string().optional().alias('d'),
|
|
10
|
+
headerEmphasis: z.enum(['0', '1', '2', '3'], {
|
|
11
|
+
error: e => `${e.input} is not a valid value for headerEmphasis. Allowed values are 0|1|2|3`
|
|
12
|
+
}).optional(),
|
|
13
|
+
headerLayout: z.enum(['standard', 'compact']).optional(),
|
|
14
|
+
megaMenuEnabled: z.boolean().optional(),
|
|
15
|
+
quickLaunchEnabled: z.boolean().optional(),
|
|
16
|
+
siteLogoUrl: z.string().optional(),
|
|
17
|
+
title: z.string().optional().alias('t'),
|
|
18
|
+
url: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
19
|
+
error: e => `${e.input} is not a valid SharePoint Online site URL.`
|
|
20
|
+
}).alias('u'),
|
|
21
|
+
footerEnabled: z.boolean().optional(),
|
|
22
|
+
navAudienceTargetingEnabled: z.boolean().optional(),
|
|
23
|
+
searchScope: z.preprocess(value => String(value).toLowerCase(), z.enum(['defaultscope', 'tenant', 'hub', 'site'])).optional(),
|
|
24
|
+
welcomePage: z.string().optional()
|
|
25
|
+
});
|
|
11
26
|
class SpoWebSetCommand extends SpoCommand {
|
|
12
27
|
get name() {
|
|
13
28
|
return commands.WEB_SET;
|
|
@@ -15,17 +30,12 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
15
30
|
get description() {
|
|
16
31
|
return 'Updates subsite properties';
|
|
17
32
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoWebSetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initTypes).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoWebSetCommand_instances, "m", _SpoWebSetCommand_initValidators).call(this);
|
|
33
|
+
get schema() {
|
|
34
|
+
return options;
|
|
25
35
|
}
|
|
26
36
|
async commandAction(logger, args) {
|
|
27
37
|
const payload = {};
|
|
28
|
-
this.
|
|
38
|
+
this.addUnknownOptionsToPayloadZod(payload, args.options);
|
|
29
39
|
if (args.options.title) {
|
|
30
40
|
payload.Title = args.options.title;
|
|
31
41
|
}
|
|
@@ -39,7 +49,7 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
39
49
|
payload.QuickLaunchEnabled = args.options.quickLaunchEnabled;
|
|
40
50
|
}
|
|
41
51
|
if (typeof args.options.headerEmphasis !== 'undefined') {
|
|
42
|
-
payload.HeaderEmphasis = args.options.headerEmphasis;
|
|
52
|
+
payload.HeaderEmphasis = Number(args.options.headerEmphasis);
|
|
43
53
|
}
|
|
44
54
|
if (typeof args.options.headerLayout !== 'undefined') {
|
|
45
55
|
payload.HeaderLayout = args.options.headerLayout === 'standard' ? 1 : 2;
|
|
@@ -55,7 +65,7 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
55
65
|
}
|
|
56
66
|
if (typeof args.options.searchScope !== 'undefined') {
|
|
57
67
|
const searchScope = args.options.searchScope.toLowerCase();
|
|
58
|
-
payload.SearchScope =
|
|
68
|
+
payload.SearchScope = SpoWebSetCommand.searchScopeOptions.indexOf(searchScope);
|
|
59
69
|
}
|
|
60
70
|
try {
|
|
61
71
|
const requestOptions = {
|
|
@@ -97,86 +107,6 @@ class SpoWebSetCommand extends SpoCommand {
|
|
|
97
107
|
return true;
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
|
-
_a = SpoWebSetCommand, _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = function _SpoWebSetCommand_initTelemetry() {
|
|
101
|
-
this.telemetry.push((args) => {
|
|
102
|
-
Object.assign(this.telemetryProperties, {
|
|
103
|
-
description: typeof args.options.description !== 'undefined',
|
|
104
|
-
headerEmphasis: typeof args.options.headerEmphasis !== 'undefined',
|
|
105
|
-
headerLayout: typeof args.options.headerLayout !== 'undefined',
|
|
106
|
-
megaMenuEnabled: typeof args.options.megaMenuEnabled !== 'undefined',
|
|
107
|
-
siteLogoUrl: typeof args.options.siteLogoUrl !== 'undefined',
|
|
108
|
-
title: typeof args.options.title !== 'undefined',
|
|
109
|
-
quickLaunchEnabled: typeof args.options.quickLaunchEnabled !== 'undefined',
|
|
110
|
-
footerEnabled: typeof args.options.footerEnabled !== 'undefined',
|
|
111
|
-
navAudienceTargetingEnabled: typeof args.options.navAudienceTargetingEnabled !== 'undefined',
|
|
112
|
-
searchScope: typeof args.options.searchScope !== 'undefined',
|
|
113
|
-
welcomePage: typeof args.options.welcomePage !== 'undefined'
|
|
114
|
-
});
|
|
115
|
-
this.trackUnknownOptions(this.telemetryProperties, args.options);
|
|
116
|
-
});
|
|
117
|
-
}, _SpoWebSetCommand_initOptions = function _SpoWebSetCommand_initOptions() {
|
|
118
|
-
this.options.unshift({
|
|
119
|
-
option: '-u, --url <url>'
|
|
120
|
-
}, {
|
|
121
|
-
option: '-t, --title [title]'
|
|
122
|
-
}, {
|
|
123
|
-
option: '-d, --description [description]'
|
|
124
|
-
}, {
|
|
125
|
-
option: '--siteLogoUrl [siteLogoUrl]'
|
|
126
|
-
}, {
|
|
127
|
-
option: '--quickLaunchEnabled [quickLaunchEnabled]',
|
|
128
|
-
autocomplete: ['true', 'false']
|
|
129
|
-
}, {
|
|
130
|
-
option: '--headerLayout [headerLayout]',
|
|
131
|
-
autocomplete: ['standard', 'compact']
|
|
132
|
-
}, {
|
|
133
|
-
option: '--headerEmphasis [headerEmphasis]',
|
|
134
|
-
autocomplete: ['0', '1', '2', '3']
|
|
135
|
-
}, {
|
|
136
|
-
option: '--megaMenuEnabled [megaMenuEnabled]',
|
|
137
|
-
autocomplete: ['true', 'false']
|
|
138
|
-
}, {
|
|
139
|
-
option: '--footerEnabled [footerEnabled]',
|
|
140
|
-
autocomplete: ['true', 'false']
|
|
141
|
-
}, {
|
|
142
|
-
option: '--navAudienceTargetingEnabled [navAudienceTargetingEnabled]',
|
|
143
|
-
autocomplete: ['true', 'false']
|
|
144
|
-
}, {
|
|
145
|
-
option: '--searchScope [searchScope]',
|
|
146
|
-
autocomplete: _a.searchScopeOptions
|
|
147
|
-
}, {
|
|
148
|
-
option: '--welcomePage [welcomePage]'
|
|
149
|
-
});
|
|
150
|
-
}, _SpoWebSetCommand_initTypes = function _SpoWebSetCommand_initTypes() {
|
|
151
|
-
this.types.boolean.push('megaMenuEnabled', 'footerEnabled', 'quickLaunchEnabled', 'navAudienceTargetingEnabled');
|
|
152
|
-
}, _SpoWebSetCommand_initValidators = function _SpoWebSetCommand_initValidators() {
|
|
153
|
-
this.validators.push(async (args) => {
|
|
154
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.url);
|
|
155
|
-
if (isValidSharePointUrl !== true) {
|
|
156
|
-
return isValidSharePointUrl;
|
|
157
|
-
}
|
|
158
|
-
if (typeof args.options.headerEmphasis !== 'undefined') {
|
|
159
|
-
if (isNaN(args.options.headerEmphasis)) {
|
|
160
|
-
return `${args.options.headerEmphasis} is not a number`;
|
|
161
|
-
}
|
|
162
|
-
if ([0, 1, 2, 3].indexOf(args.options.headerEmphasis) < 0) {
|
|
163
|
-
return `${args.options.headerEmphasis} is not a valid value for headerEmphasis. Allowed values are 0|1|2|3`;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
if (typeof args.options.headerLayout !== 'undefined') {
|
|
167
|
-
if (['standard', 'compact'].indexOf(args.options.headerLayout) < 0) {
|
|
168
|
-
return `${args.options.headerLayout} is not a valid value for headerLayout. Allowed values are standard|compact`;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (typeof args.options.searchScope !== 'undefined') {
|
|
172
|
-
const searchScope = args.options.searchScope.toString().toLowerCase();
|
|
173
|
-
if (_a.searchScopeOptions.indexOf(searchScope) < 0) {
|
|
174
|
-
return `${args.options.searchScope} is not a valid value for searchScope. Allowed values are DefaultScope|Tenant|Hub|Site`;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return true;
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
110
|
SpoWebSetCommand.searchScopeOptions = ['defaultscope', 'tenant', 'hub', 'site'];
|
|
181
111
|
export default new SpoWebSetCommand();
|
|
182
112
|
//# sourceMappingURL=web-set.js.map
|
|
@@ -366,8 +366,6 @@ export default {
|
|
|
366
366
|
USERPROFILE_GET: `${prefix} userprofile get`,
|
|
367
367
|
USERPROFILE_SET: `${prefix} userprofile set`,
|
|
368
368
|
WEB_ADD: `${prefix} web add`,
|
|
369
|
-
WEB_ALERT_LIST: `${prefix} web alert list`,
|
|
370
|
-
WEB_ALERT_REMOVE: `${prefix} web alert remove`,
|
|
371
369
|
WEB_CLIENTSIDEWEBPART_LIST: `${prefix} web clientsidewebpart list`,
|
|
372
370
|
WEB_GET: `${prefix} web get`,
|
|
373
371
|
WEB_INSTALLEDLANGUAGE_LIST: `${prefix} web installedlanguage list`,
|
|
@@ -379,6 +377,7 @@ export default {
|
|
|
379
377
|
WEB_ROLEASSIGNMENT_ADD: `${prefix} web roleassignment add`,
|
|
380
378
|
WEB_ROLEINHERITANCE_BREAK: `${prefix} web roleinheritance break`,
|
|
381
379
|
WEB_ROLEINHERITANCE_RESET: `${prefix} web roleinheritance reset`,
|
|
380
|
+
WEB_RULE_GET: `${prefix} web rule get`,
|
|
382
381
|
WEB_RULE_LIST: `${prefix} web rule list`,
|
|
383
382
|
WEB_RULE_REMOVE: `${prefix} web rule remove`,
|
|
384
383
|
WEB_SET: `${prefix} web set`
|