@pnp/cli-microsoft365 5.0.0-beta.117f66f → 5.0.0-beta.21e7f85
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/.devcontainer/devcontainer.json +9 -1
- package/.eslintrc.js +2 -0
- package/dist/Command.js +1 -1
- package/dist/Utils.js +7 -0
- package/dist/api.d.ts +11 -0
- package/dist/api.js +17 -0
- package/dist/cli/Cli.js +26 -13
- package/dist/m365/aad/commands/app/app-add.js +43 -7
- package/dist/m365/aad/commands/app/app-delete.js +123 -0
- package/dist/m365/aad/commands/app/app-set.js +98 -3
- package/dist/m365/aad/commands/group/group-list.js +54 -0
- package/dist/m365/aad/commands/o365group/{Group.js → GroupExtended.js} +1 -1
- package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +41 -0
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +3 -3
- package/dist/m365/aad/commands/user/user-get.js +33 -6
- package/dist/m365/aad/commands/user/user-hibp.js +67 -0
- package/dist/m365/aad/commands/user/user-list.js +7 -4
- package/dist/m365/aad/commands.js +4 -0
- package/dist/m365/cli/commands/config/config-set.js +4 -1
- package/dist/m365/flow/commands/flow-get.js +2 -2
- package/dist/m365/outlook/commands/room/room-list.js +43 -0
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +25 -0
- package/dist/m365/outlook/commands.js +2 -0
- package/dist/m365/pa/cds-project-mutator.js +1 -1
- package/dist/m365/{aad/commands/o365group/GroupUser.js → planner/AppliedCategories.js} +1 -1
- package/dist/m365/planner/commands/task/task-add.js +288 -0
- package/dist/m365/planner/commands/task/task-details-get.js +39 -0
- package/dist/m365/planner/commands/task/task-get.js +37 -0
- package/dist/m365/planner/commands/task/task-list.js +37 -7
- package/dist/m365/planner/commands/task/task-set.js +357 -0
- package/dist/m365/planner/commands.js +5 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014008_CODE_launch_hostedWorkbench_type.js +62 -0
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.14.0-beta.4.js → upgrade-1.14.0-rc.2.js} +27 -25
- package/dist/m365/spfx/commands/project/project-upgrade.js +1 -1
- package/dist/m365/spo/commands/group/group-user-add.js +74 -16
- package/dist/m365/spo/commands/group/group-user-remove.js +100 -0
- package/dist/m365/spo/commands/site/site-ensure.js +1 -1
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +76 -0
- package/dist/m365/spo/commands.js +2 -0
- package/dist/m365/teams/commands/app/app-list.js +9 -6
- package/dist/m365/teams/commands/channel/channel-get.js +29 -7
- package/dist/m365/teams/commands/chat/chat-list.js +43 -0
- package/dist/m365/teams/commands/chat/chat-member-list.js +42 -0
- package/dist/m365/teams/commands/chat/chat-message-list.js +60 -0
- package/dist/m365/teams/commands/chat/chat-message-send.js +225 -0
- package/dist/m365/teams/commands/message/message-get.js +1 -1
- package/dist/m365/teams/commands/tab/tab-get.js +9 -6
- package/dist/m365/teams/commands.js +4 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +57 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +56 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +39 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +38 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +51 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +38 -0
- package/dist/m365/tenant/commands.js +6 -0
- package/dist/settingsNames.js +6 -1
- package/docs/docs/cmd/aad/app/app-delete.md +51 -0
- package/docs/docs/cmd/aad/app/app-set.md +21 -0
- package/docs/docs/cmd/aad/group/group-list.md +30 -0
- package/docs/docs/cmd/aad/o365group/o365group-conversation-list.md +24 -0
- package/docs/docs/cmd/aad/user/user-get.md +13 -4
- package/docs/docs/cmd/aad/user/user-hibp.md +46 -0
- package/docs/docs/cmd/aad/user/user-list.md +9 -0
- package/docs/docs/cmd/outlook/room/room-list.md +30 -0
- package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +21 -0
- package/docs/docs/cmd/planner/task/task-add.md +78 -0
- package/docs/docs/cmd/planner/task/task-details-get.md +24 -0
- package/docs/docs/cmd/planner/task/task-get.md +29 -0
- package/docs/docs/cmd/planner/task/task-list.md +5 -0
- package/docs/docs/cmd/planner/task/task-set.md +99 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-add.md +3 -3
- package/docs/docs/cmd/spo/group/group-user-add.md +28 -6
- package/docs/docs/cmd/spo/group/group-user-remove.md +39 -0
- package/docs/docs/cmd/spo/site/site-recyclebinitem-list.md +40 -0
- package/docs/docs/cmd/teams/channel/channel-get.md +11 -2
- package/docs/docs/cmd/teams/chat/chat-list.md +30 -0
- package/docs/docs/cmd/teams/chat/chat-member-list.md +24 -0
- package/docs/docs/cmd/teams/chat/chat-message-list.md +24 -0
- package/docs/docs/cmd/teams/chat/chat-message-send.md +55 -0
- package/docs/docs/cmd/teams/message/message-get.md +0 -3
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +33 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +30 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.md +24 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.md +34 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.md +28 -0
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.md +34 -0
- package/npm-shrinkwrap.json +938 -1001
- package/package.json +33 -27
- package/dist/m365/base/AadCommand.js +0 -10
|
@@ -20,10 +20,20 @@ class AadUserGetCommand extends GraphCommand_1.default {
|
|
|
20
20
|
}
|
|
21
21
|
commandAction(logger, args, cb) {
|
|
22
22
|
const properties = args.options.properties ?
|
|
23
|
-
|
|
23
|
+
`&$select=${args.options.properties.split(',').map(p => encodeURIComponent(p.trim())).join(',')}` :
|
|
24
24
|
'';
|
|
25
|
+
let requestUrl = `${this.resource}/v1.0/users`;
|
|
26
|
+
if (args.options.id) {
|
|
27
|
+
requestUrl += `?$filter=id eq '${encodeURIComponent(args.options.id)}'${properties}`;
|
|
28
|
+
}
|
|
29
|
+
else if (args.options.userName) {
|
|
30
|
+
requestUrl += `?$filter=userPrincipalName eq '${encodeURIComponent(args.options.userName)}'${properties}`;
|
|
31
|
+
}
|
|
32
|
+
else if (args.options.email) {
|
|
33
|
+
requestUrl += `?$filter=mail eq '${encodeURIComponent(args.options.email)}'${properties}`;
|
|
34
|
+
}
|
|
25
35
|
const requestOptions = {
|
|
26
|
-
url:
|
|
36
|
+
url: requestUrl,
|
|
27
37
|
headers: {
|
|
28
38
|
accept: 'application/json;odata.metadata=none'
|
|
29
39
|
},
|
|
@@ -31,6 +41,18 @@ class AadUserGetCommand extends GraphCommand_1.default {
|
|
|
31
41
|
};
|
|
32
42
|
request_1.default
|
|
33
43
|
.get(requestOptions)
|
|
44
|
+
.then((res) => {
|
|
45
|
+
if (res.value.length === 1) {
|
|
46
|
+
return Promise.resolve(res.value[0]);
|
|
47
|
+
}
|
|
48
|
+
const identifier = args.options.id ? `id ${args.options.id}`
|
|
49
|
+
: args.options.userName ? `user name ${args.options.userName}`
|
|
50
|
+
: `email ${args.options.email}`;
|
|
51
|
+
if (res.value.length === 0) {
|
|
52
|
+
return Promise.reject(`The specified user with ${identifier} does not exist`);
|
|
53
|
+
}
|
|
54
|
+
return Promise.reject(`Multiple users with ${identifier} found. Please disambiguate (user names): ${res.value.map(a => a.userPrincipalName).join(', ')} or (ids): ${res.value.map(a => a.id).join(', ')}`);
|
|
55
|
+
})
|
|
34
56
|
.then((res) => {
|
|
35
57
|
logger.log(res);
|
|
36
58
|
cb();
|
|
@@ -44,6 +66,9 @@ class AadUserGetCommand extends GraphCommand_1.default {
|
|
|
44
66
|
{
|
|
45
67
|
option: '-n, --userName [userName]'
|
|
46
68
|
},
|
|
69
|
+
{
|
|
70
|
+
option: '--email [email]'
|
|
71
|
+
},
|
|
47
72
|
{
|
|
48
73
|
option: '-p, --properties [properties]'
|
|
49
74
|
}
|
|
@@ -52,11 +77,13 @@ class AadUserGetCommand extends GraphCommand_1.default {
|
|
|
52
77
|
return options.concat(parentOptions);
|
|
53
78
|
}
|
|
54
79
|
validate(args) {
|
|
55
|
-
if (!args.options.id && !args.options.userName) {
|
|
56
|
-
return 'Specify
|
|
80
|
+
if (!args.options.id && !args.options.userName && !args.options.email) {
|
|
81
|
+
return 'Specify id, userName or email, one is required';
|
|
57
82
|
}
|
|
58
|
-
if (args.options.id && args.options.
|
|
59
|
-
|
|
83
|
+
if ((args.options.id && args.options.email) ||
|
|
84
|
+
(args.options.id && args.options.userName) ||
|
|
85
|
+
(args.options.userName && args.options.email)) {
|
|
86
|
+
return 'Use either id, userName or email, but not all';
|
|
60
87
|
}
|
|
61
88
|
if (args.options.id &&
|
|
62
89
|
!Utils_1.default.isValidGuid(args.options.id)) {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
5
|
+
const AnonymousCommand_1 = require("../../../base/AnonymousCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class AadUserHibpCommand extends AnonymousCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.USER_HIBP;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Allows you to retrieve all accounts that have been pwned with the specified username';
|
|
13
|
+
}
|
|
14
|
+
getTelemetryProperties(args) {
|
|
15
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
+
telemetryProps.domain = args.options.domain;
|
|
17
|
+
return telemetryProps;
|
|
18
|
+
}
|
|
19
|
+
commandAction(logger, args, cb) {
|
|
20
|
+
const requestOptions = {
|
|
21
|
+
url: `https://haveibeenpwned.com/api/v3/breachedaccount/${encodeURIComponent(args.options.userName)}${(args.options.domain ? `?domain=${encodeURIComponent(args.options.domain)}` : '')}`,
|
|
22
|
+
headers: {
|
|
23
|
+
'accept': 'application/json',
|
|
24
|
+
'hibp-api-key': args.options.apiKey,
|
|
25
|
+
'x-anonymous': true
|
|
26
|
+
},
|
|
27
|
+
responseType: 'json'
|
|
28
|
+
};
|
|
29
|
+
request_1.default
|
|
30
|
+
.get(requestOptions)
|
|
31
|
+
.then((res) => {
|
|
32
|
+
logger.log(res);
|
|
33
|
+
cb();
|
|
34
|
+
})
|
|
35
|
+
.catch((err) => {
|
|
36
|
+
if ((err && err.response !== undefined && err.response.status === 404) && (this.debug || this.verbose)) {
|
|
37
|
+
logger.log('No pwnage found');
|
|
38
|
+
cb();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
return this.handleRejectedODataJsonPromise(err, logger, cb);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
options() {
|
|
45
|
+
const options = [
|
|
46
|
+
{
|
|
47
|
+
option: '-n, --userName <userName>'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
option: '--apiKey, <apiKey>'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
option: '--domain, [domain]'
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
const parentOptions = super.options();
|
|
57
|
+
return options.concat(parentOptions);
|
|
58
|
+
}
|
|
59
|
+
validate(args) {
|
|
60
|
+
if (!Utils_1.default.isValidUserPrincipalName(args.options.userName)) {
|
|
61
|
+
return 'Specify valid userName';
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
module.exports = new AadUserHibpCommand();
|
|
67
|
+
//# sourceMappingURL=user-hibp.js.map
|
|
@@ -15,6 +15,7 @@ class AadUserListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
|
15
15
|
getTelemetryProperties(args) {
|
|
16
16
|
const telemetryProps = super.getTelemetryProperties(args);
|
|
17
17
|
telemetryProps.properties = args.options.properties;
|
|
18
|
+
telemetryProps.deleted = typeof args.options.deleted !== 'undefined';
|
|
18
19
|
return telemetryProps;
|
|
19
20
|
}
|
|
20
21
|
commandAction(logger, args, cb) {
|
|
@@ -22,7 +23,8 @@ class AadUserListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
|
22
23
|
args.options.properties.split(',').map(p => p.trim()) :
|
|
23
24
|
['userPrincipalName', 'displayName'];
|
|
24
25
|
const filter = this.getFilter(args.options);
|
|
25
|
-
const
|
|
26
|
+
const endpoint = args.options.deleted ? 'directory/deletedItems/microsoft.graph.user' : 'users';
|
|
27
|
+
const url = `${this.resource}/v1.0/${endpoint}?$select=${properties.join(',')}${(filter.length > 0 ? '&' + filter : '')}&$top=100`;
|
|
26
28
|
this
|
|
27
29
|
.getAllItems(url, logger, true)
|
|
28
30
|
.then(() => {
|
|
@@ -35,6 +37,8 @@ class AadUserListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
|
35
37
|
const excludeOptions = [
|
|
36
38
|
'properties',
|
|
37
39
|
'p',
|
|
40
|
+
'deleted',
|
|
41
|
+
'd',
|
|
38
42
|
'debug',
|
|
39
43
|
'verbose',
|
|
40
44
|
'output',
|
|
@@ -55,9 +59,8 @@ class AadUserListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
|
55
59
|
}
|
|
56
60
|
options() {
|
|
57
61
|
const options = [
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
}
|
|
62
|
+
{ option: '-p, --properties [properties]' },
|
|
63
|
+
{ option: '-d, --deleted' }
|
|
61
64
|
];
|
|
62
65
|
const parentOptions = super.options();
|
|
63
66
|
return options.concat(parentOptions);
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const prefix = 'aad';
|
|
4
4
|
exports.default = {
|
|
5
5
|
APP_ADD: `${prefix} app add`,
|
|
6
|
+
APP_DELETE: `${prefix} app delete`,
|
|
6
7
|
APP_GET: `${prefix} app get`,
|
|
7
8
|
APP_SET: `${prefix} app set`,
|
|
8
9
|
APP_ROLE_ADD: `${prefix} app role add`,
|
|
@@ -11,6 +12,7 @@ exports.default = {
|
|
|
11
12
|
APPROLEASSIGNMENT_ADD: `${prefix} approleassignment add`,
|
|
12
13
|
APPROLEASSIGNMENT_LIST: `${prefix} approleassignment list`,
|
|
13
14
|
APPROLEASSIGNMENT_REMOVE: `${prefix} approleassignment remove`,
|
|
15
|
+
GROUP_LIST: `${prefix} group list`,
|
|
14
16
|
GROUPSETTING_ADD: `${prefix} groupsetting add`,
|
|
15
17
|
GROUPSETTING_GET: `${prefix} groupsetting get`,
|
|
16
18
|
GROUPSETTING_LIST: `${prefix} groupsetting list`,
|
|
@@ -21,6 +23,7 @@ exports.default = {
|
|
|
21
23
|
O365GROUP_ADD: `${prefix} o365group add`,
|
|
22
24
|
O365GROUP_GET: `${prefix} o365group get`,
|
|
23
25
|
O365GROUP_LIST: `${prefix} o365group list`,
|
|
26
|
+
O365GROUP_CONVERSATION_LIST: `${prefix} o365group conversation list`,
|
|
24
27
|
O365GROUP_RECYCLEBINITEM_CLEAR: `${prefix} o365group recyclebinitem clear`,
|
|
25
28
|
O365GROUP_RECYCLEBINITEM_LIST: `${prefix} o365group recyclebinitem list`,
|
|
26
29
|
O365GROUP_RECYCLEBINITEM_RESTORE: `${prefix} o365group recyclebinitem restore`,
|
|
@@ -50,6 +53,7 @@ exports.default = {
|
|
|
50
53
|
SP_ADD: `${prefix} sp add`,
|
|
51
54
|
SP_GET: `${prefix} sp get`,
|
|
52
55
|
USER_GET: `${prefix} user get`,
|
|
56
|
+
USER_HIBP: `${prefix} user hibp`,
|
|
53
57
|
USER_LIST: `${prefix} user list`,
|
|
54
58
|
USER_PASSWORD_VALIDATE: `${prefix} user password validate`,
|
|
55
59
|
USER_SET: `${prefix} user set`
|
|
@@ -21,6 +21,9 @@ class CliConfigSetCommand extends AnonymousCommand_1.default {
|
|
|
21
21
|
switch (args.options.key) {
|
|
22
22
|
case settingsNames_1.settingsNames.showHelpOnFailure:
|
|
23
23
|
case settingsNames_1.settingsNames.printErrorsAsPlainText:
|
|
24
|
+
case settingsNames_1.settingsNames.csvHeader:
|
|
25
|
+
case settingsNames_1.settingsNames.csvQuoted:
|
|
26
|
+
case settingsNames_1.settingsNames.csvQuotedEmpty:
|
|
24
27
|
value = args.options.value === 'true';
|
|
25
28
|
break;
|
|
26
29
|
default:
|
|
@@ -47,7 +50,7 @@ class CliConfigSetCommand extends AnonymousCommand_1.default {
|
|
|
47
50
|
if (CliConfigSetCommand.optionNames.indexOf(args.options.key) < 0) {
|
|
48
51
|
return `${args.options.key} is not a valid setting. Allowed values: ${CliConfigSetCommand.optionNames.join(', ')}`;
|
|
49
52
|
}
|
|
50
|
-
const allowedOutputs = ['text', 'json'];
|
|
53
|
+
const allowedOutputs = ['text', 'json', 'csv'];
|
|
51
54
|
if (args.options.key === settingsNames_1.settingsNames.output &&
|
|
52
55
|
allowedOutputs.indexOf(args.options.value) === -1) {
|
|
53
56
|
return `${args.options.value} is not a valid value for the option ${args.options.key}. Allowed values: ${allowedOutputs.join(', ')}`;
|
|
@@ -29,8 +29,8 @@ class FlowGetCommand extends AzmgmtCommand_1.default {
|
|
|
29
29
|
.then((res) => {
|
|
30
30
|
res.displayName = res.properties.displayName;
|
|
31
31
|
res.description = res.properties.definitionSummary.description || '';
|
|
32
|
-
res.triggers =
|
|
33
|
-
res.actions =
|
|
32
|
+
res.triggers = res.properties.definitionSummary.triggers.map((t) => (t.type + (t.kind ? "-" + t.kind : ''))).join(', ');
|
|
33
|
+
res.actions = res.properties.definitionSummary.actions.map((a) => (a.type + (a.swaggerOperationId ? "-" + a.swaggerOperationId : ''))).join(', ');
|
|
34
34
|
logger.log(res);
|
|
35
35
|
cb();
|
|
36
36
|
}, (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
4
|
+
const commands_1 = require("../../commands");
|
|
5
|
+
class OutlookRoomListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
6
|
+
get name() {
|
|
7
|
+
return commands_1.default.ROOM_LIST;
|
|
8
|
+
}
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Get a collection of all available rooms';
|
|
11
|
+
}
|
|
12
|
+
getTelemetryProperties(args) {
|
|
13
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
14
|
+
telemetryProps.roomlistEmail = typeof args.options.roomlistEmail !== 'undefined';
|
|
15
|
+
return telemetryProps;
|
|
16
|
+
}
|
|
17
|
+
defaultProperties() {
|
|
18
|
+
return ['id', 'displayName', 'phone', 'emailAddress'];
|
|
19
|
+
}
|
|
20
|
+
commandAction(logger, args, cb) {
|
|
21
|
+
let endpoint = `${this.resource}/v1.0/places/microsoft.graph.room`;
|
|
22
|
+
if (args.options.roomlistEmail) {
|
|
23
|
+
endpoint = `${this.resource}/v1.0/places/${args.options.roomlistEmail}/microsoft.graph.roomlist/rooms`;
|
|
24
|
+
}
|
|
25
|
+
this
|
|
26
|
+
.getAllItems(endpoint, logger, true)
|
|
27
|
+
.then(() => {
|
|
28
|
+
logger.log(this.items);
|
|
29
|
+
cb();
|
|
30
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
31
|
+
}
|
|
32
|
+
options() {
|
|
33
|
+
const options = [
|
|
34
|
+
{
|
|
35
|
+
option: '--roomlistEmail [roomlistEmail]'
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
const parentOptions = super.options();
|
|
39
|
+
return options.concat(parentOptions);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
module.exports = new OutlookRoomListCommand();
|
|
43
|
+
//# sourceMappingURL=room-list.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
4
|
+
const commands_1 = require("../../commands");
|
|
5
|
+
class OutlookRoomListListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
6
|
+
get name() {
|
|
7
|
+
return commands_1.default.ROOMLIST_LIST;
|
|
8
|
+
}
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Get a collection of available roomlists';
|
|
11
|
+
}
|
|
12
|
+
defaultProperties() {
|
|
13
|
+
return ['id', 'displayName', 'phone', 'emailAddress'];
|
|
14
|
+
}
|
|
15
|
+
commandAction(logger, args, cb) {
|
|
16
|
+
this
|
|
17
|
+
.getAllItems(`${this.resource}/v1.0/places/microsoft.graph.roomlist`, logger, true)
|
|
18
|
+
.then(() => {
|
|
19
|
+
logger.log(this.items);
|
|
20
|
+
cb();
|
|
21
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
module.exports = new OutlookRoomListListCommand();
|
|
25
|
+
//# sourceMappingURL=roomlist-list.js.map
|
|
@@ -16,6 +16,8 @@ exports.default = {
|
|
|
16
16
|
REPORT_MAILBOXUSAGEMAILBOXCOUNT: `${prefix} report mailboxusagemailboxcount`,
|
|
17
17
|
REPORT_MAILBOXUSAGEQUOTASTATUSMAILBOXCOUNTS: `${prefix} report mailboxusagequotastatusmailboxcounts`,
|
|
18
18
|
REPORT_MAILBOXUSAGESTORAGE: `${prefix} report mailboxusagestorage`,
|
|
19
|
+
ROOM_LIST: `${prefix} room list`,
|
|
20
|
+
ROOMLIST_LIST: `${prefix} roomlist list`,
|
|
19
21
|
SENDMAIL: `${prefix} sendmail`
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const path = require("path");
|
|
4
|
-
const xmldom_1 = require("xmldom");
|
|
4
|
+
const xmldom_1 = require("@xmldom/xmldom");
|
|
5
5
|
/*
|
|
6
6
|
* Logic extracted from bolt.module.solution.dll
|
|
7
7
|
* Version: 0.4.3
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
5
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class PlannerTaskAddCommand extends GraphCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.TASK_ADD;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Adds a new Microsoft Planner Task';
|
|
13
|
+
}
|
|
14
|
+
getTelemetryProperties(args) {
|
|
15
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
+
telemetryProps.planId = typeof args.options.planId !== 'undefined';
|
|
17
|
+
telemetryProps.planName = typeof args.options.planName !== 'undefined';
|
|
18
|
+
telemetryProps.ownerGroupId = typeof args.options.ownerGroupId !== 'undefined';
|
|
19
|
+
telemetryProps.ownerGroupName = typeof args.options.ownerGroupName !== 'undefined';
|
|
20
|
+
telemetryProps.bucketId = typeof args.options.bucketId !== 'undefined';
|
|
21
|
+
telemetryProps.bucketName = typeof args.options.bucketName !== 'undefined';
|
|
22
|
+
telemetryProps.startDateTime = typeof args.options.startDateTime !== 'undefined';
|
|
23
|
+
telemetryProps.dueDateTime = typeof args.options.dueDateTime !== 'undefined';
|
|
24
|
+
telemetryProps.percentComplete = typeof args.options.percentComplete !== 'undefined';
|
|
25
|
+
telemetryProps.assignedToUserIds = typeof args.options.assignedToUserIds !== 'undefined';
|
|
26
|
+
telemetryProps.assignedToUserNames = typeof args.options.assignedToUserNames !== 'undefined';
|
|
27
|
+
telemetryProps.description = typeof args.options.description !== 'undefined';
|
|
28
|
+
telemetryProps.orderHint = typeof args.options.orderHint !== 'undefined';
|
|
29
|
+
return telemetryProps;
|
|
30
|
+
}
|
|
31
|
+
commandAction(logger, args, cb) {
|
|
32
|
+
this
|
|
33
|
+
.getPlanId(args)
|
|
34
|
+
.then(planId => {
|
|
35
|
+
this.planId = planId;
|
|
36
|
+
return this.getBucketId(args, planId);
|
|
37
|
+
})
|
|
38
|
+
.then(bucketId => {
|
|
39
|
+
this.bucketId = bucketId;
|
|
40
|
+
return this.generateUserAssignments(args);
|
|
41
|
+
})
|
|
42
|
+
.then(assignments => {
|
|
43
|
+
const requestOptions = {
|
|
44
|
+
url: `${this.resource}/v1.0/planner/tasks`,
|
|
45
|
+
headers: {
|
|
46
|
+
'accept': 'application/json;odata.metadata=none'
|
|
47
|
+
},
|
|
48
|
+
responseType: 'json',
|
|
49
|
+
data: {
|
|
50
|
+
planId: this.planId,
|
|
51
|
+
bucketId: this.bucketId,
|
|
52
|
+
title: args.options.title,
|
|
53
|
+
startDateTime: args.options.startDateTime,
|
|
54
|
+
dueDateTime: args.options.dueDateTime,
|
|
55
|
+
percentComplete: args.options.percentComplete,
|
|
56
|
+
assignments: assignments,
|
|
57
|
+
orderHint: args.options.orderHint
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return request_1.default.post(requestOptions);
|
|
61
|
+
})
|
|
62
|
+
.then(newTask => this.updateTaskDetails(args.options, newTask))
|
|
63
|
+
.then((res) => {
|
|
64
|
+
logger.log(res);
|
|
65
|
+
cb();
|
|
66
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
67
|
+
}
|
|
68
|
+
getTaskDetailsEtag(taskId) {
|
|
69
|
+
const requestOptions = {
|
|
70
|
+
url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(taskId)}/details`,
|
|
71
|
+
headers: {
|
|
72
|
+
accept: 'application/json'
|
|
73
|
+
},
|
|
74
|
+
responseType: 'json'
|
|
75
|
+
};
|
|
76
|
+
return request_1.default
|
|
77
|
+
.get(requestOptions)
|
|
78
|
+
.then((response) => {
|
|
79
|
+
const etag = response ? response['@odata.etag'] : undefined;
|
|
80
|
+
if (!etag) {
|
|
81
|
+
return Promise.reject(`Error fetching task details`);
|
|
82
|
+
}
|
|
83
|
+
return Promise.resolve(etag);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
updateTaskDetails(options, newTask) {
|
|
87
|
+
const taskId = newTask.id;
|
|
88
|
+
if (!options.description) {
|
|
89
|
+
return Promise.resolve(newTask);
|
|
90
|
+
}
|
|
91
|
+
return this
|
|
92
|
+
.getTaskDetailsEtag(taskId)
|
|
93
|
+
.then(etag => {
|
|
94
|
+
const requestOptionsTaskDetails = {
|
|
95
|
+
url: `${this.resource}/v1.0/planner/tasks/${taskId}/details`,
|
|
96
|
+
headers: {
|
|
97
|
+
'accept': 'application/json;odata.metadata=none',
|
|
98
|
+
'If-Match': etag,
|
|
99
|
+
'Prefer': 'return=representation'
|
|
100
|
+
},
|
|
101
|
+
responseType: 'json',
|
|
102
|
+
data: {
|
|
103
|
+
description: options.description
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return request_1.default.patch(requestOptionsTaskDetails);
|
|
107
|
+
})
|
|
108
|
+
.then(taskDetails => {
|
|
109
|
+
return Object.assign(Object.assign({}, newTask), taskDetails);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
generateUserAssignments(args) {
|
|
113
|
+
const assignments = {};
|
|
114
|
+
if (!args.options.assignedToUserIds && !args.options.assignedToUserNames) {
|
|
115
|
+
return Promise.resolve(assignments);
|
|
116
|
+
}
|
|
117
|
+
return this
|
|
118
|
+
.getUserIds(args.options)
|
|
119
|
+
.then((userIds) => {
|
|
120
|
+
userIds.map(x => assignments[x] = {
|
|
121
|
+
'@odata.type': '#microsoft.graph.plannerAssignment',
|
|
122
|
+
orderHint: ' !'
|
|
123
|
+
});
|
|
124
|
+
return Promise.resolve(assignments);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
getBucketId(args, planId) {
|
|
128
|
+
if (args.options.bucketId) {
|
|
129
|
+
return Promise.resolve(args.options.bucketId);
|
|
130
|
+
}
|
|
131
|
+
const requestOptions = {
|
|
132
|
+
url: `${this.resource}/v1.0/planner/plans/${planId}/buckets`,
|
|
133
|
+
headers: {
|
|
134
|
+
accept: 'application/json;odata.metadata=none'
|
|
135
|
+
},
|
|
136
|
+
responseType: 'json'
|
|
137
|
+
};
|
|
138
|
+
return request_1.default
|
|
139
|
+
.get(requestOptions)
|
|
140
|
+
.then((response) => {
|
|
141
|
+
const bucket = response.value.find(val => val.name === args.options.bucketName);
|
|
142
|
+
if (!bucket) {
|
|
143
|
+
return Promise.reject(`The specified bucket does not exist`);
|
|
144
|
+
}
|
|
145
|
+
return Promise.resolve(bucket.id);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
getPlanId(args) {
|
|
149
|
+
if (args.options.planId) {
|
|
150
|
+
return Promise.resolve(args.options.planId);
|
|
151
|
+
}
|
|
152
|
+
return this
|
|
153
|
+
.getGroupId(args)
|
|
154
|
+
.then((groupId) => {
|
|
155
|
+
const requestOptions = {
|
|
156
|
+
url: `${this.resource}/v1.0/planner/plans?$filter=(owner eq '${groupId}')`,
|
|
157
|
+
headers: {
|
|
158
|
+
accept: 'application/json;odata.metadata=none'
|
|
159
|
+
},
|
|
160
|
+
responseType: 'json'
|
|
161
|
+
};
|
|
162
|
+
return request_1.default.get(requestOptions);
|
|
163
|
+
}).then((response) => {
|
|
164
|
+
const plan = response.value.find(val => val.title === args.options.planName);
|
|
165
|
+
if (!plan) {
|
|
166
|
+
return Promise.reject(`The specified plan does not exist`);
|
|
167
|
+
}
|
|
168
|
+
return Promise.resolve(plan.id);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
getGroupId(args) {
|
|
172
|
+
if (args.options.ownerGroupId) {
|
|
173
|
+
return Promise.resolve(args.options.ownerGroupId);
|
|
174
|
+
}
|
|
175
|
+
const requestOptions = {
|
|
176
|
+
url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.ownerGroupName)}'`,
|
|
177
|
+
headers: {
|
|
178
|
+
accept: 'application/json;odata.metadata=none'
|
|
179
|
+
},
|
|
180
|
+
responseType: 'json'
|
|
181
|
+
};
|
|
182
|
+
return request_1.default
|
|
183
|
+
.get(requestOptions)
|
|
184
|
+
.then(response => {
|
|
185
|
+
const group = response.value[0];
|
|
186
|
+
if (!group) {
|
|
187
|
+
return Promise.reject(`The specified owner group does not exist`);
|
|
188
|
+
}
|
|
189
|
+
return Promise.resolve(group.id);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
getUserIds(options) {
|
|
193
|
+
if (options.assignedToUserIds) {
|
|
194
|
+
return Promise.resolve(options.assignedToUserIds.split(','));
|
|
195
|
+
}
|
|
196
|
+
// Hitting this section means assignedToUserNames won't be undefined
|
|
197
|
+
const userNames = options.assignedToUserNames;
|
|
198
|
+
const userArr = userNames.split(',').map(o => o.trim());
|
|
199
|
+
let userIds = [];
|
|
200
|
+
const promises = userArr.map(user => {
|
|
201
|
+
const requestOptions = {
|
|
202
|
+
url: `${this.resource}/v1.0/users?$filter=userPrincipalName eq '${Utils_1.default.encodeQueryParameter(user)}'&$select=id,userPrincipalName`,
|
|
203
|
+
headers: {
|
|
204
|
+
'content-type': 'application/json'
|
|
205
|
+
},
|
|
206
|
+
responseType: 'json'
|
|
207
|
+
};
|
|
208
|
+
return request_1.default.get(requestOptions);
|
|
209
|
+
});
|
|
210
|
+
return Promise
|
|
211
|
+
.all(promises)
|
|
212
|
+
.then((usersRes) => {
|
|
213
|
+
let userUpns = [];
|
|
214
|
+
userUpns = usersRes.map(res => { var _a; return (_a = res.value[0]) === null || _a === void 0 ? void 0 : _a.userPrincipalName; });
|
|
215
|
+
userIds = usersRes.map(res => { var _a; return (_a = res.value[0]) === null || _a === void 0 ? void 0 : _a.id; });
|
|
216
|
+
// Find the members where no graph response was found
|
|
217
|
+
const invalidUsers = userArr.filter(user => !userUpns.some((upn) => (upn === null || upn === void 0 ? void 0 : upn.toLowerCase()) === user.toLowerCase()));
|
|
218
|
+
if (invalidUsers && invalidUsers.length > 0) {
|
|
219
|
+
return Promise.reject(`Cannot proceed with planner task creation. The following users provided are invalid : ${invalidUsers.join(',')}`);
|
|
220
|
+
}
|
|
221
|
+
return Promise.resolve(userIds);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
options() {
|
|
225
|
+
const options = [
|
|
226
|
+
{ option: '-t, --title <title>' },
|
|
227
|
+
{ option: '--planId [planId]' },
|
|
228
|
+
{ option: '--planName [planName]' },
|
|
229
|
+
{ option: '--ownerGroupId [ownerGroupId]' },
|
|
230
|
+
{ option: '--ownerGroupName [ownerGroupName]' },
|
|
231
|
+
{ option: '--bucketId [bucketId]' },
|
|
232
|
+
{ option: '--bucketName [bucketName]' },
|
|
233
|
+
{ option: '--startDateTime [startDateTime]' },
|
|
234
|
+
{ option: '--dueDateTime [dueDateTime]' },
|
|
235
|
+
{ option: '--percentComplete [percentComplete]' },
|
|
236
|
+
{ option: '--assignedToUserIds [assignedToUserIds]' },
|
|
237
|
+
{ option: '--assignedToUserNames [assignedToUserNames]' },
|
|
238
|
+
{ option: '--description [description]' },
|
|
239
|
+
{ option: '--orderHint [orderHint]' }
|
|
240
|
+
];
|
|
241
|
+
const parentOptions = super.options();
|
|
242
|
+
return options.concat(parentOptions);
|
|
243
|
+
}
|
|
244
|
+
validate(args) {
|
|
245
|
+
if (!args.options.planId && !args.options.planName) {
|
|
246
|
+
return 'Specify either planId or planName';
|
|
247
|
+
}
|
|
248
|
+
if (args.options.planId && args.options.planName) {
|
|
249
|
+
return 'Specify either planId or planName but not both';
|
|
250
|
+
}
|
|
251
|
+
if (args.options.planName && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
252
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planName';
|
|
253
|
+
}
|
|
254
|
+
if (args.options.planName && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
255
|
+
return 'Specify either ownerGroupId or ownerGroupName when using planName but not both';
|
|
256
|
+
}
|
|
257
|
+
if (args.options.ownerGroupId && !Utils_1.default.isValidGuid(args.options.ownerGroupId)) {
|
|
258
|
+
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
259
|
+
}
|
|
260
|
+
if (!args.options.bucketId && !args.options.bucketName) {
|
|
261
|
+
return 'Specify either bucketId or bucketName';
|
|
262
|
+
}
|
|
263
|
+
if (args.options.bucketId && args.options.bucketName) {
|
|
264
|
+
return 'Specify either bucketId or bucketName but not both';
|
|
265
|
+
}
|
|
266
|
+
if (args.options.startDateTime && !Utils_1.default.isValidISODateTime(args.options.startDateTime)) {
|
|
267
|
+
return 'The startDateTime is not a valid ISO date string';
|
|
268
|
+
}
|
|
269
|
+
if (args.options.dueDateTime && !Utils_1.default.isValidISODateTime(args.options.dueDateTime)) {
|
|
270
|
+
return 'The dueDateTime is not a valid ISO date string';
|
|
271
|
+
}
|
|
272
|
+
if (args.options.percentComplete && isNaN(args.options.percentComplete)) {
|
|
273
|
+
return `percentComplete is not a number`;
|
|
274
|
+
}
|
|
275
|
+
if (args.options.percentComplete && (args.options.percentComplete < 0 || args.options.percentComplete > 100)) {
|
|
276
|
+
return `percentComplete should be between 0 and 100 `;
|
|
277
|
+
}
|
|
278
|
+
if (args.options.assignedToUserIds && !Utils_1.default.isValidGuidArray(args.options.assignedToUserIds.split(','))) {
|
|
279
|
+
return 'assignedToUserIds contains invalid GUID';
|
|
280
|
+
}
|
|
281
|
+
if (args.options.assignedToUserIds && args.options.assignedToUserNames) {
|
|
282
|
+
return 'Specify either assignedToUserIds or assignedToUserNames but not both';
|
|
283
|
+
}
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
module.exports = new PlannerTaskAddCommand();
|
|
288
|
+
//# sourceMappingURL=task-add.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class PlannerTaskDetailsGetCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.TASK_DETAILS_GET;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Retrieve the details of the specified planner task';
|
|
12
|
+
}
|
|
13
|
+
commandAction(logger, args, cb) {
|
|
14
|
+
const requestOptions = {
|
|
15
|
+
url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(args.options.taskId)}/details`,
|
|
16
|
+
headers: {
|
|
17
|
+
accept: 'application/json;odata.metadata=none'
|
|
18
|
+
},
|
|
19
|
+
responseType: 'json'
|
|
20
|
+
};
|
|
21
|
+
request_1.default
|
|
22
|
+
.get(requestOptions)
|
|
23
|
+
.then((res) => {
|
|
24
|
+
logger.log(res);
|
|
25
|
+
cb();
|
|
26
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
27
|
+
}
|
|
28
|
+
options() {
|
|
29
|
+
const options = [
|
|
30
|
+
{
|
|
31
|
+
option: '-i, --taskId <taskId>'
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
const parentOptions = super.options();
|
|
35
|
+
return options.concat(parentOptions);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
module.exports = new PlannerTaskDetailsGetCommand();
|
|
39
|
+
//# sourceMappingURL=task-details-get.js.map
|