@pnp/cli-microsoft365 4.4.0-beta.f2c9817 → 4.4.0-beta.ffe290f

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.
@@ -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`
@@ -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
@@ -13,6 +13,7 @@ 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`,
16
17
  CHAT_MEMBER_LIST: `${prefix} chat member list`,
17
18
  CONVERSATIONMEMBER_ADD: `${prefix} conversationmember add`,
18
19
  CONVERSATIONMEMBER_LIST: `${prefix} conversationmember list`,
@@ -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
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "4.4.0-beta.f2c9817",
3
+ "version": "4.4.0-beta.ffe290f",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",