@pnp/cli-microsoft365 11.7.0-beta.71e4ac5 → 11.7.0-beta.b9f508d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/entra/commands/user/user-license-add.js +2 -1
- package/dist/m365/entra/commands/user/user-license-list.js +4 -9
- package/dist/m365/entra/commands/user/user-license-remove.js +2 -1
- package/dist/m365/outlook/commands/event/event-cancel.js +103 -0
- package/dist/m365/outlook/commands/event/event-remove.js +104 -0
- package/dist/m365/outlook/commands.js +2 -0
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +628 -0
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +2 -2
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +13 -1
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +16 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +5 -631
- package/dist/m365/teams/commands/chat/chat-message-list.js +43 -4
- package/dist/utils/entraApp.js +9 -2
- package/dist/utils/spfx.js +59 -0
- package/docs/docs/cmd/entra/license/license-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx +19 -0
- package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-license-add.mdx +19 -0
- package/docs/docs/cmd/entra/user/user-license-list.mdx +18 -1
- package/docs/docs/cmd/entra/user/user-license-remove.mdx +21 -0
- package/docs/docs/cmd/outlook/event/event-cancel.mdx +85 -0
- package/docs/docs/cmd/outlook/event/event-remove.mdx +85 -0
- package/docs/docs/cmd/teams/chat/chat-message-list.mdx +23 -2
- package/package.json +2 -1
|
@@ -5,6 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _EntraUserLicenseAddCommand_instances, _EntraUserLicenseAddCommand_initTelemetry, _EntraUserLicenseAddCommand_initOptions, _EntraUserLicenseAddCommand_initValidators, _EntraUserLicenseAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
8
9
|
import { validation } from '../../../../utils/validation.js';
|
|
9
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
11
|
import commands from '../../commands.js';
|
|
@@ -27,7 +28,7 @@ class EntraUserLicenseAddCommand extends GraphCommand {
|
|
|
27
28
|
const addLicenses = args.options.ids.split(',').map(x => { return { "disabledPlans": [], "skuId": x }; });
|
|
28
29
|
const requestBody = { "addLicenses": addLicenses, "removeLicenses": [] };
|
|
29
30
|
const requestOptions = {
|
|
30
|
-
url: `${this.resource}/v1.0/users/${args.options.userId || args.options.userName}/assignLicense`,
|
|
31
|
+
url: `${this.resource}/v1.0/users/${formatting.encodeQueryParameter(args.options.userId || args.options.userName)}/assignLicense`,
|
|
31
32
|
headers: {
|
|
32
33
|
accept: 'application/json;odata.metadata=none'
|
|
33
34
|
},
|
|
@@ -4,13 +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 _EntraUserLicenseListCommand_instances, _EntraUserLicenseListCommand_initTelemetry, _EntraUserLicenseListCommand_initOptions, _EntraUserLicenseListCommand_initValidators, _EntraUserLicenseListCommand_initOptionSets;
|
|
7
|
-
import { accessToken } from '../../../../utils/accessToken.js';
|
|
8
7
|
import { odata } from '../../../../utils/odata.js';
|
|
8
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
|
-
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
10
|
import commands from '../../commands.js';
|
|
12
|
-
import
|
|
13
|
-
class EntraUserLicenseListCommand extends
|
|
11
|
+
import GraphDelegatedCommand from '../../../base/GraphDelegatedCommand.js';
|
|
12
|
+
class EntraUserLicenseListCommand extends GraphDelegatedCommand {
|
|
14
13
|
get name() {
|
|
15
14
|
return commands.USER_LICENSE_LIST;
|
|
16
15
|
}
|
|
@@ -29,16 +28,12 @@ class EntraUserLicenseListCommand extends GraphCommand {
|
|
|
29
28
|
__classPrivateFieldGet(this, _EntraUserLicenseListCommand_instances, "m", _EntraUserLicenseListCommand_initOptionSets).call(this);
|
|
30
29
|
}
|
|
31
30
|
async commandAction(logger, args) {
|
|
32
|
-
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[this.resource].accessToken);
|
|
33
|
-
if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName) {
|
|
34
|
-
this.handleError(`Specify at least 'userId' or 'userName' when using application permissions.`);
|
|
35
|
-
}
|
|
36
31
|
if (this.verbose) {
|
|
37
32
|
await logger.logToStderr(`Retrieving licenses from user: ${args.options.userId || args.options.userName || 'current user'}.`);
|
|
38
33
|
}
|
|
39
34
|
let requestUrl = `${this.resource}/v1.0/`;
|
|
40
35
|
if (args.options.userId || args.options.userName) {
|
|
41
|
-
requestUrl += `users/${args.options.userId || args.options.userName}`;
|
|
36
|
+
requestUrl += `users/${formatting.encodeQueryParameter(args.options.userId || args.options.userName)}`;
|
|
42
37
|
}
|
|
43
38
|
else {
|
|
44
39
|
requestUrl += 'me';
|
|
@@ -7,6 +7,7 @@ var _EntraUserLicenseRemoveCommand_instances, _EntraUserLicenseRemoveCommand_ini
|
|
|
7
7
|
import commands from '../../commands.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
11
|
import { cli } from '../../../../cli/cli.js';
|
|
11
12
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
13
|
class EntraUserLicenseRemoveCommand extends GraphCommand {
|
|
@@ -42,7 +43,7 @@ class EntraUserLicenseRemoveCommand extends GraphCommand {
|
|
|
42
43
|
const removeLicenses = args.options.ids.split(',');
|
|
43
44
|
const requestBody = { "addLicenses": [], "removeLicenses": removeLicenses };
|
|
44
45
|
const requestOptions = {
|
|
45
|
-
url: `${this.resource}/v1.0/users/${args.options.userId || args.options.userName}/assignLicense`,
|
|
46
|
+
url: `${this.resource}/v1.0/users/${formatting.encodeQueryParameter(args.options.userId || args.options.userName)}/assignLicense`,
|
|
46
47
|
headers: {
|
|
47
48
|
accept: 'application/json;odata.metadata=none'
|
|
48
49
|
},
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import auth from '../../../../Auth.js';
|
|
2
|
+
import request from '../../../../request.js';
|
|
3
|
+
import { accessToken } from '../../../../utils/accessToken.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 { globalOptionsZod } from '../../../../Command.js';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
id: z.string().alias('i'),
|
|
13
|
+
userId: z.string().refine(id => validation.isValidGuid(id), {
|
|
14
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
15
|
+
}).optional(),
|
|
16
|
+
userName: z.string()
|
|
17
|
+
.refine(upn => validation.isValidUserPrincipalName(upn) === true, {
|
|
18
|
+
error: e => `'${e.input}' is not a valid user principal name for option 'userName'.`
|
|
19
|
+
})
|
|
20
|
+
.optional(),
|
|
21
|
+
comment: z.string().optional(),
|
|
22
|
+
force: z.boolean().optional().alias('f')
|
|
23
|
+
});
|
|
24
|
+
class OutlookEventCancelCommand extends GraphCommand {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands.EVENT_CANCEL;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Cancels a calendar event';
|
|
30
|
+
}
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
getRefinedSchema(schema) {
|
|
35
|
+
return schema
|
|
36
|
+
.refine(options => !(options.userId && options.userName), {
|
|
37
|
+
error: `Specify either 'userId' or 'userName', but not both.`
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async commandAction(logger, args) {
|
|
41
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
|
|
42
|
+
let principalUrl = '';
|
|
43
|
+
const token = auth.connection.accessTokens[auth.defaultResource].accessToken;
|
|
44
|
+
if (isAppOnlyAccessToken) {
|
|
45
|
+
if (!args.options.userId && !args.options.userName) {
|
|
46
|
+
throw `The option 'userId' or 'userName' is required when cancelling an event using application permissions.`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
if (args.options.userId) {
|
|
51
|
+
const currentUserId = accessToken.getUserIdFromAccessToken(token);
|
|
52
|
+
if (args.options.userId !== currentUserId) {
|
|
53
|
+
throw `You can only cancel your own events when using delegated permissions. The specified userId '${args.options.userId}' does not match the current user '${currentUserId}'.`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (args.options.userName) {
|
|
57
|
+
const currentUserName = accessToken.getUserNameFromAccessToken(token);
|
|
58
|
+
if (args.options.userName.toLowerCase() !== currentUserName.toLowerCase()) {
|
|
59
|
+
throw `You can only cancel your own events when using delegated permissions. The specified userName '${args.options.userName}' does not match the current user '${currentUserName}'.`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (args.options.userId || args.options.userName) {
|
|
64
|
+
const userIdentifier = args.options.userId ?? args.options.userName;
|
|
65
|
+
principalUrl += `users('${userIdentifier}')`;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
principalUrl += 'me';
|
|
69
|
+
}
|
|
70
|
+
const cancelEvent = async () => {
|
|
71
|
+
try {
|
|
72
|
+
if (this.verbose) {
|
|
73
|
+
await logger.logToStderr(`Cancelling event with id '${args.options.id}'...`);
|
|
74
|
+
}
|
|
75
|
+
const requestOptions = {
|
|
76
|
+
url: `${this.resource}/v1.0/${principalUrl}/events/${args.options.id}/cancel`,
|
|
77
|
+
headers: {
|
|
78
|
+
accept: 'application/json;odata.metadata=none',
|
|
79
|
+
'content-type': 'application/json'
|
|
80
|
+
},
|
|
81
|
+
data: {
|
|
82
|
+
comment: args.options.comment
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
await request.post(requestOptions);
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
this.handleRejectedODataJsonPromise(err);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
if (args.options.force) {
|
|
92
|
+
await cancelEvent();
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to cancel event with id '${args.options.id}'?` });
|
|
96
|
+
if (result) {
|
|
97
|
+
await cancelEvent();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export default new OutlookEventCancelCommand();
|
|
103
|
+
//# sourceMappingURL=event-cancel.js.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import auth from '../../../../Auth.js';
|
|
2
|
+
import request from '../../../../request.js';
|
|
3
|
+
import { accessToken } from '../../../../utils/accessToken.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 { globalOptionsZod } from '../../../../Command.js';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
id: z.string().alias('i'),
|
|
13
|
+
userId: z.string().refine(id => validation.isValidGuid(id), {
|
|
14
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
15
|
+
}).optional(),
|
|
16
|
+
userName: z.string()
|
|
17
|
+
.refine(upn => validation.isValidUserPrincipalName(upn) === true, {
|
|
18
|
+
error: e => `'${e.input}' is not a valid user principal name for option 'userName'.`
|
|
19
|
+
})
|
|
20
|
+
.optional(),
|
|
21
|
+
permanent: z.boolean().optional(),
|
|
22
|
+
force: z.boolean().optional().alias('f')
|
|
23
|
+
});
|
|
24
|
+
class OutlookEventRemoveCommand extends GraphCommand {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands.EVENT_REMOVE;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Removes an event from a calendar';
|
|
30
|
+
}
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
getRefinedSchema(schema) {
|
|
35
|
+
return schema.refine(options => !options.userId || !options.userName, {
|
|
36
|
+
error: 'Specify either userId or userName, but not both.'
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async commandAction(logger, args) {
|
|
40
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
|
|
41
|
+
const token = auth.connection.accessTokens[auth.defaultResource].accessToken;
|
|
42
|
+
if (isAppOnlyAccessToken) {
|
|
43
|
+
if (!args.options.userId && !args.options.userName) {
|
|
44
|
+
throw `The option 'userId' or 'userName' is required when removing an event using application permissions.`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
if (args.options.userId) {
|
|
49
|
+
const currentUserId = accessToken.getUserIdFromAccessToken(token);
|
|
50
|
+
if (args.options.userId !== currentUserId) {
|
|
51
|
+
throw `You can only remove your own events when using delegated permissions. The specified userId '${args.options.userId}' does not match the current user '${currentUserId}'.`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (args.options.userName) {
|
|
55
|
+
const currentUserName = accessToken.getUserNameFromAccessToken(token);
|
|
56
|
+
if (args.options.userName.toLowerCase() !== currentUserName.toLowerCase()) {
|
|
57
|
+
throw `You can only remove your own events when using delegated permissions. The specified userName '${args.options.userName}' does not match the current user '${currentUserName}'.`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
let principalUrl = '';
|
|
62
|
+
const userIdentifier = args.options.userId ?? args.options.userName;
|
|
63
|
+
if (userIdentifier) {
|
|
64
|
+
principalUrl += `users('${userIdentifier}')`;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
principalUrl += 'me';
|
|
68
|
+
}
|
|
69
|
+
const removeEvent = async () => {
|
|
70
|
+
try {
|
|
71
|
+
if (this.verbose) {
|
|
72
|
+
await logger.logToStderr(`Removing event with id '${args.options.id}'...`);
|
|
73
|
+
}
|
|
74
|
+
const requestOptions = {
|
|
75
|
+
url: `${this.resource}/v1.0/${principalUrl}/events/${args.options.id}`,
|
|
76
|
+
headers: {
|
|
77
|
+
accept: 'application/json;odata.metadata=none'
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
if (args.options.permanent) {
|
|
81
|
+
requestOptions.url += '/permanentDelete';
|
|
82
|
+
await request.post(requestOptions);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
await request.delete(requestOptions);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
this.handleRejectedODataJsonPromise(err);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
if (args.options.force) {
|
|
93
|
+
await removeEvent();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove event with id '${args.options.id}'?` });
|
|
97
|
+
if (result) {
|
|
98
|
+
await removeEvent();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export default new OutlookEventRemoveCommand();
|
|
104
|
+
//# sourceMappingURL=event-remove.js.map
|
|
@@ -4,7 +4,9 @@ export default {
|
|
|
4
4
|
CALENDAR_GET: `${prefix} calendar get`,
|
|
5
5
|
CALENDAR_REMOVE: `${prefix} calendar remove`,
|
|
6
6
|
CALENDARGROUP_LIST: `${prefix} calendargroup list`,
|
|
7
|
+
EVENT_CANCEL: `${prefix} event cancel`,
|
|
7
8
|
EVENT_LIST: `${prefix} event list`,
|
|
9
|
+
EVENT_REMOVE: `${prefix} event remove`,
|
|
8
10
|
MAIL_SEARCHFOLDER_ADD: `${prefix} mail searchfolder add`,
|
|
9
11
|
MAIL_SEND: `${prefix} mail send`,
|
|
10
12
|
MAILBOX_SETTINGS_GET: `${prefix} mailbox settings get`,
|