@pnp/cli-microsoft365 7.1.0 → 7.2.0-beta.2970c86
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/.eslintrc.cjs +4 -0
- 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 +93 -0
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-list.js +25 -0
- package/dist/m365/aad/commands/administrativeunit/administrativeunit-remove.js +108 -0
- package/dist/m365/aad/commands.js +4 -0
- package/dist/m365/base/AppCommand.js +3 -12
- 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/teams/commands/app/app-update.js +9 -6
- package/dist/m365/tenant/commands/people/people-profilecardproperty-add.js +128 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-get.js +73 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-list.js +63 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-remove.js +84 -0
- package/dist/m365/tenant/commands/people/profileCardProperties.js +24 -0
- package/dist/m365/tenant/commands.js +4 -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/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-add.mdx +174 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-get.mdx +97 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-list.mdx +106 -0
- package/docs/docs/cmd/tenant/people/people-profilecardproperty-remove.mdx +61 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +3 -2
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/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,93 @@
|
|
|
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 { odata } from "../../../../utils/odata.js";
|
|
12
|
+
import { formatting } from "../../../../utils/formatting.js";
|
|
13
|
+
import { Cli } from "../../../../cli/Cli.js";
|
|
14
|
+
class AadAdministrativeUnitGetCommand extends GraphCommand {
|
|
15
|
+
get name() {
|
|
16
|
+
return commands.ADMINISTRATIVEUNIT_GET;
|
|
17
|
+
}
|
|
18
|
+
get description() {
|
|
19
|
+
return 'Gets information about a specific administrative unit';
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_AadAdministrativeUnitGetCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initValidators).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initOptionSets).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitGetCommand_instances, "m", _AadAdministrativeUnitGetCommand_initTypes).call(this);
|
|
29
|
+
}
|
|
30
|
+
async commandAction(logger, args) {
|
|
31
|
+
let administrativeUnit;
|
|
32
|
+
try {
|
|
33
|
+
if (args.options.id) {
|
|
34
|
+
administrativeUnit = await this.getAdministrativeUnitById(args.options.id);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
administrativeUnit = await this.getAdministrativeUnitByDisplayName(args.options.displayName);
|
|
38
|
+
}
|
|
39
|
+
await logger.log(administrativeUnit);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
this.handleRejectedODataJsonPromise(err);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async getAdministrativeUnitById(id) {
|
|
46
|
+
const requestOptions = {
|
|
47
|
+
url: `${this.resource}/v1.0/directory/administrativeUnits/${id}`,
|
|
48
|
+
headers: {
|
|
49
|
+
accept: 'application/json;odata.metadata=none'
|
|
50
|
+
},
|
|
51
|
+
responseType: 'json'
|
|
52
|
+
};
|
|
53
|
+
return await request.get(requestOptions);
|
|
54
|
+
}
|
|
55
|
+
async getAdministrativeUnitByDisplayName(displayName) {
|
|
56
|
+
const administrativeUnits = await odata.getAllItems(`${this.resource}/v1.0/directory/administrativeUnits?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`);
|
|
57
|
+
if (administrativeUnits.length === 0) {
|
|
58
|
+
throw `The specified administrative unit '${displayName}' does not exist.`;
|
|
59
|
+
}
|
|
60
|
+
if (administrativeUnits.length > 1) {
|
|
61
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', administrativeUnits);
|
|
62
|
+
return await Cli.handleMultipleResultsFound(`Multiple administrative units with name '${displayName}' found.`, resultAsKeyValuePair);
|
|
63
|
+
}
|
|
64
|
+
return administrativeUnits[0];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
_AadAdministrativeUnitGetCommand_instances = new WeakSet(), _AadAdministrativeUnitGetCommand_initTelemetry = function _AadAdministrativeUnitGetCommand_initTelemetry() {
|
|
68
|
+
this.telemetry.push((args) => {
|
|
69
|
+
Object.assign(this.telemetryProperties, {
|
|
70
|
+
id: typeof args.options.id !== 'undefined',
|
|
71
|
+
displayName: typeof args.options.displayName !== 'undefined'
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}, _AadAdministrativeUnitGetCommand_initOptions = function _AadAdministrativeUnitGetCommand_initOptions() {
|
|
75
|
+
this.options.unshift({
|
|
76
|
+
option: '-i, --id [id]'
|
|
77
|
+
}, {
|
|
78
|
+
option: '-n, --displayName [displayName]'
|
|
79
|
+
});
|
|
80
|
+
}, _AadAdministrativeUnitGetCommand_initValidators = function _AadAdministrativeUnitGetCommand_initValidators() {
|
|
81
|
+
this.validators.push(async (args) => {
|
|
82
|
+
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
83
|
+
return `${args.options.id} is not a valid GUID`;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
});
|
|
87
|
+
}, _AadAdministrativeUnitGetCommand_initOptionSets = function _AadAdministrativeUnitGetCommand_initOptionSets() {
|
|
88
|
+
this.optionSets.push({ options: ['id', 'displayName'] });
|
|
89
|
+
}, _AadAdministrativeUnitGetCommand_initTypes = function _AadAdministrativeUnitGetCommand_initTypes() {
|
|
90
|
+
this.types.string.push('displayName');
|
|
91
|
+
};
|
|
92
|
+
export default new AadAdministrativeUnitGetCommand();
|
|
93
|
+
//# 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,108 @@
|
|
|
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 { 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 { odata } from "../../../../utils/odata.js";
|
|
12
|
+
import { formatting } from "../../../../utils/formatting.js";
|
|
13
|
+
import { Cli } from "../../../../cli/Cli.js";
|
|
14
|
+
class AadAdministrativeUnitRemoveCommand extends GraphCommand {
|
|
15
|
+
get name() {
|
|
16
|
+
return commands.ADMINISTRATIVEUNIT_REMOVE;
|
|
17
|
+
}
|
|
18
|
+
get description() {
|
|
19
|
+
return 'Removes an administrative unit';
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_AadAdministrativeUnitRemoveCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initOptions).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initValidators).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initOptionSets).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initTelemetry).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _AadAdministrativeUnitRemoveCommand_instances, "m", _AadAdministrativeUnitRemoveCommand_initTypes).call(this);
|
|
29
|
+
}
|
|
30
|
+
async commandAction(logger, args) {
|
|
31
|
+
const removeAdministrativeUnit = async () => {
|
|
32
|
+
try {
|
|
33
|
+
let administrativeUnitId = args.options.id;
|
|
34
|
+
if (args.options.displayName) {
|
|
35
|
+
administrativeUnitId = await this.getAdministrativeUnitIdByDisplayName(args.options.displayName);
|
|
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
|
+
async getAdministrativeUnitIdByDisplayName(displayName) {
|
|
65
|
+
const administrativeUnits = await odata.getAllItems(`${this.resource}/v1.0/directory/administrativeUnits?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'&$select=id`);
|
|
66
|
+
if (administrativeUnits.length === 0) {
|
|
67
|
+
throw `The specified administrative unit '${displayName}' does not exist.`;
|
|
68
|
+
}
|
|
69
|
+
if (administrativeUnits.length > 1) {
|
|
70
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', administrativeUnits);
|
|
71
|
+
const selectedAdministrativeUnit = await Cli.handleMultipleResultsFound(`Multiple administrative units with name '${displayName}' found.`, resultAsKeyValuePair);
|
|
72
|
+
return selectedAdministrativeUnit.id;
|
|
73
|
+
}
|
|
74
|
+
return administrativeUnits[0].id;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
_AadAdministrativeUnitRemoveCommand_instances = new WeakSet(), _AadAdministrativeUnitRemoveCommand_initTelemetry = function _AadAdministrativeUnitRemoveCommand_initTelemetry() {
|
|
78
|
+
this.telemetry.push((args) => {
|
|
79
|
+
Object.assign(this.telemetryProperties, {
|
|
80
|
+
id: args.options.id !== 'undefined',
|
|
81
|
+
displayName: args.options.displayName !== 'undefined',
|
|
82
|
+
force: !!args.options.force
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}, _AadAdministrativeUnitRemoveCommand_initOptions = function _AadAdministrativeUnitRemoveCommand_initOptions() {
|
|
86
|
+
this.options.unshift({
|
|
87
|
+
option: '-i, --id [id]'
|
|
88
|
+
}, {
|
|
89
|
+
option: '-n, --displayName [displayName]'
|
|
90
|
+
}, {
|
|
91
|
+
option: '-f, --force'
|
|
92
|
+
});
|
|
93
|
+
}, _AadAdministrativeUnitRemoveCommand_initOptionSets = function _AadAdministrativeUnitRemoveCommand_initOptionSets() {
|
|
94
|
+
this.optionSets.push({
|
|
95
|
+
options: ['id', 'displayName']
|
|
96
|
+
});
|
|
97
|
+
}, _AadAdministrativeUnitRemoveCommand_initValidators = function _AadAdministrativeUnitRemoveCommand_initValidators() {
|
|
98
|
+
this.validators.push(async (args) => {
|
|
99
|
+
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
100
|
+
return `${args.options.id} is not a valid GUID for option id.`;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
});
|
|
104
|
+
}, _AadAdministrativeUnitRemoveCommand_initTypes = function _AadAdministrativeUnitRemoveCommand_initTypes() {
|
|
105
|
+
this.types.string.push('id', 'displayName');
|
|
106
|
+
};
|
|
107
|
+
export default new AadAdministrativeUnitRemoveCommand();
|
|
108
|
+
//# 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
|
}
|
|
@@ -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);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { JsonRule } from '../../JsonRule.js';
|
|
2
|
+
export class FN014010_CODE_settings_filesexclude_jest extends JsonRule {
|
|
3
|
+
constructor() {
|
|
4
|
+
super();
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN014010';
|
|
8
|
+
}
|
|
9
|
+
get title() {
|
|
10
|
+
return 'Exclude Jest output files in .vscode/settings.json';
|
|
11
|
+
}
|
|
12
|
+
get description() {
|
|
13
|
+
return `Add excluding Jest output files in .vscode/settings.json`;
|
|
14
|
+
}
|
|
15
|
+
get resolution() {
|
|
16
|
+
return `{
|
|
17
|
+
"files.exclude": {
|
|
18
|
+
"**/jest-output": true
|
|
19
|
+
}
|
|
20
|
+
}`;
|
|
21
|
+
}
|
|
22
|
+
get resolutionType() {
|
|
23
|
+
return 'json';
|
|
24
|
+
}
|
|
25
|
+
get severity() {
|
|
26
|
+
return 'Required';
|
|
27
|
+
}
|
|
28
|
+
get file() {
|
|
29
|
+
return '.vscode/settings.json';
|
|
30
|
+
}
|
|
31
|
+
visit(project, findings) {
|
|
32
|
+
if (!project.vsCode ||
|
|
33
|
+
!project.vsCode.settingsJson ||
|
|
34
|
+
!project.vsCode.settingsJson["files.exclude"]) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (project.vsCode.settingsJson["files.exclude"]["**/jest-output"] === true) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const node = this.getAstNodeFromFile(project.vsCode.settingsJson, `files;#exclude`);
|
|
41
|
+
this.addFindingWithPosition(findings, node);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=FN014010_CODE_settings_filesexclude_jest.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FN001001_DEP_microsoft_sp_core_library } from './rules/FN001001_DEP_microsoft_sp_core_library.js';
|
|
2
|
+
import { FN001002_DEP_microsoft_sp_lodash_subset } from './rules/FN001002_DEP_microsoft_sp_lodash_subset.js';
|
|
3
|
+
import { FN001003_DEP_microsoft_sp_office_ui_fabric_core } from './rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.js';
|
|
4
|
+
import { FN001004_DEP_microsoft_sp_webpart_base } from './rules/FN001004_DEP_microsoft_sp_webpart_base.js';
|
|
5
|
+
import { FN001011_DEP_microsoft_sp_dialog } from './rules/FN001011_DEP_microsoft_sp_dialog.js';
|
|
6
|
+
import { FN001012_DEP_microsoft_sp_application_base } from './rules/FN001012_DEP_microsoft_sp_application_base.js';
|
|
7
|
+
import { FN001013_DEP_microsoft_decorators } from './rules/FN001013_DEP_microsoft_decorators.js';
|
|
8
|
+
import { FN001014_DEP_microsoft_sp_listview_extensibility } from './rules/FN001014_DEP_microsoft_sp_listview_extensibility.js';
|
|
9
|
+
import { FN001021_DEP_microsoft_sp_property_pane } from './rules/FN001021_DEP_microsoft_sp_property_pane.js';
|
|
10
|
+
import { FN001022_DEP_office_ui_fabric_react } from './rules/FN001022_DEP_office_ui_fabric_react.js';
|
|
11
|
+
import { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
|
|
12
|
+
import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
|
|
13
|
+
import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
|
|
14
|
+
import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
|
|
15
|
+
import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
|
|
16
|
+
import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
|
|
17
|
+
import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
|
|
18
|
+
import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
|
|
19
|
+
import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
|
|
20
|
+
import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
|
|
21
|
+
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
22
|
+
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
23
|
+
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
24
|
+
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
25
|
+
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
26
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
27
|
+
import { FN014010_CODE_settings_filesexclude_jest } from './rules/FN014010_CODE_settings_filesexclude_jest.js';
|
|
28
|
+
export default [
|
|
29
|
+
new FN001001_DEP_microsoft_sp_core_library('1.18.1-rc.0'),
|
|
30
|
+
new FN001002_DEP_microsoft_sp_lodash_subset('1.18.1-rc.0'),
|
|
31
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.18.1-rc.0'),
|
|
32
|
+
new FN001004_DEP_microsoft_sp_webpart_base('1.18.1-rc.0'),
|
|
33
|
+
new FN001011_DEP_microsoft_sp_dialog('1.18.1-rc.0'),
|
|
34
|
+
new FN001012_DEP_microsoft_sp_application_base('1.18.1-rc.0'),
|
|
35
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility('1.18.1-rc.0'),
|
|
36
|
+
new FN001021_DEP_microsoft_sp_property_pane('1.18.1-rc.0'),
|
|
37
|
+
new FN001022_DEP_office_ui_fabric_react('', false),
|
|
38
|
+
new FN001023_DEP_microsoft_sp_component_base('1.18.1-rc.0'),
|
|
39
|
+
new FN001024_DEP_microsoft_sp_diagnostics('1.18.1-rc.0'),
|
|
40
|
+
new FN001025_DEP_microsoft_sp_dynamic_data('1.18.1-rc.0'),
|
|
41
|
+
new FN001026_DEP_microsoft_sp_extension_base('1.18.1-rc.0'),
|
|
42
|
+
new FN001027_DEP_microsoft_sp_http('1.18.1-rc.0'),
|
|
43
|
+
new FN001028_DEP_microsoft_sp_list_subscription('1.18.1-rc.0'),
|
|
44
|
+
new FN001029_DEP_microsoft_sp_loader('1.18.1-rc.0'),
|
|
45
|
+
new FN001030_DEP_microsoft_sp_module_interfaces('1.18.1-rc.0'),
|
|
46
|
+
new FN001031_DEP_microsoft_sp_odata_types('1.18.1-rc.0'),
|
|
47
|
+
new FN001032_DEP_microsoft_sp_page_context('1.18.1-rc.0'),
|
|
48
|
+
new FN001013_DEP_microsoft_decorators('1.18.1-rc.0'),
|
|
49
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.18.1-rc.0'),
|
|
50
|
+
new FN002001_DEVDEP_microsoft_sp_build_web('1.18.1-rc.0'),
|
|
51
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.18.1-rc.0'),
|
|
52
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.18.1-rc.0'),
|
|
53
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.18.1-rc.0'),
|
|
54
|
+
new FN010001_YORC_version('1.18.1-rc.0'),
|
|
55
|
+
new FN014010_CODE_settings_filesexclude_jest()
|
|
56
|
+
];
|
|
57
|
+
//# sourceMappingURL=upgrade-1.18.1-rc.0.js.map
|
|
@@ -7,6 +7,8 @@ var _SpfxProjectUpgradeCommand_instances, _a, _SpfxProjectUpgradeCommand_initTel
|
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import os from 'os';
|
|
9
9
|
import path from 'path';
|
|
10
|
+
// uncomment to support upgrading to preview releases
|
|
11
|
+
import { prerelease } from 'semver';
|
|
10
12
|
import { CommandError } from '../../../../Command.js';
|
|
11
13
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
12
14
|
import { packageManager } from '../../../../utils/packageManager.js';
|
|
@@ -69,7 +71,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
69
71
|
'1.17.2',
|
|
70
72
|
'1.17.3',
|
|
71
73
|
'1.17.4',
|
|
72
|
-
'1.18.0'
|
|
74
|
+
'1.18.0',
|
|
75
|
+
'1.18.1-rc.0'
|
|
73
76
|
];
|
|
74
77
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
75
78
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -82,15 +85,15 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
82
85
|
}
|
|
83
86
|
this.toVersion = args.options.toVersion ? args.options.toVersion : this.supportedVersions[this.supportedVersions.length - 1];
|
|
84
87
|
// uncomment to support upgrading to preview releases
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
if (!args.options.toVersion &&
|
|
89
|
+
!args.options.preview &&
|
|
90
|
+
prerelease(this.toVersion)) {
|
|
91
|
+
// no version and no preview specified while the current version to
|
|
92
|
+
// upgrade to is a prerelease so let's grab the first non-preview version
|
|
93
|
+
// since we're supporting only one preview version, it's sufficient for
|
|
94
|
+
// us to take second to last version
|
|
95
|
+
this.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
96
|
+
}
|
|
94
97
|
this.packageManager = args.options.packageManager || 'npm';
|
|
95
98
|
this.shell = args.options.shell || 'bash';
|
|
96
99
|
if (this.supportedVersions.indexOf(this.toVersion) < 0) {
|
|
@@ -477,9 +480,9 @@ _a = SpfxProjectUpgradeCommand, _SpfxProjectUpgradeCommand_instances = new WeakS
|
|
|
477
480
|
preview: args.options.preview
|
|
478
481
|
});
|
|
479
482
|
// uncomment to support upgrading to preview releases
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
+
if (prerelease(this.telemetryProperties.toVersion) && !args.options.preview) {
|
|
484
|
+
this.telemetryProperties.toVersion = this.supportedVersions[this.supportedVersions.length - 2];
|
|
485
|
+
}
|
|
483
486
|
});
|
|
484
487
|
}, _SpfxProjectUpgradeCommand_initOptions = function _SpfxProjectUpgradeCommand_initOptions() {
|
|
485
488
|
this.options.unshift({
|
|
@@ -538,6 +538,21 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
538
538
|
range: '^4',
|
|
539
539
|
fix: 'npm i -g yo@4'
|
|
540
540
|
}
|
|
541
|
+
},
|
|
542
|
+
'1.18.1-rc.0': {
|
|
543
|
+
gulpCli: {
|
|
544
|
+
range: '^1 || ^2',
|
|
545
|
+
fix: 'npm i -g gulp-cli@2'
|
|
546
|
+
},
|
|
547
|
+
node: {
|
|
548
|
+
range: '>=16.13.0 <17.0.0 || >=18.17.1 <19.0.0',
|
|
549
|
+
fix: 'Install Node.js >=16.13.0 <17.0.0 || >=18.17.1 <19.0.0'
|
|
550
|
+
},
|
|
551
|
+
sp: SharePointVersion.SPO,
|
|
552
|
+
yo: {
|
|
553
|
+
range: '^4',
|
|
554
|
+
fix: 'npm i -g yo@4'
|
|
555
|
+
}
|
|
541
556
|
}
|
|
542
557
|
};
|
|
543
558
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initTelemetry).call(this);
|
|
@@ -11,6 +11,7 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
11
11
|
import { validation } from '../../../../utils/validation.js';
|
|
12
12
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
13
|
import commands from '../../commands.js';
|
|
14
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
14
15
|
class TeamsAppUpdateCommand extends GraphCommand {
|
|
15
16
|
get name() {
|
|
16
17
|
return commands.APP_UPDATE;
|
|
@@ -29,7 +30,7 @@ class TeamsAppUpdateCommand extends GraphCommand {
|
|
|
29
30
|
async commandAction(logger, args) {
|
|
30
31
|
const { filePath } = args.options;
|
|
31
32
|
try {
|
|
32
|
-
const appId = await this.getAppId(args);
|
|
33
|
+
const appId = await this.getAppId(args.options);
|
|
33
34
|
const fullPath = path.resolve(filePath);
|
|
34
35
|
if (this.verbose) {
|
|
35
36
|
await logger.logToStderr(`Updating app with id '${appId}' and file '${fullPath}' in the app catalog...`);
|
|
@@ -47,12 +48,12 @@ class TeamsAppUpdateCommand extends GraphCommand {
|
|
|
47
48
|
this.handleRejectedODataJsonPromise(err);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
async getAppId(
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
51
|
+
async getAppId(options) {
|
|
52
|
+
if (options.id) {
|
|
53
|
+
return options.id;
|
|
53
54
|
}
|
|
54
55
|
const requestOptions = {
|
|
55
|
-
url: `${this.resource}/v1.0/appCatalogs/teamsApps?$filter=displayName eq '${formatting.encodeQueryParameter(
|
|
56
|
+
url: `${this.resource}/v1.0/appCatalogs/teamsApps?$filter=displayName eq '${formatting.encodeQueryParameter(options.name)}'`,
|
|
56
57
|
headers: {
|
|
57
58
|
accept: 'application/json;odata.metadata=none'
|
|
58
59
|
},
|
|
@@ -64,7 +65,9 @@ class TeamsAppUpdateCommand extends GraphCommand {
|
|
|
64
65
|
throw `The specified Teams app does not exist`;
|
|
65
66
|
}
|
|
66
67
|
if (response.value.length > 1) {
|
|
67
|
-
|
|
68
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', response.value);
|
|
69
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple Teams apps with name ${options.name} found.`, resultAsKeyValuePair);
|
|
70
|
+
return result.id;
|
|
68
71
|
}
|
|
69
72
|
return app.id;
|
|
70
73
|
}
|