@pnp/cli-microsoft365 10.0.0-beta.48e9f7d → 10.0.0-beta.787c5f1
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 +11 -12
- package/dist/Command.js +4 -1
- package/dist/cli/cli.js +14 -0
- package/dist/config.js +60 -5
- package/dist/m365/base/PowerAutomateCommand.js +1 -1
- package/dist/m365/base/SpoCommand.js +1 -1
- package/dist/m365/cli/commands/cli-consent.js +2 -2
- package/dist/m365/cli/commands/cli-doctor.js +2 -2
- package/dist/m365/cli/commands/cli-reconsent.js +2 -3
- package/dist/m365/cli/commands/config/config-set.js +12 -4
- package/dist/m365/commands/login.js +28 -9
- package/dist/m365/commands/setup.js +256 -33
- package/dist/m365/commands/setupPresets.js +2 -4
- package/dist/m365/connection/commands/connection-list.js +4 -4
- package/dist/m365/entra/commands/app/app-add.js +52 -288
- package/dist/m365/flow/commands/environment/environment-get.js +1 -1
- package/dist/m365/flow/commands/environment/environment-list.js +1 -1
- package/dist/m365/flow/commands/flow-disable.js +1 -1
- package/dist/m365/flow/commands/flow-enable.js +1 -1
- package/dist/m365/flow/commands/flow-export.js +17 -16
- package/dist/m365/flow/commands/flow-get.js +1 -1
- package/dist/m365/flow/commands/flow-list.js +1 -1
- package/dist/m365/flow/commands/flow-remove.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +1 -1
- package/dist/m365/flow/commands/owner/owner-list.js +1 -1
- package/dist/m365/flow/commands/owner/owner-remove.js +1 -1
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +47 -0
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +48 -0
- package/dist/m365/flow/commands/run/run-cancel.js +1 -1
- package/dist/m365/flow/commands/run/run-get.js +1 -1
- package/dist/m365/flow/commands/run/run-list.js +1 -1
- package/dist/m365/flow/commands/run/run-resubmit.js +2 -2
- package/dist/m365/flow/commands.js +2 -0
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +8 -8
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +2 -2
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +17 -54
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +13 -40
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +5 -13
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +5 -13
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +143 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +111 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +95 -0
- package/dist/m365/spo/commands/list/list-get.js +17 -4
- package/dist/m365/spo/commands/page/page-section-add.js +185 -34
- package/dist/m365/spo/commands/site/SiteAdmin.js +2 -0
- package/dist/m365/spo/commands/site/site-admin-add.js +252 -0
- package/dist/m365/spo/commands/site/site-admin-list.js +2 -27
- package/dist/m365/spo/commands/user/user-get.js +67 -9
- package/dist/m365/spo/commands.js +4 -0
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +56 -0
- package/dist/m365/spp/commands.js +5 -0
- package/dist/settingsNames.js +6 -1
- package/dist/utils/entraApp.js +283 -0
- package/dist/utils/spo.js +75 -7
- package/dist/utils/zod.js +1 -1
- package/docs/docs/_clisettings.mdx +6 -1
- package/docs/docs/cmd/flow/recyclebinitem/recyclebinitem-list.mdx +132 -0
- package/docs/docs/cmd/flow/recyclebinitem/recyclebinitem-restore.mdx +55 -0
- package/docs/docs/cmd/setup.mdx +17 -6
- package/docs/docs/cmd/spo/contenttype/contenttype-field-remove.mdx +7 -7
- package/docs/docs/cmd/spo/contenttype/contenttype-field-set.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +125 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +50 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +50 -0
- package/docs/docs/cmd/spo/page/page-section-add.mdx +57 -2
- package/docs/docs/cmd/spo/site/site-admin-add.mdx +67 -0
- package/docs/docs/cmd/spo/user/user-get.mdx +35 -9
- package/docs/docs/cmd/spp/contentcenter/contentcenter-list.mdx +289 -0
- package/npm-shrinkwrap.json +203 -375
- package/package.json +16 -17
|
@@ -0,0 +1,111 @@
|
|
|
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 _SpoFolderSharingLinkClearCommand_instances, _SpoFolderSharingLinkClearCommand_initTelemetry, _SpoFolderSharingLinkClearCommand_initOptions, _SpoFolderSharingLinkClearCommand_initOptionSets, _SpoFolderSharingLinkClearCommand_initValidators, _SpoFolderSharingLinkClearCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import { spo } from '../../../../utils/spo.js';
|
|
9
|
+
import { odata } from '../../../../utils/odata.js';
|
|
10
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
|
+
import { drive } from '../../../../utils/drive.js';
|
|
12
|
+
import { validation } from '../../../../utils/validation.js';
|
|
13
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
14
|
+
import request from '../../../../request.js';
|
|
15
|
+
import commands from '../../commands.js';
|
|
16
|
+
class SpoFolderSharingLinkClearCommand extends SpoCommand {
|
|
17
|
+
get name() {
|
|
18
|
+
return commands.FOLDER_SHARINGLINK_CLEAR;
|
|
19
|
+
}
|
|
20
|
+
get description() {
|
|
21
|
+
return 'Removes all sharing links of a folder';
|
|
22
|
+
}
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
_SpoFolderSharingLinkClearCommand_instances.add(this);
|
|
26
|
+
this.allowedScopes = ['anonymous', 'users', 'organization'];
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkClearCommand_instances, "m", _SpoFolderSharingLinkClearCommand_initTelemetry).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkClearCommand_instances, "m", _SpoFolderSharingLinkClearCommand_initOptions).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkClearCommand_instances, "m", _SpoFolderSharingLinkClearCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkClearCommand_instances, "m", _SpoFolderSharingLinkClearCommand_initValidators).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkClearCommand_instances, "m", _SpoFolderSharingLinkClearCommand_initTypes).call(this);
|
|
32
|
+
}
|
|
33
|
+
async commandAction(logger, args) {
|
|
34
|
+
const clearSharingLinks = async () => {
|
|
35
|
+
if (this.verbose) {
|
|
36
|
+
await logger.logToStderr(`Clearing sharing links from folder ${args.options.folderId || args.options.folderUrl} for ${args.options.scope ? `${args.options.scope} scope` : 'all scopes'}`);
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const relFolderUrl = await spo.getFolderServerRelativeUrl(args.options.webUrl, args.options.folderUrl, args.options.folderId, logger, args.options.verbose);
|
|
40
|
+
const absoluteFolderUrl = urlUtil.getAbsoluteUrl(args.options.webUrl, relFolderUrl);
|
|
41
|
+
const folderUrl = new URL(absoluteFolderUrl);
|
|
42
|
+
const siteId = await spo.getSiteId(args.options.webUrl);
|
|
43
|
+
const driveDetails = await drive.getDriveByUrl(siteId, folderUrl, logger, args.options.verbose);
|
|
44
|
+
const itemId = await drive.getDriveItemId(driveDetails, folderUrl, logger, args.options.verbose);
|
|
45
|
+
let requestUrl = `https://graph.microsoft.com/v1.0/drives/${driveDetails.id}/items/${itemId}/permissions?$filter=Link ne null`;
|
|
46
|
+
if (args.options.scope) {
|
|
47
|
+
requestUrl += ` and Link/Scope eq '${args.options.scope}'`;
|
|
48
|
+
}
|
|
49
|
+
const sharingLinks = await odata.getAllItems(requestUrl);
|
|
50
|
+
for (const sharingLink of sharingLinks) {
|
|
51
|
+
const requestOptions = {
|
|
52
|
+
url: `https://graph.microsoft.com/v1.0/drives/${driveDetails.id}/items/${itemId}/permissions/${sharingLink.id}`,
|
|
53
|
+
headers: {
|
|
54
|
+
accept: 'application/json;odata.metadata=none'
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
await request.delete(requestOptions);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
this.handleRejectedODataJsonPromise(err);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
if (args.options.force) {
|
|
65
|
+
await clearSharingLinks();
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to clear sharing links from folder ${args.options.folderUrl || args.options.folderId}? for ${args.options.scope ? `${args.options.scope} scope` : 'all scopes'}` });
|
|
69
|
+
if (result) {
|
|
70
|
+
await clearSharingLinks();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_SpoFolderSharingLinkClearCommand_instances = new WeakSet(), _SpoFolderSharingLinkClearCommand_initTelemetry = function _SpoFolderSharingLinkClearCommand_initTelemetry() {
|
|
76
|
+
this.telemetry.push((args) => {
|
|
77
|
+
Object.assign(this.telemetryProperties, {
|
|
78
|
+
webUrl: typeof args.options.webUrl !== 'undefined',
|
|
79
|
+
folderUrl: typeof args.options.folderUrl !== 'undefined',
|
|
80
|
+
folderId: typeof args.options.folderId !== 'undefined',
|
|
81
|
+
scope: typeof args.options.scope !== 'undefined',
|
|
82
|
+
force: !!args.options.force
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}, _SpoFolderSharingLinkClearCommand_initOptions = function _SpoFolderSharingLinkClearCommand_initOptions() {
|
|
86
|
+
this.options.unshift({ option: '-u, --webUrl <webUrl>' }, { option: '--folderUrl [folderUrl]' }, { option: '--folderId [folderId]' }, {
|
|
87
|
+
option: '--scope [scope]',
|
|
88
|
+
autocomplete: this.allowedScopes
|
|
89
|
+
}, { option: '-f, --force' });
|
|
90
|
+
}, _SpoFolderSharingLinkClearCommand_initOptionSets = function _SpoFolderSharingLinkClearCommand_initOptionSets() {
|
|
91
|
+
this.optionSets.push({ options: ['folderUrl', 'folderId'] });
|
|
92
|
+
}, _SpoFolderSharingLinkClearCommand_initValidators = function _SpoFolderSharingLinkClearCommand_initValidators() {
|
|
93
|
+
this.validators.push(async (args) => {
|
|
94
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
95
|
+
if (isValidSharePointUrl !== true) {
|
|
96
|
+
return isValidSharePointUrl;
|
|
97
|
+
}
|
|
98
|
+
if (args.options.folderId && !validation.isValidGuid(args.options.folderId)) {
|
|
99
|
+
return `${args.options.folderId} is not a valid GUID`;
|
|
100
|
+
}
|
|
101
|
+
if (args.options.scope && !this.allowedScopes.some(scope => scope === args.options.scope)) {
|
|
102
|
+
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
103
|
+
}
|
|
104
|
+
return true;
|
|
105
|
+
});
|
|
106
|
+
}, _SpoFolderSharingLinkClearCommand_initTypes = function _SpoFolderSharingLinkClearCommand_initTypes() {
|
|
107
|
+
this.types.string.push('webUrl', 'folderUrl', 'folderId', 'scope');
|
|
108
|
+
this.types.boolean.push('force');
|
|
109
|
+
};
|
|
110
|
+
export default new SpoFolderSharingLinkClearCommand();
|
|
111
|
+
//# sourceMappingURL=folder-sharinglink-clear.js.map
|
|
@@ -0,0 +1,95 @@
|
|
|
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 _SpoFolderSharingLinkRemoveCommand_instances, _SpoFolderSharingLinkRemoveCommand_initTelemetry, _SpoFolderSharingLinkRemoveCommand_initOptions, _SpoFolderSharingLinkRemoveCommand_initOptionSets, _SpoFolderSharingLinkRemoveCommand_initValidators, _SpoFolderSharingLinkRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import { spo } from '../../../../utils/spo.js';
|
|
9
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
|
+
import { drive } from '../../../../utils/drive.js';
|
|
11
|
+
import { validation } from '../../../../utils/validation.js';
|
|
12
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
|
+
import request from '../../../../request.js';
|
|
14
|
+
import commands from '../../commands.js';
|
|
15
|
+
class SpoFolderSharingLinkRemoveCommand extends SpoCommand {
|
|
16
|
+
get name() {
|
|
17
|
+
return commands.FOLDER_SHARINGLINK_REMOVE;
|
|
18
|
+
}
|
|
19
|
+
get description() {
|
|
20
|
+
return 'Removes a sharing link from a folder';
|
|
21
|
+
}
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
_SpoFolderSharingLinkRemoveCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkRemoveCommand_instances, "m", _SpoFolderSharingLinkRemoveCommand_initTelemetry).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkRemoveCommand_instances, "m", _SpoFolderSharingLinkRemoveCommand_initOptions).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkRemoveCommand_instances, "m", _SpoFolderSharingLinkRemoveCommand_initOptionSets).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkRemoveCommand_instances, "m", _SpoFolderSharingLinkRemoveCommand_initValidators).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkRemoveCommand_instances, "m", _SpoFolderSharingLinkRemoveCommand_initTypes).call(this);
|
|
30
|
+
}
|
|
31
|
+
async commandAction(logger, args) {
|
|
32
|
+
const removeSharingLink = async () => {
|
|
33
|
+
if (this.verbose) {
|
|
34
|
+
await logger.logToStderr(`Removing sharing link of folder ${args.options.folderId || args.options.folderUrl} with id ${args.options.id}...`);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const relFolderUrl = await spo.getFolderServerRelativeUrl(args.options.webUrl, args.options.folderUrl, args.options.folderId, logger, args.options.verbose);
|
|
38
|
+
const absoluteFolderUrl = urlUtil.getAbsoluteUrl(args.options.webUrl, relFolderUrl);
|
|
39
|
+
const folderUrl = new URL(absoluteFolderUrl);
|
|
40
|
+
const siteId = await spo.getSiteId(args.options.webUrl);
|
|
41
|
+
const driveDetails = await drive.getDriveByUrl(siteId, folderUrl, logger, args.options.verbose);
|
|
42
|
+
const itemId = await drive.getDriveItemId(driveDetails, folderUrl, logger, args.options.verbose);
|
|
43
|
+
const requestOptions = {
|
|
44
|
+
url: `https://graph.microsoft.com/v1.0/drives/${driveDetails.id}/items/${itemId}/permissions/${args.options.id}`,
|
|
45
|
+
headers: {
|
|
46
|
+
accept: 'application/json;odata.metadata=none'
|
|
47
|
+
},
|
|
48
|
+
responseType: 'json'
|
|
49
|
+
};
|
|
50
|
+
return request.delete(requestOptions);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
this.handleRejectedODataJsonPromise(err);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
if (args.options.force) {
|
|
57
|
+
await removeSharingLink();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove sharing link ${args.options.id} of folder ${args.options.folderUrl || args.options.folderId}?` });
|
|
61
|
+
if (result) {
|
|
62
|
+
await removeSharingLink();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
_SpoFolderSharingLinkRemoveCommand_instances = new WeakSet(), _SpoFolderSharingLinkRemoveCommand_initTelemetry = function _SpoFolderSharingLinkRemoveCommand_initTelemetry() {
|
|
68
|
+
this.telemetry.push((args) => {
|
|
69
|
+
Object.assign(this.telemetryProperties, {
|
|
70
|
+
folderUrl: typeof args.options.folderUrl !== 'undefined',
|
|
71
|
+
folderId: typeof args.options.folderId !== 'undefined',
|
|
72
|
+
force: !!args.options.force
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}, _SpoFolderSharingLinkRemoveCommand_initOptions = function _SpoFolderSharingLinkRemoveCommand_initOptions() {
|
|
76
|
+
this.options.unshift({ option: '-u, --webUrl <webUrl>' }, { option: '--folderUrl [folderUrl]' }, { option: '--folderId [folderId]' }, { option: '-i, --id <id>' }, { option: '-f, --force' });
|
|
77
|
+
}, _SpoFolderSharingLinkRemoveCommand_initOptionSets = function _SpoFolderSharingLinkRemoveCommand_initOptionSets() {
|
|
78
|
+
this.optionSets.push({ options: ['folderUrl', 'folderId'] });
|
|
79
|
+
}, _SpoFolderSharingLinkRemoveCommand_initValidators = function _SpoFolderSharingLinkRemoveCommand_initValidators() {
|
|
80
|
+
this.validators.push(async (args) => {
|
|
81
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
82
|
+
if (isValidSharePointUrl !== true) {
|
|
83
|
+
return isValidSharePointUrl;
|
|
84
|
+
}
|
|
85
|
+
if (args.options.folderId && !validation.isValidGuid(args.options.folderId)) {
|
|
86
|
+
return `${args.options.folderId} is not a valid GUID`;
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
});
|
|
90
|
+
}, _SpoFolderSharingLinkRemoveCommand_initTypes = function _SpoFolderSharingLinkRemoveCommand_initTypes() {
|
|
91
|
+
this.types.string.push('webUrl', 'folderUrl', 'folderId', 'id');
|
|
92
|
+
this.types.boolean.push('force');
|
|
93
|
+
};
|
|
94
|
+
export default new SpoFolderSharingLinkRemoveCommand();
|
|
95
|
+
//# sourceMappingURL=folder-sharinglink-remove.js.map
|
|
@@ -22,6 +22,7 @@ class SpoListGetCommand extends SpoCommand {
|
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
24
24
|
_SpoListGetCommand_instances.add(this);
|
|
25
|
+
this.supportedBaseTemplates = [101, 109, 110, 111, 113, 114, 115, 116, 117, 119, 121, 122, 123, 126, 130, 175];
|
|
25
26
|
__classPrivateFieldGet(this, _SpoListGetCommand_instances, "m", _SpoListGetCommand_initTelemetry).call(this);
|
|
26
27
|
__classPrivateFieldGet(this, _SpoListGetCommand_instances, "m", _SpoListGetCommand_initOptions).call(this);
|
|
27
28
|
__classPrivateFieldGet(this, _SpoListGetCommand_instances, "m", _SpoListGetCommand_initValidators).call(this);
|
|
@@ -50,11 +51,8 @@ class SpoListGetCommand extends SpoCommand {
|
|
|
50
51
|
if (fieldsProperties.expandProperties.length > 0) {
|
|
51
52
|
queryParams.push(`$expand=${fieldsProperties.expandProperties.join(',')}`);
|
|
52
53
|
}
|
|
53
|
-
if (queryParams.length === 0) {
|
|
54
|
-
queryParams.push(`$expand=VersionPolicies`);
|
|
55
|
-
}
|
|
56
54
|
const requestOptions = {
|
|
57
|
-
url: `${requestUrl}
|
|
55
|
+
url: `${requestUrl}${queryParams.length > 0 ? `?${queryParams.join('&')}` : ''}`,
|
|
58
56
|
headers: {
|
|
59
57
|
'accept': 'application/json;odata=nometadata'
|
|
60
58
|
},
|
|
@@ -67,6 +65,9 @@ class SpoListGetCommand extends SpoCommand {
|
|
|
67
65
|
r.Member.PrincipalTypeString = ListPrincipalType[r.Member.PrincipalType];
|
|
68
66
|
});
|
|
69
67
|
}
|
|
68
|
+
if (this.supportedBaseTemplates.some(template => template === listInstance.BaseTemplate)) {
|
|
69
|
+
await this.retrieveVersionPolicies(requestUrl, listInstance);
|
|
70
|
+
}
|
|
70
71
|
if (listInstance.VersionPolicies) {
|
|
71
72
|
listInstance.VersionPolicies.DefaultTrimModeValue = DefaultTrimModeType[listInstance.VersionPolicies.DefaultTrimMode];
|
|
72
73
|
}
|
|
@@ -96,6 +97,18 @@ class SpoListGetCommand extends SpoCommand {
|
|
|
96
97
|
expandProperties: [...new Set(expandProperties)]
|
|
97
98
|
};
|
|
98
99
|
}
|
|
100
|
+
async retrieveVersionPolicies(requestUrl, listInstance) {
|
|
101
|
+
const requestOptions = {
|
|
102
|
+
url: `${requestUrl}?$select=VersionPolicies&$expand=VersionPolicies`,
|
|
103
|
+
headers: {
|
|
104
|
+
'accept': 'application/json;odata=nometadata'
|
|
105
|
+
},
|
|
106
|
+
responseType: 'json'
|
|
107
|
+
};
|
|
108
|
+
const { VersionPolicies } = await request.get(requestOptions);
|
|
109
|
+
listInstance.VersionPolicies = VersionPolicies;
|
|
110
|
+
listInstance.VersionPolicies.DefaultTrimModeValue = DefaultTrimModeType[listInstance.VersionPolicies.DefaultTrimMode];
|
|
111
|
+
}
|
|
99
112
|
}
|
|
100
113
|
_SpoListGetCommand_instances = new WeakSet(), _SpoListGetCommand_initTelemetry = function _SpoListGetCommand_initTelemetry() {
|
|
101
114
|
this.telemetry.push((args) => {
|
|
@@ -3,13 +3,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoPageSectionAddCommand_instances,
|
|
6
|
+
var _SpoPageSectionAddCommand_instances, _SpoPageSectionAddCommand_initTelemetry, _SpoPageSectionAddCommand_initOptions, _SpoPageSectionAddCommand_initValidators, _SpoPageSectionAddCommand_initTypes;
|
|
7
|
+
import { v4 } from 'uuid';
|
|
7
8
|
import request from '../../../../request.js';
|
|
8
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
10
|
import { validation } from '../../../../utils/validation.js';
|
|
10
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
12
|
import commands from '../../commands.js';
|
|
12
|
-
import { CanvasSectionTemplate
|
|
13
|
+
import { CanvasSectionTemplate } from './clientsidepages.js';
|
|
13
14
|
class SpoPageSectionAddCommand extends SpoCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.PAGE_SECTION_ADD;
|
|
@@ -20,13 +21,18 @@ class SpoPageSectionAddCommand extends SpoCommand {
|
|
|
20
21
|
constructor() {
|
|
21
22
|
super();
|
|
22
23
|
_SpoPageSectionAddCommand_instances.add(this);
|
|
24
|
+
this.sectionTemplate = ['OneColumn', 'OneColumnFullWidth', 'TwoColumn', 'ThreeColumn', 'TwoColumnLeft', 'TwoColumnRight', 'Vertical'];
|
|
25
|
+
this.zoneEmphasis = ['None', 'Neutral', 'Soft', 'Strong', 'Image', 'Gradient'];
|
|
26
|
+
this.iconAlignment = ['Left', 'Right'];
|
|
27
|
+
this.fillMode = ['ScaleToFill', 'ScaleToFit', 'Tile', 'OriginalSize'];
|
|
23
28
|
__classPrivateFieldGet(this, _SpoPageSectionAddCommand_instances, "m", _SpoPageSectionAddCommand_initTelemetry).call(this);
|
|
24
29
|
__classPrivateFieldGet(this, _SpoPageSectionAddCommand_instances, "m", _SpoPageSectionAddCommand_initOptions).call(this);
|
|
25
30
|
__classPrivateFieldGet(this, _SpoPageSectionAddCommand_instances, "m", _SpoPageSectionAddCommand_initValidators).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoPageSectionAddCommand_instances, "m", _SpoPageSectionAddCommand_initTypes).call(this);
|
|
26
32
|
}
|
|
27
33
|
async commandAction(logger, args) {
|
|
28
34
|
let pageFullName = args.options.pageName.toLowerCase();
|
|
29
|
-
if (pageFullName.
|
|
35
|
+
if (!pageFullName.endsWith('.aspx')) {
|
|
30
36
|
pageFullName += '.aspx';
|
|
31
37
|
}
|
|
32
38
|
let canvasContent;
|
|
@@ -66,11 +72,22 @@ class SpoPageSectionAddCommand extends SpoCommand {
|
|
|
66
72
|
.sort();
|
|
67
73
|
// zoneIndex for the new section to add
|
|
68
74
|
const zoneIndex = this.getSectionIndex(zoneIndices, args.options.order);
|
|
75
|
+
let zoneId;
|
|
76
|
+
let backgroundControlToAdd = undefined;
|
|
77
|
+
if (args.options.zoneEmphasis && ['image', 'gradient'].includes(args.options.zoneEmphasis.toLowerCase())) {
|
|
78
|
+
zoneId = v4();
|
|
79
|
+
// get background control based on control type 14
|
|
80
|
+
const backgroundControl = canvasContent.find(c => c.controlType === 14);
|
|
81
|
+
backgroundControlToAdd = this.setBackgroundControl(zoneId, backgroundControl, args);
|
|
82
|
+
if (!backgroundControl) {
|
|
83
|
+
canvasContent.push(backgroundControlToAdd);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
69
86
|
// get the list of columns to insert based on the selected template
|
|
70
|
-
const columnsToAdd = this.getColumns(zoneIndex, args
|
|
87
|
+
const columnsToAdd = this.getColumns(zoneIndex, args, zoneId);
|
|
71
88
|
// insert the column in the right place in the array so that
|
|
72
89
|
// it stays sorted ascending by zoneIndex
|
|
73
|
-
let pos = canvasContent.findIndex(c => typeof c.controlType === 'undefined' && c.position.zoneIndex > zoneIndex);
|
|
90
|
+
let pos = canvasContent.findIndex(c => typeof c.controlType === 'undefined' && c.position && c.position.zoneIndex > zoneIndex);
|
|
74
91
|
if (pos === -1) {
|
|
75
92
|
pos = canvasContent.length - 1;
|
|
76
93
|
}
|
|
@@ -107,71 +124,146 @@ class SpoPageSectionAddCommand extends SpoCommand {
|
|
|
107
124
|
}
|
|
108
125
|
return zoneIndices[order - 2] + ((zoneIndices[order - 1] - zoneIndices[order - 2]) / 2);
|
|
109
126
|
}
|
|
110
|
-
getColumns(zoneIndex,
|
|
127
|
+
getColumns(zoneIndex, args, zoneId) {
|
|
111
128
|
const columns = [];
|
|
112
129
|
let sectionIndex = 1;
|
|
113
|
-
switch (sectionTemplate) {
|
|
130
|
+
switch (args.options.sectionTemplate) {
|
|
114
131
|
case 'OneColumnFullWidth':
|
|
115
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 0,
|
|
132
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 0, args, zoneId));
|
|
116
133
|
break;
|
|
117
134
|
case 'TwoColumn':
|
|
118
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 6,
|
|
119
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 6,
|
|
135
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 6, args, zoneId));
|
|
136
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 6, args, zoneId));
|
|
120
137
|
break;
|
|
121
138
|
case 'ThreeColumn':
|
|
122
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4,
|
|
123
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4,
|
|
124
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4,
|
|
139
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, args, zoneId));
|
|
140
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, args, zoneId));
|
|
141
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, args, zoneId));
|
|
125
142
|
break;
|
|
126
143
|
case 'TwoColumnLeft':
|
|
127
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 8,
|
|
128
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4,
|
|
144
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 8, args, zoneId));
|
|
145
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, args, zoneId));
|
|
129
146
|
break;
|
|
130
147
|
case 'TwoColumnRight':
|
|
131
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4,
|
|
132
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 8,
|
|
148
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 4, args, zoneId));
|
|
149
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 8, args, zoneId));
|
|
133
150
|
break;
|
|
134
151
|
case 'Vertical':
|
|
135
|
-
columns.push(this.getVerticalColumn(
|
|
152
|
+
columns.push(this.getVerticalColumn(args, zoneId));
|
|
136
153
|
break;
|
|
137
154
|
case 'OneColumn':
|
|
138
155
|
default:
|
|
139
|
-
columns.push(this.getColumn(zoneIndex, sectionIndex++, 12,
|
|
156
|
+
columns.push(this.getColumn(zoneIndex, sectionIndex++, 12, args, zoneId));
|
|
140
157
|
break;
|
|
141
158
|
}
|
|
142
159
|
return columns;
|
|
143
160
|
}
|
|
144
|
-
getColumn(zoneIndex, sectionIndex, sectionFactor,
|
|
161
|
+
getColumn(zoneIndex, sectionIndex, sectionFactor, args, zoneId) {
|
|
162
|
+
const { zoneEmphasis, isCollapsibleSection, isExpanded, showDivider, iconAlignment } = args.options;
|
|
145
163
|
const columnValue = {
|
|
146
164
|
displayMode: 2,
|
|
147
165
|
position: {
|
|
148
166
|
zoneIndex: zoneIndex,
|
|
149
167
|
sectionIndex: sectionIndex,
|
|
150
168
|
sectionFactor: sectionFactor,
|
|
151
|
-
layoutIndex: 1
|
|
169
|
+
layoutIndex: 1,
|
|
170
|
+
zoneId: zoneId
|
|
152
171
|
},
|
|
153
172
|
emphasis: {}
|
|
154
173
|
};
|
|
155
|
-
if (zoneEmphasis) {
|
|
156
|
-
|
|
174
|
+
if (zoneEmphasis && ['none', 'neutral', 'soft', 'strong'].includes(zoneEmphasis?.toLocaleLowerCase())) {
|
|
175
|
+
// Just these zoneEmphasis values should be added to column emphasis
|
|
176
|
+
const zoneEmphasisValue = ['none', 'neutral', 'soft', 'strong'].indexOf(zoneEmphasis.toLocaleLowerCase());
|
|
157
177
|
columnValue.emphasis = { zoneEmphasis: zoneEmphasisValue };
|
|
158
178
|
}
|
|
179
|
+
if (isCollapsibleSection) {
|
|
180
|
+
columnValue.zoneGroupMetadata = {
|
|
181
|
+
type: 1,
|
|
182
|
+
isExpanded: !!isExpanded,
|
|
183
|
+
showDividerLine: !!showDivider,
|
|
184
|
+
iconAlignment: iconAlignment && iconAlignment.toLocaleLowerCase() === "right" ? "right" : "left"
|
|
185
|
+
};
|
|
186
|
+
}
|
|
159
187
|
return columnValue;
|
|
160
188
|
}
|
|
161
|
-
getVerticalColumn(
|
|
162
|
-
const columnValue = this.getColumn(1, 1, 12,
|
|
163
|
-
columnValue.position.isLayoutReflowOnTop = isLayoutReflowOnTop !== undefined
|
|
189
|
+
getVerticalColumn(args, zoneId) {
|
|
190
|
+
const columnValue = this.getColumn(1, 1, 12, args, zoneId);
|
|
191
|
+
columnValue.position.isLayoutReflowOnTop = args.options.isLayoutReflowOnTop !== undefined;
|
|
164
192
|
columnValue.position.layoutIndex = 2;
|
|
165
193
|
columnValue.position.controlIndex = 1;
|
|
166
194
|
return columnValue;
|
|
167
195
|
}
|
|
196
|
+
setBackgroundControl(zoneId, backgroundControl, args) {
|
|
197
|
+
const { overlayColor, overlayOpacity, useLightText, imageUrl } = args.options;
|
|
198
|
+
const backgroundDetails = this.getBackgroundDetails(args);
|
|
199
|
+
if (!backgroundControl) {
|
|
200
|
+
backgroundControl = {
|
|
201
|
+
controlType: 14,
|
|
202
|
+
webPartData: {
|
|
203
|
+
properties: {
|
|
204
|
+
zoneBackground: {}
|
|
205
|
+
},
|
|
206
|
+
serverProcessedContent: {
|
|
207
|
+
htmlStrings: {},
|
|
208
|
+
searchablePlainTexts: {},
|
|
209
|
+
imageSources: {},
|
|
210
|
+
links: {}
|
|
211
|
+
},
|
|
212
|
+
dataVersion: "1.0"
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
backgroundControl.webPartData.properties.zoneBackground[zoneId] = {
|
|
217
|
+
...backgroundDetails,
|
|
218
|
+
useLightText: !!useLightText,
|
|
219
|
+
overlay: {
|
|
220
|
+
color: overlayColor ? overlayColor : "#FFFFFF",
|
|
221
|
+
opacity: overlayOpacity ? overlayOpacity : 60
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
if (imageUrl && backgroundControl.webPartData.serverProcessedContent.imageSources) {
|
|
225
|
+
backgroundControl.webPartData.serverProcessedContent.imageSources[`zoneBackground.${zoneId}.imageData.url`] = imageUrl;
|
|
226
|
+
}
|
|
227
|
+
return backgroundControl;
|
|
228
|
+
}
|
|
229
|
+
getBackgroundDetails(args) {
|
|
230
|
+
const { gradientText, imageUrl, imageHeight, imageWidth, fillMode } = args.options;
|
|
231
|
+
const backgroundDetails = {};
|
|
232
|
+
if (gradientText) {
|
|
233
|
+
backgroundDetails.type = "gradient";
|
|
234
|
+
backgroundDetails.gradient = gradientText;
|
|
235
|
+
}
|
|
236
|
+
if (imageUrl) {
|
|
237
|
+
backgroundDetails.type = "image";
|
|
238
|
+
backgroundDetails.imageData = {
|
|
239
|
+
source: 2,
|
|
240
|
+
fileName: "sectionbackground.jpg",
|
|
241
|
+
height: imageHeight ? imageHeight : 955,
|
|
242
|
+
width: imageWidth ? imageWidth : 555
|
|
243
|
+
};
|
|
244
|
+
backgroundDetails.fillMode = fillMode ? this.fillMode.indexOf(fillMode) : 0;
|
|
245
|
+
}
|
|
246
|
+
return backgroundDetails;
|
|
247
|
+
}
|
|
168
248
|
}
|
|
169
|
-
|
|
249
|
+
_SpoPageSectionAddCommand_instances = new WeakSet(), _SpoPageSectionAddCommand_initTelemetry = function _SpoPageSectionAddCommand_initTelemetry() {
|
|
170
250
|
this.telemetry.push((args) => {
|
|
171
251
|
Object.assign(this.telemetryProperties, {
|
|
172
252
|
order: typeof args.options.order !== 'undefined',
|
|
173
253
|
zoneEmphasis: typeof args.options.zoneEmphasis !== 'undefined',
|
|
174
|
-
isLayoutReflowOnTop: !!args.options.isLayoutReflowOnTop
|
|
254
|
+
isLayoutReflowOnTop: !!args.options.isLayoutReflowOnTop,
|
|
255
|
+
isCollapsibleSection: !!args.options.isCollapsibleSection,
|
|
256
|
+
showDivider: !!typeof args.options.showDivider,
|
|
257
|
+
iconAlignment: typeof args.options.iconAlignment !== 'undefined',
|
|
258
|
+
isExpanded: !!args.options.isExpanded,
|
|
259
|
+
gradientText: typeof args.options.gradientText !== 'undefined',
|
|
260
|
+
imageUrl: typeof args.options.imageUrl !== 'undefined',
|
|
261
|
+
imageHeight: typeof args.options.imageHeight !== 'undefined',
|
|
262
|
+
imageWidth: typeof args.options.imageWidth !== 'undefined',
|
|
263
|
+
fillMode: typeof args.options.fillMode !== 'undefined',
|
|
264
|
+
useLightText: !!args.options.useLightText,
|
|
265
|
+
overlayColor: typeof args.options.overlayColor !== 'undefined',
|
|
266
|
+
overlayOpacity: typeof args.options.overlayOpacity !== 'undefined'
|
|
175
267
|
});
|
|
176
268
|
});
|
|
177
269
|
}, _SpoPageSectionAddCommand_initOptions = function _SpoPageSectionAddCommand_initOptions() {
|
|
@@ -181,14 +273,40 @@ _a = SpoPageSectionAddCommand, _SpoPageSectionAddCommand_instances = new WeakSet
|
|
|
181
273
|
option: '-u, --webUrl <webUrl>'
|
|
182
274
|
}, {
|
|
183
275
|
option: '-t, --sectionTemplate <sectionTemplate>',
|
|
184
|
-
autocomplete:
|
|
276
|
+
autocomplete: this.sectionTemplate
|
|
185
277
|
}, {
|
|
186
278
|
option: '--order [order]'
|
|
187
279
|
}, {
|
|
188
280
|
option: '--zoneEmphasis [zoneEmphasis]',
|
|
189
|
-
autocomplete:
|
|
281
|
+
autocomplete: this.zoneEmphasis
|
|
190
282
|
}, {
|
|
191
283
|
option: '--isLayoutReflowOnTop'
|
|
284
|
+
}, {
|
|
285
|
+
option: '--isCollapsibleSection'
|
|
286
|
+
}, {
|
|
287
|
+
option: '--showDivider'
|
|
288
|
+
}, {
|
|
289
|
+
option: '--iconAlignment [iconAlignment]',
|
|
290
|
+
autocomplete: this.iconAlignment
|
|
291
|
+
}, {
|
|
292
|
+
option: '--isExpanded'
|
|
293
|
+
}, {
|
|
294
|
+
option: '--gradientText [gradientText]'
|
|
295
|
+
}, {
|
|
296
|
+
option: '--imageUrl [imageUrl]'
|
|
297
|
+
}, {
|
|
298
|
+
option: '--imageHeight [imageHeight]'
|
|
299
|
+
}, {
|
|
300
|
+
option: '--imageWidth [imageWidth]'
|
|
301
|
+
}, {
|
|
302
|
+
option: '--fillMode [fillMode]',
|
|
303
|
+
autocomplete: this.fillMode
|
|
304
|
+
}, {
|
|
305
|
+
option: '--useLightText'
|
|
306
|
+
}, {
|
|
307
|
+
option: '--overlayColor [overlayColor]'
|
|
308
|
+
}, {
|
|
309
|
+
option: '--overlayOpacity [overlayOpacity]'
|
|
192
310
|
});
|
|
193
311
|
}, _SpoPageSectionAddCommand_initValidators = function _SpoPageSectionAddCommand_initValidators() {
|
|
194
312
|
this.validators.push(async (args) => {
|
|
@@ -201,8 +319,8 @@ _a = SpoPageSectionAddCommand, _SpoPageSectionAddCommand_instances = new WeakSet
|
|
|
201
319
|
}
|
|
202
320
|
}
|
|
203
321
|
if (typeof args.options.zoneEmphasis !== 'undefined') {
|
|
204
|
-
if (!(args.options.zoneEmphasis
|
|
205
|
-
return
|
|
322
|
+
if (!this.zoneEmphasis.some(zoneEmphasisValue => zoneEmphasisValue.toLocaleLowerCase() === args.options.zoneEmphasis?.toLowerCase())) {
|
|
323
|
+
return `The value of parameter zoneEmphasis must be ${this.zoneEmphasis.join(', ')}`;
|
|
206
324
|
}
|
|
207
325
|
}
|
|
208
326
|
if (typeof args.options.isLayoutReflowOnTop !== 'undefined') {
|
|
@@ -210,10 +328,43 @@ _a = SpoPageSectionAddCommand, _SpoPageSectionAddCommand_instances = new WeakSet
|
|
|
210
328
|
return 'Specify isLayoutReflowOnTop when the sectionTemplate is set to Vertical.';
|
|
211
329
|
}
|
|
212
330
|
}
|
|
331
|
+
if (typeof args.options.iconAlignment !== 'undefined') {
|
|
332
|
+
if (!this.iconAlignment.some(iconAlignmentValue => iconAlignmentValue.toLocaleLowerCase() === args.options.iconAlignment?.toLowerCase())) {
|
|
333
|
+
return `The value of parameter iconAlignment must be ${this.iconAlignment.join(', ')}`;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (typeof args.options.fillMode !== 'undefined') {
|
|
337
|
+
if (!this.fillMode.some(fillModeValue => fillModeValue.toLocaleLowerCase() === args.options.fillMode?.toLowerCase())) {
|
|
338
|
+
return `The value of parameter fillMode must be ${this.fillMode.join(', ')}`;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (args.options.zoneEmphasis?.toLocaleLowerCase() !== 'image' && (args.options.imageUrl || args.options.imageWidth ||
|
|
342
|
+
args.options.imageHeight || args.options.fillMode)) {
|
|
343
|
+
return 'Specify imageUrl, imageWidth, imageHeight or fillMode only when zoneEmphasis is set to Image';
|
|
344
|
+
}
|
|
345
|
+
if (args.options.zoneEmphasis?.toLocaleLowerCase() === 'image' && !args.options.imageUrl) {
|
|
346
|
+
return 'Specify imageUrl when zoneEmphasis is set to Image';
|
|
347
|
+
}
|
|
348
|
+
if (args.options.zoneEmphasis?.toLowerCase() !== 'gradient' && args.options.gradientText) {
|
|
349
|
+
return 'Specify gradientText only when zoneEmphasis is set to Gradient';
|
|
350
|
+
}
|
|
351
|
+
if (args.options.zoneEmphasis?.toLowerCase() === 'gradient' && !args.options.gradientText) {
|
|
352
|
+
return 'Specify gradientText when zoneEmphasis is set to Gradient';
|
|
353
|
+
}
|
|
354
|
+
if (args.options.overlayOpacity && (args.options.overlayOpacity < 0 || args.options.overlayOpacity > 100)) {
|
|
355
|
+
return 'The value of parameter overlayOpacity must be between 0 and 100';
|
|
356
|
+
}
|
|
357
|
+
if (args.options.overlayColor && !/^#[0-9a-f]{6}$/i.test(args.options.overlayColor)) {
|
|
358
|
+
return 'The value of parameter overlayColor must be a valid hex color';
|
|
359
|
+
}
|
|
360
|
+
if (!(args.options.zoneEmphasis && ['image', 'gradient'].includes(args.options.zoneEmphasis.toLowerCase())) && (args.options.overlayColor || args.options.overlayOpacity || args.options.useLightText)) {
|
|
361
|
+
return 'Specify overlayColor or overlayOpacity only when zoneEmphasis is set to Image or Gradient';
|
|
362
|
+
}
|
|
213
363
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
214
364
|
});
|
|
365
|
+
}, _SpoPageSectionAddCommand_initTypes = function _SpoPageSectionAddCommand_initTypes() {
|
|
366
|
+
this.types.string = ['pageName', 'webUrl', 'sectionTemplate', 'zoneEmphasis', 'iconAlignment', 'gradientText', 'imageUrl', 'fillMode', 'overlayColor'];
|
|
367
|
+
this.types.boolean = ['isLayoutReflowOnTop', 'isCollapsibleSection', 'showDivider', 'isExpanded', 'useLightText'];
|
|
215
368
|
};
|
|
216
|
-
SpoPageSectionAddCommand.SectionTemplate = ['OneColumn', 'OneColumnFullWidth', 'TwoColumn', 'ThreeColumn', 'TwoColumnLeft', 'TwoColumnRight', 'Vertical'];
|
|
217
|
-
SpoPageSectionAddCommand.ZoneEmphasis = ['None', 'Neutral', 'Soft', 'Strong'];
|
|
218
369
|
export default new SpoPageSectionAddCommand();
|
|
219
370
|
//# sourceMappingURL=page-section-add.js.map
|