@pnp/cli-microsoft365 7.1.0-beta.d53f0d9 → 7.2.0-beta.0642f3a
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/Dockerfile +0 -1
- package/.eslintrc.cjs +4 -0
- package/Dockerfile +0 -1
- package/dist/Auth.js +1 -1
- package/dist/Command.js +18 -28
- package/dist/cli/Cli.js +6 -4
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-add.js +61 -0
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-get.js +80 -0
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-list.js +25 -0
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-remove.js +96 -0
- package/dist/m365/aad/commands/group/group-user-list.js +146 -0
- package/dist/m365/aad/commands/m365group/m365group-remove.js +109 -15
- package/dist/m365/aad/commands.js +5 -0
- package/dist/m365/base/AppCommand.js +3 -12
- package/dist/m365/cli/commands/cli-doctor.js +11 -6
- package/dist/m365/commands/setup.js +6 -1
- package/dist/m365/{search/commands/externalconnection/externalconnection-add.js → external/commands/connection/connection-add.js} +16 -13
- package/dist/m365/{search/commands/externalconnection/externalconnection-get.js → external/commands/connection/connection-get.js} +16 -13
- package/dist/m365/{search/commands/externalconnection/externalconnection-list.js → external/commands/connection/connection-list.js} +7 -4
- package/dist/m365/{search/commands/externalconnection/externalconnection-remove.js → external/commands/connection/connection-remove.js} +17 -14
- package/dist/m365/{search/commands/externalconnection/externalconnection-schema-add.js → external/commands/connection/connection-schema-add.js} +14 -11
- package/dist/m365/external/commands.js +15 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.18.1-rc.0.js +21 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN014010_CODE_settings_filesexclude_jest.js +44 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.18.1-rc.0.js +57 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/spo/commands/site/site-set.js +33 -1
- package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +15 -14
- package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +22 -22
- package/dist/m365/teams/commands/app/app-update.js +9 -6
- package/dist/m365/tenant/commands/people/people-profilecardproperty-add.js +131 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-get.js +75 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-list.js +53 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-remove.js +84 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-set.js +118 -0
- package/dist/m365/tenant/commands/people/profileCardProperties.js +24 -0
- package/dist/m365/tenant/commands.js +5 -0
- package/dist/m365/todo/commands/task/task-list.js +8 -10
- package/dist/m365/todo/commands/task/task-remove.js +36 -36
- package/dist/m365/todo/commands/task/task-set.js +11 -13
- package/dist/m365/yammer/commands/group/group-user-remove.js +22 -23
- package/dist/utils/aadAdministrativeUnit.js +25 -0
- package/dist/utils/aadGroup.js +3 -1
- package/dist/utils/odata.js +20 -19
- package/dist/utils/prompt.js +16 -0
- package/docs/docs/cmd/aad/administrativeunit/administrativeunit-add.mdx +119 -0
- package/docs/docs/cmd/aad/administrativeunit/administrativeunit-get.mdx +102 -0
- package/docs/docs/cmd/aad/administrativeunit/administrativeunit-list.mdx +87 -0
- package/docs/docs/cmd/aad/administrativeunit/administrativeunit-remove.mdx +56 -0
- package/docs/docs/cmd/aad/group/group-user-list.mdx +135 -0
- package/docs/docs/cmd/aad/m365group/m365group-remove.mdx +11 -1
- package/docs/docs/cmd/{search/externalconnection/externalconnection-add.mdx → external/connection/connection-add.mdx} +16 -10
- package/docs/docs/cmd/{search/externalconnection/externalconnection-get.mdx → external/connection/connection-get.mdx} +16 -11
- package/docs/docs/cmd/{search/externalconnection/externalconnection-list.mdx → external/connection/connection-list.mdx} +12 -7
- package/docs/docs/cmd/external/connection/connection-remove.mdx +54 -0
- package/docs/docs/cmd/external/connection/connection-schema-add.mdx +41 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/field/field-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-rename.mdx +2 -0
- package/docs/docs/cmd/spo/site/site-set.mdx +15 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +126 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +101 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +98 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +61 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-set.mdx +120 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +36 -18
- package/dist/m365/search/commands.js +0 -9
- package/docs/docs/cmd/search/externalconnection/externalconnection-remove.mdx +0 -48
- package/docs/docs/cmd/search/externalconnection/externalconnection-schema-add.mdx +0 -35
|
@@ -10,16 +10,21 @@ import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
+
import config from '../../../../config.js';
|
|
14
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
15
|
+
import { spo } from '../../../../utils/spo.js';
|
|
16
|
+
import { setTimeout } from 'timers/promises';
|
|
13
17
|
class AadM365GroupRemoveCommand extends GraphCommand {
|
|
14
18
|
get name() {
|
|
15
19
|
return commands.M365GROUP_REMOVE;
|
|
16
20
|
}
|
|
17
21
|
get description() {
|
|
18
|
-
return 'Removes
|
|
22
|
+
return 'Removes a Microsoft 365 Group';
|
|
19
23
|
}
|
|
20
24
|
constructor() {
|
|
21
25
|
super();
|
|
22
26
|
_AadM365GroupRemoveCommand_instances.add(this);
|
|
27
|
+
this.intervalInMs = 5000;
|
|
23
28
|
__classPrivateFieldGet(this, _AadM365GroupRemoveCommand_instances, "m", _AadM365GroupRemoveCommand_initTelemetry).call(this);
|
|
24
29
|
__classPrivateFieldGet(this, _AadM365GroupRemoveCommand_instances, "m", _AadM365GroupRemoveCommand_initOptions).call(this);
|
|
25
30
|
__classPrivateFieldGet(this, _AadM365GroupRemoveCommand_instances, "m", _AadM365GroupRemoveCommand_initValidators).call(this);
|
|
@@ -34,21 +39,13 @@ class AadM365GroupRemoveCommand extends GraphCommand {
|
|
|
34
39
|
if (!isUnifiedGroup) {
|
|
35
40
|
throw Error(`Specified group with id '${args.options.id}' is not a Microsoft 365 group.`);
|
|
36
41
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
await request.delete(requestOptions);
|
|
42
|
+
const siteUrl = await this.getM365GroupSiteUrl(logger, args.options.id);
|
|
43
|
+
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
44
|
+
// Delete the Microsoft 365 group site. This operation will also delete the group.
|
|
45
|
+
await this.deleteM365GroupSite(logger, siteUrl, spoAdminUrl);
|
|
44
46
|
if (args.options.skipRecycleBin) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
headers: {
|
|
48
|
-
'accept': 'application/json;odata.metadata=none'
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
await request.delete(requestOptions2);
|
|
47
|
+
await this.deleteM365GroupFromRecycleBin(logger, args.options.id);
|
|
48
|
+
await this.deleteSiteFromRecycleBin(logger, siteUrl, spoAdminUrl);
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
catch (err) {
|
|
@@ -70,6 +67,102 @@ class AadM365GroupRemoveCommand extends GraphCommand {
|
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
}
|
|
70
|
+
async getM365GroupSiteUrl(logger, id) {
|
|
71
|
+
if (this.verbose) {
|
|
72
|
+
await logger.logToStderr(`Getting the site URL of Microsoft 365 Group: ${id}...`);
|
|
73
|
+
}
|
|
74
|
+
const requestOptions = {
|
|
75
|
+
url: `${this.resource}/v1.0/groups/${id}/drive?$select=webUrl`,
|
|
76
|
+
headers: {
|
|
77
|
+
accept: 'application/json;odata.metadata=none'
|
|
78
|
+
},
|
|
79
|
+
responseType: 'json'
|
|
80
|
+
};
|
|
81
|
+
const res = await request.get(requestOptions);
|
|
82
|
+
// Extract the base URL by removing everything after the last '/' character in the URL.
|
|
83
|
+
const baseUrl = res.webUrl.substring(0, res.webUrl.lastIndexOf('/'));
|
|
84
|
+
return baseUrl;
|
|
85
|
+
}
|
|
86
|
+
async deleteM365GroupSite(logger, url, spoAdminUrl) {
|
|
87
|
+
if (this.verbose) {
|
|
88
|
+
await logger.logToStderr(`Deleting the group site: '${url}'...`);
|
|
89
|
+
}
|
|
90
|
+
const requestOptions = {
|
|
91
|
+
url: `${spoAdminUrl}/_api/GroupSiteManager/Delete?siteUrl='${url}'`,
|
|
92
|
+
headers: {
|
|
93
|
+
accept: 'application/json;odata=nometadata'
|
|
94
|
+
},
|
|
95
|
+
responseType: 'json'
|
|
96
|
+
};
|
|
97
|
+
await request.post(requestOptions);
|
|
98
|
+
}
|
|
99
|
+
async deleteM365GroupFromRecycleBin(logger, id) {
|
|
100
|
+
for (let retries = 0; retries < AadM365GroupRemoveCommand.maxRetries; retries++) {
|
|
101
|
+
if (await this.isM365GroupInDeletedItemsList(id)) {
|
|
102
|
+
await this.removeM365GroupPermanently(logger, id);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
if (this.verbose) {
|
|
107
|
+
await logger.logToStderr(`Group has not been deleted yet. Waiting for ${this.intervalInMs / 1000} seconds before the next attempt. ${AadM365GroupRemoveCommand.maxRetries - retries} attempts remaining...`);
|
|
108
|
+
}
|
|
109
|
+
await setTimeout(this.intervalInMs);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
await logger.logToStderr(`Group has been successfully deleted, but it couldn't be permanently removed from the recycle bin after all retries. It will still appear in the deleted groups list.`);
|
|
113
|
+
}
|
|
114
|
+
async removeM365GroupPermanently(logger, id) {
|
|
115
|
+
if (this.verbose) {
|
|
116
|
+
await logger.logToStderr(`Group has been deleted and is now available in the deleted groups list. Removing permanently...`);
|
|
117
|
+
}
|
|
118
|
+
const requestOptions = {
|
|
119
|
+
url: `${this.resource}/v1.0/directory/deletedItems/${id}`,
|
|
120
|
+
headers: {
|
|
121
|
+
accept: 'application/json;odata.metadata=none'
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
await request.delete(requestOptions);
|
|
125
|
+
}
|
|
126
|
+
async isM365GroupInDeletedItemsList(id) {
|
|
127
|
+
const requestOptions = {
|
|
128
|
+
url: `${this.resource}/v1.0/directory/deletedItems/${id}`,
|
|
129
|
+
headers: {
|
|
130
|
+
accept: 'application/json;odata.metadata=none'
|
|
131
|
+
},
|
|
132
|
+
responseType: 'json'
|
|
133
|
+
};
|
|
134
|
+
try {
|
|
135
|
+
const response = await request.get(requestOptions);
|
|
136
|
+
return Boolean(response && response.id);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
if (error.response && error.response.status === 404) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
async deleteSiteFromRecycleBin(logger, url, spoAdminUrl) {
|
|
148
|
+
if (this.verbose) {
|
|
149
|
+
await logger.logToStderr(`Deleting the M365 group site '${url}' from the recycle bin...`);
|
|
150
|
+
}
|
|
151
|
+
const res = await spo.ensureFormDigest(spoAdminUrl, logger, undefined, this.debug);
|
|
152
|
+
const requestOptions = {
|
|
153
|
+
url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
154
|
+
headers: {
|
|
155
|
+
'X-RequestDigest': res.FormDigestValue
|
|
156
|
+
},
|
|
157
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="185" ObjectPathId="184" /><Query Id="186" ObjectPathId="184"><Query SelectAllProperties="false"><Properties><Property Name="IsComplete" ScalarProperty="true" /><Property Name="PollingInterval" ScalarProperty="true" /></Properties></Query></Query></Actions><ObjectPaths><Method Id="184" ParentId="175" Name="RemoveDeletedSite"><Parameters><Parameter Type="String">${formatting.escapeXml(url)}</Parameter></Parameters></Method><Constructor Id="175" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /></ObjectPaths></Request>`
|
|
158
|
+
};
|
|
159
|
+
const processQuery = await request.post(requestOptions);
|
|
160
|
+
const json = JSON.parse(processQuery);
|
|
161
|
+
const response = json[0];
|
|
162
|
+
if (response.ErrorInfo) {
|
|
163
|
+
throw response.ErrorInfo.ErrorMessage;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
73
166
|
}
|
|
74
167
|
_AadM365GroupRemoveCommand_instances = new WeakSet(), _AadM365GroupRemoveCommand_initTelemetry = function _AadM365GroupRemoveCommand_initTelemetry() {
|
|
75
168
|
this.telemetry.push((args) => {
|
|
@@ -94,5 +187,6 @@ _AadM365GroupRemoveCommand_instances = new WeakSet(), _AadM365GroupRemoveCommand
|
|
|
94
187
|
return true;
|
|
95
188
|
});
|
|
96
189
|
};
|
|
190
|
+
AadM365GroupRemoveCommand.maxRetries = 10;
|
|
97
191
|
export default new AadM365GroupRemoveCommand();
|
|
98
192
|
//# sourceMappingURL=m365group-remove.js.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
const prefix = 'aad';
|
|
2
2
|
export default {
|
|
3
|
+
ADMINISTRATIVEUNIT_ADD: `${prefix} administrativeunit add`,
|
|
4
|
+
ADMINISTRATIVEUNIT_GET: `${prefix} administrativeunit get`,
|
|
5
|
+
ADMINISTRATIVEUNIT_LIST: `${prefix} administrativeunit list`,
|
|
6
|
+
ADMINISTRATIVEUNIT_REMOVE: `${prefix} administrativeunit remove`,
|
|
3
7
|
APP_ADD: `${prefix} app add`,
|
|
4
8
|
APP_GET: `${prefix} app get`,
|
|
5
9
|
APP_LIST: `${prefix} app list`,
|
|
@@ -14,6 +18,7 @@ export default {
|
|
|
14
18
|
GROUP_GET: `${prefix} group get`,
|
|
15
19
|
GROUP_LIST: `${prefix} group list`,
|
|
16
20
|
GROUP_REMOVE: `${prefix} group remove`,
|
|
21
|
+
GROUP_USER_LIST: `${prefix} group user list`,
|
|
17
22
|
GROUPSETTING_ADD: `${prefix} groupsetting add`,
|
|
18
23
|
GROUPSETTING_GET: `${prefix} groupsetting get`,
|
|
19
24
|
GROUPSETTING_LIST: `${prefix} groupsetting list`,
|
|
@@ -8,6 +8,7 @@ import fs from 'fs';
|
|
|
8
8
|
import { Cli } from '../../cli/Cli.js';
|
|
9
9
|
import Command, { CommandError } from '../../Command.js';
|
|
10
10
|
import { validation } from '../../utils/validation.js';
|
|
11
|
+
import { formatting } from '../../utils/formatting.js';
|
|
11
12
|
class AppCommand extends Command {
|
|
12
13
|
get resource() {
|
|
13
14
|
return 'https://graph.microsoft.com';
|
|
@@ -52,18 +53,8 @@ class AppCommand extends Command {
|
|
|
52
53
|
return super.action(logger, args);
|
|
53
54
|
}
|
|
54
55
|
if (this.m365rcJson.apps.length > 1) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
type: 'list',
|
|
58
|
-
choices: this.m365rcJson.apps.map((app, i) => {
|
|
59
|
-
return {
|
|
60
|
-
name: `${app.name} (${app.appId})`,
|
|
61
|
-
value: i
|
|
62
|
-
};
|
|
63
|
-
}),
|
|
64
|
-
default: 0,
|
|
65
|
-
name: 'appIdIndex'
|
|
66
|
-
});
|
|
56
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('appIdIndex', this.m365rcJson.apps);
|
|
57
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple Azure AD apps found in ${m365rcJsonPath}.`, resultAsKeyValuePair);
|
|
67
58
|
this.appId = this.m365rcJson.apps[result.appIdIndex].appId;
|
|
68
59
|
await super.action(logger, args);
|
|
69
60
|
}
|
|
@@ -14,11 +14,14 @@ class CliDoctorCommand extends Command {
|
|
|
14
14
|
}
|
|
15
15
|
async commandAction(logger) {
|
|
16
16
|
const roles = [];
|
|
17
|
-
const scopes =
|
|
17
|
+
const scopes = new Map();
|
|
18
18
|
Object.keys(auth.service.accessTokens).forEach(resource => {
|
|
19
19
|
const accessToken = auth.service.accessTokens[resource].accessToken;
|
|
20
20
|
this.getRolesFromAccessToken(accessToken).forEach(role => roles.push(role));
|
|
21
|
-
this.getScopesFromAccessToken(accessToken)
|
|
21
|
+
const [res, scp] = this.getScopesFromAccessToken(accessToken);
|
|
22
|
+
if (res !== "") {
|
|
23
|
+
scopes.set(res, scp);
|
|
24
|
+
}
|
|
22
25
|
});
|
|
23
26
|
const diagnosticInfo = {
|
|
24
27
|
os: {
|
|
@@ -34,7 +37,7 @@ class CliDoctorCommand extends Command {
|
|
|
34
37
|
cliEnvironment: process.env.CLIMICROSOFT365_ENV ? process.env.CLIMICROSOFT365_ENV : '',
|
|
35
38
|
cliConfig: Cli.getInstance().config.all,
|
|
36
39
|
roles: roles,
|
|
37
|
-
scopes: scopes
|
|
40
|
+
scopes: Object.fromEntries(scopes)
|
|
38
41
|
};
|
|
39
42
|
await logger.log(diagnosticInfo);
|
|
40
43
|
}
|
|
@@ -55,20 +58,22 @@ class CliDoctorCommand extends Command {
|
|
|
55
58
|
return roles;
|
|
56
59
|
}
|
|
57
60
|
getScopesFromAccessToken(accessToken) {
|
|
61
|
+
let resource = "";
|
|
58
62
|
let scopes = [];
|
|
59
63
|
if (!accessToken || accessToken.length === 0) {
|
|
60
|
-
return scopes;
|
|
64
|
+
return [resource, scopes];
|
|
61
65
|
}
|
|
62
66
|
const chunks = accessToken.split('.');
|
|
63
67
|
if (chunks.length !== 3) {
|
|
64
|
-
return scopes;
|
|
68
|
+
return [resource, scopes];
|
|
65
69
|
}
|
|
66
70
|
const tokenString = Buffer.from(chunks[1], 'base64').toString();
|
|
67
71
|
const token = JSON.parse(tokenString);
|
|
68
72
|
if (token.scp?.length > 0) {
|
|
73
|
+
resource = token.aud.replace(/(-my|-admin).sharepoint.com/, '.sharepoint.com');
|
|
69
74
|
scopes = token.scp.split(' ');
|
|
70
75
|
}
|
|
71
|
-
return scopes;
|
|
76
|
+
return [resource, scopes];
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
export default new CliDoctorCommand();
|
|
@@ -12,6 +12,7 @@ import { pid } from '../../utils/pid.js';
|
|
|
12
12
|
import AnonymousCommand from '../base/AnonymousCommand.js';
|
|
13
13
|
import commands from './commands.js';
|
|
14
14
|
import { interactivePreset, powerShellPreset, scriptingPreset } from './setupPresets.js';
|
|
15
|
+
import { prompt } from '../../utils/prompt.js';
|
|
15
16
|
class SetupCommand extends AnonymousCommand {
|
|
16
17
|
get name() {
|
|
17
18
|
return commands.SETUP;
|
|
@@ -44,11 +45,13 @@ class SetupCommand extends AnonymousCommand {
|
|
|
44
45
|
await this.configureSettings(settings, true, logger);
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
48
|
+
// stop the spinner. Fixes #5598
|
|
49
|
+
Cli.getInstance().spinner.stop();
|
|
47
50
|
await logger.logToStderr(`Welcome to the CLI for Microsoft 365 setup!`);
|
|
48
51
|
await logger.logToStderr(`This command will guide you through the process of configuring the CLI for your needs.`);
|
|
49
52
|
await logger.logToStderr(`Please, answer the following questions and we'll define a set of settings to best match how you intend to use the CLI.`);
|
|
50
53
|
await logger.logToStderr('');
|
|
51
|
-
const preferences = await
|
|
54
|
+
const preferences = await prompt.forInput([
|
|
52
55
|
{
|
|
53
56
|
type: 'list',
|
|
54
57
|
name: 'usageMode',
|
|
@@ -94,6 +97,8 @@ class SetupCommand extends AnonymousCommand {
|
|
|
94
97
|
await logger.logToStderr('');
|
|
95
98
|
await logger.logToStderr('Configuring settings...');
|
|
96
99
|
await logger.logToStderr('');
|
|
100
|
+
// start the spinner. Fixes #5598
|
|
101
|
+
Cli.getInstance().spinner.start();
|
|
97
102
|
await this.configureSettings(settings, false, logger);
|
|
98
103
|
if (!this.verbose) {
|
|
99
104
|
await logger.logToStderr('');
|
|
@@ -3,23 +3,26 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
6
|
+
var _ExternalConnectionAddCommand_instances, _ExternalConnectionAddCommand_initTelemetry, _ExternalConnectionAddCommand_initOptions, _ExternalConnectionAddCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
9
|
import commands from '../../commands.js';
|
|
10
|
-
class
|
|
10
|
+
class ExternalConnectionAddCommand extends GraphCommand {
|
|
11
11
|
get name() {
|
|
12
|
-
return commands.
|
|
12
|
+
return commands.CONNECTION_ADD;
|
|
13
13
|
}
|
|
14
14
|
get description() {
|
|
15
|
-
return 'Adds a new
|
|
15
|
+
return 'Adds a new external connection';
|
|
16
|
+
}
|
|
17
|
+
alias() {
|
|
18
|
+
return [commands.EXTERNALCONNECTION_ADD];
|
|
16
19
|
}
|
|
17
20
|
constructor() {
|
|
18
21
|
super();
|
|
19
|
-
|
|
20
|
-
__classPrivateFieldGet(this,
|
|
21
|
-
__classPrivateFieldGet(this,
|
|
22
|
-
__classPrivateFieldGet(this,
|
|
22
|
+
_ExternalConnectionAddCommand_instances.add(this);
|
|
23
|
+
__classPrivateFieldGet(this, _ExternalConnectionAddCommand_instances, "m", _ExternalConnectionAddCommand_initTelemetry).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _ExternalConnectionAddCommand_instances, "m", _ExternalConnectionAddCommand_initOptions).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _ExternalConnectionAddCommand_instances, "m", _ExternalConnectionAddCommand_initValidators).call(this);
|
|
23
26
|
}
|
|
24
27
|
async commandAction(logger, args) {
|
|
25
28
|
let appIds = [];
|
|
@@ -51,13 +54,13 @@ class SearchExternalConnectionAddCommand extends GraphCommand {
|
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
|
-
|
|
57
|
+
_ExternalConnectionAddCommand_instances = new WeakSet(), _ExternalConnectionAddCommand_initTelemetry = function _ExternalConnectionAddCommand_initTelemetry() {
|
|
55
58
|
this.telemetry.push((args) => {
|
|
56
59
|
Object.assign(this.telemetryProperties, {
|
|
57
60
|
authorizedAppIds: typeof args.options.authorizedAppIds !== 'undefined'
|
|
58
61
|
});
|
|
59
62
|
});
|
|
60
|
-
},
|
|
63
|
+
}, _ExternalConnectionAddCommand_initOptions = function _ExternalConnectionAddCommand_initOptions() {
|
|
61
64
|
this.options.unshift({
|
|
62
65
|
option: '-i, --id <id>'
|
|
63
66
|
}, {
|
|
@@ -67,7 +70,7 @@ _SearchExternalConnectionAddCommand_instances = new WeakSet(), _SearchExternalCo
|
|
|
67
70
|
}, {
|
|
68
71
|
option: '--authorizedAppIds [authorizedAppIds]'
|
|
69
72
|
});
|
|
70
|
-
},
|
|
73
|
+
}, _ExternalConnectionAddCommand_initValidators = function _ExternalConnectionAddCommand_initValidators() {
|
|
71
74
|
this.validators.push(async (args) => {
|
|
72
75
|
const id = args.options.id;
|
|
73
76
|
if (id.length < 3 || id.length > 32) {
|
|
@@ -104,5 +107,5 @@ _SearchExternalConnectionAddCommand_instances = new WeakSet(), _SearchExternalCo
|
|
|
104
107
|
return true;
|
|
105
108
|
});
|
|
106
109
|
};
|
|
107
|
-
export default new
|
|
108
|
-
//# sourceMappingURL=
|
|
110
|
+
export default new ExternalConnectionAddCommand();
|
|
111
|
+
//# sourceMappingURL=connection-add.js.map
|
|
@@ -3,24 +3,27 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
6
|
+
var _ExternalConnectionGetCommand_instances, _ExternalConnectionGetCommand_initTelemetry, _ExternalConnectionGetCommand_initOptions, _ExternalConnectionGetCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
10
|
import commands from '../../commands.js';
|
|
11
|
-
class
|
|
11
|
+
class ExternalConnectionGetCommand extends GraphCommand {
|
|
12
12
|
get name() {
|
|
13
|
-
return commands.
|
|
13
|
+
return commands.CONNECTION_GET;
|
|
14
14
|
}
|
|
15
15
|
get description() {
|
|
16
|
-
return 'Get a specific external connection
|
|
16
|
+
return 'Get a specific external connection';
|
|
17
|
+
}
|
|
18
|
+
alias() {
|
|
19
|
+
return [commands.EXTERNALCONNECTION_GET];
|
|
17
20
|
}
|
|
18
21
|
constructor() {
|
|
19
22
|
super();
|
|
20
|
-
|
|
21
|
-
__classPrivateFieldGet(this,
|
|
22
|
-
__classPrivateFieldGet(this,
|
|
23
|
-
__classPrivateFieldGet(this,
|
|
23
|
+
_ExternalConnectionGetCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _ExternalConnectionGetCommand_instances, "m", _ExternalConnectionGetCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _ExternalConnectionGetCommand_instances, "m", _ExternalConnectionGetCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _ExternalConnectionGetCommand_instances, "m", _ExternalConnectionGetCommand_initOptionSets).call(this);
|
|
24
27
|
}
|
|
25
28
|
async commandAction(logger, args) {
|
|
26
29
|
let url = `${this.resource}/v1.0/external/connections`;
|
|
@@ -52,21 +55,21 @@ class SearchExternalConnectionGetCommand extends GraphCommand {
|
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
|
|
58
|
+
_ExternalConnectionGetCommand_instances = new WeakSet(), _ExternalConnectionGetCommand_initTelemetry = function _ExternalConnectionGetCommand_initTelemetry() {
|
|
56
59
|
this.telemetry.push((args) => {
|
|
57
60
|
Object.assign(this.telemetryProperties, {
|
|
58
61
|
id: typeof args.options.id !== 'undefined',
|
|
59
62
|
name: typeof args.options.name !== 'undefined'
|
|
60
63
|
});
|
|
61
64
|
});
|
|
62
|
-
},
|
|
65
|
+
}, _ExternalConnectionGetCommand_initOptions = function _ExternalConnectionGetCommand_initOptions() {
|
|
63
66
|
this.options.unshift({
|
|
64
67
|
option: '-i, --id [id]'
|
|
65
68
|
}, {
|
|
66
69
|
option: '-n, --name [name]'
|
|
67
70
|
});
|
|
68
|
-
},
|
|
71
|
+
}, _ExternalConnectionGetCommand_initOptionSets = function _ExternalConnectionGetCommand_initOptionSets() {
|
|
69
72
|
this.optionSets.push({ options: ['id', 'name'] });
|
|
70
73
|
};
|
|
71
|
-
export default new
|
|
72
|
-
//# sourceMappingURL=
|
|
74
|
+
export default new ExternalConnectionGetCommand();
|
|
75
|
+
//# sourceMappingURL=connection-get.js.map
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { odata } from '../../../../utils/odata.js';
|
|
2
2
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
|
-
class
|
|
4
|
+
class ExternalConnectionListCommand extends GraphCommand {
|
|
5
5
|
get name() {
|
|
6
|
-
return commands.
|
|
6
|
+
return commands.CONNECTION_LIST;
|
|
7
7
|
}
|
|
8
8
|
get description() {
|
|
9
9
|
return 'Lists external connections defined in the Microsoft Search';
|
|
10
10
|
}
|
|
11
|
+
alias() {
|
|
12
|
+
return [commands.EXTERNALCONNECTION_LIST];
|
|
13
|
+
}
|
|
11
14
|
defaultProperties() {
|
|
12
15
|
return ['id', 'name', 'state'];
|
|
13
16
|
}
|
|
@@ -21,5 +24,5 @@ class SearchExternalConnectionListCommand extends GraphCommand {
|
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
|
-
export default new
|
|
25
|
-
//# sourceMappingURL=
|
|
27
|
+
export default new ExternalConnectionListCommand();
|
|
28
|
+
//# sourceMappingURL=connection-list.js.map
|
|
@@ -3,25 +3,28 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
6
|
+
var _ExternalConnectionRemoveCommand_instances, _ExternalConnectionRemoveCommand_initTelemetry, _ExternalConnectionRemoveCommand_initOptions, _ExternalConnectionRemoveCommand_initOptionSets;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
-
class
|
|
12
|
+
class ExternalConnectionRemoveCommand extends GraphCommand {
|
|
13
13
|
get name() {
|
|
14
|
-
return commands.
|
|
14
|
+
return commands.CONNECTION_REMOVE;
|
|
15
15
|
}
|
|
16
16
|
get description() {
|
|
17
|
-
return 'Removes a specific
|
|
17
|
+
return 'Removes a specific external connection';
|
|
18
|
+
}
|
|
19
|
+
alias() {
|
|
20
|
+
return [commands.EXTERNALCONNECTION_REMOVE];
|
|
18
21
|
}
|
|
19
22
|
constructor() {
|
|
20
23
|
super();
|
|
21
|
-
|
|
22
|
-
__classPrivateFieldGet(this,
|
|
23
|
-
__classPrivateFieldGet(this,
|
|
24
|
-
__classPrivateFieldGet(this,
|
|
24
|
+
_ExternalConnectionRemoveCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _ExternalConnectionRemoveCommand_instances, "m", _ExternalConnectionRemoveCommand_initTelemetry).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _ExternalConnectionRemoveCommand_instances, "m", _ExternalConnectionRemoveCommand_initOptions).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _ExternalConnectionRemoveCommand_instances, "m", _ExternalConnectionRemoveCommand_initOptionSets).call(this);
|
|
25
28
|
}
|
|
26
29
|
async getExternalConnectionId(args) {
|
|
27
30
|
if (args.options.id) {
|
|
@@ -39,7 +42,7 @@ class SearchExternalConnectionRemoveCommand extends GraphCommand {
|
|
|
39
42
|
return res.value[0].id;
|
|
40
43
|
}
|
|
41
44
|
if (res.value.length === 0) {
|
|
42
|
-
throw `The specified connection does not exist
|
|
45
|
+
throw `The specified connection does not exist`;
|
|
43
46
|
}
|
|
44
47
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
45
48
|
const result = await Cli.handleMultipleResultsFound(`Multiple external connections with name ${args.options.name} found.`, resultAsKeyValuePair);
|
|
@@ -78,7 +81,7 @@ class SearchExternalConnectionRemoveCommand extends GraphCommand {
|
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
|
-
|
|
84
|
+
_ExternalConnectionRemoveCommand_instances = new WeakSet(), _ExternalConnectionRemoveCommand_initTelemetry = function _ExternalConnectionRemoveCommand_initTelemetry() {
|
|
82
85
|
this.telemetry.push((args) => {
|
|
83
86
|
Object.assign(this.telemetryProperties, {
|
|
84
87
|
id: typeof args.options.id !== 'undefined',
|
|
@@ -86,10 +89,10 @@ _SearchExternalConnectionRemoveCommand_instances = new WeakSet(), _SearchExterna
|
|
|
86
89
|
force: (!(!args.options.force)).toString()
|
|
87
90
|
});
|
|
88
91
|
});
|
|
89
|
-
},
|
|
92
|
+
}, _ExternalConnectionRemoveCommand_initOptions = function _ExternalConnectionRemoveCommand_initOptions() {
|
|
90
93
|
this.options.unshift({ option: '--id [id]' }, { option: '--name [name]' }, { option: '-f, --force' });
|
|
91
|
-
},
|
|
94
|
+
}, _ExternalConnectionRemoveCommand_initOptionSets = function _ExternalConnectionRemoveCommand_initOptionSets() {
|
|
92
95
|
this.optionSets.push({ options: ['id', 'name'] });
|
|
93
96
|
};
|
|
94
|
-
export default new
|
|
95
|
-
//# sourceMappingURL=
|
|
97
|
+
export default new ExternalConnectionRemoveCommand();
|
|
98
|
+
//# sourceMappingURL=connection-remove.js.map
|
|
@@ -3,22 +3,25 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
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");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
6
|
+
var _ExternalConnectionSchemaAddCommand_instances, _ExternalConnectionSchemaAddCommand_initOptions, _ExternalConnectionSchemaAddCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
9
|
import commands from '../../commands.js';
|
|
10
|
-
class
|
|
10
|
+
class ExternalConnectionSchemaAddCommand extends GraphCommand {
|
|
11
11
|
get name() {
|
|
12
|
-
return commands.
|
|
12
|
+
return commands.CONNECTION_SCHEMA_ADD;
|
|
13
13
|
}
|
|
14
14
|
get description() {
|
|
15
|
-
return '
|
|
15
|
+
return 'Allows the administrator to add a schema to a specific external connection';
|
|
16
|
+
}
|
|
17
|
+
alias() {
|
|
18
|
+
return [commands.EXTERNALCONNECTION_SCHEMA_ADD];
|
|
16
19
|
}
|
|
17
20
|
constructor() {
|
|
18
21
|
super();
|
|
19
|
-
|
|
20
|
-
__classPrivateFieldGet(this,
|
|
21
|
-
__classPrivateFieldGet(this,
|
|
22
|
+
_ExternalConnectionSchemaAddCommand_instances.add(this);
|
|
23
|
+
__classPrivateFieldGet(this, _ExternalConnectionSchemaAddCommand_instances, "m", _ExternalConnectionSchemaAddCommand_initOptions).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _ExternalConnectionSchemaAddCommand_instances, "m", _ExternalConnectionSchemaAddCommand_initValidators).call(this);
|
|
22
25
|
}
|
|
23
26
|
async commandAction(logger, args) {
|
|
24
27
|
if (this.verbose) {
|
|
@@ -40,13 +43,13 @@ class SearchExternalConnectionSchemaAddCommand extends GraphCommand {
|
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
|
-
|
|
46
|
+
_ExternalConnectionSchemaAddCommand_instances = new WeakSet(), _ExternalConnectionSchemaAddCommand_initOptions = function _ExternalConnectionSchemaAddCommand_initOptions() {
|
|
44
47
|
this.options.unshift({
|
|
45
48
|
option: '-i, --externalConnectionId <externalConnectionId>'
|
|
46
49
|
}, {
|
|
47
50
|
option: '-s, --schema <schema>'
|
|
48
51
|
});
|
|
49
|
-
},
|
|
52
|
+
}, _ExternalConnectionSchemaAddCommand_initValidators = function _ExternalConnectionSchemaAddCommand_initValidators() {
|
|
50
53
|
this.validators.push(async (args) => {
|
|
51
54
|
if (args.options.externalConnectionId.length < 3 || args.options.externalConnectionId.length > 32) {
|
|
52
55
|
return 'externalConnectionId must be between 3 and 32 characters in length.';
|
|
@@ -69,5 +72,5 @@ _SearchExternalConnectionSchemaAddCommand_instances = new WeakSet(), _SearchExte
|
|
|
69
72
|
return true;
|
|
70
73
|
});
|
|
71
74
|
};
|
|
72
|
-
export default new
|
|
73
|
-
//# sourceMappingURL=
|
|
75
|
+
export default new ExternalConnectionSchemaAddCommand();
|
|
76
|
+
//# sourceMappingURL=connection-schema-add.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const prefix = 'external';
|
|
2
|
+
const searchPrefix = 'search';
|
|
3
|
+
export default {
|
|
4
|
+
CONNECTION_ADD: `${prefix} connection add`,
|
|
5
|
+
CONNECTION_GET: `${prefix} connection get`,
|
|
6
|
+
CONNECTION_LIST: `${prefix} connection list`,
|
|
7
|
+
CONNECTION_REMOVE: `${prefix} connection remove`,
|
|
8
|
+
CONNECTION_SCHEMA_ADD: `${prefix} connection schema add`,
|
|
9
|
+
EXTERNALCONNECTION_ADD: `${searchPrefix} externalconnection add`,
|
|
10
|
+
EXTERNALCONNECTION_GET: `${searchPrefix} externalconnection get`,
|
|
11
|
+
EXTERNALCONNECTION_LIST: `${searchPrefix} externalconnection list`,
|
|
12
|
+
EXTERNALCONNECTION_REMOVE: `${searchPrefix} externalconnection remove`,
|
|
13
|
+
EXTERNALCONNECTION_SCHEMA_ADD: `${searchPrefix} externalconnection schema add`
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
2
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
3
|
+
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
4
|
+
import { FN002004_DEVDEP_gulp } from './rules/FN002004_DEVDEP_gulp.js';
|
|
5
|
+
import { FN002007_DEVDEP_ajv } from './rules/FN002007_DEVDEP_ajv.js';
|
|
6
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
7
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
8
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
9
|
+
import { FN002019_DEVDEP_microsoft_rush_stack_compiler } from './rules/FN002019_DEVDEP_microsoft_rush_stack_compiler.js';
|
|
10
|
+
export default [
|
|
11
|
+
new FN001008_DEP_react('17'),
|
|
12
|
+
new FN001009_DEP_react_dom('17'),
|
|
13
|
+
new FN001035_DEP_fluentui_react('^8.106.4'),
|
|
14
|
+
new FN002004_DEVDEP_gulp('4.0.2'),
|
|
15
|
+
new FN002007_DEVDEP_ajv('^6.12.5'),
|
|
16
|
+
new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
17
|
+
new FN002015_DEVDEP_types_react('17'),
|
|
18
|
+
new FN002016_DEVDEP_types_react_dom('17'),
|
|
19
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['4.7'])
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=doctor-1.18.1-rc.0.js.map
|
|
@@ -67,7 +67,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
67
67
|
'1.17.2',
|
|
68
68
|
'1.17.3',
|
|
69
69
|
'1.17.4',
|
|
70
|
-
'1.18.0'
|
|
70
|
+
'1.18.0',
|
|
71
|
+
'1.18.1-rc.0'
|
|
71
72
|
];
|
|
72
73
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
73
74
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|