@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
package/dist/Command.js
CHANGED
|
@@ -424,7 +424,7 @@ class Command {
|
|
|
424
424
|
if (this.schema) {
|
|
425
425
|
const telemetryProperties = {};
|
|
426
426
|
this.optionsInfo.forEach(o => {
|
|
427
|
-
if (o.required) {
|
|
427
|
+
if (o.required && !o.autocomplete) {
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
430
|
if (typeof args.options[o.name] === 'undefined') {
|
|
@@ -432,23 +432,26 @@ class Command {
|
|
|
432
432
|
}
|
|
433
433
|
switch (o.type) {
|
|
434
434
|
case 'string':
|
|
435
|
-
telemetryProperties[o.name] = o.autocomplete ? args.options[o.name] :
|
|
435
|
+
telemetryProperties[o.name] = o.autocomplete ? args.options[o.name] : true;
|
|
436
436
|
break;
|
|
437
437
|
case 'boolean':
|
|
438
438
|
telemetryProperties[o.name] = args.options[o.name];
|
|
439
439
|
break;
|
|
440
440
|
case 'number':
|
|
441
|
-
telemetryProperties[o.name] =
|
|
441
|
+
telemetryProperties[o.name] = true;
|
|
442
442
|
break;
|
|
443
443
|
}
|
|
444
|
-
;
|
|
445
444
|
});
|
|
445
|
+
if (this.allowUnknownOptions()) {
|
|
446
|
+
const unknownOptions = optionsUtils.getUnknownOptions(args.options, zod.schemaToOptions(this.schema));
|
|
447
|
+
Object.keys(unknownOptions).forEach(optionName => {
|
|
448
|
+
telemetryProperties[optionName] = true;
|
|
449
|
+
});
|
|
450
|
+
}
|
|
446
451
|
return telemetryProperties;
|
|
447
452
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
return this.telemetryProperties;
|
|
451
|
-
}
|
|
453
|
+
this.telemetry.forEach(t => t(args));
|
|
454
|
+
return this.telemetryProperties;
|
|
452
455
|
}
|
|
453
456
|
async getTextOutput(logStatement) {
|
|
454
457
|
// display object as a list of key-value pairs
|
package/dist/cli/cli.js
CHANGED
|
@@ -47,6 +47,21 @@ const yargsConfiguration = {
|
|
|
47
47
|
'boolean-negation': true,
|
|
48
48
|
'camel-case-expansion': false
|
|
49
49
|
};
|
|
50
|
+
function isMissingRequiredValueError(error, options) {
|
|
51
|
+
if (error.code !== 'invalid_type') {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
let currentValue = options;
|
|
55
|
+
for (const pathSegment of error.path) {
|
|
56
|
+
if (currentValue === null ||
|
|
57
|
+
typeof currentValue !== 'object' ||
|
|
58
|
+
!Object.prototype.hasOwnProperty.call(currentValue, pathSegment)) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
currentValue = currentValue[pathSegment];
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
50
65
|
function getConfig() {
|
|
51
66
|
if (!_config) {
|
|
52
67
|
_config = new Configstore(config.configstoreName);
|
|
@@ -159,15 +174,14 @@ async function execute(rawArgs) {
|
|
|
159
174
|
const shouldPrompt = cli.getSettingWithDefaultValue(settingsNames.prompt, true);
|
|
160
175
|
if (!shouldPrompt) {
|
|
161
176
|
result.error.issues.forEach(e => {
|
|
162
|
-
if (e.
|
|
163
|
-
e.input === undefined) {
|
|
177
|
+
if (isMissingRequiredValueError(e, cli.optionsFromArgs.options)) {
|
|
164
178
|
e.message = `Required option not specified`;
|
|
165
179
|
}
|
|
166
180
|
});
|
|
167
181
|
return cli.closeWithError(result.error, cli.optionsFromArgs, true);
|
|
168
182
|
}
|
|
169
183
|
const missingRequiredValuesErrors = result.error.issues
|
|
170
|
-
.filter(e => (e
|
|
184
|
+
.filter(e => isMissingRequiredValueError(e, cli.optionsFromArgs.options) ||
|
|
171
185
|
(e.code === 'custom' && e.params?.customCode === 'required'));
|
|
172
186
|
const optionSetErrors = result.error.issues
|
|
173
187
|
.filter(e => e.code === 'custom' && e.params?.customCode === 'optionSet');
|
|
@@ -191,12 +205,24 @@ async function execute(rawArgs) {
|
|
|
191
205
|
return cli.closeWithError(e.message, cli.optionsFromArgs, true);
|
|
192
206
|
}
|
|
193
207
|
}
|
|
208
|
+
try {
|
|
209
|
+
await cli.commandToExecute.command.processOptions(cli.optionsFromArgs.options);
|
|
210
|
+
}
|
|
211
|
+
catch (e) {
|
|
212
|
+
return cli.closeWithError(e.message, cli.optionsFromArgs, false);
|
|
213
|
+
}
|
|
194
214
|
continue;
|
|
195
215
|
}
|
|
196
216
|
if (optionSetErrors.length > 0) {
|
|
197
217
|
for (const error of optionSetErrors) {
|
|
198
218
|
await promptForOptionSetNameAndValue(cli.optionsFromArgs, error.params?.options);
|
|
199
219
|
}
|
|
220
|
+
try {
|
|
221
|
+
await cli.commandToExecute.command.processOptions(cli.optionsFromArgs.options);
|
|
222
|
+
}
|
|
223
|
+
catch (e) {
|
|
224
|
+
return cli.closeWithError(e.message, cli.optionsFromArgs, false);
|
|
225
|
+
}
|
|
200
226
|
continue;
|
|
201
227
|
}
|
|
202
228
|
}
|
|
@@ -910,24 +936,11 @@ async function promptForOptionSetNameAndValue(args, options) {
|
|
|
910
936
|
await cli.error(`🌶️ Please specify one of the following options:`);
|
|
911
937
|
const selectedOptionName = await prompt.forSelection({ message: `Option to use:`, choices: options.map((choice) => { return { name: choice, value: choice }; }) });
|
|
912
938
|
const optionValue = await prompt.forInput({ message: `${selectedOptionName}:` });
|
|
913
|
-
|
|
914
|
-
// Basic type coercion to align with how CLI arguments are typically parsed
|
|
915
|
-
if (typeof optionValue === 'string') {
|
|
916
|
-
const trimmed = optionValue.trim();
|
|
917
|
-
if (trimmed === 'true') {
|
|
918
|
-
coercedValue = true;
|
|
919
|
-
}
|
|
920
|
-
else if (trimmed === 'false') {
|
|
921
|
-
coercedValue = false;
|
|
922
|
-
}
|
|
923
|
-
else if (trimmed !== '' && !isNaN(Number(trimmed))) {
|
|
924
|
-
coercedValue = Number(trimmed);
|
|
925
|
-
}
|
|
926
|
-
}
|
|
939
|
+
const parsedOptions = getCommandOptionsFromArgs([`--${selectedOptionName}`, optionValue], cli.commandToExecute);
|
|
927
940
|
options
|
|
928
941
|
.filter(optionName => optionName !== selectedOptionName)
|
|
929
942
|
.forEach(optionName => args.options[optionName] = undefined);
|
|
930
|
-
args.options[selectedOptionName] =
|
|
943
|
+
args.options[selectedOptionName] = parsedOptions[selectedOptionName];
|
|
931
944
|
await cli.error('');
|
|
932
945
|
}
|
|
933
946
|
export const cli = {
|
package/dist/config.js
CHANGED
|
@@ -4,6 +4,7 @@ export default {
|
|
|
4
4
|
'https://management.azure.com/user_impersonation',
|
|
5
5
|
'https://admin.services.crm.dynamics.com/user_impersonation',
|
|
6
6
|
'https://graph.microsoft.com/AgentIdentityBlueprint.Read.All',
|
|
7
|
+
'https://graph.microsoft.com/AgentIdentityBlueprintPrincipal.Read.All',
|
|
7
8
|
'https://graph.microsoft.com/AppCatalog.ReadWrite.All',
|
|
8
9
|
'https://graph.microsoft.com/AuditLog.Read.All',
|
|
9
10
|
'https://graph.microsoft.com/Bookings.Read.All',
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
4
|
+
import { odata } from '../../../../utils/odata.js';
|
|
5
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
6
|
+
import commands from '../../commands.js';
|
|
7
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
properties: z.string().optional().alias('p')
|
|
11
|
+
});
|
|
12
|
+
class EntraAgentBlueprintPrincipalListCommand extends GraphCommand {
|
|
13
|
+
get name() {
|
|
14
|
+
return commands.AGENT_BLUEPRINTPRINCIPAL_LIST;
|
|
15
|
+
}
|
|
16
|
+
get description() {
|
|
17
|
+
return 'Retrieves a list of agent blueprint principals';
|
|
18
|
+
}
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
21
|
+
}
|
|
22
|
+
defaultProperties() {
|
|
23
|
+
return ['id', 'appDisplayName', 'appId'];
|
|
24
|
+
}
|
|
25
|
+
async commandAction(logger, args) {
|
|
26
|
+
const queryParameters = [];
|
|
27
|
+
if (args.options.properties) {
|
|
28
|
+
const allProperties = args.options.properties
|
|
29
|
+
.split(',')
|
|
30
|
+
.map(prop => prop.trim())
|
|
31
|
+
.filter(prop => prop.length > 0);
|
|
32
|
+
const selectProperties = [...new Set(allProperties.map(prop => prop.split('/')[0]))];
|
|
33
|
+
if (selectProperties.length > 0) {
|
|
34
|
+
queryParameters.push(`$select=${selectProperties.map(property => formatting.encodeQueryParameter(property)).join(',')}`);
|
|
35
|
+
if (cli.commandToExecute) {
|
|
36
|
+
cli.commandToExecute.defaultProperties = selectProperties;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const queryString = queryParameters.length > 0
|
|
41
|
+
? `?${queryParameters.join('&')}`
|
|
42
|
+
: '';
|
|
43
|
+
try {
|
|
44
|
+
if (this.verbose) {
|
|
45
|
+
await logger.logToStderr(`Retrieving a list of agent blueprint principals...`);
|
|
46
|
+
}
|
|
47
|
+
const results = await odata.getAllItems(`${this.resource}/v1.0/servicePrincipals/microsoft.graph.agentIdentityBlueprintPrincipal${queryString}`);
|
|
48
|
+
await logger.log(results);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
this.handleRejectedODataJsonPromise(err);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export default new EntraAgentBlueprintPrincipalListCommand();
|
|
56
|
+
//# sourceMappingURL=agent-blueprintprincipal-list.js.map
|
|
@@ -11,6 +11,7 @@ export default {
|
|
|
11
11
|
ADMINISTRATIVEUNIT_ROLEASSIGNMENT_ADD: `${prefix} administrativeunit roleassignment add`,
|
|
12
12
|
AGENT_LIST: `${prefix} agent list`,
|
|
13
13
|
AGENT_BLUEPRINT_LIST: `${prefix} agent blueprint list`,
|
|
14
|
+
AGENT_BLUEPRINTPRINCIPAL_LIST: `${prefix} agent blueprintprincipal list`,
|
|
14
15
|
APP_ADD: `${prefix} app add`,
|
|
15
16
|
APP_GET: `${prefix} app get`,
|
|
16
17
|
APP_LIST: `${prefix} app list`,
|
|
@@ -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 _SpeContainerActivateCommand_instances, _SpeContainerActivateCommand_initOptions, _SpeContainerActivateCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
8
4
|
import commands from '../../commands.js';
|
|
9
5
|
import request from '../../../../request.js';
|
|
10
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
id: z.string().alias('i')
|
|
10
|
+
});
|
|
11
11
|
class SpeContainerActivateCommand extends GraphCommand {
|
|
12
12
|
get name() {
|
|
13
13
|
return commands.CONTAINER_ACTIVATE;
|
|
@@ -15,11 +15,8 @@ class SpeContainerActivateCommand extends GraphCommand {
|
|
|
15
15
|
get description() {
|
|
16
16
|
return 'Activates a container';
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpeContainerActivateCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpeContainerActivateCommand_instances, "m", _SpeContainerActivateCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpeContainerActivateCommand_instances, "m", _SpeContainerActivateCommand_initTypes).call(this);
|
|
18
|
+
get schema() {
|
|
19
|
+
return options;
|
|
23
20
|
}
|
|
24
21
|
async commandAction(logger, args) {
|
|
25
22
|
if (this.verbose) {
|
|
@@ -41,10 +38,5 @@ class SpeContainerActivateCommand extends GraphCommand {
|
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
_SpeContainerActivateCommand_instances = new WeakSet(), _SpeContainerActivateCommand_initOptions = function _SpeContainerActivateCommand_initOptions() {
|
|
45
|
-
this.options.unshift({ option: '-i, --id <id>' });
|
|
46
|
-
}, _SpeContainerActivateCommand_initTypes = function _SpeContainerActivateCommand_initTypes() {
|
|
47
|
-
this.types.string.push('id');
|
|
48
|
-
};
|
|
49
41
|
export default new SpeContainerActivateCommand();
|
|
50
42
|
//# sourceMappingURL=container-activate.js.map
|
|
@@ -1,34 +1,38 @@
|
|
|
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 _SpeContainerListCommand_instances, _SpeContainerListCommand_initTelemetry, _SpeContainerListCommand_initOptions, _SpeContainerListCommand_initValidators, _SpeContainerListCommand_initOptionSets, _SpeContainerListCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
4
|
import { odata } from '../../../../utils/odata.js';
|
|
9
|
-
import { validation } from '../../../../utils/validation.js';
|
|
10
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
6
|
import commands from '../../commands.js';
|
|
12
7
|
import { spe } from '../../../../utils/spe.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
containerTypeId: z.guid().optional(),
|
|
11
|
+
containerTypeName: z.string().optional()
|
|
12
|
+
});
|
|
13
13
|
class SpeContainerListCommand extends GraphCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.CONTAINER_LIST;
|
|
16
16
|
}
|
|
17
17
|
get description() {
|
|
18
|
-
return 'Lists
|
|
18
|
+
return 'Lists containers of a specific Container Type';
|
|
19
|
+
}
|
|
20
|
+
get schema() {
|
|
21
|
+
return options;
|
|
22
|
+
}
|
|
23
|
+
getRefinedSchema(schema) {
|
|
24
|
+
return schema
|
|
25
|
+
.refine(opts => [opts.containerTypeId, opts.containerTypeName].filter(o => o !== undefined).length === 1, {
|
|
26
|
+
message: 'Specify one of the following options: containerTypeId, containerTypeName.',
|
|
27
|
+
params: {
|
|
28
|
+
customCode: 'optionSet',
|
|
29
|
+
options: ['containerTypeId', 'containerTypeName']
|
|
30
|
+
}
|
|
31
|
+
});
|
|
19
32
|
}
|
|
20
33
|
defaultProperties() {
|
|
21
34
|
return ['id', 'displayName', 'containerTypeId', 'createdDateTime'];
|
|
22
35
|
}
|
|
23
|
-
constructor() {
|
|
24
|
-
super();
|
|
25
|
-
_SpeContainerListCommand_instances.add(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initTelemetry).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initOptions).call(this);
|
|
28
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initValidators).call(this);
|
|
29
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initOptionSets).call(this);
|
|
30
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initTypes).call(this);
|
|
31
|
-
}
|
|
32
36
|
async commandAction(logger, args) {
|
|
33
37
|
try {
|
|
34
38
|
if (this.verbose) {
|
|
@@ -49,30 +53,5 @@ class SpeContainerListCommand extends GraphCommand {
|
|
|
49
53
|
return spe.getContainerTypeIdByName(options.containerTypeName);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
|
-
_SpeContainerListCommand_instances = new WeakSet(), _SpeContainerListCommand_initTelemetry = function _SpeContainerListCommand_initTelemetry() {
|
|
53
|
-
this.telemetry.push((args) => {
|
|
54
|
-
Object.assign(this.telemetryProperties, {
|
|
55
|
-
containerTypeId: typeof args.options.containerTypeId !== 'undefined',
|
|
56
|
-
containerTypeName: typeof args.options.containerTypeName !== 'undefined'
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}, _SpeContainerListCommand_initOptions = function _SpeContainerListCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '--containerTypeId [containerTypeId]'
|
|
62
|
-
}, {
|
|
63
|
-
option: '--containerTypeName [containerTypeName]'
|
|
64
|
-
});
|
|
65
|
-
}, _SpeContainerListCommand_initValidators = function _SpeContainerListCommand_initValidators() {
|
|
66
|
-
this.validators.push(async (args) => {
|
|
67
|
-
if (args.options.containerTypeId && !validation.isValidGuid(args.options.containerTypeId)) {
|
|
68
|
-
return `${args.options.containerTypeId} is not a valid GUID`;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
});
|
|
72
|
-
}, _SpeContainerListCommand_initOptionSets = function _SpeContainerListCommand_initOptionSets() {
|
|
73
|
-
this.optionSets.push({ options: ['containerTypeId', 'containerTypeName'] });
|
|
74
|
-
}, _SpeContainerListCommand_initTypes = function _SpeContainerListCommand_initTypes() {
|
|
75
|
-
this.types.string.push('containerTypeId', 'containerTypeName');
|
|
76
|
-
};
|
|
77
56
|
export default new SpeContainerListCommand();
|
|
78
57
|
//# sourceMappingURL=container-list.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import commands from '../../commands.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
2
3
|
import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
|
|
3
4
|
import { odata } from '../../../../utils/odata.js';
|
|
5
|
+
export const options = globalOptionsZod.strict();
|
|
4
6
|
class SpeContainerTypeListCommand extends GraphDelegatedCommand {
|
|
5
7
|
get name() {
|
|
6
8
|
return commands.CONTAINERTYPE_LIST;
|
|
@@ -8,6 +10,9 @@ class SpeContainerTypeListCommand extends GraphDelegatedCommand {
|
|
|
8
10
|
get description() {
|
|
9
11
|
return 'Lists all container types';
|
|
10
12
|
}
|
|
13
|
+
get schema() {
|
|
14
|
+
return options;
|
|
15
|
+
}
|
|
11
16
|
defaultProperties() {
|
|
12
17
|
return ['id', 'name', 'owningAppId'];
|
|
13
18
|
}
|
|
@@ -668,6 +668,21 @@ export const versions = {
|
|
|
668
668
|
range: '^4 || ^5 || ^6 || ^7',
|
|
669
669
|
fix: 'npm i -g yo@7'
|
|
670
670
|
}
|
|
671
|
+
},
|
|
672
|
+
'1.24.1': {
|
|
673
|
+
heft: {
|
|
674
|
+
range: '^1',
|
|
675
|
+
fix: 'npm i -g @rushstack/heft@1'
|
|
676
|
+
},
|
|
677
|
+
node: {
|
|
678
|
+
range: '>=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0',
|
|
679
|
+
fix: 'Install Node.js >=22.14.0 <23.0.0 || >=24.0.0 <25.0.0 || >=26.0.0 <27.0.0'
|
|
680
|
+
},
|
|
681
|
+
sp: SharePointVersion.SPO,
|
|
682
|
+
yo: {
|
|
683
|
+
range: '^4 || ^5 || ^6 || ^7',
|
|
684
|
+
fix: 'npm i -g yo@7'
|
|
685
|
+
}
|
|
671
686
|
}
|
|
672
687
|
};
|
|
673
688
|
//# sourceMappingURL=SpfxCompatibilityMatrix.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
2
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
3
|
+
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
4
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
5
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
6
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
7
|
+
import { FN002022_DEVDEP_typescript } from './rules/FN002022_DEVDEP_typescript.js';
|
|
8
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
9
|
+
export default [
|
|
10
|
+
new FN001008_DEP_react({ supportedRange: '18' }),
|
|
11
|
+
new FN001009_DEP_react_dom({ supportedRange: '18' }),
|
|
12
|
+
new FN001035_DEP_fluentui_react({ supportedRange: '^8.106.4' }),
|
|
13
|
+
new FN002013_DEVDEP_types_webpack_env({ supportedRange: '~1.15.2' }),
|
|
14
|
+
new FN002015_DEVDEP_types_react({ supportedRange: '18' }),
|
|
15
|
+
new FN002016_DEVDEP_types_react_dom({ supportedRange: '18' }),
|
|
16
|
+
new FN002022_DEVDEP_typescript({ supportedRange: '~5.8.0' }),
|
|
17
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version({ includeDevDeps: true })
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=doctor-1.24.1.js.map
|
|
@@ -79,7 +79,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
79
79
|
'1.22.2',
|
|
80
80
|
'1.23.0',
|
|
81
81
|
'1.23.2',
|
|
82
|
-
'1.24.0'
|
|
82
|
+
'1.24.0',
|
|
83
|
+
'1.24.1'
|
|
83
84
|
];
|
|
84
85
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
85
86
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DependencyRule } from './DependencyRule.js';
|
|
2
|
+
export class FN027004_OVERRIDES_serialize_javascript extends DependencyRule {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
super({ packageName: 'serialize-javascript', packageVersion: options.version, isOverride: true });
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN027004';
|
|
8
|
+
}
|
|
9
|
+
visit(project, findings) {
|
|
10
|
+
const updateFindings = [];
|
|
11
|
+
super.visit(project, updateFindings);
|
|
12
|
+
// If an override entry for the package already exists in package.json,
|
|
13
|
+
// emit an extra finding to remove the existing override first. This avoids
|
|
14
|
+
// having to use a separate remove-override rule (e.g. FN027003) in the upgrade scripts.
|
|
15
|
+
if (project.packageJson?.overrides?.[this.packageName] && updateFindings.length > 0) {
|
|
16
|
+
const node = this.getAstNodeFromFile(project.packageJson, `overrides.${this.packageName}`);
|
|
17
|
+
findings.push({
|
|
18
|
+
id: `${this.id}_REMOVE`,
|
|
19
|
+
title: this.packageName,
|
|
20
|
+
description: `Remove existing SharePoint Framework override dependency package ${this.packageName}`,
|
|
21
|
+
occurrences: [{
|
|
22
|
+
file: this.file,
|
|
23
|
+
resolution: `removeOverride overrides.${this.packageName}`,
|
|
24
|
+
position: this.getPositionFromNode(node)
|
|
25
|
+
}],
|
|
26
|
+
resolutionType: 'cmd',
|
|
27
|
+
severity: 'Required',
|
|
28
|
+
supersedes: []
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
findings.push(...updateFindings);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=FN027004_OVERRIDES_serialize_javascript.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FN001001_DEP_microsoft_sp_core_library } from './rules/FN001001_DEP_microsoft_sp_core_library.js';
|
|
2
|
+
import { FN001002_DEP_microsoft_sp_lodash_subset } from './rules/FN001002_DEP_microsoft_sp_lodash_subset.js';
|
|
3
|
+
import { FN001003_DEP_microsoft_sp_office_ui_fabric_core } from './rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.js';
|
|
4
|
+
import { FN001004_DEP_microsoft_sp_webpart_base } from './rules/FN001004_DEP_microsoft_sp_webpart_base.js';
|
|
5
|
+
import { FN001011_DEP_microsoft_sp_dialog } from './rules/FN001011_DEP_microsoft_sp_dialog.js';
|
|
6
|
+
import { FN001012_DEP_microsoft_sp_application_base } from './rules/FN001012_DEP_microsoft_sp_application_base.js';
|
|
7
|
+
import { FN001013_DEP_microsoft_decorators } from './rules/FN001013_DEP_microsoft_decorators.js';
|
|
8
|
+
import { FN001014_DEP_microsoft_sp_listview_extensibility } from './rules/FN001014_DEP_microsoft_sp_listview_extensibility.js';
|
|
9
|
+
import { FN001021_DEP_microsoft_sp_property_pane } from './rules/FN001021_DEP_microsoft_sp_property_pane.js';
|
|
10
|
+
import { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
|
|
11
|
+
import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
|
|
12
|
+
import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
|
|
13
|
+
import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
|
|
14
|
+
import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
|
|
15
|
+
import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
|
|
16
|
+
import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
|
|
17
|
+
import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
|
|
18
|
+
import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
|
|
19
|
+
import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
|
|
20
|
+
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
|
+
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
22
|
+
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
23
|
+
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
24
|
+
import { FN002030_DEVDEP_microsoft_spfx_web_build_rig } from './rules/FN002030_DEVDEP_microsoft_spfx_web_build_rig.js';
|
|
25
|
+
import { FN002034_DEVDEP_microsoft_spfx_heft_plugins } from './rules/FN002034_DEVDEP_microsoft_spfx_heft_plugins.js';
|
|
26
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
27
|
+
import { FN027004_OVERRIDES_serialize_javascript } from './rules/FN027004_OVERRIDES_serialize_javascript.js';
|
|
28
|
+
export default [
|
|
29
|
+
new FN001001_DEP_microsoft_sp_core_library({ packageVersion: '1.24.1' }),
|
|
30
|
+
new FN001002_DEP_microsoft_sp_lodash_subset({ packageVersion: '1.24.1' }),
|
|
31
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core({ packageVersion: '1.24.1' }),
|
|
32
|
+
new FN001004_DEP_microsoft_sp_webpart_base({ packageVersion: '1.24.1' }),
|
|
33
|
+
new FN001011_DEP_microsoft_sp_dialog({ packageVersion: '1.24.1' }),
|
|
34
|
+
new FN001012_DEP_microsoft_sp_application_base({ packageVersion: '1.24.1' }),
|
|
35
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility({ packageVersion: '1.24.1' }),
|
|
36
|
+
new FN001021_DEP_microsoft_sp_property_pane({ packageVersion: '1.24.1' }),
|
|
37
|
+
new FN001023_DEP_microsoft_sp_component_base({ packageVersion: '1.24.1' }),
|
|
38
|
+
new FN001024_DEP_microsoft_sp_diagnostics({ packageVersion: '1.24.1' }),
|
|
39
|
+
new FN001025_DEP_microsoft_sp_dynamic_data({ packageVersion: '1.24.1' }),
|
|
40
|
+
new FN001026_DEP_microsoft_sp_extension_base({ packageVersion: '1.24.1' }),
|
|
41
|
+
new FN001027_DEP_microsoft_sp_http({ packageVersion: '1.24.1' }),
|
|
42
|
+
new FN001028_DEP_microsoft_sp_list_subscription({ packageVersion: '1.24.1' }),
|
|
43
|
+
new FN001029_DEP_microsoft_sp_loader({ packageVersion: '1.24.1' }),
|
|
44
|
+
new FN001030_DEP_microsoft_sp_module_interfaces({ packageVersion: '1.24.1' }),
|
|
45
|
+
new FN001031_DEP_microsoft_sp_odata_types({ packageVersion: '1.24.1' }),
|
|
46
|
+
new FN001032_DEP_microsoft_sp_page_context({ packageVersion: '1.24.1' }),
|
|
47
|
+
new FN001013_DEP_microsoft_decorators({ packageVersion: '1.24.1' }),
|
|
48
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base({ packageVersion: '1.24.1' }),
|
|
49
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces({ packageVersion: '1.24.1' }),
|
|
50
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx({ packageVersion: '1.24.1' }),
|
|
51
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx({ packageVersion: '1.24.1' }),
|
|
52
|
+
new FN002030_DEVDEP_microsoft_spfx_web_build_rig({ packageVersion: '1.24.1' }),
|
|
53
|
+
new FN002034_DEVDEP_microsoft_spfx_heft_plugins({ packageVersion: '1.24.1' }),
|
|
54
|
+
new FN010001_YORC_version({ version: '1.24.1' }),
|
|
55
|
+
new FN027004_OVERRIDES_serialize_javascript({ version: '^7.1.3' })
|
|
56
|
+
];
|
|
57
|
+
//# sourceMappingURL=upgrade-1.24.1.js.map
|
|
@@ -1,13 +1,43 @@
|
|
|
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 _SpoApplicationCustomizerAddCommand_instances, _a, _SpoApplicationCustomizerAddCommand_initOptions, _SpoApplicationCustomizerAddCommand_initTelemetry, _SpoApplicationCustomizerAddCommand_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
|
+
title: z.string().alias('t'),
|
|
10
|
+
webUrl: z.string().refine(val => validation.isValidSharePointUrl(val) === true, {
|
|
11
|
+
error: e => `${e.input} is not a valid SharePoint URL`
|
|
12
|
+
}).alias('u'),
|
|
13
|
+
clientSideComponentId: z.string().refine(val => validation.isValidGuid(val), {
|
|
14
|
+
error: e => `${e.input} is not a valid GUID`
|
|
15
|
+
}).alias('i'),
|
|
16
|
+
description: z.string().optional(),
|
|
17
|
+
clientSideComponentProperties: z.string().refine(val => {
|
|
18
|
+
try {
|
|
19
|
+
JSON.parse(val);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
error: 'Specified clientSideComponentProperties is not a valid JSON string.'
|
|
27
|
+
}).optional(),
|
|
28
|
+
hostProperties: z.string().refine(val => {
|
|
29
|
+
try {
|
|
30
|
+
JSON.parse(val);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
error: 'Specified hostProperties is not a valid JSON string.'
|
|
38
|
+
}).optional(),
|
|
39
|
+
scope: z.enum(['Site', 'Web']).optional().alias('s')
|
|
40
|
+
});
|
|
11
41
|
class SpoApplicationCustomizerAddCommand extends SpoCommand {
|
|
12
42
|
get name() {
|
|
13
43
|
return commands.APPLICATIONCUSTOMIZER_ADD;
|
|
@@ -15,12 +45,8 @@ class SpoApplicationCustomizerAddCommand extends SpoCommand {
|
|
|
15
45
|
get description() {
|
|
16
46
|
return 'Adds an application customizer to a site.';
|
|
17
47
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoApplicationCustomizerAddCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoApplicationCustomizerAddCommand_instances, "m", _SpoApplicationCustomizerAddCommand_initTelemetry).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoApplicationCustomizerAddCommand_instances, "m", _SpoApplicationCustomizerAddCommand_initOptions).call(this);
|
|
23
|
-
__classPrivateFieldGet(this, _SpoApplicationCustomizerAddCommand_instances, "m", _SpoApplicationCustomizerAddCommand_initValidators).call(this);
|
|
48
|
+
get schema() {
|
|
49
|
+
return options;
|
|
24
50
|
}
|
|
25
51
|
async commandAction(logger, args) {
|
|
26
52
|
if (this.verbose) {
|
|
@@ -49,64 +75,5 @@ class SpoApplicationCustomizerAddCommand extends SpoCommand {
|
|
|
49
75
|
await request.post(requestOptions);
|
|
50
76
|
}
|
|
51
77
|
}
|
|
52
|
-
_a = SpoApplicationCustomizerAddCommand, _SpoApplicationCustomizerAddCommand_instances = new WeakSet(), _SpoApplicationCustomizerAddCommand_initOptions = function _SpoApplicationCustomizerAddCommand_initOptions() {
|
|
53
|
-
this.options.unshift({
|
|
54
|
-
option: '-t, --title <title>'
|
|
55
|
-
}, {
|
|
56
|
-
option: '-u, --webUrl <webUrl>'
|
|
57
|
-
}, {
|
|
58
|
-
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
59
|
-
}, {
|
|
60
|
-
option: '--description [description]'
|
|
61
|
-
}, {
|
|
62
|
-
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
63
|
-
}, {
|
|
64
|
-
option: '--hostProperties [hostProperties]'
|
|
65
|
-
}, {
|
|
66
|
-
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
67
|
-
});
|
|
68
|
-
}, _SpoApplicationCustomizerAddCommand_initTelemetry = function _SpoApplicationCustomizerAddCommand_initTelemetry() {
|
|
69
|
-
this.telemetry.push((args) => {
|
|
70
|
-
Object.assign(this.telemetryProperties, {
|
|
71
|
-
description: typeof args.options.description !== 'undefined',
|
|
72
|
-
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
73
|
-
hostProperties: typeof args.options.hostProperties !== 'undefined',
|
|
74
|
-
scope: typeof args.options.scope !== 'undefined'
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}, _SpoApplicationCustomizerAddCommand_initValidators = function _SpoApplicationCustomizerAddCommand_initValidators() {
|
|
78
|
-
this.validators.push(async (args) => {
|
|
79
|
-
if (args.options.webUrl) {
|
|
80
|
-
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
81
|
-
if (isValidSharePointUrl !== true) {
|
|
82
|
-
return isValidSharePointUrl;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (!validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
86
|
-
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
87
|
-
}
|
|
88
|
-
if (args.options.clientSideComponentProperties) {
|
|
89
|
-
try {
|
|
90
|
-
JSON.parse(args.options.clientSideComponentProperties);
|
|
91
|
-
}
|
|
92
|
-
catch (e) {
|
|
93
|
-
return `An error has occurred while parsing clientSideComponentProperties: ${e}`;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (args.options.hostProperties) {
|
|
97
|
-
try {
|
|
98
|
-
JSON.parse(args.options.hostProperties);
|
|
99
|
-
}
|
|
100
|
-
catch (e) {
|
|
101
|
-
return `An error has occurred while parsing hostProperties: ${e}`;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
105
|
-
return `${args.options.scope} is not a valid value for allowedMembers. Valid values are ${_a.scopes.join(', ')}`;
|
|
106
|
-
}
|
|
107
|
-
return true;
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
SpoApplicationCustomizerAddCommand.scopes = ['Site', 'Web'];
|
|
111
78
|
export default new SpoApplicationCustomizerAddCommand();
|
|
112
79
|
//# sourceMappingURL=applicationcustomizer-add.js.map
|