@pnp/cli-microsoft365 11.0.0-beta.3d99ea3 → 11.0.0-beta.4abfd23
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/.devproxy/api-specs/sharepoint.yaml +54 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Command.js +4 -0
- package/dist/m365/adaptivecard/commands/adaptivecard-send.js +1 -1
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +13 -27
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +18 -43
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +10 -21
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +25 -49
- package/dist/m365/entra/commands/group/group-member-add.js +6 -27
- package/dist/m365/entra/commands/group/group-member-set.js +5 -26
- package/dist/m365/entra/commands/m365group/m365group-get.js +1 -7
- package/dist/m365/entra/commands/m365group/m365group-list.js +1 -7
- package/dist/m365/entra/commands/pim/pim-role-assignment-eligibility-list.js +1 -7
- package/dist/m365/entra/commands/pim/pim-role-assignment-list.js +1 -7
- package/dist/m365/entra/commands/pim/pim-role-request-list.js +1 -7
- package/dist/m365/entra/commands/roleassignment/roleassignment-add.js +146 -0
- package/dist/m365/entra/commands.js +1 -0
- package/dist/m365/flow/commands/environment/environment-get.js +19 -29
- package/dist/m365/flow/commands/flow-list.js +7 -14
- package/dist/m365/flow/commands/run/run-get.js +1 -7
- package/dist/m365/graph/commands/openextension/openextension-add.js +2 -2
- package/dist/m365/graph/commands/openextension/openextension-set.js +2 -6
- package/dist/m365/graph/commands/subscription/subscription-add.js +3 -10
- package/dist/m365/pa/commands/environment/environment-get.js +18 -23
- package/dist/m365/pp/commands/copilot/copilot-get.js +0 -4
- package/dist/m365/pp/commands/copilot/copilot-list.js +0 -4
- package/dist/m365/pp/commands/copilot/copilot-remove.js +0 -4
- package/dist/m365/pp/commands/environment/environment-get.js +19 -26
- package/dist/m365/pp/commands/solution/solution-publisher-list.js +1 -8
- package/dist/m365/pp/commands.js +0 -3
- package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +1 -7
- package/dist/m365/spfx/commands/project/project-upgrade.js +23 -66
- package/dist/m365/spo/commands/file/file-move.js +2 -8
- package/dist/m365/spo/commands/file/file-version-keep.js +78 -0
- package/dist/m365/spo/commands/homesite/homesite-get.js +28 -14
- package/dist/m365/spo/commands/homesite/homesite-list.js +1 -12
- package/dist/m365/spo/commands/homesite/homesite-remove.js +6 -34
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +4 -13
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +1 -8
- package/dist/m365/spo/commands/list/list-view-add.js +1 -1
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +17 -25
- package/dist/m365/spo/commands/{tenant/tenant-site-archive.js → site/site-archive.js} +14 -14
- package/dist/m365/spo/commands/{tenant/tenant-site-list.js → site/site-list.js} +16 -27
- package/dist/m365/spo/commands/{tenant/tenant-site-membership-list.js → site/site-membership-list.js} +15 -15
- package/dist/m365/spo/commands/{tenant/tenant-site-rename.js → site/site-rename.js} +14 -14
- package/dist/m365/spo/commands/{tenant/tenant-site-unarchive.js → site/site-unarchive.js} +14 -14
- package/dist/m365/spo/commands/term/term-list.js +1 -7
- package/dist/m365/spo/commands.js +5 -6
- package/dist/m365/teams/commands/chat/chat-member-add.js +3 -9
- package/dist/m365/viva/commands/engage/engage-network-list.js +1 -7
- package/dist/utils/entraAdministrativeUnit.js +1 -1
- package/docs/docs/cmd/entra/group/group-member-add.mdx +7 -26
- package/docs/docs/cmd/entra/group/group-member-set.mdx +5 -23
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +0 -3
- package/docs/docs/cmd/entra/m365group/m365group-list.mdx +0 -3
- package/docs/docs/cmd/entra/pim/pim-role-assignment-eligibility-list.mdx +0 -3
- package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +0 -3
- package/docs/docs/cmd/entra/pim/pim-role-request-list.mdx +0 -3
- package/docs/docs/cmd/entra/roleassignment/roleassignment-add.mdx +163 -0
- package/docs/docs/cmd/flow/environment/environment-get.mdx +6 -5
- package/docs/docs/cmd/flow/flow-list.mdx +0 -3
- package/docs/docs/cmd/flow/run/run-get.mdx +0 -3
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +0 -3
- package/docs/docs/cmd/pa/environment/environment-get.mdx +5 -2
- package/docs/docs/cmd/pp/copilot/copilot-get.mdx +0 -6
- package/docs/docs/cmd/pp/copilot/copilot-list.mdx +0 -6
- package/docs/docs/cmd/pp/copilot/copilot-remove.mdx +0 -6
- package/docs/docs/cmd/pp/environment/environment-get.mdx +5 -2
- package/docs/docs/cmd/pp/solution/solution-publisher-list.mdx +0 -3
- package/docs/docs/cmd/purview/threatassessment/threatassessment-get.mdx +0 -3
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +18 -5
- package/docs/docs/cmd/spo/file/file-move.mdx +0 -3
- package/docs/docs/cmd/spo/file/file-version-keep.mdx +68 -0
- package/docs/docs/cmd/spo/homesite/homesite-get.mdx +44 -23
- package/docs/docs/cmd/spo/homesite/homesite-list.mdx +0 -6
- package/docs/docs/cmd/spo/homesite/homesite-remove.mdx +10 -35
- package/docs/docs/cmd/spo/homesite/homesite-set.mdx +1 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-get.mdx +0 -3
- package/docs/docs/cmd/spo/hubsite/hubsite-list.mdx +0 -3
- package/docs/docs/cmd/spo/list/list-view-add.mdx +11 -11
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-list.mdx +18 -18
- package/docs/docs/cmd/spo/{tenant/tenant-site-archive.mdx → site/site-archive.mdx} +4 -4
- package/docs/docs/cmd/spo/{tenant/tenant-site-list.mdx → site/site-list.mdx} +7 -16
- package/docs/docs/cmd/spo/{tenant/tenant-site-membership-list.mdx → site/site-membership-list.mdx} +5 -5
- package/docs/docs/cmd/spo/{tenant/tenant-site-rename.mdx → site/site-rename.mdx} +7 -7
- package/docs/docs/cmd/spo/{tenant/tenant-site-unarchive.mdx → site/site-unarchive.mdx} +4 -4
- package/docs/docs/cmd/spo/term/term-list.mdx +0 -3
- package/docs/docs/cmd/teams/chat/chat-member-add.mdx +2 -5
- package/docs/docs/cmd/viva/engage/engage-network-list.mdx +0 -3
- package/package.json +1 -1
- package/dist/m365/spo/commands/tenant/SPOTenantSitePropertiesEnumerable.js +0 -2
- package/dist/m365/spo/commands/tenant/TenantSiteProperties.js +0 -2
|
@@ -30,9 +30,6 @@ class EntraPimRoleRequestListCommand extends GraphCommand {
|
|
|
30
30
|
__classPrivateFieldGet(this, _EntraPimRoleRequestListCommand_instances, "m", _EntraPimRoleRequestListCommand_initOptionSets).call(this);
|
|
31
31
|
}
|
|
32
32
|
async commandAction(logger, args) {
|
|
33
|
-
if (args.options.includePrincipalDetails) {
|
|
34
|
-
await this.warn(logger, `Parameter 'includePrincipalDetails' is deprecated. Please use 'withPrincipalDetails' instead`);
|
|
35
|
-
}
|
|
36
33
|
if (this.verbose) {
|
|
37
34
|
await logger.logToStderr(`Retrieving list of PIM roles requests for ${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName || 'all users'}...`);
|
|
38
35
|
}
|
|
@@ -54,7 +51,7 @@ class EntraPimRoleRequestListCommand extends GraphCommand {
|
|
|
54
51
|
queryParameters.push(`$filter=${filters.join(' and ')}`);
|
|
55
52
|
}
|
|
56
53
|
expands.push('roleDefinition($select=displayName)');
|
|
57
|
-
if (args.options.
|
|
54
|
+
if (args.options.withPrincipalDetails) {
|
|
58
55
|
expands.push('principal');
|
|
59
56
|
}
|
|
60
57
|
queryParameters.push(`$expand=${expands.join(',')}`);
|
|
@@ -103,7 +100,6 @@ _EntraPimRoleRequestListCommand_instances = new WeakSet(), _EntraPimRoleRequestL
|
|
|
103
100
|
groupName: typeof args.options.groupName !== 'undefined',
|
|
104
101
|
createdDateTime: typeof args.options.createdDateTime !== 'undefined',
|
|
105
102
|
status: typeof args.options.status !== 'undefined',
|
|
106
|
-
includePrincipalDetails: !!args.options.includePrincipalDetails,
|
|
107
103
|
withPrincipalDetails: !!args.options.withPrincipalDetails
|
|
108
104
|
});
|
|
109
105
|
});
|
|
@@ -121,8 +117,6 @@ _EntraPimRoleRequestListCommand_instances = new WeakSet(), _EntraPimRoleRequestL
|
|
|
121
117
|
}, {
|
|
122
118
|
option: '-s, --status [status]',
|
|
123
119
|
autocomplete: this.allowedStatuses
|
|
124
|
-
}, {
|
|
125
|
-
option: '--includePrincipalDetails'
|
|
126
120
|
}, {
|
|
127
121
|
option: '--withPrincipalDetails'
|
|
128
122
|
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
4
|
+
import commands from '../../commands.js';
|
|
5
|
+
import request from '../../../../request.js';
|
|
6
|
+
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import { entraAdministrativeUnit } from '../../../../utils/entraAdministrativeUnit.js';
|
|
8
|
+
import { entraApp } from '../../../../utils/entraApp.js';
|
|
9
|
+
import { entraServicePrincipal } from '../../../../utils/entraServicePrincipal.js';
|
|
10
|
+
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
11
|
+
import { roleDefinition } from '../../../../utils/roleDefinition.js';
|
|
12
|
+
import { entraUser } from '../../../../utils/entraUser.js';
|
|
13
|
+
const options = globalOptionsZod
|
|
14
|
+
.extend({
|
|
15
|
+
roleDefinitionId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
16
|
+
message: `'${id}' is not a valid GUID.`
|
|
17
|
+
})).optional(),
|
|
18
|
+
roleDefinitionName: z.string().optional(),
|
|
19
|
+
principal: z.string().refine(principal => validation.isValidGuid(principal) || validation.isValidUserPrincipalName(principal) || validation.isValidMailNickname(principal), principal => ({
|
|
20
|
+
message: `'${principal}' is not a valid GUID, UPN or group mail nickname.`
|
|
21
|
+
})),
|
|
22
|
+
userId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
23
|
+
message: `'${id}' is not a valid GUID.`
|
|
24
|
+
})).optional(),
|
|
25
|
+
userName: z.string().refine(upn => validation.isValidUserPrincipalName(upn), upn => ({
|
|
26
|
+
message: `'${upn}' is not a valid UPN.`
|
|
27
|
+
})).optional(),
|
|
28
|
+
administrativeUnitId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
29
|
+
message: `'${id}' is not a valid GUID.`
|
|
30
|
+
})).optional(),
|
|
31
|
+
administrativeUnitName: z.string().optional(),
|
|
32
|
+
applicationId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
33
|
+
message: `'${id}' is not a valid GUID.`
|
|
34
|
+
})).optional(),
|
|
35
|
+
applicationObjectId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
36
|
+
message: `'${id}' is not a valid GUID.`
|
|
37
|
+
})).optional(),
|
|
38
|
+
applicationName: z.string().optional(),
|
|
39
|
+
servicePrincipalId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
40
|
+
message: `'${id}' is not a valid GUID.`
|
|
41
|
+
})).optional(),
|
|
42
|
+
servicePrincipalName: z.string().optional(),
|
|
43
|
+
groupId: z.string().refine(id => validation.isValidGuid(id), id => ({
|
|
44
|
+
message: `'${id}' is not a valid GUID.`
|
|
45
|
+
})).optional(),
|
|
46
|
+
groupName: z.string().optional()
|
|
47
|
+
})
|
|
48
|
+
.strict();
|
|
49
|
+
class EntraRoleAssignmentAddCommand extends GraphCommand {
|
|
50
|
+
get name() {
|
|
51
|
+
return commands.ROLEASSIGNMENT_ADD;
|
|
52
|
+
}
|
|
53
|
+
get description() {
|
|
54
|
+
return 'Assign a Entra ID role to a user and specify the scope for which the user has been granted access';
|
|
55
|
+
}
|
|
56
|
+
get schema() {
|
|
57
|
+
return options;
|
|
58
|
+
}
|
|
59
|
+
getRefinedSchema(schema) {
|
|
60
|
+
return schema
|
|
61
|
+
.refine(options => [options.roleDefinitionId, options.roleDefinitionName].filter(o => o !== undefined).length === 1, {
|
|
62
|
+
message: 'Specify either roleDefinitionId or roleDefinitionName'
|
|
63
|
+
})
|
|
64
|
+
.refine(options => Object.values([options.userId, options.userName, options.administrativeUnitId, options.administrativeUnitName, options.applicationId, options.applicationObjectId, options.applicationName,
|
|
65
|
+
options.servicePrincipalId, options.servicePrincipalName, options.groupId, options.groupName]).filter(v => typeof v !== 'undefined').length < 2, {
|
|
66
|
+
message: 'Provide value for only one of the following parameters: userId, userName, administrativeUnitId, administrativeUnitName, applicationId, applicationObjectId, applicationName, servicePrincipalId, servicePrincipalName, groupId or groupName'
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async commandAction(logger, args) {
|
|
70
|
+
try {
|
|
71
|
+
const roleDefinitionId = await this.getRoleDefinitionId(args.options, logger);
|
|
72
|
+
const data = {
|
|
73
|
+
roleDefinitionId: roleDefinitionId,
|
|
74
|
+
principalId: await this.getPrincipalId(args.options, logger),
|
|
75
|
+
directoryScopeId: await this.getDirectoryScopeId(args.options)
|
|
76
|
+
};
|
|
77
|
+
const requestOptions = {
|
|
78
|
+
url: `${this.resource}/v1.0/roleManagement/directory/roleAssignments`,
|
|
79
|
+
headers: {
|
|
80
|
+
accept: 'application/json;odata.metadata=none'
|
|
81
|
+
},
|
|
82
|
+
responseType: 'json',
|
|
83
|
+
data: data
|
|
84
|
+
};
|
|
85
|
+
const response = await request.post(requestOptions);
|
|
86
|
+
await logger.log(response);
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
this.handleRejectedODataJsonPromise(err);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async getRoleDefinitionId(options, logger) {
|
|
93
|
+
if (options.roleDefinitionId) {
|
|
94
|
+
return options.roleDefinitionId;
|
|
95
|
+
}
|
|
96
|
+
if (this.verbose) {
|
|
97
|
+
await logger.logToStderr(`Retrieving role definition by its name '${options.roleDefinitionName}'`);
|
|
98
|
+
}
|
|
99
|
+
const role = await roleDefinition.getRoleDefinitionByDisplayName(options.roleDefinitionName);
|
|
100
|
+
return role.id;
|
|
101
|
+
}
|
|
102
|
+
async getPrincipalId(options, logger) {
|
|
103
|
+
if (validation.isValidGuid(options.principal)) {
|
|
104
|
+
return options.principal;
|
|
105
|
+
}
|
|
106
|
+
if (validation.isValidUserPrincipalName(options.principal)) {
|
|
107
|
+
if (this.verbose) {
|
|
108
|
+
await logger.logToStderr(`Retrieving user id by UPN '${options.principal}'`);
|
|
109
|
+
}
|
|
110
|
+
return await entraUser.getUserIdByUpn(options.principal);
|
|
111
|
+
}
|
|
112
|
+
if (this.verbose) {
|
|
113
|
+
await logger.logToStderr(`Retrieving group id by mail nickname '${options.principal}'`);
|
|
114
|
+
}
|
|
115
|
+
return await entraGroup.getGroupIdByMailNickname(options.principal);
|
|
116
|
+
}
|
|
117
|
+
async getDirectoryScopeId(options) {
|
|
118
|
+
let prefix = '/';
|
|
119
|
+
let resourceId = '';
|
|
120
|
+
if (options.userId || options.userName) {
|
|
121
|
+
resourceId = options.userId || await entraUser.getUserIdByUpn(options.userName);
|
|
122
|
+
}
|
|
123
|
+
else if (options.administrativeUnitId || options.administrativeUnitName) {
|
|
124
|
+
prefix = '/administrativeUnits/';
|
|
125
|
+
resourceId = options.administrativeUnitId || (await entraAdministrativeUnit.getAdministrativeUnitByDisplayName(options.administrativeUnitName, "id")).id;
|
|
126
|
+
}
|
|
127
|
+
else if (options.applicationId || options.applicationObjectId || options.applicationName) {
|
|
128
|
+
resourceId = options.applicationObjectId;
|
|
129
|
+
if (options.applicationId) {
|
|
130
|
+
resourceId = (await entraApp.getAppRegistrationByAppId(options.applicationId, ["id"])).id;
|
|
131
|
+
}
|
|
132
|
+
else if (options.applicationName) {
|
|
133
|
+
resourceId = (await entraApp.getAppRegistrationByAppName(options.applicationName, ["id"])).id;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else if (options.servicePrincipalId || options.servicePrincipalName) {
|
|
137
|
+
resourceId = options.servicePrincipalId || (await entraServicePrincipal.getServicePrincipalByAppName(options.servicePrincipalName, "id")).id;
|
|
138
|
+
}
|
|
139
|
+
else if (options.groupId || options.groupName) {
|
|
140
|
+
resourceId = options.groupId || (await entraGroup.getGroupIdByDisplayName(options.groupName));
|
|
141
|
+
}
|
|
142
|
+
return `${prefix}${resourceId}`;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export default new EntraRoleAssignmentAddCommand();
|
|
146
|
+
//# sourceMappingURL=roleassignment-add.js.map
|
|
@@ -92,6 +92,7 @@ export default {
|
|
|
92
92
|
PIM_ROLE_REQUEST_LIST: `${prefix} pim role request list`,
|
|
93
93
|
POLICY_LIST: `${prefix} policy list`,
|
|
94
94
|
RESOURCENAMESPACE_LIST: `${prefix} resourcenamespace list`,
|
|
95
|
+
ROLEASSIGNMENT_ADD: `${prefix} roleassignment add`,
|
|
95
96
|
ROLEDEFINITION_ADD: `${prefix} roledefinition add`,
|
|
96
97
|
ROLEDEFINITION_LIST: `${prefix} roledefinition list`,
|
|
97
98
|
ROLEDEFINITION_GET: `${prefix} roledefinition get`,
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _FlowEnvironmentGetCommand_instances, _FlowEnvironmentGetCommand_initOptions, _FlowEnvironmentGetCommand_initTelemetry;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import PowerAutomateCommand from '../../../base/PowerAutomateCommand.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
name: zod.alias('n', z.string().optional()),
|
|
11
|
+
default: z.boolean().optional()
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
11
14
|
class FlowEnvironmentGetCommand extends PowerAutomateCommand {
|
|
12
15
|
get name() {
|
|
13
16
|
return commands.ENVIRONMENT_GET;
|
|
@@ -15,23 +18,21 @@ class FlowEnvironmentGetCommand extends PowerAutomateCommand {
|
|
|
15
18
|
get description() {
|
|
16
19
|
return 'Gets information about the specified Microsoft Flow environment';
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
24
|
+
getRefinedSchema(schema) {
|
|
25
|
+
return schema
|
|
26
|
+
.refine(options => !!options.name !== !!options.default, {
|
|
27
|
+
message: `Specify either name or default, but not both.`
|
|
28
|
+
});
|
|
23
29
|
}
|
|
24
30
|
async commandAction(logger, args) {
|
|
25
31
|
if (this.verbose) {
|
|
26
|
-
await logger.logToStderr(`Retrieving information about Microsoft Flow environment ${args.options.name ?? ''}...`);
|
|
32
|
+
await logger.logToStderr(`Retrieving information about Microsoft Flow environment ${args.options.name ?? 'default'}...`);
|
|
27
33
|
}
|
|
28
34
|
let requestUrl = `${PowerAutomateCommand.resource}/providers/Microsoft.ProcessSimple/environments/`;
|
|
29
|
-
|
|
30
|
-
requestUrl += `${formatting.encodeQueryParameter(args.options.name)}`;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
requestUrl += `~default`;
|
|
34
|
-
}
|
|
35
|
+
requestUrl += args.options.default ? '~default' : formatting.encodeQueryParameter(args.options.name);
|
|
35
36
|
const requestOptions = {
|
|
36
37
|
url: `${requestUrl}?api-version=2016-11-01`,
|
|
37
38
|
headers: {
|
|
@@ -55,16 +56,5 @@ class FlowEnvironmentGetCommand extends PowerAutomateCommand {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
_FlowEnvironmentGetCommand_instances = new WeakSet(), _FlowEnvironmentGetCommand_initOptions = function _FlowEnvironmentGetCommand_initOptions() {
|
|
59
|
-
this.options.unshift({
|
|
60
|
-
option: '-n, --name [name]'
|
|
61
|
-
});
|
|
62
|
-
}, _FlowEnvironmentGetCommand_initTelemetry = function _FlowEnvironmentGetCommand_initTelemetry() {
|
|
63
|
-
this.telemetry.push((args) => {
|
|
64
|
-
Object.assign(this.telemetryProperties, {
|
|
65
|
-
name: typeof args.options.name !== 'undefined'
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
59
|
export default new FlowEnvironmentGetCommand();
|
|
70
60
|
//# sourceMappingURL=environment-get.js.map
|
|
@@ -28,33 +28,29 @@ class FlowListCommand extends PowerAutomateCommand {
|
|
|
28
28
|
__classPrivateFieldGet(this, _FlowListCommand_instances, "m", _FlowListCommand_initTypes).call(this);
|
|
29
29
|
}
|
|
30
30
|
async commandAction(logger, args) {
|
|
31
|
-
if (args.options.includeSolutions) {
|
|
32
|
-
await this.warn(logger, `Parameter 'includeSolutions' is deprecated. Please use 'withSolutions' instead`);
|
|
33
|
-
}
|
|
34
31
|
if (this.verbose) {
|
|
35
32
|
await logger.logToStderr(`Getting Power Automate flows${args.options.asAdmin ? ' as admin' : ''} in environment '${args.options.environmentName}'...`);
|
|
36
33
|
}
|
|
37
34
|
try {
|
|
38
|
-
const { environmentName, asAdmin, sharingStatus,
|
|
35
|
+
const { environmentName, asAdmin, sharingStatus, withSolutions } = args.options;
|
|
39
36
|
let items = [];
|
|
40
|
-
const shouldIncludeSolutions = withSolutions || includeSolutions;
|
|
41
37
|
if (sharingStatus === 'personal') {
|
|
42
|
-
const url = this.getApiUrl(environmentName, asAdmin,
|
|
38
|
+
const url = this.getApiUrl(environmentName, asAdmin, withSolutions, 'personal');
|
|
43
39
|
items = await odata.getAllItems(url);
|
|
44
40
|
}
|
|
45
41
|
else if (sharingStatus === 'sharedWithMe') {
|
|
46
|
-
const url = this.getApiUrl(environmentName, asAdmin,
|
|
42
|
+
const url = this.getApiUrl(environmentName, asAdmin, withSolutions, 'team');
|
|
47
43
|
items = await odata.getAllItems(url);
|
|
48
44
|
}
|
|
49
45
|
else if (sharingStatus === 'all') {
|
|
50
|
-
let url = this.getApiUrl(environmentName, asAdmin,
|
|
46
|
+
let url = this.getApiUrl(environmentName, asAdmin, withSolutions, 'personal');
|
|
51
47
|
items = await odata.getAllItems(url);
|
|
52
|
-
url = this.getApiUrl(environmentName, asAdmin,
|
|
48
|
+
url = this.getApiUrl(environmentName, asAdmin, withSolutions, 'team');
|
|
53
49
|
const teamFlows = await odata.getAllItems(url);
|
|
54
50
|
items = items.concat(teamFlows);
|
|
55
51
|
}
|
|
56
52
|
else {
|
|
57
|
-
const url = this.getApiUrl(environmentName, asAdmin,
|
|
53
|
+
const url = this.getApiUrl(environmentName, asAdmin, withSolutions);
|
|
58
54
|
items = await odata.getAllItems(url);
|
|
59
55
|
}
|
|
60
56
|
// Remove duplicates
|
|
@@ -84,7 +80,6 @@ _FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = fun
|
|
|
84
80
|
this.telemetry.push((args) => {
|
|
85
81
|
Object.assign(this.telemetryProperties, {
|
|
86
82
|
sharingStatus: typeof args.options.sharingStatus !== 'undefined',
|
|
87
|
-
includeSolutions: !!args.options.includeSolutions,
|
|
88
83
|
withSolutions: !!args.options.withSolutions,
|
|
89
84
|
asAdmin: !!args.options.asAdmin
|
|
90
85
|
});
|
|
@@ -95,8 +90,6 @@ _FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = fun
|
|
|
95
90
|
}, {
|
|
96
91
|
option: '--sharingStatus [sharingStatus]',
|
|
97
92
|
autocomplete: this.allowedSharingStatuses
|
|
98
|
-
}, {
|
|
99
|
-
option: '--includeSolutions'
|
|
100
93
|
}, {
|
|
101
94
|
option: '--withSolutions'
|
|
102
95
|
}, {
|
|
@@ -114,7 +107,7 @@ _FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = fun
|
|
|
114
107
|
});
|
|
115
108
|
}, _FlowListCommand_initTypes = function _FlowListCommand_initTypes() {
|
|
116
109
|
this.types.string.push('environmentName', 'sharingStatus');
|
|
117
|
-
this.types.boolean.push('
|
|
110
|
+
this.types.boolean.push('withSolutions', 'asAdmin');
|
|
118
111
|
};
|
|
119
112
|
export default new FlowListCommand();
|
|
120
113
|
//# sourceMappingURL=flow-list.js.map
|
|
@@ -27,9 +27,6 @@ class FlowRunGetCommand extends PowerAutomateCommand {
|
|
|
27
27
|
if (this.verbose) {
|
|
28
28
|
await logger.logToStderr(`Retrieving information about run ${args.options.name} of Microsoft Flow ${args.options.flowName}...`);
|
|
29
29
|
}
|
|
30
|
-
if (args.options.includeTriggerInformation) {
|
|
31
|
-
await this.warn(logger, `Parameter 'includeTriggerInformation' is deprecated. Please use 'withTrigger' instead`);
|
|
32
|
-
}
|
|
33
30
|
const actionsParameter = args.options.withActions ? '$expand=properties%2Factions&' : '';
|
|
34
31
|
const requestOptions = {
|
|
35
32
|
url: `${PowerAutomateCommand.resource}/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.flowName)}/runs/${formatting.encodeQueryParameter(args.options.name)}?${actionsParameter}api-version=2016-11-01`,
|
|
@@ -44,7 +41,7 @@ class FlowRunGetCommand extends PowerAutomateCommand {
|
|
|
44
41
|
res.endTime = res.properties.endTime || '';
|
|
45
42
|
res.status = res.properties.status;
|
|
46
43
|
res.triggerName = res.properties.trigger.name;
|
|
47
|
-
if (
|
|
44
|
+
if (args.options.withTrigger && res.properties.trigger.outputsLink) {
|
|
48
45
|
res.triggerInformation = await this.getTriggerInformation(res);
|
|
49
46
|
}
|
|
50
47
|
if (!!args.options.withActions) {
|
|
@@ -96,8 +93,6 @@ _FlowRunGetCommand_instances = new WeakSet(), _FlowRunGetCommand_initOptions = f
|
|
|
96
93
|
option: '--flowName <flowName>'
|
|
97
94
|
}, {
|
|
98
95
|
option: '-e, --environmentName <environmentName>'
|
|
99
|
-
}, {
|
|
100
|
-
option: '--includeTriggerInformation'
|
|
101
96
|
}, {
|
|
102
97
|
option: '--withTrigger'
|
|
103
98
|
}, {
|
|
@@ -116,7 +111,6 @@ _FlowRunGetCommand_instances = new WeakSet(), _FlowRunGetCommand_initOptions = f
|
|
|
116
111
|
}, _FlowRunGetCommand_initTelemetry = function _FlowRunGetCommand_initTelemetry() {
|
|
117
112
|
this.telemetry.push((args) => {
|
|
118
113
|
Object.assign(this.telemetryProperties, {
|
|
119
|
-
includeTriggerInformation: !!args.options.includeTriggerInformation,
|
|
120
114
|
withTrigger: !!args.options.withTrigger,
|
|
121
115
|
withActions: typeof args.options.withActions !== 'undefined'
|
|
122
116
|
});
|
|
@@ -12,7 +12,7 @@ const options = globalOptionsZod
|
|
|
12
12
|
resourceId: zod.alias('i', z.string()),
|
|
13
13
|
resourceType: zod.alias('t', z.enum(['user', 'group', 'device', 'organization']))
|
|
14
14
|
})
|
|
15
|
-
.
|
|
15
|
+
.passthrough();
|
|
16
16
|
class GraphOpenExtensionAddCommand extends GraphCommand {
|
|
17
17
|
get name() {
|
|
18
18
|
return commands.OPENEXTENSION_ADD;
|
|
@@ -38,7 +38,7 @@ class GraphOpenExtensionAddCommand extends GraphCommand {
|
|
|
38
38
|
try {
|
|
39
39
|
const requestBody = {};
|
|
40
40
|
requestBody["extensionName"] = args.options.name;
|
|
41
|
-
const unknownOptions = optionsUtils.getUnknownOptions(args.options, this.
|
|
41
|
+
const unknownOptions = optionsUtils.getUnknownOptions(args.options, zod.schemaToOptions(this.schema));
|
|
42
42
|
const unknownOptionsNames = Object.getOwnPropertyNames(unknownOptions);
|
|
43
43
|
unknownOptionsNames.forEach(async (o) => {
|
|
44
44
|
try {
|
|
@@ -13,11 +13,10 @@ const options = globalOptionsZod
|
|
|
13
13
|
resourceType: zod.alias('t', z.enum(['user', 'group', 'device', 'organization'])),
|
|
14
14
|
keepUnchangedProperties: zod.alias('k', z.boolean().optional())
|
|
15
15
|
})
|
|
16
|
-
.
|
|
16
|
+
.passthrough();
|
|
17
17
|
class GraphOpenExtensionSetCommand extends GraphCommand {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
|
-
this.commandOptions = ['keepUnchangedProperties', 'resourceType', 'resourceId', 'name'];
|
|
21
20
|
this.defaultOpenExtensionProperties = ['id', 'extensionName'];
|
|
22
21
|
}
|
|
23
22
|
get name() {
|
|
@@ -46,12 +45,9 @@ class GraphOpenExtensionSetCommand extends GraphCommand {
|
|
|
46
45
|
const currentExtensionNames = Object.getOwnPropertyNames(currentExtension);
|
|
47
46
|
const requestBody = {};
|
|
48
47
|
requestBody["@odata.type"] = '#microsoft.graph.openTypeExtension';
|
|
49
|
-
const unknownOptions = optionsUtils.getUnknownOptions(args.options, this.
|
|
48
|
+
const unknownOptions = optionsUtils.getUnknownOptions(args.options, zod.schemaToOptions(this.schema));
|
|
50
49
|
const unknownOptionsNames = Object.getOwnPropertyNames(unknownOptions);
|
|
51
50
|
unknownOptionsNames.forEach(async (option) => {
|
|
52
|
-
if (this.commandOptions.includes(option)) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
51
|
const value = unknownOptions[option];
|
|
56
52
|
if (value === "") {
|
|
57
53
|
requestBody[option] = null;
|
|
@@ -49,7 +49,7 @@ class GraphSubscriptionAddCommand extends GraphCommand {
|
|
|
49
49
|
notificationUrl: args.options.notificationUrl,
|
|
50
50
|
expirationDateTime: await this.getExpirationDateTimeOrDefault(logger, args),
|
|
51
51
|
clientState: args.options.clientState,
|
|
52
|
-
includeResourceData: args.options.withResourceData
|
|
52
|
+
includeResourceData: args.options.withResourceData,
|
|
53
53
|
encryptionCertificate: args.options.encryptionCertificate,
|
|
54
54
|
encryptionCertificateId: args.options.encryptionCertificateId,
|
|
55
55
|
lifecycleNotificationUrl: args.options.lifecycleNotificationUrl,
|
|
@@ -66,9 +66,6 @@ class GraphSubscriptionAddCommand extends GraphCommand {
|
|
|
66
66
|
responseType: 'json'
|
|
67
67
|
};
|
|
68
68
|
try {
|
|
69
|
-
if (args.options.includeResourceData) {
|
|
70
|
-
await this.warn(logger, `Parameter 'includeResourceData' is deprecated. Please use 'withResourceData' instead`);
|
|
71
|
-
}
|
|
72
69
|
const res = await request.post(requestOptions);
|
|
73
70
|
await logger.log(res);
|
|
74
71
|
}
|
|
@@ -135,7 +132,6 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
135
132
|
lifecycleNotificationUrl: typeof args.options.lifecycleNotificationUrl !== 'undefined',
|
|
136
133
|
notificationUrlAppId: typeof args.options.notificationUrlAppId !== 'undefined',
|
|
137
134
|
latestTLSVersion: typeof args.options.latestTLSVersion !== 'undefined',
|
|
138
|
-
includeResourceData: !!args.options.includeResourceData,
|
|
139
135
|
withResourceData: !!args.options.withResourceData,
|
|
140
136
|
encryptionCertificate: typeof args.options.encryptionCertificate !== 'undefined',
|
|
141
137
|
encryptionCertificateId: typeof args.options.encryptionCertificateId !== 'undefined'
|
|
@@ -160,8 +156,6 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
160
156
|
}, {
|
|
161
157
|
option: '--latestTLSVersion [latestTLSVersion]',
|
|
162
158
|
autocomplete: this.allowedTlsVersions
|
|
163
|
-
}, {
|
|
164
|
-
option: '--includeResourceData [includeResourceData]'
|
|
165
159
|
}, {
|
|
166
160
|
option: '--withResourceData [withResourceData]'
|
|
167
161
|
}, {
|
|
@@ -193,11 +187,10 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
193
187
|
if (args.options.latestTLSVersion && this.allowedTlsVersions.map(x => x.toLowerCase()).indexOf(args.options.latestTLSVersion.toLowerCase()) === -1) {
|
|
194
188
|
return `${args.options.latestTLSVersion} is not a valid TLS version. Allowed values are ${this.allowedTlsVersions.join(', ')}`;
|
|
195
189
|
}
|
|
196
|
-
|
|
197
|
-
if (shouldIncludeResourceData && !args.options.encryptionCertificate) {
|
|
190
|
+
if (args.options.withResourceData && !args.options.encryptionCertificate) {
|
|
198
191
|
return `The 'encryptionCertificate' options is required to include the changed resource data`;
|
|
199
192
|
}
|
|
200
|
-
if (
|
|
193
|
+
if (args.options.withResourceData && !args.options.encryptionCertificateId) {
|
|
201
194
|
return `The 'encryptionCertificateId' options is required to include the changed resource data`;
|
|
202
195
|
}
|
|
203
196
|
if (args.options.notificationUrlAppId && !validation.isValidGuid(args.options.notificationUrlAppId)) {
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _PaEnvironmentGetCommand_instances, _PaEnvironmentGetCommand_initTelemetry, _PaEnvironmentGetCommand_initOptions;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { formatting } from '../../../../utils/formatting.js';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import PowerAppsCommand from '../../../base/PowerAppsCommand.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
name: zod.alias('n', z.string().optional()),
|
|
11
|
+
default: z.boolean().optional()
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
11
14
|
class PaEnvironmentGetCommand extends PowerAppsCommand {
|
|
12
15
|
get name() {
|
|
13
16
|
return commands.ENVIRONMENT_GET;
|
|
@@ -15,17 +18,20 @@ class PaEnvironmentGetCommand extends PowerAppsCommand {
|
|
|
15
18
|
get description() {
|
|
16
19
|
return 'Gets information about the specified Microsoft Power Apps environment';
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
24
|
+
getRefinedSchema(schema) {
|
|
25
|
+
return schema
|
|
26
|
+
.refine(options => !!options.name !== !!options.default, {
|
|
27
|
+
message: `Specify either name or default, but not both.`
|
|
28
|
+
});
|
|
23
29
|
}
|
|
24
30
|
async commandAction(logger, args) {
|
|
25
31
|
if (this.verbose) {
|
|
26
32
|
await logger.logToStderr(`Retrieving information about Microsoft Power Apps environment ${args.options.name || 'default'}...`);
|
|
27
33
|
}
|
|
28
|
-
const environmentName = args.options.
|
|
34
|
+
const environmentName = args.options.default ? '~default' : formatting.encodeQueryParameter(args.options.name);
|
|
29
35
|
const requestOptions = {
|
|
30
36
|
url: `${this.resource}/providers/Microsoft.PowerApps/environments/${environmentName}?api-version=2016-11-01`,
|
|
31
37
|
headers: {
|
|
@@ -47,16 +53,5 @@ class PaEnvironmentGetCommand extends PowerAppsCommand {
|
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
|
-
_PaEnvironmentGetCommand_instances = new WeakSet(), _PaEnvironmentGetCommand_initTelemetry = function _PaEnvironmentGetCommand_initTelemetry() {
|
|
51
|
-
this.telemetry.push((args) => {
|
|
52
|
-
Object.assign(this.telemetryProperties, {
|
|
53
|
-
name: typeof args.options.name !== 'undefined'
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}, _PaEnvironmentGetCommand_initOptions = function _PaEnvironmentGetCommand_initOptions() {
|
|
57
|
-
this.options.unshift({
|
|
58
|
-
option: '-n, --name [name]'
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
56
|
export default new PaEnvironmentGetCommand();
|
|
62
57
|
//# sourceMappingURL=environment-get.js.map
|
|
@@ -18,9 +18,6 @@ class PpCopilotGetCommand extends PowerPlatformCommand {
|
|
|
18
18
|
get description() {
|
|
19
19
|
return 'Get information about the specified copilot';
|
|
20
20
|
}
|
|
21
|
-
alias() {
|
|
22
|
-
return [commands.CHATBOT_GET];
|
|
23
|
-
}
|
|
24
21
|
constructor() {
|
|
25
22
|
super();
|
|
26
23
|
_PpCopilotGetCommand_instances.add(this);
|
|
@@ -30,7 +27,6 @@ class PpCopilotGetCommand extends PowerPlatformCommand {
|
|
|
30
27
|
__classPrivateFieldGet(this, _PpCopilotGetCommand_instances, "m", _PpCopilotGetCommand_initOptionSets).call(this);
|
|
31
28
|
}
|
|
32
29
|
async commandAction(logger, args) {
|
|
33
|
-
await this.showDeprecationWarning(logger, commands.CHATBOT_GET, commands.COPILOT_GET);
|
|
34
30
|
if (this.verbose) {
|
|
35
31
|
await logger.logToStderr(`Retrieving copilot '${args.options.id || args.options.name}'...`);
|
|
36
32
|
}
|
|
@@ -15,9 +15,6 @@ class PpCopilotListCommand extends PowerPlatformCommand {
|
|
|
15
15
|
get description() {
|
|
16
16
|
return 'Lists Microsoft Power Platform copilots in the specified Power Platform environment';
|
|
17
17
|
}
|
|
18
|
-
alias() {
|
|
19
|
-
return [commands.CHATBOT_LIST];
|
|
20
|
-
}
|
|
21
18
|
defaultProperties() {
|
|
22
19
|
return ['name', 'botid', 'publishedOn', 'createdOn', 'botModifiedOn'];
|
|
23
20
|
}
|
|
@@ -28,7 +25,6 @@ class PpCopilotListCommand extends PowerPlatformCommand {
|
|
|
28
25
|
__classPrivateFieldGet(this, _PpCopilotListCommand_instances, "m", _PpCopilotListCommand_initOptions).call(this);
|
|
29
26
|
}
|
|
30
27
|
async commandAction(logger, args) {
|
|
31
|
-
await this.showDeprecationWarning(logger, commands.CHATBOT_LIST, commands.COPILOT_LIST);
|
|
32
28
|
if (this.verbose) {
|
|
33
29
|
await logger.logToStderr(`Retrieving list of copilots for environment '${args.options.environmentName}'.`);
|
|
34
30
|
}
|
|
@@ -18,9 +18,6 @@ class PpCopilotRemoveCommand extends PowerPlatformCommand {
|
|
|
18
18
|
get description() {
|
|
19
19
|
return 'Removes the specified copilot';
|
|
20
20
|
}
|
|
21
|
-
alias() {
|
|
22
|
-
return [commands.CHATBOT_REMOVE];
|
|
23
|
-
}
|
|
24
21
|
constructor() {
|
|
25
22
|
super();
|
|
26
23
|
_PpCopilotRemoveCommand_instances.add(this);
|
|
@@ -30,7 +27,6 @@ class PpCopilotRemoveCommand extends PowerPlatformCommand {
|
|
|
30
27
|
__classPrivateFieldGet(this, _PpCopilotRemoveCommand_instances, "m", _PpCopilotRemoveCommand_initOptionSets).call(this);
|
|
31
28
|
}
|
|
32
29
|
async commandAction(logger, args) {
|
|
33
|
-
await this.showDeprecationWarning(logger, commands.CHATBOT_REMOVE, commands.COPILOT_REMOVE);
|
|
34
30
|
if (this.verbose) {
|
|
35
31
|
await logger.logToStderr(`Removing copilot '${args.options.id || args.options.name}'...`);
|
|
36
32
|
}
|