Commit graph

153 commits

Author SHA1 Message Date
RMidhunSuresh 9b315d1564 Replace object with Record 2021-12-03 11:40:26 +05:30
RMidhunSuresh 57d24dcf90 Treat wrapper hsapi as HomeServerApi 2021-12-03 11:40:26 +05:30
RMidhunSuresh 8387215efd Add comment 2021-12-03 11:40:26 +05:30
RMidhunSuresh 885abc59be Add return types 2021-12-03 11:40:26 +05:30
RMidhunSuresh 7403cbc389 WIP - HomeServerApi.js to ts conversion 2021-12-03 11:40:26 +05:30
RMidhunSuresh 145b40f28d Fomatting fix 2021-12-03 11:40:26 +05:30
RMidhunSuresh cf54b78af7 Convert RequestScheduler.js to ts 2021-12-03 11:40:26 +05:30
RMidhunSuresh 0aae31a450 Change year in copyright notice 2021-12-03 11:40:26 +05:30
RMidhunSuresh f120ce50e6 Convert Reconnector.js to ts 2021-12-03 11:40:26 +05:30
RMidhunSuresh 90e3fde35d Convert MediaRepository.js to ts 2021-12-03 11:40:26 +05:30
RMidhunSuresh ff53c2757d Convert HomeServerRequest.js to ts 2021-12-03 11:40:26 +05:30
RMidhunSuresh e1a823400a Convert ExponentialRetryDelay.js to ts 2021-12-03 11:40:26 +05:30
RMidhunSuresh 3a24019d96 Convert common.js to ts 2021-12-03 11:40:26 +05:30
RMidhunSuresh 9688a561b3 Move interface to common.ts 2021-12-03 11:40:26 +05:30
RMidhunSuresh 0c424cb77f Fix imports 2021-11-17 20:28:44 +05:30
RMidhunSuresh 4ce7634201 Convert error.js to ts 2021-11-17 20:28:44 +05:30
Bruno Windels c89e414bb5 WIP3 2021-10-27 15:08:53 +02:00
Bruno Windels 718b410253 WIP2 2021-10-27 10:26:36 +02:00
Bruno Windels faf4ea6434 WIP 2021-10-26 18:47:46 +02:00
Bruno Windels f998041748 add logout button in settings 2021-10-26 12:49:31 +02:00
Danila Fedorin a7360f409e Rename ObservableValue to TypeScript 2021-09-29 17:42:57 -07:00
Bruno Windels c7b47bb8d6 fix homeServer misspelling to homeserver across the project 2021-08-23 19:26:39 +02:00
RMidhunSuresh 83f4095d88 rename queryLogin to getLoginFlows
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:05:15 +05:30
RMidhunSuresh 66f28b90fc Implement token login
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:33 +05:30
RMidhunSuresh e0fcec9102 Add method to query login types
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:02 +05:30
RMidhunSuresh 6cfb4cfbe0 Support state events
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-02 17:50:09 +05:30
Bruno Windels edaac9f436 draft redaction support, no local echo yet 2021-05-20 12:50:16 +02:00
Bruno Windels 9679058081 allow to join room by id or alias 2021-05-18 11:05:31 +02:00
Bruno Windels b30b62416c add option to forget archived room 2021-05-12 15:38:54 +02:00
Bruno Windels 5ce138539b network calls to accept and reject invite 2021-04-20 19:02:45 +02:00
Bruno Windels 4b19e3c498 remove unused member 2021-04-09 16:27:25 +02:00
Bruno Windels 606e30fed2 make comment easier to read 2021-04-09 15:24:10 +02:00
Bruno Windels c36e812360 move RequestWrapper to own file
and add tests, improve comments, and and don't use timeout connection
error as that's not what happens if aborted request from service worker
is reported as TypeError either.
2021-04-09 15:15:28 +02:00
Bruno Windels 2b1f4866a9 map unexpected fetch AbortError to ConnectionError, so doesn't stop sync 2021-04-09 14:25:19 +02:00
Bruno Windels c06659c0be support checking if pusher is still present on server 2021-04-01 14:59:46 +02:00
Bruno Windels d4fc08c06b put pusher bits in separate class to enable and disable on the HS 2021-03-23 18:20:23 +01:00
Bruno Windels 0bd0f788e3 consider all server errors as connection errors
even if they do have an errcode

