Commit graph

15 commits

Author SHA1 Message Date
Johann150 2c3f731ae2
remove more default exports 2023-05-19 23:08:06 +02:00
Andy 7685b92511
improve fetching of endpoint arguments
including support for route parameters (e.g. '/v2/note/:noteId' giving us a 'noteId' value)

Co-authored-by: Johann150 <johann.galle@protonmail.com>
2022-12-22 11:02:04 +01:00
Johann150 bd68096ea9
server: refactor API error 2022-12-19 21:24:39 +01:00
Johann150 735b9ab502
fix some lints
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
2022-10-28 16:57:56 +02:00
Johann150 934ee82b8f
server: refactor ApiError to store error descriptions centrally
The UUIDs are no longer used for errors and all errors should now have
a descriptive message attached to them. Also, all errors should now have
the proper HTTP status code for a reply instead of the generic 400 and 500
response codes. Because the errors all have more specific error codes, the
"kind" of client or server is also abolished.
2022-10-27 22:43:58 +02:00
Johann150 66d7b69377
server: refactor API handler and returning errors
This refactors the API handler to not use default exports, be async
instead of constructing a promise and modify how errors are returned.
2022-10-26 23:15:31 +02:00
Johann150 edac21e8f7
improve authentication errors 2022-07-18 23:11:48 +02:00
Johann150 91bdab1a9d
add OAuth 2.0 Bearer Token authentication 2022-07-18 23:11:39 +02:00
syuilo 45b36e8059
fix #8894 2022-07-13 12:45:24 +02:00
syuilo 4d8d9936f1
feat: allow GET for some endpoints
Resolve #8263
2022-07-13 11:23:15 +02:00
syuilo d071d18dd7
refactor: Use ESM (#8358)
* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
2022-02-27 11:07:39 +09:00
syuilo 510de87607
refactor: use ajv instead of cafy (#8324)
* wip

* wip

* Update abuse-user-reports.ts

* Update files.ts

* Update list-remote.ts

* Update list.ts

* Update show-users.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update update.ts

* Update search.ts

* Update reactions.ts

* Update search.ts

* wip

* wip

* wip

* wip

* Update update.ts

* Update relation.ts

* Update available.ts

* wip

* wip

* wip

* Update packages/backend/src/server/api/define.ts

Co-authored-by: Johann150 <johann.galle@protonmail.com>

* Update define.ts

* Update define.ts

* typo

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update update.ts

* wip

* Update signup.ts

* Update call.ts

* minimum for limit

* type

* remove needless annotation

* wip

* Update signup.ts

* wip

* wip

* fix

* Update create.ts

Co-authored-by: Johann150 <johann.galle@protonmail.com>
2022-02-19 14:05:32 +09:00
MeiMei f2b40b51c2
refactor: APIで非JSON入力の型変換はendpointに渡す前に行うように (#8229)
* Resolve #8228

* fix
2022-01-31 01:40:27 +09:00
syuilo c69b72e199 fix lint 2021-12-09 23:58:30 +09:00
syuilo 0e4a111f81 refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00
Renamed from src/server/api/api-handler.ts (Browse further)