mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-25 12:35:01 +01:00
Add more hs api
This commit is contained in:
parent
bebbbd9db0
commit
eb51e76f9d
@ -271,6 +271,12 @@ export class HomeServerApi {
|
|||||||
return this._post(`/join/${encodeURIComponent(roomIdOrAlias)}`, {}, {}, options);
|
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 {
|
leave(roomId: string, options?: BaseRequestOptions): IHomeServerRequest {
|
||||||
return this._post(`/rooms/${encodeURIComponent(roomId)}/leave`, {}, {}, options);
|
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);
|
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 {
|
profile(userId: string, options?: BaseRequestOptions): IHomeServerRequest {
|
||||||
return this._get(`/profile/${encodeURIComponent(userId)}`);
|
return this._get(`/profile/${encodeURIComponent(userId)}`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user