@pnp/cli-microsoft365 10.6.0-beta.7205e34 → 10.6.0-beta.908b842

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/dist/config.js CHANGED
@@ -33,6 +33,7 @@ export default {
33
33
  'https://graph.microsoft.com/PeopleSettings.ReadWrite.All',
34
34
  'https://graph.microsoft.com/Place.Read.All',
35
35
  'https://graph.microsoft.com/Policy.Read.All',
36
+ 'https://graph.microsoft.com/Policy.Read.PermissionGrant',
36
37
  'https://graph.microsoft.com/RecordsManagement.ReadWrite.All',
37
38
  'https://graph.microsoft.com/Reports.Read.All',
38
39
  'https://graph.microsoft.com/ReportSettings.ReadWrite.All',
@@ -9,10 +9,22 @@ import GraphCommand from '../../../base/GraphCommand.js';
9
9
  import commands from '../../commands.js';
10
10
  const policyEndPoints = {
11
11
  activitybasedtimeout: "activityBasedTimeoutPolicies",
12
+ adminconsentrequest: "adminConsentRequestPolicy",
13
+ appManagement: "appManagementPolicies",
14
+ authenticationflows: "authenticationFlowsPolicy",
15
+ authenticationmethods: "authenticationMethodsPolicy",
16
+ authenticationstrength: "authenticationStrengthPolicies",
12
17
  authorization: "authorizationPolicy",
13
18
  claimsmapping: "claimsMappingPolicies",
19
+ conditionalaccess: "conditionalAccessPolicies",
20
+ crosstenantaccess: "crossTenantAccessPolicy",
21
+ defaultappmanagement: "defaultAppManagementPolicy",
22
+ deviceregistration: "deviceRegistrationPolicy",
23
+ featurerolloutpolicy: "featureRolloutPolicies",
14
24
  homerealmdiscovery: "homeRealmDiscoveryPolicies",
15
25
  identitysecuritydefaultsenforcement: "identitySecurityDefaultsEnforcementPolicy",
26
+ permissiongrant: "permissionGrantPolicies",
27
+ rolemanagement: "roleManagementPolicies",
16
28
  tokenissuance: "tokenIssuancePolicies",
17
29
  tokenlifetime: "tokenLifetimePolicies"
18
30
  };
@@ -56,15 +68,26 @@ class EntraPolicyListCommand extends GraphCommand {
56
68
  }
57
69
  async getPolicies(policyType) {
58
70
  const endpoint = policyEndPoints[policyType];
71
+ let requestUrl = `${this.resource}/v1.0/policies/${endpoint}`;
72
+ if (endpoint === policyEndPoints.rolemanagement) {
73
+ // roleManagementPolicies endpoint requires $filter query parameter
74
+ requestUrl += `?$filter=scopeId eq '/' and scopeType eq 'DirectoryRole'`;
75
+ }
59
76
  const requestOptions = {
60
- url: `${this.resource}/v1.0/policies/${endpoint}`,
77
+ url: requestUrl,
61
78
  headers: {
62
79
  accept: 'application/json;odata.metadata=none'
63
80
  },
64
81
  responseType: 'json'
65
82
  };
66
83
  const response = await request.get(requestOptions);
67
- if (endpoint === policyEndPoints.authorization ||
84
+ if (endpoint === policyEndPoints.adminconsentrequest ||
85
+ endpoint === policyEndPoints.authenticationflows ||
86
+ endpoint === policyEndPoints.authenticationmethods ||
87
+ endpoint === policyEndPoints.authorization ||
88
+ endpoint === policyEndPoints.crosstenantaccess ||
89
+ endpoint === policyEndPoints.defaultappmanagement ||
90
+ endpoint === policyEndPoints.deviceregistration ||
68
91
  endpoint === policyEndPoints.identitysecuritydefaultsenforcement) {
69
92
  return response;
70
93
  }
@@ -95,6 +118,26 @@ _a = EntraPolicyListCommand, _EntraPolicyListCommand_instances = new WeakSet(),
95
118
  return true;
96
119
  });
97
120
  };
