@pnp/cli-microsoft365 11.7.0-beta.71c58f3 → 11.7.0-beta.837cfea
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/outlook/commands/calendar/calendar-set.js +132 -0
- package/dist/m365/outlook/commands/calendargroup/calendargroup-get.js +114 -0
- package/dist/m365/outlook/commands.js +2 -0
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +21 -6
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.23.0-rc.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002032_DEVDEP_typescript_eslint_parser.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015008_FILE_eslintrc_js.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015016_FILE_eslint_config_js.js +10 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.23.0-rc.0.js +84 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +12 -11
- package/dist/m365/spo/commands/brandcenter/brandcenter-colors-list.js +59 -0
- package/dist/m365/spo/commands/propertybag/propertybag-set.js +3 -9
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +5 -1
- package/dist/m365/spo/commands.js +1 -0
- package/dist/request.js +0 -16
- package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx +21 -0
- package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +21 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-add.mdx +19 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-get.mdx +19 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-list.mdx +19 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-remove.mdx +21 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-set.mdx +21 -0
- package/docs/docs/cmd/entra/siteclassification/siteclassification-disable.mdx +21 -0
- package/docs/docs/cmd/entra/siteclassification/siteclassification-enable.mdx +21 -0
- package/docs/docs/cmd/entra/siteclassification/siteclassification-get.mdx +19 -0
- package/docs/docs/cmd/entra/siteclassification/siteclassification-set.mdx +20 -0
- package/docs/docs/cmd/external/connection/connection-add.mdx +21 -0
- package/docs/docs/cmd/external/connection/connection-doctor.mdx +19 -0
- package/docs/docs/cmd/external/connection/connection-get.mdx +19 -0
- package/docs/docs/cmd/external/connection/connection-list.mdx +19 -0
- package/docs/docs/cmd/external/connection/connection-remove.mdx +21 -0
- package/docs/docs/cmd/external/connection/connection-schema-add.mdx +21 -0
- package/docs/docs/cmd/external/connection/connection-urltoitemresolver-add.mdx +21 -0
- package/docs/docs/cmd/external/item/item-add.mdx +19 -0
- package/docs/docs/cmd/outlook/calendar/calendar-set.mdx +178 -0
- package/docs/docs/cmd/outlook/calendargroup/calendargroup-get.mdx +125 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/brandcenter/brandcenter-colors-list.mdx +115 -0
- package/docs/docs/cmd/spo/propertybag/propertybag-set.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-settings-set.mdx +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
4
|
+
import commands from '../../commands.js';
|
|
5
|
+
import { validation } from '../../../../utils/validation.js';
|
|
6
|
+
import request from '../../../../request.js';
|
|
7
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
8
|
+
import auth from '../../../../Auth.js';
|
|
9
|
+
import { calendarGroup } from '../../../../utils/calendarGroup.js';
|
|
10
|
+
const calendarColors = ['auto', 'lightBlue', 'lightGreen', 'lightOrange', 'lightGray', 'lightYellow', 'lightTeal', 'lightPink', 'lightBrown', 'lightRed', 'maxColor'];
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
id: z.string().alias('i'),
|
|
14
|
+
name: z.string().optional().alias('n'),
|
|
15
|
+
userId: z.string().refine(id => validation.isValidGuid(id), {
|
|
16
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
17
|
+
}).optional(),
|
|
18
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
19
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
20
|
+
}).optional(),
|
|
21
|
+
calendarGroupId: z.string().optional(),
|
|
22
|
+
calendarGroupName: z.string().optional(),
|
|
23
|
+
color: z.enum(calendarColors).optional(),
|
|
24
|
+
isDefault: z.boolean().optional()
|
|
25
|
+
});
|
|
26
|
+
class OutlookCalendarSetCommand extends GraphCommand {
|
|
27
|
+
get name() {
|
|
28
|
+
return commands.CALENDAR_SET;
|
|
29
|
+
}
|
|
30
|
+
get description() {
|
|
31
|
+
return 'Updates a calendar for a user';
|
|
32
|
+
}
|
|
33
|
+
get schema() {
|
|
34
|
+
return options;
|
|
35
|
+
}
|
|
36
|
+
getRefinedSchema(schema) {
|
|
37
|
+
return schema
|
|
38
|
+
.refine(options => !(options.userId && options.userName), {
|
|
39
|
+
error: 'Specify either userId or userName, but not both.'
|
|
40
|
+
})
|
|
41
|
+
.refine(options => !(options.calendarGroupId && options.calendarGroupName), {
|
|
42
|
+
error: 'Specify either calendarGroupId or calendarGroupName, but not both.'
|
|
43
|
+
})
|
|
44
|
+
.refine(options => [options.name, options.color, options.isDefault].filter(o => o !== undefined).length > 0, {
|
|
45
|
+
error: 'Specify at least one of the following options: name, color, or isDefault.'
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
async commandAction(logger, args) {
|
|
49
|
+
try {
|
|
50
|
+
const token = auth.connection.accessTokens[auth.defaultResource].accessToken;
|
|
51
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(token);
|
|
52
|
+
let requestUrl;
|
|
53
|
+
if (isAppOnlyAccessToken) {
|
|
54
|
+
if (!args.options.userId && !args.options.userName) {
|
|
55
|
+
throw 'When running with application permissions either userId or userName is required.';
|
|
56
|
+
}
|
|
57
|
+
const userIdentifier = args.options.userId ?? args.options.userName;
|
|
58
|
+
requestUrl = this.buildRequestUrl(userIdentifier);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if (args.options.userId || args.options.userName) {
|
|
62
|
+
const currentUserId = accessToken.getUserIdFromAccessToken(token);
|
|
63
|
+
const currentUserName = accessToken.getUserNameFromAccessToken(token);
|
|
64
|
+
const isOtherUser = (args.options.userId && args.options.userId !== currentUserId) ||
|
|
65
|
+
(args.options.userName && args.options.userName.toLowerCase() !== currentUserName?.toLowerCase());
|
|
66
|
+
if (isOtherUser) {
|
|
67
|
+
const scopes = accessToken.getScopesFromAccessToken(token);
|
|
68
|
+
const hasSharedScope = scopes.some(s => s === 'Calendars.ReadWrite.Shared');
|
|
69
|
+
if (!hasSharedScope) {
|
|
70
|
+
throw 'To update calendars of other users, the Entra ID application used for authentication must have the Calendars.ReadWrite.Shared delegated permission assigned.';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const userIdentifier = args.options.userId ?? args.options.userName;
|
|
74
|
+
requestUrl = this.buildRequestUrl(userIdentifier);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
requestUrl = this.buildRequestUrl(undefined);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (this.verbose) {
|
|
81
|
+
await logger.logToStderr(`Updating calendar '${args.options.id}'...`);
|
|
82
|
+
}
|
|
83
|
+
let calendarGroupId = args.options.calendarGroupId;
|
|
84
|
+
if (args.options.calendarGroupName) {
|
|
85
|
+
const userIdForGroup = args.options.userId ?? args.options.userName ?? accessToken.getUserIdFromAccessToken(token);
|
|
86
|
+
const calendarGroupResult = await calendarGroup.getUserCalendarGroupByName(userIdForGroup, args.options.calendarGroupName, 'id');
|
|
87
|
+
calendarGroupId = calendarGroupResult.id;
|
|
88
|
+
}
|
|
89
|
+
const url = this.buildCalendarUrl(requestUrl, args.options.id, calendarGroupId);
|
|
90
|
+
const requestOptions = {
|
|
91
|
+
url,
|
|
92
|
+
headers: {
|
|
93
|
+
accept: 'application/json;odata.metadata=none'
|
|
94
|
+
},
|
|
95
|
+
responseType: 'json',
|
|
96
|
+
data: this.createRequestBody(args)
|
|
97
|
+
};
|
|
98
|
+
const result = await request.patch(requestOptions);
|
|
99
|
+
await logger.log(result);
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
this.handleRejectedODataJsonPromise(err);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
buildRequestUrl(userIdentifier) {
|
|
106
|
+
if (userIdentifier) {
|
|
107
|
+
return `${this.resource}/v1.0/users('${userIdentifier}')`;
|
|
108
|
+
}
|
|
109
|
+
return `${this.resource}/v1.0/me`;
|
|
110
|
+
}
|
|
111
|
+
buildCalendarUrl(baseUrl, calendarId, calendarGroupId) {
|
|
112
|
+
if (calendarGroupId) {
|
|
113
|
+
return `${baseUrl}/calendarGroups/${calendarGroupId}/calendars/${calendarId}`;
|
|
114
|
+
}
|
|
115
|
+
return `${baseUrl}/calendars/${calendarId}`;
|
|
116
|
+
}
|
|
117
|
+
createRequestBody(args) {
|
|
118
|
+
const data = {};
|
|
119
|
+
if (args.options.name !== undefined) {
|
|
120
|
+
data.name = args.options.name;
|
|
121
|
+
}
|
|
122
|
+
if (args.options.color !== undefined) {
|
|
123
|
+
data.color = args.options.color;
|
|
124
|
+
}
|
|
125
|
+
if (args.options.isDefault !== undefined) {
|
|
126
|
+
data.isDefaultCalendar = args.options.isDefault;
|
|
127
|
+
}
|
|
128
|
+
return data;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
export default new OutlookCalendarSetCommand();
|
|
132
|
+
//# sourceMappingURL=calendar-set.js.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { validation } from '../../../../utils/validation.js';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
7
|
+
import { odata } from '../../../../utils/odata.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
10
|
+
import auth from '../../../../Auth.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
id: z.string().optional(),
|
|
14
|
+
name: z.string().optional(),
|
|
15
|
+
userId: z.string().refine(id => validation.isValidGuid(id), {
|
|
16
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
17
|
+
}).optional(),
|
|
18
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
19
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
20
|
+
}).optional()
|
|
21
|
+
});
|
|
22
|
+
class OutlookCalendarGroupGetCommand extends GraphCommand {
|
|
23
|
+
get name() {
|
|
24
|
+
return commands.CALENDARGROUP_GET;
|
|
25
|
+
}
|
|
26
|
+
get description() {
|
|
27
|
+
return 'Retrieve information about a calendar group for a user';
|
|
28
|
+
}
|
|
29
|
+
get schema() {
|
|
30
|
+
return options;
|
|
31
|
+
}
|
|
32
|
+
getRefinedSchema(schema) {
|
|
33
|
+
return schema
|
|
34
|
+
.refine(o => !(o.id && o.name), {
|
|
35
|
+
error: 'Specify either id or name, but not both.'
|
|
36
|
+
})
|
|
37
|
+
.refine(o => Boolean(o.id || o.name), {
|
|
38
|
+
error: 'Specify either id or name.'
|
|
39
|
+
})
|
|
40
|
+
.refine(o => !(o.userId && o.userName), {
|
|
41
|
+
error: 'Specify either userId or userName, but not both.'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async commandAction(logger, args) {
|
|
45
|
+
try {
|
|
46
|
+
const token = auth.connection.accessTokens[auth.defaultResource].accessToken;
|
|
47
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(token);
|
|
48
|
+
let userIdentifier = undefined;
|
|
49
|
+
if (args.options.userId || args.options.userName) {
|
|
50
|
+
userIdentifier = args.options.userId ?? args.options.userName;
|
|
51
|
+
}
|
|
52
|
+
const encodedUserIdentifier = userIdentifier
|
|
53
|
+
? formatting.encodeQueryParameter(userIdentifier)
|
|
54
|
+
: undefined;
|
|
55
|
+
if (isAppOnlyAccessToken) {
|
|
56
|
+
if (!args.options.userId && !args.options.userName) {
|
|
57
|
+
throw 'When running with application permissions either userId or userName is required.';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if (args.options.userId || args.options.userName) {
|
|
62
|
+
const currentUserId = accessToken.getUserIdFromAccessToken(token);
|
|
63
|
+
const currentUserName = accessToken.getUserNameFromAccessToken(token);
|
|
64
|
+
const isOtherUser = (args.options.userId && args.options.userId !== currentUserId) ||
|
|
65
|
+
(args.options.userName && args.options.userName.toLowerCase() !== currentUserName?.toLowerCase());
|
|
66
|
+
if (isOtherUser) {
|
|
67
|
+
const scopes = accessToken.getScopesFromAccessToken(token);
|
|
68
|
+
const hasSharedScope = scopes.some(s => s === 'Calendars.Read.Shared' || s === 'Calendars.ReadWrite.Shared');
|
|
69
|
+
if (!hasSharedScope) {
|
|
70
|
+
throw `To retrieve calendar groups of other users, the Entra ID application used for authentication must have either the Calendars.Read.Shared or Calendars.ReadWrite.Shared delegated permission assigned.`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const getCalendarGroupByName = async (calendarGroupName) => {
|
|
76
|
+
const userPath = encodedUserIdentifier ? `users('${encodedUserIdentifier}')` : 'me';
|
|
77
|
+
const calendarGroups = await odata.getAllItems(`${this.resource}/v1.0/${userPath}/calendarGroups?$filter=name eq '${formatting.encodeQueryParameter(calendarGroupName)}'`);
|
|
78
|
+
if (calendarGroups.length === 0) {
|
|
79
|
+
throw `The specified calendar group '${calendarGroupName}' does not exist.`;
|
|
80
|
+
}
|
|
81
|
+
return calendarGroups[0];
|
|
82
|
+
};
|
|
83
|
+
if (args.options.name) {
|
|
84
|
+
if (this.verbose) {
|
|
85
|
+
await logger.logToStderr(`Retrieving calendar group '${args.options.name}'...`);
|
|
86
|
+
}
|
|
87
|
+
const result = await getCalendarGroupByName(args.options.name);
|
|
88
|
+
await logger.log(result);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const calendarGroupId = args.options.id;
|
|
92
|
+
const userPath = encodedUserIdentifier ? `users('${encodedUserIdentifier}')` : 'me';
|
|
93
|
+
const requestUrl = `${this.resource}/v1.0/${userPath}/calendarGroups/${calendarGroupId}`;
|
|
94
|
+
if (this.verbose) {
|
|
95
|
+
await logger.logToStderr(`Retrieving calendar group '${calendarGroupId}'...`);
|
|
96
|
+
}
|
|
97
|
+
const requestOptions = {
|
|
98
|
+
url: requestUrl,
|
|
99
|
+
headers: {
|
|
100
|
+
accept: 'application/json;odata.metadata=none'
|
|
101
|
+
},
|
|
102
|
+
responseType: 'json'
|
|
103
|
+
};
|
|
104
|
+
const result = await request.get(requestOptions);
|
|
105
|
+
await logger.log(result);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
this.handleRejectedODataJsonPromise(err);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export default new OutlookCalendarGroupGetCommand();
|
|
114
|
+
//# sourceMappingURL=calendargroup-get.js.map
|
|
@@ -3,6 +3,8 @@ export default {
|
|
|
3
3
|
CALENDAR_ADD: `${prefix} calendar add`,
|
|
4
4
|
CALENDAR_GET: `${prefix} calendar get`,
|
|
5
5
|
CALENDAR_REMOVE: `${prefix} calendar remove`,
|
|
6
|
+
CALENDAR_SET: `${prefix} calendar set`,
|
|
7
|
+
CALENDARGROUP_GET: `${prefix} calendargroup get`,
|
|
6
8
|
CALENDARGROUP_LIST: `${prefix} calendargroup list`,
|
|
7
9
|
CALENDARGROUP_SET: `${prefix} calendargroup set`,
|
|
8
10
|
EVENT_CANCEL: `${prefix} event cancel`,
|
|
@@ -590,8 +590,8 @@ export const versions = {
|
|
|
590
590
|
},
|
|
591
591
|
sp: SharePointVersion.SPO,
|
|
592
592
|
yo: {
|
|
593
|
-
range: '^4 || ^5 || ^6',
|
|
594
|
-
fix: 'npm i -g yo@
|
|
593
|
+
range: '^4 || ^5 || ^6 || ^7',
|
|
594
|
+
fix: 'npm i -g yo@7'
|
|
595
595
|
}
|
|
596
596
|
},
|
|
597
597
|
'1.22.1': {
|
|
@@ -605,8 +605,8 @@ export const versions = {
|
|
|
605
605
|
},
|
|
606
606
|
sp: SharePointVersion.SPO,
|
|
607
607
|
yo: {
|
|
608
|
-
range: '^4 || ^5 || ^6',
|
|
609
|
-
fix: 'npm i -g yo@
|
|
608
|
+
range: '^4 || ^5 || ^6 || ^7',
|
|
609
|
+
fix: 'npm i -g yo@7'
|
|
610
610
|
}
|
|
611
611
|
},
|
|
612
612
|
'1.22.2': {
|
|
@@ -620,8 +620,23 @@ export const versions = {
|
|
|
620
620
|
},
|
|
621
621
|
sp: SharePointVersion.SPO,
|
|
622
622
|
yo: {
|
|
623
|
-
range: '^4 || ^5 || ^6',
|
|
624
|
-
fix: 'npm i -g yo@
|
|
623
|
+
range: '^4 || ^5 || ^6 || ^7',
|
|
624
|
+
fix: 'npm i -g yo@7'
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
'1.23.0-rc.0': {
|
|
628
|
+
heft: {
|
|
629
|
+
range: '^1',
|
|
630
|
+
fix: 'npm i -g @rushstack/heft@1'
|
|
631
|
+
},
|
|
632
|
+
node: {
|
|
633
|
+
range: '>=22.14.0 <23.0.0',
|
|
634
|
+
fix: 'Install Node.js >=22.14.0 <23.0.0'
|
|
635
|
+
},
|
|
636
|
+
sp: SharePointVersion.SPO,
|
|
637
|
+
yo: {
|
|
638
|
+
range: '^4 || ^5 || ^6 || ^7',
|
|
639
|
+
fix: 'npm i -g yo@7'
|
|
625
640
|
}
|
|
626
641
|
}
|
|
627
642
|
};
|
|
@@ -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('17'),
|
|
11
|
+
new FN001009_DEP_react_dom('17'),
|
|
12
|
+
new FN001035_DEP_fluentui_react('^8.106.4'),
|
|
13
|
+
new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
14
|
+
new FN002015_DEVDEP_types_react('17'),
|
|
15
|
+
new FN002016_DEVDEP_types_react_dom('17'),
|
|
16
|
+
new FN002022_DEVDEP_typescript('~5.8.0'),
|
|
17
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version(true)
|
|
18
|
+
];
|
|
19
|
+
//# sourceMappingURL=doctor-1.23.0-rc.0.js.map
|
|
@@ -76,7 +76,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
76
76
|
'1.21.1',
|
|
77
77
|
'1.22.0',
|
|
78
78
|
'1.22.1',
|
|
79
|
-
'1.22.2'
|
|
79
|
+
'1.22.2',
|
|
80
|
+
'1.23.0-rc.0'
|
|
80
81
|
];
|
|
81
82
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
82
83
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DependencyRule } from "./DependencyRule.js";
|
|
2
2
|
export class FN002021_DEVDEP_rushstack_eslint_config extends DependencyRule {
|
|
3
|
-
constructor(packageVersion) {
|
|
4
|
-
super('@rushstack/eslint-config', packageVersion, true);
|
|
3
|
+
constructor(packageVersion, add = true) {
|
|
4
|
+
super('@rushstack/eslint-config', packageVersion, true, false, add);
|
|
5
5
|
}
|
|
6
6
|
get id() {
|
|
7
7
|
return 'FN002021';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DependencyRule } from "./DependencyRule.js";
|
|
2
2
|
export class FN002032_DEVDEP_typescript_eslint_parser extends DependencyRule {
|
|
3
|
-
constructor(packageVersion) {
|
|
4
|
-
super('@typescript-eslint/parser', packageVersion, true);
|
|
3
|
+
constructor(packageVersion, add = true) {
|
|
4
|
+
super('@typescript-eslint/parser', packageVersion, true, false, add);
|
|
5
5
|
}
|
|
6
6
|
get id() {
|
|
7
7
|
return 'FN002032';
|
|
@@ -8,7 +8,7 @@ export class FN015008_FILE_eslintrc_js extends FileAddRemoveRule {
|
|
|
8
8
|
return 'FN015008';
|
|
9
9
|
}
|
|
10
10
|
visit(project, notifications) {
|
|
11
|
-
if (spfx.isReactProject(project)) {
|
|
11
|
+
if (spfx.isReactProject(project) && this.contents) {
|
|
12
12
|
this.contents = this.contents.replace('@microsoft/eslint-config-spfx/lib/profiles/default', '@microsoft/eslint-config-spfx/lib/profiles/react');
|
|
13
13
|
}
|
|
14
14
|
super.visit(project, notifications);
|
package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015016_FILE_eslint_config_js.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileAddRemoveRule } from "./FileAddRemoveRule.js";
|
|
2
|
+
export class FN015016_FILE_eslint_config_js extends FileAddRemoveRule {
|
|
3
|
+
constructor(add, contents) {
|
|
4
|
+
super('./eslint.config.js', add, contents);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN015016';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FN015016_FILE_eslint_config_js.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
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 { FN002021_DEVDEP_rushstack_eslint_config } from './rules/FN002021_DEVDEP_rushstack_eslint_config.js';
|
|
23
|
+
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
24
|
+
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
25
|
+
import { FN002024_DEVDEP_eslint } from './rules/FN002024_DEVDEP_eslint.js';
|
|
26
|
+
import { FN002025_DEVDEP_eslint_plugin_react_hooks } from './rules/FN002025_DEVDEP_eslint_plugin_react_hooks.js';
|
|
27
|
+
import { FN002030_DEVDEP_microsoft_spfx_web_build_rig } from './rules/FN002030_DEVDEP_microsoft_spfx_web_build_rig.js';
|
|
28
|
+
import { FN002031_DEVDEP_rushstack_heft } from './rules/FN002031_DEVDEP_rushstack_heft.js';
|
|
29
|
+
import { FN002032_DEVDEP_typescript_eslint_parser } from './rules/FN002032_DEVDEP_typescript_eslint_parser.js';
|
|
30
|
+
import { FN002034_DEVDEP_microsoft_spfx_heft_plugins } from './rules/FN002034_DEVDEP_microsoft_spfx_heft_plugins.js';
|
|
31
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
32
|
+
import { FN015008_FILE_eslintrc_js } from './rules/FN015008_FILE_eslintrc_js.js';
|
|
33
|
+
import { FN015016_FILE_eslint_config_js } from './rules/FN015016_FILE_eslint_config_js.js';
|
|
34
|
+
import { FN021009_PKG_overrides_rushstack_heft } from './rules/FN021009_PKG_overrides_rushstack_heft.js';
|
|
35
|
+
export default [
|
|
36
|
+
new FN001001_DEP_microsoft_sp_core_library('1.23.0-rc.0'),
|
|
37
|
+
new FN001002_DEP_microsoft_sp_lodash_subset('1.23.0-rc.0'),
|
|
38
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.23.0-rc.0'),
|
|
39
|
+
new FN001004_DEP_microsoft_sp_webpart_base('1.23.0-rc.0'),
|
|
40
|
+
new FN001011_DEP_microsoft_sp_dialog('1.23.0-rc.0'),
|
|
41
|
+
new FN001012_DEP_microsoft_sp_application_base('1.23.0-rc.0'),
|
|
42
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility('1.23.0-rc.0'),
|
|
43
|
+
new FN001021_DEP_microsoft_sp_property_pane('1.23.0-rc.0'),
|
|
44
|
+
new FN001023_DEP_microsoft_sp_component_base('1.23.0-rc.0'),
|
|
45
|
+
new FN001024_DEP_microsoft_sp_diagnostics('1.23.0-rc.0'),
|
|
46
|
+
new FN001025_DEP_microsoft_sp_dynamic_data('1.23.0-rc.0'),
|
|
47
|
+
new FN001026_DEP_microsoft_sp_extension_base('1.23.0-rc.0'),
|
|
48
|
+
new FN001027_DEP_microsoft_sp_http('1.23.0-rc.0'),
|
|
49
|
+
new FN001028_DEP_microsoft_sp_list_subscription('1.23.0-rc.0'),
|
|
50
|
+
new FN001029_DEP_microsoft_sp_loader('1.23.0-rc.0'),
|
|
51
|
+
new FN001030_DEP_microsoft_sp_module_interfaces('1.23.0-rc.0'),
|
|
52
|
+
new FN001031_DEP_microsoft_sp_odata_types('1.23.0-rc.0'),
|
|
53
|
+
new FN001032_DEP_microsoft_sp_page_context('1.23.0-rc.0'),
|
|
54
|
+
new FN001013_DEP_microsoft_decorators('1.23.0-rc.0'),
|
|
55
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.23.0-rc.0'),
|
|
56
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.23.0-rc.0'),
|
|
57
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.23.0-rc.0'),
|
|
58
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.23.0-rc.0'),
|
|
59
|
+
new FN002030_DEVDEP_microsoft_spfx_web_build_rig('1.23.0-rc.0'),
|
|
60
|
+
new FN002034_DEVDEP_microsoft_spfx_heft_plugins('1.23.0-rc.0'),
|
|
61
|
+
new FN010001_YORC_version('1.23.0-rc.0'),
|
|
62
|
+
new FN002031_DEVDEP_rushstack_heft('1.2.7'),
|
|
63
|
+
new FN021009_PKG_overrides_rushstack_heft('1.2.7'),
|
|
64
|
+
new FN002025_DEVDEP_eslint_plugin_react_hooks('5.2.0'),
|
|
65
|
+
new FN002024_DEVDEP_eslint('9.37.0'),
|
|
66
|
+
new FN015016_FILE_eslint_config_js(true, `const spfxProfile = require('@microsoft/eslint-config-spfx/lib/flat-profiles/react');
|
|
67
|
+
|
|
68
|
+
module.exports = [
|
|
69
|
+
...spfxProfile,
|
|
70
|
+
{
|
|
71
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
72
|
+
languageOptions: {
|
|
73
|
+
parserOptions: {
|
|
74
|
+
tsconfigRootDir: __dirname,
|
|
75
|
+
project: './tsconfig.json'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
];`),
|
|
80
|
+
new FN015008_FILE_eslintrc_js(false),
|
|
81
|
+
new FN002021_DEVDEP_rushstack_eslint_config('4.5.2', false),
|
|
82
|
+
new FN002032_DEVDEP_typescript_eslint_parser('8.46.2', false)
|
|
83
|
+
];
|
|
84
|
+
//# sourceMappingURL=upgrade-1.23.0-rc.0.js.map
|
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
// uncomment to support upgrading to preview releases
|
|
5
|
-
|
|
5
|
+
import { prerelease } from 'semver';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { CommandError, globalOptionsZod } from '../../../../Command.js';
|
|
8
8
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
@@ -85,7 +85,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
85
85
|
'1.21.1',
|
|
86
86
|
'1.22.0',
|
|
87
87
|
'1.22.1',
|
|
88
|
-
'1.22.2'
|
|
88
|
+
'1.22.2',
|
|
89
|
+
'1.23.0-rc.0'
|
|
89
90
|
];
|
|
90
91
|
}
|
|
91
92
|
async commandAction(logger, args) {
|
|
@@ -95,15 +96,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
95
96
|
}
|
|
96
97
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
97
98
|
// uncomment to support upgrading to preview releases
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
if (!args.options.toVersion &&
|
|
100
|
+
!args.options.preview &&
|
|
101
|
+
prerelease(this.toVersion)) {
|
|
102
|
+
// no version and no preview specified while the current version to
|
|
103
|
+
// upgrade to is a prerelease so let's grab the first non-preview version
|
|
104
|
+
// since we're supporting only one preview version, it's sufficient for
|
|
105
|
+
// us to take second to last version
|
|
106
|
+
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
107
|
+
}
|
|
107
108
|
this.packageManager = args.options.packageManager || 'npm';
|
|
108
109
|
this.shell = args.options.shell || 'powershell';
|
|
109
110
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import commands from '../../commands.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import request from '../../../../request.js';
|
|
4
|
+
import { odata } from '../../../../utils/odata.js';
|
|
5
|
+
import { spo } from '../../../../utils/spo.js';
|
|
6
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
7
|
+
const options = globalOptionsZod.strict();
|
|
8
|
+
class SpoBrandCenterColorsListCommand extends SpoCommand {
|
|
9
|
+
get name() {
|
|
10
|
+
return commands.BRANDCENTER_COLORS_LIST;
|
|
11
|
+
}
|
|
12
|
+
get description() {
|
|
13
|
+
return 'Lists the brand center colors';
|
|
14
|
+
}
|
|
15
|
+
defaultProperties() {
|
|
16
|
+
return ['ColorCode', 'Title', 'IsVisible'];
|
|
17
|
+
}
|
|
18
|
+
get schema() {
|
|
19
|
+
return options;
|
|
20
|
+
}
|
|
21
|
+
async commandAction(logger) {
|
|
22
|
+
if (this.verbose) {
|
|
23
|
+
await logger.logToStderr(`Retrieving brand center colors...`);
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const spoUrl = await spo.getSpoUrl(logger, this.verbose);
|
|
27
|
+
const configRequestOptions = {
|
|
28
|
+
url: `${spoUrl}/_api/Brandcenter/Configuration`,
|
|
29
|
+
headers: {
|
|
30
|
+
accept: 'application/json;odata=nometadata'
|
|
31
|
+
},
|
|
32
|
+
responseType: 'json'
|
|
33
|
+
};
|
|
34
|
+
const config = await request.get(configRequestOptions);
|
|
35
|
+
if (!config.BrandColorsListUrl) {
|
|
36
|
+
if (this.verbose) {
|
|
37
|
+
await logger.logToStderr('Brand colors list not found.');
|
|
38
|
+
}
|
|
39
|
+
await logger.log([]);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (this.verbose) {
|
|
43
|
+
await logger.logToStderr(`Brand colors list found at '${config.BrandColorsListUrl.DecodedUrl}'.`);
|
|
44
|
+
}
|
|
45
|
+
const items = await odata.getAllItems(`${config.SiteUrl}/_api/web/lists(guid'${config.BrandColorsListId}')/items?$select=OData__SPColorTitle,OData__SPColorCode,OData__SPColorVisible`);
|
|
46
|
+
const result = items.map(item => ({
|
|
47
|
+
Title: item.OData__SPColorTitle,
|
|
48
|
+
ColorCode: item.OData__SPColorCode,
|
|
49
|
+
IsVisible: item.OData__SPColorVisible
|
|
50
|
+
}));
|
|
51
|
+
await logger.log(result);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.handleRejectedODataJsonPromise(err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export default new SpoBrandCenterColorsListCommand();
|
|
59
|
+
//# sourceMappingURL=brandcenter-colors-list.js.map
|
|
@@ -28,12 +28,6 @@ class SpoPropertyBagSetCommand extends SpoPropertyBagBaseCommand {
|
|
|
28
28
|
this.formDigestValue = contextResponse.FormDigestValue;
|
|
29
29
|
let identityResp = await spo.getCurrentWebIdentity(args.options.webUrl, this.formDigestValue);
|
|
30
30
|
const webIdentityResp = identityResp;
|
|
31
|
-
// Check if web no script enabled or not
|
|
32
|
-
// Cannot set property bag value if no script is enabled
|
|
33
|
-
const isNoScriptSite = await this.isNoScriptSite(identityResp, args.options, logger);
|
|
34
|
-
if (isNoScriptSite) {
|
|
35
|
-
throw 'Site has NoScript enabled, and setting property bag values is not supported';
|
|
36
|
-
}
|
|
37
31
|
const opts = args.options;
|
|
38
32
|
if (opts.folder) {
|
|
39
33
|
// get the folder guid instead of the web guid
|
|
@@ -42,15 +36,15 @@ class SpoPropertyBagSetCommand extends SpoPropertyBagBaseCommand {
|
|
|
42
36
|
await this.setProperty(identityResp, args.options, logger);
|
|
43
37
|
}
|
|
44
38
|
catch (err) {
|
|
39
|
+
if (err.toString().indexOf('E_ACCESSDENIED') > -1) {
|
|
40
|
+
await logger.logToStderr('Tip: If a site has NoScript enabled, setting the property bag value may result in exceptions.');
|
|
41
|
+
}
|
|
45
42
|
this.handleRejectedPromise(err);
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
setProperty(identityResp, options, logger) {
|
|
49
46
|
return SpoPropertyBagBaseCommand.setProperty(options.key, options.value, options.webUrl, this.formDigestValue, identityResp, logger, this.debug, options.folder);
|
|
50
47
|
}
|
|
51
|
-
isNoScriptSite(webIdentityResp, options, logger) {
|
|
52
|
-
return SpoPropertyBagBaseCommand.isNoScriptSite(options.webUrl, this.formDigestValue, webIdentityResp, logger, this.debug);
|
|
53
|
-
}
|
|
54
48
|
}
|
|
55
49
|
_SpoPropertyBagSetCommand_instances = new WeakSet(), _SpoPropertyBagSetCommand_initTelemetry = function _SpoPropertyBagSetCommand_initTelemetry() {
|
|
56
50
|
this.telemetry.push((args) => {
|
|
@@ -414,6 +414,9 @@ _a = SpoTenantSettingsSetCommand, _SpoTenantSettingsSetCommand_instances = new W
|
|
|
414
414
|
}, {
|
|
415
415
|
option: '--SyncAadB2BManagementPolicy [SyncAadB2BManagementPolicy]',
|
|
416
416
|
autocomplete: ['true', 'false']
|
|
417
|
+
}, {
|
|
418
|
+
option: '--AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled [AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled]',
|
|
419
|
+
autocomplete: ['true', 'false']
|
|
417
420
|
});
|
|
418
421
|
}, _SpoTenantSettingsSetCommand_initValidators = function _SpoTenantSettingsSetCommand_initValidators() {
|
|
419
422
|
this.validators.push(async (args) => {
|
|
@@ -496,7 +499,8 @@ SpoTenantSettingsSetCommand.booleanOptions = [
|
|
|
496
499
|
'DisableCustomAppAuthentication',
|
|
497
500
|
'CommentsOnListItemsDisabled',
|
|
498
501
|
'EnableAzureADB2BIntegration',
|
|
499
|
-
'SyncAadB2BManagementPolicy'
|
|
502
|
+
'SyncAadB2BManagementPolicy',
|
|
503
|
+
'AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled'
|
|
500
504
|
];
|
|
501
505
|
export default new SpoTenantSettingsSetCommand();
|
|
502
506
|
//# sourceMappingURL=tenant-settings-set.js.map
|
|
@@ -19,6 +19,7 @@ export default {
|
|
|
19
19
|
APPLICATIONCUSTOMIZER_SET: `${prefix} applicationcustomizer set`,
|
|
20
20
|
APPPAGE_ADD: `${prefix} apppage add`,
|
|
21
21
|
APPPAGE_SET: `${prefix} apppage set`,
|
|
22
|
+
BRANDCENTER_COLORS_LIST: `${prefix} brandcenter colors list`,
|
|
22
23
|
BRANDCENTER_SETTINGS_LIST: `${prefix} brandcenter settings list`,
|
|
23
24
|
CDN_GET: `${prefix} cdn get`,
|
|
24
25
|
CDN_ORIGIN_ADD: `${prefix} cdn origin add`,
|