@pnp/cli-microsoft365 5.9.0-beta.5aade58 → 5.9.0-beta.7a142b7
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/dist/m365/spo/commands/file/file-roleinheritance-reset.js +125 -0
- package/dist/m365/spo/commands.js +1 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +1 -1
- package/docs/docs/cmd/aad/user/user-signin-list.md +1 -1
- package/docs/docs/cmd/onedrive/report/report-activityusercounts.md +1 -1
- package/docs/docs/cmd/planner/task/task-checklistitem-list.md +1 -1
- package/docs/docs/cmd/planner/task/task-reference-add.md +1 -1
- package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.md +39 -0
- package/docs/docs/cmd/spo/list/list-roleassignment-add.md +1 -1
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +1 -1
- package/docs/docs/cmd/spo/roledefinition/roledefinition-add.md +1 -1
- package/docs/docs/cmd/spo/web/web-roleinheritance-reset.md +1 -1
- package/docs/docs/cmd/teams/cache/cache-remove.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-add.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-member-set.md +1 -1
- package/docs/docs/cmd/teams/funsettings/funsettings-set.md +6 -6
- package/docs/docs/cmd/tenant/security/security-alerts-list.md +1 -1
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +1 -1
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _SpoFileRoleInheritanceResetCommand_instances, _SpoFileRoleInheritanceResetCommand_initTelemetry, _SpoFileRoleInheritanceResetCommand_initOptions, _SpoFileRoleInheritanceResetCommand_initValidators, _SpoFileRoleInheritanceResetCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
22
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
23
|
+
const commands_1 = require("../../commands");
|
|
24
|
+
const SpoFileGetCommand = require("./file-get");
|
|
25
|
+
class SpoFileRoleInheritanceResetCommand extends SpoCommand_1.default {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
_SpoFileRoleInheritanceResetCommand_instances.add(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initTelemetry).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initOptions).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initValidators).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initOptionSets).call(this);
|
|
33
|
+
}
|
|
34
|
+
get name() {
|
|
35
|
+
return commands_1.default.FILE_ROLEINHERITANCE_RESET;
|
|
36
|
+
}
|
|
37
|
+
get description() {
|
|
38
|
+
return 'Restores the role inheritance of a file';
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const resetFileRoleInheritance = () => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
const fileURL = yield this.getFileURL(args);
|
|
45
|
+
const requestOptions = {
|
|
46
|
+
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativeUrl('${formatting_1.formatting.encodeQueryParameter(fileURL)}')/ListItemAllFields/resetroleinheritance`,
|
|
47
|
+
headers: {
|
|
48
|
+
accept: 'application/json;odata.metadata=none'
|
|
49
|
+
},
|
|
50
|
+
responseType: 'json'
|
|
51
|
+
};
|
|
52
|
+
yield request_1.default.post(requestOptions);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
this.handleRejectedODataJsonPromise(err);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
if (args.options.confirm) {
|
|
59
|
+
yield resetFileRoleInheritance();
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const result = yield Cli_1.Cli.prompt({
|
|
63
|
+
type: 'confirm',
|
|
64
|
+
name: 'continue',
|
|
65
|
+
default: false,
|
|
66
|
+
message: `Are you sure you want to reset the role inheritance of file ${args.options.fileUrl || args.options.fileId} located in site ${args.options.webUrl}?`
|
|
67
|
+
});
|
|
68
|
+
if (result.continue) {
|
|
69
|
+
yield resetFileRoleInheritance();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
getFileURL(args) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
if (args.options.fileUrl) {
|
|
77
|
+
return args.options.fileUrl;
|
|
78
|
+
}
|
|
79
|
+
const options = {
|
|
80
|
+
webUrl: args.options.webUrl,
|
|
81
|
+
id: args.options.fileId,
|
|
82
|
+
output: 'json',
|
|
83
|
+
debug: this.debug,
|
|
84
|
+
verbose: this.verbose
|
|
85
|
+
};
|
|
86
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(SpoFileGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
87
|
+
const getFileOutput = JSON.parse(output.stdout);
|
|
88
|
+
return getFileOutput.ServerRelativeUrl;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
_SpoFileRoleInheritanceResetCommand_instances = new WeakSet(), _SpoFileRoleInheritanceResetCommand_initTelemetry = function _SpoFileRoleInheritanceResetCommand_initTelemetry() {
|
|
93
|
+
this.telemetry.push((args) => {
|
|
94
|
+
Object.assign(this.telemetryProperties, {
|
|
95
|
+
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
96
|
+
fileId: typeof args.options.fileId !== 'undefined',
|
|
97
|
+
confirm: !!args.options.confirm
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}, _SpoFileRoleInheritanceResetCommand_initOptions = function _SpoFileRoleInheritanceResetCommand_initOptions() {
|
|
101
|
+
this.options.unshift({
|
|
102
|
+
option: '-u, --webUrl <webUrl>'
|
|
103
|
+
}, {
|
|
104
|
+
option: '--fileUrl [fileUrl]'
|
|
105
|
+
}, {
|
|
106
|
+
option: 'i, --fileId [fileId]'
|
|
107
|
+
}, {
|
|
108
|
+
option: '--confirm'
|
|
109
|
+
});
|
|
110
|
+
}, _SpoFileRoleInheritanceResetCommand_initValidators = function _SpoFileRoleInheritanceResetCommand_initValidators() {
|
|
111
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
113
|
+
if (isValidSharePointUrl !== true) {
|
|
114
|
+
return isValidSharePointUrl;
|
|
115
|
+
}
|
|
116
|
+
if (args.options.fileId && !validation_1.validation.isValidGuid(args.options.fileId)) {
|
|
117
|
+
return `${args.options.fileId} is not a valid GUID`;
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
}));
|
|
121
|
+
}, _SpoFileRoleInheritanceResetCommand_initOptionSets = function _SpoFileRoleInheritanceResetCommand_initOptionSets() {
|
|
122
|
+
this.optionSets.push(['fileId', 'fileUrl']);
|
|
123
|
+
};
|
|
124
|
+
module.exports = new SpoFileRoleInheritanceResetCommand();
|
|
125
|
+
//# sourceMappingURL=file-roleinheritance-reset.js.map
|
|
@@ -56,6 +56,7 @@ exports.default = {
|
|
|
56
56
|
FILE_MOVE: `${prefix} file move`,
|
|
57
57
|
FILE_REMOVE: `${prefix} file remove`,
|
|
58
58
|
FILE_RENAME: `${prefix} file rename`,
|
|
59
|
+
FILE_ROLEINHERITANCE_RESET: `${prefix} file roleinheritance reset`,
|
|
59
60
|
FILE_SHARINGINFO_GET: `${prefix} file sharinginfo get`,
|
|
60
61
|
FOLDER_ADD: `${prefix} folder add`,
|
|
61
62
|
FOLDER_COPY: `${prefix} folder copy`,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# spo file roleinheritance reset
|
|
2
|
+
|
|
3
|
+
Restores the role inheritance of a file
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 spo file roleinheritance reset [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-u, --webUrl <webUrl>`
|
|
14
|
+
: URL of the site where the file is located
|
|
15
|
+
|
|
16
|
+
`--fileUrl [fileUrl]`
|
|
17
|
+
: The server-relative URL of the file to retrieve. Specify either `fileUrl` or `fileId` but not both
|
|
18
|
+
|
|
19
|
+
`i, --fileId [fileId]`
|
|
20
|
+
: The UniqueId (GUID) of the file to retrieve. Specify either `fileUrl` or `fileId` but not both
|
|
21
|
+
|
|
22
|
+
`--confirm`
|
|
23
|
+
: Don't prompt for confirmation
|
|
24
|
+
|
|
25
|
+
--8<-- "docs/cmd/_global.md"
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
Reset inheritance of file with id (UniqueId) _b2307a39-e878-458b-bc90-03bc578531d6_ located in site _https://contoso.sharepoint.com/sites/project-x_
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
m365 spo file roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileId "b2307a39-e878-458b-bc90-03bc578531d6"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Reset inheritance of file with server-relative url _/sites/project-x/documents/Test1_.docx located in site _https://contoso.sharepoint.com/sites/project-x_. It will **not** prompt for confirmation before resetting.
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
m365 spo file roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileUrl "/sites/project-x/documents/Test1.docx" --confirm
|
|
39
|
+
```
|
|
@@ -75,4 +75,4 @@ add role assignment to list _someList_ located in site _https://contoso.sharepoi
|
|
|
75
75
|
|
|
76
76
|
```sh
|
|
77
77
|
m365 spo list roleassignment add --webUrl "https://contoso.sharepoint.com/sites/project-x" --listTitle "someList" --principalId 11 --roleDefinitionName "Full Control"
|
|
78
|
-
```
|
|
78
|
+
```
|
|
@@ -64,4 +64,4 @@ Remove roleassignment from listitem getting list by url based on principal Id wi
|
|
|
64
64
|
|
|
65
65
|
```sh
|
|
66
66
|
m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl '/sites/contoso-sales/lists/Events' --listItemId 1 --principalId 2 --confirm
|
|
67
|
-
```
|
|
67
|
+
```
|
|
@@ -40,4 +40,4 @@ Adds the role definition for site _https://contoso.sharepoint.com/sites/project-
|
|
|
40
40
|
|
|
41
41
|
```sh
|
|
42
42
|
m365 spo roledefinition add --webUrl https://contoso.sharepoint.com/sites/project-x --name test --description "test description" --rights "ViewListItems,AddListItems,EditListItems,DeleteListItems"
|
|
43
|
-
```
|
|
43
|
+
```
|
|
@@ -43,4 +43,4 @@ m365 teams cache remove
|
|
|
43
43
|
|
|
44
44
|
## More information
|
|
45
45
|
|
|
46
|
-
- [Clear the Teams client cache guidance](https://docs.microsoft.com/microsoftteams/troubleshoot/teams-administration/clear-teams-cache)
|
|
46
|
+
- [Clear the Teams client cache guidance](https://docs.microsoft.com/microsoftteams/troubleshoot/teams-administration/clear-teams-cache)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# teams funsettings set
|
|
2
2
|
|
|
3
3
|
Updates fun settings of a Microsoft Teams team
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
m365
|
|
8
|
+
m365 teams funsettings set [options]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Options
|
|
@@ -32,23 +32,23 @@ m365 graph teams funsettings set [options]
|
|
|
32
32
|
Allow giphy usage within a given Microsoft Teams team, setting the content rating for giphy to Moderate
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
m365
|
|
35
|
+
m365 teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowGiphy true --giphyContentRating Moderate
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
Disable usage of giphy within a given Microsoft Teams team
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
m365
|
|
41
|
+
m365 teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowGiphy false
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Allow usage of stickers and memes within a given Microsoft Teams team
|
|
45
45
|
|
|
46
46
|
```sh
|
|
47
|
-
m365
|
|
47
|
+
m365 teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowStickersAndMemes true
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Disable usage custom memes within a given Microsoft Teams team
|
|
51
51
|
|
|
52
52
|
```sh
|
|
53
|
-
m365
|
|
53
|
+
m365 teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowCustomMemes false
|
|
54
54
|
```
|
package/package.json
CHANGED