fixes #223
2021-03-09 12:51:34 +01:00
Bruno Windels a3987a655e log if a connection error is a timeout 2021-03-08 15:35:34 +01:00
Bruno Windels 7524a912c3 use (t)ype rather than kind 2021-02-18 12:44:19 +01:00
Bruno Windels a53c25d2ae support logging in hsApi 2021-02-12 18:35:33 +01:00
Bruno Windels bbab1e9ecc move base64/58 encoding into platform
fixes https://github.com/vector-im/hydrogen-web/issues/99
2021-02-12 16:01:54 +01:00
Bruno Windels ac1bbb3937 ensure thumbnail dimensions are integer, fixes #203 2021-02-11 11:15:20 +01:00
Bruno Windels 83cbe78cd6 report attachment upload progress 2020-11-16 10:45:46 +01:00
Bruno Windels 91f15074be /upload is on /media/r0, not /client/r0 2020-11-11 11:50:40 +01:00
Bruno Windels 2890a6aff7 implement attachment uploading in hs api rather than media repo
as we need the access token
2020-11-11 10:45:44 +01:00
Bruno Windels 9f2c7c1e32 support uploading blobs in hs api 2020-11-11 10:45:23 +01:00
Bruno Windels 2cfffa015d WIP 2020-11-10 22:36:26 +01:00
Bruno Windels 373a42c7a8 allow downloading plaintext attachments also, with or without cache 2020-11-10 17:49:48 +01:00
Bruno Windels e0c8be3a9a try to call out when #187 happens 2020-11-05 22:41:33 +01:00
Bruno Windels 16542284f3 fix #48 2020-11-05 21:24:14 +01:00
Bruno Windels 7d81306a49 return BufferHandles from the media repository
BufferHandles are platform specific handles to a buffer. On web,
they have a .blob and .url property.
2020-10-30 15:18:27 +01:00
Bruno Windels a3aa25449b make it work with xhr 2020-10-26 17:37:32 +01:00
Bruno Windels 3ed5ea8b0b Merge branch 'master' into bwindels/decrypt-images 2020-10-26 17:08:29 +01:00
Bruno Windels 03351d2e1f extract platform class to put all platform specific code in 2020-10-26 15:44:11 +01:00
Bruno Windels 4fd71279cf don't disable cache for media repository downloads 2020-10-26 09:58:39 +01:00
Bruno Windels 3a6268f0c1 basic PoC of image decryption working
needs looooaaads of cleanup still
2020-10-23 17:25:11 +02:00
Bruno Windels b1cb797919 fix refactor error in xhr, breaking it 2020-10-06 13:02:35 +02:00
Bruno Windels 5ae1be9a9c ignore invalid json on error pages 2020-10-05 17:18:05 +02:00
Bruno Windels e93b091566 dont use no-cache in fetch, as it doesn't play well with CORS on Safari 2020-10-02 14:02:59 +02:00
Bruno Windels 27a8ef4604 add comment how timeouts interact with the reconnector 2020-09-25 10:45:41 +02:00
Bruno Windels e175e9ac8b cleanup 2020-09-25 10:45:34 +02:00
Bruno Windels 137f55b44d manage request scheduler in session container
so we can start it before sync does its first request,
which otherwise gets aborted because the scheduler hasn't started yet
2020-09-22 16:39:41 +02:00
Bruno Windels 5660e0f4f0 rename send scheduler to request scheduler 2020-09-22 15:49:35 +02:00
Bruno Windels d7c25e3106 move MediaRepository out of HomeServerApi
so HomeServerApi becomes easier to wrap, only having methods
that return a RequestResult.
2020-09-22 13:40:38 +02:00
Bruno Windels 8cf29e344b don't send access token on /versions
as it's not a good idea, and some CORS configs might not be happy with
an Authorization header on that path
2020-09-18 18:13:20 +02:00
Bruno Windels a205ae8841 fixes 2020-09-17 17:57:12 +02:00
Bruno Windels 3941af93d2 more impl of SessionBackup 2020-09-17 14:19:57 +02:00
Bruno Windels dea9fd90b4 name devices at login "Hydrogen"
so you can somewhat identify them in a device list
2020-09-08 10:53:15 +02:00
Bruno Windels 5cafef96f5 add RoomEncryption to room 2020-09-03 15:36:17 +02:00
Bruno Windels 2a40c89a24 implement hsapi /keys/claim endpoint 2020-09-03 15:33:23 +02:00
Bruno Windels 4ef5d4b3b8 implement hsapi /keys/query method 2020-08-31 14:24:09 +02:00
Bruno Windels 4c290f0394 upload identity and one-time keys 2020-08-27 19:13:24 +02:00
Bruno Windels 2bfbb41ee7 send receipt to server when clearing unread state so notif count clears 2020-08-21 15:16:57 +02:00
Bruno Windels 5d0ee21267 move mxcUrl functions to media repo class 2020-08-20 15:40:43 +02:00
Bruno Windels a5595570f9 members hs api call 2020-08-19 16:11:33 +02:00
Bruno Windels 1699600ffc fix test 2020-08-05 19:06:54 +02:00
Bruno Windels 3154b047a6 Merge branch 'bwindels/ie11' of github.com:vector-im/hydrogen-web into bwindels/ie11 2020-08-05 19:02:42 +02:00
Bruno Windels d0ba894e2d apply new license headers in new code 2020-08-05 18:59:16 +02:00
Bruno Windels 5ddc02ebc8 XHR request support for legacy browsers 2020-08-05 18:56:06 +02:00
Bruno Windels e8e9740521 Move timeout to fetch, as XHR has native timeout support 2020-08-05 18:56:06 +02:00
Bruno Windels 00a85697ab add license header in all source files 2020-08-05 18:38:55 +02:00
Bruno Windels 69142909d9 XHR request support for legacy browsers 2020-08-05 15:37:37 +00:00
Bruno Windels b26bc69042 Move timeout to fetch, as XHR has native timeout support 2020-08-05 15:36:44 +00:00
Bruno Windels 7f221cda65 show images intimeline 2020-05-09 20:02:08 +02:00
Bruno Windels 2010704f14 fix only reconnecting the first time 2020-05-06 20:58:48 +02:00
Bruno Windels f8f13f54be fix timeouts not working
and also not being handled in the Reconnector
2020-05-06 19:38:33 +02:00
Bruno Windels 0eefc88fe3 waitForRetry doesn't reject when aborted 2020-05-05 23:13:41 +02:00
Bruno Windels 8e9c76c26b options is the 5th arg 2020-05-05 23:13:05 +02:00
Bruno Windels 4de29779c7 also abort timeout timer when response is rejected 2020-05-05 23:12:46 +02:00
Bruno Windels f90b435362 No need for Offline state if we're always in Waiting really 2020-05-04 23:42:34 +02:00
Bruno Windels 08b1c02af7 remove start value, can be hardcoded for now
also fix params in wrong order this way
2020-04-22 20:48:49 +02:00
Bruno Windels f826258c75 null doesn't set queryParams to {} here, so revert explicitly 2020-04-22 20:47:53 +02:00
Bruno Windels 174fd3ea4a don't assume options 2020-04-22 20:47:46 +02:00
Bruno Windels 3f840d9d33 simple unit test for hsApi 2020-04-22 20:47:31 +02:00
Bruno Windels 277c8af628 Headers is a DOM specific class, use Map instead in HomeServerApi 2020-04-22 20:46:47 +02:00
Bruno Windels 001dbefbcf stop using default exports
because it becomes hard to remember where you used them and where not
2020-04-20 21:26:39 +02:00
Bruno Windels 87b23d062c fix imports after reshuffleling 2020-04-20 19:47:45 +02:00
Bruno Windels 8c56ac3e4f rename NetworkError to ConnectionError 2020-04-19 19:05:12 +02:00
Bruno Windels 8c5411cb7d moar WIP 2020-04-19 19:02:10 +02:00
Bruno Windels 1f15ca6498 more WIP 2020-04-18 19:16:16 +02:00