forked from mystiq/hydrogen-web
Add more hs api
This commit is contained in:
parent
bebbbd9db0
commit
eb51e76f9d
1 changed files with 13 additions and 0 deletions
|
@ -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 a new issue