@pnp/cli-microsoft365 4.4.0-beta.1bd9aa9 → 5.0.0-beta.014983c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Utils.js +4 -0
- package/dist/cli/Cli.js +7 -9
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-list.js +7 -7
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +36 -12
- package/dist/m365/aad/commands/sp/sp-get.js +44 -21
- package/dist/m365/aad/commands/user/user-hibp.js +67 -0
- package/dist/m365/aad/commands.js +1 -0
- package/dist/m365/cli/commands/config/config-set.js +4 -1
- 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.js +2 -0
- package/dist/settingsNames.js +6 -1
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-list.md +4 -3
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.md +9 -0
- package/docs/docs/cmd/aad/sp/sp-get.md +2 -1
- package/docs/docs/cmd/aad/user/user-hibp.md +46 -0
- package/docs/docs/cmd/teams/chat/chat-list.md +30 -0
- package/docs/docs/cmd/teams/chat/chat-member-list.md +24 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
package/dist/Utils.js
CHANGED
|
@@ -51,6 +51,10 @@ class Utils {
|
|
|
51
51
|
const guidRegEx = new RegExp(/^19:[0-9a-zA-Z-_]+@thread\.(skype|tacv2)$/i);
|
|
52
52
|
return guidRegEx.test(guid);
|
|
53
53
|
}
|
|
54
|
+
static isValidTeamsChatId(guid) {
|
|
55
|
+
const guidRegEx = new RegExp(/^19:[0-9a-zA-Z-_]+(@thread\.v2|@unq\.gbl\.spaces)$/i);
|
|
56
|
+
return guidRegEx.test(guid);
|
|
57
|
+
}
|
|
54
58
|
static isValidUserPrincipalName(upn) {
|
|
55
59
|
const upnRegEx = new RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/i);
|
|
56
60
|
return upnRegEx.test(upn);
|
package/dist/cli/Cli.js
CHANGED
|
@@ -447,16 +447,14 @@ class Cli {
|
|
|
447
447
|
}
|
|
448
448
|
if (options.output === 'csv') {
|
|
449
449
|
const { stringify } = require('csv-stringify/sync');
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
header: Display the column names on the first line if the columns option is provided or discovered.
|
|
453
|
-
escape: Single character used for escaping; only apply to characters matching the quote and the escape options default to ".
|
|
454
|
-
quote: The quote characters surrounding a field, defaults to the " (double quotation marks), an empty quote value will preserve the original field, whether it contains quotation marks or not.
|
|
455
|
-
quoted: Boolean, default to false, quote all the non-empty fields even if not required.
|
|
456
|
-
quotedEmpty: Quote empty strings and overrides quoted_string on empty strings when defined; default is false.
|
|
457
|
-
*/
|
|
450
|
+
const cli = Cli.getInstance();
|
|
451
|
+
// https://csv.js.org/stringify/options/
|
|
458
452
|
return stringify(logStatement, {
|
|
459
|
-
header: true
|
|
453
|
+
header: cli.getSettingWithDefaultValue(settingsNames_1.settingsNames.csvHeader, true),
|
|
454
|
+
escape: cli.getSettingWithDefaultValue(settingsNames_1.settingsNames.csvEscape, '"'),
|
|
455
|
+
quote: cli.config.get(settingsNames_1.settingsNames.csvQuote),
|
|
456
|
+
quoted: cli.getSettingWithDefaultValue(settingsNames_1.settingsNames.csvQuoted, false),
|
|
457
|
+
quotedEmpty: cli.getSettingWithDefaultValue(settingsNames_1.settingsNames.csvQuotedEmpty, false)
|
|
460
458
|
});
|
|
461
459
|
}
|
|
462
460
|
// display object as a list of key-value pairs
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
4
|
const Utils_1 = require("../../../../Utils");
|
|
5
|
-
const
|
|
5
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
6
|
const commands_1 = require("../../commands");
|
|
7
|
-
class AadOAuth2GrantListCommand extends
|
|
7
|
+
class AadOAuth2GrantListCommand extends GraphCommand_1.default {
|
|
8
8
|
get name() {
|
|
9
9
|
return commands_1.default.OAUTH2GRANT_LIST;
|
|
10
10
|
}
|
|
@@ -19,9 +19,9 @@ class AadOAuth2GrantListCommand extends AadCommand_1.default {
|
|
|
19
19
|
logger.logToStderr(`Retrieving list of OAuth grants for the service principal...`);
|
|
20
20
|
}
|
|
21
21
|
const requestOptions = {
|
|
22
|
-
url: `${this.resource}/
|
|
22
|
+
url: `${this.resource}/v1.0/oauth2PermissionGrants?$filter=clientId eq '${encodeURIComponent(args.options.spObjectId)}'`,
|
|
23
23
|
headers: {
|
|
24
|
-
accept: 'application/json;odata=
|
|
24
|
+
accept: 'application/json;odata.metadata=none'
|
|
25
25
|
},
|
|
26
26
|
responseType: 'json'
|
|
27
27
|
};
|
|
@@ -37,15 +37,15 @@ class AadOAuth2GrantListCommand extends AadCommand_1.default {
|
|
|
37
37
|
options() {
|
|
38
38
|
const options = [
|
|
39
39
|
{
|
|
40
|
-
option: '-i, --
|
|
40
|
+
option: '-i, --spObjectId <spObjectId>'
|
|
41
41
|
}
|
|
42
42
|
];
|
|
43
43
|
const parentOptions = super.options();
|
|
44
44
|
return options.concat(parentOptions);
|
|
45
45
|
}
|
|
46
46
|
validate(args) {
|
|
47
|
-
if (!Utils_1.default.isValidGuid(args.options.
|
|
48
|
-
return `${args.options.
|
|
47
|
+
if (!Utils_1.default.isValidGuid(args.options.spObjectId)) {
|
|
48
|
+
return `${args.options.spObjectId} is not a valid GUID`;
|
|
49
49
|
}
|
|
50
50
|
return true;
|
|
51
51
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_1 = require("../../../../cli");
|
|
3
4
|
const request_1 = require("../../../../request");
|
|
4
5
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
5
6
|
const commands_1 = require("../../commands");
|
|
@@ -11,24 +12,47 @@ class AadOAuth2GrantRemoveCommand extends GraphCommand_1.default {
|
|
|
11
12
|
return 'Remove specified service principal OAuth2 permissions';
|
|
12
13
|
}
|
|
13
14
|
commandAction(logger, args, cb) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const removeOauth2Grant = () => {
|
|
16
|
+
if (this.verbose) {
|
|
17
|
+
logger.logToStderr(`Removing OAuth2 permissions...`);
|
|
18
|
+
}
|
|
19
|
+
const requestOptions = {
|
|
20
|
+
url: `${this.resource}/v1.0/oauth2PermissionGrants/${encodeURIComponent(args.options.grantId)}`,
|
|
21
|
+
headers: {
|
|
22
|
+
'accept': 'application/json;odata.metadata=none'
|
|
23
|
+
},
|
|
24
|
+
responseType: 'json'
|
|
25
|
+
};
|
|
26
|
+
request_1.default
|
|
27
|
+
.delete(requestOptions)
|
|
28
|
+
.then(_ => cb(), (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
|
|
23
29
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
if (args.options.confirm) {
|
|
31
|
+
removeOauth2Grant();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
cli_1.Cli.prompt({
|
|
35
|
+
type: 'confirm',
|
|
36
|
+
name: 'continue',
|
|
37
|
+
default: false,
|
|
38
|
+
message: `Are you sure you want to remove the OAuth2 permissions for ${args.options.grantId}?`
|
|
39
|
+
}, (result) => {
|
|
40
|
+
if (!result.continue) {
|
|
41
|
+
cb();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
removeOauth2Grant();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
27
48
|
}
|
|
28
49
|
options() {
|
|
29
50
|
const options = [
|
|
30
51
|
{
|
|
31
52
|
option: '-i, --grantId <grantId>'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
option: '--confirm'
|
|
32
56
|
}
|
|
33
57
|
];
|
|
34
58
|
const parentOptions = super.options();
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const request_1 = require("../../../../request");
|
|
4
4
|
const Utils_1 = require("../../../../Utils");
|
|
5
|
-
const
|
|
5
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
6
6
|
const commands_1 = require("../../commands");
|
|
7
|
-
class AadSpGetCommand extends
|
|
7
|
+
class AadSpGetCommand extends GraphCommand_1.default {
|
|
8
8
|
get name() {
|
|
9
9
|
return commands_1.default.SP_GET;
|
|
10
10
|
}
|
|
@@ -18,35 +18,58 @@ class AadSpGetCommand extends AadCommand_1.default {
|
|
|
18
18
|
telemetryProps.objectId = (!(!args.options.objectId)).toString();
|
|
19
19
|
return telemetryProps;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
if (
|
|
23
|
-
|
|
21
|
+
getSpId(args) {
|
|
22
|
+
if (args.options.objectId) {
|
|
23
|
+
return Promise.resolve(args.options.objectId);
|
|
24
24
|
}
|
|
25
25
|
let spMatchQuery = '';
|
|
26
|
-
if (args.options.
|
|
27
|
-
spMatchQuery = `appId eq '${encodeURIComponent(args.options.appId)}'`;
|
|
28
|
-
}
|
|
29
|
-
else if (args.options.objectId) {
|
|
30
|
-
spMatchQuery = `objectId eq '${encodeURIComponent(args.options.objectId)}'`;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
26
|
+
if (args.options.displayName) {
|
|
33
27
|
spMatchQuery = `displayName eq '${encodeURIComponent(args.options.displayName)}'`;
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
else if (args.options.appId) {
|
|
30
|
+
spMatchQuery = `appId eq '${encodeURIComponent(args.options.appId)}'`;
|
|
31
|
+
}
|
|
32
|
+
const idRequestOptions = {
|
|
33
|
+
url: `${this.resource}/v1.0/servicePrincipals?$filter=${spMatchQuery}`,
|
|
37
34
|
headers: {
|
|
38
|
-
accept: 'application/json;odata=
|
|
35
|
+
accept: 'application/json;odata.metadata=none'
|
|
39
36
|
},
|
|
40
37
|
responseType: 'json'
|
|
41
38
|
};
|
|
42
|
-
request_1.default
|
|
43
|
-
.get(
|
|
44
|
-
.then(
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
return request_1.default
|
|
40
|
+
.get(idRequestOptions)
|
|
41
|
+
.then(response => {
|
|
42
|
+
const spItem = response.value[0];
|
|
43
|
+
if (!spItem) {
|
|
44
|
+
return Promise.reject(`The specified Azure AD app does not exist`);
|
|
45
|
+
}
|
|
46
|
+
if (response.value.length > 1) {
|
|
47
|
+
return Promise.reject(`Multiple Azure AD apps with name ${args.options.displayName} found: ${response.value.map(x => x.id)}`);
|
|
47
48
|
}
|
|
49
|
+
return Promise.resolve(spItem.id);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
commandAction(logger, args, cb) {
|
|
53
|
+
if (this.verbose) {
|
|
54
|
+
logger.logToStderr(`Retrieving service principal information...`);
|
|
55
|
+
}
|
|
56
|
+
this
|
|
57
|
+
.getSpId(args)
|
|
58
|
+
.then((id) => {
|
|
59
|
+
const requestOptions = {
|
|
60
|
+
url: `${this.resource}/v1.0/servicePrincipals/${id}`,
|
|
61
|
+
headers: {
|
|
62
|
+
accept: 'application/json;odata.metadata=none',
|
|
63
|
+
'content-type': 'application/json;odata.metadata=none'
|
|
64
|
+
},
|
|
65
|
+
responseType: 'json'
|
|
66
|
+
};
|
|
67
|
+
return request_1.default.get(requestOptions);
|
|
68
|
+
})
|
|
69
|
+
.then((res) => {
|
|
70
|
+
logger.log(res);
|
|
48
71
|
cb();
|
|
49
|
-
}, (
|
|
72
|
+
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
50
73
|
}
|
|
51
74
|
options() {
|
|
52
75
|
const options = [
|
|
@@ -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
|
|
@@ -51,6 +51,7 @@ exports.default = {
|
|
|
51
51
|
SP_ADD: `${prefix} sp add`,
|
|
52
52
|
SP_GET: `${prefix} sp get`,
|
|
53
53
|
USER_GET: `${prefix} user get`,
|
|
54
|
+
USER_HIBP: `${prefix} user hibp`,
|
|
54
55
|
USER_LIST: `${prefix} user list`,
|
|
55
56
|
USER_PASSWORD_VALIDATE: `${prefix} user password validate`,
|
|
56
57
|
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(', ')}`;
|
|
@@ -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
|
|
@@ -13,6 +13,8 @@ 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`,
|
|
16
18
|
CONVERSATIONMEMBER_ADD: `${prefix} conversationmember add`,
|
|
17
19
|
CONVERSATIONMEMBER_LIST: `${prefix} conversationmember list`,
|
|
18
20
|
FUNSETTINGS_LIST: `${prefix} funsettings list`,
|
package/dist/settingsNames.js
CHANGED
|
@@ -5,7 +5,12 @@ const settingsNames = {
|
|
|
5
5
|
errorOutput: 'errorOutput',
|
|
6
6
|
output: 'output',
|
|
7
7
|
printErrorsAsPlainText: 'printErrorsAsPlainText',
|
|
8
|
-
showHelpOnFailure: 'showHelpOnFailure'
|
|
8
|
+
showHelpOnFailure: 'showHelpOnFailure',
|
|
9
|
+
csvHeader: 'csvHeader',
|
|
10
|
+
csvEscape: 'csvEscape',
|
|
11
|
+
csvQuote: 'csvQuote',
|
|
12
|
+
csvQuoted: 'csvQuoted',
|
|
13
|
+
csvQuotedEmpty: 'csvQuotedEmpty'
|
|
9
14
|
};
|
|
10
15
|
exports.settingsNames = settingsNames;
|
|
11
16
|
//# sourceMappingURL=settingsNames.js.map
|
|
@@ -10,7 +10,7 @@ m365 aad oauth2grant list [options]
|
|
|
10
10
|
|
|
11
11
|
## Options
|
|
12
12
|
|
|
13
|
-
`-i, --
|
|
13
|
+
`-i, --spObjectId <spObjectId>`
|
|
14
14
|
: objectId of the service principal for which the configured OAuth2 permission grants should be retrieved
|
|
15
15
|
|
|
16
16
|
--8<-- "docs/cmd/_global.md"
|
|
@@ -26,9 +26,10 @@ When using the text output type (default), the command lists only the values of
|
|
|
26
26
|
List OAuth2 permissions granted to service principal with `objectId` _b2307a39-e878-458b-bc90-03bc578531d6_.
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
m365 aad oauth2grant list --
|
|
29
|
+
m365 aad oauth2grant list --spObjectId b2307a39-e878-458b-bc90-03bc578531d6
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## More information
|
|
33
33
|
|
|
34
|
-
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
34
|
+
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
35
|
+
- List oauth2PermissionGrants: [https://docs.microsoft.com/en-us/graph/api/oauth2permissiongrant-list?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/oauth2permissiongrant-list?view=graph-rest-1.0)
|
|
@@ -13,6 +13,9 @@ m365 aad oauth2grant remove [options]
|
|
|
13
13
|
`-i, --grantId <grantId>`
|
|
14
14
|
: `objectId` of OAuth2 permission grant to remove
|
|
15
15
|
|
|
16
|
+
`--confirm`
|
|
17
|
+
: Do not prompt for confirmation before removing OAuth2 permission grant
|
|
18
|
+
|
|
16
19
|
--8<-- "docs/cmd/_global.md"
|
|
17
20
|
|
|
18
21
|
## Remarks
|
|
@@ -33,6 +36,12 @@ Remove the OAuth2 permission grant with ID _YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXk
|
|
|
33
36
|
m365 aad oauth2grant remove --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek
|
|
34
37
|
```
|
|
35
38
|
|
|
39
|
+
Remove the OAuth2 permission grant with ID _YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek_ without being asked for confirmation
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
m365 aad oauth2grant remove --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek --confirm
|
|
43
|
+
```
|
|
44
|
+
|
|
36
45
|
## More information
|
|
37
46
|
|
|
38
47
|
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
@@ -47,4 +47,5 @@ m365 aad sp get --objectId b2307a39-e878-458b-bc90-03bc578531dd
|
|
|
47
47
|
|
|
48
48
|
## More information
|
|
49
49
|
|
|
50
|
-
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
50
|
+
- Application and service principal objects in Azure Active Directory (Azure AD): [https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects)
|
|
51
|
+
- Get servicePrincipal: [https://docs.microsoft.com/en-us/graph/api/serviceprincipal-get?view=graph-rest-1.0](https://docs.microsoft.com/en-us/graph/api/serviceprincipal-get?view=graph-rest-1.0)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# aad user hibp
|
|
2
|
+
|
|
3
|
+
Allows you to retrieve all accounts that have been pwned with the specified username
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad user hibp [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-n, --userName <userName>`
|
|
14
|
+
: The name of the user to retrieve information for.
|
|
15
|
+
|
|
16
|
+
`--apiKey, <apiKey>`
|
|
17
|
+
: Have I been pwned `API Key`. You can buy it from [https://haveibeenpwned.com/API/Key](https://haveibeenpwned.com/API/Key)
|
|
18
|
+
|
|
19
|
+
`--domain, [domain]`
|
|
20
|
+
: Limit the returned breaches only contain results with the domain specified.
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
If the user with the specified user name doesn't involved in any breach, you will get a `No pwnage found` message when running in debug or verbose mode.
|
|
27
|
+
|
|
28
|
+
If `API Key` is invalid, you will get a `Required option apiKey not specified` error.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
Check if user with user name _account-exists@hibp-integration-tests.com_ is in a data breach
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
m365 aad user hibp --userName account-exists@hibp-integration-tests.com --apiKey _YOUR-API-KEY_
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Check if user with user name _account-exists@hibp-integration-tests.com_ is in a data breach against the domain specified
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
m365 aad user hibp --userName account-exists@hibp-integration-tests.com --apiKey _YOUR-API-KEY_ --domain adobe.com
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## More information
|
|
45
|
+
|
|
46
|
+
- Have I been pwned API documentation: [https://haveibeenpwned.com/API/v3](https://haveibeenpwned.com/API/v3)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# teams chat list
|
|
2
|
+
|
|
3
|
+
Lists all Microsoft Teams chat conversations for the current user.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 teams chat list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-t, --type [chatType]`
|
|
14
|
+
: The chat type to optionally filter chat conversations by type. The value can be `oneOnOne`, `group` or `meeting`.
|
|
15
|
+
|
|
16
|
+
--8<-- "docs/cmd/_global.md"
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
List all the Microsoft Teams chat conversations of the current user.
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
m365 teams chat list
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
List only the one on one Microsoft Teams chat conversations.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
m365 teams chat list --type oneOnOne
|
|
30
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# teams chat member list
|
|
2
|
+
|
|
3
|
+
Lists all members from a Microsoft Teams chat conversation.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 teams chat member list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-i, --chatId <chatId>`
|
|
14
|
+
: The ID of the chat conversation
|
|
15
|
+
|
|
16
|
+
--8<-- "docs/cmd/_global.md"
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
List the members from a Microsoft Teams chat conversation
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
m365 teams chat member list --chatId 19:8b081ef6-4792-4def-b2c9-c363a1bf41d5_5031bb31-22c0-4f6f-9f73-91d34ab2b32d@unq.gbl.spaces
|
|
24
|
+
```
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pnp/cli-microsoft365",
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "5.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@azure/msal-node": "^1.5.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-beta.014983c",
|
|
4
4
|
"description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"Laskewitz, Daniel <daniel@laskewitz.nl>",
|
|
123
123
|
"Lengelle, Veronique <25181757+veronicageek@users.noreply.github.com>",
|
|
124
124
|
"Levert, Sebastien <slevert@outlook.com>",
|
|
125
|
+
"Lingstuyl, Martin <martin@i4-you.com>",
|
|
125
126
|
"Maillot, Michaël <battosaimykle@gmail.com>",
|
|
126
127
|
"Mastykarz, Waldek <waldek@mastykarz.nl>",
|
|
127
128
|
"McDonnell, Kevin <kevin@mcd79.com>",
|