@pnp/cli-microsoft365 4.2.0-beta.bf7382d → 4.3.0-beta.0aaa522
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/.devcontainer/Dockerfile +2 -2
- package/.eslintrc.js +1 -0
- package/README.md +1 -1
- package/dist/appInsights.js +5 -2
- package/dist/cli/Cli.js +26 -4
- package/dist/m365/aad/commands/app/app-add.js +58 -5
- package/dist/m365/aad/commands/app/app-get.js +97 -0
- package/dist/m365/aad/commands/o365group/o365group-add.js +56 -50
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-add.js +5 -8
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +6 -3
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-set.js +3 -3
- package/dist/m365/aad/commands/sp/sp-add.js +107 -0
- package/dist/m365/aad/commands/user/user-password-validate.js +42 -0
- package/dist/m365/aad/commands.js +3 -0
- package/dist/m365/app/commands/permission/permission-list.js +266 -0
- package/dist/m365/app/commands.js +7 -0
- package/dist/m365/base/AppCommand.js +76 -0
- package/dist/m365/base/M365RcJson.js +3 -0
- package/dist/m365/cli/commands/cli-doctor.js +2 -0
- package/dist/m365/file/commands/file-add.js +32 -13
- package/dist/m365/file/commands/file-list.js +181 -0
- package/dist/m365/file/commands.js +2 -1
- package/dist/m365/pa/commands/app/app-list.js +28 -1
- package/dist/m365/search/commands/externalconnection/externalconnection-add.js +99 -0
- package/dist/m365/search/commands.js +7 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006005_CFG_PS_metadata.js +63 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN006006_CFG_PS_features.js +60 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.13.1.js +53 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.14.0-beta.4.js +57 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +17 -13
- package/dist/m365/spfx/commands/spfx-doctor.js +176 -62
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +52 -0
- package/dist/m365/spo/commands/list/list-get.js +6 -2
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +90 -0
- package/dist/m365/spo/commands/page/Page.js +3 -1
- package/dist/m365/spo/commands/page/page-add.js +7 -10
- package/dist/m365/spo/commands/page/page-set.js +7 -10
- package/dist/m365/spo/commands/site/site-remove.js +98 -30
- package/dist/m365/spo/commands/web/web-installedlanguage-list.js +48 -0
- package/dist/m365/spo/commands.js +4 -1
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +1 -1
- package/dist/m365/teams/commands/report/report-pstncalls.js +1 -1
- package/dist/request.js +9 -4
- package/docs/docs/cmd/_global.md +2 -2
- package/docs/docs/cmd/aad/app/app-add.md +11 -0
- package/docs/docs/cmd/aad/app/app-get.md +48 -0
- package/docs/docs/cmd/aad/o365group/o365group-add.md +1 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.md +2 -1
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-set.md +3 -2
- package/docs/docs/cmd/aad/sp/sp-add.md +53 -0
- package/docs/docs/cmd/aad/user/user-password-validate.md +29 -0
- package/docs/docs/cmd/app/permission/permission-list.md +36 -0
- package/docs/docs/cmd/file/file-add.md +11 -0
- package/docs/docs/cmd/file/file-list.md +46 -0
- package/docs/docs/cmd/pa/app/app-list.md +17 -1
- package/docs/docs/cmd/search/externalconnection/externalconnection-add.md +43 -0
- package/docs/docs/cmd/spfx/project/project-externalize.md +1 -1
- package/docs/docs/cmd/spfx/project/project-rename.md +1 -1
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/spfx/spfx-doctor.md +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-list.md +33 -0
- package/docs/docs/cmd/spo/list/list-get.md +9 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.md +39 -0
- package/docs/docs/cmd/spo/page/page-add.md +2 -2
- package/docs/docs/cmd/spo/page/page-set.md +3 -3
- package/docs/docs/cmd/spo/site/site-remove.md +3 -1
- package/docs/docs/cmd/spo/web/web-installedlanguage-list.md +24 -0
- package/docs/docs/cmd/teams/report/report-directroutingcalls.md +0 -3
- package/docs/docs/cmd/teams/report/report-pstncalls.md +4 -3
- package/npm-shrinkwrap.json +1050 -1568
- package/package.json +29 -24
|
@@ -284,11 +284,11 @@ class SpoPageAddCommand extends SpoCommand_1.default {
|
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
286
|
option: '-l, --layoutType [layoutType]',
|
|
287
|
-
autocomplete:
|
|
287
|
+
autocomplete: Page_1.supportedPageLayouts
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
290
|
option: '-p, --promoteAs [promoteAs]',
|
|
291
|
-
autocomplete:
|
|
291
|
+
autocomplete: Page_1.supportedPromoteAs
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
option: '--commentsEnabled'
|
|
@@ -312,20 +312,17 @@ class SpoPageAddCommand extends SpoCommand_1.default {
|
|
|
312
312
|
return isValidSharePointUrl;
|
|
313
313
|
}
|
|
314
314
|
if (args.options.layoutType &&
|
|
315
|
-
args.options.layoutType
|
|
316
|
-
args.options.layoutType
|
|
317
|
-
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values Article|Home`;
|
|
315
|
+
Page_1.supportedPageLayouts.indexOf(args.options.layoutType) < 0) {
|
|
316
|
+
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values ${Page_1.supportedPageLayouts.join(', ')}`;
|
|
318
317
|
}
|
|
319
318
|
if (args.options.promoteAs &&
|
|
320
|
-
args.options.promoteAs
|
|
321
|
-
args.options.promoteAs
|
|
322
|
-
args.options.promoteAs !== 'Template') {
|
|
323
|
-
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values HomePage|NewsPage|Template`;
|
|
319
|
+
Page_1.supportedPromoteAs.indexOf(args.options.promoteAs) < 0) {
|
|
320
|
+
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values ${Page_1.supportedPromoteAs.join(', ')}`;
|
|
324
321
|
}
|
|
325
322
|
if (args.options.promoteAs === 'HomePage' && args.options.layoutType !== 'Home') {
|
|
326
323
|
return 'You can only promote home pages as site home page';
|
|
327
324
|
}
|
|
328
|
-
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType
|
|
325
|
+
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType && args.options.layoutType !== 'Article') {
|
|
329
326
|
return 'You can only promote article pages as news article';
|
|
330
327
|
}
|
|
331
328
|
return true;
|
|
@@ -283,11 +283,11 @@ class SpoPageSetCommand extends SpoCommand_1.default {
|
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
285
|
option: '-l, --layoutType [layoutType]',
|
|
286
|
-
autocomplete:
|
|
286
|
+
autocomplete: Page_1.supportedPageLayouts
|
|
287
287
|
},
|
|
288
288
|
{
|
|
289
289
|
option: '-p, --promoteAs [promoteAs]',
|
|
290
|
-
autocomplete:
|
|
290
|
+
autocomplete: Page_1.supportedPromoteAs
|
|
291
291
|
},
|
|
292
292
|
{
|
|
293
293
|
option: '--commentsEnabled [commentsEnabled]',
|
|
@@ -315,20 +315,17 @@ class SpoPageSetCommand extends SpoCommand_1.default {
|
|
|
315
315
|
return isValidSharePointUrl;
|
|
316
316
|
}
|
|
317
317
|
if (args.options.layoutType &&
|
|
318
|
-
args.options.layoutType
|
|
319
|
-
args.options.layoutType
|
|
320
|
-
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values Article|Home`;
|
|
318
|
+
Page_1.supportedPageLayouts.indexOf(args.options.layoutType) < 0) {
|
|
319
|
+
return `${args.options.layoutType} is not a valid option for layoutType. Allowed values ${Page_1.supportedPageLayouts.join(', ')}`;
|
|
321
320
|
}
|
|
322
321
|
if (args.options.promoteAs &&
|
|
323
|
-
args.options.promoteAs
|
|
324
|
-
args.options.promoteAs
|
|
325
|
-
args.options.promoteAs !== 'Template') {
|
|
326
|
-
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values HomePage|NewsPage|Template`;
|
|
322
|
+
Page_1.supportedPromoteAs.indexOf(args.options.promoteAs) < 0) {
|
|
323
|
+
return `${args.options.promoteAs} is not a valid option for promoteAs. Allowed values ${Page_1.supportedPromoteAs.join(', ')}`;
|
|
327
324
|
}
|
|
328
325
|
if (args.options.promoteAs === 'HomePage' && args.options.layoutType !== 'Home') {
|
|
329
326
|
return 'You can only promote home pages as site home page';
|
|
330
327
|
}
|
|
331
|
-
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType
|
|
328
|
+
if (args.options.promoteAs === 'NewsPage' && args.options.layoutType && args.options.layoutType !== 'Article') {
|
|
332
329
|
return 'You can only promote article pages as news article';
|
|
333
330
|
}
|
|
334
331
|
if (typeof args.options.commentsEnabled !== 'undefined' &&
|
|
@@ -25,26 +25,65 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
|
|
|
25
25
|
commandAction(logger, args, cb) {
|
|
26
26
|
const removeSite = () => {
|
|
27
27
|
this.dots = '';
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
if (args.options.fromRecycleBin) {
|
|
29
|
+
this
|
|
30
|
+
.deleteSiteWithoutGroup(logger, args)
|
|
31
|
+
.then(_ => cb(), (err) => this.handleRejectedPromise(err, logger, cb));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this
|
|
35
|
+
.getSiteGroupId(args.options.url, logger)
|
|
36
|
+
.then((groupId) => {
|
|
37
|
+
if (groupId === '00000000-0000-0000-0000-000000000000') {
|
|
38
|
+
if (this.debug) {
|
|
39
|
+
logger.logToStderr('Site is not groupified. Going ahead with the conventional site deletion options');
|
|
40
|
+
}
|
|
41
|
+
return this.deleteSiteWithoutGroup(logger, args);
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
else {
|
|
44
|
+
if (this.debug) {
|
|
45
|
+
logger.logToStderr(`Site attached to group ${groupId}. Initiating group delete operation via Graph API`);
|
|
46
|
+
}
|
|
47
|
+
return this
|
|
48
|
+
.getSiteGroup(groupId)
|
|
49
|
+
.then((group) => {
|
|
50
|
+
if (args.options.skipRecycleBin || args.options.wait) {
|
|
51
|
+
logger.logToStderr(chalk.yellow(`Entered site is a groupified site. Hence, the parameters 'skipRecycleBin' and 'wait' will not be applicable.`));
|
|
52
|
+
}
|
|
53
|
+
return this.deleteGroupifiedSite(group.id, logger);
|
|
54
|
+
})
|
|
55
|
+
.catch((err) => {
|
|
56
|
+
if (err.response.status === 404) {
|
|
57
|
+
if (this.verbose) {
|
|
58
|
+
logger.logToStderr(`Site group doesn't exist. Searching in the Microsoft 365 deleted groups.`);
|
|
59
|
+
}
|
|
60
|
+
return this
|
|
61
|
+
.isSiteGroupDeleted(groupId)
|
|
62
|
+
.then((deletedGroups) => {
|
|
63
|
+
if (deletedGroups.value.length === 0) {
|
|
64
|
+
if (this.verbose) {
|
|
65
|
+
logger.logToStderr("Site group doesn't exist anymore. Deleting the site.");
|
|
66
|
+
}
|
|
67
|
+
if (args.options.wait) {
|
|
68
|
+
logger.logToStderr(chalk.yellow(`Entered site is a groupified site. Hence, the parameter 'wait' will not be applicable.`));
|
|
69
|
+
}
|
|
70
|
+
return Promise.resolve();
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return Promise.reject(`Site group still exists in the deleted groups. The site won't be removed.`);
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
.then(_ => this.deleteOrphanedSite(logger, args.options.url))
|
|
77
|
+
.catch((err) => Promise.reject(err));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return Promise.reject(err);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
43
83
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
.then(_ => cb(), (err) => this.handleRejectedPromise(err, logger, cb));
|
|
84
|
+
})
|
|
85
|
+
.then(_ => cb(), (err) => this.handleRejectedPromise(err, logger, cb));
|
|
86
|
+
}
|
|
48
87
|
};
|
|
49
88
|
if (args.options.confirm) {
|
|
50
89
|
removeSite();
|
|
@@ -65,32 +104,64 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
|
|
|
65
104
|
});
|
|
66
105
|
}
|
|
67
106
|
}
|
|
107
|
+
getSiteGroup(groupId) {
|
|
108
|
+
const requestOptions = {
|
|
109
|
+
url: `https://graph.microsoft.com/v1.0/groups/${groupId}`,
|
|
110
|
+
headers: {
|
|
111
|
+
accept: 'application/json;odata.metadata=none'
|
|
112
|
+
},
|
|
113
|
+
responseType: 'json'
|
|
114
|
+
};
|
|
115
|
+
return request_1.default.get(requestOptions);
|
|
116
|
+
}
|
|
117
|
+
isSiteGroupDeleted(groupId) {
|
|
118
|
+
const requestOptions = {
|
|
119
|
+
url: `https://graph.microsoft.com/v1.0/directory/deletedItems/Microsoft.Graph.Group?$select=id&$filter=groupTypes/any(c:c+eq+'Unified') and startswith(id, '${groupId}')`,
|
|
120
|
+
headers: {
|
|
121
|
+
accept: 'application/json;odata.metadata=none'
|
|
122
|
+
},
|
|
123
|
+
responseType: 'json'
|
|
124
|
+
};
|
|
125
|
+
return request_1.default.get(requestOptions);
|
|
126
|
+
}
|
|
127
|
+
deleteOrphanedSite(logger, url) {
|
|
128
|
+
return this
|
|
129
|
+
.getSpoAdminUrl(logger, this.debug)
|
|
130
|
+
.then((spoAdminUrl) => {
|
|
131
|
+
const requestOptions = {
|
|
132
|
+
url: `${spoAdminUrl}/_api/GroupSiteManager/Delete?siteUrl='${url}'`,
|
|
133
|
+
headers: {
|
|
134
|
+
'content-type': 'application/json;odata=nometadata',
|
|
135
|
+
accept: 'application/json;odata=nometadata'
|
|
136
|
+
},
|
|
137
|
+
responseType: 'json'
|
|
138
|
+
};
|
|
139
|
+
return request_1.default.post(requestOptions);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
68
142
|
deleteSiteWithoutGroup(logger, args) {
|
|
69
143
|
return this
|
|
70
144
|
.getSpoAdminUrl(logger, this.debug)
|
|
71
|
-
.then((
|
|
72
|
-
this.spoAdminUrl =
|
|
145
|
+
.then((spoAdminUrl) => {
|
|
146
|
+
this.spoAdminUrl = spoAdminUrl;
|
|
73
147
|
return this.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
|
|
74
148
|
})
|
|
75
149
|
.then((res) => {
|
|
76
150
|
this.context = res;
|
|
77
151
|
if (args.options.fromRecycleBin) {
|
|
78
152
|
if (this.verbose) {
|
|
79
|
-
logger.logToStderr(`Deleting site
|
|
153
|
+
logger.logToStderr(`Deleting site from recycle bin ${args.options.url}...`);
|
|
80
154
|
}
|
|
81
155
|
return this.deleteSiteFromTheRecycleBin(args.options.url, args.options.wait, logger);
|
|
82
156
|
}
|
|
83
157
|
else {
|
|
84
|
-
if (this.verbose) {
|
|
85
|
-
logger.logToStderr(`Deleting site collection ${args.options.url}...`);
|
|
86
|
-
}
|
|
87
158
|
return this.deleteSite(args.options.url, args.options.wait, logger);
|
|
88
159
|
}
|
|
89
160
|
})
|
|
90
161
|
.then(() => {
|
|
91
162
|
if (args.options.skipRecycleBin) {
|
|
92
163
|
if (this.verbose) {
|
|
93
|
-
logger.logToStderr(`Also deleting site
|
|
164
|
+
logger.logToStderr(`Also deleting site from tenant recycle bin ${args.options.url}...`);
|
|
94
165
|
}
|
|
95
166
|
return this.deleteSiteFromTheRecycleBin(args.options.url, args.options.wait, logger);
|
|
96
167
|
}
|
|
@@ -106,7 +177,7 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
|
|
|
106
177
|
.then((res) => {
|
|
107
178
|
this.context = res;
|
|
108
179
|
if (this.verbose) {
|
|
109
|
-
logger.logToStderr(`Deleting site ${url}
|
|
180
|
+
logger.logToStderr(`Deleting site ${url}...`);
|
|
110
181
|
}
|
|
111
182
|
const requestOptions = {
|
|
112
183
|
url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
@@ -143,9 +214,6 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
|
|
|
143
214
|
.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug)
|
|
144
215
|
.then((res) => {
|
|
145
216
|
this.context = res;
|
|
146
|
-
if (this.verbose) {
|
|
147
|
-
logger.logToStderr(`Deleting site ${url} from the recycle bin...`);
|
|
148
|
-
}
|
|
149
217
|
const requestOptions = {
|
|
150
218
|
url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
151
219
|
headers: {
|
|
@@ -185,7 +253,7 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
|
|
|
185
253
|
.then((res) => {
|
|
186
254
|
this.context = res;
|
|
187
255
|
if (this.verbose) {
|
|
188
|
-
logger.logToStderr(`Retrieving the
|
|
256
|
+
logger.logToStderr(`Retrieving the group Id of the site ${url}`);
|
|
189
257
|
}
|
|
190
258
|
const requestOptions = {
|
|
191
259
|
url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class SpoWebInstalledLanguageListCommand extends SpoCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.WEB_INSTALLEDLANGUAGE_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists all installed languages on site';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['DisplayName', 'LanguageTag', 'Lcid'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
if (this.verbose) {
|
|
18
|
+
logger.logToStderr(`Retrieving all installed languages on site ${args.options.webUrl}...`);
|
|
19
|
+
}
|
|
20
|
+
const requestOptions = {
|
|
21
|
+
url: `${args.options.webUrl}/_api/web/RegionalSettings/InstalledLanguages`,
|
|
22
|
+
headers: {
|
|
23
|
+
'accept': 'application/json;odata=nometadata'
|
|
24
|
+
},
|
|
25
|
+
responseType: 'json'
|
|
26
|
+
};
|
|
27
|
+
request_1.default
|
|
28
|
+
.get(requestOptions)
|
|
29
|
+
.then((webInstalledLanguageProperties) => {
|
|
30
|
+
logger.log(webInstalledLanguageProperties.Items);
|
|
31
|
+
cb();
|
|
32
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
33
|
+
}
|
|
34
|
+
options() {
|
|
35
|
+
const options = [
|
|
36
|
+
{
|
|
37
|
+
option: '-u, --webUrl <webUrl>'
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
const parentOptions = super.options();
|
|
41
|
+
return options.concat(parentOptions);
|
|
42
|
+
}
|
|
43
|
+
validate(args) {
|
|
44
|
+
return SpoCommand_1.default.isValidSharePointUrl(args.options.webUrl);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
module.exports = new SpoWebInstalledLanguageListCommand();
|
|
48
|
+
//# sourceMappingURL=web-installedlanguage-list.js.map
|
|
@@ -22,9 +22,10 @@ exports.default = {
|
|
|
22
22
|
CDN_POLICY_SET: `${prefix} cdn policy set`,
|
|
23
23
|
CDN_SET: `${prefix} cdn set`,
|
|
24
24
|
CONTENTTYPE_ADD: `${prefix} contenttype add`,
|
|
25
|
-
CONTENTTYPE_GET: `${prefix} contenttype get`,
|
|
26
25
|
CONTENTTYPE_FIELD_REMOVE: `${prefix} contenttype field remove`,
|
|
27
26
|
CONTENTTYPE_FIELD_SET: `${prefix} contenttype field set`,
|
|
27
|
+
CONTENTTYPE_GET: `${prefix} contenttype get`,
|
|
28
|
+
CONTENTTYPE_LIST: `${prefix} contenttype list`,
|
|
28
29
|
CONTENTTYPE_REMOVE: `${prefix} contenttype remove`,
|
|
29
30
|
CONTENTTYPEHUB_GET: `${prefix} contenttypehub get`,
|
|
30
31
|
CUSTOMACTION_ADD: `${prefix} customaction add`,
|
|
@@ -107,6 +108,7 @@ exports.default = {
|
|
|
107
108
|
LIST_WEBHOOK_REMOVE: `${prefix} list webhook remove`,
|
|
108
109
|
LIST_WEBHOOK_SET: `${prefix} list webhook set`,
|
|
109
110
|
LISTITEM_ADD: `${prefix} listitem add`,
|
|
111
|
+
LISTITEM_ATTACHMENT_LIST: `${prefix} listitem attachment list`,
|
|
110
112
|
LISTITEM_GET: `${prefix} listitem get`,
|
|
111
113
|
LISTITEM_ISRECORD: `${prefix} listitem isrecord`,
|
|
112
114
|
LISTITEM_LIST: `${prefix} listitem list`,
|
|
@@ -244,6 +246,7 @@ exports.default = {
|
|
|
244
246
|
WEB_ADD: `${prefix} web add`,
|
|
245
247
|
WEB_CLIENTSIDEWEBPART_LIST: `${prefix} web clientsidewebpart list`,
|
|
246
248
|
WEB_GET: `${prefix} web get`,
|
|
249
|
+
WEB_INSTALLEDLANGUAGE_LIST: `${prefix} web installedlanguage list`,
|
|
247
250
|
WEB_LIST: `${prefix} web list`,
|
|
248
251
|
WEB_REINDEX: `${prefix} web reindex`,
|
|
249
252
|
WEB_REMOVE: `${prefix} web remove`,
|
|
@@ -22,7 +22,7 @@ class TeamsReportDirectroutingcallsCommand extends GraphCommand_1.default {
|
|
|
22
22
|
commandAction(logger, args, cb) {
|
|
23
23
|
const toDateTimeParameter = encodeURIComponent(args.options.toDateTime ? args.options.toDateTime : new Date().toISOString());
|
|
24
24
|
const requestOptions = {
|
|
25
|
-
url: `${this.resource}/
|
|
25
|
+
url: `${this.resource}/v1.0/communications/callRecords/getDirectRoutingCalls(fromDateTime=${encodeURIComponent(args.options.fromDateTime)},toDateTime=${toDateTimeParameter})`,
|
|
26
26
|
headers: {
|
|
27
27
|
accept: 'application/json;odata.metadata=none'
|
|
28
28
|
},
|
|
@@ -22,7 +22,7 @@ class TeamsReportPstncallsCommand extends GraphCommand_1.default {
|
|
|
22
22
|
commandAction(logger, args, cb) {
|
|
23
23
|
const toDateTimeParameter = encodeURIComponent(args.options.toDateTime ? args.options.toDateTime : new Date().toISOString());
|
|
24
24
|
const requestOptions = {
|
|
25
|
-
url: `${this.resource}/
|
|
25
|
+
url: `${this.resource}/v1.0/communications/callRecords/getPstnCalls(fromDateTime=${encodeURIComponent(args.options.fromDateTime)},toDateTime=${toDateTimeParameter})`,
|
|
26
26
|
headers: {
|
|
27
27
|
accept: 'application/json;odata.metadata=none'
|
|
28
28
|
},
|
package/dist/request.js
CHANGED
|
@@ -16,7 +16,9 @@ class Request {
|
|
|
16
16
|
decompress: true,
|
|
17
17
|
responseType: 'text',
|
|
18
18
|
/* c8 ignore next */
|
|
19
|
-
transformResponse: [data => data]
|
|
19
|
+
transformResponse: [data => data],
|
|
20
|
+
maxBodyLength: Infinity,
|
|
21
|
+
maxContentLength: Infinity
|
|
20
22
|
});
|
|
21
23
|
// since we're stubbing requests, request interceptor is never called in
|
|
22
24
|
// tests, so let's exclude it from coverage
|
|
@@ -64,7 +66,7 @@ class Request {
|
|
|
64
66
|
});
|
|
65
67
|
// since we're stubbing requests, response interceptor is never called in
|
|
66
68
|
// tests, so let's exclude it from coverage
|
|
67
|
-
/* c8 ignore next
|
|
69
|
+
/* c8 ignore next 26 */
|
|
68
70
|
this.req.interceptors.response.use((response) => {
|
|
69
71
|
if (this._logger) {
|
|
70
72
|
this._logger.logToStderr('Response:');
|
|
@@ -73,19 +75,22 @@ class Request {
|
|
|
73
75
|
response.headers['content-type'].indexOf('json') > -1) {
|
|
74
76
|
properties.push('data');
|
|
75
77
|
}
|
|
76
|
-
this._logger.logToStderr(JSON.stringify(Utils_1.default.filterObject(response, properties), null, 2));
|
|
78
|
+
this._logger.logToStderr(JSON.stringify(Object.assign({ url: response.config.url }, Utils_1.default.filterObject(response, properties)), null, 2));
|
|
77
79
|
}
|
|
78
80
|
return response;
|
|
79
81
|
}, (error) => {
|
|
80
82
|
if (this._logger) {
|
|
81
83
|
const properties = ['status', 'statusText', 'headers'];
|
|
82
84
|
this._logger.logToStderr('Request error:');
|
|
83
|
-
this._logger.logToStderr(JSON.stringify(Object.assign(Object.assign({}, Utils_1.default.filterObject(error.response, properties)), { error: error.error }), null, 2));
|
|
85
|
+
this._logger.logToStderr(JSON.stringify(Object.assign(Object.assign({ url: error.config.url }, Utils_1.default.filterObject(error.response, properties)), { error: error.error }), null, 2));
|
|
84
86
|
}
|
|
85
87
|
throw error;
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
90
|
}
|
|
91
|
+
get logger() {
|
|
92
|
+
return this._logger;
|
|
93
|
+
}
|
|
89
94
|
set logger(logger) {
|
|
90
95
|
this._logger = logger;
|
|
91
96
|
}
|
package/docs/docs/cmd/_global.md
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
: JMESPath query string. See [http://jmespath.org/](http://jmespath.org/) for more information and examples
|
|
6
6
|
|
|
7
7
|
`-o, --output [output]`
|
|
8
|
-
: Output type. `json,text`. Default `
|
|
8
|
+
: Output type. `json,text,csv`. Default `json`
|
|
9
9
|
|
|
10
10
|
`--verbose`
|
|
11
11
|
: Runs command with verbose logging
|
|
12
12
|
|
|
13
13
|
`--debug`
|
|
14
|
-
: Runs command with debug logging
|
|
14
|
+
: Runs command with debug logging
|
|
@@ -52,6 +52,9 @@ m365 aad app add [options]
|
|
|
52
52
|
`--manifest [manifest]`
|
|
53
53
|
: Azure AD app manifest as retrieved from the Azure Portal to create the app registration from
|
|
54
54
|
|
|
55
|
+
`--save`
|
|
56
|
+
: Use to store the information about the created app in a local file
|
|
57
|
+
|
|
55
58
|
--8<-- "docs/cmd/_global.md"
|
|
56
59
|
|
|
57
60
|
## Remarks
|
|
@@ -80,6 +83,8 @@ When using the `withSecret` option, this command will automatically generate a s
|
|
|
80
83
|
|
|
81
84
|
After creating the Azure AD app registration, this command returns the app ID and object ID of the created app registration. If you used the `withSecret` option, it will also return the generated secret.
|
|
82
85
|
|
|
86
|
+
If you want to store the information about the created Azure AD app registration, use the `--save` option. This is useful when you build solutions connected to Microsoft 365 and want to easily manage app registrations used with your solution. When you use the `--save` option, after you create the app registration, the command will write its ID and name to the `.m365rc.json` file in the current directory. If the file already exists, it will add the information about the to it, allowing you to track multiple apps. If the file doesn't exist, the command will create it.
|
|
87
|
+
|
|
83
88
|
## Examples
|
|
84
89
|
|
|
85
90
|
Create new Azure AD app registration with the specified name
|
|
@@ -141,3 +146,9 @@ Create new Azure AD app registration with Application ID URI set to a value that
|
|
|
141
146
|
```sh
|
|
142
147
|
m365 aad app add --name 'My AAD app' --uri api://caf406b91cd4.ngrok.io/_appId_ --scopeName access_as_user --scopeAdminConsentDescription 'Access as a user' --scopeAdminConsentDisplayName 'Access as a user' --scopeConsentBy adminsAndUsers
|
|
143
148
|
```
|
|
149
|
+
|
|
150
|
+
Create new Azure AD app registration with the specified name. Store information about the created app registration in the _.m365rc.json_ file in the current directory.
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
m365 aad app add --name 'My AAD app' --save
|
|
154
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# aad app get
|
|
2
|
+
|
|
3
|
+
Gets an Azure AD app registration
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad app get [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--appId [appId]`
|
|
14
|
+
: Application (client) ID of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
|
|
15
|
+
|
|
16
|
+
`--objectId [objectId]`
|
|
17
|
+
: Object ID of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
|
|
18
|
+
|
|
19
|
+
`--name [name]`
|
|
20
|
+
: Name of the Azure AD application registration to get. Specify either `appId`, `objectId` or `name`
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
For best performance use the `objectId` option to reference the Azure AD application registration to update. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
|
|
27
|
+
|
|
28
|
+
If the command finds multiple Azure AD application registrations with the specified app name, it will prompt you to disambiguate which app it should use, listing the discovered object IDs.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
Get the Azure AD application registration by its app (client) ID
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
m365 aad app get --appId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Get the Azure AD application registration by its object ID
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
m365 aad app get --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Get the Azure AD application registration by its name
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
m365 aad app get --name "My app"
|
|
48
|
+
```
|
|
@@ -36,6 +36,7 @@ m365 aad o365group add [options]
|
|
|
36
36
|
## Remarks
|
|
37
37
|
|
|
38
38
|
When specifying the path to the logo image you can use both relative and absolute paths. Note, that ~ in the path, will not be resolved and will most likely result in an error.
|
|
39
|
+
If an invalid user is provided in the comma-separated list or Owners or Members, the command operation will fail and the Micrsoft 365 Group will not be created.
|
|
39
40
|
|
|
40
41
|
## Examples
|
|
41
42
|
|
|
@@ -35,4 +35,5 @@ m365 aad oauth2grant remove --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-e
|
|
|
35
35
|
|
|
36
36
|
## More information
|
|
37
37
|
|
|
38
|
-
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
38
|
+
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
39
|
+
- Delete a delegated permission grant (oAuth2PermissionGrant): [https://docs.microsoft.com/en-us/graph/api/oauth2permissiongrant-delete?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/oauth2permissiongrant-delete?view=graph-rest-1.0)
|
|
@@ -22,7 +22,7 @@ m365 aad oauth2grant set [options]
|
|
|
22
22
|
|
|
23
23
|
Before you can update service principal's OAuth2 permissions, you need to get the `objectId` of the permissions grant to update. You can retrieve it using the [aad oauth2grant list](./oauth2grant-list.md) command.
|
|
24
24
|
|
|
25
|
-
If the `objectId` listed when using the [aad oauth2grant list](./oauth2grant-list.md) command has a minus sign ('-') prefix, you may receive an error indicating `--grantId` is missing.
|
|
25
|
+
If the `objectId` listed when using the [aad oauth2grant list](./oauth2grant-list.md) command has a minus sign ('-') prefix, you may receive an error indicating `--grantId` is missing. To resolve this issue simply escape the leading '-'.
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
28
|
m365 aad oauth2grant set --grantId \\-Zc1JRY8REeLxmXz5KtixAYU3Q6noCBPlhwGiX7pxmU
|
|
@@ -38,4 +38,5 @@ m365 aad oauth2grant set --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek -
|
|
|
38
38
|
|
|
39
39
|
## More information
|
|
40
40
|
|
|
41
|
-
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
41
|
+
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
42
|
+
- Update a delegated permission grant (oAuth2PermissionGrant): [https://docs.microsoft.com/en-us/graph/api/oauth2permissiongrant-update?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/oauth2permissiongrant-update?view=graph-rest-1.0)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# aad sp add
|
|
2
|
+
|
|
3
|
+
Adds a service principal to a registered Azure AD app
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad sp add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--appId [appId]`
|
|
14
|
+
: ID of the application to which the service principal should be added
|
|
15
|
+
|
|
16
|
+
`--appName [appName]`
|
|
17
|
+
: Display name of the application to which the service principal should be added
|
|
18
|
+
|
|
19
|
+
`--objectId [objectId]`
|
|
20
|
+
: ObjectId of the application to which the service principal should be added
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
Specify either the `appId`, `appName` or `objectId`. If you specify more than one option value, the command will fail with an error.
|
|
27
|
+
|
|
28
|
+
If you register an application in the portal, an application object as well as a service principal object are automatically created in your home tenant. If you register an application using CLI for Microsoft 365 or the Microsoft Graph, you'll need to create the service principal separately. To register/create an application using the CLI for Microsoft 365, use the [m365 aad app add](../app/app-add.md) command.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
Adds a service principal to a registered Azure AD app with appId _b2307a39-e878-458b-bc90-03bc578531d6_.
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
m365 aad sp add --appId b2307a39-e878-458b-bc90-03bc578531d6
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Adds a service principal to a registered Azure AD app with appName _Microsoft Graph_.
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
m365 aad sp add --appName "Microsoft Graph"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Adds a service principal to a registered Azure AD app with objectId _b2307a39-e878-458b-bc90-03bc578531d6_.
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
m365 aad sp add --objectId b2307a39-e878-458b-bc90-03bc578531d6
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## More information
|
|
51
|
+
|
|
52
|
+
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
53
|
+
- Create servicePrincipal: [https://docs.microsoft.com/en-us/graph/api/serviceprincipal-post-serviceprincipals?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/serviceprincipal-post-serviceprincipals?view=graph-rest-1.0)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# aad user password validate
|
|
2
|
+
|
|
3
|
+
Check a user's password against the organization's password validation policy
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad user password validate [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-p, --password <password>`
|
|
14
|
+
: The password to be validated.
|
|
15
|
+
|
|
16
|
+
--8<-- "docs/cmd/_global.md"
|
|
17
|
+
|
|
18
|
+
## Remarks
|
|
19
|
+
|
|
20
|
+
!!! attention
|
|
21
|
+
This command is based on an API that is currently in preview and is subject to change once the API reached general availability.
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
Validate password _cli365P@ssW0rd_ against the organization's password validation policy
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
m365 aad user password validate --password "cli365P@ssW0rd"
|
|
29
|
+
```
|