@pnp/cli-microsoft365 10.6.0-beta.7205e34 → 10.6.0-beta.8ecef43
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +2 -1
- package/dist/Command.js +10 -0
- package/dist/auth/MsalNetworkClient.js +48 -0
- package/dist/config.js +1 -0
- package/dist/m365/entra/commands/group/group-member-add.js +1 -1
- package/dist/m365/entra/commands/group/group-member-remove.js +197 -0
- package/dist/m365/entra/commands/policy/policy-list.js +46 -3
- package/dist/m365/entra/commands.js +1 -0
- package/dist/m365/flow/commands/flow-list.js +1 -1
- package/dist/m365/graph/commands/openextension/openextension-get.js +57 -0
- package/dist/m365/graph/commands/openextension/openextension-list.js +62 -0
- package/dist/m365/graph/commands/openextension/openextension-remove.js +68 -0
- package/dist/m365/graph/commands.js +3 -0
- package/dist/m365/pp/commands/card/card-clone.js +7 -1
- package/dist/m365/pp/commands/card/card-get.js +5 -2
- package/dist/m365/pp/commands/card/card-remove.js +7 -1
- package/dist/m365/pp/commands/solution/solution-get.js +5 -11
- package/dist/m365/pp/commands/solution/solution-publish.js +6 -16
- package/dist/m365/pp/commands/solution/solution-remove.js +4 -13
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +9 -2
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +0 -19
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.21.0.js +25 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +0 -16
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3.js +13 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.21.0.js +63 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/util/commands/accesstoken/accesstoken-get.js +13 -3
- package/dist/utils/accessToken.js +8 -0
- package/dist/utils/powerPlatform.js +25 -4
- package/dist/utils/prompt.js +9 -2
- package/dist/utils/types.js +1 -0
- package/docs/docs/cmd/entra/group/group-member-add.mdx +1 -1
- package/docs/docs/cmd/entra/group/group-member-remove.mdx +96 -0
- package/docs/docs/cmd/entra/policy/policy-list.mdx +1 -1
- package/docs/docs/cmd/graph/openextension/openextension-get.mdx +111 -0
- package/docs/docs/cmd/graph/openextension/openextension-list.mdx +129 -0
- package/docs/docs/cmd/graph/openextension/openextension-remove.mdx +59 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -4
- package/docs/docs/cmd/util/accesstoken/accesstoken-get.mdx +72 -0
- package/npm-shrinkwrap.json +515 -479
- package/package.json +14 -14
|
@@ -43,13 +43,19 @@ class PpCardRemoveCommand extends PowerPlatformCommand {
|
|
|
43
43
|
if (args.options.id) {
|
|
44
44
|
return args.options.id;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
if (this.verbose) {
|
|
47
|
+
await logger.logToStderr(`Retrieving the card with name '${args.options.name}'`);
|
|
48
|
+
}
|
|
49
|
+
const card = await powerPlatform.getCardByName(dynamicsApiUrl, args.options.name);
|
|
47
50
|
return card.cardid;
|
|
48
51
|
}
|
|
49
52
|
async deleteCard(args, logger) {
|
|
50
53
|
try {
|
|
51
54
|
const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin);
|
|
52
55
|
const cardId = await this.getCardId(args, dynamicsApiUrl, logger);
|
|
56
|
+
if (this.verbose) {
|
|
57
|
+
await logger.logToStderr(`Deleting card with Id '${cardId}'`);
|
|
58
|
+
}
|
|
53
59
|
const requestOptions = {
|
|
54
60
|
url: `${dynamicsApiUrl}/api/data/v9.1/cards(${cardId})`,
|
|
55
61
|
headers: {
|
|
@@ -49,23 +49,17 @@ class PpSolutionGetCommand extends PowerPlatformCommand {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
async getSolution(dynamicsApiUrl, options) {
|
|
52
|
+
if (options.name) {
|
|
53
|
+
return powerPlatform.getSolutionByName(dynamicsApiUrl, options.name);
|
|
54
|
+
}
|
|
52
55
|
const requestOptions = {
|
|
53
56
|
headers: {
|
|
54
57
|
accept: 'application/json;odata.metadata=none'
|
|
55
58
|
},
|
|
56
59
|
responseType: 'json'
|
|
57
60
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const result = await request.get(requestOptions);
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true and uniquename eq \'${options.name}\'&$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`;
|
|
64
|
-
const result = await request.get(requestOptions);
|
|
65
|
-
if (result.value.length === 0) {
|
|
66
|
-
throw `The specified solution '${options.name}' does not exist.`;
|
|
67
|
-
}
|
|
68
|
-
return result.value[0];
|
|
61
|
+
requestOptions.url = `${dynamicsApiUrl}/api/data/v9.0/solutions(${options.id})?$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`;
|
|
62
|
+
return request.get(requestOptions);
|
|
69
63
|
}
|
|
70
64
|
}
|
|
71
65
|
_PpSolutionGetCommand_instances = new WeakSet(), _PpSolutionGetCommand_initTelemetry = function _PpSolutionGetCommand_initTelemetry() {
|
|
@@ -4,14 +4,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _PpSolutionPublishCommand_instances, _PpSolutionPublishCommand_initTelemetry, _PpSolutionPublishCommand_initOptions, _PpSolutionPublishCommand_initOptionSets, _PpSolutionPublishCommand_initValidators;
|
|
7
|
-
import { cli } from '../../../../cli/cli.js';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
9
|
import { powerPlatform } from '../../../../utils/powerPlatform.js';
|
|
11
10
|
import { validation } from '../../../../utils/validation.js';
|
|
12
11
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
13
12
|
import commands from '../../commands.js';
|
|
14
|
-
import ppSolutionGetCommand from './solution-get.js';
|
|
15
13
|
class PpSolutionPublishCommand extends PowerPlatformCommand {
|
|
16
14
|
get name() {
|
|
17
15
|
return commands.SOLUTION_PUBLISH;
|
|
@@ -29,8 +27,8 @@ class PpSolutionPublishCommand extends PowerPlatformCommand {
|
|
|
29
27
|
}
|
|
30
28
|
async commandAction(logger, args) {
|
|
31
29
|
try {
|
|
32
|
-
const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.
|
|
33
|
-
const solutionId = await this.getSolutionId(args, logger);
|
|
30
|
+
const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin);
|
|
31
|
+
const solutionId = await this.getSolutionId(args, dynamicsApiUrl, logger);
|
|
34
32
|
const solutionComponents = await this.getSolutionComponents(dynamicsApiUrl, solutionId, logger);
|
|
35
33
|
const parameterXml = await this.buildXmlRequestObject(solutionComponents, logger);
|
|
36
34
|
const requestOptions = {
|
|
@@ -71,23 +69,15 @@ class PpSolutionPublishCommand extends PowerPlatformCommand {
|
|
|
71
69
|
const response = await request.get(requestOptions);
|
|
72
70
|
return response.value;
|
|
73
71
|
}
|
|
74
|
-
async getSolutionId(args, logger) {
|
|
72
|
+
async getSolutionId(args, dynamicsApiUrl, logger) {
|
|
75
73
|
if (args.options.id) {
|
|
76
74
|
return args.options.id;
|
|
77
75
|
}
|
|
78
76
|
if (this.verbose) {
|
|
79
|
-
await logger.logToStderr(`Retrieving solutionId
|
|
77
|
+
await logger.logToStderr(`Retrieving solutionId...`);
|
|
80
78
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
name: args.options.name,
|
|
84
|
-
output: 'json',
|
|
85
|
-
debug: this.debug,
|
|
86
|
-
verbose: this.verbose
|
|
87
|
-
};
|
|
88
|
-
const output = await cli.executeCommandWithOutput(ppSolutionGetCommand, { options: { ...options, _: [] } });
|
|
89
|
-
const getSolutionOutput = JSON.parse(output.stdout);
|
|
90
|
-
return getSolutionOutput.solutionid;
|
|
79
|
+
const solution = await powerPlatform.getSolutionByName(dynamicsApiUrl, args.options.name);
|
|
80
|
+
return solution.solutionid;
|
|
91
81
|
}
|
|
92
82
|
async buildXmlRequestObject(solutionComponents, logger) {
|
|
93
83
|
if (this.verbose) {
|
|
@@ -10,7 +10,6 @@ import { powerPlatform } from '../../../../utils/powerPlatform.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import PowerPlatformCommand from '../../../base/PowerPlatformCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
-
import ppSolutionGetCommand from './solution-get.js';
|
|
14
13
|
class PpSolutionRemoveCommand extends PowerPlatformCommand {
|
|
15
14
|
get name() {
|
|
16
15
|
return commands.SOLUTION_REMOVE;
|
|
@@ -40,25 +39,17 @@ class PpSolutionRemoveCommand extends PowerPlatformCommand {
|
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
async getSolutionId(args) {
|
|
42
|
+
async getSolutionId(args, dynamicsApiUrl) {
|
|
44
43
|
if (args.options.id) {
|
|
45
44
|
return args.options.id;
|
|
46
45
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
name: args.options.name,
|
|
50
|
-
output: 'json',
|
|
51
|
-
debug: this.debug,
|
|
52
|
-
verbose: this.verbose
|
|
53
|
-
};
|
|
54
|
-
const output = await cli.executeCommandWithOutput(ppSolutionGetCommand, { options: { ...options, _: [] } });
|
|
55
|
-
const getSolutionOutput = JSON.parse(output.stdout);
|
|
56
|
-
return getSolutionOutput.solutionid;
|
|
46
|
+
const solution = await powerPlatform.getSolutionByName(dynamicsApiUrl, args.options.name);
|
|
47
|
+
return solution.solutionid;
|
|
57
48
|
}
|
|
58
49
|
async deleteSolution(args) {
|
|
59
50
|
try {
|
|
60
51
|
const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin);
|
|
61
|
-
const solutionId = await this.getSolutionId(args);
|
|
52
|
+
const solutionId = await this.getSolutionId(args, dynamicsApiUrl);
|
|
62
53
|
const requestOptions = {
|
|
63
54
|
url: `${dynamicsApiUrl}/api/data/v9.1/solutions(${solutionId})`,
|
|
64
55
|
headers: {
|
|
@@ -10,6 +10,9 @@ export const workflow = {
|
|
|
10
10
|
jobs: {
|
|
11
11
|
"build-and-deploy": {
|
|
12
12
|
"runs-on": "ubuntu-latest",
|
|
13
|
+
env: {
|
|
14
|
+
NodeVersion: "22.x"
|
|
15
|
+
},
|
|
13
16
|
steps: [
|
|
14
17
|
{
|
|
15
18
|
name: "Checkout",
|
|
@@ -19,7 +22,7 @@ export const workflow = {
|
|
|
19
22
|
name: "Use Node.js",
|
|
20
23
|
uses: "actions/setup-node@v4",
|
|
21
24
|
with: {
|
|
22
|
-
"node-version": "
|
|
25
|
+
"node-version": "${{ env.NodeVersion }}"
|
|
23
26
|
}
|
|
24
27
|
},
|
|
25
28
|
{
|
|
@@ -105,6 +108,10 @@ export const pipeline = {
|
|
|
105
108
|
{
|
|
106
109
|
name: "SiteAppCatalogUrl",
|
|
107
110
|
value: ""
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "NodeVersion",
|
|
114
|
+
value: "22.x"
|
|
108
115
|
}
|
|
109
116
|
],
|
|
110
117
|
stages: [
|
|
@@ -118,7 +125,7 @@ export const pipeline = {
|
|
|
118
125
|
task: "NodeTool@0",
|
|
119
126
|
displayName: "Use Node.js",
|
|
120
127
|
inputs: {
|
|
121
|
-
versionSpec: "
|
|
128
|
+
versionSpec: "$(NodeVersion)"
|
|
122
129
|
}
|
|
123
130
|
},
|
|
124
131
|
{
|
|
@@ -13,7 +13,6 @@ import { BaseProjectCommand } from './base-project-command.js';
|
|
|
13
13
|
import { validation } from '../../../../utils/validation.js';
|
|
14
14
|
import { pipeline } from './DeployWorkflow.js';
|
|
15
15
|
import { fsUtil } from '../../../../utils/fsUtil.js';
|
|
16
|
-
import { parse } from 'semver';
|
|
17
16
|
class SpfxProjectAzureDevOpsPipelineAddCommand extends BaseProjectCommand {
|
|
18
17
|
get name() {
|
|
19
18
|
return commands.PROJECT_AZUREDEVOPS_PIPELINE_ADD;
|
|
@@ -65,20 +64,6 @@ class SpfxProjectAzureDevOpsPipelineAddCommand extends BaseProjectCommand {
|
|
|
65
64
|
if (options.branchName) {
|
|
66
65
|
pipeline.trigger.branches.include[0] = options.branchName;
|
|
67
66
|
}
|
|
68
|
-
const version = this.getProjectVersion();
|
|
69
|
-
if (!version) {
|
|
70
|
-
throw `Unable to determine the version of the current SharePoint Framework project`;
|
|
71
|
-
}
|
|
72
|
-
const minorVersion = parse(version)?.minor;
|
|
73
|
-
if (minorVersion === undefined) {
|
|
74
|
-
throw `Unable to determine the minor version of the current SharePoint Framework project`;
|
|
75
|
-
}
|
|
76
|
-
if (minorVersion < 18) {
|
|
77
|
-
const node = this.getNodeAction(pipeline);
|
|
78
|
-
if (node.inputs) {
|
|
79
|
-
node.inputs.versionSpec = '16.x';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
67
|
const script = this.getScriptAction(pipeline);
|
|
83
68
|
if (script.script) {
|
|
84
69
|
if (options.loginMethod === 'user') {
|
|
@@ -122,10 +107,6 @@ class SpfxProjectAzureDevOpsPipelineAddCommand extends BaseProjectCommand {
|
|
|
122
107
|
const steps = this.getPipelineSteps(pipeline);
|
|
123
108
|
return steps.find(step => step.script);
|
|
124
109
|
}
|
|
125
|
-
getNodeAction(pipeline) {
|
|
126
|
-
const steps = this.getPipelineSteps(pipeline);
|
|
127
|
-
return steps.find(step => step.task && step.task.indexOf('NodeTool') >= 0);
|
|
128
|
-
}
|
|
129
110
|
getPipelineSteps(pipeline) {
|
|
130
111
|
return pipeline.stages[0].jobs[0].steps;
|
|
131
112
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FN002021_DEVDEP_rushstack_eslint_config } from '../project-upgrade/rules/FN002021_DEVDEP_rushstack_eslint_config.js';
|
|
2
|
+
import { FN001008_DEP_react } from './rules/FN001008_DEP_react.js';
|
|
3
|
+
import { FN001009_DEP_react_dom } from './rules/FN001009_DEP_react_dom.js';
|
|
4
|
+
import { FN001035_DEP_fluentui_react } from './rules/FN001035_DEP_fluentui_react.js';
|
|
5
|
+
import { FN002004_DEVDEP_gulp } from './rules/FN002004_DEVDEP_gulp.js';
|
|
6
|
+
import { FN002007_DEVDEP_ajv } from './rules/FN002007_DEVDEP_ajv.js';
|
|
7
|
+
import { FN002013_DEVDEP_types_webpack_env } from './rules/FN002013_DEVDEP_types_webpack_env.js';
|
|
8
|
+
import { FN002015_DEVDEP_types_react } from './rules/FN002015_DEVDEP_types_react.js';
|
|
9
|
+
import { FN002016_DEVDEP_types_react_dom } from './rules/FN002016_DEVDEP_types_react_dom.js';
|
|
10
|
+
import { FN002019_DEVDEP_microsoft_rush_stack_compiler } from './rules/FN002019_DEVDEP_microsoft_rush_stack_compiler.js';
|
|
11
|
+
import { FN021001_PKG_spfx_deps_versions_match_project_version } from './rules/FN021001_PKG_spfx_deps_versions_match_project_version.js';
|
|
12
|
+
export default [
|
|
13
|
+
new FN001008_DEP_react('17'),
|
|
14
|
+
new FN001009_DEP_react_dom('17'),
|
|
15
|
+
new FN001035_DEP_fluentui_react('^8.106.4'),
|
|
16
|
+
new FN002004_DEVDEP_gulp('4.0.2'),
|
|
17
|
+
new FN002007_DEVDEP_ajv('^6.12.5'),
|
|
18
|
+
new FN002013_DEVDEP_types_webpack_env('~1.15.2'),
|
|
19
|
+
new FN002015_DEVDEP_types_react('17'),
|
|
20
|
+
new FN002016_DEVDEP_types_react_dom('17'),
|
|
21
|
+
new FN002019_DEVDEP_microsoft_rush_stack_compiler(['5.3']),
|
|
22
|
+
new FN002021_DEVDEP_rushstack_eslint_config('4.0.1'),
|
|
23
|
+
new FN021001_PKG_spfx_deps_versions_match_project_version(true)
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=doctor-1.21.0.js.map
|
|
@@ -71,7 +71,8 @@ class SpfxProjectDoctorCommand extends BaseProjectCommand {
|
|
|
71
71
|
'1.18.1',
|
|
72
72
|
'1.18.2',
|
|
73
73
|
'1.19.0',
|
|
74
|
-
'1.20.0'
|
|
74
|
+
'1.20.0',
|
|
75
|
+
'1.21.0'
|
|
75
76
|
];
|
|
76
77
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initTelemetry).call(this);
|
|
77
78
|
__classPrivateFieldGet(this, _SpfxProjectDoctorCommand_instances, "m", _SpfxProjectDoctorCommand_initOptions).call(this);
|
|
@@ -13,7 +13,6 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
13
13
|
import commands from '../../commands.js';
|
|
14
14
|
import { workflow } from './DeployWorkflow.js';
|
|
15
15
|
import { BaseProjectCommand } from './base-project-command.js';
|
|
16
|
-
import { parse } from 'semver';
|
|
17
16
|
class SpfxProjectGithubWorkflowAddCommand extends BaseProjectCommand {
|
|
18
17
|
get name() {
|
|
19
18
|
return commands.PROJECT_GITHUB_WORKFLOW_ADD;
|
|
@@ -64,17 +63,6 @@ class SpfxProjectGithubWorkflowAddCommand extends BaseProjectCommand {
|
|
|
64
63
|
// eslint-disable-next-line camelcase
|
|
65
64
|
workflow.on.workflow_dispatch = null;
|
|
66
65
|
}
|
|
67
|
-
const version = this.getProjectVersion();
|
|
68
|
-
if (!version) {
|
|
69
|
-
throw `Unable to determine the version of the current SharePoint Framework project`;
|
|
70
|
-
}
|
|
71
|
-
const minorVersion = parse(version)?.minor;
|
|
72
|
-
if (minorVersion === undefined) {
|
|
73
|
-
throw `Unable to determine the minor version of the current SharePoint Framework project`;
|
|
74
|
-
}
|
|
75
|
-
if (minorVersion < 18) {
|
|
76
|
-
this.getNodeAction(workflow).with['node-version'] = '16.x';
|
|
77
|
-
}
|
|
78
66
|
if (options.skipFeatureDeployment) {
|
|
79
67
|
this.getDeployAction(workflow).with.SKIP_FEATURE_DEPLOYMENT = true;
|
|
80
68
|
}
|
|
@@ -103,10 +91,6 @@ class SpfxProjectGithubWorkflowAddCommand extends BaseProjectCommand {
|
|
|
103
91
|
const steps = this.getWorkFlowSteps(workflow);
|
|
104
92
|
return steps.find(step => step.uses && step.uses.indexOf('action-cli-deploy') >= 0);
|
|
105
93
|
}
|
|
106
|
-
getNodeAction(workflow) {
|
|
107
|
-
const steps = this.getWorkFlowSteps(workflow);
|
|
108
|
-
return steps.find(step => step.uses && step.uses.indexOf('actions/setup-node@') >= 0);
|
|
109
|
-
}
|
|
110
94
|
getWorkFlowSteps(workflow) {
|
|
111
95
|
return workflow.jobs['build-and-deploy'].steps;
|
|
112
96
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DependencyRule } from "./DependencyRule.js";
|
|
2
|
+
export class FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3 extends DependencyRule {
|
|
3
|
+
constructor(packageVersion) {
|
|
4
|
+
super('@microsoft/rush-stack-compiler-5.3', packageVersion, true);
|
|
5
|
+
}
|
|
6
|
+
get id() {
|
|
7
|
+
return 'FN002029';
|
|
8
|
+
}
|
|
9
|
+
get supersedes() {
|
|
10
|
+
return ['FN002010', 'FN002011', 'FN002012', 'FN002017', 'FN002018', 'FN002020', 'FN002028'];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
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 { FN001023_DEP_microsoft_sp_component_base } from './rules/FN001023_DEP_microsoft_sp_component_base.js';
|
|
11
|
+
import { FN001024_DEP_microsoft_sp_diagnostics } from './rules/FN001024_DEP_microsoft_sp_diagnostics.js';
|
|
12
|
+
import { FN001025_DEP_microsoft_sp_dynamic_data } from './rules/FN001025_DEP_microsoft_sp_dynamic_data.js';
|
|
13
|
+
import { FN001026_DEP_microsoft_sp_extension_base } from './rules/FN001026_DEP_microsoft_sp_extension_base.js';
|
|
14
|
+
import { FN001027_DEP_microsoft_sp_http } from './rules/FN001027_DEP_microsoft_sp_http.js';
|
|
15
|
+
import { FN001028_DEP_microsoft_sp_list_subscription } from './rules/FN001028_DEP_microsoft_sp_list_subscription.js';
|
|
16
|
+
import { FN001029_DEP_microsoft_sp_loader } from './rules/FN001029_DEP_microsoft_sp_loader.js';
|
|
17
|
+
import { FN001030_DEP_microsoft_sp_module_interfaces } from './rules/FN001030_DEP_microsoft_sp_module_interfaces.js';
|
|
18
|
+
import { FN001031_DEP_microsoft_sp_odata_types } from './rules/FN001031_DEP_microsoft_sp_odata_types.js';
|
|
19
|
+
import { FN001032_DEP_microsoft_sp_page_context } from './rules/FN001032_DEP_microsoft_sp_page_context.js';
|
|
20
|
+
import { FN001034_DEP_microsoft_sp_adaptive_card_extension_base } from './rules/FN001034_DEP_microsoft_sp_adaptive_card_extension_base.js';
|
|
21
|
+
import { FN002001_DEVDEP_microsoft_sp_build_web } from './rules/FN002001_DEVDEP_microsoft_sp_build_web.js';
|
|
22
|
+
import { FN002002_DEVDEP_microsoft_sp_module_interfaces } from './rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.js';
|
|
23
|
+
import { FN002022_DEVDEP_microsoft_eslint_plugin_spfx } from './rules/FN002022_DEVDEP_microsoft_eslint_plugin_spfx.js';
|
|
24
|
+
import { FN002023_DEVDEP_microsoft_eslint_config_spfx } from './rules/FN002023_DEVDEP_microsoft_eslint_config_spfx.js';
|
|
25
|
+
import { FN002024_DEVDEP_eslint } from './rules/FN002024_DEVDEP_eslint.js';
|
|
26
|
+
import { FN002026_DEVDEP_typescript } from './rules/FN002026_DEVDEP_typescript.js';
|
|
27
|
+
import { FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3 } from './rules/FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3.js';
|
|
28
|
+
import { FN010001_YORC_version } from './rules/FN010001_YORC_version.js';
|
|
29
|
+
import { FN012017_TSC_extends } from './rules/FN012017_TSC_extends.js';
|
|
30
|
+
import { FN021003_PKG_engines_node } from './rules/FN021003_PKG_engines_node.js';
|
|
31
|
+
export default [
|
|
32
|
+
new FN001001_DEP_microsoft_sp_core_library('1.21.0'),
|
|
33
|
+
new FN001002_DEP_microsoft_sp_lodash_subset('1.21.0'),
|
|
34
|
+
new FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.21.0'),
|
|
35
|
+
new FN001004_DEP_microsoft_sp_webpart_base('1.21.0'),
|
|
36
|
+
new FN001011_DEP_microsoft_sp_dialog('1.21.0'),
|
|
37
|
+
new FN001012_DEP_microsoft_sp_application_base('1.21.0'),
|
|
38
|
+
new FN001014_DEP_microsoft_sp_listview_extensibility('1.21.0'),
|
|
39
|
+
new FN001021_DEP_microsoft_sp_property_pane('1.21.0'),
|
|
40
|
+
new FN001023_DEP_microsoft_sp_component_base('1.21.0'),
|
|
41
|
+
new FN001024_DEP_microsoft_sp_diagnostics('1.21.0'),
|
|
42
|
+
new FN001025_DEP_microsoft_sp_dynamic_data('1.21.0'),
|
|
43
|
+
new FN001026_DEP_microsoft_sp_extension_base('1.21.0'),
|
|
44
|
+
new FN001027_DEP_microsoft_sp_http('1.21.0'),
|
|
45
|
+
new FN001028_DEP_microsoft_sp_list_subscription('1.21.0'),
|
|
46
|
+
new FN001029_DEP_microsoft_sp_loader('1.21.0'),
|
|
47
|
+
new FN001030_DEP_microsoft_sp_module_interfaces('1.21.0'),
|
|
48
|
+
new FN001031_DEP_microsoft_sp_odata_types('1.21.0'),
|
|
49
|
+
new FN001032_DEP_microsoft_sp_page_context('1.21.0'),
|
|
50
|
+
new FN001013_DEP_microsoft_decorators('1.21.0'),
|
|
51
|
+
new FN001034_DEP_microsoft_sp_adaptive_card_extension_base('1.21.0'),
|
|
52
|
+
new FN002001_DEVDEP_microsoft_sp_build_web('1.21.0'),
|
|
53
|
+
new FN002002_DEVDEP_microsoft_sp_module_interfaces('1.21.0'),
|
|
54
|
+
new FN002024_DEVDEP_eslint('8.57.1'),
|
|
55
|
+
new FN002022_DEVDEP_microsoft_eslint_plugin_spfx('1.21.0'),
|
|
56
|
+
new FN002023_DEVDEP_microsoft_eslint_config_spfx('1.21.0'),
|
|
57
|
+
new FN002026_DEVDEP_typescript('5.3.3'),
|
|
58
|
+
new FN002029_DEVDEP_microsoft_rush_stack_compiler_5_3('0.1.0'),
|
|
59
|
+
new FN010001_YORC_version('1.21.0'),
|
|
60
|
+
new FN012017_TSC_extends('./node_modules/@microsoft/rush-stack-compiler-5.3/includes/tsconfig-web.json'),
|
|
61
|
+
new FN021003_PKG_engines_node('>=22.14.0 < 23.0.0')
|
|
62
|
+
];
|
|
63
|
+
//# sourceMappingURL=upgrade-1.21.0.js.map
|
|
@@ -73,7 +73,8 @@ class SpfxProjectUpgradeCommand extends BaseProjectCommand {
|
|
|
73
73
|
'1.18.1',
|
|
74
74
|
'1.18.2',
|
|
75
75
|
'1.19.0',
|
|
76
|
-
'1.20.0'
|
|
76
|
+
'1.20.0',
|
|
77
|
+
'1.21.0'
|
|
77
78
|
];
|
|
78
79
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initTelemetry).call(this);
|
|
79
80
|
__classPrivateFieldGet(this, _SpfxProjectUpgradeCommand_instances, "m", _SpfxProjectUpgradeCommand_initOptions).call(this);
|
|
@@ -590,6 +590,21 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
590
590
|
range: '^4 || ^5',
|
|
591
591
|
fix: 'npm i -g yo@5'
|
|
592
592
|
}
|
|
593
|
+
},
|
|
594
|
+
'1.21.0': {
|
|
595
|
+
gulpCli: {
|
|
596
|
+
range: '^1 || ^2 || ^3',
|
|
597
|
+
fix: 'npm i -g gulp-cli@3'
|
|
598
|
+
},
|
|
599
|
+
node: {
|
|
600
|
+
range: '>=22.14.0 < 23.0.0',
|
|
601
|
+
fix: 'Install Node.js >=22.14.0 < 23.0.0'
|
|
602
|
+
},
|
|
603
|
+
sp: SharePointVersion.SPO,
|
|
604
|
+
yo: {
|
|
605
|
+
range: '^4 || ^5',
|
|
606
|
+
fix: 'npm i -g yo@5'
|
|
607
|
+
}
|
|
593
608
|
}
|
|
594
609
|
};
|
|
595
610
|
this.output = '';
|
|
@@ -7,6 +7,7 @@ var _UtilAccessTokenGetCommand_instances, _UtilAccessTokenGetCommand_initTelemet
|
|
|
7
7
|
import auth, { Auth } from '../../../../Auth.js';
|
|
8
8
|
import Command from '../../../../Command.js';
|
|
9
9
|
import commands from '../../commands.js';
|
|
10
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
10
11
|
class UtilAccessTokenGetCommand extends Command {
|
|
11
12
|
get name() {
|
|
12
13
|
return commands.ACCESSTOKEN_GET;
|
|
@@ -34,8 +35,14 @@ class UtilAccessTokenGetCommand extends Command {
|
|
|
34
35
|
resource = Auth.getEndpointForResource('https://graph.microsoft.com', auth.connection.cloudType);
|
|
35
36
|
}
|
|
36
37
|
try {
|
|
37
|
-
const
|
|
38
|
-
|
|
38
|
+
const token = await auth.ensureAccessToken(resource, logger, this.debug, args.options.new);
|
|
39
|
+
if (args.options.decoded) {
|
|
40
|
+
const { header, payload } = accessToken.getDecodedAccessToken(token);
|
|
41
|
+
await logger.logRaw(`${JSON.stringify(header, null, 2)}.${JSON.stringify(payload, null, 2)}.[signature]`);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
await logger.log(token);
|
|
45
|
+
}
|
|
39
46
|
}
|
|
40
47
|
catch (err) {
|
|
41
48
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -45,7 +52,8 @@ class UtilAccessTokenGetCommand extends Command {
|
|
|
45
52
|
_UtilAccessTokenGetCommand_instances = new WeakSet(), _UtilAccessTokenGetCommand_initTelemetry = function _UtilAccessTokenGetCommand_initTelemetry() {
|
|
46
53
|
this.telemetry.push((args) => {
|
|
47
54
|
Object.assign(this.telemetryProperties, {
|
|
48
|
-
new: args.options.new
|
|
55
|
+
new: args.options.new,
|
|
56
|
+
decoded: args.options.decoded
|
|
49
57
|
});
|
|
50
58
|
});
|
|
51
59
|
}, _UtilAccessTokenGetCommand_initOptions = function _UtilAccessTokenGetCommand_initOptions() {
|
|
@@ -53,6 +61,8 @@ _UtilAccessTokenGetCommand_instances = new WeakSet(), _UtilAccessTokenGetCommand
|
|
|
53
61
|
option: '-r, --resource <resource>'
|
|
54
62
|
}, {
|
|
55
63
|
option: '--new'
|
|
64
|
+
}, {
|
|
65
|
+
option: '--decoded'
|
|
56
66
|
});
|
|
57
67
|
};
|
|
58
68
|
export default new UtilAccessTokenGetCommand();
|
|
@@ -75,6 +75,14 @@ export const accessToken = {
|
|
|
75
75
|
}
|
|
76
76
|
return userId;
|
|
77
77
|
},
|
|
78
|
+
getDecodedAccessToken(accessToken) {
|
|
79
|
+
const chunks = accessToken.split('.');
|
|
80
|
+
const headerString = Buffer.from(chunks[0], 'base64').toString();
|
|
81
|
+
const payloadString = Buffer.from(chunks[1], 'base64').toString();
|
|
82
|
+
const header = JSON.parse(headerString);
|
|
83
|
+
const payload = JSON.parse(payloadString);
|
|
84
|
+
return { header, payload };
|
|
85
|
+
},
|
|
78
86
|
/**
|
|
79
87
|
* Asserts the presence of a delegated access token.
|
|
80
88
|
* @throws {CommandError} Will throw an error if the access token is not available.
|
|
@@ -71,10 +71,7 @@ export const powerPlatform = {
|
|
|
71
71
|
* @param logger The logger object
|
|
72
72
|
* @param verbose Set for verbose logging
|
|
73
73
|
*/
|
|
74
|
-
async getCardByName(dynamicsApiUrl, name
|
|
75
|
-
if (verbose && logger) {
|
|
76
|
-
await logger.logToStderr(`Retrieving the card with name ${name}`);
|
|
77
|
-
}
|
|
74
|
+
async getCardByName(dynamicsApiUrl, name) {
|
|
78
75
|
const requestOptions = {
|
|
79
76
|
url: `${dynamicsApiUrl}/api/data/v9.1/cards?$filter=name eq '${name}'`,
|
|
80
77
|
headers: {
|
|
@@ -91,6 +88,30 @@ export const powerPlatform = {
|
|
|
91
88
|
return cli.handleMultipleResultsFound(`Multiple cards with name '${name}' found.`, resultAsKeyValuePair);
|
|
92
89
|
}
|
|
93
90
|
return result.value[0];
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Get a solution by name
|
|
94
|
+
* Returns the solution object
|
|
95
|
+
* @param dynamicsApiUrl The dynamics api url of the environment
|
|
96
|
+
* @param name The name of the solution
|
|
97
|
+
*/
|
|
98
|
+
async getSolutionByName(dynamicsApiUrl, name) {
|
|
99
|
+
const requestOptions = {
|
|
100
|
+
url: `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true and uniquename eq \'${name}\'&$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`,
|
|
101
|
+
headers: {
|
|
102
|
+
accept: 'application/json;odata.metadata=none'
|
|
103
|
+
},
|
|
104
|
+
responseType: 'json'
|
|
105
|
+
};
|
|
106
|
+
const result = await request.get(requestOptions);
|
|
107
|
+
if (result.value.length === 0) {
|
|
108
|
+
throw Error(`The specified solution '${name}' does not exist.`);
|
|
109
|
+
}
|
|
110
|
+
if (result.value.length > 1) {
|
|
111
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('solutionid', result.value);
|
|
112
|
+
return cli.handleMultipleResultsFound(`Multiple solutions with name '${name}' found.`, resultAsKeyValuePair);
|
|
113
|
+
}
|
|
114
|
+
return result.value[0];
|
|
94
115
|
}
|
|
95
116
|
};
|
|
96
117
|
//# sourceMappingURL=powerPlatform.js.map
|
package/dist/utils/prompt.js
CHANGED
|
@@ -6,13 +6,20 @@ let inquirerSelect;
|
|
|
6
6
|
;
|
|
7
7
|
;
|
|
8
8
|
export const prompt = {
|
|
9
|
-
/* c8 ignore next
|
|
9
|
+
/* c8 ignore next 16 */
|
|
10
10
|
async forInput(config) {
|
|
11
11
|
if (!inquirerInput) {
|
|
12
12
|
inquirerInput = await import('@inquirer/input');
|
|
13
13
|
}
|
|
14
14
|
const errorOutput = cli.getSettingWithDefaultValue(settingsNames.errorOutput, 'stderr');
|
|
15
|
-
return inquirerInput
|
|
15
|
+
return inquirerInput
|
|
16
|
+
.default(config, { output: errorOutput === 'stderr' ? process.stderr : process.stdout })
|
|
17
|
+
.catch(error => {
|
|
18
|
+
if (error instanceof Error && error.name === 'ExitPromptError') {
|
|
19
|
+
return ''; // noop; handle Ctrl + C
|
|
20
|
+
}
|
|
21
|
+
throw error;
|
|
22
|
+
});
|
|
16
23
|
},
|
|
17
24
|
/* c8 ignore next 9 */
|
|
18
25
|
async forConfirmation(config) {
|
package/dist/utils/types.js
CHANGED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
|
|
3
|
+
# entra group member remove
|
|
4
|
+
|
|
5
|
+
Removes members from a Microsoft Entra group
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
m365 entra group member remove [options]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Options
|
|
14
|
+
|
|
15
|
+
```md definition-list
|
|
16
|
+
`-i, --groupId [groupId]`
|
|
17
|
+
: The ID of the Entra ID group. Specify `groupId` or `groupName` but not both.
|
|
18
|
+
|
|
19
|
+
`-n, --groupName [groupName]`
|
|
20
|
+
: The display name of the Entra ID group. Specify `groupId` or `groupName` but not both.
|
|
21
|
+
|
|
22
|
+
`--userIds [userIds]`
|
|
23
|
+
: Microsoft Entra user IDs. You can also pass a comma-separated list of IDs. Specify either `userIds`, `userNames`, `subgroupIds` or `subgroupNames` but not multiple.
|
|
24
|
+
|
|
25
|
+
`--userNames [userNames]`
|
|
26
|
+
: The user principal names of users. You can also pass a comma-separated list of UPNs. Specify either `userIds`, `userNames`, `subgroupIds` or `subgroupNames` but not multiple.
|
|
27
|
+
|
|
28
|
+
`--subgroupIds [subgroupIds]`
|
|
29
|
+
: Microsoft Entra group IDs. You can also pass a comma-separated list of IDs. Specify either `userIds`, `userNames`, `subgroupIds` or `subgroupNames` but not multiple.
|
|
30
|
+
|
|
31
|
+
`--subgroupNames [subgroupNames]`
|
|
32
|
+
: The display names of Microsoft Entra groups. You can also pass a comma-separated list of group display names. Specify either `userIds`, `userNames`, `subgroupIds` or `subgroupNames` but not multiple.
|
|
33
|
+
|
|
34
|
+
`-r, --role [role]`
|
|
35
|
+
: The role to be removed from the users. Valid values: `Owner`, `Member`. Defaults to both.
|
|
36
|
+
|
|
37
|
+
`--suppressNotFound`
|
|
38
|
+
: Suppress errors when a user was not found in a group.
|
|
39
|
+
|
|
40
|
+
`-f, --force`
|
|
41
|
+
: Don't prompt for confirmation.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
<Global />
|
|
45
|
+
|
|
46
|
+
## Remarks
|
|
47
|
+
|
|
48
|
+
:::tip
|
|
49
|
+
|
|
50
|
+
When you use the `suppressNotFound` option, the command will not return an error if a user is not found as either an owner or a member of the group.
|
|
51
|
+
This feature proves useful when you need to remove a user from a group, but you are uncertain whether the user holds the role of a member or an owner within that group.
|
|
52
|
+
Without using this option, you would need to manually verify the user's role in the group before proceeding with removal.
|
|
53
|
+
|
|
54
|
+
:::
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
Remove a single user specified by ID as member from a group specified by display name
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
m365 entra group member remove --groupName Developers --userIds 098b9f52-f48c-4401-819f-29c33794c3f5 --role Member
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Remove multiple users specified by ID from a group specified by ID
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
m365 entra group member remove --groupId a03c0c35-ef9a-419b-8cab-f89e0a8d2d2a --userIds "098b9f52-f48c-4401-819f-29c33794c3f5,f1e06e31-3abf-4746-83c2-1513d71f38b8"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Remove a single user specified by UPN as an owner from a group specified by display name
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
m365 entra group member remove --groupName Developers --userNames john.doe@contoso.com --role Owner
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Remove multiple users specified by UPN from a group specified by ID
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
m365 entra group member remove --groupId a03c0c35-ef9a-419b-8cab-f89e0a8d2d2a --userNames "john.doe@contoso.com,adele.vance@contoso.com"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Remove a single user specified by ID as owner and member of the group and suppress errors when the user was not found as owner or member
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
m365 entra group member remove --groupName Developers --userIds 098b9f52-f48c-4401-819f-29c33794c3f5 --suppressNotFound
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Remove 2 nested groups referenced by id from a security group
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
m365 entra group member remove --groupName Developers --subgroupIds "b51b6157-839f-4d92-8dab-ac61b53c6c40,1e793f86-8dc6-4df6-8037-649ef9a22330" --role Member
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Response
|
|
95
|
+
|
|
96
|
+
The command doesn't return a response on success.
|