@pnp/cli-microsoft365 11.0.0-beta.4be9237 → 11.0.0-beta.677f8d3
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/.eslintrc.cjs +2 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/entra/commands/app/app-add.js +14 -2
- 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/outlook/commands/mail/mail-searchfolder-add.js +85 -0
- package/dist/m365/outlook/commands.js +1 -0
- 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.js +0 -3
- package/dist/m365/spfx/commands/project/project-upgrade.js +23 -66
- 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/list/list-view-add.js +1 -1
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +17 -25
- package/dist/m365/spo/commands.js +1 -1
- package/dist/utils/entraAdministrativeUnit.js +1 -1
- package/dist/utils/entraApp.js +15 -0
- package/docs/docs/cmd/entra/app/app-add.mdx +7 -1
- 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/outlook/mail/mail-searchfolder-add.mdx +147 -0
- 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/spfx/project/project-upgrade.mdx +18 -5
- 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/list/list-view-add.mdx +11 -11
- package/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-grant-list.mdx +18 -18
- package/package.json +1 -1
|
@@ -425,7 +425,9 @@ _a = EntraAppAddCommand, _EntraAppAddCommand_instances = new WeakSet(), _EntraAp
|
|
|
425
425
|
certificateBase64Encoded: typeof args.options.certificateBase64Encoded !== 'undefined',
|
|
426
426
|
certificateDisplayName: typeof args.options.certificateDisplayName !== 'undefined',
|
|
427
427
|
grantAdminConsent: typeof args.options.grantAdminConsent !== 'undefined',
|
|
428
|
-
allowPublicClientFlows: typeof args.options.allowPublicClientFlows !== 'undefined'
|
|
428
|
+
allowPublicClientFlows: typeof args.options.allowPublicClientFlows !== 'undefined',
|
|
429
|
+
bundleId: typeof args.options.bundleId !== 'undefined',
|
|
430
|
+
signatureHash: typeof args.options.signatureHash !== 'undefined'
|
|
429
431
|
});
|
|
430
432
|
});
|
|
431
433
|
}, _EntraAppAddCommand_initOptions = function _EntraAppAddCommand_initOptions() {
|
|
@@ -465,6 +467,10 @@ _a = EntraAppAddCommand, _EntraAppAddCommand_instances = new WeakSet(), _EntraAp
|
|
|
465
467
|
option: '--certificateDisplayName [certificateDisplayName]'
|
|
466
468
|
}, {
|
|
467
469
|
option: '--manifest [manifest]'
|
|
470
|
+
}, {
|
|
471
|
+
option: '--bundleId [bundleId]'
|
|
472
|
+
}, {
|
|
473
|
+
option: '--signatureHash [signatureHash]'
|
|
468
474
|
}, {
|
|
469
475
|
option: '--save'
|
|
470
476
|
}, {
|
|
@@ -519,12 +525,18 @@ _a = EntraAppAddCommand, _EntraAppAddCommand_instances = new WeakSet(), _EntraAp
|
|
|
519
525
|
return `Error while parsing the specified manifest: ${e}`;
|
|
520
526
|
}
|
|
521
527
|
}
|
|
528
|
+
if (args.options.platform === 'apple' && !args.options.bundleId) {
|
|
529
|
+
return `When you use platform apple, you'll need to specify bundleId`;
|
|
530
|
+
}
|
|
531
|
+
if (args.options.platform === 'android' && (!args.options.bundleId || !args.options.signatureHash)) {
|
|
532
|
+
return `When you use platform android, you'll need to specify bundleId and signatureHash`;
|
|
533
|
+
}
|
|
522
534
|
return true;
|
|
523
535
|
});
|
|
524
536
|
}, _EntraAppAddCommand_initOptionSets = function _EntraAppAddCommand_initOptionSets() {
|
|
525
537
|
this.optionSets.push({ options: ['name', 'manifest'] });
|
|
526
538
|
};
|
|
527
|
-
EntraAppAddCommand.entraApplicationPlatform = ['spa', 'web', 'publicClient'];
|
|
539
|
+
EntraAppAddCommand.entraApplicationPlatform = ['spa', 'web', 'publicClient', 'apple', 'android'];
|
|
528
540
|
EntraAppAddCommand.entraAppScopeConsentBy = ['admins', 'adminsAndUsers'];
|
|
529
541
|
export default new EntraAppAddCommand();
|
|
530
542
|
//# sourceMappingURL=app-add.js.map
|
|
@@ -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
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import request from '../../../../request.js';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
+
import { zod } from '../../../../utils/zod.js';
|
|
7
|
+
import { validation } from '../../../../utils/validation.js';
|
|
8
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
9
|
+
import auth from '../../../../Auth.js';
|
|
10
|
+
const options = globalOptionsZod
|
|
11
|
+
.extend({
|
|
12
|
+
userId: zod.alias('i', z.string()
|
|
13
|
+
.refine(userId => validation.isValidGuid(userId), userId => ({
|
|
14
|
+
message: `'${userId}' is not a valid GUID.`
|
|
15
|
+
})).optional()),
|
|
16
|
+
userName: zod.alias('n', z.string()
|
|
17
|
+
.refine(userName => validation.isValidUserPrincipalName(userName), userName => ({
|
|
18
|
+
message: `'${userName}' is not a valid UPN.`
|
|
19
|
+
})).optional()),
|
|
20
|
+
folderName: z.string(),
|
|
21
|
+
messageFilter: z.string(),
|
|
22
|
+
sourceFoldersIds: z.string().transform((value) => value.split(',')).pipe(z.string().array()),
|
|
23
|
+
includeNestedFolders: z.boolean().optional()
|
|
24
|
+
})
|
|
25
|
+
.strict();
|
|
26
|
+
class OutlookMailSearchFolderAddCommand extends GraphCommand {
|
|
27
|
+
get name() {
|
|
28
|
+
return commands.MAIL_SEARCHFOLDER_ADD;
|
|
29
|
+
}
|
|
30
|
+
get description() {
|
|
31
|
+
return `Creates a new mail search folder in the user's mailbox`;
|
|
32
|
+
}
|
|
33
|
+
get schema() {
|
|
34
|
+
return options;
|
|
35
|
+
}
|
|
36
|
+
getRefinedSchema(schema) {
|
|
37
|
+
return schema
|
|
38
|
+
.refine(options => !(options.userId && options.userName), {
|
|
39
|
+
message: 'Specify either userId or userName, but not both'
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async commandAction(logger, args) {
|
|
43
|
+
try {
|
|
44
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
|
|
45
|
+
let requestUrl = `${this.resource}/v1.0/me/mailFolders/searchFolders/childFolders`;
|
|
46
|
+
if (isAppOnlyAccessToken) {
|
|
47
|
+
if (!args.options.userId && !args.options.userName) {
|
|
48
|
+
throw 'When running with application permissions either userId or userName is required';
|
|
49
|
+
}
|
|
50
|
+
const userIdentifier = args.options.userId ?? args.options.userName;
|
|
51
|
+
requestUrl = `${this.resource}/v1.0/users('${userIdentifier}')/mailFolders/searchFolders/childFolders`;
|
|
52
|
+
if (args.options.verbose) {
|
|
53
|
+
await logger.logToStderr(`Creating a mail search folder in the mailbox of the user ${userIdentifier}...`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
if (args.options.userId || args.options.userName) {
|
|
58
|
+
throw 'You can create mail search folder for other users only if CLI is authenticated in app-only mode';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const requestOptions = {
|
|
62
|
+
url: requestUrl,
|
|
63
|
+
headers: {
|
|
64
|
+
accept: 'application/json;odata.metadata=none',
|
|
65
|
+
'content-type': 'application/json'
|
|
66
|
+
},
|
|
67
|
+
responseType: 'json',
|
|
68
|
+
data: {
|
|
69
|
+
'@odata.type': '#microsoft.graph.mailSearchFolder',
|
|
70
|
+
displayName: args.options.folderName,
|
|
71
|
+
includeNestedFolders: args.options.includeNestedFolders,
|
|
72
|
+
filterQuery: args.options.messageFilter,
|
|
73
|
+
sourceFolderIds: args.options.sourceFoldersIds
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const result = await request.post(requestOptions);
|
|
77
|
+
await logger.log(result);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
this.handleRejectedODataJsonPromise(err);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export default new OutlookMailSearchFolderAddCommand();
|
|
85
|
+
//# sourceMappingURL=mail-searchfolder-add.js.map
|
|
@@ -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
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
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 _PpEnvironmentGetCommand_instances, _PpEnvironmentGetCommand_initTelemetry, _PpEnvironmentGetCommand_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 PowerPlatformCommand from '../../../base/PowerPlatformCommand.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
|
+
asAdmin: z.boolean().optional()
|
|
13
|
+
})
|
|
14
|
+
.strict();
|
|
11
15
|
class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
12
16
|
get name() {
|
|
13
17
|
return commands.ENVIRONMENT_GET;
|
|
@@ -15,11 +19,14 @@ class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
|
15
19
|
get description() {
|
|
16
20
|
return 'Gets information about the specified Power Platform environment';
|
|
17
21
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
24
|
+
}
|
|
25
|
+
getRefinedSchema(schema) {
|
|
26
|
+
return schema
|
|
27
|
+
.refine(options => !!options.name !== !!options.default, {
|
|
28
|
+
message: `Specify either name or default, but not both.`
|
|
29
|
+
});
|
|
23
30
|
}
|
|
24
31
|
async commandAction(logger, args) {
|
|
25
32
|
if (this.verbose) {
|
|
@@ -29,7 +36,7 @@ class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
|
29
36
|
if (args.options.asAdmin) {
|
|
30
37
|
url += '/scopes/admin';
|
|
31
38
|
}
|
|
32
|
-
const envName = args.options.
|
|
39
|
+
const envName = args.options.default ? '~Default' : formatting.encodeQueryParameter(args.options.name);
|
|
33
40
|
url += `/environments/${envName}?api-version=2020-10-01`;
|
|
34
41
|
const requestOptions = {
|
|
35
42
|
url: url,
|
|
@@ -42,19 +49,5 @@ class PpEnvironmentGetCommand extends PowerPlatformCommand {
|
|
|
42
49
|
await logger.log(response);
|
|
43
50
|
}
|
|
44
51
|
}
|
|
45
|
-
_PpEnvironmentGetCommand_instances = new WeakSet(), _PpEnvironmentGetCommand_initTelemetry = function _PpEnvironmentGetCommand_initTelemetry() {
|
|
46
|
-
this.telemetry.push((args) => {
|
|
47
|
-
Object.assign(this.telemetryProperties, {
|
|
48
|
-
name: typeof args.options.name !== 'undefined',
|
|
49
|
-
asAdmin: !!args.options.asAdmin
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}, _PpEnvironmentGetCommand_initOptions = function _PpEnvironmentGetCommand_initOptions() {
|
|
53
|
-
this.options.unshift({
|
|
54
|
-
option: '-n, --name [name]'
|
|
55
|
-
}, {
|
|
56
|
-
option: '--asAdmin'
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
52
|
export default new PpEnvironmentGetCommand();
|
|
60
53
|
//# sourceMappingURL=environment-get.js.map
|
package/dist/m365/pp/commands.js
CHANGED
|
@@ -3,9 +3,6 @@ export default {
|
|
|
3
3
|
AIBUILDERMODEL_GET: `${prefix} aibuildermodel get`,
|
|
4
4
|
AIBUILDERMODEL_LIST: `${prefix} aibuildermodel list`,
|
|
5
5
|
AIBUILDERMODEL_REMOVE: `${prefix} aibuildermodel remove`,
|
|
6
|
-
CHATBOT_GET: `${prefix} chatbot get`,
|
|
7
|
-
CHATBOT_LIST: `${prefix} chatbot list`,
|
|
8
|
-
CHATBOT_REMOVE: `${prefix} chatbot remove`,
|
|
9
6
|
COPILOT_GET: `${prefix} copilot get`,
|
|
10
7
|
COPILOT_LIST: `${prefix} copilot list`,
|
|
11
8
|
COPILOT_REMOVE: `${prefix} copilot remove`,
|