Add more hs api

This commit is contained in:
Ajay Bura 2022-06-29 15:58:29 +05:30
parent bebbbd9db0
commit eb51e76f9d

View file

@ -271,6 +271,12 @@ export class HomeServerApi {
return this._post(`/join/${encodeURIComponent(roomIdOrAlias)}`, {}, {}, options);
}
invite(roomId: string, userId: string, options?: BaseRequestOptions): IHomeServerRequest {
return this._post(`/rooms/${encodeURIComponent(roomId)}/invite`, {}, {
user_id: userId
}, options);
}
leave(roomId: string, options?: BaseRequestOptions): IHomeServerRequest {
return this._post(`/rooms/${encodeURIComponent(roomId)}/leave`, {}, {}, options);
}
@ -298,6 +304,13 @@ export class HomeServerApi {
return this._post(`/dehydrated_device/claim`, {}, {device_id: deviceId}, options);
}
searchProfile(searchTerm: string, limit?: number, options?: BaseRequestOptions): IHomeServerRequest {
return this._post(`/user_directory/search`, {}, {
limit: limit ?? 10,
search_term: searchTerm,
}, options);
}
profile(userId: string, options?: BaseRequestOptions): IHomeServerRequest {
return this._get(`/profile/${encodeURIComponent(userId)}`);
}