@pnp/cli-microsoft365 5.0.0-beta.2e2ba7d → 5.0.0-beta.4aa3f65
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 +1 -0
- package/README.md +1 -1
- package/dist/Utils.js +7 -0
- package/dist/api.d.ts +11 -0
- package/dist/api.js +17 -0
- package/dist/appInsights.js +2 -1
- package/dist/cli/Cli.js +38 -6
- package/dist/m365/aad/commands/app/app-add.js +43 -7
- package/dist/m365/aad/commands/group/group-list.js +41 -0
- package/dist/m365/aad/commands/o365group/{Group.js → GroupExtended.js} +1 -1
- 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/user/user-password-validate.js +42 -0
- package/dist/m365/aad/commands.js +3 -0
- package/dist/m365/app/commands/permission/permission-list.js +266 -0
- package/dist/m365/app/commands.js +7 -0
- package/dist/m365/base/AppCommand.js +76 -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/pa/cds-project-mutator.js +1 -1
- package/dist/m365/pa/commands/app/app-list.js +28 -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 +64 -13
- 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/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/message/message-get.js +1 -1
- package/dist/m365/teams/commands/tab/tab-get.js +9 -6
- package/dist/m365/teams/commands.js +3 -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/request.js +9 -4
- package/dist/settingsNames.js +6 -1
- package/docs/docs/cmd/_global.md +2 -2
- package/docs/docs/cmd/aad/group/group-list.md +21 -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/aad/user/user-password-validate.md +29 -0
- package/docs/docs/cmd/app/permission/permission-list.md +36 -0
- package/docs/docs/cmd/pa/app/app-list.md +17 -1
- 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 +24 -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/spfx/project/project-externalize.md +1 -1
- package/docs/docs/cmd/spfx/project/project-rename.md +1 -1
- package/docs/docs/cmd/spfx/spfx-doctor.md +1 -1
- package/docs/docs/cmd/spo/group/group-user-add.md +24 -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 +1 -1
- 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/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 +1298 -1501
- package/package.json +34 -27
- package/dist/m365/base/AadCommand.js +0 -10
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_1 = require("../../../../cli");
|
|
4
|
+
const request_1 = require("../../../../request");
|
|
5
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
6
|
+
const commands_1 = require("../../commands");
|
|
7
|
+
class SpoGroupUserRemoveCommand extends SpoCommand_1.default {
|
|
8
|
+
get name() {
|
|
9
|
+
return commands_1.default.GROUP_USER_REMOVE;
|
|
10
|
+
}
|
|
11
|
+
get description() {
|
|
12
|
+
return 'Removes the specified user from a SharePoint group';
|
|
13
|
+
}
|
|
14
|
+
getTelemetryProperties(args) {
|
|
15
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
16
|
+
telemetryProps.groupId = (!(!args.options.groupId)).toString();
|
|
17
|
+
telemetryProps.groupName = (!(!args.options.groupName)).toString();
|
|
18
|
+
telemetryProps.confirm = (!(!args.options.confirm)).toString();
|
|
19
|
+
return telemetryProps;
|
|
20
|
+
}
|
|
21
|
+
commandAction(logger, args, cb) {
|
|
22
|
+
const removeUserfromSPGroup = () => {
|
|
23
|
+
if (this.verbose) {
|
|
24
|
+
logger.logToStderr(`Removing User with Username ${args.options.userName} from Group: ${args.options.groupId ? args.options.groupId : args.options.groupName}`);
|
|
25
|
+
}
|
|
26
|
+
const loginName = `i:0#.f|membership|${args.options.userName}`;
|
|
27
|
+
const requestUrl = `${args.options.webUrl}/_api/web/sitegroups/${args.options.groupId
|
|
28
|
+
? `GetById('${encodeURIComponent(args.options.groupId)}')`
|
|
29
|
+
: `GetByName('${encodeURIComponent(args.options.groupName)}')`}/users/removeByLoginName(@LoginName)?@LoginName='${encodeURIComponent(loginName)}'`;
|
|
30
|
+
const requestOptions = {
|
|
31
|
+
url: requestUrl,
|
|
32
|
+
headers: {
|
|
33
|
+
'accept': 'application/json;odata=nometadata'
|
|
34
|
+
},
|
|
35
|
+
responseType: 'json'
|
|
36
|
+
};
|
|
37
|
+
request_1.default
|
|
38
|
+
.post(requestOptions)
|
|
39
|
+
.then(() => {
|
|
40
|
+
cb();
|
|
41
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
42
|
+
};
|
|
43
|
+
if (args.options.confirm) {
|
|
44
|
+
if (this.debug) {
|
|
45
|
+
logger.logToStderr('Confirmation bypassed by entering confirm option. Removing the user from SharePoint Group...');
|
|
46
|
+
}
|
|
47
|
+
removeUserfromSPGroup();
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
cli_1.Cli.prompt({
|
|
51
|
+
type: 'confirm',
|
|
52
|
+
name: 'continue',
|
|
53
|
+
default: false,
|
|
54
|
+
message: `Are you sure you want to remove user User ${args.options.userName} from SharePoint group?`
|
|
55
|
+
}, (result) => {
|
|
56
|
+
if (!result.continue) {
|
|
57
|
+
cb();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
removeUserfromSPGroup();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
options() {
|
|
66
|
+
const options = [
|
|
67
|
+
{
|
|
68
|
+
option: '-u, --webUrl <webUrl>'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
option: '--groupId [groupId]'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
option: '--groupName [groupName]'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
option: '--userName <userName>'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
option: '--confirm'
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
const parentOptions = super.options();
|
|
84
|
+
return options.concat(parentOptions);
|
|
85
|
+
}
|
|
86
|
+
validate(args) {
|
|
87
|
+
if (args.options.groupId && args.options.groupName) {
|
|
88
|
+
return 'Use either "groupName" or "groupId", but not both';
|
|
89
|
+
}
|
|
90
|
+
if (!args.options.groupId && !args.options.groupName) {
|
|
91
|
+
return 'Either "groupName" or "groupId" is required';
|
|
92
|
+
}
|
|
93
|
+
if (args.options.groupId && isNaN(args.options.groupId)) {
|
|
94
|
+
return `Specified "groupId" ${args.options.groupId} is not valid`;
|
|
95
|
+
}
|
|
96
|
+
return SpoCommand_1.default.isValidSharePointUrl(args.options.webUrl);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
module.exports = new SpoGroupUserRemoveCommand();
|
|
100
|
+
//# sourceMappingURL=group-user-remove.js.map
|
|
@@ -59,7 +59,7 @@ class SpoSiteEnsureCommand extends SpoCommand_1.default {
|
|
|
59
59
|
if (this.debug) {
|
|
60
60
|
logger.logToStderr(err.stderr);
|
|
61
61
|
}
|
|
62
|
-
if (err.error.message !== '
|
|
62
|
+
if (err.error.message !== '404 FILE NOT FOUND') {
|
|
63
63
|
return Promise.reject(err);
|
|
64
64
|
}
|
|
65
65
|
if (this.verbose) {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class SpoSiteRecycleBinItemListCommand extends SpoCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.SITE_RECYCLEBINITEM_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists items from recycle bin';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['Id', 'Title', 'DirName'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
if (this.verbose) {
|
|
18
|
+
logger.logToStderr(`Retrieving all items from recycle bin at ${args.options.siteUrl}...`);
|
|
19
|
+
}
|
|
20
|
+
const state = args.options.secondary ? '2' : '1';
|
|
21
|
+
let requestUrl = `${args.options.siteUrl}/_api/site/RecycleBin?$filter=(ItemState eq ${state})`;
|
|
22
|
+
if (typeof args.options.type !== 'undefined') {
|
|
23
|
+
const type = SpoSiteRecycleBinItemListCommand.recycleBinItemType.find(item => item.value === args.options.type);
|
|
24
|
+
if (typeof type !== 'undefined') {
|
|
25
|
+
requestUrl += ` and (ItemType eq ${type.id})`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const requestOptions = {
|
|
29
|
+
url: requestUrl,
|
|
30
|
+
headers: {
|
|
31
|
+
'accept': 'application/json;odata=nometadata'
|
|
32
|
+
},
|
|
33
|
+
responseType: 'json'
|
|
34
|
+
};
|
|
35
|
+
request_1.default
|
|
36
|
+
.get(requestOptions)
|
|
37
|
+
.then((response) => {
|
|
38
|
+
logger.log(response.value);
|
|
39
|
+
cb();
|
|
40
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
41
|
+
}
|
|
42
|
+
options() {
|
|
43
|
+
const options = [
|
|
44
|
+
{
|
|
45
|
+
option: '-u, --siteUrl <siteUrl>'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
option: '-t, --type [type]',
|
|
49
|
+
autocomplete: SpoSiteRecycleBinItemListCommand.recycleBinItemType.map(item => item.value)
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
option: '-s, --secondary'
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
const parentOptions = super.options();
|
|
56
|
+
return options.concat(parentOptions);
|
|
57
|
+
}
|
|
58
|
+
validate(args) {
|
|
59
|
+
const isValidSharePointUrl = SpoCommand_1.default.isValidSharePointUrl(args.options.siteUrl);
|
|
60
|
+
if (isValidSharePointUrl !== true) {
|
|
61
|
+
return isValidSharePointUrl;
|
|
62
|
+
}
|
|
63
|
+
if (typeof args.options.type !== 'undefined' &&
|
|
64
|
+
!SpoSiteRecycleBinItemListCommand.recycleBinItemType.some(item => item.value === args.options.type)) {
|
|
65
|
+
return `${args.options.type} is not a valid value. Allowed values are ${SpoSiteRecycleBinItemListCommand.recycleBinItemType.map(item => item.value).join(', ')}`;
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
SpoSiteRecycleBinItemListCommand.recycleBinItemType = [
|
|
71
|
+
{ id: 1, value: 'files' },
|
|
72
|
+
{ id: 3, value: 'listItems' },
|
|
73
|
+
{ id: 5, value: 'folders' }
|
|
74
|
+
];
|
|
75
|
+
module.exports = new SpoSiteRecycleBinItemListCommand();
|
|
76
|
+
//# sourceMappingURL=site-recyclebinitem-list.js.map
|
|
@@ -64,6 +64,7 @@ exports.default = {
|
|
|
64
64
|
GROUP_REMOVE: `${prefix} group remove`,
|
|
65
65
|
GROUP_USER_ADD: `${prefix} group user add`,
|
|
66
66
|
GROUP_USER_LIST: `${prefix} group user list`,
|
|
67
|
+
GROUP_USER_REMOVE: `${prefix} group user remove`,
|
|
67
68
|
HIDEDEFAULTTHEMES_GET: `${prefix} hidedefaultthemes get`,
|
|
68
69
|
HIDEDEFAULTTHEMES_SET: `${prefix} hidedefaultthemes set`,
|
|
69
70
|
HOMESITE_GET: `${prefix} homesite get`,
|
|
@@ -183,6 +184,7 @@ exports.default = {
|
|
|
183
184
|
SITE_GROUPIFY: `${prefix} site groupify`,
|
|
184
185
|
SITE_LIST: `${prefix} site list`,
|
|
185
186
|
SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
|
|
187
|
+
SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
|
|
186
188
|
SITE_REMOVE: `${prefix} site remove`,
|
|
187
189
|
SITE_RENAME: `${prefix} site rename`,
|
|
188
190
|
SITE_SET: `${prefix} site set`,
|
|
@@ -25,24 +25,27 @@ class TeamsAppListCommand extends GraphItemsListCommand_1.GraphItemsListCommand
|
|
|
25
25
|
if (args.options.teamId) {
|
|
26
26
|
return Promise.resolve(args.options.teamId);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
url: `${this.resource}/v1.0/
|
|
28
|
+
const requestOptions = {
|
|
29
|
+
url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
|
|
30
30
|
headers: {
|
|
31
31
|
accept: 'application/json;odata.metadata=none'
|
|
32
32
|
},
|
|
33
33
|
responseType: 'json'
|
|
34
34
|
};
|
|
35
35
|
return request_1.default
|
|
36
|
-
.get(
|
|
36
|
+
.get(requestOptions)
|
|
37
37
|
.then(response => {
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
38
|
+
const groupItem = response.value[0];
|
|
39
|
+
if (!groupItem) {
|
|
40
|
+
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
41
|
+
}
|
|
42
|
+
if (groupItem.resourceProvisioningOptions.indexOf('Team') === -1) {
|
|
40
43
|
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
41
44
|
}
|
|
42
45
|
if (response.value.length > 1) {
|
|
43
46
|
return Promise.reject(`Multiple Microsoft Teams teams with name ${args.options.teamName} found: ${response.value.map(x => x.id)}`);
|
|
44
47
|
}
|
|
45
|
-
return Promise.resolve(
|
|
48
|
+
return Promise.resolve(groupItem.id);
|
|
46
49
|
});
|
|
47
50
|
}
|
|
48
51
|
getEndpointUrl(args) {
|
|
@@ -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 TeamsChatListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
6
|
+
get name() {
|
|
7
|
+
return commands_1.default.CHAT_LIST;
|
|
8
|
+
}
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Lists all chat conversations';
|
|
11
|
+
}
|
|
12
|
+
defaultProperties() {
|
|
13
|
+
return ['id', 'topic', 'chatType'];
|
|
14
|
+
}
|
|
15
|
+
commandAction(logger, args, cb) {
|
|
16
|
+
const filter = args.options.type !== undefined ? `?$filter=chatType eq '${args.options.type}'` : '';
|
|
17
|
+
const endpoint = `${this.resource}/v1.0/chats${filter}`;
|
|
18
|
+
this
|
|
19
|
+
.getAllItems(endpoint, logger, true)
|
|
20
|
+
.then(() => {
|
|
21
|
+
logger.log(this.items);
|
|
22
|
+
cb();
|
|
23
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
24
|
+
}
|
|
25
|
+
options() {
|
|
26
|
+
const options = [
|
|
27
|
+
{
|
|
28
|
+
option: '-t, --type [chatType]'
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
const parentOptions = super.options();
|
|
32
|
+
return options.concat(parentOptions);
|
|
33
|
+
}
|
|
34
|
+
validate(args) {
|
|
35
|
+
const supportedTypes = ['oneOnOne', 'group', 'meeting'];
|
|
36
|
+
if (args.options.type !== undefined && supportedTypes.indexOf(args.options.type) === -1) {
|
|
37
|
+
return `${args.options.type} is not a valid chatType. Accepted values are ${supportedTypes.join(', ')}`;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
module.exports = new TeamsChatListCommand();
|
|
43
|
+
//# sourceMappingURL=chat-list.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class TeamsChatMemberListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.CHAT_MEMBER_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists all members from a chat';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['userId', 'displayName', 'email'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/members`;
|
|
18
|
+
this
|
|
19
|
+
.getAllItems(endpoint, logger, true)
|
|
20
|
+
.then(() => {
|
|
21
|
+
logger.log(this.items);
|
|
22
|
+
cb();
|
|
23
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
24
|
+
}
|
|
25
|
+
options() {
|
|
26
|
+
const options = [
|
|
27
|
+
{
|
|
28
|
+
option: '-i, --chatId <chatId>'
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
const parentOptions = super.options();
|
|
32
|
+
return options.concat(parentOptions);
|
|
33
|
+
}
|
|
34
|
+
validate(args) {
|
|
35
|
+
if (!Utils_1.default.isValidTeamsChatId(args.options.chatId)) {
|
|
36
|
+
return `${args.options.chatId} is not a valid Teams ChatId`;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
module.exports = new TeamsChatMemberListCommand();
|
|
42
|
+
//# sourceMappingURL=chat-member-list.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
|
+
const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class TeamsChatMessageListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.CHAT_MESSAGE_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Lists all messages from a chat';
|
|
12
|
+
}
|
|
13
|
+
defaultProperties() {
|
|
14
|
+
return ['id', 'shortBody'];
|
|
15
|
+
}
|
|
16
|
+
commandAction(logger, args, cb) {
|
|
17
|
+
const endpoint = `${this.resource}/v1.0/chats/${args.options.chatId}/messages`;
|
|
18
|
+
this
|
|
19
|
+
.getAllItems(endpoint, logger, true)
|
|
20
|
+
.then(() => {
|
|
21
|
+
if (args.options.output !== 'json') {
|
|
22
|
+
this.items.forEach(i => {
|
|
23
|
+
// hoist the content to body for readability
|
|
24
|
+
i.body = i.body.content;
|
|
25
|
+
let shortBody;
|
|
26
|
+
const bodyToProcess = i.body;
|
|
27
|
+
if (bodyToProcess) {
|
|
28
|
+
let maxLength = 50;
|
|
29
|
+
let addedDots = '...';
|
|
30
|
+
if (bodyToProcess.length < maxLength) {
|
|
31
|
+
maxLength = bodyToProcess.length;
|
|
32
|
+
addedDots = '';
|
|
33
|
+
}
|
|
34
|
+
shortBody = bodyToProcess.replace(/\n/g, ' ').substring(0, maxLength) + addedDots;
|
|
35
|
+
}
|
|
36
|
+
i.shortBody = shortBody;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
logger.log(this.items);
|
|
40
|
+
cb();
|
|
41
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
42
|
+
}
|
|
43
|
+
options() {
|
|
44
|
+
const options = [
|
|
45
|
+
{
|
|
46
|
+
option: '-i, --chatId <chatId>'
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
const parentOptions = super.options();
|
|
50
|
+
return options.concat(parentOptions);
|
|
51
|
+
}
|
|
52
|
+
validate(args) {
|
|
53
|
+
if (!Utils_1.default.isValidTeamsChatId(args.options.chatId)) {
|
|
54
|
+
return `${args.options.chatId} is not a valid Teams chat ID`;
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
module.exports = new TeamsChatMessageListCommand();
|
|
60
|
+
//# sourceMappingURL=chat-message-list.js.map
|
|
@@ -13,7 +13,7 @@ class TeamsMessageGetCommand extends GraphCommand_1.default {
|
|
|
13
13
|
}
|
|
14
14
|
commandAction(logger, args, cb) {
|
|
15
15
|
const requestOptions = {
|
|
16
|
-
url: `${this.resource}/
|
|
16
|
+
url: `${this.resource}/v1.0/teams/${args.options.teamId}/channels/${args.options.channelId}/messages/${args.options.messageId}`,
|
|
17
17
|
headers: {
|
|
18
18
|
accept: 'application/json;odata.metadata=none'
|
|
19
19
|
},
|
|
@@ -30,24 +30,27 @@ class TeamsTabGetCommand extends GraphCommand_1.default {
|
|
|
30
30
|
if (args.options.teamId) {
|
|
31
31
|
return Promise.resolve(args.options.teamId);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
url: `${this.resource}/v1.0/
|
|
33
|
+
const requestOptions = {
|
|
34
|
+
url: `${this.resource}/v1.0/groups?$filter=displayName eq '${encodeURIComponent(args.options.teamName)}'`,
|
|
35
35
|
headers: {
|
|
36
36
|
accept: 'application/json;odata.metadata=none'
|
|
37
37
|
},
|
|
38
38
|
responseType: 'json'
|
|
39
39
|
};
|
|
40
40
|
return request_1.default
|
|
41
|
-
.get(
|
|
41
|
+
.get(requestOptions)
|
|
42
42
|
.then(response => {
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
43
|
+
const groupItem = response.value[0];
|
|
44
|
+
if (!groupItem) {
|
|
45
|
+
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
46
|
+
}
|
|
47
|
+
if (groupItem.resourceProvisioningOptions.indexOf('Team') === -1) {
|
|
45
48
|
return Promise.reject(`The specified team does not exist in the Microsoft Teams`);
|
|
46
49
|
}
|
|
47
50
|
if (response.value.length > 1) {
|
|
48
51
|
return Promise.reject(`Multiple Microsoft Teams teams with name ${args.options.teamName} found: ${response.value.map(x => x.id)}`);
|
|
49
52
|
}
|
|
50
|
-
return Promise.resolve(
|
|
53
|
+
return Promise.resolve(groupItem.id);
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
getChannelId(args) {
|
|
@@ -13,6 +13,9 @@ exports.default = {
|
|
|
13
13
|
CHANNEL_LIST: `${prefix} channel list`,
|
|
14
14
|
CHANNEL_REMOVE: `${prefix} channel remove`,
|
|
15
15
|
CHANNEL_SET: `${prefix} channel set`,
|
|
16
|
+
CHAT_LIST: `${prefix} chat list`,
|
|
17
|
+
CHAT_MEMBER_LIST: `${prefix} chat member list`,
|
|
18
|
+
CHAT_MESSAGE_LIST: `${prefix} chat message list`,
|
|
16
19
|
CONVERSATIONMEMBER_ADD: `${prefix} conversationmember add`,
|
|
17
20
|
CONVERSATIONMEMBER_LIST: `${prefix} conversationmember list`,
|
|
18
21
|
FUNSETTINGS_LIST: `${prefix} funsettings list`,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
4
|
+
const request_1 = require("../../../../request");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class TenantServiceAnnouncementHealthGetCommand extends GraphCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.SERVICEANNOUNCEMENT_HEALTH_GET;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'This operation provides the health information of a specified service for a tenant';
|
|
12
|
+
}
|
|
13
|
+
getTelemetryProperties(args) {
|
|
14
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
15
|
+
telemetryProps.issues = typeof args.options.issues !== 'undefined';
|
|
16
|
+
return telemetryProps;
|
|
17
|
+
}
|
|
18
|
+
defaultProperties() {
|
|
19
|
+
return ['id', 'status', 'service'];
|
|
20
|
+
}
|
|
21
|
+
commandAction(logger, args, cb) {
|
|
22
|
+
this
|
|
23
|
+
.getServiceHealth(args.options)
|
|
24
|
+
.then((res) => {
|
|
25
|
+
logger.log(res);
|
|
26
|
+
cb();
|
|
27
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
28
|
+
}
|
|
29
|
+
getServiceHealth(options) {
|
|
30
|
+
const requestOptions = {
|
|
31
|
+
url: `${this.resource}/v1.0/admin/serviceAnnouncement/healthOverviews/${options.serviceName}${options.issues && (!options.output || options.output.toLocaleLowerCase() === 'json') ? '?$expand=issues' : ''}`,
|
|
32
|
+
headers: {
|
|
33
|
+
accept: 'application/json;odata.metadata=none'
|
|
34
|
+
},
|
|
35
|
+
responseType: 'json'
|
|
36
|
+
};
|
|
37
|
+
return request_1.default
|
|
38
|
+
.get(requestOptions)
|
|
39
|
+
.then(response => {
|
|
40
|
+
const serviceHealth = response;
|
|
41
|
+
if (!serviceHealth) {
|
|
42
|
+
return Promise.reject(`Error fetching service health`);
|
|
43
|
+
}
|
|
44
|
+
return Promise.resolve(serviceHealth);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
options() {
|
|
48
|
+
const options = [
|
|
49
|
+
{ option: '-s, --serviceName <serviceName>' },
|
|
50
|
+
{ option: '-i, --issues' }
|
|
51
|
+
];
|
|
52
|
+
const parentOptions = super.options();
|
|
53
|
+
return options.concat(parentOptions);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
module.exports = new TenantServiceAnnouncementHealthGetCommand();
|
|
57
|
+
//# sourceMappingURL=serviceannouncement-health-get.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
4
|
+
const request_1 = require("../../../../request");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class TenantServiceAnnouncementHealthListCommand extends GraphCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.SERVICEANNOUNCEMENT_HEALTH_LIST;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'This operation provides the health report of all subscribed services for a tenant';
|
|
12
|
+
}
|
|
13
|
+
getTelemetryProperties(args) {
|
|
14
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
15
|
+
telemetryProps.issues = typeof args.options.issues !== 'undefined';
|
|
16
|
+
return telemetryProps;
|
|
17
|
+
}
|
|
18
|
+
defaultProperties() {
|
|
19
|
+
return ['id', 'status', 'service'];
|
|
20
|
+
}
|
|
21
|
+
commandAction(logger, args, cb) {
|
|
22
|
+
this
|
|
23
|
+
.listServiceHealth(args.options)
|
|
24
|
+
.then((res) => {
|
|
25
|
+
logger.log(res);
|
|
26
|
+
cb();
|
|
27
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
28
|
+
}
|
|
29
|
+
listServiceHealth(options) {
|
|
30
|
+
const requestOptions = {
|
|
31
|
+
url: `${this.resource}/v1.0/admin/serviceAnnouncement/healthOverviews${options.issues && (!options.output || options.output.toLocaleLowerCase() === 'json') ? '?$expand=issues' : ''}`,
|
|
32
|
+
headers: {
|
|
33
|
+
accept: 'application/json;odata.metadata=none'
|
|
34
|
+
},
|
|
35
|
+
responseType: 'json'
|
|
36
|
+
};
|
|
37
|
+
return request_1.default
|
|
38
|
+
.get(requestOptions)
|
|
39
|
+
.then(response => {
|
|
40
|
+
const serviceHealthList = response.value;
|
|
41
|
+
if (!serviceHealthList) {
|
|
42
|
+
return Promise.reject(`Error fetching service health`);
|
|
43
|
+
}
|
|
44
|
+
return Promise.resolve(serviceHealthList);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
options() {
|
|
48
|
+
const options = [
|
|
49
|
+
{ option: '-i, --issues' }
|
|
50
|
+
];
|
|
51
|
+
const parentOptions = super.options();
|
|
52
|
+
return options.concat(parentOptions);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
module.exports = new TenantServiceAnnouncementHealthListCommand();
|
|
56
|
+
//# sourceMappingURL=serviceannouncement-health-list.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const request_1 = require("../../../../request");
|
|
4
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
5
|
+
const commands_1 = require("../../commands");
|
|
6
|
+
class TenantServiceAnnouncementHealthIssueGetCommand extends GraphCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.SERVICEANNOUNCEMENT_HEALTHISSUE_GET;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Gets a specified service health issue for tenant';
|
|
12
|
+
}
|
|
13
|
+
commandAction(logger, args, cb) {
|
|
14
|
+
const requestOptions = {
|
|
15
|
+
url: `${this.resource}/v1.0/admin/serviceAnnouncement/issues/${encodeURIComponent(args.options.id)}`,
|
|
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, --id <id>'
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
const parentOptions = super.options();
|
|
35
|
+
return options.concat(parentOptions);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
module.exports = new TenantServiceAnnouncementHealthIssueGetCommand();
|
|
39
|
+
//# sourceMappingURL=serviceannouncement-healthissue-get.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
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 TenantServiceAnnouncementHealthIssueListCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
|
|
6
|
+
get name() {
|
|
7
|
+
return commands_1.default.SERVICEANNOUNCEMENT_HEALTHISSUE_LIST;
|
|
8
|
+
}
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Gets all service health issues for the tenant';
|
|
11
|
+
}
|
|
12
|
+
defaultProperties() {
|
|
13
|
+
return ['id', 'title'];
|
|
14
|
+
}
|
|
15
|
+
commandAction(logger, args, cb) {
|
|
16
|
+
let endpoint = `${this.resource}/v1.0/admin/serviceAnnouncement/issues`;
|
|
17
|
+
if (args.options.service) {
|
|
18
|
+
endpoint += `?$filter=service eq '${encodeURIComponent(args.options.service)}'`;
|
|
19
|
+
}
|
|
20
|
+
this
|
|
21
|
+
.getAllItems(endpoint, logger, true)
|
|
22
|
+
.then(() => {
|
|
23
|
+
logger.log(this.items);
|
|
24
|
+
cb();
|
|
25
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
26
|
+
}
|
|
27
|
+
options() {
|
|
28
|
+
const options = [
|
|
29
|
+
{
|
|
30
|
+
option: '-s, --service [service]'
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
const parentOptions = super.options();
|
|
34
|
+
return options.concat(parentOptions);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
module.exports = new TenantServiceAnnouncementHealthIssueListCommand();
|
|
38
|
+
//# sourceMappingURL=serviceannouncement-healthissue-list.js.map
|