@pnp/cli-microsoft365 12.0.0-beta.d0b29c1 → 12.0.0-beta.d58fb77
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 +15 -1
- package/dist/m365/cli/commands/cli-consent.js +9 -2
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +1 -1
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.24.0-rc.0.js → doctor-1.24.0.js} +1 -1
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.24.0-rc.0.js → upgrade-1.24.0.js} +27 -27
- package/dist/m365/spfx/commands/project/project-upgrade.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
- package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
- package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
- package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
- package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
- package/dist/m365/spp/commands/model/model-get.js +25 -45
- package/dist/m365/spp/commands/model/model-list.js +12 -23
- package/dist/m365/spp/commands/model/model-remove.js +25 -45
- package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
- package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
- package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
- package/dist/m365/teams/commands/message/message-get.js +19 -30
- package/dist/m365/teams/commands/message/message-list.js +26 -43
- package/dist/m365/teams/commands/message/message-remove.js +43 -58
- package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
- package/dist/m365/teams/commands/message/message-restore.js +40 -50
- package/dist/m365/teams/commands/message/message-send.js +19 -30
- package/docs/docs/cmd/login.mdx +15 -2
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/package.json +2 -1
|
@@ -1,9 +1,4 @@
|
|
|
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 _SpoCommandSetSetCommand_instances, _a, _SpoCommandSetSetCommand_initTelemetry, _SpoCommandSetSetCommand_initOptions, _SpoCommandSetSetCommand_initValidators, _SpoCommandSetSetCommand_initOptionSets;
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
2
|
import commands from '../../commands.js';
|
|
8
3
|
import { validation } from '../../../../utils/validation.js';
|
|
9
4
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -11,6 +6,23 @@ import request from '../../../../request.js';
|
|
|
11
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
12
7
|
import { spo } from '../../../../utils/spo.js';
|
|
13
8
|
import { cli } from '../../../../cli/cli.js';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
webUrl: z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
}).alias('u'),
|
|
15
|
+
title: z.string().optional().alias('t'),
|
|
16
|
+
id: z.string().refine(validation.isValidGuid, { message: 'The value must be a valid GUID.' }).optional().alias('i'),
|
|
17
|
+
clientSideComponentId: z.string().refine(validation.isValidGuid, { message: 'The value must be a valid GUID.' }).optional().alias('c'),
|
|
18
|
+
newClientSideComponentId: z.string().refine(validation.isValidGuid, { message: 'The value must be a valid GUID.' }).optional(),
|
|
19
|
+
newTitle: z.string().optional(),
|
|
20
|
+
description: z.string().optional(),
|
|
21
|
+
listType: z.enum(['List', 'Library', 'SitePages']).optional().alias('l'),
|
|
22
|
+
clientSideComponentProperties: z.string().optional(),
|
|
23
|
+
scope: z.enum(['All', 'Site', 'Web']).optional().alias('s'),
|
|
24
|
+
location: z.enum(['ContextMenu', 'CommandBar', 'Both']).optional()
|
|
25
|
+
});
|
|
14
26
|
class SpoCommandSetSetCommand extends SpoCommand {
|
|
15
27
|
get name() {
|
|
16
28
|
return commands.COMMANDSET_SET;
|
|
@@ -18,13 +30,18 @@ class SpoCommandSetSetCommand extends SpoCommand {
|
|
|
18
30
|
get description() {
|
|
19
31
|
return 'Updates a ListView Command Set on a site.';
|
|
20
32
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
get schema() {
|
|
34
|
+
return options;
|
|
35
|
+
}
|
|
36
|
+
getRefinedSchema(schema) {
|
|
37
|
+
return schema
|
|
38
|
+
.refine(opts => [opts.title, opts.id, opts.clientSideComponentId].filter(x => x !== undefined).length === 1, {
|
|
39
|
+
message: `Specify either 'title', 'id' or 'clientSideComponentId', but not multiple.`,
|
|
40
|
+
params: { customCode: 'optionSet', options: ['title', 'id', 'clientSideComponentId'] }
|
|
41
|
+
})
|
|
42
|
+
.refine(opts => !!opts.newTitle || opts.description !== undefined || !!opts.listType || !!opts.clientSideComponentProperties || !!opts.location || !!opts.newClientSideComponentId, {
|
|
43
|
+
message: 'Please specify option to be updated'
|
|
44
|
+
});
|
|
28
45
|
}
|
|
29
46
|
async commandAction(logger, args) {
|
|
30
47
|
if (this.verbose) {
|
|
@@ -114,75 +131,5 @@ class SpoCommandSetSetCommand extends SpoCommand {
|
|
|
114
131
|
}
|
|
115
132
|
}
|
|
116
133
|
}
|
|
117
|
-
_a = SpoCommandSetSetCommand, _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_initTelemetry = function _SpoCommandSetSetCommand_initTelemetry() {
|
|
118
|
-
this.telemetry.push((args) => {
|
|
119
|
-
Object.assign(this.telemetryProperties, {
|
|
120
|
-
title: typeof args.options.title !== 'undefined',
|
|
121
|
-
id: typeof args.options.id !== 'undefined',
|
|
122
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
123
|
-
newClientSideComponentId: typeof args.options.newClientSideComponentId !== 'undefined',
|
|
124
|
-
newTitle: typeof args.options.newTitle !== 'undefined',
|
|
125
|
-
description: typeof args.options.description !== 'undefined',
|
|
126
|
-
listType: typeof args.options.listType !== 'undefined',
|
|
127
|
-
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
128
|
-
scope: typeof args.options.scope !== 'undefined',
|
|
129
|
-
location: typeof args.options.location !== 'undefined'
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
}, _SpoCommandSetSetCommand_initOptions = function _SpoCommandSetSetCommand_initOptions() {
|
|
133
|
-
this.options.unshift({
|
|
134
|
-
option: '-u, --webUrl <webUrl>'
|
|
135
|
-
}, {
|
|
136
|
-
option: '-t, --title [title]'
|
|
137
|
-
}, {
|
|
138
|
-
option: '-i, --id [id]'
|
|
139
|
-
}, {
|
|
140
|
-
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
141
|
-
}, {
|
|
142
|
-
option: '--newClientSideComponentId [newClientSideComponentId]'
|
|
143
|
-
}, {
|
|
144
|
-
option: '--newTitle [newTitle]'
|
|
145
|
-
}, {
|
|
146
|
-
option: '--description [description]'
|
|
147
|
-
}, {
|
|
148
|
-
option: '-l, --listType [listType]', autocomplete: _a.listTypes
|
|
149
|
-
}, {
|
|
150
|
-
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
151
|
-
}, {
|
|
152
|
-
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
153
|
-
}, {
|
|
154
|
-
option: '--location [location]', autocomplete: _a.locations
|
|
155
|
-
});
|
|
156
|
-
}, _SpoCommandSetSetCommand_initValidators = function _SpoCommandSetSetCommand_initValidators() {
|
|
157
|
-
this.validators.push(async (args) => {
|
|
158
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
159
|
-
return `${args.options.id} is not a valid GUID`;
|
|
160
|
-
}
|
|
161
|
-
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
162
|
-
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
163
|
-
}
|
|
164
|
-
if (args.options.newClientSideComponentId && !validation.isValidGuid(args.options.newClientSideComponentId)) {
|
|
165
|
-
return `${args.options.newClientSideComponentId} is not a valid GUID`;
|
|
166
|
-
}
|
|
167
|
-
if (args.options.listType && _a.listTypes.indexOf(args.options.listType) < 0) {
|
|
168
|
-
return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
|
|
169
|
-
}
|
|
170
|
-
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
171
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
172
|
-
}
|
|
173
|
-
if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
|
|
174
|
-
return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
|
|
175
|
-
}
|
|
176
|
-
if (!args.options.newTitle && args.options.description === undefined && !args.options.listType && !args.options.clientSideComponentProperties && !args.options.location && !args.options.newClientSideComponentId) {
|
|
177
|
-
return `Please specify option to be updated`;
|
|
178
|
-
}
|
|
179
|
-
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
180
|
-
});
|
|
181
|
-
}, _SpoCommandSetSetCommand_initOptionSets = function _SpoCommandSetSetCommand_initOptionSets() {
|
|
182
|
-
this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
|
|
183
|
-
};
|
|
184
|
-
SpoCommandSetSetCommand.listTypes = ['List', 'Library', 'SitePages'];
|
|
185
|
-
SpoCommandSetSetCommand.scopes = ['All', 'Site', 'Web'];
|
|
186
|
-
SpoCommandSetSetCommand.locations = ['ContextMenu', 'CommandBar', 'Both'];
|
|
187
134
|
export default new SpoCommandSetSetCommand();
|
|
188
135
|
//# sourceMappingURL=commandset-set.js.map
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpoSiteScriptAddCommand_instances, _SpoSiteScriptAddCommand_initTelemetry, _SpoSiteScriptAddCommand_initOptions, _SpoSiteScriptAddCommand_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 { spo } from '../../../../utils/spo.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
|
+
title: z.string().alias('t'),
|
|
11
|
+
content: z.string()
|
|
12
|
+
.refine(val => {
|
|
13
|
+
try {
|
|
14
|
+
JSON.parse(val);
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
error: 'Specified content value is not a valid JSON string.'
|
|
22
|
+
})
|
|
23
|
+
.alias('c'),
|
|
24
|
+
description: z.string().optional().alias('d')
|
|
25
|
+
});
|
|
12
26
|
class SpoSiteScriptAddCommand extends SpoCommand {
|
|
13
27
|
get name() {
|
|
14
28
|
return commands.SITESCRIPT_ADD;
|
|
@@ -16,12 +30,8 @@ class SpoSiteScriptAddCommand extends SpoCommand {
|
|
|
16
30
|
get description() {
|
|
17
31
|
return 'Adds site script for use with site designs';
|
|
18
32
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoSiteScriptAddCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoSiteScriptAddCommand_instances, "m", _SpoSiteScriptAddCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoSiteScriptAddCommand_instances, "m", _SpoSiteScriptAddCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoSiteScriptAddCommand_instances, "m", _SpoSiteScriptAddCommand_initValidators).call(this);
|
|
33
|
+
get schema() {
|
|
34
|
+
return options;
|
|
25
35
|
}
|
|
26
36
|
async commandAction(logger, args) {
|
|
27
37
|
try {
|
|
@@ -45,30 +55,5 @@ class SpoSiteScriptAddCommand extends SpoCommand {
|
|
|
45
55
|
}
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
|
-
_SpoSiteScriptAddCommand_instances = new WeakSet(), _SpoSiteScriptAddCommand_initTelemetry = function _SpoSiteScriptAddCommand_initTelemetry() {
|
|
49
|
-
this.telemetry.push((args) => {
|
|
50
|
-
Object.assign(this.telemetryProperties, {
|
|
51
|
-
description: typeof args.options.description !== 'undefined'
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}, _SpoSiteScriptAddCommand_initOptions = function _SpoSiteScriptAddCommand_initOptions() {
|
|
55
|
-
this.options.unshift({
|
|
56
|
-
option: '-t, --title <title>'
|
|
57
|
-
}, {
|
|
58
|
-
option: '-c, --content <content>'
|
|
59
|
-
}, {
|
|
60
|
-
option: '-d, --description [description]'
|
|
61
|
-
});
|
|
62
|
-
}, _SpoSiteScriptAddCommand_initValidators = function _SpoSiteScriptAddCommand_initValidators() {
|
|
63
|
-
this.validators.push(async (args) => {
|
|
64
|
-
try {
|
|
65
|
-
JSON.parse(args.options.content);
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
return `Specified content value is not a valid JSON string. Error: ${e}`;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
58
|
export default new SpoSiteScriptAddCommand();
|
|
74
59
|
//# sourceMappingURL=sitescript-add.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 _SpoSiteScriptGetCommand_instances, _SpoSiteScriptGetCommand_initOptions, _SpoSiteScriptGetCommand_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
|
-
import { validation } from '../../../../utils/validation.js';
|
|
10
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
id: z.guid().alias('i'),
|
|
10
|
+
content: z.boolean().optional().alias('c')
|
|
11
|
+
});
|
|
12
12
|
class SpoSiteScriptGetCommand extends SpoCommand {
|
|
13
13
|
get name() {
|
|
14
14
|
return commands.SITESCRIPT_GET;
|
|
@@ -16,11 +16,8 @@ class SpoSiteScriptGetCommand extends SpoCommand {
|
|
|
16
16
|
get description() {
|
|
17
17
|
return 'Gets information about the specified site script';
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoSiteScriptGetCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoSiteScriptGetCommand_instances, "m", _SpoSiteScriptGetCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoSiteScriptGetCommand_instances, "m", _SpoSiteScriptGetCommand_initValidators).call(this);
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
24
21
|
}
|
|
25
22
|
async commandAction(logger, args) {
|
|
26
23
|
try {
|
|
@@ -49,19 +46,5 @@ class SpoSiteScriptGetCommand extends SpoCommand {
|
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
_SpoSiteScriptGetCommand_instances = new WeakSet(), _SpoSiteScriptGetCommand_initOptions = function _SpoSiteScriptGetCommand_initOptions() {
|
|
53
|
-
this.options.unshift({
|
|
54
|
-
option: '-i, --id <id>'
|
|
55
|
-
}, {
|
|
56
|
-
option: '-c, --content'
|
|
57
|
-
});
|
|
58
|
-
}, _SpoSiteScriptGetCommand_initValidators = function _SpoSiteScriptGetCommand_initValidators() {
|
|
59
|
-
this.validators.push(async (args) => {
|
|
60
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
61
|
-
return `${args.options.id} is not a valid GUID`;
|
|
62
|
-
}
|
|
63
|
-
return true;
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
49
|
export default new SpoSiteScriptGetCommand();
|
|
67
50
|
//# sourceMappingURL=sitescript-get.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 SpoSiteScriptListCommand extends SpoCommand {
|
|
6
8
|
get name() {
|
|
7
9
|
return commands.SITESCRIPT_LIST;
|
|
@@ -9,6 +11,9 @@ class SpoSiteScriptListCommand extends SpoCommand {
|
|
|
9
11
|
get description() {
|
|
10
12
|
return 'Lists site script available for use with site designs';
|
|
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,15 +1,15 @@
|
|
|
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 _SpoSiteScriptRemoveCommand_instances, _SpoSiteScriptRemoveCommand_initTelemetry, _SpoSiteScriptRemoveCommand_initOptions, _SpoSiteScriptRemoveCommand_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
|
-
import { validation } from '../../../../utils/validation.js';
|
|
11
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.guid().alias('i'),
|
|
11
|
+
force: z.boolean().optional().alias('f')
|
|
12
|
+
});
|
|
13
13
|
class SpoSiteScriptRemoveCommand extends SpoCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.SITESCRIPT_REMOVE;
|
|
@@ -17,12 +17,8 @@ class SpoSiteScriptRemoveCommand extends SpoCommand {
|
|
|
17
17
|
get description() {
|
|
18
18
|
return 'Removes the specified site script';
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_SpoSiteScriptRemoveCommand_instances.add(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoSiteScriptRemoveCommand_instances, "m", _SpoSiteScriptRemoveCommand_initTelemetry).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoSiteScriptRemoveCommand_instances, "m", _SpoSiteScriptRemoveCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _SpoSiteScriptRemoveCommand_instances, "m", _SpoSiteScriptRemoveCommand_initValidators).call(this);
|
|
20
|
+
get schema() {
|
|
21
|
+
return options;
|
|
26
22
|
}
|
|
27
23
|
async commandAction(logger, args) {
|
|
28
24
|
if (args.options.force) {
|
|
@@ -56,25 +52,5 @@ class SpoSiteScriptRemoveCommand extends SpoCommand {
|
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
|
-
_SpoSiteScriptRemoveCommand_instances = new WeakSet(), _SpoSiteScriptRemoveCommand_initTelemetry = function _SpoSiteScriptRemoveCommand_initTelemetry() {
|
|
60
|
-
this.telemetry.push((args) => {
|
|
61
|
-
Object.assign(this.telemetryProperties, {
|
|
62
|
-
force: args.options.force || false
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}, _SpoSiteScriptRemoveCommand_initOptions = function _SpoSiteScriptRemoveCommand_initOptions() {
|
|
66
|
-
this.options.unshift({
|
|
67
|
-
option: '-i, --id <id>'
|
|
68
|
-
}, {
|
|
69
|
-
option: '-f, --force'
|
|
70
|
-
});
|
|
71
|
-
}, _SpoSiteScriptRemoveCommand_initValidators = function _SpoSiteScriptRemoveCommand_initValidators() {
|
|
72
|
-
this.validators.push(async (args) => {
|
|
73
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
74
|
-
return `${args.options.id} is not a valid GUID`;
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
55
|
export default new SpoSiteScriptRemoveCommand();
|
|
80
56
|
//# sourceMappingURL=sitescript-remove.js.map
|
|
@@ -1,14 +1,34 @@
|
|
|
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 _SpoSiteScriptSetCommand_instances, _SpoSiteScriptSetCommand_initTelemetry, _SpoSiteScriptSetCommand_initOptions, _SpoSiteScriptSetCommand_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
|
-
import { validation } from '../../../../utils/validation.js';
|
|
10
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
6
|
import commands from '../../commands.js';
|
|
7
|
+
import { validation } from '../../../../utils/validation.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.guid().alias('i'),
|
|
11
|
+
title: z.string().optional().alias('t'),
|
|
12
|
+
description: z.string().optional().alias('d'),
|
|
13
|
+
version: z.string()
|
|
14
|
+
.refine(val => validation.isValidPositiveInteger(val), {
|
|
15
|
+
error: 'Version must be a number.'
|
|
16
|
+
})
|
|
17
|
+
.optional().alias('v'),
|
|
18
|
+
content: z.string()
|
|
19
|
+
.refine(val => {
|
|
20
|
+
try {
|
|
21
|
+
JSON.parse(val);
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
error: 'Specified content value is not a valid JSON string.'
|
|
29
|
+
})
|
|
30
|
+
.optional().alias('c')
|
|
31
|
+
});
|
|
12
32
|
class SpoSiteScriptSetCommand extends SpoCommand {
|
|
13
33
|
get name() {
|
|
14
34
|
return commands.SITESCRIPT_SET;
|
|
@@ -16,12 +36,8 @@ class SpoSiteScriptSetCommand extends SpoCommand {
|
|
|
16
36
|
get description() {
|
|
17
37
|
return 'Updates existing site script';
|
|
18
38
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_SpoSiteScriptSetCommand_instances.add(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoSiteScriptSetCommand_instances, "m", _SpoSiteScriptSetCommand_initTelemetry).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoSiteScriptSetCommand_instances, "m", _SpoSiteScriptSetCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _SpoSiteScriptSetCommand_instances, "m", _SpoSiteScriptSetCommand_initValidators).call(this);
|
|
39
|
+
get schema() {
|
|
40
|
+
return options;
|
|
25
41
|
}
|
|
26
42
|
async commandAction(logger, args) {
|
|
27
43
|
try {
|
|
@@ -60,48 +76,5 @@ class SpoSiteScriptSetCommand extends SpoCommand {
|
|
|
60
76
|
}
|
|
61
77
|
}
|
|
62
78
|
}
|
|
63
|
-
_SpoSiteScriptSetCommand_instances = new WeakSet(), _SpoSiteScriptSetCommand_initTelemetry = function _SpoSiteScriptSetCommand_initTelemetry() {
|
|
64
|
-
this.telemetry.push((args) => {
|
|
65
|
-
Object.assign(this.telemetryProperties, {
|
|
66
|
-
title: (!(!args.options.title)).toString(),
|
|
67
|
-
description: (!(!args.options.description)).toString(),
|
|
68
|
-
version: (!(!args.options.version)).toString(),
|
|
69
|
-
content: (!(!args.options.content)).toString()
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
}, _SpoSiteScriptSetCommand_initOptions = function _SpoSiteScriptSetCommand_initOptions() {
|
|
73
|
-
this.options.unshift({
|
|
74
|
-
option: '-i, --id <id>'
|
|
75
|
-
}, {
|
|
76
|
-
option: '-t, --title [title]'
|
|
77
|
-
}, {
|
|
78
|
-
option: '-d, --description [description]'
|
|
79
|
-
}, {
|
|
80
|
-
option: '-v, --version [version]'
|
|
81
|
-
}, {
|
|
82
|
-
option: '-c, --content [content]'
|
|
83
|
-
});
|
|
84
|
-
}, _SpoSiteScriptSetCommand_initValidators = function _SpoSiteScriptSetCommand_initValidators() {
|
|
85
|
-
this.validators.push(async (args) => {
|
|
86
|
-
if (!validation.isValidGuid(args.options.id)) {
|
|
87
|
-
return `${args.options.id} is not a valid GUID`;
|
|
88
|
-
}
|
|
89
|
-
if (args.options.version) {
|
|
90
|
-
const version = parseInt(args.options.version);
|
|
91
|
-
if (isNaN(version)) {
|
|
92
|
-
return `${args.options.version} is not a number`;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (args.options.content) {
|
|
96
|
-
try {
|
|
97
|
-
JSON.parse(args.options.content);
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
return `Specified content value is not a valid JSON string. Error: ${e}`;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return true;
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
79
|
export default new SpoSiteScriptSetCommand();
|
|
107
80
|
//# sourceMappingURL=sitescript-set.js.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
1
2
|
import config from '../../../../config.js';
|
|
2
3
|
import request from '../../../../request.js';
|
|
3
4
|
import { spo } from '../../../../utils/spo.js';
|
|
4
5
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
5
6
|
import commands from '../../commands.js';
|
|
7
|
+
export const options = globalOptionsZod.strict();
|
|
6
8
|
class SppContentCenterListCommand extends SpoCommand {
|
|
7
9
|
get name() {
|
|
8
10
|
return commands.CONTENTCENTER_LIST;
|
|
@@ -13,6 +15,9 @@ class SppContentCenterListCommand extends SpoCommand {
|
|
|
13
15
|
defaultProperties() {
|
|
14
16
|
return ['Title', 'Url'];
|
|
15
17
|
}
|
|
18
|
+
get schema() {
|
|
19
|
+
return options;
|
|
20
|
+
}
|
|
16
21
|
async commandAction(logger) {
|
|
17
22
|
try {
|
|
18
23
|
if (this.verbose) {
|
|
@@ -1,15 +1,22 @@
|
|
|
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 _SppModelGetCommand_instances, _SppModelGetCommand_initTelemetry, _SppModelGetCommand_initOptions, _SppModelGetCommand_initValidators, _SppModelGetCommand_initOptionSets, _SppModelGetCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { odata } from '../../../../utils/odata.js';
|
|
8
4
|
import { spp } from '../../../../utils/spp.js';
|
|
9
5
|
import { urlUtil } from '../../../../utils/urlUtil.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
|
+
siteUrl: z.string()
|
|
12
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
})
|
|
15
|
+
.alias('u'),
|
|
16
|
+
id: z.guid().optional().alias('i'),
|
|
17
|
+
title: z.string().optional().alias('t'),
|
|
18
|
+
withPublications: z.boolean().optional()
|
|
19
|
+
});
|
|
13
20
|
class SppModelGetCommand extends SpoCommand {
|
|
14
21
|
get name() {
|
|
15
22
|
return commands.MODEL_GET;
|
|
@@ -17,14 +24,18 @@ class SppModelGetCommand extends SpoCommand {
|
|
|
17
24
|
get description() {
|
|
18
25
|
return 'Retrieves information about a document understanding model';
|
|
19
26
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
get schema() {
|
|
28
|
+
return options;
|
|
29
|
+
}
|
|
30
|
+
getRefinedSchema(schema) {
|
|
31
|
+
return schema
|
|
32
|
+
.refine(opts => [opts.id, opts.title].filter(x => x !== undefined).length === 1, {
|
|
33
|
+
message: `Specify either 'id' or 'title', but not both.`,
|
|
34
|
+
params: {
|
|
35
|
+
customCode: 'optionSet',
|
|
36
|
+
options: ['id', 'title']
|
|
37
|
+
}
|
|
38
|
+
});
|
|
28
39
|
}
|
|
29
40
|
async commandAction(logger, args) {
|
|
30
41
|
try {
|
|
@@ -56,36 +67,5 @@ class SppModelGetCommand extends SpoCommand {
|
|
|
56
67
|
}
|
|
57
68
|
}
|
|
58
69
|
}
|
|
59
|
-
_SppModelGetCommand_instances = new WeakSet(), _SppModelGetCommand_initTelemetry = function _SppModelGetCommand_initTelemetry() {
|
|
60
|
-
this.telemetry.push((args) => {
|
|
61
|
-
Object.assign(this.telemetryProperties, {
|
|
62
|
-
id: typeof args.options.id !== 'undefined',
|
|
63
|
-
title: typeof args.options.title !== 'undefined',
|
|
64
|
-
withPublications: !!args.options.withPublications
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
}, _SppModelGetCommand_initOptions = function _SppModelGetCommand_initOptions() {
|
|
68
|
-
this.options.unshift({
|
|
69
|
-
option: '-u, --siteUrl <siteUrl>'
|
|
70
|
-
}, {
|
|
71
|
-
option: '-i, --id [id]'
|
|
72
|
-
}, {
|
|
73
|
-
option: '-t, --title [title]'
|
|
74
|
-
}, {
|
|
75
|
-
option: '--withPublications'
|
|
76
|
-
});
|
|
77
|
-
}, _SppModelGetCommand_initValidators = function _SppModelGetCommand_initValidators() {
|
|
78
|
-
this.validators.push(async (args) => {
|
|
79
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
80
|
-
return `${args.options.id} is not a valid GUID for option 'id'.`;
|
|
81
|
-
}
|
|
82
|
-
return validation.isValidSharePointUrl(args.options.siteUrl);
|
|
83
|
-
});
|
|
84
|
-
}, _SppModelGetCommand_initOptionSets = function _SppModelGetCommand_initOptionSets() {
|
|
85
|
-
this.optionSets.push({ options: ['id', 'title'] });
|
|
86
|
-
}, _SppModelGetCommand_initTypes = function _SppModelGetCommand_initTypes() {
|
|
87
|
-
this.types.string.push('siteUrl', 'id', 'title');
|
|
88
|
-
this.types.boolean.push('withPublications');
|
|
89
|
-
};
|
|
90
70
|
export default new SppModelGetCommand();
|
|
91
71
|
//# sourceMappingURL=model-get.js.map
|
|
@@ -1,15 +1,19 @@
|
|
|
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 _SppModelListCommand_instances, _SppModelListCommand_initOptions, _SppModelListCommand_initTypes, _SppModelListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { odata } from '../../../../utils/odata.js';
|
|
8
4
|
import { spp } from '../../../../utils/spp.js';
|
|
9
5
|
import { urlUtil } from '../../../../utils/urlUtil.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
|
+
siteUrl: z.string()
|
|
12
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
13
|
+
error: e => `'${e.input}' is not a valid SharePoint Online site URL.`
|
|
14
|
+
})
|
|
15
|
+
.alias('u')
|
|
16
|
+
});
|
|
13
17
|
class SppModelListCommand extends SpoCommand {
|
|
14
18
|
get name() {
|
|
15
19
|
return commands.MODEL_LIST;
|
|
@@ -20,12 +24,8 @@ class SppModelListCommand extends SpoCommand {
|
|
|
20
24
|
defaultProperties() {
|
|
21
25
|
return ['AIBuilderHybridModelType', 'ContentTypeName', 'LastTrained', 'UniqueId'];
|
|
22
26
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_SppModelListCommand_instances.add(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SppModelListCommand_instances, "m", _SppModelListCommand_initOptions).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SppModelListCommand_instances, "m", _SppModelListCommand_initTypes).call(this);
|
|
28
|
-
__classPrivateFieldGet(this, _SppModelListCommand_instances, "m", _SppModelListCommand_initValidators).call(this);
|
|
27
|
+
get schema() {
|
|
28
|
+
return options;
|
|
29
29
|
}
|
|
30
30
|
async commandAction(logger, args) {
|
|
31
31
|
try {
|
|
@@ -42,16 +42,5 @@ class SppModelListCommand extends SpoCommand {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
_SppModelListCommand_instances = new WeakSet(), _SppModelListCommand_initOptions = function _SppModelListCommand_initOptions() {
|
|
46
|
-
this.options.unshift({
|
|
47
|
-
option: '-u, --siteUrl <siteUrl>'
|
|
48
|
-
});
|
|
49
|
-
}, _SppModelListCommand_initTypes = function _SppModelListCommand_initTypes() {
|
|
50
|
-
this.types.string.push('siteUrl');
|
|
51
|
-
}, _SppModelListCommand_initValidators = function _SppModelListCommand_initValidators() {
|
|
52
|
-
this.validators.push(async (args) => {
|
|
53
|
-
return validation.isValidSharePointUrl(args.options.siteUrl);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
45
|
export default new SppModelListCommand();
|
|
57
46
|
//# sourceMappingURL=model-list.js.map
|