@pnp/cli-microsoft365 12.1.0-beta.0c2915d → 12.1.0-beta.ab87e08
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/spo/commands/page/page-add.js +31 -68
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +74 -101
- package/dist/m365/spo/commands/page/page-column-get.js +15 -32
- package/dist/m365/spo/commands/page/page-column-list.js +14 -27
- package/dist/m365/spo/commands/page/page-control-get.js +18 -27
- package/dist/m365/spo/commands/page/page-control-list.js +13 -20
- package/dist/m365/spo/commands/page/page-control-remove.js +1 -1
- package/dist/m365/spo/commands/page/page-control-set.js +51 -61
- package/dist/m365/spo/commands/page/page-copy.js +15 -31
- package/dist/m365/spo/commands/page/page-header-set.js +25 -89
- package/dist/m365/spo/commands/page/page-list.js +12 -18
- package/dist/m365/spo/commands/page/page-remove.js +16 -39
- package/dist/m365/spo/commands/page/page-section-add.js +108 -173
- package/dist/m365/spo/commands/page/page-section-get.js +17 -27
- package/dist/m365/spo/commands/page/page-section-list.js +13 -20
- package/dist/m365/spo/commands/page/page-section-remove.js +4 -1
- package/dist/m365/spo/commands/page/page-set.js +50 -100
- package/dist/m365/spo/commands/page/page-template-list.js +12 -18
- package/dist/m365/spo/commands/page/page-text-add.js +23 -45
- package/docs/docs/cmd/spo/listitem/listitem-record-declare.mdx +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-lock.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-undeclare.mdx +21 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-unlock.mdx +21 -0
- package/docs/docs/cmd/spo/page/page-text-add.mdx +1 -1
- package/docs/docs/cmd/viva/engage/engage-community-add.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-get.mdx +19 -0
- package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-community-set.mdx +19 -0
- package/package.json +1 -1
|
@@ -1,15 +1,52 @@
|
|
|
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 _SpoPageControlSetCommand_instances, _SpoPageControlSetCommand_initTelemetry, _SpoPageControlSetCommand_initOptions, _SpoPageControlSetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
12
8
|
import { Page } from './Page.js';
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
id: z.string()
|
|
12
|
+
.refine(id => validation.isValidGuid(id), {
|
|
13
|
+
error: e => `${e.input} is not a valid GUID`
|
|
14
|
+
})
|
|
15
|
+
.alias('i'),
|
|
16
|
+
pageName: z.string().alias('n'),
|
|
17
|
+
webUrl: z.string()
|
|
18
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
19
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
20
|
+
})
|
|
21
|
+
.alias('u'),
|
|
22
|
+
webPartData: z.string()
|
|
23
|
+
.refine(data => {
|
|
24
|
+
try {
|
|
25
|
+
JSON.parse(data);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
error: 'Specified webPartData is not a valid JSON string.'
|
|
33
|
+
})
|
|
34
|
+
.optional(),
|
|
35
|
+
webPartProperties: z.string()
|
|
36
|
+
.refine(properties => {
|
|
37
|
+
try {
|
|
38
|
+
JSON.parse(properties);
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
error: 'Specified webPartProperties is not a valid JSON string.'
|
|
46
|
+
})
|
|
47
|
+
.optional(),
|
|
48
|
+
innerHtml: z.string().optional()
|
|
49
|
+
});
|
|
13
50
|
class SpoPageControlSetCommand extends SpoCommand {
|
|
14
51
|
get name() {
|
|
15
52
|
return commands.PAGE_CONTROL_SET;
|
|
@@ -17,12 +54,14 @@ class SpoPageControlSetCommand extends SpoCommand {
|
|
|
17
54
|
get description() {
|
|
18
55
|
return 'Updates web part data or properties of a control on a modern page';
|
|
19
56
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
57
|
+
get schema() {
|
|
58
|
+
return options;
|
|
59
|
+
}
|
|
60
|
+
getRefinedSchema(schema) {
|
|
61
|
+
return schema
|
|
62
|
+
.refine(opts => [opts.webPartData, opts.webPartProperties, opts.innerHtml].filter(Boolean).length <= 1, {
|
|
63
|
+
error: 'Specify webPartProperties, webPartData, or innerHtml but not more than one'
|
|
64
|
+
});
|
|
26
65
|
}
|
|
27
66
|
async commandAction(logger, args) {
|
|
28
67
|
let pageName = args.options.pageName;
|
|
@@ -142,54 +181,5 @@ class SpoPageControlSetCommand extends SpoCommand {
|
|
|
142
181
|
}
|
|
143
182
|
}
|
|
144
183
|
}
|
|
145
|
-
_SpoPageControlSetCommand_instances = new WeakSet(), _SpoPageControlSetCommand_initTelemetry = function _SpoPageControlSetCommand_initTelemetry() {
|
|
146
|
-
this.telemetry.push((args) => {
|
|
147
|
-
Object.assign(this.telemetryProperties, {
|
|
148
|
-
webPartData: typeof args.options.webPartData !== 'undefined',
|
|
149
|
-
webPartProperties: typeof args.options.webPartProperties !== 'undefined',
|
|
150
|
-
innerHtml: typeof args.options.innerHtml !== 'undefined'
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
}, _SpoPageControlSetCommand_initOptions = function _SpoPageControlSetCommand_initOptions() {
|
|
154
|
-
this.options.unshift({
|
|
155
|
-
option: '-i, --id <id>'
|
|
156
|
-
}, {
|
|
157
|
-
option: '-n, --pageName <pageName>'
|
|
158
|
-
}, {
|
|
159
|
-
option: '-u, --webUrl <webUrl>'
|
|
160
|
-
}, {
|
|
161
|
-
option: '--webPartData [webPartData]'
|
|
162
|
-
}, {
|
|
163
|
-
option: '--webPartProperties [webPartProperties]'
|
|
164
|
-
}, {
|
|
165
|
-
option: '--innerHtml [innerHtml]'
|
|
166
|
-
});
|
|
167
|
-
}, _SpoPageControlSetCommand_initValidators = function _SpoPageControlSetCommand_initValidators() {
|
|
168
|
-
this.validators.push(async (args) => {
|
|
169
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
170
|
-
return `${args.options.id} is not a valid GUID`;
|
|
171
|
-
}
|
|
172
|
-
if ([args.options.webPartData, args.options.webPartProperties, args.options.innerHtml].filter(Boolean).length > 1) {
|
|
173
|
-
return 'Specify webPartProperties, webPartData, or innerHtml but not more than one';
|
|
174
|
-
}
|
|
175
|
-
if (args.options.webPartProperties) {
|
|
176
|
-
try {
|
|
177
|
-
JSON.parse(args.options.webPartProperties);
|
|
178
|
-
}
|
|
179
|
-
catch (e) {
|
|
180
|
-
return `Specified webPartProperties is not a valid JSON string. Input: ${args.options.webPartProperties}. Error: ${e}`;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
if (args.options.webPartData) {
|
|
184
|
-
try {
|
|
185
|
-
JSON.parse(args.options.webPartData);
|
|
186
|
-
}
|
|
187
|
-
catch (e) {
|
|
188
|
-
return `Specified webPartData is not a valid JSON string. Input: ${args.options.webPartData}. Error: ${e}`;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
184
|
export default new SpoPageControlSetCommand();
|
|
195
185
|
//# sourceMappingURL=page-control-set.js.map
|
|
@@ -1,14 +1,21 @@
|
|
|
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 _SpoPageCopyCommand_instances, _SpoPageCopyCommand_initTelemetry, _SpoPageCopyCommand_initOptions, _SpoPageCopyCommand_initValidators;
|
|
7
1
|
import chalk from 'chalk';
|
|
2
|
+
import { z } from 'zod';
|
|
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()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
12
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
})
|
|
14
|
+
.alias('u'),
|
|
15
|
+
sourceName: z.string(),
|
|
16
|
+
targetUrl: z.string(),
|
|
17
|
+
overwrite: z.boolean().optional()
|
|
18
|
+
});
|
|
12
19
|
class SpoPageCopyCommand extends SpoCommand {
|
|
13
20
|
get name() {
|
|
14
21
|
return `${commands.PAGE_COPY}`;
|
|
@@ -16,12 +23,8 @@ class SpoPageCopyCommand extends SpoCommand {
|
|
|
16
23
|
get description() {
|
|
17
24
|
return 'Creates a copy of a modern page or template';
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoPageCopyCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoPageCopyCommand_instances, "m", _SpoPageCopyCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoPageCopyCommand_instances, "m", _SpoPageCopyCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoPageCopyCommand_instances, "m", _SpoPageCopyCommand_initValidators).call(this);
|
|
26
|
+
get schema() {
|
|
27
|
+
return options;
|
|
25
28
|
}
|
|
26
29
|
async commandAction(logger, args) {
|
|
27
30
|
let { webUrl } = args.options;
|
|
@@ -97,24 +100,5 @@ class SpoPageCopyCommand extends SpoCommand {
|
|
|
97
100
|
return value;
|
|
98
101
|
}
|
|
99
102
|
}
|
|
100
|
-
_SpoPageCopyCommand_instances = new WeakSet(), _SpoPageCopyCommand_initTelemetry = function _SpoPageCopyCommand_initTelemetry() {
|
|
101
|
-
this.telemetry.push((args) => {
|
|
102
|
-
Object.assign(this.telemetryProperties, {
|
|
103
|
-
overwrite: !!args.options.overwrite
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
}, _SpoPageCopyCommand_initOptions = function _SpoPageCopyCommand_initOptions() {
|
|
107
|
-
this.options.unshift({
|
|
108
|
-
option: '--sourceName <sourceName>'
|
|
109
|
-
}, {
|
|
110
|
-
option: '--targetUrl <targetUrl>'
|
|
111
|
-
}, {
|
|
112
|
-
option: '-u, --webUrl <webUrl>'
|
|
113
|
-
}, {
|
|
114
|
-
option: '--overwrite'
|
|
115
|
-
});
|
|
116
|
-
}, _SpoPageCopyCommand_initValidators = function _SpoPageCopyCommand_initValidators() {
|
|
117
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
118
|
-
};
|
|
119
103
|
export default new SpoPageCopyCommand();
|
|
120
104
|
//# sourceMappingURL=page-copy.js.map
|
|
@@ -1,10 +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 _SpoPageHeaderSetCommand_instances, _SpoPageHeaderSetCommand_initTelemetry, _SpoPageHeaderSetCommand_initOptions, _SpoPageHeaderSetCommand_initValidators, _SpoPageHeaderSetCommand_initTypes;
|
|
7
|
-
import { CommandError } from '../../../../Command.js';
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CommandError, globalOptionsZod } from '../../../../Command.js';
|
|
8
3
|
import request from '../../../../request.js';
|
|
9
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
5
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -12,6 +7,27 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
12
7
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
8
|
import commands from '../../commands.js';
|
|
14
9
|
import { Page } from './Page.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
altText: z.string().optional(),
|
|
13
|
+
authors: z.string().optional(),
|
|
14
|
+
imageUrl: z.string().optional(),
|
|
15
|
+
topicHeader: z.string().optional(),
|
|
16
|
+
layout: z.enum(['FullWidthImage', 'NoImage', 'ColorBlock', 'CutInShape']).optional(),
|
|
17
|
+
pageName: z.string().alias('n'),
|
|
18
|
+
showTopicHeader: z.boolean().optional().autocomplete(['true', 'false']),
|
|
19
|
+
showPublishDate: z.boolean().optional().autocomplete(['true', 'false']),
|
|
20
|
+
showTimeToRead: z.boolean().optional().autocomplete(['true', 'false']),
|
|
21
|
+
textAlignment: z.enum(['Left', 'Center']).optional(),
|
|
22
|
+
translateX: z.number().optional().alias('x'),
|
|
23
|
+
translateY: z.number().optional().alias('y'),
|
|
24
|
+
type: z.enum(['None', 'Default', 'Custom']).optional().alias('t'),
|
|
25
|
+
webUrl: z.string()
|
|
26
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
27
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
28
|
+
})
|
|
29
|
+
.alias('u')
|
|
30
|
+
});
|
|
15
31
|
const BannerWebPartId = 'cbe7b0a9-3504-44dd-a3a3-0e5cacd07788';
|
|
16
32
|
class SpoPageHeaderSetCommand extends SpoCommand {
|
|
17
33
|
get name() {
|
|
@@ -20,13 +36,8 @@ class SpoPageHeaderSetCommand extends SpoCommand {
|
|
|
20
36
|
get description() {
|
|
21
37
|
return 'Sets modern page header';
|
|
22
38
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_SpoPageHeaderSetCommand_instances.add(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoPageHeaderSetCommand_instances, "m", _SpoPageHeaderSetCommand_initTelemetry).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpoPageHeaderSetCommand_instances, "m", _SpoPageHeaderSetCommand_initOptions).call(this);
|
|
28
|
-
__classPrivateFieldGet(this, _SpoPageHeaderSetCommand_instances, "m", _SpoPageHeaderSetCommand_initValidators).call(this);
|
|
29
|
-
__classPrivateFieldGet(this, _SpoPageHeaderSetCommand_instances, "m", _SpoPageHeaderSetCommand_initTypes).call(this);
|
|
39
|
+
get schema() {
|
|
40
|
+
return options;
|
|
30
41
|
}
|
|
31
42
|
getExcludedOptionsWithUrls() {
|
|
32
43
|
return ['imageUrl'];
|
|
@@ -381,80 +392,5 @@ class SpoPageHeaderSetCommand extends SpoCommand {
|
|
|
381
392
|
return request.get(requestOptions);
|
|
382
393
|
}
|
|
383
394
|
}
|
|
384
|
-
_SpoPageHeaderSetCommand_instances = new WeakSet(), _SpoPageHeaderSetCommand_initTelemetry = function _SpoPageHeaderSetCommand_initTelemetry() {
|
|
385
|
-
this.telemetry.push((args) => {
|
|
386
|
-
Object.assign(this.telemetryProperties, {
|
|
387
|
-
altText: typeof args.options.altText !== 'undefined',
|
|
388
|
-
authors: typeof args.options.authors !== 'undefined',
|
|
389
|
-
imageUrl: typeof args.options.imageUrl !== 'undefined',
|
|
390
|
-
topicHeader: typeof args.options.topicHeader !== 'undefined',
|
|
391
|
-
layout: args.options.layout,
|
|
392
|
-
showTopicHeader: !!args.options.showTopicHeader,
|
|
393
|
-
showPublishDate: !!args.options.showPublishDate,
|
|
394
|
-
showTimeToRead: !!args.options.showTimeToRead,
|
|
395
|
-
textAlignment: args.options.textAlignment,
|
|
396
|
-
translateX: typeof args.options.translateX !== 'undefined',
|
|
397
|
-
translateY: typeof args.options.translateY !== 'undefined',
|
|
398
|
-
type: args.options.type
|
|
399
|
-
});
|
|
400
|
-
});
|
|
401
|
-
}, _SpoPageHeaderSetCommand_initOptions = function _SpoPageHeaderSetCommand_initOptions() {
|
|
402
|
-
this.options.unshift({
|
|
403
|
-
option: '-n, --pageName <pageName>'
|
|
404
|
-
}, {
|
|
405
|
-
option: '-u, --webUrl <webUrl>'
|
|
406
|
-
}, {
|
|
407
|
-
option: '-t, --type [type]',
|
|
408
|
-
autocomplete: ['None', 'Default', 'Custom']
|
|
409
|
-
}, {
|
|
410
|
-
option: '--imageUrl [imageUrl]'
|
|
411
|
-
}, {
|
|
412
|
-
option: '--altText [altText]'
|
|
413
|
-
}, {
|
|
414
|
-
option: '-x, --translateX [translateX]'
|
|
415
|
-
}, {
|
|
416
|
-
option: '-y, --translateY [translateY]'
|
|
417
|
-
}, {
|
|
418
|
-
option: '--layout [layout]',
|
|
419
|
-
autocomplete: ['FullWidthImage', 'NoImage', 'ColorBlock', 'CutInShape']
|
|
420
|
-
}, {
|
|
421
|
-
option: '--textAlignment [textAlignment]',
|
|
422
|
-
autocomplete: ['Left', 'Center']
|
|
423
|
-
}, {
|
|
424
|
-
option: '--showTopicHeader [showTopicHeader]',
|
|
425
|
-
autocomplete: ['true', 'false']
|
|
426
|
-
}, {
|
|
427
|
-
option: '--showPublishDate [showPublishDate]',
|
|
428
|
-
autocomplete: ['true', 'false']
|
|
429
|
-
}, {
|
|
430
|
-
option: '--showTimeToRead [showTimeToRead]',
|
|
431
|
-
autocomplete: ['true', 'false']
|
|
432
|
-
}, {
|
|
433
|
-
option: '--topicHeader [topicHeader]'
|
|
434
|
-
}, {
|
|
435
|
-
option: '--authors [authors]'
|
|
436
|
-
});
|
|
437
|
-
}, _SpoPageHeaderSetCommand_initValidators = function _SpoPageHeaderSetCommand_initValidators() {
|
|
438
|
-
this.validators.push(async (args) => {
|
|
439
|
-
if (args.options.type && !['None', 'Default', 'Custom'].includes(args.options.type)) {
|
|
440
|
-
return `${args.options.type} is not a valid type value. Allowed values None|Default|Custom`;
|
|
441
|
-
}
|
|
442
|
-
if (args.options.translateX && isNaN(args.options.translateX)) {
|
|
443
|
-
return `${args.options.translateX} is not a valid number`;
|
|
444
|
-
}
|
|
445
|
-
if (args.options.translateY && isNaN(args.options.translateY)) {
|
|
446
|
-
return `${args.options.translateY} is not a valid number`;
|
|
447
|
-
}
|
|
448
|
-
if (args.options.layout && !['FullWidthImage', 'NoImage', 'ColorBlock', 'CutInShape'].includes(args.options.layout)) {
|
|
449
|
-
return `${args.options.layout} is not a valid layout value. Allowed values FullWidthImage|NoImage|ColorBlock|CutInShape`;
|
|
450
|
-
}
|
|
451
|
-
if (args.options.textAlignment && !['Left', 'Center'].includes(args.options.textAlignment)) {
|
|
452
|
-
return `${args.options.textAlignment} is not a valid textAlignment value. Allowed values Left|Center`;
|
|
453
|
-
}
|
|
454
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
455
|
-
});
|
|
456
|
-
}, _SpoPageHeaderSetCommand_initTypes = function _SpoPageHeaderSetCommand_initTypes() {
|
|
457
|
-
this.types.boolean.push('showTimeToRead', 'showPublishDate', 'showTopicHeader');
|
|
458
|
-
};
|
|
459
395
|
export default new SpoPageHeaderSetCommand();
|
|
460
396
|
//# sourceMappingURL=page-header-set.js.map
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpoPageListCommand_instances, _SpoPageListCommand_initOptions, _SpoPageListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { odata } from '../../../../utils/odata.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
9
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
webUrl: z.string()
|
|
10
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
12
|
+
})
|
|
13
|
+
.alias('u')
|
|
14
|
+
});
|
|
11
15
|
class SpoPageListCommand extends SpoCommand {
|
|
12
16
|
get name() {
|
|
13
17
|
return commands.PAGE_LIST;
|
|
@@ -18,11 +22,8 @@ class SpoPageListCommand extends SpoCommand {
|
|
|
18
22
|
defaultProperties() {
|
|
19
23
|
return ['Name', 'Title'];
|
|
20
24
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_SpoPageListCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoPageListCommand_instances, "m", _SpoPageListCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoPageListCommand_instances, "m", _SpoPageListCommand_initValidators).call(this);
|
|
25
|
+
get schema() {
|
|
26
|
+
return options;
|
|
26
27
|
}
|
|
27
28
|
async commandAction(logger, args) {
|
|
28
29
|
try {
|
|
@@ -56,12 +57,5 @@ class SpoPageListCommand extends SpoCommand {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
_SpoPageListCommand_instances = new WeakSet(), _SpoPageListCommand_initOptions = function _SpoPageListCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '-u, --webUrl <webUrl>'
|
|
62
|
-
});
|
|
63
|
-
}, _SpoPageListCommand_initValidators = function _SpoPageListCommand_initValidators() {
|
|
64
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
65
|
-
};
|
|
66
60
|
export default new SpoPageListCommand();
|
|
67
61
|
//# sourceMappingURL=page-list.js.map
|
|
@@ -1,16 +1,24 @@
|
|
|
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 _SpoPageRemoveCommand_instances, _SpoPageRemoveCommand_initTelemetry, _SpoPageRemoveCommand_initOptions, _SpoPageRemoveCommand_initValidators, _SpoPageRemoveCommand_initTypes;
|
|
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 { formatting } from '../../../../utils/formatting.js';
|
|
10
6
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string()
|
|
13
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
14
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
15
|
+
})
|
|
16
|
+
.alias('u'),
|
|
17
|
+
name: z.string().alias('n'),
|
|
18
|
+
permanent: z.boolean().optional(),
|
|
19
|
+
bypassSharedLock: z.boolean().optional(),
|
|
20
|
+
force: z.boolean().optional().alias('f')
|
|
21
|
+
});
|
|
14
22
|
class SpoPageRemoveCommand extends SpoCommand {
|
|
15
23
|
get name() {
|
|
16
24
|
return commands.PAGE_REMOVE;
|
|
@@ -18,13 +26,8 @@ class SpoPageRemoveCommand extends SpoCommand {
|
|
|
18
26
|
get description() {
|
|
19
27
|
return 'Removes a modern page';
|
|
20
28
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_SpoPageRemoveCommand_instances.add(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoPageRemoveCommand_instances, "m", _SpoPageRemoveCommand_initTelemetry).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoPageRemoveCommand_instances, "m", _SpoPageRemoveCommand_initOptions).call(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpoPageRemoveCommand_instances, "m", _SpoPageRemoveCommand_initValidators).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpoPageRemoveCommand_instances, "m", _SpoPageRemoveCommand_initTypes).call(this);
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
28
31
|
}
|
|
29
32
|
async commandAction(logger, args) {
|
|
30
33
|
if (args.options.force) {
|
|
@@ -71,31 +74,5 @@ class SpoPageRemoveCommand extends SpoCommand {
|
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
|
-
_SpoPageRemoveCommand_instances = new WeakSet(), _SpoPageRemoveCommand_initTelemetry = function _SpoPageRemoveCommand_initTelemetry() {
|
|
75
|
-
this.telemetry.push((args) => {
|
|
76
|
-
Object.assign(this.telemetryProperties, {
|
|
77
|
-
force: !!args.options.force,
|
|
78
|
-
permanent: !!args.options.permanent,
|
|
79
|
-
bypassSharedLock: !!args.options.bypassSharedLock
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}, _SpoPageRemoveCommand_initOptions = function _SpoPageRemoveCommand_initOptions() {
|
|
83
|
-
this.options.unshift({
|
|
84
|
-
option: '-u, --webUrl <webUrl>'
|
|
85
|
-
}, {
|
|
86
|
-
option: '-n, --name <name>'
|
|
87
|
-
}, {
|
|
88
|
-
option: '--permanent'
|
|
89
|
-
}, {
|
|
90
|
-
option: '--bypassSharedLock'
|
|
91
|
-
}, {
|
|
92
|
-
option: '-f, --force'
|
|
93
|
-
});
|
|
94
|
-
}, _SpoPageRemoveCommand_initValidators = function _SpoPageRemoveCommand_initValidators() {
|
|
95
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
96
|
-
}, _SpoPageRemoveCommand_initTypes = function _SpoPageRemoveCommand_initTypes() {
|
|
97
|
-
this.types.string.push('name', 'webUrl');
|
|
98
|
-
this.types.boolean.push('force', 'bypassSharedLock', 'permanent');
|
|
99
|
-
};
|
|
100
77
|
export default new SpoPageRemoveCommand();
|
|
101
78
|
//# sourceMappingURL=page-remove.js.map
|