@pnp/cli-microsoft365 4.2.0 → 4.3.0-beta.5bf07a3
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,99 @@
|
|
|
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 SearchExternalConnectionAddCommand extends GraphCommand_1.default {
|
|
7
|
+
get name() {
|
|
8
|
+
return commands_1.default.EXTERNALCONNECTION_ADD;
|
|
9
|
+
}
|
|
10
|
+
get description() {
|
|
11
|
+
return 'Adds a new External Connection for Microsoft Search';
|
|
12
|
+
}
|
|
13
|
+
getTelemetryProperties(args) {
|
|
14
|
+
const telemetryProps = super.getTelemetryProperties(args);
|
|
15
|
+
telemetryProps.authorizedAppIds = typeof args.options.authorizedAppIds !== undefined;
|
|
16
|
+
return telemetryProps;
|
|
17
|
+
}
|
|
18
|
+
commandAction(logger, args, cb) {
|
|
19
|
+
let appIds = [];
|
|
20
|
+
if (args.options.authorizedAppIds !== undefined &&
|
|
21
|
+
args.options.authorizedAppIds !== '') {
|
|
22
|
+
appIds = args.options.authorizedAppIds.split(',');
|
|
23
|
+
}
|
|
24
|
+
const commandData = {
|
|
25
|
+
id: args.options.id,
|
|
26
|
+
name: args.options.name,
|
|
27
|
+
description: args.options.description,
|
|
28
|
+
configuration: {
|
|
29
|
+
authorizedAppIds: appIds
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const requestOptions = {
|
|
33
|
+
url: `${this.resource}/v1.0/external/connections`,
|
|
34
|
+
headers: {
|
|
35
|
+
accept: 'application/json;odata.metadata=none'
|
|
36
|
+
},
|
|
37
|
+
responseType: 'json',
|
|
38
|
+
data: commandData
|
|
39
|
+
};
|
|
40
|
+
request_1.default
|
|
41
|
+
.post(requestOptions)
|
|
42
|
+
.then(_ => cb(), err => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
43
|
+
}
|
|
44
|
+
options() {
|
|
45
|
+
const options = [
|
|
46
|
+
{
|
|
47
|
+
option: '-i, --id <id>'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
option: '-n, --name <name>'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
option: '-d, --description <description>'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
option: '--authorizedAppIds [authorizedAppIds]'
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
const parentOptions = super.options();
|
|
60
|
+
return options.concat(parentOptions);
|
|
61
|
+
}
|
|
62
|
+
validate(args) {
|
|
63
|
+
const id = args.options.id;
|
|
64
|
+
if (id.length < 3 || id.length > 32) {
|
|
65
|
+
return 'ID must be between 3 and 32 characters in length.';
|
|
66
|
+
}
|
|
67
|
+
const alphaNumericRegEx = /[^\w]|_/g;
|
|
68
|
+
if (alphaNumericRegEx.test(id)) {
|
|
69
|
+
return 'ID must only contain alphanumeric characters.';
|
|
70
|
+
}
|
|
71
|
+
if (id.length > 9 &&
|
|
72
|
+
id.startsWith('Microsoft')) {
|
|
73
|
+
return 'ID cannot begin with Microsoft';
|
|
74
|
+
}
|
|
75
|
+
const invalidIds = ['None',
|
|
76
|
+
'Directory',
|
|
77
|
+
'Exchange',
|
|
78
|
+
'ExchangeArchive',
|
|
79
|
+
'LinkedIn',
|
|
80
|
+
'Mailbox',
|
|
81
|
+
'OneDriveBusiness',
|
|
82
|
+
'SharePoint',
|
|
83
|
+
'Teams',
|
|
84
|
+
'Yammer',
|
|
85
|
+
'Connectors',
|
|
86
|
+
'TaskFabric',
|
|
87
|
+
'PowerBI',
|
|
88
|
+
'Assistant',
|
|
89
|
+
'TopicEngine',
|
|
90
|
+
'MSFT_All_Connectors'
|
|
91
|
+
];
|
|
92
|
+
if (invalidIds.indexOf(id) > -1) {
|
|
93
|
+
return `ID cannot be one of the following values: ${invalidIds.join(', ')}.`;
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
module.exports = new SearchExternalConnectionAddCommand();
|
|
99
|
+
//# sourceMappingURL=externalconnection-add.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# search externalconnection add
|
|
2
|
+
|
|
3
|
+
Add a new external connection to be defined for Microsoft Search
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 search externalconnection add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`-i, --id <id>`
|
|
14
|
+
: Developer-provided unique ID of the connection within the Azure Active Directory tenant
|
|
15
|
+
|
|
16
|
+
`-n, --name <name>`
|
|
17
|
+
: The display name of the connection to be displayed in the Microsoft 365 admin center. Maximum length of 128 characters
|
|
18
|
+
|
|
19
|
+
`-d, --description <description>`
|
|
20
|
+
: Description of the connection displayed in the Microsoft 365 admin center
|
|
21
|
+
|
|
22
|
+
`--authorizedAppIds [authorizedAppIds]`
|
|
23
|
+
: Comma-separated collection of application IDs for registered Azure Active Directory apps that are allowed to manage the external connection and to index content in the external connection.
|
|
24
|
+
|
|
25
|
+
--8<-- "docs/cmd/_global.md"
|
|
26
|
+
|
|
27
|
+
## Remarks
|
|
28
|
+
|
|
29
|
+
The `id` must be at least 3 and no more than 32 characters long. It can contain only alphanumeric characters, can't begin with _Microsoft_ and can be any of the following values: *None, Directory, Exchange, ExchangeArchive, LinkedIn, Mailbox, OneDriveBusiness, SharePoint, Teams, Yammer, Connectors, TaskFabric, PowerBI, Assistant, TopicEngine, MSFT_All_Connectors*.
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
Adds a new external connection with name and description of test
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
m365 search externalconnection add --id MyApp --name "My application" --description "Description of your application"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Adds a new external connection with a limited number of authorized apps
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
m365 search externalconnection add --id MyApp --name "My application" --description "Description of your application" --authorizedAppIds "00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"
|
|
43
|
+
```
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pnp/cli-microsoft365",
|
|
9
|
-
"version": "4.
|
|
9
|
+
"version": "4.3.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@azure/msal-node": "^1.3.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-beta.5bf07a3",
|
|
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
|
"Levert, Sebastien <slevert@outlook.com>",
|
|
123
123
|
"Maillot, Michaël <battosaimykle@gmail.com>",
|
|
124
124
|
"Mastykarz, Waldek <waldek@mastykarz.nl>",
|
|
125
|
+
"McDonnell, Kevin <kevin@mcd79.com>",
|
|
125
126
|
"Menon, Arjun <arjun.umenon@gmail.com>",
|
|
126
127
|
"Moujahid, Abderahman <rags_place@hotmail.com>",
|
|
127
128
|
"Mücklisch, Steve <steve.muecklisch@gmail.com>",
|
|
@@ -219,4 +220,4 @@
|
|
|
219
220
|
"rimraf": "^3.0.2",
|
|
220
221
|
"sinon": "^11.1.2"
|
|
221
222
|
}
|
|
222
|
-
}
|
|
223
|
+
}
|