@pnp/cli-microsoft365 5.9.0-beta.21a8d94 → 5.9.0-beta.5aade58
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/folder/folder-get.js +36 -6
- package/dist/m365/teams/commands/channel/channel-list.js +3 -3
- package/docs/docs/cmd/spo/folder/folder-get.md +13 -4
- package/docs/docs/cmd/spo/web/web-roleassignment-add.md +5 -5
- package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +5 -5
- package/docs/docs/cmd/teams/channel/channel-list.md +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _SpoFolderGetCommand_instances, _SpoFolderGetCommand_initOptions, _SpoFolderGetCommand_initValidators;
|
|
16
|
+
var _SpoFolderGetCommand_instances, _SpoFolderGetCommand_initTelemetry, _SpoFolderGetCommand_initOptions, _SpoFolderGetCommand_initValidators, _SpoFolderGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const Command_1 = require("../../../../Command");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
@@ -25,8 +25,10 @@ class SpoFolderGetCommand extends SpoCommand_1.default {
|
|
|
25
25
|
constructor() {
|
|
26
26
|
super();
|
|
27
27
|
_SpoFolderGetCommand_instances.add(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initTelemetry).call(this);
|
|
28
29
|
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initOptions).call(this);
|
|
29
30
|
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initValidators).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoFolderGetCommand_instances, "m", _SpoFolderGetCommand_initOptionSets).call(this);
|
|
30
32
|
}
|
|
31
33
|
get name() {
|
|
32
34
|
return commands_1.default.FOLDER_GET;
|
|
@@ -39,8 +41,14 @@ class SpoFolderGetCommand extends SpoCommand_1.default {
|
|
|
39
41
|
if (this.verbose) {
|
|
40
42
|
logger.logToStderr(`Retrieving folder from site ${args.options.webUrl}...`);
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
let requestUrl = '';
|
|
45
|
+
if (args.options.id) {
|
|
46
|
+
requestUrl = `${args.options.webUrl}/_api/web/GetFolderById('${encodeURIComponent(args.options.id)}')`;
|
|
47
|
+
}
|
|
48
|
+
else if (args.options.folderUrl) {
|
|
49
|
+
const serverRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.folderUrl);
|
|
50
|
+
requestUrl = `${args.options.webUrl}/_api/web/GetFolderByServerRelativeUrl('${encodeURIComponent(serverRelativeUrl)}')`;
|
|
51
|
+
}
|
|
44
52
|
const requestOptions = {
|
|
45
53
|
url: requestUrl,
|
|
46
54
|
headers: {
|
|
@@ -61,14 +69,36 @@ class SpoFolderGetCommand extends SpoCommand_1.default {
|
|
|
61
69
|
});
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
|
-
_SpoFolderGetCommand_instances = new WeakSet(),
|
|
72
|
+
_SpoFolderGetCommand_instances = new WeakSet(), _SpoFolderGetCommand_initTelemetry = function _SpoFolderGetCommand_initTelemetry() {
|
|
73
|
+
this.telemetry.push((args) => {
|
|
74
|
+
Object.assign(this.telemetryProperties, {
|
|
75
|
+
id: (!(!args.options.id)).toString(),
|
|
76
|
+
folderUrl: (!(!args.options.folderUrl)).toString()
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}, _SpoFolderGetCommand_initOptions = function _SpoFolderGetCommand_initOptions() {
|
|
65
80
|
this.options.unshift({
|
|
66
81
|
option: '-u, --webUrl <webUrl>'
|
|
67
82
|
}, {
|
|
68
|
-
option: '-f, --folderUrl
|
|
83
|
+
option: '-f, --folderUrl [folderUrl]'
|
|
84
|
+
}, {
|
|
85
|
+
option: '-i, --id [id]'
|
|
69
86
|
});
|
|
70
87
|
}, _SpoFolderGetCommand_initValidators = function _SpoFolderGetCommand_initValidators() {
|
|
71
|
-
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
90
|
+
if (isValidSharePointUrl !== true) {
|
|
91
|
+
return isValidSharePointUrl;
|
|
92
|
+
}
|
|
93
|
+
if (args.options.id) {
|
|
94
|
+
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
95
|
+
return `${args.options.id} is not a valid GUID`;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}));
|
|
100
|
+
}, _SpoFolderGetCommand_initOptionSets = function _SpoFolderGetCommand_initOptionSets() {
|
|
101
|
+
this.optionSets.push(['folderUrl', 'id']);
|
|
72
102
|
};
|
|
73
103
|
module.exports = new SpoFolderGetCommand();
|
|
74
104
|
//# sourceMappingURL=folder-get.js.map
|
|
@@ -82,15 +82,15 @@ _TeamsChannelListCommand_instances = new WeakSet(), _TeamsChannelListCommand_ini
|
|
|
82
82
|
option: '--teamName [teamName]'
|
|
83
83
|
}, {
|
|
84
84
|
option: '--type [type]',
|
|
85
|
-
autocomplete: ['standard', 'private']
|
|
85
|
+
autocomplete: ['standard', 'private', 'shared']
|
|
86
86
|
});
|
|
87
87
|
}, _TeamsChannelListCommand_initValidators = function _TeamsChannelListCommand_initValidators() {
|
|
88
88
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
89
89
|
if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
90
90
|
return `${args.options.teamId} is not a valid GUID`;
|
|
91
91
|
}
|
|
92
|
-
if (args.options.type && ['standard', 'private'].indexOf(args.options.type.toLowerCase()) === -1) {
|
|
93
|
-
return `${args.options.type} is not a valid type value. Allowed values standard|private`;
|
|
92
|
+
if (args.options.type && ['standard', 'private', 'shared'].indexOf(args.options.type.toLowerCase()) === -1) {
|
|
93
|
+
return `${args.options.type} is not a valid type value. Allowed values standard|private|shared`;
|
|
94
94
|
}
|
|
95
95
|
return true;
|
|
96
96
|
}));
|
|
@@ -13,8 +13,11 @@ m365 spo folder get [options]
|
|
|
13
13
|
`-u, --webUrl <webUrl>`
|
|
14
14
|
: The URL of the site where the folder is located
|
|
15
15
|
|
|
16
|
-
`-f, --folderUrl
|
|
17
|
-
:
|
|
16
|
+
`-f, --folderUrl [folderUrl]`
|
|
17
|
+
: The server-relative URL of the folder to retrieve. Specify either `folderUrl` or `id` but not both
|
|
18
|
+
|
|
19
|
+
`-i, --id [id]`
|
|
20
|
+
: The UniqueId (GUID) of the folder to retrieve. Specify either `folderUrl` or `id` but not both
|
|
18
21
|
|
|
19
22
|
--8<-- "docs/cmd/_global.md"
|
|
20
23
|
|
|
@@ -24,8 +27,14 @@ If no folder exists at the specified URL, you will get a `Please check the folde
|
|
|
24
27
|
|
|
25
28
|
## Examples
|
|
26
29
|
|
|
27
|
-
Get folder properties for folder with
|
|
30
|
+
Get folder properties for folder with server-relative url _'/Shared Documents'_ located in site _https://contoso.sharepoint.com/sites/project-x_
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
m365 spo folder get --webUrl https://contoso.sharepoint.com/sites/project-x --folderUrl "/Shared Documents"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Get folder properties for folder with id (UniqueId) _b2307a39-e878-458b-bc90-03bc578531d6_ located in site _https://contoso.sharepoint.com/sites/project-x_
|
|
28
37
|
|
|
29
38
|
```sh
|
|
30
|
-
m365 spo folder get --webUrl https://contoso.sharepoint.com/sites/project-x --
|
|
39
|
+
m365 spo folder get --webUrl https://contoso.sharepoint.com/sites/project-x --id "b2307a39-e878-458b-bc90-03bc578531d6"
|
|
31
40
|
```
|
|
@@ -35,23 +35,23 @@ m365 spo web roleassignment add [options]
|
|
|
35
35
|
add role assignment to site _https://contoso.sharepoint.com/sites/project-x_for principal id _11_ and role definition id _1073741829_
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
|
-
m365 spo
|
|
38
|
+
m365 spo web roleassignment add --webUrl "https://contoso.sharepoint.com/sites/project-x" --principalId 11 --roleDefinitionId 1073741829
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
add role assignment to site _https://contoso.sharepoint.com/sites/project-x_for upn _someaccount@tenant.onmicrosoft.com_ and role definition id _1073741829_
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
|
-
m365 spo
|
|
44
|
+
m365 spo web roleassignment add --webUrl "https://contoso.sharepoint.com/sites/project-x" --upn "someaccount@tenant.onmicrosoft.com" --roleDefinitionId 1073741829
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
add role assignment to site _https://contoso.sharepoint.com/sites/project-x_for group _someGroup_ and role definition id _1073741829_
|
|
48
48
|
|
|
49
49
|
```sh
|
|
50
|
-
m365 spo
|
|
50
|
+
m365 spo web roleassignment add --webUrl "https://contoso.sharepoint.com/sites/project-x" --groupName "someGroup" --roleDefinitionId 1073741829
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
add role assignment to site _https://contoso.sharepoint.com/sites/project-x_for principal id _11_ and role definition name _Full Control_
|
|
54
54
|
|
|
55
55
|
```sh
|
|
56
|
-
m365 spo
|
|
57
|
-
```
|
|
56
|
+
m365 spo web roleassignment add --webUrl "https://contoso.sharepoint.com/sites/project-x" --principalId 11 --roleDefinitionName "Full Control"
|
|
57
|
+
```
|
|
@@ -32,23 +32,23 @@ m365 spo web roleassignment remove [options]
|
|
|
32
32
|
Remove roleassignment from web based on group name
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
m365 spo
|
|
35
|
+
m365 spo web roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --groupName "saleGroup"
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
Remove roleassignment from web based on principal Id
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
m365 spo
|
|
41
|
+
m365 spo web roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --principalId 2
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
Remove roleassignment from web based on upn
|
|
45
45
|
|
|
46
46
|
```sh
|
|
47
|
-
m365 spo
|
|
47
|
+
m365 spo web roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --upn "someaccount@tenant.onmicrosoft.com"
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Remove roleassignment from web based on principal Id without prompting for confirmation
|
|
51
51
|
|
|
52
52
|
```sh
|
|
53
|
-
m365 spo
|
|
54
|
-
```
|
|
53
|
+
m365 spo web roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --principalId 2 --confirm
|
|
54
|
+
```
|
|
@@ -17,7 +17,7 @@ m365 teams channel list [options]
|
|
|
17
17
|
: The display name of the team to list the channels of. Specify either `teamId` or `teamName` but not both
|
|
18
18
|
|
|
19
19
|
`--type [type]`
|
|
20
|
-
: Filter the results to only channels of a given type: `standard
|
|
20
|
+
: Filter the results to only channels of a given type: `standard`, `private`, `shared`. By default all channels are listed.
|
|
21
21
|
|
|
22
22
|
--8<-- "docs/cmd/_global.md"
|
|
23
23
|
|
package/package.json
CHANGED