@pnp/cli-microsoft365 7.1.0 → 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/cli/Cli.js +3 -2
- 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.js +4 -0
- package/dist/m365/base/AppCommand.js +3 -12
- 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/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/utils/aadAdministrativeUnit.js +25 -0
- package/dist/utils/aadGroup.js +3 -1
- 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/{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/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 +5 -7
- 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
package/.devcontainer/Dockerfile
CHANGED
|
@@ -6,7 +6,6 @@ LABEL name="CLI for Microsoft 365 Development" \
|
|
|
6
6
|
maintainers="Waldek Mastykarz <waldek@mastykarz.nl>, \
|
|
7
7
|
Garry Trinder <garry.trinder@live.com>, \
|
|
8
8
|
Albert-Jan Schot <appie@digiwijs.nl>, \
|
|
9
|
-
Patrick Lamber <patrick@nubo.eu>, \
|
|
10
9
|
Arjun Menon <arjun.umenon@gmail.com>, \
|
|
11
10
|
Adam Wojcik <adam.wojcik.it@gmail.com>, \
|
|
12
11
|
Martin Lingstuyl <mlingstuyl@live.com>, \
|
package/.eslintrc.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const dictionary = [
|
|
|
5
5
|
'activation',
|
|
6
6
|
'activations',
|
|
7
7
|
'adaptive',
|
|
8
|
+
'administrative',
|
|
8
9
|
'ai',
|
|
9
10
|
'app',
|
|
10
11
|
'application',
|
|
@@ -15,6 +16,7 @@ const dictionary = [
|
|
|
15
16
|
'audit',
|
|
16
17
|
'bin',
|
|
17
18
|
'builder',
|
|
19
|
+
'card',
|
|
18
20
|
'catalog',
|
|
19
21
|
'checklist',
|
|
20
22
|
'client',
|
|
@@ -67,6 +69,7 @@ const dictionary = [
|
|
|
67
69
|
'permission',
|
|
68
70
|
'place',
|
|
69
71
|
'policy',
|
|
72
|
+
'profile',
|
|
70
73
|
'property',
|
|
71
74
|
'records',
|
|
72
75
|
'recycle',
|
|
@@ -90,6 +93,7 @@ const dictionary = [
|
|
|
90
93
|
'threat',
|
|
91
94
|
'token',
|
|
92
95
|
'type',
|
|
96
|
+
'unit',
|
|
93
97
|
'user',
|
|
94
98
|
'web',
|
|
95
99
|
'webhook'
|
package/Dockerfile
CHANGED
|
@@ -8,7 +8,6 @@ LABEL name="m365pnp/cli-microsoft365:${CLI_VERSION}" \
|
|
|
8
8
|
maintainers="Waldek Mastykarz <waldek@mastykarz.nl>, \
|
|
9
9
|
Garry Trinder <garry.trinder@live.com>, \
|
|
10
10
|
Albert-Jan Schot <appie@digiwijs.nl>, \
|
|
11
|
-
Patrick Lamber <patrick@nubo.eu>, \
|
|
12
11
|
Arjun Menon <arjun.umenon@gmail.com>, \
|
|
13
12
|
Adam Wojcik <adam.wojcik.it@gmail.com>, \
|
|
14
13
|
Martin Lingstuyl <mlingstuyl@live.com>, \
|
package/dist/cli/Cli.js
CHANGED
|
@@ -707,9 +707,10 @@ export class Cli {
|
|
|
707
707
|
const maxLength = Math.max(...namesOfCommandsToPrint.map(s => s.length)) + 10;
|
|
708
708
|
Cli.log(`Commands:`);
|
|
709
709
|
Cli.log();
|
|
710
|
-
|
|
710
|
+
const sortedCommandNamesToPrint = Object.getOwnPropertyNames(commandsToPrint).sort();
|
|
711
|
+
sortedCommandNamesToPrint.forEach(commandName => {
|
|
711
712
|
Cli.log(` ${`${commandName} [options]`.padEnd(maxLength, ' ')} ${commandsToPrint[commandName].command.description}`);
|
|
712
|
-
}
|
|
713
|
+
});
|
|
713
714
|
}
|
|
714
715
|
const namesOfCommandGroupsToPrint = Object.keys(commandGroupsToPrint);
|
|
715
716
|
if (namesOfCommandGroupsToPrint.length > 0) {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _AadAdministrativeUnitAddCommand_instances, _AadAdministrativeUnitAddCommand_initTelemetry, _AadAdministrativeUnitAddCommand_initOptions;
|
|
7
|
+
import request from "../../../../request.js";
|
|
8
|
+
import GraphCommand from "../../../base/GraphCommand.js";
|
|
9
|
+
import commands from "../../commands.js";
|
|
10
|
+
class AadAdministrativeUnitAddCommand extends GraphCommand {
|
|
11
|
+
get name() {
|
|
12
|
+
return commands.ADMINISTRATIVEUNIT_ADD;
|
|
13
|
+
}
|
|
14
|
+
get description() {
|
|
15
|
+
return 'Creates an administrative unit';
|
|
16
|
+
}
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
_AadAdministrativeUnitAddCommand_instances.add(this);
|
|
20
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitAddCommand_instances, "m", _AadAdministrativeUnitAddCommand_initTelemetry).call(this);
|
|
21
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitAddCommand_instances, "m", _AadAdministrativeUnitAddCommand_initOptions).call(this);
|
|
22
|
+
}
|
|
23
|
+
async commandAction(logger, args) {
|
|
24
|
+
const requestOptions = {
|
|
25
|
+
url: `${this.resource}/v1.0/directory/administrativeUnits`,
|
|
26
|
+
headers: {
|
|
27
|
+
accept: 'application/json;odata.metadata=none'
|
|
28
|
+
},
|
|
29
|
+
responseType: 'json',
|
|
30
|
+
data: {
|
|
31
|
+
description: args.options.description,
|
|
32
|
+
displayName: args.options.displayName,
|
|
33
|
+
visibility: args.options.hiddenMembership ? 'HiddenMembership' : null
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
try {
|
|
37
|
+
const administrativeUnit = await request.post(requestOptions);
|
|
38
|
+
await logger.log(administrativeUnit);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
this.handleRejectedODataJsonPromise(err);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
_AadAdministrativeUnitAddCommand_instances = new WeakSet(), _AadAdministrativeUnitAddCommand_initTelemetry = function _AadAdministrativeUnitAddCommand_initTelemetry() {
|
|
46
|
+
this.telemetry.push((args) => {
|
|
47
|
+
Object.assign(this.telemetryProperties, {
|
|
48
|
+
hiddenMembership: !!args.options.hiddenMembership
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}, _AadAdministrativeUnitAddCommand_initOptions = function _AadAdministrativeUnitAddCommand_initOptions() {
|
|
52
|
+
this.options.unshift({
|
|
53
|
+
option: '-n, --displayName <displayName>'
|
|
54
|
+
}, {
|
|
55
|
+
option: '-d, --description [description]'
|
|
56
|
+
}, {
|
|
57
|
+
option: '--hiddenMembership'
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
export default new AadAdministrativeUnitAddCommand();
|
|
61
|
+
//# sourceMappingURL=administrativeunit-add.js.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _AadAdministrativeUnitGetCommand_instances, _AadAdministrativeUnitGetCommand_initTelemetry, _AadAdministrativeUnitGetCommand_initOptions, _AadAdministrativeUnitGetCommand_initValidators, _AadAdministrativeUnitGetCommand_initOptionSets, _AadAdministrativeUnitGetCommand_initTypes;
|
|
7
|
+
import { validation } from "../../../../utils/validation.js";
|
|
8
|
+
import request from "../../../../request.js";
|
|
9
|
+
import GraphCommand from "../../../base/GraphCommand.js";
|
|
10
|
+
import commands from "../../commands.js";
|
|
11
|
+
import { aadAdministrativeUnit } from "../../../../utils/aadAdministrativeUnit.js";
|
|
12
|
+
class AadAdministrativeUnitGetCommand extends GraphCommand {
|
|
13
|
+
get name() {
|
|
14
|
+
return commands.ADMINISTRATIVEUNIT_GET;
|
|
15
|
+
}
|
|
16
|
+
get description() {
|
|
17
|
+
return 'Gets information about a specific administrative unit';
|
|
18
|
+
}
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
_AadAdministrativeUnitGetCommand_instances.add(this);
|
|
22
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initTelemetry).call(this);
|
|
23
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initOptions).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initValidators).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initOptionSets).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initTypes).call(this);
|
|
27
|
+
}
|
|
28
|
+
async commandAction(logger, args) {
|
|
29
|
+
let administrativeUnit;
|
|
30
|
+
try {
|
|
31
|
+
if (args.options.id) {
|
|
32
|
+
administrativeUnit = await this.getAdministrativeUnitById(args.options.id);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
administrativeUnit = await aadAdministrativeUnit.getAdministrativeUnitByDisplayName(args.options.displayName);
|
|
36
|
+
}
|
|
37
|
+
await logger.log(administrativeUnit);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
this.handleRejectedODataJsonPromise(err);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async getAdministrativeUnitById(id) {
|
|
44
|
+
const requestOptions = {
|
|
45
|
+
url: `${this.resource}/v1.0/directory/administrativeUnits/${id}`,
|
|
46
|
+
headers: {
|
|
47
|
+
accept: 'application/json;odata.metadata=none'
|
|
48
|
+
},
|
|
49
|
+
responseType: 'json'
|
|
50
|
+
};
|
|
51
|
+
return await request.get(requestOptions);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
_AadAdministrativeUnitGetCommand_instances = new WeakSet(), _AadAdministrativeUnitGetCommand_initTelemetry = function _AadAdministrativeUnitGetCommand_initTelemetry() {
|
|
55
|
+
this.telemetry.push((args) => {
|
|
56
|
+
Object.assign(this.telemetryProperties, {
|
|
57
|
+
id: typeof args.options.id !== 'undefined',
|
|
58
|
+
displayName: typeof args.options.displayName !== 'undefined'
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}, _AadAdministrativeUnitGetCommand_initOptions = function _AadAdministrativeUnitGetCommand_initOptions() {
|
|
62
|
+
this.options.unshift({
|
|
63
|
+
option: '-i, --id [id]'
|
|
64
|
+
}, {
|
|
65
|
+
option: '-n, --displayName [displayName]'
|
|
66
|
+
});
|
|
67
|
+
}, _AadAdministrativeUnitGetCommand_initValidators = function _AadAdministrativeUnitGetCommand_initValidators() {
|
|
68
|
+
this.validators.push(async (args) => {
|
|
69
|
+
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
70
|
+
return `${args.options.id} is not a valid GUID`;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
});
|
|
74
|
+
}, _AadAdministrativeUnitGetCommand_initOptionSets = function _AadAdministrativeUnitGetCommand_initOptionSets() {
|
|
75
|
+
this.optionSets.push({ options: ['id', 'displayName'] });
|
|
76
|
+
}, _AadAdministrativeUnitGetCommand_initTypes = function _AadAdministrativeUnitGetCommand_initTypes() {
|
|
77
|
+
this.types.string.push('displayName');
|
|
78
|
+
};
|
|
79
|
+
export default new AadAdministrativeUnitGetCommand();
|
|
80
|
+
//# sourceMappingURL=administrativeunit-get.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { odata } from '../../../../utils/odata.js';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
class AadAdministrativeUnitListCommand extends GraphCommand {
|
|
5
|
+
get name() {
|
|
6
|
+
return commands.ADMINISTRATIVEUNIT_LIST;
|
|
7
|
+
}
|
|
8
|
+
get description() {
|
|
9
|
+
return 'Retrieves a list of administrative units';
|
|
10
|
+
}
|
|
11
|
+
defaultProperties() {
|
|
12
|
+
return ['id', 'displayName', 'visibility'];
|
|
13
|
+
}
|
|
14
|
+
async commandAction(logger) {
|
|
15
|
+
try {
|
|
16
|
+
const results = await odata.getAllItems(`${this.resource}/v1.0/directory/administrativeUnits`);
|
|
17
|
+
await logger.log(results);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
this.handleRejectedODataJsonPromise(err);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export default new AadAdministrativeUnitListCommand();
|
|
25
|
+
//# sourceMappingURL=administrativeunit-list.js.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _AadAdministrativeUnitRemoveCommand_instances, _AadAdministrativeUnitRemoveCommand_initTelemetry, _AadAdministrativeUnitRemoveCommand_initOptions, _AadAdministrativeUnitRemoveCommand_initOptionSets, _AadAdministrativeUnitRemoveCommand_initValidators, _AadAdministrativeUnitRemoveCommand_initTypes;
|
|
7
|
+
import { aadAdministrativeUnit } from '../../../../utils/aadAdministrativeUnit.js';
|
|
8
|
+
import { validation } from "../../../../utils/validation.js";
|
|
9
|
+
import request from "../../../../request.js";
|
|
10
|
+
import GraphCommand from "../../../base/GraphCommand.js";
|
|
11
|
+
import commands from "../../commands.js";
|
|
12
|
+
import { Cli } from "../../../../cli/Cli.js";
|
|
13
|
+
class AadAdministrativeUnitRemoveCommand extends GraphCommand {
|
|
14
|
+
get name() {
|
|
15
|
+
return commands.ADMINISTRATIVEUNIT_REMOVE;
|
|
16
|
+
}
|
|
17
|
+
get description() {
|
|
18
|
+
return 'Removes an administrative unit';
|
|
19
|
+
}
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
_AadAdministrativeUnitRemoveCommand_instances.add(this);
|
|
23
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initOptions).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initValidators).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initOptionSets).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initTelemetry).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initTypes).call(this);
|
|
28
|
+
}
|
|
29
|
+
async commandAction(logger, args) {
|
|
30
|
+
const removeAdministrativeUnit = async () => {
|
|
31
|
+
try {
|
|
32
|
+
let administrativeUnitId = args.options.id;
|
|
33
|
+
if (args.options.displayName) {
|
|
34
|
+
const administrativeUnit = await aadAdministrativeUnit.getAdministrativeUnitByDisplayName(args.options.displayName);
|
|
35
|
+
administrativeUnitId = administrativeUnit.id;
|
|
36
|
+
}
|
|
37
|
+
const requestOptions = {
|
|
38
|
+
url: `${this.resource}/v1.0/directory/administrativeUnits/${administrativeUnitId}`,
|
|
39
|
+
headers: {
|
|
40
|
+
accept: 'application/json;odata.metadata=none'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
await request.delete(requestOptions);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
this.handleRejectedODataJsonPromise(err);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
if (args.options.force) {
|
|
50
|
+
await removeAdministrativeUnit();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const result = await Cli.prompt({
|
|
54
|
+
type: 'confirm',
|
|
55
|
+
name: 'continue',
|
|
56
|
+
default: false,
|
|
57
|
+
message: `Are you sure you want to remove administrative unit '${args.options.id || args.options.displayName}'?`
|
|
58
|
+
});
|
|
59
|
+
if (result.continue) {
|
|
60
|
+
await removeAdministrativeUnit();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
_AadAdministrativeUnitRemoveCommand_instances = new WeakSet(), _AadAdministrativeUnitRemoveCommand_initTelemetry = function _AadAdministrativeUnitRemoveCommand_initTelemetry() {
|
|
66
|
+
this.telemetry.push((args) => {
|
|
67
|
+
Object.assign(this.telemetryProperties, {
|
|
68
|
+
id: args.options.id !== 'undefined',
|
|
69
|
+
displayName: args.options.displayName !== 'undefined',
|
|
70
|
+
force: !!args.options.force
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}, _AadAdministrativeUnitRemoveCommand_initOptions = function _AadAdministrativeUnitRemoveCommand_initOptions() {
|
|
74
|
+
this.options.unshift({
|
|
75
|
+
option: '-i, --id [id]'
|
|
76
|
+
}, {
|
|
77
|
+
option: '-n, --displayName [displayName]'
|
|
78
|
+
}, {
|
|
79
|
+
option: '-f, --force'
|
|
80
|
+
});
|
|
81
|
+
}, _AadAdministrativeUnitRemoveCommand_initOptionSets = function _AadAdministrativeUnitRemoveCommand_initOptionSets() {
|
|
82
|
+
this.optionSets.push({
|
|
83
|
+
options: ['id', 'displayName']
|
|
84
|
+
});
|
|
85
|
+
}, _AadAdministrativeUnitRemoveCommand_initValidators = function _AadAdministrativeUnitRemoveCommand_initValidators() {
|
|
86
|
+
this.validators.push(async (args) => {
|
|
87
|
+
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
88
|
+
return `${args.options.id} is not a valid GUID for option id.`;
|
|
89
|
+
}
|
|
90
|
+
return true;
|
|
91
|
+
});
|
|
92
|
+
}, _AadAdministrativeUnitRemoveCommand_initTypes = function _AadAdministrativeUnitRemoveCommand_initTypes() {
|
|
93
|
+
this.types.string.push('id', 'displayName');
|
|
94
|
+
};
|
|
95
|
+
export default new AadAdministrativeUnitRemoveCommand();
|
|
96
|
+
//# sourceMappingURL=administrativeunit-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`,
|
|
@@ -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
|
}
|
|
@@ -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
|