@pnp/cli-microsoft365 5.3.0-beta.1ed1aa2 → 5.3.0-beta.421b58b
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/Auth.js +5 -0
- package/dist/m365/aad/commands/app/app-add.js +91 -35
- package/dist/m365/aad/commands/app/app-role-list.js +1 -1
- package/dist/m365/aad/commands/app/app-set.js +91 -0
- package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +55 -22
- package/dist/m365/aad/commands/group/group-list.js +1 -1
- package/dist/m365/aad/commands/groupsetting/groupsetting-list.js +1 -1
- package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +1 -1
- package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +3 -3
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-list.js +1 -1
- package/dist/m365/aad/commands/o365group/o365group-user-list.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +2 -2
- package/dist/m365/aad/commands/user/user-list.js +1 -1
- package/dist/m365/aad/commands/user/user-signin-list.js +1 -1
- package/dist/m365/aad/commands.js +1 -1
- package/dist/m365/app/commands/app-open.js +64 -0
- package/dist/m365/app/commands.js +1 -0
- package/dist/m365/base/PowerBICommand.js +10 -0
- package/dist/m365/file/commands/file-list.js +1 -1
- package/dist/m365/outlook/commands/message/message-list.js +1 -1
- package/dist/m365/outlook/commands/room/room-list.js +1 -1
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +1 -1
- package/dist/m365/planner/commands/bucket/bucket-add.js +8 -16
- package/dist/m365/planner/commands/bucket/bucket-get.js +186 -0
- package/dist/m365/planner/commands/bucket/bucket-list.js +10 -19
- package/dist/m365/planner/commands/bucket/bucket-remove.js +202 -0
- package/dist/m365/planner/commands/bucket/bucket-set.js +9 -21
- package/dist/m365/planner/commands/plan/plan-add.js +6 -1
- package/dist/m365/planner/commands/plan/plan-details-get.js +12 -15
- package/dist/m365/planner/commands/plan/plan-get.js +13 -18
- package/dist/m365/planner/commands/plan/plan-list.js +10 -13
- package/dist/m365/planner/commands/task/task-add.js +8 -16
- package/dist/m365/planner/commands/task/task-details-get.js +6 -0
- package/dist/m365/planner/commands/task/task-get.js +138 -7
- package/dist/m365/planner/commands/task/task-list.js +15 -24
- package/dist/m365/planner/commands/task/task-reference-add.js +75 -0
- package/dist/m365/planner/commands/task/task-reference-list.js +45 -0
- package/dist/m365/planner/commands/task/task-set.js +9 -18
- package/dist/m365/planner/commands.js +5 -1
- package/dist/m365/pp/commands/gateway/gateway-list.js +36 -0
- package/dist/m365/pp/commands/managementapp/managementapp-list.js +1 -1
- package/dist/m365/pp/commands.js +1 -0
- package/dist/m365/spo/commands/field/field-list.js +84 -0
- package/dist/m365/spo/commands/list/list-roleinheritance-break.js +84 -0
- package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +76 -0
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +83 -0
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +79 -0
- package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +49 -0
- package/dist/m365/spo/commands.js +6 -0
- package/dist/m365/teams/commands/app/app-list.js +1 -1
- package/dist/m365/teams/commands/channel/channel-list.js +1 -1
- package/dist/m365/teams/commands/channel/channel-member-add.js +4 -1
- package/dist/m365/teams/commands/channel/channel-member-list.js +1 -1
- package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -0
- package/dist/m365/teams/commands/channel/channel-member-set.js +3 -0
- package/dist/m365/teams/commands/chat/chat-get.js +8 -8
- package/dist/m365/teams/commands/chat/chat-list.js +1 -1
- package/dist/m365/teams/commands/chat/chat-member-list.js +1 -1
- package/dist/m365/teams/commands/chat/chat-message-list.js +1 -1
- package/dist/m365/teams/commands/chat/chat-message-send.js +6 -6
- package/dist/m365/teams/commands/chat/chatUtil.js +4 -4
- package/dist/m365/teams/commands/message/message-list.js +1 -1
- package/dist/m365/teams/commands/message/message-reply-list.js +1 -1
- package/dist/m365/teams/commands/tab/tab-list.js +1 -1
- package/dist/m365/teams/commands/team/team-list.js +1 -1
- package/dist/m365/teams/commands/user/user-app-list.js +1 -1
- package/dist/m365/teams/commands/user/user-list.js +2 -2
- package/dist/m365/tenant/commands/security/security-alerts-list.js +71 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +1 -1
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +1 -1
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/m365/todo/commands/list/list-list.js +1 -1
- package/dist/m365/todo/commands/task/task-list.js +1 -1
- package/dist/utils/accessToken.js +18 -0
- package/dist/utils/formatting.js +11 -2
- package/dist/utils/odata.js +2 -2
- package/dist/utils/planner.js +65 -0
- package/docs/docs/cmd/aad/app/app-add.md +15 -0
- package/docs/docs/cmd/aad/app/app-set.md +17 -0
- package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.md +1 -1
- package/docs/docs/cmd/app/app-open.md +45 -0
- package/docs/docs/cmd/planner/bucket/bucket-get.md +57 -0
- package/docs/docs/cmd/planner/bucket/bucket-remove.md +60 -0
- package/docs/docs/cmd/planner/task/task-get.md +30 -3
- package/docs/docs/cmd/planner/task/task-reference-add.md +45 -0
- package/docs/docs/cmd/planner/task/task-reference-list.md +24 -0
- package/docs/docs/cmd/pp/gateway/gateway-list.md +21 -0
- package/docs/docs/cmd/spo/field/field-list.md +51 -0
- package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +55 -0
- package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +36 -0
- package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +58 -0
- package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.md +39 -0
- package/docs/docs/cmd/spo/roledefinition/roledefinition-list.md +24 -0
- package/docs/docs/cmd/spo/userprofile/userprofile-get.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-member-list.md +4 -4
- package/docs/docs/cmd/teams/channel/channel-member-remove.md +2 -2
- package/docs/docs/cmd/teams/channel/channel-member-set.md +2 -2
- package/docs/docs/cmd/tenant/security/security-alerts-list.md +30 -0
- package/npm-shrinkwrap.json +1515 -1282
- package/package.json +25 -24
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const request_1 = require("../../../../request");
|
|
4
3
|
const utils_1 = require("../../../../utils");
|
|
4
|
+
const Auth_1 = require("../../../../Auth");
|
|
5
|
+
const request_1 = require("../../../../request");
|
|
6
|
+
const planner_1 = require("../../../../utils/planner");
|
|
5
7
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
8
|
const commands_1 = require("../../commands");
|
|
7
9
|
class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
@@ -36,6 +38,10 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
|
36
38
|
return telemetryProps;
|
|
37
39
|
}
|
|
38
40
|
commandAction(logger, args, cb) {
|
|
41
|
+
if (utils_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
42
|
+
this.handleError('This command does not support application permissions.', logger, cb);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
39
45
|
this
|
|
40
46
|
.getBucketId(args.options)
|
|
41
47
|
.then(bucketId => {
|
|
@@ -217,23 +223,8 @@ class PlannerTaskSetCommand extends GraphCommand_1.default {
|
|
|
217
223
|
}
|
|
218
224
|
return this
|
|
219
225
|
.getGroupId(options)
|
|
220
|
-
.then((groupId) =>
|
|
221
|
-
|
|
222
|
-
url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')&$select=id,title`,
|
|
223
|
-
headers: {
|
|
224
|
-
accept: 'application/json;odata.metadata=none'
|
|
225
|
-
},
|
|
226
|
-
responseType: 'json'
|
|
227
|
-
};
|
|
228
|
-
return request_1.default.get(requestOptions);
|
|
229
|
-
})
|
|
230
|
-
.then((response) => {
|
|
231
|
-
const plan = response.value.find(val => val.title === options.planName);
|
|
232
|
-
if (!plan) {
|
|
233
|
-
return Promise.reject(`The specified plan does not exist`);
|
|
234
|
-
}
|
|
235
|
-
return Promise.resolve(plan.id);
|
|
236
|
-
});
|
|
226
|
+
.then((groupId) => planner_1.planner.getPlanByName(options.planName, groupId))
|
|
227
|
+
.then(plan => plan.id);
|
|
237
228
|
}
|
|
238
229
|
getGroupId(options) {
|
|
239
230
|
if (options.ownerGroupId) {
|
|
@@ -5,14 +5,18 @@ exports.default = {
|
|
|
5
5
|
BUCKET_ADD: `${prefix} bucket add`,
|
|
6
6
|
BUCKET_LIST: `${prefix} bucket list`,
|
|
7
7
|
BUCKET_SET: `${prefix} bucket set`,
|
|
8
|
+
BUCKET_REMOVE: `${prefix} bucket remove`,
|
|
9
|
+
BUCKET_GET: `${prefix} bucket get`,
|
|
8
10
|
PLAN_ADD: `${prefix} plan add`,
|
|
9
|
-
PLAN_GET: `${prefix} plan get`,
|
|
10
11
|
PLAN_DETAILS_GET: `${prefix} plan details get`,
|
|
12
|
+
PLAN_GET: `${prefix} plan get`,
|
|
11
13
|
PLAN_LIST: `${prefix} plan list`,
|
|
12
14
|
TASK_ADD: `${prefix} task add`,
|
|
13
15
|
TASK_DETAILS_GET: `${prefix} task details get`,
|
|
14
16
|
TASK_GET: `${prefix} task get`,
|
|
15
17
|
TASK_LIST: `${prefix} task list`,
|
|
18
|
+
TASK_REFERENCE_ADD: `${prefix} task reference add`,
|
|
19
|
+
TASK_REFERENCE_LIST: `${prefix} task reference list`,
|
|
16
20
|
TASK_SET: `${prefix} task set`
|
|
17
21
|
};
|
|
18
22
|
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const PowerBICommand_1 = require("../../../base/PowerBICommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class PpGatewayListCommand extends PowerBICommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.GATEWAY_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Returns a list of gateways for which the user is an admin';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['id', 'name'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
if (this.verbose) {
|
|
18
|
+
logger.logToStderr(`Retrieving list of gateways for which the user is an admin...`);
|
|
19
|
+
}
|
|
20
|
+
const requestOptions = {
|
|
21
|
+
url: `${this.resource}/v1.0/myorg/gateways`,
|
|
22
|
+
headers: {
|
|
23
|
+
accept: 'application/json;odata.metadata=none'
|
|
24
|
+
},
|
|
25
|
+
responseType: 'json'
|
|
26
|
+
};
|
|
27
|
+
request_1.default
|
|
28
|
+
.get(requestOptions)
|
|
29
|
+
.then((res) => {
|
|
30
|
+
logger.log(res.value);
|
|
31
|
+
cb();
|
|
32
|
+
}, (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
module.exports = new PpGatewayListCommand();
|
|
36
|
+
//# sourceMappingURL=gateway-list.js.map
|
|
@@ -13,7 +13,7 @@ class PpManagementAppListCommand extends PowerPlatformCommand_1.default {
|
|
|
13
13
|
commandAction(logger, args, cb) {
|
|
14
14
|
const endpoint = `${this.resource}/providers/Microsoft.BusinessAppPlatform/adminApplications?api-version=2020-06-01`;
|
|
15
15
|
utils_1.odata
|
|
16
|
-
.getAllItems(endpoint
|
|
16
|
+
.getAllItems(endpoint)
|
|
17
17
|
.then((managementApps) => {
|
|
18
18
|
logger.log(managementApps);
|
|
19
19
|
cb();
|
package/dist/m365/pp/commands.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const prefix = 'pp';
|
|
4
4
|
exports.default = {
|
|
5
5
|
ENVIRONMENT_LIST: `${prefix} environment list`,
|
|
6
|
+
GATEWAY_LIST: `${prefix} gateway list`,
|
|
6
7
|
MANAGEMENTAPP_ADD: `${prefix} managementapp add`,
|
|
7
8
|
MANAGEMENTAPP_LIST: `${prefix} managementapp list`
|
|
8
9
|
};
|
|
@@ -0,0 +1,84 @@
|
|
|
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 SpoFieldListCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.FIELD_LIST;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Retrieves columns for the specified list or site';
|
|
13
|
+
}
|
|
14
|
+
getTelemetryProperties(args) {
|
|
15
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
+
telemetryProps.listId = typeof args.options.listId !== 'undefined';
|
|
17
|
+
telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
|
|
18
|
+
telemetryProps.listUrl = typeof args.options.listUrl !== 'undefined';
|
|
19
|
+
return telemetryProps;
|
|
20
|
+
}
|
|
21
|
+
defaultProperties() {
|
|
22
|
+
return ['Id', 'Title', 'Group', 'Hidden'];
|
|
23
|
+
}
|
|
24
|
+
commandAction(logger, args, cb) {
|
|
25
|
+
let listUrl = '';
|
|
26
|
+
if (args.options.listId) {
|
|
27
|
+
listUrl = `lists(guid'${encodeURIComponent(args.options.listId)}')/`;
|
|
28
|
+
}
|
|
29
|
+
else if (args.options.listTitle) {
|
|
30
|
+
listUrl = `lists/getByTitle('${encodeURIComponent(args.options.listTitle)}')/`;
|
|
31
|
+
}
|
|
32
|
+
else if (args.options.listUrl) {
|
|
33
|
+
const listServerRelativeUrl = utils_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
34
|
+
listUrl = `GetList('${encodeURIComponent(listServerRelativeUrl)}')/`;
|
|
35
|
+
}
|
|
36
|
+
const requestOptions = {
|
|
37
|
+
url: `${args.options.webUrl}/_api/web/${listUrl}fields`,
|
|
38
|
+
headers: {
|
|
39
|
+
accept: 'application/json;odata=nometadata'
|
|
40
|
+
},
|
|
41
|
+
responseType: 'json'
|
|
42
|
+
};
|
|
43
|
+
request_1.default
|
|
44
|
+
.get(requestOptions)
|
|
45
|
+
.then((res) => {
|
|
46
|
+
logger.log(res.value);
|
|
47
|
+
cb();
|
|
48
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
49
|
+
}
|
|
50
|
+
options() {
|
|
51
|
+
const options = [
|
|
52
|
+
{
|
|
53
|
+
option: '-u, --webUrl <webUrl>'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
option: '-t, --listTitle [listTitle]'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
option: '-i, --listId [listId]'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
option: '--listUrl [listUrl]'
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
const parentOptions = super.options();
|
|
66
|
+
return options.concat(parentOptions);
|
|
67
|
+
}
|
|
68
|
+
validate(args) {
|
|
69
|
+
const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
70
|
+
if (isValidSharePointUrl !== true) {
|
|
71
|
+
return isValidSharePointUrl;
|
|
72
|
+
}
|
|
73
|
+
if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
|
|
74
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
75
|
+
}
|
|
76
|
+
const listOptions = [args.options.listId, args.options.listTitle, args.options.listUrl];
|
|
77
|
+
if (listOptions.some(item => item !== undefined) && listOptions.filter(item => item !== undefined).length > 1) {
|
|
78
|
+
return `Specify either list id or title or list url`;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
module.exports = new SpoFieldListCommand();
|
|
84
|
+
//# sourceMappingURL=field-list.js.map
|
|
@@ -0,0 +1,84 @@
|
|
|
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 SpoListRoleInheritanceBreakCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.LIST_ROLEINHERITANCE_BREAK;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Breaks role inheritance on list or library';
|
|
13
|
+
}
|
|
14
|
+
optionSets() {
|
|
15
|
+
return [
|
|
16
|
+
['listId', 'listTitle']
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
getTelemetryProperties(args) {
|
|
20
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
21
|
+
telemetryProps.listId = typeof args.options.listId !== 'undefined';
|
|
22
|
+
telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
|
|
23
|
+
telemetryProps.clearExistingPermissions = args.options.clearExistingPermissions === true;
|
|
24
|
+
return telemetryProps;
|
|
25
|
+
}
|
|
26
|
+
commandAction(logger, args, cb) {
|
|
27
|
+
if (this.verbose) {
|
|
28
|
+
logger.logToStderr(`Breaking role inheritance of list in site at ${args.options.webUrl}...`);
|
|
29
|
+
}
|
|
30
|
+
let requestUrl = `${args.options.webUrl}/_api/web/lists`;
|
|
31
|
+
if (args.options.listId) {
|
|
32
|
+
requestUrl += `(guid'${encodeURIComponent(args.options.listId)}')`;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
requestUrl += `/getbytitle('${encodeURIComponent(args.options.listTitle)}')`;
|
|
36
|
+
}
|
|
37
|
+
let keepExistingPermissions = true;
|
|
38
|
+
if (args.options.clearExistingPermissions) {
|
|
39
|
+
keepExistingPermissions = !args.options.clearExistingPermissions;
|
|
40
|
+
}
|
|
41
|
+
const requestOptions = {
|
|
42
|
+
url: `${requestUrl}/breakroleinheritance(${keepExistingPermissions})`,
|
|
43
|
+
method: 'POST',
|
|
44
|
+
headers: {
|
|
45
|
+
'accept': 'application/json;odata=nometadata',
|
|
46
|
+
'content-type': 'application/json'
|
|
47
|
+
},
|
|
48
|
+
responseType: 'json'
|
|
49
|
+
};
|
|
50
|
+
request_1.default
|
|
51
|
+
.post(requestOptions)
|
|
52
|
+
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
53
|
+
}
|
|
54
|
+
options() {
|
|
55
|
+
const options = [
|
|
56
|
+
{
|
|
57
|
+
option: '-u, --webUrl <webUrl>'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
option: '-i, --listId [listId]'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
option: '-t, --listTitle [listTitle]'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
option: '-c, --clearExistingPermissions'
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
const parentOptions = super.options();
|
|
70
|
+
return options.concat(parentOptions);
|
|
71
|
+
}
|
|
72
|
+
validate(args) {
|
|
73
|
+
const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
74
|
+
if (isValidSharePointUrl !== true) {
|
|
75
|
+
return isValidSharePointUrl;
|
|
76
|
+
}
|
|
77
|
+
if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
|
|
78
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
module.exports = new SpoListRoleInheritanceBreakCommand();
|
|
84
|
+
//# sourceMappingURL=list-roleinheritance-break.js.map
|
|
@@ -0,0 +1,76 @@
|
|
|
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 SpoListRoleInheritanceResetCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.LIST_ROLEINHERITANCE_RESET;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Restores role inheritance on list or library';
|
|
13
|
+
}
|
|
14
|
+
optionSets() {
|
|
15
|
+
return [
|
|
16
|
+
['listId', 'listTitle']
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
getTelemetryProperties(args) {
|
|
20
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
21
|
+
telemetryProps.listId = typeof args.options.listId !== 'undefined';
|
|
22
|
+
telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
|
|
23
|
+
return telemetryProps;
|
|
24
|
+
}
|
|
25
|
+
commandAction(logger, args, cb) {
|
|
26
|
+
if (this.verbose) {
|
|
27
|
+
logger.logToStderr(`Restore role inheritance of list in site at ${args.options.webUrl}...`);
|
|
28
|
+
}
|
|
29
|
+
let requestUrl = `${args.options.webUrl}/_api/web/lists`;
|
|
30
|
+
if (args.options.listId) {
|
|
31
|
+
requestUrl += `(guid'${encodeURIComponent(args.options.listId)}')`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
requestUrl += `/getbytitle('${encodeURIComponent(args.options.listTitle)}')`;
|
|
35
|
+
}
|
|
36
|
+
const requestOptions = {
|
|
37
|
+
url: `${requestUrl}/resetroleinheritance`,
|
|
38
|
+
method: 'POST',
|
|
39
|
+
headers: {
|
|
40
|
+
'accept': 'application/json;odata=nometadata',
|
|
41
|
+
'content-type': 'application/json'
|
|
42
|
+
},
|
|
43
|
+
responseType: 'json'
|
|
44
|
+
};
|
|
45
|
+
request_1.default
|
|
46
|
+
.post(requestOptions)
|
|
47
|
+
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
48
|
+
}
|
|
49
|
+
options() {
|
|
50
|
+
const options = [
|
|
51
|
+
{
|
|
52
|
+
option: '-u, --webUrl <webUrl>'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
option: '-i, --listId [listId]'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
option: '-t, --listTitle [listTitle]'
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
const parentOptions = super.options();
|
|
62
|
+
return options.concat(parentOptions);
|
|
63
|
+
}
|
|
64
|
+
validate(args) {
|
|
65
|
+
const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
66
|
+
if (isValidSharePointUrl !== true) {
|
|
67
|
+
return isValidSharePointUrl;
|
|
68
|
+
}
|
|
69
|
+
if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
|
|
70
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
module.exports = new SpoListRoleInheritanceResetCommand();
|
|
76
|
+
//# sourceMappingURL=list-roleinheritance-reset.js.map
|
|
@@ -0,0 +1,83 @@
|
|
|
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 SpoListItemRoleInheritanceBreakCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.LISTITEM_ROLEINHERITANCE_BREAK;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Break inheritance of list item';
|
|
13
|
+
}
|
|
14
|
+
optionSets() {
|
|
15
|
+
return [
|
|
16
|
+
['listId', 'listTitle']
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
commandAction(logger, args, cb) {
|
|
20
|
+
if (this.verbose) {
|
|
21
|
+
logger.logToStderr(`Breaking role inheritance of list item in site at ${args.options.webUrl}...`);
|
|
22
|
+
}
|
|
23
|
+
let requestUrl = `${args.options.webUrl}/_api/web/lists`;
|
|
24
|
+
if (args.options.listId) {
|
|
25
|
+
requestUrl += `(guid'${encodeURIComponent(args.options.listId)}')`;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
requestUrl += `/getbytitle('${encodeURIComponent(args.options.listTitle)}')`;
|
|
29
|
+
}
|
|
30
|
+
let keepExistingPermissions = true;
|
|
31
|
+
if (args.options.clearExistingPermissions) {
|
|
32
|
+
keepExistingPermissions = !args.options.clearExistingPermissions;
|
|
33
|
+
}
|
|
34
|
+
const requestOptions = {
|
|
35
|
+
url: `${requestUrl}/items(${args.options.listItemId})/breakroleinheritance(${keepExistingPermissions})`,
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers: {
|
|
38
|
+
'accept': 'application/json;odata=nometadata',
|
|
39
|
+
'content-type': 'application/json'
|
|
40
|
+
},
|
|
41
|
+
responseType: 'json'
|
|
42
|
+
};
|
|
43
|
+
request_1.default
|
|
44
|
+
.post(requestOptions)
|
|
45
|
+
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
46
|
+
}
|
|
47
|
+
options() {
|
|
48
|
+
const options = [
|
|
49
|
+
{
|
|
50
|
+
option: '-u, --webUrl <webUrl>'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
option: '--listItemId <listItemId>'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
option: '-l, --listId [listId]'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
option: '-t, --listTitle [listTitle]'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
option: '-c, --clearExistingPermissions'
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
const parentOptions = super.options();
|
|
66
|
+
return options.concat(parentOptions);
|
|
67
|
+
}
|
|
68
|
+
validate(args) {
|
|
69
|
+
const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
70
|
+
if (isValidSharePointUrl !== true) {
|
|
71
|
+
return isValidSharePointUrl;
|
|
72
|
+
}
|
|
73
|
+
if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
|
|
74
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
75
|
+
}
|
|
76
|
+
if (isNaN(args.options.listItemId)) {
|
|
77
|
+
return `${args.options.listItemId} is not a number`;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
module.exports = new SpoListItemRoleInheritanceBreakCommand();
|
|
83
|
+
//# sourceMappingURL=listitem-roleinheritance-break.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
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 SpoListItemRoleInheritanceResetCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.LISTITEM_ROLEINHERITANCE_RESET;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Restores the role inheritance of list item, file, or folder';
|
|
13
|
+
}
|
|
14
|
+
getTelemetryProperties(args) {
|
|
15
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
+
telemetryProps.listId = typeof args.options.listId !== 'undefined';
|
|
17
|
+
telemetryProps.listTitle = typeof args.options.listTitle !== 'undefined';
|
|
18
|
+
return telemetryProps;
|
|
19
|
+
}
|
|
20
|
+
commandAction(logger, args, cb) {
|
|
21
|
+
let requestUrl = `${args.options.webUrl}/_api/web/lists`;
|
|
22
|
+
if (args.options.listId) {
|
|
23
|
+
requestUrl += `(guid'${encodeURIComponent(args.options.listId)}')`;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
requestUrl += `/getbytitle('${encodeURIComponent(args.options.listTitle)}')`;
|
|
27
|
+
}
|
|
28
|
+
const requestOptions = {
|
|
29
|
+
url: `${requestUrl}/items(${args.options.listItemId})/resetroleinheritance`,
|
|
30
|
+
method: 'POST',
|
|
31
|
+
headers: {
|
|
32
|
+
'accept': 'application/json;odata=nometadata',
|
|
33
|
+
'content-type': 'application/json'
|
|
34
|
+
},
|
|
35
|
+
responseType: 'json'
|
|
36
|
+
};
|
|
37
|
+
request_1.default
|
|
38
|
+
.post(requestOptions)
|
|
39
|
+
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
40
|
+
}
|
|
41
|
+
optionSets() {
|
|
42
|
+
return [
|
|
43
|
+
['listId', 'listTitle']
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
options() {
|
|
47
|
+
const options = [
|
|
48
|
+
{
|
|
49
|
+
option: '-u, --webUrl <webUrl>'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
option: '--listItemId <listItemId>'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
option: '--listId [listId]'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
option: '--listTitle [listTitle]'
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
const parentOptions = super.options();
|
|
62
|
+
return options.concat(parentOptions);
|
|
63
|
+
}
|
|
64
|
+
validate(args) {
|
|
65
|
+
const isValidSharePointUrl = utils_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
66
|
+
if (isValidSharePointUrl !== true) {
|
|
67
|
+
return isValidSharePointUrl;
|
|
68
|
+
}
|
|
69
|
+
if (args.options.listId && !utils_1.validation.isValidGuid(args.options.listId)) {
|
|
70
|
+
return `${args.options.listId} is not a valid GUID`;
|
|
71
|
+
}
|
|
72
|
+
if (isNaN(args.options.listItemId)) {
|
|
73
|
+
return `${args.options.listItemId} is not a number`;
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
module.exports = new SpoListItemRoleInheritanceResetCommand();
|
|
79
|
+
//# sourceMappingURL=listitem-roleinheritance-reset.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
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 SpoRoleDefinitionListCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.ROLEDEFINITION_LIST;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Gets list of role definitions for the specified site';
|
|
13
|
+
}
|
|
14
|
+
defaultProperties() {
|
|
15
|
+
return ['Id', 'Name'];
|
|
16
|
+
}
|
|
17
|
+
commandAction(logger, args, cb) {
|
|
18
|
+
if (this.verbose) {
|
|
19
|
+
logger.logToStderr(`Getting role definitions list from ${args.options.webUrl}...`);
|
|
20
|
+
}
|
|
21
|
+
const requestOptions = {
|
|
22
|
+
url: `${args.options.webUrl}/_api/web/roledefinitions`,
|
|
23
|
+
headers: {
|
|
24
|
+
'accept': 'application/json;odata=nometadata'
|
|
25
|
+
},
|
|
26
|
+
responseType: 'json'
|
|
27
|
+
};
|
|
28
|
+
request_1.default
|
|
29
|
+
.get(requestOptions)
|
|
30
|
+
.then((response) => {
|
|
31
|
+
logger.log(response.value);
|
|
32
|
+
cb();
|
|
33
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
34
|
+
}
|
|
35
|
+
options() {
|
|
36
|
+
const options = [
|
|
37
|
+
{
|
|
38
|
+
option: '-u, --webUrl <webUrl>'
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
const parentOptions = super.options();
|
|
42
|
+
return options.concat(parentOptions);
|
|
43
|
+
}
|
|
44
|
+
validate(args) {
|
|
45
|
+
return utils_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
module.exports = new SpoRoleDefinitionListCommand();
|
|
49
|
+
//# sourceMappingURL=roledefinition-list.js.map
|
|
@@ -41,6 +41,7 @@ exports.default = {
|
|
|
41
41
|
FEATURE_LIST: `${prefix} feature list`,
|
|
42
42
|
FIELD_ADD: `${prefix} field add`,
|
|
43
43
|
FIELD_GET: `${prefix} field get`,
|
|
44
|
+
FIELD_LIST: `${prefix} field list`,
|
|
44
45
|
FIELD_REMOVE: `${prefix} field remove`,
|
|
45
46
|
FIELD_SET: `${prefix} field set`,
|
|
46
47
|
FILE_ADD: `${prefix} file add`,
|
|
@@ -95,6 +96,8 @@ exports.default = {
|
|
|
95
96
|
LIST_LABEL_SET: `${prefix} list label set`,
|
|
96
97
|
LIST_LIST: `${prefix} list list`,
|
|
97
98
|
LIST_REMOVE: `${prefix} list remove`,
|
|
99
|
+
LIST_ROLEINHERITANCE_BREAK: `${prefix} list roleinheritance break`,
|
|
100
|
+
LIST_ROLEINHERITANCE_RESET: `${prefix} list roleinheritance reset`,
|
|
98
101
|
LIST_SET: `${prefix} list set`,
|
|
99
102
|
LIST_SITESCRIPT_GET: `${prefix} list sitescript get`,
|
|
100
103
|
LIST_VIEW_GET: `${prefix} list view get`,
|
|
@@ -117,6 +120,8 @@ exports.default = {
|
|
|
117
120
|
LISTITEM_RECORD_DECLARE: `${prefix} listitem record declare`,
|
|
118
121
|
LISTITEM_RECORD_UNDECLARE: `${prefix} listitem record undeclare`,
|
|
119
122
|
LISTITEM_REMOVE: `${prefix} listitem remove`,
|
|
123
|
+
LISTITEM_ROLEINHERITANCE_BREAK: `${prefix} listitem roleinheritance break`,
|
|
124
|
+
LISTITEM_ROLEINHERITANCE_RESET: `${prefix} listitem roleinheritance reset`,
|
|
120
125
|
LISTITEM_SET: `${prefix} listitem set`,
|
|
121
126
|
MAIL_SEND: `${prefix} mail send`,
|
|
122
127
|
NAVIGATION_NODE_ADD: `${prefix} navigation node add`,
|
|
@@ -159,6 +164,7 @@ exports.default = {
|
|
|
159
164
|
REPORT_SITEUSAGEPAGES: `${prefix} report siteusagepages`,
|
|
160
165
|
REPORT_SITEUSAGESITECOUNTS: `${prefix} report siteusagesitecounts`,
|
|
161
166
|
REPORT_SITEUSAGESTORAGE: `${prefix} report siteusagestorage`,
|
|
167
|
+
ROLEDEFINITION_LIST: `${prefix} roledefinition list`,
|
|
162
168
|
SEARCH: `${prefix} search`,
|
|
163
169
|
SERVICEPRINCIPAL_GRANT_ADD: `${prefix} serviceprincipal grant add`,
|
|
164
170
|
SERVICEPRINCIPAL_GRANT_LIST: `${prefix} serviceprincipal grant list`,
|
|
@@ -76,7 +76,7 @@ class TeamsAppListCommand extends GraphCommand_1.default {
|
|
|
76
76
|
commandAction(logger, args, cb) {
|
|
77
77
|
this
|
|
78
78
|
.getEndpointUrl(args)
|
|
79
|
-
.then(endpoint => utils_1.odata.getAllItems(endpoint
|
|
79
|
+
.then(endpoint => utils_1.odata.getAllItems(endpoint))
|
|
80
80
|
.then((items) => {
|
|
81
81
|
if (args.options.teamId || args.options.teamName) {
|
|
82
82
|
items.forEach(t => {
|
|
@@ -53,7 +53,7 @@ class TeamsChannelListCommand extends GraphCommand_1.default {
|
|
|
53
53
|
if (args.options.type) {
|
|
54
54
|
endpoint += `?$filter=membershipType eq '${args.options.type}'`;
|
|
55
55
|
}
|
|
56
|
-
return utils_1.odata.getAllItems(endpoint
|
|
56
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
57
57
|
})
|
|
58
58
|
.then((items) => {
|
|
59
59
|
logger.log(items);
|
|
@@ -153,8 +153,11 @@ class TeamsChannelMemberAddCommand extends GraphCommand_1.default {
|
|
|
153
153
|
if (!channelItem) {
|
|
154
154
|
return Promise.reject(`The specified channel '${args.options.channelName}' does not exist in the Microsoft Teams team with ID '${teamId}'`);
|
|
155
155
|
}
|
|
156
|
+
if (channelItem.membershipType !== "private") {
|
|
157
|
+
return Promise.reject(`The specified channel is not a private channel`);
|
|
158
|
+
}
|
|
156
159
|
return Promise.resolve(channelItem.id);
|
|
157
|
-
}
|
|
160
|
+
});
|
|
158
161
|
}
|
|
159
162
|
getUserId(args) {
|
|
160
163
|
if (args.options.userId) {
|
|
@@ -40,7 +40,7 @@ class TeamsChannelMemberListCommand extends GraphCommand_1.default {
|
|
|
40
40
|
})
|
|
41
41
|
.then((channelId) => {
|
|
42
42
|
const endpoint = `${this.resource}/v1.0/teams/${this.teamId}/channels/${channelId}/members`;
|
|
43
|
-
return utils_1.odata.getAllItems(endpoint
|
|
43
|
+
return utils_1.odata.getAllItems(endpoint);
|
|
44
44
|
})
|
|
45
45
|
.then((memberships) => {
|
|
46
46
|
if (args.options.role) {
|
|
@@ -135,6 +135,9 @@ class TeamsChannelMemberRemoveCommand extends GraphCommand_1.default {
|
|
|
135
135
|
if (!channelItem) {
|
|
136
136
|
return Promise.reject(`The specified channel does not exist in the Microsoft Teams team`);
|
|
137
137
|
}
|
|
138
|
+
if (channelItem.membershipType !== "private") {
|
|
139
|
+
return Promise.reject(`The specified channel is not a private channel`);
|
|
140
|
+
}
|
|
138
141
|
return Promise.resolve(channelItem.id);
|
|
139
142
|
});
|
|
140
143
|
}
|