@pnp/cli-microsoft365 10.3.0-beta.f5e6f85 → 10.4.0-beta.17b3a55
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/config.js +3 -1
- package/dist/m365/entra/commands/app/app-add.js +3 -0
- package/dist/m365/entra/commands/resourcenamespace/resourcenamespace-list.js +28 -0
- package/dist/m365/entra/commands/rolepermission/rolepermission-list.js +42 -0
- package/dist/m365/entra/commands.js +2 -0
- package/dist/m365/outlook/commands/mailbox/mailbox-settings-get.js +71 -0
- package/dist/m365/outlook/commands/mailbox/mailbox-settings-set.js +5 -2
- package/dist/m365/outlook/commands.js +1 -0
- package/dist/m365/spe/commands/container/container-activate.js +50 -0
- package/dist/m365/spe/commands.js +1 -0
- package/dist/m365/spo/commands/list/list-defaultvalue-clear.js +184 -0
- package/dist/m365/spo/commands/list/list-defaultvalue-remove.js +181 -0
- package/dist/m365/spo/commands/list/list-defaultvalue-set.js +210 -0
- package/dist/m365/spo/commands/mail/mail-send.js +2 -0
- package/dist/m365/spo/commands/page/page-get.js +40 -27
- package/dist/m365/spo/commands.js +3 -0
- package/dist/m365/tenant/commands/report/report-settings-get.js +32 -0
- package/dist/m365/tenant/commands/report/report-settings-set.js +47 -0
- package/dist/m365/tenant/commands.js +2 -0
- package/docs/docs/cmd/entra/app/app-add.mdx +1 -1
- package/docs/docs/cmd/entra/resourcenamespace/resourcenamespace-list.mdx +96 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-add.mdx +4 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-set.mdx +4 -0
- package/docs/docs/cmd/entra/rolepermission/rolepermission-list.mdx +164 -0
- package/docs/docs/cmd/outlook/mailbox/mailbox-settings-get.mdx +131 -0
- package/docs/docs/cmd/spe/container/container-activate.mdx +34 -0
- package/docs/docs/cmd/spo/list/list-defaultvalue-clear.mdx +62 -0
- package/docs/docs/cmd/spo/list/list-defaultvalue-remove.mdx +62 -0
- package/docs/docs/cmd/spo/list/list-defaultvalue-set.mdx +112 -0
- package/docs/docs/cmd/spo/page/page-get.mdx +11 -2
- package/docs/docs/cmd/tenant/report/report-settings-get.mdx +67 -0
- package/docs/docs/cmd/tenant/report/report-settings-set.mdx +32 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { zod } from '../../../../utils/zod.js';
|
|
5
|
+
import commands from '../../commands.js';
|
|
6
|
+
import { DOMParser } from '@xmldom/xmldom';
|
|
7
|
+
import { validation } from '../../../../utils/validation.js';
|
|
8
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
9
|
+
import request from '../../../../request.js';
|
|
10
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
11
|
+
const options = globalOptionsZod
|
|
12
|
+
.extend({
|
|
13
|
+
webUrl: zod.alias('u', z.string()
|
|
14
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, url => ({
|
|
15
|
+
message: `'${url}' is not a valid SharePoint Online site URL.`
|
|
16
|
+
}))),
|
|
17
|
+
listId: zod.alias('i', z.string().optional()
|
|
18
|
+
.refine(id => id === undefined || validation.isValidGuid(id), id => ({
|
|
19
|
+
message: `'${id}' is not a valid GUID.`
|
|
20
|
+
}))),
|
|
21
|
+
listTitle: zod.alias('t', z.string().optional()),
|
|
22
|
+
listUrl: z.string().optional(),
|
|
23
|
+
fieldName: z.string(),
|
|
24
|
+
fieldValue: z.string()
|
|
25
|
+
.refine(value => value !== '', `The value cannot be empty. Use 'spo list defaultvalue remove' to remove a default column value.`),
|
|
26
|
+
folderUrl: z.string().optional()
|
|
27
|
+
.refine(url => url === undefined || (!url.includes('#') && !url.includes('%')), 'Due to limitations in SharePoint Online, setting default column values for folders with a # or % character in their path is not supported.')
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
class SpoListDefaultValueSetCommand extends SpoCommand {
|
|
31
|
+
get name() {
|
|
32
|
+
return commands.LIST_DEFAULTVALUE_SET;
|
|
33
|
+
}
|
|
34
|
+
get description() {
|
|
35
|
+
return 'Sets default column values for a specific document library';
|
|
36
|
+
}
|
|
37
|
+
get schema() {
|
|
38
|
+
return options;
|
|
39
|
+
}
|
|
40
|
+
getRefinedSchema(schema) {
|
|
41
|
+
return schema
|
|
42
|
+
.refine(options => [options.listId, options.listTitle, options.listUrl].filter(o => o !== undefined).length === 1, {
|
|
43
|
+
message: 'Use one of the following options: listId, listTitle, listUrl.'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async commandAction(logger, args) {
|
|
47
|
+
try {
|
|
48
|
+
if (this.verbose) {
|
|
49
|
+
await logger.logToStderr(`Setting default column value '${args.options.fieldValue}' for field '${args.options.fieldName}'...`);
|
|
50
|
+
await logger.logToStderr(`Getting server-relative URL of the list...`);
|
|
51
|
+
}
|
|
52
|
+
const listServerRelUrl = await this.getServerRelativeListUrl(args.options);
|
|
53
|
+
let folderUrl = listServerRelUrl;
|
|
54
|
+
if (args.options.folderUrl) {
|
|
55
|
+
if (this.verbose) {
|
|
56
|
+
await logger.logToStderr(`Getting server-relative URL of folder '${args.options.folderUrl}'...`);
|
|
57
|
+
}
|
|
58
|
+
// Casing of the folder URL is important, let's retrieve the correct URL
|
|
59
|
+
const serverRelativeFolderUrl = urlUtil.getServerRelativePath(args.options.webUrl, urlUtil.removeTrailingSlashes(args.options.folderUrl));
|
|
60
|
+
folderUrl = await this.getCorrectFolderUrl(args.options.webUrl, serverRelativeFolderUrl);
|
|
61
|
+
}
|
|
62
|
+
if (this.verbose) {
|
|
63
|
+
await logger.logToStderr(`Getting default column values...`);
|
|
64
|
+
}
|
|
65
|
+
const defaultValuesXml = await this.ensureDefaultColumnValuesXml(args.options.webUrl, listServerRelUrl);
|
|
66
|
+
const modifiedXml = await this.updateFieldValueXml(logger, defaultValuesXml, args.options.fieldName, args.options.fieldValue, folderUrl);
|
|
67
|
+
await this.uploadDefaultColumnValuesXml(logger, args.options.webUrl, listServerRelUrl, modifiedXml);
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
this.handleRejectedODataJsonPromise(err);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async getServerRelativeListUrl(options) {
|
|
74
|
+
const requestOptions = {
|
|
75
|
+
url: `${options.webUrl}/_api/Web`,
|
|
76
|
+
headers: {
|
|
77
|
+
accept: 'application/json;odata=nometadata'
|
|
78
|
+
},
|
|
79
|
+
responseType: 'json'
|
|
80
|
+
};
|
|
81
|
+
if (options.listUrl) {
|
|
82
|
+
const serverRelativeUrl = urlUtil.getServerRelativePath(options.webUrl, options.listUrl);
|
|
83
|
+
requestOptions.url += `/GetList('${formatting.encodeQueryParameter(serverRelativeUrl)}')`;
|
|
84
|
+
}
|
|
85
|
+
else if (options.listId) {
|
|
86
|
+
requestOptions.url += `/Lists('${options.listId}')`;
|
|
87
|
+
}
|
|
88
|
+
else if (options.listTitle) {
|
|
89
|
+
requestOptions.url += `/Lists/GetByTitle('${formatting.encodeQueryParameter(options.listTitle)}')`;
|
|
90
|
+
}
|
|
91
|
+
requestOptions.url += '?$expand=RootFolder&$select=RootFolder/ServerRelativeUrl,BaseTemplate';
|
|
92
|
+
try {
|
|
93
|
+
const response = await request.get(requestOptions);
|
|
94
|
+
if (response.BaseTemplate !== 101) {
|
|
95
|
+
throw `The specified list is not a document library.`;
|
|
96
|
+
}
|
|
97
|
+
return response.RootFolder.ServerRelativeUrl;
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (error.status === 404) {
|
|
101
|
+
throw `List '${options.listId || options.listTitle || options.listUrl}' was not found.`;
|
|
102
|
+
}
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async getCorrectFolderUrl(webUrl, folderUrl) {
|
|
107
|
+
const requestOptions = {
|
|
108
|
+
// Using ListItemAllFields endpoint because GetFolderByServerRelativePath doesn't return the correctly cased URL
|
|
109
|
+
url: `${webUrl}/_api/Web/GetFolderByServerRelativePath(decodedUrl='${formatting.encodeQueryParameter(folderUrl)}')/ListItemAllFields?$select=FileRef`,
|
|
110
|
+
headers: {
|
|
111
|
+
accept: 'application/json;odata=nometadata'
|
|
112
|
+
},
|
|
113
|
+
responseType: 'json'
|
|
114
|
+
};
|
|
115
|
+
const response = await request.get(requestOptions);
|
|
116
|
+
if (!response.FileRef) {
|
|
117
|
+
throw `Folder '${folderUrl}' was not found.`;
|
|
118
|
+
}
|
|
119
|
+
return response.FileRef;
|
|
120
|
+
}
|
|
121
|
+
async ensureDefaultColumnValuesXml(webUrl, listServerRelUrl) {
|
|
122
|
+
try {
|
|
123
|
+
const requestOptions = {
|
|
124
|
+
url: `${webUrl}/_api/Web/GetFileByServerRelativePath(decodedUrl='${formatting.encodeQueryParameter(listServerRelUrl + '/Forms/client_LocationBasedDefaults.html')}')/$value`,
|
|
125
|
+
headers: {
|
|
126
|
+
accept: 'application/json;odata=nometadata'
|
|
127
|
+
},
|
|
128
|
+
responseType: 'json'
|
|
129
|
+
};
|
|
130
|
+
const defaultValuesXml = await request.get(requestOptions);
|
|
131
|
+
return defaultValuesXml;
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
if (err.status !== 404) {
|
|
135
|
+
throw err;
|
|
136
|
+
}
|
|
137
|
+
// For lists that have never had default column values set, the client_LocationBasedDefaults.html file does not exist.
|
|
138
|
+
// In this case, we need to create the file with blank default metadata.
|
|
139
|
+
const requestOptions = {
|
|
140
|
+
url: `${webUrl}/_api/Web/GetFolderByServerRelativePath(decodedUrl='${formatting.encodeQueryParameter(listServerRelUrl + '/Forms')}')/Files/Add(url='client_LocationBasedDefaults.html', overwrite=false)`,
|
|
141
|
+
headers: {
|
|
142
|
+
accept: 'application/json;odata=nometadata',
|
|
143
|
+
'content-type': 'text/plain'
|
|
144
|
+
},
|
|
145
|
+
responseType: 'json',
|
|
146
|
+
data: '<MetadataDefaults />'
|
|
147
|
+
};
|
|
148
|
+
await request.post(requestOptions);
|
|
149
|
+
return requestOptions.data;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async updateFieldValueXml(logger, xml, fieldName, fieldValue, folderUrl) {
|
|
153
|
+
if (this.verbose) {
|
|
154
|
+
await logger.logToStderr(`Modifying default column values...`);
|
|
155
|
+
}
|
|
156
|
+
// Encode all spaces in the folder URL
|
|
157
|
+
const encodedFolderUrl = folderUrl.replace(/ /g, '%20');
|
|
158
|
+
const parser = new DOMParser();
|
|
159
|
+
const doc = parser.parseFromString(xml, 'application/xml');
|
|
160
|
+
// Create a new DefaultValue node
|
|
161
|
+
const newDefaultValueNode = doc.createElement('DefaultValue');
|
|
162
|
+
newDefaultValueNode.setAttribute('FieldName', fieldName);
|
|
163
|
+
newDefaultValueNode.textContent = fieldValue;
|
|
164
|
+
const folderLinks = doc.getElementsByTagName('a');
|
|
165
|
+
for (let i = 0; i < folderLinks.length; i++) {
|
|
166
|
+
const folderNode = folderLinks[i];
|
|
167
|
+
const folderNodeUrl = folderNode.getAttribute('href');
|
|
168
|
+
if (encodedFolderUrl !== folderNodeUrl) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const defaultValues = folderNode.getElementsByTagName('DefaultValue');
|
|
172
|
+
for (let j = 0; j < defaultValues.length; j++) {
|
|
173
|
+
const defaultValueNode = defaultValues[j];
|
|
174
|
+
const defaultValueNodeField = defaultValueNode.getAttribute('FieldName');
|
|
175
|
+
if (defaultValueNodeField !== fieldName) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
// Default value node found, let's update the value
|
|
179
|
+
defaultValueNode.textContent = fieldValue;
|
|
180
|
+
return doc.toString();
|
|
181
|
+
}
|
|
182
|
+
// Default value node not found, let's create it
|
|
183
|
+
folderNode.appendChild(newDefaultValueNode);
|
|
184
|
+
return doc.toString();
|
|
185
|
+
}
|
|
186
|
+
// Folder node was not found, let's create it
|
|
187
|
+
const newFolderNode = doc.createElement('a');
|
|
188
|
+
newFolderNode.setAttribute('href', encodedFolderUrl);
|
|
189
|
+
newFolderNode.appendChild(newDefaultValueNode);
|
|
190
|
+
doc.documentElement.appendChild(newFolderNode);
|
|
191
|
+
return doc.toString();
|
|
192
|
+
}
|
|
193
|
+
async uploadDefaultColumnValuesXml(logger, webUrl, listServerRelUrl, xml) {
|
|
194
|
+
if (this.verbose) {
|
|
195
|
+
await logger.logToStderr(`Uploading default column values to list...`);
|
|
196
|
+
}
|
|
197
|
+
const requestOptions = {
|
|
198
|
+
url: `${webUrl}/_api/Web/GetFileByServerRelativePath(decodedUrl='${formatting.encodeQueryParameter(listServerRelUrl + '/Forms/client_LocationBasedDefaults.html')}')/$value`,
|
|
199
|
+
headers: {
|
|
200
|
+
accept: 'application/json;odata=nometadata',
|
|
201
|
+
'content-type': 'text/plain'
|
|
202
|
+
},
|
|
203
|
+
responseType: 'json',
|
|
204
|
+
data: xml
|
|
205
|
+
};
|
|
206
|
+
await request.put(requestOptions);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
export default new SpoListDefaultValueSetCommand();
|
|
210
|
+
//# sourceMappingURL=list-defaultvalue-set.js.map
|
|
@@ -8,6 +8,7 @@ import request from '../../../../request.js';
|
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
10
|
import commands from '../../commands.js';
|
|
11
|
+
import outlookCommands from '../../../outlook/commands.js';
|
|
11
12
|
class SpoMailSendCommand extends SpoCommand {
|
|
12
13
|
get name() {
|
|
13
14
|
return commands.MAIL_SEND;
|
|
@@ -23,6 +24,7 @@ class SpoMailSendCommand extends SpoCommand {
|
|
|
23
24
|
__classPrivateFieldGet(this, _SpoMailSendCommand_instances, "m", _SpoMailSendCommand_initValidators).call(this);
|
|
24
25
|
}
|
|
25
26
|
async commandAction(logger, args) {
|
|
27
|
+
await this.showDeprecationWarning(logger, commands.MAIL_SEND, outlookCommands.MAIL_SEND);
|
|
26
28
|
const params = {
|
|
27
29
|
properties: {
|
|
28
30
|
__metadata: { "type": "SP.Utilities.EmailProperties" },
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpoPageGetCommand_instances, _SpoPageGetCommand_initOptions, _SpoPageGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { zod } from '../../../../utils/zod.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
4
|
import request from '../../../../request.js';
|
|
8
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
6
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
7
|
import { validation } from '../../../../utils/validation.js';
|
|
11
8
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
9
|
import commands from '../../commands.js';
|
|
10
|
+
const options = globalOptionsZod
|
|
11
|
+
.extend({
|
|
12
|
+
webUrl: zod.alias('u', z.string()
|
|
13
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, url => ({
|
|
14
|
+
message: `'${url}' is not a valid SharePoint Online site URL.`
|
|
15
|
+
}))),
|
|
16
|
+
name: zod.alias('n', z.string()).optional(),
|
|
17
|
+
default: z.boolean().optional(),
|
|
18
|
+
metadataOnly: z.boolean().optional()
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
13
21
|
class SpoPageGetCommand extends SpoCommand {
|
|
14
22
|
get name() {
|
|
15
23
|
return commands.PAGE_GET;
|
|
@@ -20,21 +28,37 @@ class SpoPageGetCommand extends SpoCommand {
|
|
|
20
28
|
defaultProperties() {
|
|
21
29
|
return ['commentsDisabled', 'numSections', 'numControls', 'title', 'layoutType'];
|
|
22
30
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
getRefinedSchema(schema) {
|
|
35
|
+
return schema
|
|
36
|
+
.refine(options => [options.name, options.default].filter(x => x !== undefined).length === 1, {
|
|
37
|
+
message: `Specify either name or default, but not both.`
|
|
38
|
+
});
|
|
28
39
|
}
|
|
29
40
|
async commandAction(logger, args) {
|
|
30
41
|
if (this.verbose) {
|
|
31
42
|
await logger.logToStderr(`Retrieving information about the page...`);
|
|
32
43
|
}
|
|
33
|
-
let pageName =
|
|
34
|
-
if (args.options.name.indexOf('.aspx') < 0) {
|
|
35
|
-
pageName += '.aspx';
|
|
36
|
-
}
|
|
44
|
+
let pageName = '';
|
|
37
45
|
try {
|
|
46
|
+
if (args.options.name) {
|
|
47
|
+
pageName = args.options.name.endsWith('.aspx')
|
|
48
|
+
? args.options.name
|
|
49
|
+
: `${args.options.name}.aspx`;
|
|
50
|
+
}
|
|
51
|
+
else if (args.options.default) {
|
|
52
|
+
const requestOptions = {
|
|
53
|
+
url: `${args.options.webUrl}/_api/Web/RootFolder?$select=WelcomePage`,
|
|
54
|
+
headers: {
|
|
55
|
+
accept: 'application/json;odata=nometadata'
|
|
56
|
+
},
|
|
57
|
+
responseType: 'json'
|
|
58
|
+
};
|
|
59
|
+
const { WelcomePage } = await request.get(requestOptions);
|
|
60
|
+
pageName = WelcomePage.split('/').pop();
|
|
61
|
+
}
|
|
38
62
|
let requestOptions = {
|
|
39
63
|
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${urlUtil.getServerRelativeSiteUrl(args.options.webUrl)}/SitePages/${formatting.encodeQueryParameter(pageName)}')?$expand=ListItemAllFields/ClientSideApplicationId,ListItemAllFields/PageLayoutType,ListItemAllFields/CommentsDisabled`,
|
|
40
64
|
headers: {
|
|
@@ -45,7 +69,7 @@ class SpoPageGetCommand extends SpoCommand {
|
|
|
45
69
|
};
|
|
46
70
|
const page = await request.get(requestOptions);
|
|
47
71
|
if (page.ListItemAllFields.ClientSideApplicationId !== 'b6917cb1-93a0-4b97-a84d-7cf49975d4ec') {
|
|
48
|
-
throw `Page ${
|
|
72
|
+
throw `Page ${pageName} is not a modern page.`;
|
|
49
73
|
}
|
|
50
74
|
let pageItemData = {};
|
|
51
75
|
pageItemData = Object.assign({}, page);
|
|
@@ -80,16 +104,5 @@ class SpoPageGetCommand extends SpoCommand {
|
|
|
80
104
|
}
|
|
81
105
|
}
|
|
82
106
|
}
|
|
83
|
-
_SpoPageGetCommand_instances = new WeakSet(), _SpoPageGetCommand_initOptions = function _SpoPageGetCommand_initOptions() {
|
|
84
|
-
this.options.unshift({
|
|
85
|
-
option: '-n, --name <name>'
|
|
86
|
-
}, {
|
|
87
|
-
option: '-u, --webUrl <webUrl>'
|
|
88
|
-
}, {
|
|
89
|
-
option: '--metadataOnly'
|
|
90
|
-
});
|
|
91
|
-
}, _SpoPageGetCommand_initValidators = function _SpoPageGetCommand_initValidators() {
|
|
92
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.webUrl));
|
|
93
|
-
};
|
|
94
107
|
export default new SpoPageGetCommand();
|
|
95
108
|
//# sourceMappingURL=page-get.js.map
|
|
@@ -137,7 +137,10 @@ export default {
|
|
|
137
137
|
LIST_CONTENTTYPE_LIST: `${prefix} list contenttype list`,
|
|
138
138
|
LIST_CONTENTTYPE_REMOVE: `${prefix} list contenttype remove`,
|
|
139
139
|
LIST_CONTENTTYPE_DEFAULT_SET: `${prefix} list contenttype default set`,
|
|
140
|
+
LIST_DEFAULTVALUE_CLEAR: `${prefix} list defaultvalue clear`,
|
|
140
141
|
LIST_DEFAULTVALUE_LIST: `${prefix} list defaultvalue list`,
|
|
142
|
+
LIST_DEFAULTVALUE_REMOVE: `${prefix} list defaultvalue remove`,
|
|
143
|
+
LIST_DEFAULTVALUE_SET: `${prefix} list defaultvalue set`,
|
|
141
144
|
LIST_GET: `${prefix} list get`,
|
|
142
145
|
LIST_LIST: `${prefix} list list`,
|
|
143
146
|
LIST_REMOVE: `${prefix} list remove`,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
2
|
+
import commands from '../../commands.js';
|
|
3
|
+
import request from '../../../../request.js';
|
|
4
|
+
class TenantReportSettingsGetCommand extends GraphCommand {
|
|
5
|
+
get name() {
|
|
6
|
+
return commands.REPORT_SETTINGS_GET;
|
|
7
|
+
}
|
|
8
|
+
get description() {
|
|
9
|
+
return 'Get the tenant-level settings for Microsoft 365 reports';
|
|
10
|
+
}
|
|
11
|
+
async commandAction(logger) {
|
|
12
|
+
if (this.verbose) {
|
|
13
|
+
await logger.logToStderr('Getting tenant-level settings for Microsoft 365 reports...');
|
|
14
|
+
}
|
|
15
|
+
const requestOptions = {
|
|
16
|
+
url: `${this.resource}/v1.0/admin/reportSettings`,
|
|
17
|
+
headers: {
|
|
18
|
+
accept: 'application/json;odata.metadata=none'
|
|
19
|
+
},
|
|
20
|
+
responseType: 'json'
|
|
21
|
+
};
|
|
22
|
+
try {
|
|
23
|
+
const res = await request.get(requestOptions);
|
|
24
|
+
await logger.log(res);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
this.handleRejectedODataJsonPromise(err);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export default new TenantReportSettingsGetCommand();
|
|
32
|
+
//# sourceMappingURL=report-settings-get.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import request from '../../../../request.js';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
+
import { zod } from '../../../../utils/zod.js';
|
|
7
|
+
const options = globalOptionsZod
|
|
8
|
+
.extend({
|
|
9
|
+
displayConcealedNames: zod.alias('d', z.boolean())
|
|
10
|
+
})
|
|
11
|
+
.strict();
|
|
12
|
+
class TenantReportSettingsSetCommand extends GraphCommand {
|
|
13
|
+
get name() {
|
|
14
|
+
return commands.REPORT_SETTINGS_SET;
|
|
15
|
+
}
|
|
16
|
+
get description() {
|
|
17
|
+
return 'Update tenant-level settings for Microsoft 365 reports';
|
|
18
|
+
}
|
|
19
|
+
get schema() {
|
|
20
|
+
return options;
|
|
21
|
+
}
|
|
22
|
+
async commandAction(logger, args) {
|
|
23
|
+
try {
|
|
24
|
+
const { displayConcealedNames } = args.options;
|
|
25
|
+
if (this.verbose) {
|
|
26
|
+
await logger.logToStderr(`Updating report setting displayConcealedNames to ${displayConcealedNames}`);
|
|
27
|
+
}
|
|
28
|
+
const requestOptions = {
|
|
29
|
+
url: `${this.resource}/v1.0/admin/reportSettings`,
|
|
30
|
+
headers: {
|
|
31
|
+
accept: 'application/json;odata.metadata=none',
|
|
32
|
+
'content-type': 'application/json'
|
|
33
|
+
},
|
|
34
|
+
responseType: 'json',
|
|
35
|
+
data: {
|
|
36
|
+
displayConcealedNames
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
await request.patch(requestOptions);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
this.handleRejectedODataJsonPromise(err);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export default new TenantReportSettingsSetCommand();
|
|
47
|
+
//# sourceMappingURL=report-settings-set.js.map
|
|
@@ -15,6 +15,8 @@ export default {
|
|
|
15
15
|
REPORT_OFFICE365ACTIVATIONSUSERDETAIL: `${prefix} report office365activationsuserdetail`,
|
|
16
16
|
REPORT_OFFICE365ACTIVATIONSUSERCOUNTS: `${prefix} report office365activationsusercounts`,
|
|
17
17
|
REPORT_SERVICESUSERCOUNTS: `${prefix} report servicesusercounts`,
|
|
18
|
+
REPORT_SETTINGS_GET: `${prefix} report settings get`,
|
|
19
|
+
REPORT_SETTINGS_SET: `${prefix} report settings set`,
|
|
18
20
|
SECURITY_ALERTS_LIST: `${prefix} security alerts list`,
|
|
19
21
|
SERVICEANNOUNCEMENT_HEALTHISSUE_GET: `${prefix} serviceannouncement healthissue get`,
|
|
20
22
|
SERVICEANNOUNCEMENT_HEALTH_GET: `${prefix} serviceannouncement health get`,
|
|
@@ -31,7 +31,7 @@ m365 entra appregistration add [options]
|
|
|
31
31
|
: Comma-separated list of redirect URIs. Requires `platform` to be specified.
|
|
32
32
|
|
|
33
33
|
`-p, --platform [platform]`
|
|
34
|
-
: Platform for which the `redirectUris` should be configured. Allowed values `spa`, `web`, `publicClient`.
|
|
34
|
+
: Platform for which the `redirectUris` should be configured. Allowed values `spa`, `web`, `publicClient`. Requires `redirectUris` to be specified.
|
|
35
35
|
|
|
36
36
|
`--implicitFlow`
|
|
37
37
|
: Specify, to indicate that the authorization endpoint should return ID and access tokens.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# entra resourcenamespace list
|
|
6
|
+
|
|
7
|
+
Get a list of the RBAC resource namespaces and their properties
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 entra resourcenamespace list [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
<Global />
|
|
18
|
+
|
|
19
|
+
## Remarks
|
|
20
|
+
|
|
21
|
+
:::warning
|
|
22
|
+
|
|
23
|
+
The command is based on an API that is currently in preview and is subject to change once the API reached general availability.
|
|
24
|
+
|
|
25
|
+
:::
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
Retrieve all resource namespaces.
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
m365 entra resourcenamespace list
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Response
|
|
36
|
+
|
|
37
|
+
<Tabs>
|
|
38
|
+
<TabItem value="JSON">
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
[
|
|
42
|
+
{
|
|
43
|
+
"id": "microsoft.directory",
|
|
44
|
+
"name": "microsoft.directory"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "microsoft.aad.b2c",
|
|
48
|
+
"name": "microsoft.aad.b2c"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
</TabItem>
|
|
54
|
+
<TabItem value="Text">
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
id name
|
|
58
|
+
-------------------- --------------------
|
|
59
|
+
microsoft.directory microsoft.directory
|
|
60
|
+
microsoft.aad.b2c microsoft.aad.b2c
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
</TabItem>
|
|
64
|
+
<TabItem value="CSV">
|
|
65
|
+
|
|
66
|
+
```csv
|
|
67
|
+
id,name
|
|
68
|
+
microsoft.directory,microsoft.directory
|
|
69
|
+
microsoft.aad.b2c,microsoft.aad.b2c
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
</TabItem>
|
|
73
|
+
<TabItem value="Markdown">
|
|
74
|
+
|
|
75
|
+
```md
|
|
76
|
+
# entra resourcenamespace list
|
|
77
|
+
|
|
78
|
+
Date: 1/31/2025
|
|
79
|
+
|
|
80
|
+
## microsoft.directory (microsoft.directory)
|
|
81
|
+
|
|
82
|
+
Property | Value
|
|
83
|
+
---------|-------
|
|
84
|
+
id | microsoft.directory
|
|
85
|
+
name | microsoft.directory
|
|
86
|
+
|
|
87
|
+
## microsoft.aad.b2c (microsoft.aad.b2c)
|
|
88
|
+
|
|
89
|
+
Property | Value
|
|
90
|
+
---------|-------
|
|
91
|
+
id | microsoft.aad.b2c
|
|
92
|
+
name | microsoft.aad.b2c
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
</TabItem>
|
|
96
|
+
</Tabs>
|
|
@@ -33,6 +33,10 @@ m365 entra roledefinition add [options]
|
|
|
33
33
|
|
|
34
34
|
<Global />
|
|
35
35
|
|
|
36
|
+
## Remarks
|
|
37
|
+
|
|
38
|
+
Use the `m365 entra rolepermission list --resourceNamespace microsoft.directory` command to get a list of available resource actions.
|
|
39
|
+
|
|
36
40
|
## Examples
|
|
37
41
|
|
|
38
42
|
Create a custom Microsoft Entra ID role
|
|
@@ -37,6 +37,10 @@ m365 entra roledefinition set [options]
|
|
|
37
37
|
|
|
38
38
|
<Global />
|
|
39
39
|
|
|
40
|
+
## Remarks
|
|
41
|
+
|
|
42
|
+
Use the `m365 entra rolepermission list --resourceNamespace microsoft.directory` command to get a list of available resource actions.
|
|
43
|
+
|
|
40
44
|
## Examples
|
|
41
45
|
|
|
42
46
|
Update a custom Microsoft Entra ID role specified by the id
|