@pnp/cli-microsoft365 5.1.0-beta.6ab68db → 5.1.0-beta.9b2f51d
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/.eslintrc.js +1 -0
- package/dist/m365/aad/commands/app/app-add.js +68 -10
- package/dist/m365/aad/commands/app/{app-delete.js → app-remove.js} +9 -5
- package/dist/m365/aad/commands/app/{app-role-delete.js → app-role-remove.js} +11 -7
- package/dist/m365/aad/commands.js +3 -1
- package/dist/m365/base/PowerPlatformCommand.js +10 -0
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +98 -0
- package/dist/m365/pp/commands.js +7 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001033_DEP_tslib.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN023002_GITIGNORE_heft.js +40 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.12.0.js +0 -2
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.0-beta.1.js +63 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +24 -19
- package/dist/m365/spo/commands/site/site-recyclebinitem-restore.js +66 -0
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/tenant/commands.js +1 -6
- package/dist/utils/formatting.js +3 -0
- package/docs/docs/cmd/aad/app/{app-delete.md → app-remove.md} +15 -9
- package/docs/docs/cmd/aad/app/{app-role-delete.md → app-role-remove.md} +25 -19
- package/docs/docs/cmd/pp/managementapp/managementapp-add.md +50 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +1 -1
- package/docs/docs/cmd/spo/site/site-recyclebinitem-restore.md +27 -0
- package/package.json +3 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015006_FILE_editorconfig.js +0 -14
- package/dist/m365/tenant/commands/auditlog/auditlog-report.js +0 -231
- package/dist/m365/tenant/commands/service/service-list.js +0 -41
- package/dist/m365/tenant/commands/service/service-message-list.js +0 -55
- package/dist/m365/tenant/commands/service/service-report-historicalservicestatus.js +0 -54
- package/dist/m365/tenant/commands/status/status-list.js +0 -55
- package/docs/docs/cmd/tenant/auditlog/auditlog-report.md +0 -61
- package/docs/docs/cmd/tenant/service/service-list.md +0 -25
- package/docs/docs/cmd/tenant/service/service-message-list.md +0 -34
- package/docs/docs/cmd/tenant/service/service-report-historicalservicestatus.md +0 -38
- package/docs/docs/cmd/tenant/status/status-list.md +0 -34
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const utils_1 = require("../../../../utils");
|
|
5
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class SpoSiteRecycleBinItemRestoreCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.SITE_RECYCLEBINITEM_RESTORE;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Restores given items from the site recycle bin';
|
|
13
|
+
}
|
|
14
|
+
commandAction(logger, args, cb) {
|
|
15
|
+
if (this.verbose) {
|
|
16
|
+
logger.logToStderr(`Restoring items from recycle bin at ${args.options.siteUrl}...`);
|
|
17
|
+
}
|
|
18
|
+
const requestUrl = `${args.options.siteUrl}/_api/site/RecycleBin/RestoreByIds`;
|
|
19
|
+
const ids = utils_1.formatting.splitAndTrim(args.options.ids);
|
|
20
|
+
const idsChunks = [];
|
|
21
|
+
while (ids.length) {
|
|
22
|
+
idsChunks.push(ids.splice(0, 20));
|
|
23
|
+
}
|
|
24
|
+
Promise.all(idsChunks.map((idsChunk) => {
|
|
25
|
+
const requestOptions = {
|
|
26
|
+
url: requestUrl,
|
|
27
|
+
headers: {
|
|
28
|
+
'accept': 'application/json;odata=nometadata',
|
|
29
|
+
'content-type': 'application/json'
|
|
30
|
+
},
|
|
31
|
+
responseType: 'json',
|
|
32
|
+
data: {
|
|
33
|
+
ids: idsChunk
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return request_1.default.post(requestOptions);
|
|
37
|
+
})).then(_ => cb(), (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
|
|
38
|
+
}
|
|
39
|
+
options() {
|
|
40
|
+
const options = [
|
|
41
|
+
{
|
|
42
|
+
option: '-u, --siteUrl <siteUrl>'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
option: '-i, --ids <ids>'
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
const parentOptions = super.options();
|
|
49
|
+
return options.concat(parentOptions);
|
|
50
|
+
}
|
|
51
|
+
validate(args) {
|
|
52
|
+
const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.siteUrl);
|
|
53
|
+
if (isValidSharePointUrl !== true) {
|
|
54
|
+
return isValidSharePointUrl;
|
|
55
|
+
}
|
|
56
|
+
const invalidIds = utils_1.formatting
|
|
57
|
+
.splitAndTrim(args.options.ids)
|
|
58
|
+
.filter(id => !utils_1.validation.isValidGuid(id));
|
|
59
|
+
if (invalidIds.length > 0) {
|
|
60
|
+
return `The following IDs are invalid: ${invalidIds.join(', ')}`;
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
module.exports = new SpoSiteRecycleBinItemRestoreCommand();
|
|
66
|
+
//# sourceMappingURL=site-recyclebinitem-restore.js.map
|
|
@@ -185,6 +185,7 @@ exports.default = {
|
|
|
185
185
|
SITE_LIST: `${prefix} site list`,
|
|
186
186
|
SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
|
|
187
187
|
SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
|
|
188
|
+
SITE_RECYCLEBINITEM_RESTORE: `${prefix} site recyclebinitem restore`,
|
|
188
189
|
SITE_REMOVE: `${prefix} site remove`,
|
|
189
190
|
SITE_RENAME: `${prefix} site rename`,
|
|
190
191
|
SITE_SET: `${prefix} site set`,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const prefix = 'tenant';
|
|
4
4
|
exports.default = {
|
|
5
|
-
AUDITLOG_REPORT: `${prefix} auditlog report`,
|
|
6
5
|
ID_GET: `${prefix} id get`,
|
|
7
6
|
REPORT_ACTIVEUSERCOUNTS: `${prefix} report activeusercounts`,
|
|
8
7
|
REPORT_ACTIVEUSERDETAIL: `${prefix} report activeuserdetail`,
|
|
@@ -11,14 +10,10 @@ exports.default = {
|
|
|
11
10
|
REPORT_OFFICE365ACTIVATIONSUSERCOUNTS: `${prefix} report office365activationsusercounts`,
|
|
12
11
|
REPORT_SERVICESUSERCOUNTS: `${prefix} report servicesusercounts`,
|
|
13
12
|
SERVICEANNOUNCEMENT_HEALTHISSUE_GET: `${prefix} serviceannouncement healthissue get`,
|
|
14
|
-
SERVICE_LIST: `${prefix} service list`,
|
|
15
|
-
SERVICE_MESSAGE_LIST: `${prefix} service message list`,
|
|
16
|
-
SERVICE_REPORT_HISTORICALSERVICESTATUS: `${prefix} service report historicalservicestatus`,
|
|
17
13
|
SERVICEANNOUNCEMENT_HEALTH_GET: `${prefix} serviceannouncement health get`,
|
|
18
14
|
SERVICEANNOUNCEMENT_HEALTH_LIST: `${prefix} serviceannouncement health list`,
|
|
19
15
|
SERVICEANNOUNCEMENT_HEALTHISSUE_LIST: `${prefix} serviceannouncement healthissue list`,
|
|
20
16
|
SERVICEANNOUNCEMENT_MESSAGE_GET: `${prefix} serviceannouncement message get`,
|
|
21
|
-
SERVICEANNOUNCEMENT_MESSAGE_LIST: `${prefix} serviceannouncement message list
|
|
22
|
-
STATUS_LIST: `${prefix} status list`
|
|
17
|
+
SERVICEANNOUNCEMENT_MESSAGE_LIST: `${prefix} serviceannouncement message list`
|
|
23
18
|
};
|
|
24
19
|
//# sourceMappingURL=commands.js.map
|
package/dist/utils/formatting.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
# aad app
|
|
1
|
+
# aad app remove
|
|
2
2
|
|
|
3
3
|
Removes an Azure AD app registration
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad app remove [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Alias
|
|
12
|
+
|
|
7
13
|
```sh
|
|
8
14
|
m365 aad app delete [options]
|
|
9
15
|
```
|
|
@@ -20,32 +26,32 @@ m365 aad app delete [options]
|
|
|
20
26
|
: Name of the Azure AD application registration to remove. Specify either `appId`, `objectId` or `name`
|
|
21
27
|
|
|
22
28
|
`--confirm`:
|
|
23
|
-
: Don't prompt for confirmation to
|
|
29
|
+
: Don't prompt for confirmation to remove the app
|
|
24
30
|
|
|
25
31
|
--8<-- "docs/cmd/_global.md"
|
|
26
32
|
|
|
27
33
|
## Remarks
|
|
28
34
|
|
|
29
|
-
For best performance use the `objectId` option to reference the Azure AD application registration to
|
|
35
|
+
For best performance use the `objectId` option to reference the Azure AD application registration to remove. If you use `appId` or `name`, this command will first need to find the corresponding object ID for that application.
|
|
30
36
|
|
|
31
37
|
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.
|
|
32
38
|
|
|
33
39
|
## Examples
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
Remove the Azure AD application registration by its app (client) ID
|
|
36
42
|
|
|
37
43
|
```sh
|
|
38
|
-
m365 aad app
|
|
44
|
+
m365 aad app remove --appId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
39
45
|
```
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
Remove the Azure AD application registration by its object ID
|
|
42
48
|
|
|
43
49
|
```sh
|
|
44
|
-
m365 aad app
|
|
50
|
+
m365 aad app remove --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
45
51
|
```
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
Remove the Azure AD application registration by its name. Will NOT prompt for confirmation before deleting.
|
|
48
54
|
|
|
49
55
|
```sh
|
|
50
|
-
m365 aad app
|
|
56
|
+
m365 aad app remove --name "My app" --confirm
|
|
51
57
|
```
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
# aad app role
|
|
1
|
+
# aad app role remove
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Removes role from the specified Azure AD app registration
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad app role remove [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Alias
|
|
12
|
+
|
|
7
13
|
```sh
|
|
8
14
|
m365 aad app role delete [options]
|
|
9
15
|
```
|
|
@@ -11,60 +17,60 @@ m365 aad app role delete [options]
|
|
|
11
17
|
## Options
|
|
12
18
|
|
|
13
19
|
`--appId [appId]`
|
|
14
|
-
: Application (client) ID of the Azure AD application registration from which role should be
|
|
20
|
+
: Application (client) ID of the Azure AD application registration from which role should be removed. Specify either `appId`, `appObjectId` or `appName`
|
|
15
21
|
|
|
16
22
|
`--appObjectId [appObjectId]`
|
|
17
|
-
: Object ID of the Azure AD application registration from which role should be
|
|
23
|
+
: Object ID of the Azure AD application registration from which role should be removed. Specify either `appId`, `appObjectId` or `appName`
|
|
18
24
|
|
|
19
25
|
`--appName [appName]`
|
|
20
|
-
: Name of the Azure AD application registration from which role should be
|
|
26
|
+
: Name of the Azure AD application registration from which role should be removed. Specify either `appId`, `appObjectId` or `appName`
|
|
21
27
|
|
|
22
28
|
`-n, --name [name]`
|
|
23
|
-
: Name of the role to
|
|
29
|
+
: Name of the role to remove. Specify either `name`, `id` or `claim`
|
|
24
30
|
|
|
25
31
|
`-i, --id [id]`
|
|
26
|
-
: Id of the role to
|
|
32
|
+
: Id of the role to remove. Specify either `name`, `id` or `claim`
|
|
27
33
|
|
|
28
34
|
`-c, --claim [claim]`
|
|
29
|
-
: Claim value of the role to
|
|
35
|
+
: Claim value of the role to remove. Specify either `name`, `id` or `claim`
|
|
30
36
|
|
|
31
37
|
`--confirm`
|
|
32
|
-
: Don't prompt for confirmation to
|
|
38
|
+
: Don't prompt for confirmation to remove the role.
|
|
33
39
|
|
|
34
40
|
--8<-- "docs/cmd/_global.md"
|
|
35
41
|
|
|
36
42
|
## Remarks
|
|
37
43
|
|
|
38
|
-
For best performance use the `appObjectId` option to reference the Azure AD application registration from which to
|
|
44
|
+
For best performance use the `appObjectId` option to reference the Azure AD application registration from which to remove the role. If you use `appId` or `appName`, this command will first need to find the corresponding object ID for that application.
|
|
39
45
|
|
|
40
46
|
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.
|
|
41
47
|
|
|
42
48
|
If the command finds multiple roles with the specified role name, it will prompt you to disambiguate which role it should use, listing the claim values.
|
|
43
49
|
|
|
44
|
-
If the role to be
|
|
50
|
+
If the role to be removed is 'Enabled', this command will disable the role first and then remove.
|
|
45
51
|
|
|
46
52
|
## Examples
|
|
47
53
|
|
|
48
|
-
|
|
54
|
+
Remove role from a Azure AD application registration using object ID and role name options. Will prompt for confirmation before deleting the role.
|
|
49
55
|
|
|
50
56
|
```sh
|
|
51
|
-
m365 aad app role
|
|
57
|
+
m365 aad app role remove --appObjectId d75be2e1-0204-4f95-857d-51a37cf40be8 --name "Get Product"
|
|
52
58
|
```
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
Remove role from a Azure AD application registration using app (client) ID and role claim options. Will prompt for confirmation before deleting the role.
|
|
55
61
|
|
|
56
62
|
```sh
|
|
57
|
-
m365 aad app role
|
|
63
|
+
m365 aad app role remove --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --claim "Product.Get"
|
|
58
64
|
```
|
|
59
65
|
|
|
60
|
-
|
|
66
|
+
Remove role from a Azure AD application registration using app name and role claim options. Will prompt for confirmation before deleting the role.
|
|
61
67
|
|
|
62
68
|
```sh
|
|
63
|
-
m365 aad app role
|
|
69
|
+
m365 aad app role remove --appName "My app" --claim "Product.Get"
|
|
64
70
|
```
|
|
65
71
|
|
|
66
|
-
|
|
72
|
+
Remove role from a Azure AD application registration using object ID and role id options. Will NOT prompt for confirmation before deleting the role.
|
|
67
73
|
|
|
68
74
|
```sh
|
|
69
|
-
m365 aad app role
|
|
75
|
+
m365 aad app role remove --appObjectId d75be2e1-0204-4f95-857d-51a37cf40be8 --id 15927ce6-1933-4b2f-b029-4dee3d53f4dd --confirm
|
|
70
76
|
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# pp managementapp add
|
|
2
|
+
|
|
3
|
+
Register management application for Power Platform
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 pp managementapp add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--appId [appId]`
|
|
14
|
+
: Application (client) ID of the Azure AD application registration to register as a management app. Specify either `appId`, `objectId` or `name`
|
|
15
|
+
|
|
16
|
+
`--objectId [objectId]`
|
|
17
|
+
: Object ID of the Azure AD application registration to register as a management app. Specify either `appId`, `objectId` or `name`
|
|
18
|
+
|
|
19
|
+
`--name [name]`
|
|
20
|
+
: Name of the Azure AD application registration to register as a management app. Specify either `appId`, `objectId` or `name`
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
To execute this command the first time you'll need sign in using the Microsoft Azure PowerShell app registration. You can do this by executing `m365 login --appId 1950a258-227b-4e31-a9cf-717495945fc2`. To register the Azure AD app registration that CLI for Microsoft 365 uses by default, execute `m365 pp managementapp add--appId 31359c7f-bd7e-475c-86db-fdb8c937548e`.
|
|
27
|
+
|
|
28
|
+
For best performance use the `appId` option to reference the Azure AD application registration to update. If you use `objectId` or `name`, this command will first need to find the corresponding `appId` for that application.
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
## Examples
|
|
33
|
+
|
|
34
|
+
Register CLI for Microsoft 365 as a management application for the Power Platform
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
m365 pp managementapp add --appId 31359c7f-bd7e-475c-86db-fdb8c937548e
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Register Azure AD application with the specified object ID as a management application for the Power Platform
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
m365 pp managementapp add --objectId d75be2e1-0204-4f95-857d-51a37cf40be8
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Register Azure AD application named _My app_ as a management application for the Power Platform
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
m365 pp managementapp add --name "My app"
|
|
50
|
+
```
|
|
@@ -32,7 +32,7 @@ m365 spfx project upgrade [options]
|
|
|
32
32
|
|
|
33
33
|
## Remarks
|
|
34
34
|
|
|
35
|
-
The `spfx project upgrade` command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.14.0).
|
|
35
|
+
The `spfx project upgrade` command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.14.0). If you specify the `preview` option without a specific version, the command will upgrade your project to the latest preview version v1.15.0-beta.1.
|
|
36
36
|
|
|
37
37
|
This command doesn't change your project files. Instead, it gives you a report with all steps necessary to upgrade your project to the specified version of the SharePoint Framework. Changing project files is error-prone, especially when it comes to updating your solution's code. This is why at this moment, this command produces a report that you can use yourself to perform the necessary updates and verify that everything is working as expected.
|
|
38
38
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# spo site recyclebinitem restore
|
|
2
|
+
|
|
3
|
+
Restores given items from the site recycle bin
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 spo site recyclebinitem restore [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-u, --siteUrl <siteUrl>`
|
|
14
|
+
: URL of the site for which to restore the recycle bin items
|
|
15
|
+
|
|
16
|
+
`-i, --ids <ids>`
|
|
17
|
+
: List of ids of items which will be restored from the site recycle bin
|
|
18
|
+
|
|
19
|
+
--8<-- "docs/cmd/_global.md"
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
Restore specific items by given ids from recycle bin for site _https://contoso.sharepoint.com/site_
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
m365 spo site recyclebinitem restore --siteUrl https://contoso.sharepoint.com/site --ids "ae6f97a7-280e-48d6-b481-0ea986c323da,aadbf916-1f71-42ee-abf2-8ee4802ae291"
|
|
27
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "5.1.0-beta.
|
|
3
|
+
"version": "5.1.0-beta.9b2f51d",
|
|
4
4
|
"description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/api.js",
|
|
@@ -107,9 +107,10 @@
|
|
|
107
107
|
"Georgiev, Velin <velin.georgiev@gmail.com>",
|
|
108
108
|
"Ghuge, Pramod <pramod7@gmail.com>",
|
|
109
109
|
"Gölles, Thomas <thomy@outlook.at>",
|
|
110
|
-
"Hagström, Joakim <
|
|
110
|
+
"Hagström, Joakim <johags@johags-sb2.localdomain>",
|
|
111
111
|
"Harding, Phil <pil.harding@platinumdogs.co.uk>",
|
|
112
112
|
"Hawrylak, Paweł <phawrylak@outlook.com>",
|
|
113
|
+
"Holemans, Milan <Milan.Holemans@vanroey.be>",
|
|
113
114
|
"Högberg, Joakim <joakim.hogberg@bravero.se>",
|
|
114
115
|
"Hvam, Allan <ahp@delegate.dk>",
|
|
115
116
|
"Jaakke, Robert <robert.jaakke@mavention.nl>",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FN015006_FILE_editorconfig = void 0;
|
|
4
|
-
const FileAddRemoveRule_1 = require("./FileAddRemoveRule");
|
|
5
|
-
class FN015006_FILE_editorconfig extends FileAddRemoveRule_1.FileAddRemoveRule {
|
|
6
|
-
constructor(add) {
|
|
7
|
-
super('.editorconfig', add);
|
|
8
|
-
}
|
|
9
|
-
get id() {
|
|
10
|
-
return 'FN015006';
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.FN015006_FILE_editorconfig = FN015006_FILE_editorconfig;
|
|
14
|
-
//# sourceMappingURL=FN015006_FILE_editorconfig.js.map
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const Auth_1 = require("../../../../Auth");
|
|
4
|
-
const Command_1 = require("../../../../Command");
|
|
5
|
-
const request_1 = require("../../../../request");
|
|
6
|
-
const utils_1 = require("../../../../utils");
|
|
7
|
-
const commands_1 = require("../../commands");
|
|
8
|
-
var AuditContentTypes;
|
|
9
|
-
(function (AuditContentTypes) {
|
|
10
|
-
AuditContentTypes["AzureActiveDirectory"] = "Audit.AzureActiveDirectory";
|
|
11
|
-
AuditContentTypes["Exchange"] = "Audit.Exchange";
|
|
12
|
-
AuditContentTypes["SharePoint"] = "Audit.SharePoint";
|
|
13
|
-
AuditContentTypes["General"] = "Audit.General";
|
|
14
|
-
AuditContentTypes["DLP"] = "DLP.All";
|
|
15
|
-
})(AuditContentTypes || (AuditContentTypes = {}));
|
|
16
|
-
class TenantAuditlogReportCommand extends Command_1.default {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.serviceUrl = 'https://manage.office.com/api/v1.0';
|
|
20
|
-
this.completeAuditReports = [];
|
|
21
|
-
}
|
|
22
|
-
get name() {
|
|
23
|
-
return commands_1.default.AUDITLOG_REPORT;
|
|
24
|
-
}
|
|
25
|
-
get description() {
|
|
26
|
-
return 'Gets audit logs from the Office 365 Management API';
|
|
27
|
-
}
|
|
28
|
-
getTelemetryProperties(args) {
|
|
29
|
-
const telemetryProps = super.getTelemetryProperties(args);
|
|
30
|
-
telemetryProps.startTime = typeof args.options.startTime !== 'undefined';
|
|
31
|
-
telemetryProps.endTime = typeof args.options.endTime !== 'undefined';
|
|
32
|
-
telemetryProps.contentType = args.options.contentType;
|
|
33
|
-
return telemetryProps;
|
|
34
|
-
}
|
|
35
|
-
defaultProperties() {
|
|
36
|
-
return ['CreationTime', 'Operation', 'ClientIP', 'UserId', 'Workload'];
|
|
37
|
-
}
|
|
38
|
-
commandAction(logger, args, cb) {
|
|
39
|
-
if (this.verbose) {
|
|
40
|
-
logger.logToStderr(`Start retrieving Audit Log Report`);
|
|
41
|
-
}
|
|
42
|
-
this.tenantId = utils_1.accessToken.getTenantIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken);
|
|
43
|
-
this
|
|
44
|
-
.getCompleteAuditReports(args, logger)
|
|
45
|
-
.then((res) => {
|
|
46
|
-
logger.log(res);
|
|
47
|
-
cb();
|
|
48
|
-
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
49
|
-
}
|
|
50
|
-
getCompleteAuditReports(args, logger) {
|
|
51
|
-
return this
|
|
52
|
-
.startContentSubscriptionIfNotActive(args, logger)
|
|
53
|
-
.then(() => this.getAuditContentList(args, logger))
|
|
54
|
-
.then((auditContentLists) => this.getBatchedPromises(auditContentLists, 10))
|
|
55
|
-
.then((batchedPromise) => {
|
|
56
|
-
return new Promise((resolve, reject) => {
|
|
57
|
-
if (batchedPromise.length > 0) {
|
|
58
|
-
this.getBatchedAuditlogData(logger, batchedPromise, 0, resolve, reject);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
resolve();
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
})
|
|
65
|
-
.then(_ => this.completeAuditReports);
|
|
66
|
-
}
|
|
67
|
-
startContentSubscriptionIfNotActive(args, logger) {
|
|
68
|
-
if (this.verbose) {
|
|
69
|
-
logger.logToStderr(`Checking if subscription is active...`);
|
|
70
|
-
}
|
|
71
|
-
const subscriptionListEndpoint = 'activity/feed/subscriptions/list';
|
|
72
|
-
const requestOptions = {
|
|
73
|
-
url: `${this.serviceUrl}/${this.tenantId}/${subscriptionListEndpoint}`,
|
|
74
|
-
headers: {
|
|
75
|
-
accept: 'application/json;odata.metadata=none'
|
|
76
|
-
},
|
|
77
|
-
responseType: 'json'
|
|
78
|
-
};
|
|
79
|
-
return request_1.default
|
|
80
|
-
.get(requestOptions)
|
|
81
|
-
.then((subscriptionLists) => {
|
|
82
|
-
return subscriptionLists.some(subscriptionList => subscriptionList.contentType === AuditContentTypes[args.options.contentType] &&
|
|
83
|
-
subscriptionList.status === 'enabled');
|
|
84
|
-
})
|
|
85
|
-
.then((hasActiveSubscription) => {
|
|
86
|
-
if (hasActiveSubscription) {
|
|
87
|
-
return Promise.resolve();
|
|
88
|
-
}
|
|
89
|
-
if (this.verbose) {
|
|
90
|
-
logger.logToStderr(`Starting subscription since subscription is not active for the content type`);
|
|
91
|
-
}
|
|
92
|
-
const startSubscriptionEndPoint = `activity/feed/subscriptions/start?contentType=${AuditContentTypes[args.options.contentType]}&PublisherIdentifier=${this.tenantId}`;
|
|
93
|
-
const requestOptions = {
|
|
94
|
-
url: `${this.serviceUrl}/${this.tenantId}/${startSubscriptionEndPoint}`,
|
|
95
|
-
headers: {
|
|
96
|
-
accept: 'application/json;odata.metadata=none'
|
|
97
|
-
},
|
|
98
|
-
responseType: 'json'
|
|
99
|
-
};
|
|
100
|
-
return request_1.default.post(requestOptions);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
getAuditContentList(args, logger) {
|
|
104
|
-
if (this.verbose) {
|
|
105
|
-
logger.logToStderr(`Start listing Audit Content URL`);
|
|
106
|
-
}
|
|
107
|
-
let subscriptionListEndpoint = `activity/feed/subscriptions/content?contentType=${AuditContentTypes[args.options.contentType]}&PublisherIdentifier=${this.tenantId}`;
|
|
108
|
-
if (typeof args.options.startTime !== 'undefined') {
|
|
109
|
-
if (typeof args.options.endTime !== 'undefined') {
|
|
110
|
-
subscriptionListEndpoint += `&starttime=${escape(args.options.startTime)}&endTime=${escape(args.options.endTime)}`;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
const parsedEndDate = new Date(args.options.startTime);
|
|
114
|
-
parsedEndDate.setDate(parsedEndDate.getDate() + 1);
|
|
115
|
-
subscriptionListEndpoint += `&starttime=${escape(args.options.startTime)}&endTime=${escape(parsedEndDate.toISOString())}`;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
const requestOptions = {
|
|
119
|
-
url: `${this.serviceUrl}/${this.tenantId}/${subscriptionListEndpoint}`,
|
|
120
|
-
headers: {
|
|
121
|
-
accept: 'application/json;odata.metadata=none'
|
|
122
|
-
},
|
|
123
|
-
responseType: 'json'
|
|
124
|
-
};
|
|
125
|
-
return request_1.default.get(requestOptions);
|
|
126
|
-
}
|
|
127
|
-
getBatchedPromises(auditContentLists, batchSize) {
|
|
128
|
-
const batchedPromises = [];
|
|
129
|
-
for (let i = 0; i < auditContentLists.length; i += batchSize) {
|
|
130
|
-
const promiseRequestBatch = auditContentLists
|
|
131
|
-
.slice(i, i + batchSize < auditContentLists.length ? i + batchSize : auditContentLists.length)
|
|
132
|
-
.map((AuditContentList) => this.getAuditLogReportForSingleContentUrl(AuditContentList.contentUri));
|
|
133
|
-
batchedPromises.push(promiseRequestBatch);
|
|
134
|
-
}
|
|
135
|
-
return Promise.resolve(batchedPromises);
|
|
136
|
-
}
|
|
137
|
-
getBatchedAuditlogData(logger, batchedPromiseList, batchNumber, resolve, reject) {
|
|
138
|
-
if (this.verbose) {
|
|
139
|
-
logger.logToStderr(`Starting Batch : ${batchNumber}`);
|
|
140
|
-
}
|
|
141
|
-
Promise
|
|
142
|
-
.all(batchedPromiseList[batchNumber])
|
|
143
|
-
.then((data) => {
|
|
144
|
-
data.forEach(d1 => {
|
|
145
|
-
d1.forEach(d2 => {
|
|
146
|
-
this.completeAuditReports.push(d2);
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
if (batchNumber < batchedPromiseList.length - 1) {
|
|
150
|
-
this.getBatchedAuditlogData(logger, batchedPromiseList, ++batchNumber, resolve, reject);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
resolve();
|
|
154
|
-
}
|
|
155
|
-
}, (err) => reject(err));
|
|
156
|
-
}
|
|
157
|
-
getAuditLogReportForSingleContentUrl(auditURL) {
|
|
158
|
-
const requestOptions = {
|
|
159
|
-
url: auditURL,
|
|
160
|
-
headers: {
|
|
161
|
-
accept: 'application/json'
|
|
162
|
-
},
|
|
163
|
-
responseType: 'json'
|
|
164
|
-
};
|
|
165
|
-
return request_1.default.get(requestOptions);
|
|
166
|
-
}
|
|
167
|
-
get auditContentTypeLists() {
|
|
168
|
-
const result = [];
|
|
169
|
-
for (const auditContentType in AuditContentTypes) {
|
|
170
|
-
result.push(auditContentType);
|
|
171
|
-
}
|
|
172
|
-
return result;
|
|
173
|
-
}
|
|
174
|
-
options() {
|
|
175
|
-
const options = [
|
|
176
|
-
{
|
|
177
|
-
option: '-c, --contentType <contentType>',
|
|
178
|
-
autocomplete: this.auditContentTypeLists
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
option: '-s, --startTime [startTime]'
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
option: '-e, --endTime [endTime]'
|
|
185
|
-
}
|
|
186
|
-
];
|
|
187
|
-
const parentOptions = super.options();
|
|
188
|
-
return options.concat(parentOptions);
|
|
189
|
-
}
|
|
190
|
-
validate(args) {
|
|
191
|
-
if (AuditContentTypes[args.options.contentType] === undefined) {
|
|
192
|
-
return `${args.options.contentType} is not a valid value for the contentType option. Allowed values are ${this.auditContentTypeLists.join(' | ')}`;
|
|
193
|
-
}
|
|
194
|
-
if (args.options.startTime || args.options.endTime) {
|
|
195
|
-
if (!args.options.startTime) {
|
|
196
|
-
return `Please specify startTime`;
|
|
197
|
-
}
|
|
198
|
-
const parsedStartTime = Date.parse(args.options.startTime);
|
|
199
|
-
if (isNaN(parsedStartTime)) {
|
|
200
|
-
return `${args.options.startTime} is not a valid startTime. Provide the date in one of the following formats:
|
|
201
|
-
'YYYY-MM-DD'
|
|
202
|
-
'YYYY-MM-DDThh:mm'
|
|
203
|
-
'YYYY-MM-DDThh:mmZ'
|
|
204
|
-
'YYYY-MM-DDThh:mm±hh:mm'`;
|
|
205
|
-
}
|
|
206
|
-
const startdateTodayDifference = (new Date().getTime() - parsedStartTime) / (1000 * 60 * 60 * 24);
|
|
207
|
-
if (startdateTodayDifference > 7) {
|
|
208
|
-
return `Start time should be no more than 7 days in the past`;
|
|
209
|
-
}
|
|
210
|
-
if (args.options.endTime) {
|
|
211
|
-
const parsedEndTime = Date.parse(args.options.endTime);
|
|
212
|
-
if (isNaN(parsedEndTime)) {
|
|
213
|
-
return `${args.options.endTime} is not a valid endTime. Provide the date in one of the following formats:
|
|
214
|
-
'YYYY-MM-DD'
|
|
215
|
-
'YYYY-MM-DDThh:mm'
|
|
216
|
-
'YYYY-MM-DDThh:mmZ'
|
|
217
|
-
'YYYY-MM-DDThh:mm±hh:mm'`;
|
|
218
|
-
}
|
|
219
|
-
if (parsedStartTime && parsedEndTime) {
|
|
220
|
-
const startEndDateDifference = (parsedEndTime - parsedStartTime) / (1000 * 60 * 60 * 24);
|
|
221
|
-
if (startEndDateDifference < 0 || startEndDateDifference > 1) {
|
|
222
|
-
return `startTime and endTime must be less than or equal to 24 hours apart, with the start time prior to end time.`;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return true;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
module.exports = new TenantAuditlogReportCommand();
|
|
231
|
-
//# sourceMappingURL=auditlog-report.js.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const Auth_1 = require("../../../../Auth");
|
|
4
|
-
const Command_1 = require("../../../../Command");
|
|
5
|
-
const request_1 = require("../../../../request");
|
|
6
|
-
const utils_1 = require("../../../../utils");
|
|
7
|
-
const commands_1 = require("../../commands");
|
|
8
|
-
class TenantServiceListCommand extends Command_1.default {
|
|
9
|
-
get name() {
|
|
10
|
-
return commands_1.default.SERVICE_LIST;
|
|
11
|
-
}
|
|
12
|
-
get description() {
|
|
13
|
-
return 'Gets services available in Microsoft 365';
|
|
14
|
-
}
|
|
15
|
-
defaultProperties() {
|
|
16
|
-
return ['Id', 'DisplayName'];
|
|
17
|
-
}
|
|
18
|
-
commandAction(logger, args, cb) {
|
|
19
|
-
if (this.verbose) {
|
|
20
|
-
logger.logToStderr(`Getting the health status of the different services in Microsoft 365.`);
|
|
21
|
-
}
|
|
22
|
-
const serviceUrl = 'https://manage.office.com/api/v1.0';
|
|
23
|
-
const statusEndpoint = 'ServiceComms/Services';
|
|
24
|
-
const tenantId = utils_1.accessToken.getTenantIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken);
|
|
25
|
-
const requestOptions = {
|
|
26
|
-
url: `${serviceUrl}/${tenantId}/${statusEndpoint}`,
|
|
27
|
-
headers: {
|
|
28
|
-
accept: 'application/json;odata.metadata=none'
|
|
29
|
-
},
|
|
30
|
-
responseType: 'json'
|
|
31
|
-
};
|
|
32
|
-
request_1.default
|
|
33
|
-
.get(requestOptions)
|
|
34
|
-
.then((res) => {
|
|
35
|
-
logger.log(res.value);
|
|
36
|
-
cb();
|
|
37
|
-
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
module.exports = new TenantServiceListCommand();
|
|
41
|
-
//# sourceMappingURL=service-list.js.map
|