@pnp/cli-microsoft365 12.0.0-beta.235caf5 → 12.0.0-beta.445fe0a
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/Command.js +11 -8
- package/dist/cli/cli.js +31 -18
- package/dist/config.js +1 -0
- package/dist/m365/entra/commands/agent/agent-blueprintprincipal-list.js +56 -0
- package/dist/m365/entra/commands.js +1 -0
- package/dist/m365/spe/commands/container/container-activate.js +8 -16
- package/dist/m365/spe/commands/container/container-list.js +21 -42
- package/dist/m365/spe/commands/containertype/containertype-list.js +5 -0
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.1.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027004_OVERRIDES_serialize_javascript.js +34 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.1.js +57 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +38 -71
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +25 -59
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +11 -34
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +25 -54
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +52 -83
- package/dist/m365/spo/commands/apppage/apppage-add.js +21 -39
- package/dist/m365/spo/commands/apppage/apppage-set.js +20 -30
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +39 -65
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +28 -56
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +40 -68
- package/dist/m365/spo/commands/externaluser/externaluser-list.js +24 -66
- package/dist/m365/spo/commands/group/group-add.js +19 -60
- package/dist/m365/spo/commands/group/group-get.js +32 -45
- package/dist/m365/spo/commands/group/group-list.js +13 -27
- package/dist/m365/spo/commands/group/group-member-add.js +52 -84
- package/dist/m365/spo/commands/group/group-member-list.js +24 -38
- package/dist/m365/spo/commands/group/group-member-remove.js +49 -68
- package/dist/m365/spo/commands/group/group-remove.js +25 -45
- package/dist/m365/spo/commands/group/group-set.js +36 -79
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +15 -49
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +5 -0
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +9 -17
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-list.js +5 -0
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +11 -27
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-set.js +10 -18
- package/dist/m365/spo/commands/propertybag/propertybag-get.js +14 -29
- package/dist/m365/spo/commands/propertybag/propertybag-list.js +13 -27
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +15 -32
- package/dist/m365/spo/commands/propertybag/propertybag-set.js +15 -31
- package/dist/m365/spo/commands/roledefinition/roledefinition-add.js +45 -44
- package/dist/m365/spo/commands/roledefinition/roledefinition-get.js +14 -25
- package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +12 -18
- package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +15 -35
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-add.js +9 -17
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +5 -0
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-revoke.js +9 -17
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +29 -39
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-deny.js +10 -23
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +5 -0
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +19 -28
- package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +24 -59
- package/dist/m365/spo/commands/sitedesign/sitedesign-apply.js +10 -34
- package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +19 -36
- package/dist/m365/spo/commands/sitedesign/sitedesign-list.js +8 -0
- package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +9 -32
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-grant.js +10 -31
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-list.js +8 -23
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +10 -34
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-list.js +9 -38
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-status-get.js +9 -29
- package/dist/m365/spo/commands/sitedesign/sitedesign-set.js +27 -80
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-get.js +8 -23
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-list.js +8 -18
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +9 -32
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +15 -46
- package/dist/m365/spo/commands/tenant/tenant-appcatalogurl-get.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +12 -56
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +5 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +47 -79
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +15 -53
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +25 -50
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +5 -1
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +41 -65
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-list.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +10 -30
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +8 -21
- package/dist/m365/spo/commands/tenant/tenant-settings-list.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +104 -386
- package/dist/m365/spo/commands/term/term-add.js +95 -110
- package/dist/m365/spo/commands/term/term-get.js +63 -75
- package/dist/m365/spo/commands/term/term-group-add.js +11 -41
- package/dist/m365/spo/commands/term/term-group-get.js +16 -47
- package/dist/m365/spo/commands/term/term-group-list.js +9 -34
- package/dist/m365/spo/commands/term/term-list.js +42 -57
- package/dist/m365/spo/commands/term/term-set-add.js +50 -71
- package/dist/m365/spo/commands/term/term-set-get.js +41 -58
- package/dist/m365/spo/commands/term/term-set-list.js +16 -47
- package/dist/m365/spo/commands/theme/theme-apply.js +27 -43
- package/dist/m365/spo/commands/theme/theme-get.js +8 -15
- package/dist/m365/spo/commands/theme/theme-list.js +5 -0
- package/dist/m365/spo/commands/theme/theme-remove.js +9 -24
- package/dist/m365/spo/commands/theme/theme-set.js +12 -34
- package/dist/m365/tenant/commands/id/id-get.js +8 -22
- package/dist/m365/tenant/commands/info/info-get.js +23 -36
- package/dist/m365/tenant/commands/people/people-profilecardproperty-add.js +67 -55
- package/dist/m365/tenant/commands/people/people-profilecardproperty-get.js +11 -24
- package/dist/m365/tenant/commands/people/people-profilecardproperty-list.js +5 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-remove.js +12 -33
- package/dist/m365/tenant/commands/people/people-profilecardproperty-set.js +31 -51
- package/dist/m365/tenant/commands/people/people-pronouns-get.js +5 -0
- package/dist/m365/tenant/commands/people/profileCardProperties.js +10 -7
- package/dist/m365/tenant/commands/security/security-alerts-list.js +8 -20
- package/dist/utils/validation.js +12 -0
- package/dist/utils/zod.js +1 -0
- package/docs/docs/cmd/entra/agent/agent-blueprintprincipal-list.mdx +156 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
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 _SpoSiteDesignRunListCommand_instances, _SpoSiteDesignRunListCommand_initTelemetry, _SpoSiteDesignRunListCommand_initOptions, _SpoSiteDesignRunListCommand_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.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string().refine(val => validation.isValidSharePointUrl(val) === true, { message: 'The value is not a valid SharePoint Online site URL.' }).alias('u'),
|
|
10
|
+
siteDesignId: z.string().refine(val => validation.isValidGuid(val), { message: 'The value must be a valid GUID.' }).optional().alias('i')
|
|
11
|
+
});
|
|
11
12
|
class SpoSiteDesignRunListCommand extends SpoCommand {
|
|
12
13
|
get name() {
|
|
13
14
|
return commands.SITEDESIGN_RUN_LIST;
|
|
@@ -18,12 +19,8 @@ class SpoSiteDesignRunListCommand extends SpoCommand {
|
|
|
18
19
|
defaultProperties() {
|
|
19
20
|
return ['ID', 'SiteDesignID', 'SiteDesignTitle', 'StartTime'];
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_SpoSiteDesignRunListCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoSiteDesignRunListCommand_instances, "m", _SpoSiteDesignRunListCommand_initTelemetry).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoSiteDesignRunListCommand_instances, "m", _SpoSiteDesignRunListCommand_initOptions).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoSiteDesignRunListCommand_instances, "m", _SpoSiteDesignRunListCommand_initValidators).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
27
24
|
}
|
|
28
25
|
async commandAction(logger, args) {
|
|
29
26
|
const data = {};
|
|
@@ -53,31 +50,5 @@ class SpoSiteDesignRunListCommand extends SpoCommand {
|
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
|
-
_SpoSiteDesignRunListCommand_instances = new WeakSet(), _SpoSiteDesignRunListCommand_initTelemetry = function _SpoSiteDesignRunListCommand_initTelemetry() {
|
|
57
|
-
this.telemetry.push((args) => {
|
|
58
|
-
Object.assign(this.telemetryProperties, {
|
|
59
|
-
siteDesignId: typeof args.options.siteDesignId !== 'undefined'
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}, _SpoSiteDesignRunListCommand_initOptions = function _SpoSiteDesignRunListCommand_initOptions() {
|
|
63
|
-
this.options.unshift({
|
|
64
|
-
option: '-u, --webUrl <webUrl>'
|
|
65
|
-
}, {
|
|
66
|
-
option: '-i, --siteDesignId [siteDesignId]'
|
|
67
|
-
});
|
|
68
|
-
}, _SpoSiteDesignRunListCommand_initValidators = function _SpoSiteDesignRunListCommand_initValidators() {
|
|
69
|
-
this.validators.push(async (args) => {
|
|
70
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
71
|
-
if (isValidSharePointUrl !== true) {
|
|
72
|
-
return isValidSharePointUrl;
|
|
73
|
-
}
|
|
74
|
-
if (args.options.siteDesignId) {
|
|
75
|
-
if (!validation.isValidGuid(args.options.siteDesignId)) {
|
|
76
|
-
return `${args.options.siteDesignId} is not a valid GUID`;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return true;
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
53
|
export default new SpoSiteDesignRunListCommand();
|
|
83
54
|
//# sourceMappingURL=sitedesign-run-list.js.map
|
|
@@ -1,13 +1,14 @@
|
|
|
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 _SpoSiteDesignRunStatusGetCommand_instances, _SpoSiteDesignRunStatusGetCommand_initOptions, _SpoSiteDesignRunStatusGetCommand_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.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string().refine(val => validation.isValidSharePointUrl(val) === true, { message: 'The value is not a valid SharePoint Online site URL.' }).alias('u'),
|
|
10
|
+
runId: z.string().refine(val => validation.isValidGuid(val), { message: 'The value must be a valid GUID.' }).alias('i')
|
|
11
|
+
});
|
|
11
12
|
class SpoSiteDesignRunStatusGetCommand extends SpoCommand {
|
|
12
13
|
get name() {
|
|
13
14
|
return commands.SITEDESIGN_RUN_STATUS_GET;
|
|
@@ -15,11 +16,8 @@ class SpoSiteDesignRunStatusGetCommand extends SpoCommand {
|
|
|
15
16
|
get description() {
|
|
16
17
|
return 'Gets information about the site scripts executed for the specified site design';
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoSiteDesignRunStatusGetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoSiteDesignRunStatusGetCommand_instances, "m", _SpoSiteDesignRunStatusGetCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoSiteDesignRunStatusGetCommand_instances, "m", _SpoSiteDesignRunStatusGetCommand_initValidators).call(this);
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
23
21
|
}
|
|
24
22
|
async commandAction(logger, args) {
|
|
25
23
|
const data = {
|
|
@@ -43,23 +41,5 @@ class SpoSiteDesignRunStatusGetCommand extends SpoCommand {
|
|
|
43
41
|
}
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
|
-
_SpoSiteDesignRunStatusGetCommand_instances = new WeakSet(), _SpoSiteDesignRunStatusGetCommand_initOptions = function _SpoSiteDesignRunStatusGetCommand_initOptions() {
|
|
47
|
-
this.options.unshift({
|
|
48
|
-
option: '-u, --webUrl <webUrl>'
|
|
49
|
-
}, {
|
|
50
|
-
option: '-i, --runId <runId>'
|
|
51
|
-
});
|
|
52
|
-
}, _SpoSiteDesignRunStatusGetCommand_initValidators = function _SpoSiteDesignRunStatusGetCommand_initValidators() {
|
|
53
|
-
this.validators.push(async (args) => {
|
|
54
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
55
|
-
if (isValidSharePointUrl !== true) {
|
|
56
|
-
return isValidSharePointUrl;
|
|
57
|
-
}
|
|
58
|
-
if (!validation.isValidGuid(args.options.runId)) {
|
|
59
|
-
return `${args.options.runId} is not a valid GUID`;
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
44
|
export default new SpoSiteDesignRunStatusGetCommand();
|
|
65
45
|
//# sourceMappingURL=sitedesign-run-status-get.js.map
|
|
@@ -1,14 +1,32 @@
|
|
|
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 _SpoSiteDesignSetCommand_instances, _SpoSiteDesignSetCommand_initTelemetry, _SpoSiteDesignSetCommand_initOptions, _SpoSiteDesignSetCommand_initTypes, _SpoSiteDesignSetCommand_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 { 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
|
+
id: z.string().refine(val => validation.isValidGuid(val), { message: 'The value must be a valid GUID.' }).alias('i'),
|
|
11
|
+
title: z.string().optional().alias('t'),
|
|
12
|
+
webTemplate: z.enum(['TeamSite', 'CommunicationSite']).optional().alias('w'),
|
|
13
|
+
siteScripts: z.string().superRefine((val, ctx) => {
|
|
14
|
+
const items = val.split(',').map(s => s.trim());
|
|
15
|
+
const invalid = items.filter(item => !validation.isValidGuid(item));
|
|
16
|
+
if (invalid.length > 0) {
|
|
17
|
+
ctx.addIssue({
|
|
18
|
+
code: 'custom',
|
|
19
|
+
message: `The following values are not valid GUIDs: ${invalid.join(', ')}`
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}).optional().alias('s'),
|
|
23
|
+
description: z.string().optional().alias('d'),
|
|
24
|
+
previewImageUrl: z.string().optional().alias('m'),
|
|
25
|
+
previewImageAltText: z.string().optional().alias('a'),
|
|
26
|
+
thumbnailUrl: z.string().optional(),
|
|
27
|
+
version: z.string().refine(val => val.trim() !== '' && Number.isFinite(Number(val)), { message: 'Version must be a number' }).optional().alias('v'),
|
|
28
|
+
isDefault: z.boolean().optional()
|
|
29
|
+
});
|
|
12
30
|
class SpoSiteDesignSetCommand extends SpoCommand {
|
|
13
31
|
get name() {
|
|
14
32
|
return commands.SITEDESIGN_SET;
|
|
@@ -16,13 +34,8 @@ class SpoSiteDesignSetCommand extends SpoCommand {
|
|
|
16
34
|
get description() {
|
|
17
35
|
return 'Updates a site design with new values';
|
|
18
36
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoSiteDesignSetCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoSiteDesignSetCommand_instances, "m", _SpoSiteDesignSetCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoSiteDesignSetCommand_instances, "m", _SpoSiteDesignSetCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoSiteDesignSetCommand_instances, "m", _SpoSiteDesignSetCommand_initTypes).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoSiteDesignSetCommand_instances, "m", _SpoSiteDesignSetCommand_initValidators).call(this);
|
|
37
|
+
get schema() {
|
|
38
|
+
return options;
|
|
26
39
|
}
|
|
27
40
|
async commandAction(logger, args) {
|
|
28
41
|
try {
|
|
@@ -52,7 +65,7 @@ class SpoSiteDesignSetCommand extends SpoCommand {
|
|
|
52
65
|
updateInfo.WebTemplate = args.options.webTemplate === 'TeamSite' ? '64' : '68';
|
|
53
66
|
}
|
|
54
67
|
if (args.options.version) {
|
|
55
|
-
updateInfo.Version = args.options.version;
|
|
68
|
+
updateInfo.Version = Number(args.options.version);
|
|
56
69
|
}
|
|
57
70
|
if (typeof args.options.isDefault !== 'undefined') {
|
|
58
71
|
updateInfo.IsDefault = args.options.isDefault;
|
|
@@ -75,71 +88,5 @@ class SpoSiteDesignSetCommand extends SpoCommand {
|
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
90
|
}
|
|
78
|
-
_SpoSiteDesignSetCommand_instances = new WeakSet(), _SpoSiteDesignSetCommand_initTelemetry = function _SpoSiteDesignSetCommand_initTelemetry() {
|
|
79
|
-
this.telemetry.push((args) => {
|
|
80
|
-
Object.assign(this.telemetryProperties, {
|
|
81
|
-
title: typeof args.options.title !== 'undefined',
|
|
82
|
-
webTemplate: args.options.webTemplate,
|
|
83
|
-
siteScripts: typeof args.options.siteScripts !== 'undefined',
|
|
84
|
-
description: typeof args.options.description !== 'undefined',
|
|
85
|
-
previewImageUrl: typeof args.options.previewImageUrl !== 'undefined',
|
|
86
|
-
previewImageAltText: typeof args.options.previewImageAltText !== 'undefined',
|
|
87
|
-
thumbnailUrl: typeof args.options.thumbnailUrl !== 'undefined',
|
|
88
|
-
version: typeof args.options.version !== 'undefined',
|
|
89
|
-
isDefault: typeof args.options.isDefault
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
}, _SpoSiteDesignSetCommand_initOptions = function _SpoSiteDesignSetCommand_initOptions() {
|
|
93
|
-
this.options.unshift({
|
|
94
|
-
option: '-i, --id <id>'
|
|
95
|
-
}, {
|
|
96
|
-
option: '-t, --title [title]'
|
|
97
|
-
}, {
|
|
98
|
-
option: '-w, --webTemplate [webTemplate]',
|
|
99
|
-
autocomplete: ['TeamSite', 'CommunicationSite']
|
|
100
|
-
}, {
|
|
101
|
-
option: '-s, --siteScripts [siteScripts]'
|
|
102
|
-
}, {
|
|
103
|
-
option: '-d, --description [description]'
|
|
104
|
-
}, {
|
|
105
|
-
option: '-m, --previewImageUrl [previewImageUrl]'
|
|
106
|
-
}, {
|
|
107
|
-
option: '-a, --previewImageAltText [previewImageAltText]'
|
|
108
|
-
}, {
|
|
109
|
-
option: '--thumbnailUrl [thumbnailUrl]'
|
|
110
|
-
}, {
|
|
111
|
-
option: '-v, --version [version]'
|
|
112
|
-
}, {
|
|
113
|
-
option: '--isDefault [isDefault]',
|
|
114
|
-
autocomplete: ['true', 'false']
|
|
115
|
-
});
|
|
116
|
-
}, _SpoSiteDesignSetCommand_initTypes = function _SpoSiteDesignSetCommand_initTypes() {
|
|
117
|
-
this.types.boolean.push('isDefault');
|
|
118
|
-
}, _SpoSiteDesignSetCommand_initValidators = function _SpoSiteDesignSetCommand_initValidators() {
|
|
119
|
-
this.validators.push(async (args) => {
|
|
120
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
121
|
-
return `${args.options.id} is not a valid GUID`;
|
|
122
|
-
}
|
|
123
|
-
if (args.options.webTemplate &&
|
|
124
|
-
args.options.webTemplate !== 'TeamSite' &&
|
|
125
|
-
args.options.webTemplate !== 'CommunicationSite') {
|
|
126
|
-
return `${args.options.webTemplate} is not a valid web template type. Allowed values TeamSite|CommunicationSite`;
|
|
127
|
-
}
|
|
128
|
-
if (args.options.siteScripts) {
|
|
129
|
-
const siteScripts = args.options.siteScripts.split(',');
|
|
130
|
-
for (let i = 0; i < siteScripts.length; i++) {
|
|
131
|
-
const trimmedId = siteScripts[i].trim();
|
|
132
|
-
if (!validation.isValidGuid(trimmedId)) {
|
|
133
|
-
return `${trimmedId} is not a valid GUID`;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (args.options.version &&
|
|
138
|
-
typeof args.options.version !== 'number') {
|
|
139
|
-
return `${args.options.version} is not a number`;
|
|
140
|
-
}
|
|
141
|
-
return true;
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
91
|
export default new SpoSiteDesignSetCommand();
|
|
145
92
|
//# sourceMappingURL=sitedesign-set.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
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 _SpoSiteDesignTaskGetCommand_instances, _SpoSiteDesignTaskGetCommand_initOptions, _SpoSiteDesignTaskGetCommand_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 { 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
|
+
id: z.string().refine(val => validation.isValidGuid(val), { message: 'The value must be a valid GUID.' }).alias('i')
|
|
11
|
+
});
|
|
12
12
|
class SpoSiteDesignTaskGetCommand extends SpoCommand {
|
|
13
13
|
get name() {
|
|
14
14
|
return commands.SITEDESIGN_TASK_GET;
|
|
@@ -16,11 +16,8 @@ class SpoSiteDesignTaskGetCommand extends SpoCommand {
|
|
|
16
16
|
get description() {
|
|
17
17
|
return 'Gets information about the specified site design scheduled for execution';
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoSiteDesignTaskGetCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoSiteDesignTaskGetCommand_instances, "m", _SpoSiteDesignTaskGetCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoSiteDesignTaskGetCommand_instances, "m", _SpoSiteDesignTaskGetCommand_initValidators).call(this);
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
24
21
|
}
|
|
25
22
|
async commandAction(logger, args) {
|
|
26
23
|
try {
|
|
@@ -45,17 +42,5 @@ class SpoSiteDesignTaskGetCommand extends SpoCommand {
|
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
|
-
_SpoSiteDesignTaskGetCommand_instances = new WeakSet(), _SpoSiteDesignTaskGetCommand_initOptions = function _SpoSiteDesignTaskGetCommand_initOptions() {
|
|
49
|
-
this.options.unshift({
|
|
50
|
-
option: '-i, --id <id>'
|
|
51
|
-
});
|
|
52
|
-
}, _SpoSiteDesignTaskGetCommand_initValidators = function _SpoSiteDesignTaskGetCommand_initValidators() {
|
|
53
|
-
this.validators.push(async (args) => {
|
|
54
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
55
|
-
return `${args.options.id} is not a valid GUID`;
|
|
56
|
-
}
|
|
57
|
-
return true;
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
45
|
export default new SpoSiteDesignTaskGetCommand();
|
|
61
46
|
//# sourceMappingURL=sitedesign-task-get.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
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 _SpoSiteDesignTaskListCommand_instances, _SpoSiteDesignTaskListCommand_initOptions, _SpoSiteDesignTaskListCommand_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.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string().refine(val => validation.isValidSharePointUrl(val) === true, { message: 'The value is not a valid SharePoint Online site URL.' }).alias('u')
|
|
10
|
+
});
|
|
11
11
|
class SpoSiteDesignTaskListCommand extends SpoCommand {
|
|
12
12
|
get name() {
|
|
13
13
|
return commands.SITEDESIGN_TASK_LIST;
|
|
@@ -18,11 +18,8 @@ class SpoSiteDesignTaskListCommand extends SpoCommand {
|
|
|
18
18
|
defaultProperties() {
|
|
19
19
|
return ['ID', 'SiteDesignID', 'LogonName'];
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_SpoSiteDesignTaskListCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoSiteDesignTaskListCommand_instances, "m", _SpoSiteDesignTaskListCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoSiteDesignTaskListCommand_instances, "m", _SpoSiteDesignTaskListCommand_initValidators).call(this);
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
26
23
|
}
|
|
27
24
|
async commandAction(logger, args) {
|
|
28
25
|
const requestOptions = {
|
|
@@ -41,12 +38,5 @@ class SpoSiteDesignTaskListCommand extends SpoCommand {
|
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
_SpoSiteDesignTaskListCommand_instances = new WeakSet(), _SpoSiteDesignTaskListCommand_initOptions = function _SpoSiteDesignTaskListCommand_initOptions() {
|
|
45
|
-
this.options.unshift({
|
|
46
|
-
option: '-u, --webUrl <webUrl>'
|
|
47
|
-
});
|
|
48
|
-
}, _SpoSiteDesignTaskListCommand_initValidators = function _SpoSiteDesignTaskListCommand_initValidators() {
|
|
49
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
50
|
-
};
|
|
51
41
|
export default new SpoSiteDesignTaskListCommand();
|
|
52
42
|
//# sourceMappingURL=sitedesign-task-list.js.map
|
|
@@ -1,15 +1,16 @@
|
|
|
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 _SpoSiteDesignTaskRemoveCommand_instances, _SpoSiteDesignTaskRemoveCommand_initTelemetry, _SpoSiteDesignTaskRemoveCommand_initOptions, _SpoSiteDesignTaskRemoveCommand_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 { 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
|
+
id: z.string().refine(val => validation.isValidGuid(val), { message: 'The value must be a valid GUID.' }).alias('i'),
|
|
12
|
+
force: z.boolean().optional().alias('f')
|
|
13
|
+
});
|
|
13
14
|
class SpoSiteDesignTaskRemoveCommand extends SpoCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.SITEDESIGN_TASK_REMOVE;
|
|
@@ -17,12 +18,8 @@ class SpoSiteDesignTaskRemoveCommand extends SpoCommand {
|
|
|
17
18
|
get description() {
|
|
18
19
|
return 'Removes the specified site design scheduled for execution';
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_SpoSiteDesignTaskRemoveCommand_instances.add(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoSiteDesignTaskRemoveCommand_instances, "m", _SpoSiteDesignTaskRemoveCommand_initTelemetry).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoSiteDesignTaskRemoveCommand_instances, "m", _SpoSiteDesignTaskRemoveCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoSiteDesignTaskRemoveCommand_instances, "m", _SpoSiteDesignTaskRemoveCommand_initValidators).call(this);
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
26
23
|
}
|
|
27
24
|
async commandAction(logger, args) {
|
|
28
25
|
if (args.options.force) {
|
|
@@ -55,25 +52,5 @@ class SpoSiteDesignTaskRemoveCommand extends SpoCommand {
|
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
|
-
_SpoSiteDesignTaskRemoveCommand_instances = new WeakSet(), _SpoSiteDesignTaskRemoveCommand_initTelemetry = function _SpoSiteDesignTaskRemoveCommand_initTelemetry() {
|
|
59
|
-
this.telemetry.push((args) => {
|
|
60
|
-
Object.assign(this.telemetryProperties, {
|
|
61
|
-
force: args.options.force || false
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}, _SpoSiteDesignTaskRemoveCommand_initOptions = function _SpoSiteDesignTaskRemoveCommand_initOptions() {
|
|
65
|
-
this.options.unshift({
|
|
66
|
-
option: '-i, --id <id>'
|
|
67
|
-
}, {
|
|
68
|
-
option: '-f, --force'
|
|
69
|
-
});
|
|
70
|
-
}, _SpoSiteDesignTaskRemoveCommand_initValidators = function _SpoSiteDesignTaskRemoveCommand_initValidators() {
|
|
71
|
-
this.validators.push(async (args) => {
|
|
72
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
73
|
-
return `${args.options.id} is not a valid GUID`;
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
55
|
export default new SpoSiteDesignTaskRemoveCommand();
|
|
79
56
|
//# sourceMappingURL=sitedesign-task-remove.js.map
|
|
@@ -1,11 +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 _SpoTenantAppCatalogAddCommand_instances, _SpoTenantAppCatalogAddCommand_initTelemetry, _SpoTenantAppCatalogAddCommand_initOptions, _SpoTenantAppCatalogAddCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
8
|
-
import { CommandError } from '../../../../Command.js';
|
|
3
|
+
import { CommandError, globalOptionsZod } from '../../../../Command.js';
|
|
9
4
|
import { validation } from '../../../../utils/validation.js';
|
|
10
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
6
|
import commands from '../../commands.js';
|
|
@@ -13,6 +8,15 @@ import spoSiteAddCommand from '../site/site-add.js';
|
|
|
13
8
|
import spoSiteGetCommand from '../site/site-get.js';
|
|
14
9
|
import spoSiteRemoveCommand from '../site/site-remove.js';
|
|
15
10
|
import spoTenantAppCatalogUrlGetCommand from './tenant-appcatalogurl-get.js';
|
|
11
|
+
const isNonEmptyFiniteNumber = (value) => value.trim().length > 0 && Number.isFinite(Number(value));
|
|
12
|
+
export const options = z.strictObject({
|
|
13
|
+
...globalOptionsZod.shape,
|
|
14
|
+
url: z.string().refine(val => validation.isValidSharePointUrl(val) === true, { message: 'The value is not a valid SharePoint site URL.' }).alias('u'),
|
|
15
|
+
owner: z.string(),
|
|
16
|
+
timeZone: z.string().refine(val => isNonEmptyFiniteNumber(val), { message: 'timeZone is not a number' }).alias('z'),
|
|
17
|
+
wait: z.boolean().optional(),
|
|
18
|
+
force: z.boolean().optional()
|
|
19
|
+
});
|
|
16
20
|
class SpoTenantAppCatalogAddCommand extends SpoCommand {
|
|
17
21
|
get name() {
|
|
18
22
|
return commands.TENANT_APPCATALOG_ADD;
|
|
@@ -20,12 +24,8 @@ class SpoTenantAppCatalogAddCommand extends SpoCommand {
|
|
|
20
24
|
get description() {
|
|
21
25
|
return 'Creates new tenant app catalog site';
|
|
22
26
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_SpoTenantAppCatalogAddCommand_instances.add(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoTenantAppCatalogAddCommand_instances, "m", _SpoTenantAppCatalogAddCommand_initTelemetry).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpoTenantAppCatalogAddCommand_instances, "m", _SpoTenantAppCatalogAddCommand_initOptions).call(this);
|
|
28
|
-
__classPrivateFieldGet(this, _SpoTenantAppCatalogAddCommand_instances, "m", _SpoTenantAppCatalogAddCommand_initValidators).call(this);
|
|
27
|
+
get schema() {
|
|
28
|
+
return options;
|
|
29
29
|
}
|
|
30
30
|
async commandAction(logger, args) {
|
|
31
31
|
if (this.verbose) {
|
|
@@ -43,9 +43,9 @@ class SpoTenantAppCatalogAddCommand extends SpoCommand {
|
|
|
43
43
|
await logger.logToStderr(`Found app catalog URL ${appCatalogUrl}`);
|
|
44
44
|
}
|
|
45
45
|
//Using JSON.parse
|
|
46
|
-
await this.ensureNoExistingSite(appCatalogUrl, args.options.force, logger);
|
|
46
|
+
await this.ensureNoExistingSite(appCatalogUrl, args.options.force ?? false, logger);
|
|
47
47
|
}
|
|
48
|
-
await this.ensureNoExistingSite(args.options.url, args.options.force, logger);
|
|
48
|
+
await this.ensureNoExistingSite(args.options.url, args.options.force ?? false, logger);
|
|
49
49
|
await this.createAppCatalog(args.options, logger);
|
|
50
50
|
}
|
|
51
51
|
async ensureNoExistingSite(url, force, logger) {
|
|
@@ -110,36 +110,5 @@ class SpoTenantAppCatalogAddCommand extends SpoCommand {
|
|
|
110
110
|
return cli.executeCommand(spoSiteAddCommand, { options: { ...siteAddOptions, _: [] } });
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
_SpoTenantAppCatalogAddCommand_instances = new WeakSet(), _SpoTenantAppCatalogAddCommand_initTelemetry = function _SpoTenantAppCatalogAddCommand_initTelemetry() {
|
|
114
|
-
this.telemetry.push((args) => {
|
|
115
|
-
Object.assign(this.telemetryProperties, {
|
|
116
|
-
wait: args.options.wait || false,
|
|
117
|
-
force: args.options.force || false
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
}, _SpoTenantAppCatalogAddCommand_initOptions = function _SpoTenantAppCatalogAddCommand_initOptions() {
|
|
121
|
-
this.options.unshift({
|
|
122
|
-
option: '-u, --url <url>'
|
|
123
|
-
}, {
|
|
124
|
-
option: '--owner <owner>'
|
|
125
|
-
}, {
|
|
126
|
-
option: '-z, --timeZone <timeZone>'
|
|
127
|
-
}, {
|
|
128
|
-
option: '--wait'
|
|
129
|
-
}, {
|
|
130
|
-
option: '--force'
|
|
131
|
-
});
|
|
132
|
-
}, _SpoTenantAppCatalogAddCommand_initValidators = function _SpoTenantAppCatalogAddCommand_initValidators() {
|
|
133
|
-
this.validators.push(async (args) => {
|
|
134
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.url);
|
|
135
|
-
if (isValidSharePointUrl !== true) {
|
|
136
|
-
return isValidSharePointUrl;
|
|
137
|
-
}
|
|
138
|
-
if (typeof args.options.timeZone !== 'number') {
|
|
139
|
-
return `${args.options.timeZone} is not a number`;
|
|
140
|
-
}
|
|
141
|
-
return true;
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
113
|
export default new SpoTenantAppCatalogAddCommand();
|
|
145
114
|
//# sourceMappingURL=tenant-appcatalog-add.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import request from '../../../../request.js';
|
|
2
3
|
import { spo } from '../../../../utils/spo.js';
|
|
3
4
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
4
5
|
import commands from '../../commands.js';
|
|
6
|
+
export const options = globalOptionsZod.strict();
|
|
5
7
|
class SpoTenantAppCatalogUrlGetCommand extends SpoCommand {
|
|
6
8
|
get name() {
|
|
7
9
|
return commands.TENANT_APPCATALOGURL_GET;
|
|
@@ -9,6 +11,9 @@ class SpoTenantAppCatalogUrlGetCommand extends SpoCommand {
|
|
|
9
11
|
get description() {
|
|
10
12
|
return 'Gets the URL of the tenant app catalog';
|
|
11
13
|
}
|
|
14
|
+
get schema() {
|
|
15
|
+
return options;
|
|
16
|
+
}
|
|
12
17
|
async commandAction(logger) {
|
|
13
18
|
try {
|
|
14
19
|
const spoUrl = await spo.getSpoUrl(logger, this.debug);
|
|
@@ -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 _SpoTenantApplicationCustomizerAddCommand_instances, _SpoTenantApplicationCustomizerAddCommand_initTelemetry, _SpoTenantApplicationCustomizerAddCommand_initOptions, _SpoTenantApplicationCustomizerAddCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -12,6 +8,14 @@ import commands from '../../commands.js';
|
|
|
12
8
|
import spoListItemAddCommand from '../listitem/listitem-add.js';
|
|
13
9
|
import spoListItemListCommand from '../listitem/listitem-list.js';
|
|
14
10
|
import spoTenantAppCatalogUrlGetCommand from '../tenant/tenant-appcatalogurl-get.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
title: z.string().alias('t'),
|
|
14
|
+
clientSideComponentId: z.string().refine(val => validation.isValidGuid(val), { message: 'clientSideComponentId is not a valid GUID' }).alias('i'),
|
|
15
|
+
clientSideComponentProperties: z.string().refine(validation.isValidJsonOrEmpty, { message: 'clientSideComponentProperties is not a valid JSON string' }).optional().alias('p'),
|
|
16
|
+
hostProperties: z.string().refine(validation.isValidJsonOrEmpty, { message: 'hostProperties is not a valid JSON string' }).optional(),
|
|
17
|
+
webTemplate: z.string().optional().alias('w')
|
|
18
|
+
});
|
|
15
19
|
class SpoTenantApplicationCustomizerAddCommand extends SpoCommand {
|
|
16
20
|
get name() {
|
|
17
21
|
return commands.TENANT_APPLICATIONCUSTOMIZER_ADD;
|
|
@@ -19,12 +23,8 @@ class SpoTenantApplicationCustomizerAddCommand extends SpoCommand {
|
|
|
19
23
|
get description() {
|
|
20
24
|
return 'Adds an application customizer as a tenant wide extension.';
|
|
21
25
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_SpoTenantApplicationCustomizerAddCommand_instances.add(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerAddCommand_instances, "m", _SpoTenantApplicationCustomizerAddCommand_initTelemetry).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerAddCommand_instances, "m", _SpoTenantApplicationCustomizerAddCommand_initOptions).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerAddCommand_instances, "m", _SpoTenantApplicationCustomizerAddCommand_initValidators).call(this);
|
|
26
|
+
get schema() {
|
|
27
|
+
return options;
|
|
28
28
|
}
|
|
29
29
|
async commandAction(logger, args) {
|
|
30
30
|
try {
|
|
@@ -137,49 +137,5 @@ class SpoTenantApplicationCustomizerAddCommand extends SpoCommand {
|
|
|
137
137
|
await cli.executeCommand(spoListItemAddCommand, { options: { ...commandOptions, _: [] } });
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
_SpoTenantApplicationCustomizerAddCommand_instances = new WeakSet(), _SpoTenantApplicationCustomizerAddCommand_initTelemetry = function _SpoTenantApplicationCustomizerAddCommand_initTelemetry() {
|
|
141
|
-
this.telemetry.push((args) => {
|
|
142
|
-
Object.assign(this.telemetryProperties, {
|
|
143
|
-
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
144
|
-
hostProperties: typeof args.options.hostProperties !== 'undefined',
|
|
145
|
-
webTemplate: typeof args.options.webTemplate !== 'undefined'
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
}, _SpoTenantApplicationCustomizerAddCommand_initOptions = function _SpoTenantApplicationCustomizerAddCommand_initOptions() {
|
|
149
|
-
this.options.unshift({
|
|
150
|
-
option: '-t, --title <title>'
|
|
151
|
-
}, {
|
|
152
|
-
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
153
|
-
}, {
|
|
154
|
-
option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
|
|
155
|
-
}, {
|
|
156
|
-
option: '--hostProperties [hostProperties]'
|
|
157
|
-
}, {
|
|
158
|
-
option: '-w, --webTemplate [webTemplate]'
|
|
159
|
-
});
|
|
160
|
-
}, _SpoTenantApplicationCustomizerAddCommand_initValidators = function _SpoTenantApplicationCustomizerAddCommand_initValidators() {
|
|
161
|
-
this.validators.push(async (args) => {
|
|
162
|
-
if (!validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
163
|
-
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
164
|
-
}
|
|
165
|
-
if (args.options.clientSideComponentProperties) {
|
|
166
|
-
try {
|
|
167
|
-
JSON.parse(args.options.clientSideComponentProperties);
|
|
168
|
-
}
|
|
169
|
-
catch (e) {
|
|
170
|
-
return `An error has occurred while parsing clientSideComponentProperties: ${e}`;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (args.options.hostProperties) {
|
|
174
|
-
try {
|
|
175
|
-
JSON.parse(args.options.hostProperties);
|
|
176
|
-
}
|
|
177
|
-
catch (e) {
|
|
178
|
-
return `An error has occurred while parsing hostProperties: ${e}`;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return true;
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
140
|
export default new SpoTenantApplicationCustomizerAddCommand();
|
|
185
141
|
//# sourceMappingURL=tenant-applicationcustomizer-add.js.map
|