@pnp/cli-microsoft365 5.7.0-beta.9e8cf99 → 5.7.0-beta.a2f3d05

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,86 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var _BookingBusinessGetCommand_instances, _BookingBusinessGetCommand_initTelemetry, _BookingBusinessGetCommand_initOptions, _BookingBusinessGetCommand_initOptionSets;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const request_1 = require("../../../../request");
10
+ const GraphCommand_1 = require("../../../base/GraphCommand");
11
+ const commands_1 = require("../../commands");
12
+ class BookingBusinessGetCommand extends GraphCommand_1.default {
13
+ constructor() {
14
+ super();
15
+ _BookingBusinessGetCommand_instances.add(this);
16
+ __classPrivateFieldGet(this, _BookingBusinessGetCommand_instances, "m", _BookingBusinessGetCommand_initTelemetry).call(this);
17
+ __classPrivateFieldGet(this, _BookingBusinessGetCommand_instances, "m", _BookingBusinessGetCommand_initOptions).call(this);
18
+ __classPrivateFieldGet(this, _BookingBusinessGetCommand_instances, "m", _BookingBusinessGetCommand_initOptionSets).call(this);
19
+ }
20
+ get name() {
21
+ return commands_1.default.BUSINESS_GET;
22
+ }
23
+ get description() {
24
+ return 'Retrieve the specified Microsoft Bookings business.';
25
+ }
26
+ defaultProperties() {
27
+ return ['id', 'displayName', 'businessType', 'phone', 'email', 'defaultCurrencyIso'];
28
+ }
29
+ commandAction(logger, args, cb) {
30
+ this
31
+ .getBusinessId(args.options)
32
+ .then(businessId => {
33
+ const requestOptions = {
34
+ url: `${this.resource}/v1.0/solutions/bookingBusinesses/${encodeURIComponent(businessId)}`,
35
+ headers: {
36
+ accept: 'application/json;odata.metadata=none'
37
+ },
38
+ responseType: 'json'
39
+ };
40
+ return request_1.default.get(requestOptions);
41
+ })
42
+ .then(business => {
43
+ logger.log(business);
44
+ cb();
45
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
46
+ }
47
+ getBusinessId(options) {
48
+ if (options.id) {
49
+ return Promise.resolve(options.id);
50
+ }
51
+ const requestOptions = {
52
+ url: `${this.resource}/v1.0/solutions/bookingBusinesses`,
53
+ headers: {
54
+ accept: 'application/json;odata.metadata=none'
55
+ },
56
+ responseType: 'json'
57
+ };
58
+ return request_1.default
59
+ .get(requestOptions)
60
+ .then((response) => {
61
+ const name = options.name;
62
+ const bookingBusinesses = response.value.filter(val => { var _a; return ((_a = val.displayName) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === name.toLocaleLowerCase(); });
63
+ if (!bookingBusinesses.length) {
64
+ return Promise.reject(`The specified business with name ${options.name} does not exist.`);
65
+ }
66
+ if (bookingBusinesses.length > 1) {
67
+ return Promise.reject(`Multiple businesses with name ${options.name} found. Please disambiguate: ${bookingBusinesses.map(x => x.id).join(', ')}`);
68
+ }
69
+ return bookingBusinesses[0].id;
70
+ });
71
+ }
72
+ }
73
+ _BookingBusinessGetCommand_instances = new WeakSet(), _BookingBusinessGetCommand_initTelemetry = function _BookingBusinessGetCommand_initTelemetry() {
74
+ this.telemetry.push((args) => {
75
+ Object.assign(this.telemetryProperties, {
76
+ id: typeof args.options.id !== 'undefined',
77
+ name: typeof args.options.name !== 'undefined'
78
+ });
79
+ });
80
+ }, _BookingBusinessGetCommand_initOptions = function _BookingBusinessGetCommand_initOptions() {
81
+ this.options.unshift({ option: '-i, --id [id]' }, { option: '-n, --name [name]' });
82
+ }, _BookingBusinessGetCommand_initOptionSets = function _BookingBusinessGetCommand_initOptionSets() {
83
+ this.optionSets.push(['id', 'name']);
84
+ };
85
+ module.exports = new BookingBusinessGetCommand();
86
+ //# sourceMappingURL=business-get.js.map
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../../../../utils");
4
+ const GraphCommand_1 = require("../../../base/GraphCommand");
5
+ const commands_1 = require("../../commands");
6
+ class BookingBusinessListCommand extends GraphCommand_1.default {
7
+ get name() {
8
+ return commands_1.default.BUSINESS_LIST;
9
+ }
10
+ get description() {
11
+ return 'Lists all Microsoft Bookings businesses that are created for the tenant.';
12
+ }
13
+ defaultProperties() {
14
+ return ['id', 'displayName'];
15
+ }
16
+ commandAction(logger, args, cb) {
17
+ const endpoint = `${this.resource}/v1.0/solutions/bookingBusinesses`;
18
+ utils_1.odata
19
+ .getAllItems(endpoint)
20
+ .then((items) => {
21
+ return Promise.resolve(items);
22
+ })
23
+ .then((items) => {
24
+ logger.log(items);
25
+ cb();
26
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
27
+ }
28
+ }
29
+ module.exports = new BookingBusinessListCommand();
30
+ //# sourceMappingURL=business-list.js.map
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const prefix = 'booking';
4
+ exports.default = {
5
+ BUSINESS_GET: `${prefix} business get`,
6
+ BUSINESS_LIST: `${prefix} business list`
7
+ };
8
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var _SearchExternalConnectionRemoveCommand_instances, _SearchExternalConnectionRemoveCommand_initTelemetry, _SearchExternalConnectionRemoveCommand_initOptions, _SearchExternalConnectionRemoveCommand_initOptionSets;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const cli_1 = require("../../../../cli");
10
+ const request_1 = require("../../../../request");
11
+ const GraphCommand_1 = require("../../../base/GraphCommand");
12
+ const commands_1 = require("../../commands");
13
+ class SearchExternalConnectionRemoveCommand extends GraphCommand_1.default {
14
+ constructor() {
15
+ super();
16
+ _SearchExternalConnectionRemoveCommand_instances.add(this);
17
+ __classPrivateFieldGet(this, _SearchExternalConnectionRemoveCommand_instances, "m", _SearchExternalConnectionRemoveCommand_initTelemetry).call(this);
18
+ __classPrivateFieldGet(this, _SearchExternalConnectionRemoveCommand_instances, "m", _SearchExternalConnectionRemoveCommand_initOptions).call(this);
19
+ __classPrivateFieldGet(this, _SearchExternalConnectionRemoveCommand_instances, "m", _SearchExternalConnectionRemoveCommand_initOptionSets).call(this);
20
+ }
21
+ get name() {
22
+ return commands_1.default.EXTERNALCONNECTION_REMOVE;
23
+ }
24
+ get description() {
25
+ return 'Removes a specific External Connection from Microsoft Search';
26
+ }
27
+ getExternalConnectionId(args) {
28
+ if (args.options.id) {
29
+ return Promise.resolve(args.options.id);
30
+ }
31
+ const requestOptions = {
32
+ url: `${this.resource}/v1.0/external/connections?$filter=name eq '${encodeURIComponent(args.options.name)}'&$select=id`,
33
+ headers: {
34
+ accept: 'application/json;odata.metadata=none'
35
+ },
36
+ responseType: 'json'
37
+ };
38
+ return request_1.default
39
+ .get(requestOptions)
40
+ .then((res) => {
41
+ if (res.value.length === 1) {
42
+ return Promise.resolve(res.value[0].id);
43
+ }
44
+ if (res.value.length === 0) {
45
+ return Promise.reject(`The specified connection does not exist in Microsoft Search`);
46
+ }
47
+ return Promise.reject(`Multiple external connections with name ${args.options.name} found. Please disambiguate (IDs): ${res.value.map(x => x.id).join(', ')}`);
48
+ });
49
+ }
50
+ commandAction(logger, args, cb) {
51
+ const removeExternalConnection = () => {
52
+ this
53
+ .getExternalConnectionId(args)
54
+ .then((externalConnectionId) => {
55
+ const requestOptions = {
56
+ url: `${this.resource}/v1.0/external/connections/${encodeURIComponent(externalConnectionId)}`,
57
+ headers: {
58
+ accept: 'application/json;odata.metadata=none'
59
+ },
60
+ responseType: 'json'
61
+ };
62
+ return request_1.default
63
+ .delete(requestOptions);
64
+ })
65
+ .then(_ => cb(), (rawRes) => this.handleRejectedODataJsonPromise(rawRes, logger, cb));
66
+ };
67
+ if (args.options.confirm) {
68
+ removeExternalConnection();
69
+ }
70
+ else {
71
+ cli_1.Cli.prompt({
72
+ type: 'confirm',
73
+ name: 'continue',
74
+ default: false,
75
+ message: `Are you sure you want to remove the external connection '${args.options.id || args.options.name}'?`
76
+ }, (result) => {
77
+ if (!result.continue) {
78
+ cb();
79
+ }
80
+ else {
81
+ removeExternalConnection();
82
+ }
83
+ });
84
+ }
85
+ }
86
+ }
87
+ _SearchExternalConnectionRemoveCommand_instances = new WeakSet(), _SearchExternalConnectionRemoveCommand_initTelemetry = function _SearchExternalConnectionRemoveCommand_initTelemetry() {
88
+ this.telemetry.push((args) => {
89
+ Object.assign(this.telemetryProperties, {
90
+ id: typeof args.options.id !== 'undefined',
91
+ name: typeof args.options.name !== 'undefined',
92
+ confirm: (!(!args.options.confirm)).toString()
93
+ });
94
+ });
95
+ }, _SearchExternalConnectionRemoveCommand_initOptions = function _SearchExternalConnectionRemoveCommand_initOptions() {
96
+ this.options.unshift({ option: '--id [id]' }, { option: '--name [name]' }, { option: '--confirm' });
97
+ }, _SearchExternalConnectionRemoveCommand_initOptionSets = function _SearchExternalConnectionRemoveCommand_initOptionSets() {
98
+ this.optionSets.push(['id', 'name']);
99
+ };
100
+ module.exports = new SearchExternalConnectionRemoveCommand();
101
+ //# sourceMappingURL=externalconnection-remove.js.map
@@ -4,6 +4,7 @@ const prefix = 'search';
4
4
  exports.default = {
5
5
  EXTERNALCONNECTION_ADD: `${prefix} externalconnection add`,
6
6
  EXTERNALCONNECTION_GET: `${prefix} externalconnection get`,
7
- EXTERNALCONNECTION_LIST: `${prefix} externalconnection list`
7
+ EXTERNALCONNECTION_LIST: `${prefix} externalconnection list`,
8
+ EXTERNALCONNECTION_REMOVE: `${prefix} externalconnection remove`
8
9
  };
9
10
  //# sourceMappingURL=commands.js.map
@@ -414,6 +414,21 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
414
414
  range: '^4',
415
415
  fix: 'npm i -g yo@4'
416
416
  }
417
+ },
418
+ '1.15.2': {
419
+ gulp: {
420
+ range: '^4',
421
+ fix: 'npm i -g gulp@4'
422
+ },
423
+ node: {
424
+ range: '^12.13 || ^14.15 || ^16.13',
425
+ fix: 'Install Node.js v12.13, v14.15, v16.13 or higher'
426
+ },
427
+ sp: SharePointVersion.SPO,
428
+ yo: {
429
+ range: '^4',
430
+ fix: 'npm i -g yo@4'
431
+ }
417
432
  }
418
433
  };
419
434
  __classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initTelemetry).call(this);
@@ -176,5 +176,5 @@ m365 aad app add --name 'My AAD app' --save
176
176
  Create new Azure AD app registration with a certificate
177
177
 
178
178
  ```sh
179
- m365 aad app add --name 'My AAD app' --certificateDisplayName "Some certificate name" --certificateFile c:\temp\some-certificate.cer
179
+ m365 aad app add --name 'My AAD app' --certificateDisplayName "Some certificate name" --certificateFile "c:\temp\some-certificate.cer"
180
180
  ```
@@ -85,5 +85,5 @@ m365 aad app set --objectId 95cfe30d-ed44-4f9d-b73d-c66560f72e83 --redirectUris
85
85
  Add a certificate to the app
86
86
 
87
87
  ```sh
88
- m365 aad app set --certificateDisplayName "Some certificate name" --certificateFile c:\temp\some-certificate.cer
88
+ m365 aad app set --appId e75be2e1-0204-4f95-857d-51a37cf40be8 --certificateDisplayName "Some certificate name" --certificateFile "c:\temp\some-certificate.cer"
89
89
  ```
@@ -0,0 +1,33 @@
1
+ # booking business get
2
+
3
+ Retrieve the specified Microsoft Bookings business.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 booking business get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id [id]`
14
+ : ID of the business. Specify either `id` or `name` but not both.
15
+
16
+ `-n, --name [name]`
17
+ : Name of the business. Specify either `id` or `name` but not both.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Examples
22
+
23
+ Retrieve the specified Microsoft Bookings business with id _business@contoso.onmicrosoft.com_.
24
+
25
+ ```sh
26
+ m365 booking business get --id 'business@contoso.onmicrosoft.com'
27
+ ```
28
+
29
+ Retrieve the specified Microsoft Bookings business with name _business name_.
30
+
31
+ ```sh
32
+ m365 booking business get --name 'business name'
33
+ ```
@@ -0,0 +1,21 @@
1
+ # booking business list
2
+
3
+ Lists all Microsoft Bookings businesses that are created for the tenant.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 booking business list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ --8<-- "docs/cmd/_global.md"
14
+
15
+ ## Examples
16
+
17
+ Returns a list of all Microsoft Bookings businesses that are created for the tenant.
18
+
19
+ ```sh
20
+ m365 booking business list
21
+ ```
@@ -0,0 +1,40 @@
1
+ # search externalconnection remove
2
+
3
+ Allow the administrator to remove a specific external connection used in Microsoft Search.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 search externalconnection remove [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id [id]`
14
+ : ID of the External Connection to remove. Specify either `id` or `name`
15
+
16
+ `-n, --name [name]`
17
+ : Name of the External Connection to remove. Specify either `id` or `name`
18
+
19
+ `--confirm`
20
+ : Don't prompt for confirming removing the connection
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Remarks
25
+
26
+ If the command finds multiple external connections used in Microsoft Search with the specified name, it will prompt you to disambiguate which external connection it should remove, listing the discovered IDs.
27
+
28
+ ## Examples
29
+
30
+ Removes external connection with id _MyApp_
31
+
32
+ ```sh
33
+ m365 search externalconnection remove --id "MyApp"
34
+ ```
35
+
36
+ Removes external connection with name _Test_. Will NOT prompt for confirmation before removing.
37
+
38
+ ```sh
39
+ m365 search externalconnection remove --name "Test" --confirm
40
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "5.7.0-beta.9e8cf99",
3
+ "version": "5.7.0-beta.a2f3d05",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -86,6 +86,16 @@
86
86
  "name": "Martin Lingstuyl",
87
87
  "email": "mlingstuyl@live.com",
88
88
  "web": "https://www.blimped.nl/"
89
+ },
90
+ {
91
+ "name": "Jasey Waegebaert",
92
+ "email": "jaseyw@gmigroup.be",
93
+ "web": "https://github.com/Jwaegebaert"
94
+ },
95
+ {
96
+ "name": "Milan Holemans",
97
+ "email": "Milan.Holemans@vanroey.be",
98
+ "web": "https://github.com/milanholemans"
89
99
  }
90
100
  ],
91
101
  "contributors": [