Commit graph

29 commits

Author SHA1 Message Date
oxalica
c3842a6d3b feat(webapi): impl identity description retrieval 2024-10-18 11:12:29 -04:00
oxalica
1ecea448a2 refactor(webapi): move create-room endpoint and deprecate old one 2024-10-12 14:15:18 -04:00
oxalica
920a1cc3b9 feat(webapi): impl member information query 2024-10-12 14:14:39 -04:00
oxalica
8378c4d230 feat(webapi): impl member permission update 2024-10-12 14:14:39 -04:00
oxalica
d1dfda51db refactor(webapi): split /room/:rid/admin endpoint and deprecate
Since we alraedy use `/room/:rid/member`, member CRUD can use this path
for better semantics.

The `admin` endpoint will be removed later.
2024-10-12 14:13:30 -04:00
oxalica
ff7fd9e4b2 feat(webapi): include cid in ServerEvent::Msg 2024-10-08 21:20:20 -04:00
oxalica
367f6d2a4b feat(webapi): impl room member listing 2024-10-01 06:50:53 -04:00
oxalica
bc6e6c2056 refactor(webapi,types)!: make challenge type extensive
We may allow more challenge types other than PoW in the future, eg.
captcha. So make the relevent types more generic.

Now the challenge is returned in JSON response as a individual top-level
field `register_challenge` instead of in HTTP headers.
2024-10-01 05:26:00 -04:00
oxalica
76a9e501c5 doc: add server metadata API 2024-09-28 23:19:57 -04:00
oxalica
0911d56e22 refactor(blahd,webapi)!: overhaul error type
Error types are now collected into a single place. Similar errors are
merged.

Request invariant violations are now all under 400 with type
"invalid_request" if it's a client mistake; and if it's caused by a
server restrction, under 403 with type "disabled".
2024-09-24 19:12:56 -04:00
oxalica
5f03a4ca03 doc: fix missed Atom feed endpoint 2024-09-24 19:12:56 -04:00
oxalica
a7f31e5fad refactor(webapi)!: avoid u64/i64 usage in types except timestamp
We do not need that many big numbers yet. This should simplify client
implementation without native u64 (eg. JavaScript).

Also put a hard limit on `unseen_cnt` query.
2024-09-21 15:14:50 -04:00
oxalica
bc856f6c62 feat(webapi): impl room deletion 2024-09-21 14:46:47 -04:00
oxalica
0c28c00c3d refactor(webapi)!: put all API under path /_blah 2024-09-19 05:12:42 -04:00
oxalica
cb72d049e0 feat(types,webapi): impl id_key/act_key for all APIs and update docs 2024-09-17 21:44:36 -04:00
oxalica
fb76756482 feat(webapi): impl user registration and identity description format 2024-09-16 10:45:40 -04:00
oxalica
7f74d73c8c remove(webapi)!: remove auto user creation on joining or creating room
User must be explicitly created forehand using the registration API
(coming soon).
2024-09-16 06:41:26 -04:00
oxalica
985ea1d68a remove(types)!: remove members from CreateGroup
Now a group can only be created with the creator as the only initial
member. This forbids group creator from adding other members without
their consent. Additional members can join the group later at their own
will.
2024-09-16 06:39:10 -04:00
oxalica
93d1589730 refactor(types): WithSig -> Signed 2024-09-13 03:32:11 -04:00
oxalica
73eb441a26 refactor(*): use term msg to replace item
- `Msg` or `msg` is now the canonical term for the substructure in a
  room. It includes a `chat` subtype and (in the future) other
  administration subtypes like member joining or leaving.

- `Message` or `message` can used in human oriented context like docs
  and comments, but only when it is unambiguous.

- `message` is not chosen in code because it's hard to type (at least
  for me!), and have ambiguous meaning of:
  - "Human readable text" in context of `ApiError`'s field.
  - "A unit of data transfer, datagram" in context of WebSocket Message.

- `item` is not chosen because it is overly generic.
2024-09-13 03:32:11 -04:00
oxalica
1e944ead31 feat: impl basic peer chat 2024-09-10 12:26:37 -04:00
oxalica
9e96927693 doc: fix missed docs of member_permission 2024-09-10 12:16:48 -04:00
oxalica
74c6fa6f6a refactor(webapi): hoist RoomMetadata to blah_types and rename last_chat to last_item 2024-09-10 09:19:15 -04:00
oxalica
1a0347337c feat(webapi): differentiate no-room-permission from not-a-member error
- If a user is not a room member, HTTP 404 code=not_found will be
  returned. This also happen for posting into not-joined public rooms,
  and it can be interpreted as "room member is not found".

- If a user is a member but lacks the member permission to perform an
  action, HTTP 403 code=permission_denied will be returned.
2024-09-10 08:19:44 -04:00
oxalica
7160e5adbd refactor: reorganize docs and aux files 2024-09-10 03:59:31 -04:00
oxalica
668b873b07 Reorganize workspace layout and split out blahd 2024-08-31 00:04:16 -04:00
oxalica
370722731b Simplify rich text on-wire format 2024-08-30 13:05:29 -04:00
oxalica
c492bb2537 Use rich text format for chat 2024-08-30 12:26:45 -04:00
oxalica
4d3371e485 Add draft API docs 2024-08-29 20:50:03 -04:00