File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ export default class Client {
38
38
return this . get ( URL . profile ( userId ) ) ;
39
39
}
40
40
41
+ public getGroupMemberProfile ( groupId : string , userId : string ) : Promise < Line . Profile > {
42
+ return this . get ( URL . groupMemberProfile ( groupId , userId ) ) ;
43
+ }
44
+
45
+ public getRoomMemberProfile ( roomId : string , userId : string ) : Promise < Line . Profile > {
46
+ return this . get ( URL . roomMemberProfile ( roomId , userId ) ) ;
47
+ }
48
+
41
49
public getMessageContent ( messageId : string ) : NodeJS . ReadableStream {
42
50
return this . stream ( URL . content ( messageId ) ) ;
43
51
}
Original file line number Diff line number Diff line change @@ -7,5 +7,7 @@ export const push: string = apiURL("message/push");
7
7
export const multicast : string = apiURL ( "message/multicast" ) ;
8
8
export const content = ( messageId : string ) => apiURL ( `message/${ messageId } /content` ) ;
9
9
export const profile = ( userId : string ) => apiURL ( `profile/${ userId } ` ) ;
10
+ export const groupMemberProfile = ( groupId : string , userId : string ) => apiURL ( `group/${ groupId } /member/${ userId } ` ) ;
11
+ export const roomMemberProfile = ( roomId : string , userId : string ) => apiURL ( `room/${ roomId } /member/${ userId } ` ) ;
10
12
export const leaveGroup = ( groupId : string ) => apiURL ( `group/${ groupId } /leave` ) ;
11
13
export const leaveRoom = ( roomId : string ) => apiURL ( `room/${ roomId } /leave` ) ;
Original file line number Diff line number Diff line change @@ -59,6 +59,24 @@ describe("client", () => {
59
59
} ) ;
60
60
} ) ;
61
61
62
+ it ( "getGroupMemberProfile" , ( ) => {
63
+ return client . getGroupMemberProfile ( "test_group_id" , "test_user_id" )
64
+ . then ( ( res : any ) => {
65
+ equal ( res . headers . authorization , "Bearer test_channel_access_token" ) ;
66
+ equal ( res . path , "/group/test_group_id/member/test_user_id" ) ;
67
+ equal ( res . method , "GET" ) ;
68
+ } ) ;
69
+ } ) ;
70
+
71
+ it ( "getRoomMemberProfile" , ( ) => {
72
+ return client . getRoomMemberProfile ( "test_room_id" , "test_user_id" )
73
+ . then ( ( res : any ) => {
74
+ equal ( res . headers . authorization , "Bearer test_channel_access_token" ) ;
75
+ equal ( res . path , "/room/test_room_id/member/test_user_id" ) ;
76
+ equal ( res . method , "GET" ) ;
77
+ } ) ;
78
+ } ) ;
79
+
62
80
it ( "getMessageContent" , ( ) => {
63
81
const s = client . getMessageContent ( "test_message_id" ) ;
64
82
return getStreamData ( s )
You can’t perform that action at this time.
0 commit comments