98
- EntraPolicyListCommand.supportedPolicyTypes = ['activityBasedTimeout', 'authorization', 'claimsMapping', 'homeRealmDiscovery', 'identitySecurityDefaultsEnforcement', 'tokenIssuance', 'tokenLifetime'];
121
+ EntraPolicyListCommand.supportedPolicyTypes = [
122
+ 'activityBasedTimeout',
123
+ 'adminConsentRequest',
124
+ 'appManagement',
125
+ 'authenticationFlows',
126
+ 'authenticationMethods',
127
+ 'authenticationStrength',
128
+ 'authorization',
129
+ 'claimsMapping',
130
+ 'conditionalAccess',
131
+ 'crossTenantAccess',
132
+ 'defaultAppManagement',
133
+ 'deviceRegistration',
134
+ 'featureRolloutPolicy',
135
+ 'homeRealmDiscovery',
136
+ 'identitySecurityDefaultsEnforcement',
137
+ 'permissionGrant',
138
+ 'roleManagement',
139
+ 'tokenIssuance',
140
+ 'tokenLifetime'
141
+ ];
99
142
  export default new EntraPolicyListCommand();
100
143
  //# sourceMappingURL=policy-list.js.map
@@ -0,0 +1,57 @@
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
3
+ import { zod } from '../../../../utils/zod.js';
4
+ import { validation } from '../../../../utils/validation.js';
5
+ import GraphCommand from '../../../base/GraphCommand.js';
6
+ import commands from '../../commands.js';
7
+ import request from '../../../../request.js';
8
+ const options = globalOptionsZod
9
+ .extend({
10
+ resourceId: zod.alias('i', z.string()),
11
+ resourceType: zod.alias('t', z.enum(['user', 'group', 'device', 'organization'])),
12
+ name: zod.alias('n', z.string())
13
+ })
14
+ .strict();
15
+ class GraphOpenExtensionGetCommand extends GraphCommand {
16
+ get name() {
17
+ return commands.OPENEXTENSION_GET;
18
+ }
19
+ get description() {
20
+ return 'Retrieves a specific open extension for a resource';
21
+ }
22
+ get schema() {
23
+ return options;
24
+ }
25
+ getRefinedSchema(schema) {
26
+ return schema
27
+ .refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)), options => ({
28
+ message: `The '${options.resourceId}' must be a valid GUID`,
29
+ path: ['resourceId']
30
+ }))
31
+ .refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))), options => ({
32
+ message: `The '${options.resourceId}' must be a valid GUID or user principal name`,
33
+ path: ['resourceId']
34
+ }));
35
+ }
36
+ async commandAction(logger, args) {
37
+ try {
38
+ if (this.verbose) {
39
+ await logger.logToStderr(`Retrieving open extension for resource ${args.options.resourceId}...`);
40
+ }
41
+ const requestOptions = {
42
+ url: `${this.resource}/v1.0/${args.options.resourceType}${args.options.resourceType === 'organization' ? '' : 's'}/${args.options.resourceId}/extensions/${args.options.name}`,
43
+ headers: {
44
+ accept: 'application/json;odata.metadata=none'
45
+ },
46
+ responseType: 'json'
47
+ };
48
+ const res = await request.get(requestOptions);
49
+ await logger.log(res);
50
+ }
51
+ catch (err) {
52
+ this.handleRejectedODataJsonPromise(err);
53
+ }
54
+ }
55
+ }
56
+ export default new GraphOpenExtensionGetCommand();
57
+ //# sourceMappingURL=openextension-get.js.map
@@ -0,0 +1,62 @@
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
3
+ import { zod } from '../../../../utils/zod.js';
4
+ import { validation } from '../../../../utils/validation.js';
5
+ import GraphCommand from '../../../base/GraphCommand.js';
6
+ import commands from '../../commands.js';
7
+ import { odata } from '../../../../utils/odata.js';
8
+ const options = globalOptionsZod
9
+ .extend({
10
+ resourceId: zod.alias('i', z.string()),
11
+ resourceType: zod.alias('t', z.enum(['user', 'group', 'device', 'organization']))
12
+ })
13
+ .strict();
14
+ class GraphOpenExtensionListCommand extends GraphCommand {
15
+ get name() {
16
+ return commands.OPENEXTENSION_LIST;
17
+ }
18
+ get description() {
19
+ return 'Retrieves all open extensions for a resource';
20
+ }
21
+ defaultProperties() {
22
+ return ['id', 'extensionName'];
23
+ }
24
+ get schema() {
25
+ return options;
26
+ }
27
+ getRefinedSchema(schema) {
28
+ return schema
29
+ .refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' ||
30
+ (options.resourceId && validation.isValidGuid(options.resourceId)), options => ({
31
+ message: `The '${options.resourceId}' must be a valid GUID`,
32
+ path: ['resourceId']
33
+ }))
34
+ .refine(options => options.resourceType !== 'user' ||
35
+ (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))), options => ({
36
+ message: `The '${options.resourceId}' must be a valid GUID or user principal name`,
37
+ path: ['resourceId']
38
+ }));
39
+ }
40
+ async commandAction(logger, args) {
41
+ try {
42
+ const requestOptions = {
43
+ url: `${this.resource}/v1.0/${args.options.resourceType}${args.options.resourceType === 'organization' ? '' : 's'}/${args.options.resourceId}/extensions`,
44
+ headers: {
45
+ accept: 'application/json;odata.metadata=none',
46
+ 'content-type': 'application/json'
47
+ },
48
+ responseType: 'json'
49
+ };
50
+ if (args.options.verbose) {
51
+ await logger.logToStderr(`Retrieving open extensions for the ${args.options.resourceType} with id '${args.options.resourceId}'...`);
52
+ }
53
+ const res = await odata.getAllItems(requestOptions);
54
+ await logger.log(res);
55
+ }
56
+ catch (err) {
57
+ this.handleRejectedODataJsonPromise(err);
58
+ }
59
+ }
60
+ }
61
+ export default new GraphOpenExtensionListCommand();
62
+ //# sourceMappingURL=openextension-list.js.map
@@ -0,0 +1,68 @@
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
3
+ import { zod } from '../../../../utils/zod.js';
4
+ import { validation } from '../../../../utils/validation.js';
5
+ import GraphCommand from '../../../base/GraphCommand.js';
6
+ import commands from '../../commands.js';
7
+ import { cli } from '../../../../cli/cli.js';
8
+ import request from '../../../../request.js';
9
+ const options = globalOptionsZod
10
+ .extend({
11
+ resourceId: zod.alias('i', z.string()),
12
+ resourceType: zod.alias('t', z.enum(['user', 'group', 'device', 'organization'])),
13
+ name: zod.alias('n', z.string()),
14
+ force: zod.alias('f', z.boolean().optional())
15
+ })
16
+ .strict();
17
+ class GraphOpenExtensionRemoveCommand extends GraphCommand {
18
+ get name() {
19
+ return commands.OPENEXTENSION_REMOVE;
20
+ }
21
+ get description() {
22
+ return 'Removes a specific open extension for a resource';
23
+ }
24
+ get schema() {
25
+ return options;
26
+ }
27
+ getRefinedSchema(schema) {
28
+ return schema
29
+ .refine(options => options.resourceType !== 'group' && options.resourceType !== 'device' && options.resourceType !== 'organization' || (options.resourceId && validation.isValidGuid(options.resourceId)), options => ({
30
+ message: `The '${options.resourceId}' must be a valid GUID`,
31
+ path: ['resourceId']
32
+ }))
33
+ .refine(options => options.resourceType !== 'user' || (options.resourceId && (validation.isValidGuid(options.resourceId) || validation.isValidUserPrincipalName(options.resourceId))), options => ({
34
+ message: `The '${options.resourceId}' must be a valid GUID or user principal name`,
35
+ path: ['resourceId']
36
+ }));
37
+ }
38
+ async commandAction(logger, args) {
39
+ const removeOpenExtension = async () => {
40
+ try {
41
+ if (this.verbose) {
42
+ await logger.logToStderr(`Removing open extension for resource ${args.options.resourceId}...`);
43
+ }
44
+ const requestOptions = {
45
+ url: `${this.resource}/v1.0/${args.options.resourceType}${args.options.resourceType === 'organization' ? '' : 's'}/${args.options.resourceId}/extensions/${args.options.name}`,
46
+ headers: {
47
+ accept: 'application/json;odata.metadata=none'
48
+ }
49
+ };
50
+ await request.delete(requestOptions);
51
+ }
52
+ catch (err) {
53
+ this.handleRejectedODataJsonPromise(err);
54
+ }
55
+ };
56
+ if (args.options.force) {
57
+ await removeOpenExtension();
58
+ }
59
+ else {
60
+ const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove open extension '${args.options.name}' from resource '${args.options.resourceId}' of type '${args.options.resourceType}'?` });
61
+ if (result) {
62
+ await removeOpenExtension();
63
+ }
64
+ }
65
+ }
66
+ }
67
+ export default new GraphOpenExtensionRemoveCommand();
68
+ //# sourceMappingURL=openextension-remove.js.map
@@ -5,6 +5,9 @@ export default {
5
5
  DIRECTORYEXTENSION_GET: `${prefix} directoryextension get`,
6
6
  DIRECTORYEXTENSION_REMOVE: `${prefix} directoryextension remove`,
7
7
  OPENEXTENSION_ADD: `${prefix} openextension add`,
8
+ OPENEXTENSION_GET: `${prefix} openextension get`,
9
+ OPENEXTENSION_LIST: `${prefix} openextension list`,
10
+ OPENEXTENSION_REMOVE: `${prefix} openextension remove`,
8
11
  SCHEMAEXTENSION_ADD: `${prefix} schemaextension add`,
9
12
  SCHEMAEXTENSION_GET: `${prefix} schemaextension get`,
10
13
  SCHEMAEXTENSION_LIST: `${prefix} schemaextension list`,
@@ -35,13 +35,19 @@ class PpCardCloneCommand extends PowerPlatformCommand {
35
35
  if (args.options.id) {
36
36
  return args.options.id;
37
37
  }
38
- const card = await powerPlatform.getCardByName(dynamicsApiUrl, args.options.name, logger, this.verbose);
38
+ if (this.verbose) {
39
+ await logger.logToStderr(`Retrieving the card Id for card '${args.options.name}'`);
40
+ }
41
+ const card = await powerPlatform.getCardByName(dynamicsApiUrl, args.options.name);
39
42
  return card.cardid;
40
43
  }
41
44
  async cloneCard(args, logger) {
42
45
  try {
43
46
  const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin);
44
47
  const cardId = await this.getCardId(args, dynamicsApiUrl, logger);
48
+ if (this.verbose) {
49
+ await logger.logToStderr(`Cloning the card with id '${cardId}'`);
50
+ }
45
51
  const requestOptions = {
46
52
  url: `${dynamicsApiUrl}/api/data/v9.1/CardCreateClone`,
47
53
  headers: {
@@ -39,10 +39,13 @@ class PpCardGetCommand extends PowerPlatformCommand {
39
39
  }
40
40
  async getCard(dynamicsApiUrl, options, logger) {
41
41
  if (options.name) {
42
- return await powerPlatform.getCardByName(dynamicsApiUrl, options.name, logger, this.verbose);
42
+ if (this.verbose) {
43
+ await logger.logToStderr(`Retrieving the card with name '${options.name}'`);
44
+ }
45
+ return await powerPlatform.getCardByName(dynamicsApiUrl, options.name);
43
46
  }
44
47
  if (this.verbose) {
45
- await logger.logToStderr(`Retrieving the card with id ${options.id}`);
48
+ await logger.logToStderr(`Retrieving the card with id '${options.id}'`);
46
49
  }
47
50
  const requestOptions = {
48
51
  url: `${dynamicsApiUrl}/api/data/v9.1/cards(${options.id})`,
@@ -43,13 +43,19 @@ class PpCardRemoveCommand extends PowerPlatformCommand {
43
43
  if (args.options.id) {
44
44
  return args.options.id;
45
45
  }
46
- const card = await powerPlatform.getCardByName(dynamicsApiUrl, args.options.name, logger, this.verbose);
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
- if (options.id) {
59
- 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`;
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.environmentName, args.options.asAdmin);
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 options = {
82
- environmentName: args.options.environmentName,
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 options = {
48
- environmentName: args.options.environmentName,
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: {
@@ -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, logger, verbose) {
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
@@ -16,7 +16,7 @@ m365 entra policy list [options]
16
16
 
17
17
  ```md definition-list
18
18
  `-t, --type [type]`
19
- : The type of policies to return. Allowed values `activityBasedTimeout`, `authorization`, `claimsMapping`, `homeRealmDiscovery`, `identitySecurityDefaultsEnforcement`, `tokenIssuance`, `tokenLifetime`. If omitted, all policies are returned.
19
+ : The type of policies to return. Allowed values `activityBasedTimeout`, `adminConsentRequest`, `appManagement`, `authenticationFlows`, `authenticationMethods`, `authenticationStrength`, `authorization`, `claimsMapping`, `conditionalAccess`, `crossTenantAccess`, `defaultAppManagement`, `deviceRegistration`, `featureRolloutPolicy`, `homeRealmDiscovery`, `identitySecurityDefaultsEnforcement`, `permissionGrant`, `roleManagement`, `tokenIssuance`, `tokenLifetime`. If omitted, all policies are returned.
20
20
  ```
21
21
 
22
22
  <Global />
@@ -0,0 +1,111 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
4
+
5
+ # graph openextension get
6
+
7
+ Retrieves a specific open extension for a resource
8
+
9
+ ## Usage
10
+
11
+ ```sh
12
+ m365 graph openextension get [options]
13
+ ```
14
+
15
+ ## Options
16
+
17
+ ```md definition-list
18
+ `-n, --name <name>`
19
+ : The name of the open extension to retrieve.
20
+
21
+ `-i, --resourceId <resourceId>`
22
+ : The Id of the resource for which to retrieve the open extension.
23
+
24
+ `-t, --resourceType <resourceType>`
25
+ : The type of resource. Allowed values are `user`, `group`, `device`, `organization`.
26
+ ```
27
+
28
+ <Global />
29
+
30
+ ## Examples
31
+
32
+ Retrieve a specified open extension for a user specified by id.
33
+
34
+ ```sh
35
+ m365 graph openextension get --resourceId eb77fbcf-6fe8-458b-985d-1747284793bc --name 'com.contoso.roamingSettings' --resourceType user
36
+ ```
37
+
38
+ Retrieve a specified open extension for a user specified by UPN.
39
+
40
+ ```sh
41
+ m365 graph openextension get --resourceId john.doe@contoso.com --name 'com.contoso.roamingSettings' --resourceType user
42
+ ```
43
+
44
+ ## Response
45
+
46
+ <Tabs>
47
+ <TabItem value="JSON">
48
+
49
+ ```json
50
+ {
51
+ "extensionName": "com.contoso.roamingSettings",
52
+ "name": "com.contoso.roamingSettings",
53
+ "resourceId": "john.doe@contoso.com",
54
+ "resourceType": "user",
55
+ "theme": "dark",
56
+ "color": "red",
57
+ "language": "English",
58
+ "id": "com.contoso.roamingSettings"
59
+ }
60
+ ```
61
+
62
+ </TabItem>
63
+ <TabItem value="Text">
64
+
65
+ ```text
66
+ color : red
67
+ extensionName: com.contoso.roamingSettings
68
+ id : com.contoso.roamingSettings
69
+ language : English
70
+ name : com.contoso.roamingSettings
71
+ resourceId : john.doe@contoso.com
72
+ resourceType : user
73
+ theme : dark
74
+ ```
75
+
76
+ </TabItem>
77
+ <TabItem value="CSV">
78
+
79
+ ```csv
80
+ extensionName,name,resourceId,resourceType,theme,color,language,id
81
+ com.contoso.roamingSettings,com.contoso.roamingSettings,john.doe@contoso.com,user,dark,red,English,com.contoso.roamingSettings
82
+ ```
83
+
84
+ </TabItem>
85
+ <TabItem value="Markdown">
86
+
87
+ ```md
88
+ # graph openextension get --debug "false" --verbose "false" --resourceId "john.doe@contoso.com" --resourceType "user" --name "com.contoso.roamingSettings"
89
+
90
+ Date: 2025-04-07
91
+
92
+ ## com.contoso.roamingSettings (com.contoso.roamingSettings)
93
+
94
+ Property | Value
95
+ ---------|-------
96
+ extensionName | com.contoso.roamingSettings
97
+ name | com.contoso.roamingSettings
98
+ resourceId | john.doe@contoso.com
99
+ resourceType | user
100
+ theme | dark
101
+ color | red
102
+ language | English
103
+ id | com.contoso.roamingSettings
104
+ ```
105
+
106
+ </TabItem>
107
+ </Tabs>
108
+
109
+ ## More information
110
+
111
+ - Open extensions: https://learn.microsoft.com/graph/extensibility-overview?tabs=http#open-extensions