@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.
@@ -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`,
@@ -1,4 +1,4 @@
1
- # aad o365group restore
1
+ # aad o365group recyclebinitem restore
2
2
 
3
3
  Restores a deleted Microsoft 365 Group
4
4
 
@@ -78,4 +78,4 @@ Get all user's sign-ins filter by given user's Id and application identifier in
78
78
 
79
79
  ```sh
80
80
  m365 aad user signin list --userId '11111111-1111-1111-1111-111111111111' --appId '00000000-0000-0000-0000-000000000000'
81
- ```
81
+ ```
@@ -1,4 +1,4 @@
1
- # onerive report activityusercounts
1
+ # onedrive report activityusercounts
2
2
 
3
3
  Gets the trend in the number of active OneDrive users
4
4
 
@@ -21,4 +21,4 @@ Lists the checklist items of a Planner task.
21
21
 
22
22
  ```sh
23
23
  m365 planner task checklistitem list --taskId 'vzCcZoOv-U27PwydxHB8opcADJo-'
24
- ```
24
+ ```
@@ -42,4 +42,4 @@ Add a new reference with the url _https://www.microsoft.com_ and with the type E
42
42
 
43
43
  ```sh
44
44
  m365 planner task reference add --taskId "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --url "https://www.microsoft.com" --type "Excel"
45
- ```
45
+ ```
@@ -37,4 +37,4 @@ Removes external connection with name _Test_. Will NOT prompt for confirmation b
37
37
 
38
38
  ```sh
39
39
  m365 search externalconnection remove --name "Test" --confirm
40
- ```
40
+ ```
@@ -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
+ ```
@@ -54,4 +54,4 @@ Remove roleassignment from list by url based on principal Id
54
54
 
55
55
  ```sh
56
56
  m365 spo list roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl '/sites/contoso-sales/lists/Events' --principalId 2
57
- ```
57
+ ```
@@ -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
+ ```
@@ -21,4 +21,4 @@ Restore role inheritance of subsite _https://contoso.sharepoint.com/sites/projec
21
21
 
22
22
  ```sh
23
23
  m365 spo web roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x
24
- ```
24
+ ```
@@ -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)
@@ -58,4 +58,4 @@ Add private channel to the specified Microsoft Teams team with owner ID
58
58
 
59
59
  ```sh
60
60
  m365 teams channel add --teamId 6703ac8a-c49b-4fd4-8223-28f0ac3a6402 --name climicrosoft365 --type private --owner cc693a7d-4833-4911-a89a-f0fe6e49bf69
61
- ```
61
+ ```
@@ -48,4 +48,4 @@ Updates the role of the user with id 00000000-0000-0000-0000-000000000000 to mem
48
48
 
49
49
  ```sh
50
50
  m365 teams channel member set --teamName "Team Name" --channelName "Channel Name" --userId 00000000-0000-0000-0000-000000000000 --role member
51
- ```
51
+ ```
@@ -1,11 +1,11 @@
1
- # graph teams funsettings set
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 graph teams funsettings set [options]
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 graph teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowGiphy true --giphyContentRating Moderate
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 graph teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowGiphy false
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 graph teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowStickersAndMemes true
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 graph teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowCustomMemes false
53
+ m365 teams funsettings set --teamId 83cece1e-938d-44a1-8b86-918cf6151957 --allowCustomMemes false
54
54
  ```
@@ -27,4 +27,4 @@ Get security alerts for a vendor with name _Azure Sentinel_
27
27
 
28
28
  ```sh
29
29
  m365 tenant security alerts list --vendor "Azure Sentinel"
30
- ```
30
+ ```
@@ -1,4 +1,4 @@
1
- # tenant service announcement health get
1
+ # tenant serviceannouncement health get
2
2
 
3
3
  Get the health report of a specified service for a tenant
4
4
 
@@ -1,4 +1,4 @@
1
- # tenant service announcement health list
1
+ # tenant serviceannouncement health list
2
2
 
3
3
  Gets the health report of all subscribed services for a tenant
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.9.0-beta.5aade58",
3
+ "version": "5.9.0-beta.7a142b7",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",